3 # This file is used to generate the annotation of package info that
4 # records the user, url, revision and timestamp.
6 # Licensed to the Apache Software Foundation (ASF) under one or more
7 # contributor license agreements. See the NOTICE file distributed with
8 # this work for additional information regarding copyright ownership.
9 # The ASF licenses this file to You under the Apache License, Version 2.0
10 # (the "License"); you may not use this file except in compliance with
11 # the License. You may obtain a copy of the License at
13 # http://www.apache.org/licenses/LICENSE-2.0
15 # Unless required by applicable law or agreed to in writing, software
16 # distributed under the License is distributed on an "AS IS" BASIS,
17 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 # See the License for the specific language governing permissions and
19 # limitations under the License.
34 revision
=`svn info | sed -n -e 's/Last Changed Rev: \(.*\)/\1/p'`
35 url
=`svn info | sed -n -e 's/^URL: \(.*\)/\1/p'`
36 elif [ -d .git
]; then
37 revision
=`git log -1 --pretty=format:"%H"`
39 url
="git://${hostname}${cwd}"
44 which md5sum > /dev
/null
45 if [ "$?" != "0" ] ; then
47 if [ "$?" != "0" ] ; then
50 srcChecksum
=`find hbase-*/src/main/ | grep -e "\.java" -e "\.proto" | LC_ALL=C sort | xargs md5 | md5 | cut -d ' ' -f 1`
53 srcChecksum
=`find hbase-*/src/main/ | grep -e "\.java" -e "\.proto" | LC_ALL=C sort | xargs md5sum | md5sum | cut -d ' ' -f 1`
57 mkdir
-p "$outputDirectory/org/apache/hadoop/hbase"
58 cat >"$outputDirectory/org/apache/hadoop/hbase/package-info.java" <<EOF
60 * Generated by src/saveVersion.sh
62 @VersionAnnotation(version="$version", revision="$revision",
63 user="$user", date="$date", url="$url",
64 srcChecksum="$srcChecksum")
65 package org.apache.hadoop.hbase;