Allow usage with relative path to id-pbuild.sh
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 19 Sep 2011 18:33:43 +0000 (18:33 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 19 Sep 2011 18:33:43 +0000 (18:33 +0000)
The path to id-deb-build is made absolute before calling sudo.

id-deb-build/id-pbuild.sh

index 10b6578..fdb1442 100755 (executable)
@@ -58,13 +58,15 @@ if test "$do_help" = "yes"; then
     usage 1 1>&2
 fi
 
-PBUILDROOT=`dirname $0`/id-pbuild-root.sh
+D0=`dirname $0`
+ID_DEB_BUILD=`cd $D0; pwd`
+PBUILDROOT=${ID_DEB_BUILD}/id-pbuild-root.sh
 if test ! -x $PBUILDROOT; then
     echo "$PBUILDROOT not found"
     exit 1
 fi
 
-MKDEBSRC=`dirname $0`/id-mk-deb-src.sh
+MKDEBSRC=${ID_DEB_BUILD}/id-mk-deb-src.sh
 if test ! -x $MKDEBSRC; then
     echo "$MKDEBSRC not found"
     exit 1
@@ -108,7 +110,7 @@ echo "Debian distros: $DEBIAN_DIST"
 if test "${SUDO_USER}"; then
     echo "Running as sudo."
     echo "You can avoid it by adding the following in /etc/sudoers"
-    echo "${SUDO_USER} ALL=NOPASSWD: /home/${SUDO_USER}/proj/git-tools/id-deb-build/id-pbuild-root.sh"
+    echo "${SUDO_USER} ALL=NOPASSWD: ${ID_DEB_BUILD}/id-pbuild-root.sh"
     HOME_EXPORT=/home/${SUDO_USER}
 else
     HOME_EXPORT=$HOME