aboutsummaryrefslogtreecommitdiff
path: root/pdebuild-internal
diff options
context:
space:
mode:
authordancer <dancer>2005-06-04 05:29:21 +0000
committerdancer <dancer>2005-06-04 05:29:21 +0000
commit03fe53317b305cac19716e6209a4ac60cba7d1fc (patch)
treeafaa719da0a801f7ef5a8783ed2c7aa9e4f2ea08 /pdebuild-internal
parentfe53d3f4e62498c8df21db6181d6e7f5f8fa4689 (diff)
downloadpbuilder-03fe53317b305cac19716e6209a4ac60cba7d1fc.tar
pbuilder-03fe53317b305cac19716e6209a4ac60cba7d1fc.tar.gz
+ * pdebuild-internal: implement with user-adding.
+
Diffstat (limited to 'pdebuild-internal')
-rw-r--r--pdebuild-internal48
1 files changed, 42 insertions, 6 deletions
diff --git a/pdebuild-internal b/pdebuild-internal
index 4a997f3..88f5f0d 100644
--- a/pdebuild-internal
+++ b/pdebuild-internal
@@ -34,12 +34,48 @@ apt-get install -y pbuilder
# I'm not going to have the same LOGNAME as outside, I'm root.
export LOGNAME=root
-if [ "$2" = "--debbuildopts" ]; then
- echo "Setting DEBBUILDOPTS=$3"
- DEBBUILDOPTS="$3"
-fi
-
cd "$1"
+shift;
+
+while [ -n "$1" ]; do
+ case "$1" in
+ --debbuildopts)
+ echo "Setting DEBBUILDOPTS=$2"
+ DEBBUILDOPTS="$2"
+ shift; shift;
+ ;;
+ --uid)
+ BUILDRESULTUID=$2
+ shift; shift;
+ ;;
+ --gid)
+ BUILDRESULTGID=$2
+ shift; shift;
+ ;;
+ --debug)
+ PBUILDER_DEBUGMODE=yes
+ set -x
+ shift;
+ ;;
+ --*)
+ echo "Error: Unknown option [$1] was specified " >&2
+ exit 1;
+ ;;
+ *)
+ break;
+ ;;
+ esac
+done
+
export PBCURRENTCOMMANDLINEOPERATION="pdebuild"
/usr/lib/pbuilder/pbuilder-satisfydepends
-/usr/bin/dpkg-buildpackage -us -uc ${DEBBUILDOPTS}
+apt-get install -y --force-yes fakeroot
+
+# create the user similar to that used outside
+groupadd -g "${BUILDRESULTGID}" -o pbgroup
+useradd -g pbgroup -u "${BUILDRESULTUID}" -o pbuser
+
+# what about id -G output? if other groups than the designated is used, we're stuffed.
+
+# do build with that user.
+echo /usr/bin/dpkg-buildpackage -rfakeroot -us -uc '${DEBBUILDOPTS}' | su pbuser