aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordancer <dancer>2001-08-28 10:14:58 +0000
committerdancer <dancer>2001-08-28 10:14:58 +0000
commit8c8fb5b93321fb32de2820dcfccd27c7fda43cba (patch)
tree22004ec462d06f27b6433caf119da39d224bf8b6
parent48a8e94a0fbbfbb0d78cf3672a99b82c7b788324 (diff)
downloadpbuilder-8c8fb5b93321fb32de2820dcfccd27c7fda43cba.tar
pbuilder-8c8fb5b93321fb32de2820dcfccd27c7fda43cba.tar.gz
making ready for uploading to Debian archive, changing depends line to debootstrap with versioned depends. Re-tabbing, extactbuildplace function is created to move common code out from create and build. added an error message for unknown parameter option. added a TAGS target to the makefile to make ETAGS work.
-rw-r--r--Makefile5
-rw-r--r--debian/changelog8
-rw-r--r--debian/control2
-rwxr-xr-xpbuilder-buildpackage49
-rwxr-xr-xpbuilder-checkparams70
-rwxr-xr-xpbuilder-createbuildenv19
-rw-r--r--pbuilder-modules46
-rwxr-xr-xpbuilder-updatebuildenv20
8 files changed, 121 insertions, 98 deletions
diff --git a/Makefile b/Makefile
index 771e965..9cc91c9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,8 @@
clean:
- rm -f *.bak *~
+ rm -f *.bak *~ TAGS
+
+TAGS:
+ etags pbuider-* pbuilder
install:
install -d $(DESTDIR)/etc
diff --git a/debian/changelog b/debian/changelog
index 5577582..015e393 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+pbuilder (0.2) unstable; urgency=low
+
+ * Initial upload to Debian archive. (closes: #110388)
+ * Add a versioned depends on debootstrap, because that version is the only
+ version I tested on ... 0.1.15.2
+
+ -- Junichi Uekawa <dancer@debian.org> Tue, 28 Aug 2001 19:07:29 +0900
+
pbuilder (0.1) unstable; urgency=low
* Initial Release.
diff --git a/debian/control b/debian/control
index 68f63eb..861be91 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Standards-Version: 3.5.6
Package: pbuilder
Architecture: all
-Depends: debootstrap, tar, shellutils, debianutils, ${shlibs:Depends}
+Depends: debootstrap (>= 0.1.15.2), tar, shellutils, debianutils, ${shlibs:Depends}
Description: personal package builder for Debian packages
Constructs a chroot system, and builds a package inside the
chroot.
diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage
index a412c70..2a29173 100755
--- a/pbuilder-buildpackage
+++ b/pbuilder-buildpackage
@@ -12,17 +12,22 @@ function copydsc () {
$(echo "$DSCFILE" | sed 's/\(.*\)-[^-.]*\.dsc$/\1/').orig.tar.gz ; do
cp "$FILE" "$TARGET" ;
done
-
}
function checkbuilddep () {
- for INSTALLPKG in $($CHROOTEXEC bin/sh -c "(cd tmp/buildd/*/; dpkg-checkbuilddeps)" 2>&1 |grep "^dpkg-checkbuilddeps: Unmet build dependencies: " | sed 's/^[^:]*:[^:]*: \(.*\)$/\1/' | awk 'BEGIN{RS=", "} /^([^([]*)/{print $1}'); do
- echo " -> Installing $INSTALLPKG"
- $CHROOTEXEC usr/bin/apt-get -y install "$INSTALLPKG"
+ for INSTALLPKG in $($CHROOTEXEC bin/sh -c "(cd tmp/buildd/*/; dpkg-checkbuilddeps)" 2>&1 | \
+ grep "^dpkg-checkbuilddeps: Unmet build dependencies: " | \
+ sed 's/^[^:]*:[^:]*: \(.*\)$/\1/' | \
+ awk 'BEGIN{RS=", "} /^([^([]*)/{print $1}'); do
+ echo " -> Installing $INSTALLPKG"
+ $CHROOTEXEC usr/bin/apt-get -y install "$INSTALLPKG"
done;
- for REMOVEPKG in $($CHROOTEXEC bin/sh -c "(cd tmp/buildd/*/; dpkg-checkbuilddeps)" 2>&1 |grep "^dpkg-checkbuilddeps: Build conflicts: " | sed 's/^[^:]*:[^:]*: \(.*\)$/\1/' | awk 'BEGIN{RS=", "} /^([^([]*)/{print $1}'); do
- echo " -> Removing $REMOVEPKG"
- $CHROOTEXEC usr/bin/apt-get -y remove "$REMOVEPKG"
+ for REMOVEPKG in $($CHROOTEXEC bin/sh -c "(cd tmp/buildd/*/; dpkg-checkbuilddeps)" 2>&1 | \
+ grep "^dpkg-checkbuilddeps: Build conflicts: " | \
+ sed 's/^[^:]*:[^:]*: \(.*\)$/\1/' | \
+ awk 'BEGIN{RS=", "} /^([^([]*)/{print $1}'); do
+ echo " -> Removing $REMOVEPKG"
+ $CHROOTEXEC usr/bin/apt-get -y remove "$REMOVEPKG"
done;
}
@@ -31,22 +36,12 @@ function checkbuilddep () {
PACKAGENAME="$1"
CHROOTEXEC="chroot $BUILDPLACE "
-
-
if [ ! -f "$PACKAGENAME" ]; then
- echo "Command line parameter [$PACKAGENAME] is not a valid .dsc file name" >&2
- exit 1;
+ echo "Command line parameter [$PACKAGENAME] is not a valid .dsc file name" >&2
+ exit 1;
fi;
-cleanbuildplace
-echo "building the build env"
-mkdir -p "$BUILDPLACE"
-(
- cd "$BUILDPLACE"
- tar xfzp "$BASETGZ"
- mkdir -p "$BUILDPLACE/tmp/buildd"
- )
-mountproc
+extractbuildplace
echo Copying source file
copydsc "$PACKAGENAME" "$BUILDPLACE/tmp/buildd"
@@ -56,15 +51,17 @@ echo Installing the build-deps
checkbuilddep
echo Building the package
$CHROOTEXEC /bin/sh -c "(cd tmp/buildd/*/; dpkg-buildpackage)"
+
umountproc
test -n "$BUILDRESULT" && (
- mkdir -p "$BUILDRESULT"
- if [ -d "$BUILDRESULT" ]; then
- cp "$BUILDPLACE"/tmp/buildd/* "$BUILDRESULT"
- else
- echo "Error: BUILDRESULT=[$BUILDRESULT] and is not a directory." >&2
- fi
+ mkdir -p "$BUILDRESULT"
+ if [ -d "$BUILDRESULT" ]; then
+ cp "$BUILDPLACE"/tmp/buildd/* "$BUILDRESULT"
+ else
+ echo "Error: BUILDRESULT=[$BUILDRESULT] and is not a directory." >&2
+ fi
)
+
cleanbuildplace
diff --git a/pbuilder-checkparams b/pbuilder-checkparams
index 574b875..b64126b 100755
--- a/pbuilder-checkparams
+++ b/pbuilder-checkparams
@@ -7,34 +7,34 @@
BASEBUILDPLACE="$BUILDPLACE"
BUILDPLACE="$BUILDPLACE/$$"
-while [ -n $1 ]; do
- case "$1" in
- --basetgz)
- BASETGZ=$(readlink -f "$2");
- shift; shift;
- ;;
- --buildplace)
- BUILDPLACE=$(readlink -f "$2");
- shift; shift;
- ;;
- --mirror)
- MIRROR="$2";
- shift; shift;
- ;;
- --http-proxy)
- export http_proxy="$2";
- shift; shift;
- ;;
- --distribution)
- DISTRIBUTION="$2";
- shift; shift;
- ;;
- --buildresult)
- BUILDRESULT=$(readlink -f "$2");
- shift; shift;
- ;;
- --help)
- cat <<EOF
+while [ -n "$1" ]; do
+ case "$1" in
+ --basetgz)
+ BASETGZ=$(readlink -f "$2");
+ shift; shift;
+ ;;
+ --buildplace)
+ BUILDPLACE=$(readlink -f "$2");
+ shift; shift;
+ ;;
+ --mirror)
+ MIRROR="$2";
+ shift; shift;
+ ;;
+ --http-proxy)
+ export http_proxy="$2";
+ shift; shift;
+ ;;
+ --distribution)
+ DISTRIBUTION="$2";
+ shift; shift;
+ ;;
+ --buildresult)
+ BUILDRESULT=$(readlink -f "$2");
+ shift; shift;
+ ;;
+ --help)
+ cat <<EOF
Command Line Options:
--basetgz [base.tgz location]
--buildplace [location of build]
@@ -43,11 +43,15 @@ Command Line Options:
--distribution [distribution(woody/sid)]
--buildresult [location-to-copy-build-result]
EOF
- exit 1;
- ;;
- *)
- break;
- ;;
+ exit 1;
+ ;;
+ --*)
+ echo "Error: Unknown option [$1] was specified " >&2
+ exit 1;
+ ;;
+ *)
+ break;
+ ;;
esac
done
diff --git a/pbuilder-createbuildenv b/pbuilder-createbuildenv
index 060b389..104ee4d 100755
--- a/pbuilder-createbuildenv
+++ b/pbuilder-createbuildenv
@@ -1,29 +1,34 @@
#! /bin/bash
-#necessary for installs.
+# Creating the build environment with debootstrap.
. /usr/lib/pbuilder/pbuilder-checkparams
. /usr/lib/pbuilder/pbuilder-modules
CHROOTEXEC="chroot $BUILDPLACE "
if [ -z "$DISTRIBUTION" ]; then
- DISTRIBUTION=woody
+ DISTRIBUTION=woody
fi
echo "Distribution is $DISTRIBUTION."
cleanbuildplace
-echo "building the build env"
+echo "Building the build environment"
mkdir -p "$BUILDPLACE"
+if [ ! -d "$BUILDPLACE" ]; then
+ echo "pbuilder: Could not make directory [$BUILDPLACE]" >&2
+ exit 1
+fi
mountproc
echo " -> running debootstrap"
-( cd "$BUILDPLACE"; debootstrap "$DISTRIBUTION" . )
+( cd "$BUILDPLACE" && debootstrap "$DISTRIBUTION" . )
+echo " -> debootstrap finished"
mkdir -p "$BUILDPLACE/tmp/buildd"
echo " -> copying local configuration"
for a in passwd hosts hostname resolv.conf apt; do
- cp -r /etc/$a "$BUILDPLACE/etc/";
+ cp -r /etc/$a "$BUILDPLACE/etc/";
done
-echo "Installing apt-lines"
+echo " -> installing apt-lines"
cat > "$BUILDPLACE/etc/apt/sources.list" << EOF
deb $MIRRORSITE $DISTRIBUTION main contrib non-free
deb-src $MIRRORSITE $DISTRIBUTION main contrib non-free
@@ -38,6 +43,6 @@ $CHROOTEXEC /usr/bin/apt-get -y install build-essential dpkg-dev apt $EXTRAPACKA
$CHROOTEXEC /usr/bin/apt-get clean
umountproc
echo " -> creating base.tgz"
-( cd "$BUILDPLACE" ; tar cfz "$BASETGZ" * )
+( cd "$BUILDPLACE" && tar cfz "$BASETGZ" * || echo " -> failed building base.tgz")
cleanbuildplace
diff --git a/pbuilder-modules b/pbuilder-modules
index fb4e996..7d836d7 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -2,27 +2,51 @@
# common modules for pbuilder.
function umountproc () {
- if [ "$USEPROC" = "yes" ]; then
- echo " -> unmounting proc"
- umount "$BUILDPLACE/proc"
- fi
+ if [ "$USEPROC" = "yes" ]; then
+ echo " -> unmounting proc"
+ umount "$BUILDPLACE/proc"
+ fi
}
function mountproc () {
- if [ "$USEPROC" = "yes" ]; then
- echo " -> mounting proc"
- mkdir -p $BUILDPLACE/proc
- mount -t proc /proc "$BUILDPLACE/proc"
- fi
+ if [ "$USEPROC" = "yes" ]; then
+ echo " -> mounting proc"
+ mkdir -p $BUILDPLACE/proc
+ mount -t proc /proc "$BUILDPLACE/proc"
+ fi
}
function cleanbuildplace () {
if [ -d "$BUILDPLACE" ]; then
- echo cleaning the build env
- rm -rf "$BUILDPLACE"
+ echo cleaning the build env
+ rm -rf "$BUILDPLACE"
fi;
}
+function extractbuildplace () {
+ # after calling this function, umountproc, and cleanbuildplace
+ # needs to be called.
+ cleanbuildplace
+ echo "building the build env"
+ echo " -> extracting base.tgz"
+ mkdir -p "$BUILDPLACE"
+ (cd "$BUILDPLACE" && tar xfzp "$BASETGZ")
+ mountproc
+ mkdir -p "$BUILDPLACE/tmp/buildd"
+ echo " -> copying local configuration"
+ for a in passwd hosts hostname resolv.conf; do
+ cp /etc/$a "$BUILDPLACE/etc/$a";
+ done
+
+ if [ -n "$DISTRIBUTION" ]; then
+ echo Installing apt-lines
+ cat > "$BUILDPLACE"/etc/apt/sources.list << EOF
+deb $MIRRORSITE $DISTRIBUTION main contrib non-free
+deb-src $MIRRORSITE debian $DISTRIBUTION main contrib non-free
+EOF
+ fi
+}
+
#required for some packages to install...
export LANG=C
export LC_ALL=C
diff --git a/pbuilder-updatebuildenv b/pbuilder-updatebuildenv
index a758418..9db6f85 100755
--- a/pbuilder-updatebuildenv
+++ b/pbuilder-updatebuildenv
@@ -7,25 +7,7 @@ CHROOTEXEC="chroot $BUILDPLACE "
test -n "$DISTRIBUTION" && echo "Upgrading for distribution $DISTRIBUTION"
-cleanbuildplace
-echo "building the build env"
-echo " -> extracting base.tgz"
-mkdir -p "$BUILDPLACE"
-(cd "$BUILDPLACE"; tar xfzp "$BASETGZ")
-mountproc
-mkdir -p "$BUILDPLACE/tmp/buildd"
-echo " -> copying local configuration"
-for a in passwd hosts hostname resolv.conf; do
- cp /etc/$a "$BUILDPLACE/etc/$a";
-done
-
-if [ -n "$DISTRIBUTION" ]; then
- echo Installing apt-lines
- cat > $BUILDPLACE/etc/apt/sources.list << EOF
-deb $MIRRORSITE $DISTRIBUTION main contrib non-free
-deb-src $MIRRORSITE debian $DISTRIBUTION main contrib non-free
-EOF
-fi
+extractbuildplace
echo "Refreshing the base.tgz "
echo " -> upgrading packages"