aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunichi Uekawa <dancer@netfort.gr.jp>2009-03-07 10:29:36 +0900
committerJunichi Uekawa <dancer@netfort.gr.jp>2009-03-07 10:29:36 +0900
commit4dbef9fd357e0aca276d69980527138203f7a9e6 (patch)
tree983d32a0750f506f54744c188ab74a7613924055
parentea7049c3a6ed765a894543a9711a00bf01eda63b (diff)
downloadpbuilder-4dbef9fd357e0aca276d69980527138203f7a9e6.tar
pbuilder-4dbef9fd357e0aca276d69980527138203f7a9e6.tar.gz
implement --inputfile option.
Copies extra files to inside chroot.
-rwxr-xr-xpbuilder3
-rwxr-xr-xpbuilder-buildpackage1
-rwxr-xr-xpbuilder-checkparams13
-rw-r--r--pbuilder-modules15
-rw-r--r--pbuilder.815
5 files changed, 45 insertions, 2 deletions
diff --git a/pbuilder b/pbuilder
index 1a7d525..8a092f8 100755
--- a/pbuilder
+++ b/pbuilder
@@ -56,6 +56,7 @@ case "$1" in
. /usr/lib/pbuilder/pbuilder-runhooks
extractbuildplace
trap umountproc_cleanbuildplace_trap exit sighup
+ copyinputfile "${BUILDPLACE}/tmp/buildd"
loadhooks
recover_aptcache
trap saveaptcache_umountproc_cleanbuildplace_trap exit sighup
@@ -110,7 +111,7 @@ File extracted to: $BUILDPLACE
extractbuildplace
trap umountproc_cleanbuildplace_trap exit sighup
-
+ copyinputfile "${BUILDPLACE}/tmp/buildd"
loadhooks
recover_aptcache
trap saveaptcache_umountproc_cleanbuildplace_trap exit sighup
diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage
index 02d4b49..2be908e 100755
--- a/pbuilder-buildpackage
+++ b/pbuilder-buildpackage
@@ -96,6 +96,7 @@ trap umountproc_cleanbuildplace_trap exit sighup
log "I: Copying source file"
copydsc "$PACKAGENAME" "$BUILDPLACE/tmp/buildd"
+copyinputfile "$BUILDPLACE/tmp/buildd"
log "I: Extracting source"
if echo "chown $BUILDUSERNAME:$BUILDUSERNAME /tmp/buildd /tmp/buildd/*" | $CHROOTEXEC /bin/bash; then
diff --git a/pbuilder-checkparams b/pbuilder-checkparams
index 523e21e..4d56838 100755
--- a/pbuilder-checkparams
+++ b/pbuilder-checkparams
@@ -198,6 +198,19 @@ while [ -n "$1" ]; do
SAVE_AFTER_LOGIN=yes;
shift;
;;
+ --inputfile)
+ if [ ! -f "$2" ]; then
+ log "E: Input file $2 does not exist"
+ exit 1
+ fi
+ INPUTFILE[${#INPUTFILE[@]}]="$2";
+ shift; shift;
+ ;;
+ --outputfile)
+ OUTPUTFILE[${#OUTPUTFILE[@]}]="$2";
+ shift; shift;
+ ;;
+
## internal options.
--internal-chrootexec)
# specify custom chrootexec function -- this is internal debugging function
diff --git a/pbuilder-modules b/pbuilder-modules
index 12e4da7..ac03ad8 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -1,7 +1,7 @@
#! /bin/bash
# common modules for pbuilder.
# pbuilder -- personal Debian package builder
-# Copyright (C) 2001-2007 Junichi Uekawa
+# Copyright (C) 2001-2009 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
@@ -489,6 +489,19 @@ function create_basetgz() {
)
}
+function copyinputfile() {
+ # copy files to inside chroot, copy all files specified by INPUTFILE[] parameter.
+ TARGETDIR="$1"
+ if [ -z "$TARGETDIR" ]; then
+ log "E: Unexpected error in copyinputfile"
+ exit 1x
+ fi
+ if [ -n "$INPUTFILE" ]; then
+ log "I: copy ${INPUTFILE[*]} to taget directory"
+ cp "${INPUTFILE[@]}" "${TARGETDIR}"
+ fi
+}
+
# all trap hooks that should lead to 'exit'; and error exit.
function cleanbuildplace_trap () {
cleanbuildplace
diff --git a/pbuilder.8 b/pbuilder.8
index 4c32c78..4c34fa0 100644
--- a/pbuilder.8
+++ b/pbuilder.8
@@ -530,6 +530,21 @@ and
.B "--create"
targets.
+.TP
+.BI "\-\-inputfile " "filename"
+
+Add extra file to be copied to
+.B "/tmp/buildd"
+inside the build environment.
+
+available in
+.B "--build"
+and
+.B "--login"
+and
+.B "--execute"
+targets.
+
.SH "FILES"
.TP
.I "/etc/pbuilderrc"