Browse Source

scripts: ipkg-build: do not require git or svn

Move the "which svn" and "which git" calls next to the timestamp commands
using those tools to not prematurely fail on systems where svn or git are
not present.

Signed-off-by: Jo-Philipp Wich <[email protected]>
Jo-Philipp Wich 9 years ago
parent
commit
3a3424981c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      scripts/ipkg-build

+ 2 - 2
scripts/ipkg-build

@@ -13,14 +13,14 @@ version=1.0
 FIND="$(which find)"
 FIND="$(which find)"
 FIND="${FIND:-$(which gfind)}"
 FIND="${FIND:-$(which gfind)}"
 TAR="${TAR:-$(which tar)}"
 TAR="${TAR:-$(which tar)}"
-SVN="$(which svn)"
-GIT="$(which git)"
 GZIP="$(which gzip)"
 GZIP="$(which gzip)"
 
 
 # look up date of last commit
 # look up date of last commit
 if [ -d "$TOPDIR/.git" ]; then
 if [ -d "$TOPDIR/.git" ]; then
+	GIT="$(which git)"
 	TIMESTAMP=$(cd $TOPDIR; $GIT log -1 -s --format=%ci)
 	TIMESTAMP=$(cd $TOPDIR; $GIT log -1 -s --format=%ci)
 elif [ -d "$TOPDIR/.svn" ]; then
 elif [ -d "$TOPDIR/.svn" ]; then
+	SVN="$(which svn)"
 	TIMESTAMP=$($SVN info "$TOPDIR" | sed -n "s/^Last Changed Date: \(.*\)/\1/p")
 	TIMESTAMP=$($SVN info "$TOPDIR" | sed -n "s/^Last Changed Date: \(.*\)/\1/p")
 else
 else
 	TIMESTAMP=$(date)
 	TIMESTAMP=$(date)