sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cheol...@apache.org
Subject git commit: SQOOP-835: Do not recreate package-info.java each compilation
Date Tue, 22 Jan 2013 18:03:12 GMT
Updated Branches:
  refs/heads/sqoop2 a8cb99e7c -> acfc0ae02


SQOOP-835: Do not recreate package-info.java each compilation

(Jarek Jarcec Cecho via Cheolsoo Park)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/acfc0ae0
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/acfc0ae0
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/acfc0ae0

Branch: refs/heads/sqoop2
Commit: acfc0ae02a8ab98485f75c380b2299d7c2158040
Parents: a8cb99e
Author: Cheolsoo Park <cheolsoo@apache.org>
Authored: Tue Jan 22 10:02:23 2013 -0800
Committer: Cheolsoo Park <cheolsoo@apache.org>
Committed: Tue Jan 22 10:02:23 2013 -0800

----------------------------------------------------------------------
 common/src/saveVersion.sh |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/acfc0ae0/common/src/saveVersion.sh
----------------------------------------------------------------------
diff --git a/common/src/saveVersion.sh b/common/src/saveVersion.sh
index 38661a3..31d3a33 100755
--- a/common/src/saveVersion.sh
+++ b/common/src/saveVersion.sh
@@ -21,10 +21,19 @@
 unset LANG
 unset LC_CTYPE
 version=$1
-outputDirectory=$2
+targetDirectory=$2
+outputDirectory="$targetDirectory/org/apache/sqoop/common"
+outputFile="$outputDirectory/package-info.java"
 user=`whoami`
 date=`date`
 cwd=`pwd`
+
+# Exit if target file already exists
+if [ -e $outputFile ]; then
+  exit 0
+fi
+
+# Create version annotation
 if [ -d .svn ]; then
   revision=`svn info | sed -n -e 's/Last Changed Rev: \(.*\)/\1/p'`
   url=`svn info | sed -n -e 's/URL: \(.*\)/\1/p'`
@@ -36,8 +45,8 @@ else
   revision="Unknown"
   url="file://$cwd"
 fi
-mkdir -p "$outputDirectory/org/apache/sqoop/common"
-cat >"$outputDirectory/org/apache/sqoop/common/package-info.java" <<EOF
+mkdir -p $outputDirectory
+cat > $outputFile <<EOF
 /*
  * Generated by src/saveVersion.sh
  */


Mime
View raw message