diff options
-rw-r--r-- | ChangeLog | 18 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | debian/pbuilder-uml.files | 3 | ||||
-rwxr-xr-x | pbuilder-checkparams | 10 | ||||
-rw-r--r-- | pbuilder-uml-checkparams | 158 | ||||
-rwxr-xr-x | pbuilder-user-mode-linux | 122 | ||||
-rw-r--r-- | pdebuild-user-mode-linux | 18 | ||||
-rw-r--r-- | pdebuild-user-mode-linux.1 | 15 |
9 files changed, 210 insertions, 142 deletions
@@ -1,3 +1,21 @@ +2004-07-29 Junichi Uekawa <dancer@debian.org> + + * debian/pbuilder-uml.files: add pbuilder-uml-checkparams + + * Makefile: add pbuilder-uml-checkparams + + * pdebuild-user-mode-linux.1: update manual to reflect + current reality of pdebuild-user-mode-linux. It was originally just a + copy of pdebuild manpage. + + * pbuilder-checkparams: shift around debootstrapopts parameter + processing out of pdebuild options; it doesn't belong there. + + * pdebuild-user-mode-linux: Call pbuilder-uml-checkparams to + parse commands in UML way, not pbuilder way. + * pbuilder-uml-checkparams: Move command-line parser to here + * pbuilder-user-mode-linux: Move command-line parser out + 2004-07-24 Junichi Uekawa <dancer@debian.org> * pbuilder-user-mode-linux.1: document dumpconfig. @@ -9,6 +9,7 @@ INSTALL_EXECUTABLE=install -m 0755 SHELLCODES=pbuilder-buildpackage \ pbuilder-buildpackage-funcs \ pbuilder-checkparams \ + pbuilder-uml-checkparams \ pbuilder-createbuildenv \ pbuilder-loadconfig \ pbuilder-modules \ @@ -58,6 +59,7 @@ install: $(INSTALL_EXECUTABLE) pbuilder-loadconfig $(DESTDIR)/usr/lib/pbuilder/ $(INSTALL_EXECUTABLE) pbuilder-runhooks $(DESTDIR)/usr/lib/pbuilder/ $(INSTALL_EXECUTABLE) pbuilder-checkparams $(DESTDIR)/usr/lib/pbuilder/ + $(INSTALL_EXECUTABLE) pbuilder-uml-checkparams $(DESTDIR)/usr/lib/pbuilder/ $(INSTALL_EXECUTABLE) pbuilder-modules $(DESTDIR)/usr/lib/pbuilder/ $(INSTALL_EXECUTABLE) pbuilder $(DESTDIR)/usr/sbin $(INSTALL_EXECUTABLE) pdebuild $(DESTDIR)/usr/bin diff --git a/debian/changelog b/debian/changelog index bd916d9..bc73f9b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +pbuilder (0.113) UNRELEASED; urgency=low + + * pdebuild UML fix (closes: #250526) + + -- Junichi Uekawa <dancer@debian.org> Thu, 29 Jul 2004 08:20:05 +0900 + pbuilder (0.112) unstable; urgency=low * Added dumpconfig command-line operation for debugging. diff --git a/debian/pbuilder-uml.files b/debian/pbuilder-uml.files index 14f8bbf..746ee59 100644 --- a/debian/pbuilder-uml.files +++ b/debian/pbuilder-uml.files @@ -1,4 +1,5 @@ etc/pbuilder/pbuilder-uml.conf usr/share/pbuilder/pbuilder-uml.conf usr/bin/pbuilder-user-mode-linux -usr/bin/pdebuild-user-mode-linux
\ No newline at end of file +usr/bin/pdebuild-user-mode-linux +usr/lib/pbuilder/pbuilder-uml-checkparams
\ No newline at end of file diff --git a/pbuilder-checkparams b/pbuilder-checkparams index 00adfbf..40797ad 100755 --- a/pbuilder-checkparams +++ b/pbuilder-checkparams @@ -156,6 +156,11 @@ while [ -n "$1" ]; do BINDMOUNTS="${BINDMOUNTS} $2" shift; shift; ;; + --debootstrapopts) + # specify this option to set --variant=buildd value to debootstrap + DEBOOTSTRAPOPTS[${#DEBOOTSTRAPOPTS[@]}]="$2"; + shift; shift; + ;; ## pdebuild option --auto-debsign) AUTO_DEBSIGN="yes" @@ -173,11 +178,6 @@ while [ -n "$1" ]; do USE_PDEBUILD_INTERNAL=yes; shift; ;; - --debootstrapopts) - # specify this option to set --variant=buildd value to debootstrap - DEBOOTSTRAPOPTS[${#DEBOOTSTRAPOPTS[@]}]="$2"; - shift; shift; - ;; ## internal options. --internal-chrootexec) # specify custom chrootexec function -- this is internal debugging function diff --git a/pbuilder-uml-checkparams b/pbuilder-uml-checkparams new file mode 100644 index 0000000..b940e71 --- /dev/null +++ b/pbuilder-uml-checkparams @@ -0,0 +1,158 @@ +#! /bin/bash +# pbuilder-user-mode-linux -- personal Debian package builder +# Copyright (C) 2004 Junichi Uekawa +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# load and check params. +# requires +# . /usr/lib/pbuilder/pbuilder-loadconfig + +for SYSTEM_CONFIG in /usr/share/pbuilder/pbuilder-uml.conf /etc/pbuilder/pbuilder-uml.conf ${HOME}/.pbuilderrc; do + if [ -f ${SYSTEM_CONFIG} ]; then + . ${SYSTEM_CONFIG} + fi +done + + +PBUILDER_COW="" +UML_EXTRAOPT= +UML_DEBUGMODE= +UML_EXECUTE_EXTRAOPT= +UML_LOGIN_NOCOW= + +while [ -n "$1" ] ; do + case "$1" in + --eth0) + MY_ETH0="$2"; + shift; shift; + ;; + --uml-ip) + UML_IP="$2"; + shift; shift; + ;; + --uml-netmask) + UML_NETMASK="$2"; + shift; shift; + ;; + --uml-network) + UML_NETWORK="$2"; + shift; shift; + ;; + --uml-broadcast) + UML_BROADCAST="$2"; + shift; shift; + ;; + --uml-gateway) + UML_GATEWAY="$2"; + shift; shift; + ;; + --uml-image) + PBUILDER_UML_IMAGE="$2"; + shift; shift; + ;; + --mount-tmpfs) + UML_MOUNT_TMPFS="$2"; + shift; shift; + ;; + --uml-mem) + UML_MEM="$2"; + shift; shift; + ;; + --uml-hostname) + UML_HOSTNAME="$2"; + shift; shift; + ;; + --uml-debugmode) + UML_DEBUGMODE="set -x"; + shift;; + --distribution) + UML_DISTRIBUTION="$2"; + shift; shift; + ;; + --uml-login-nocow) + UML_LOGIN_NOCOW=yes; + shift; + ;; + #things that can be passed through without options + --override-config|--binary-arch) + UML_EXTRAOPT="${UML_EXTRAOPT} $1" + shift;; + --configfile) + UML_EXTRAOPT="${UML_EXTRAOPT} $1 $2" + . "$2" + shift; shift;; + #things that can be passed through with options + --timeout|--http-proxy|--hookdir|--aptconfdir|--bindmounts|--mirror|--nonusmirror) + UML_EXTRAOPT="${UML_EXTRAOPT} $1 $2" + shift; shift;; + --buildresult) + # ignore buildresult + if [ -d "$2" ]; then + UML_BUILDRESULT=$(readlink -f "$2") + else + echo "E: Directory $2 does not exist" >&2 + exit 1 + fi + shift; shift;; + --buildplace) + if [ -d "$2" ]; then + BUILDPLACE=$(readlink -f "$2") + else + echo "E: Directory $2 does not exist" >&2 + exit 1 + fi + shift; shift;; + --logfile) + exec > "$2"; + exec 2>&1 + PBUILDER_BUILD_LOGFILE=$(readlink -f "$2") + shift;shift;; + ## pdebuild options + --auto-debsign) + AUTO_DEBSIGN="yes" + shift; + ;; + --buildsourceroot*) + BUILDSOURCEROOTCMD="$2"; + shift; shift; + ;; + --pbuilderroot*) + PBUILDERROOTCMD="$2"; + shift; shift; + ;; + --use-pdebuild-internal) + USE_PDEBUILD_INTERNAL=yes; + shift; + ;; + ## end pdebuild options + --) + shift; + break; + ;; + --*) + echo "Error: Unknown option [$1] was specified " >&2 + exit 1; + ;; + *) + break; + ;; + esac +done + +if ! touch "${BUILDPLACE}/touch" ; then + echo "E: Cannot touch BUILDPLACE/touch, check BUILDPLACE" >&2 + exit 1 +fi diff --git a/pbuilder-user-mode-linux b/pbuilder-user-mode-linux index 279d09b..7a8b28d 100755 --- a/pbuilder-user-mode-linux +++ b/pbuilder-user-mode-linux @@ -1,7 +1,7 @@ #! /bin/bash # common modules for pbuilder. # pbuilder -- personal Debian package builder -# Copyright (C) 2001-2003 Junichi Uekawa +# Copyright (C) 2001-2004 Junichi Uekawa # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,14 +25,11 @@ function cleanup_function () { ${EXTRACLEANUP} } - . /usr/lib/pbuilder/pbuilder-loadconfig -for SYSTEM_CONFIG in /usr/share/pbuilder/pbuilder-uml.conf /etc/pbuilder/pbuilder-uml.conf ${HOME}/.pbuilderrc; do - if [ -f ${SYSTEM_CONFIG} ]; then - . ${SYSTEM_CONFIG} - fi -done +OPERATION="$1" +shift; +. /usr/lib/pbuilder/pbuilder-uml-checkparams function usecow () { PBUILDER_COWFILENAME="${BUILDPLACE}/$$.cow" @@ -146,119 +143,8 @@ EOF fi } -PBUILDER_COW="" -OPERATION="$1" -UML_EXTRAOPT= -UML_DEBUGMODE= -UML_EXECUTE_EXTRAOPT= -UML_LOGIN_NOCOW= -shift; -while [ -n "$1" ] ; do - case "$1" in - --eth0) - MY_ETH0="$2"; - shift; shift; - ;; - --uml-ip) - UML_IP="$2"; - shift; shift; - ;; - --uml-netmask) - UML_NETMASK="$2"; - shift; shift; - ;; - --uml-network) - UML_NETWORK="$2"; - shift; shift; - ;; - --uml-broadcast) - UML_BROADCAST="$2"; - shift; shift; - ;; - --uml-gateway) - UML_GATEWAY="$2"; - shift; shift; - ;; - --uml-image) - PBUILDER_UML_IMAGE="$2"; - shift; shift; - ;; - --mount-tmpfs) - UML_MOUNT_TMPFS="$2"; - shift; shift; - ;; - --uml-mem) - UML_MEM="$2"; - shift; shift; - ;; - --uml-hostname) - UML_HOSTNAME="$2"; - shift; shift; - ;; - --uml-debugmode) - UML_DEBUGMODE="set -x"; - shift;; - --distribution) - UML_DISTRIBUTION="$2"; - shift; shift; - ;; - --uml-login-nocow) - UML_LOGIN_NOCOW=yes; - shift; - ;; - #things that can be passed through without options - --override-config|--binary-arch) - UML_EXTRAOPT="${UML_EXTRAOPT} $1" - shift;; - --configfile) - UML_EXTRAOPT="${UML_EXTRAOPT} $1 $2" - . "$2" - shift; shift;; - #things that can be passed through with options - --timeout|--http-proxy|--hookdir|--aptconfdir|--bindmounts|--mirror|--nonusmirror) - UML_EXTRAOPT="${UML_EXTRAOPT} $1 $2" - shift; shift;; - --buildresult) - # ignore buildresult - if [ -d "$2" ]; then - UML_BUILDRESULT=$(readlink -f "$2") - else - echo "E: Directory $2 does not exist" >&2 - exit 1 - fi - shift; shift;; - --buildplace) - if [ -d "$2" ]; then - BUILDPLACE=$(readlink -f "$2") - else - echo "E: Directory $2 does not exist" >&2 - exit 1 - fi - shift; shift;; - --logfile) - exec > "$2"; - exec 2>&1 - PBUILDER_BUILD_LOGFILE=$(readlink -f "$2") - shift;shift;; - --) - shift; - break; - ;; - --*) - echo "Error: Unknown option [$1] was specified " >&2 - exit 1; - ;; - *) - break; - ;; - esac -done -if ! touch "${BUILDPLACE}/touch" ; then - echo "E: Cannot touch BUILDPLACE/touch, check BUILDPLACE" >&2 - exit 1 -fi BUILDING_DSC_FILE=$(readlink -f "$1") || true # ignore failure here EXTRACLEANUP= diff --git a/pdebuild-user-mode-linux b/pdebuild-user-mode-linux index 48660d6..b476451 100644 --- a/pdebuild-user-mode-linux +++ b/pdebuild-user-mode-linux @@ -1,6 +1,6 @@ #! /bin/bash # pbuilder-user-mode-linux -- personal Debian package builder -# Copyright (C) 2003 Junichi Uekawa +# Copyright (C) 2003,2004 Junichi Uekawa # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,23 +22,29 @@ while ! test -d ./debian -o "$(pwd)" = "/" ; do done if test ! -d ./debian; then - echo "Cannot find ./debian dir" + echo "E: Cannot find ./debian dir" exit 1 fi; export PBCURRENTCOMMANDLINEOPERATION="pdebuild" -. /usr/lib/pbuilder/pbuilder-checkparams + +. /usr/lib/pbuilder/pbuilder-loadconfig +. /usr/lib/pbuilder/pbuilder-uml-checkparams PKG_SOURCENAME=$(dpkg-parsechangelog|sed -n 's/^Source: //p') PKG_VERSION=$(dpkg-parsechangelog|sed -n 's/^Version: \(.*:\|\)//p') ARCHITECTURE=$(dpkg-architecture -qDEB_HOST_ARCH) if [ "${USE_PDEBUILD_INTERNAL}" = 'yes' ]; then - pbuilder-user-mode-linux execute "$@" ${EXTRA_CONFIGFILE[@]/#/--configfile } --bindmounts $(readlink -f ..) /usr/lib/pbuilder/pdebuild-internal ${PWD} --debbuildopts "${DEBBUILDOPTS}" + if [ ! readlink -f .. ]; then + echo "E: Cannot find .. dir from PWD=$(pwd)" + exit 1 + fi + pbuilder-user-mode-linux execute "$@" --bindmounts $(readlink -f ..) /usr/lib/pbuilder/pdebuild-internal ${PWD} --debbuildopts "${DEBBUILDOPTS}" else dpkg-buildpackage -S -us -uc -r${BUILDSOURCEROOTCMD} $DEBBUILDOPTS - pbuilder-user-mode-linux build "$@" ${EXTRA_CONFIGFILE[@]/#/--configfile } --buildresult "${BUILDRESULT}" ../"${PKG_SOURCENAME}_${PKG_VERSION}".dsc + pbuilder-user-mode-linux build "$@" --buildresult "${UML_BUILDRESULT}" ../"${PKG_SOURCENAME}_${PKG_VERSION}".dsc fi if [ "${AUTO_DEBSIGN}" = "yes" ]; then - debsign "${BUILDRESULT}/${PKG_SOURCENAME}_${PKG_VERSION}_${ARCHITECTURE}.changes" + debsign "${UML_BUILDRESULT}/${PKG_SOURCENAME}_${PKG_VERSION}_${ARCHITECTURE}.changes" fi diff --git a/pdebuild-user-mode-linux.1 b/pdebuild-user-mode-linux.1 index 36bffb7..5f657dd 100644 --- a/pdebuild-user-mode-linux.1 +++ b/pdebuild-user-mode-linux.1 @@ -1,4 +1,4 @@ -.TH "pdebuild-user-mode-linux" 1 "2003 Feb 10" "Debian" "pbuilder" +.TH "pdebuild-user-mode-linux" 1 "2004 Jul 29" "Debian" "pbuilder" .SH NAME pdebuild-user-mode-linux \- pbuilder-user-mode-linux way of doing debuild .SH SYNOPSIS @@ -15,16 +15,12 @@ directory, in order to make it work. .SH "PDEBUILD OPTIONS" .TP + .BI "--buildsourceroot [" "fakeroot" "]" The command used to gain root privilege for invoking dpkg-buildpackage .TP -.BI "--pbuilderroot [" "sudo" "]" -The command used to gain root privilege for -invoking pbuilder. - -.TP .BI "--auto-debsign" Invoke debsign at the end of pdebuild process. @@ -37,15 +33,10 @@ The place which build result is stored. .TP .BI "--configfile [" "Extra config file to use" "]" -The configuration file is used, and passed on to +The configuration file is used, but not passed on to .BR "pbuilder-user-mode-linux" . .TP -.BI "--debbuildopts [" "options to pass to dpkg-buildpackage" "]" - -The space-delimited list of options are passed to dpkg-buildpackage. - -.TP .BI "--use-pdebuild-internal" Uses a different implementation of pdebuild, which calls clean and build inside the chroot, using bind-mounts. |