id-pbuild.sh: call mk-deb-src when running as normal user
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 17 Oct 2011 08:44:48 +0000 (10:44 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 17 Oct 2011 08:44:48 +0000 (10:44 +0200)
id-deb-build/id-pbuild.sh

index fdb1442..b1d586a 100755 (executable)
@@ -72,13 +72,20 @@ if test ! -x $MKDEBSRC; then
     exit 1
 fi
 
-if test -d deb-src; then
+if $upload; then
     cd deb-src
 else
-    $MKDEBSRC
-fi
-
-if test -d deb-src; then
+    if test "${SUDO_USER}"; then
+       if test ! -d deb-src; then
+           $MKDEBSRC
+       fi
+    else
+       if test -d deb-src; then
+           echo "Remove deb-src"
+           exit 1
+       fi
+       $MKDEBSRC
+    fi
     cd deb-src
 fi