From 19947091bfd4b910fd42e6db329fc4e074ff854a Mon Sep 17 00:00:00 2001 From: dancer Date: Fri, 15 Feb 2002 13:49:49 +0000 Subject: updates, some potential changes. --- ChangeLog | 13 +++++++++++++ debian/changelog | 6 ++++-- pbuilder-buildpackage | 25 ++++++++++++++++++++----- pbuilder.1 | 12 ++++++++++++ pbuilderrc | 4 ++++ pbuilderrc.5 | 17 +++++++++++++++++ 6 files changed, 70 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 88fcce5..739eb89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2002-02-15 Junichi Uekawa + + * pbuilder.1: document updated, noting of minor details of + what option takes effect in what command. + + * pbuilder-buildpackage: changing it to use the specified uid. + EXTRAPACKAGES option is valued within "pbuilder build" + + * pbuilderrc.5: document BUILDUSERNAME, BUILDUSERID + + * pbuilderrc (BUILDUSERNAME): added + (BUILDUSERID): added + 2002-02-14 Junichi Uekawa * debian/TODO: document some known bugs and features. diff --git a/debian/changelog b/debian/changelog index 88cbbaf..56abde7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,9 +5,11 @@ pbuilder (0.23) unstable; urgency=low reported by Mark Brown (closes: #129053) (please test) * Fix update target to remove packages specified in REMOVEPACKAGES. - * pbuilder update requests apt-get to call dpkg with --force-confnew option + * Support building as non-root user, and using fakeroot inside + the chroot. (please test) + * EXTRAPACKAGES takes effect within the build target. (please test) - -- Junichi Uekawa Thu, 14 Feb 2002 20:32:58 +0900 + -- Junichi Uekawa Fri, 15 Feb 2002 21:23:22 +0900 pbuilder (0.22) unstable; urgency=low diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage index 5dd0e94..65fcb86 100755 --- a/pbuilder-buildpackage +++ b/pbuilder-buildpackage @@ -171,6 +171,8 @@ function checkbuilddep_internal () { function checkbuilddep () { checkbuilddep_internal + # install extra packages to the chroot + $CHROOTEXEC usr/bin/apt-get -y install ${EXTRAPACKAGES} } function echobacktime () { @@ -190,12 +192,25 @@ function saveaptcache_umountproc_cleanbuildplace () { umountproc_cleanbuildplace } +function createbuilduser () { + # create the build user + echo "$BUILDUSERNAME:x:$BUILDUSERID::/tmp/buildd:/bin/sh" >> $BUILDPLACE/etc/passwd + echo "$BUILDUSERNAME:x:$BUILDUSERID:" >> $BUILDPLACE/etc/group +} . /usr/lib/pbuilder/pbuilder-checkparams PACKAGENAME="$1" CHROOTEXEC="chroot $BUILDPLACE " - +if [ -n "$BUILDUSERNAME" -a -n "$BUILDUSERID" ]; then + SUTOUSER="su - $BUILDUSERNAME -- " + echo "I: using fakeroot in build." +else + # run the build in root + SUTOUSER="" + BUILDUSERID=0 + BUILDUSERNAME=root +fi if [ ! -f "$PACKAGENAME" ]; then echo "Command line parameter [$PACKAGENAME] is not a valid .dsc file name" >&2 exit 1; @@ -203,14 +218,14 @@ fi; showbuildbanner echobacktime - +createbuilduser extractbuildplace echo Copying source file copydsc "$PACKAGENAME" "$BUILDPLACE/tmp/buildd" echo Extracting source -if ! $CHROOTEXEC /bin/bash -c "( cd tmp/buildd; /usr/bin/dpkg-source -x $(basename $PACKAGENAME) )"; then - echo pbuilder: Failed extracting the source >&2 +if ! $CHROOTEXEC /bin/bash -c "( cd tmp/buildd; chown $BUILDUSERNAME:$BUILDUSERNAME *; $SUTOUSER /usr/bin/dpkg-source -x $(basename $PACKAGENAME) )"; then + echo "pbuilder: Failed extracting the source" >&2 umountproc_cleanbuildplace exit 1; fi @@ -224,7 +239,7 @@ echo " -> Building the package" export PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin" if [ -z "$DEBEMAIL" ]; then - if ! $CHROOTEXEC /bin/bash -c "cd tmp/buildd/*/; dpkg-buildpackage -us -uc $DEBBUILDOPTS"; then + if ! $CHROOTEXEC /bin/bash -c "cd tmp/buildd/*/; $SUTOUSER dpkg-buildpackage -us -uc $DEBBUILDOPTS"; then echo "pbuilder: Failed autobuilding of package" >&2 umountproc_cleanbuildplace exit 1; diff --git a/pbuilder.1 b/pbuilder.1 index 2f6c7e4..958a74c 100644 --- a/pbuilder.1 +++ b/pbuilder.1 @@ -70,6 +70,13 @@ This may change in the future. .BI "--basetgz [" "basetgz-location" "]" Specifies the location of .B "base.tgz" + +This option will define the default distribution and +apt-lines when used in +.B "pbuilder update" +and +.B "pbuilder create" + .TP .BI "--buildplace [" "location of build" "]" Specifies the location where building and @@ -153,6 +160,11 @@ surrounded in double quotations, like Adds packages specified as an addition to the default, which is .B build-essential +by default. +This is used in +.B build +and +.B create .TP .BI "--configfile [" "configuration file to load" "]" diff --git a/pbuilderrc b/pbuilderrc index dfbbbc8..1fd7ff0 100755 --- a/pbuilderrc +++ b/pbuilderrc @@ -37,3 +37,7 @@ DEBBUILDOPTS="-b" #APT configuration files directory APTCONFDIR="" + +# the username and ID used by pbuilder, inside chroot. Needs fakeroot, really +BUILDUSERID=1234 +#BUILDUSERNAME=pbuilder diff --git a/pbuilderrc.5 b/pbuilderrc.5 index 4ab5ab7..85688b2 100644 --- a/pbuilderrc.5 +++ b/pbuilderrc.5 @@ -21,6 +21,9 @@ This is overridden with the option Specifies extra packages which the system should install in the chroot on .BR "pbuilder create" "." +Also this is installed on +.B "pbuilder build" + .TP .BI "export DEBIAN_BUILDARCH=" "athlon" Uses this variable as @@ -157,6 +160,20 @@ in .B "pdebuild" +.TP +.BI "BUILDUSERID=" "1234" +The uid to be used inside chroot. +It should not collide with user-id outside the chroot. + +.TP +.BI "BUILDUSERNAME=" "pbuilder" +The user name of the user the build will run as. +Specifying this will enable the use of fakeroot inside +pbuilder. + +Note that this will require fakeroot to be installed within +the chroot. + .TP .BI "APTCONFDIR=" "/etc/apt" Configures where the apt configuration files are copied from. -- cgit v1.2.3