aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-buildpackage
diff options
context:
space:
mode:
authordancer <dancer>2001-09-01 07:12:48 +0000
committerdancer <dancer>2001-09-01 07:12:48 +0000
commit7ddeeba34680c1087d4d6fe113e89f5d6a738253 (patch)
treefdb1375d768a8f2c87b382286f508d0c62a8e1e7 /pbuilder-buildpackage
parent757b469fae7eacf70c5e729173536baeaea13b0d (diff)
downloadpbuilder-7ddeeba34680c1087d4d6fe113e89f5d6a738253.tar
pbuilder-7ddeeba34680c1087d4d6fe113e89f5d6a738253.tar.gz
changed to have internal checkbuilddeps
Diffstat (limited to 'pbuilder-buildpackage')
-rwxr-xr-xpbuilder-buildpackage56
1 files changed, 53 insertions, 3 deletions
diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage
index 5137c58..f190fc3 100755
--- a/pbuilder-buildpackage
+++ b/pbuilder-buildpackage
@@ -14,23 +14,73 @@ function copydsc () {
done
}
-function checkbuilddep () {
+function checkbuilddep_internal () {
+# fall back to this function if checkbuilddeps is not available.
+ local ARCH=$(dpkg --print-architecture)
+ echo " -> Attempting to parse the build-deps by myself"
+ for INSTALLPKG in grep "^Build-Depends\(-Indep\|\): " "$BUILDPLACE/"tmp/buildd/*/debian/control | \
+ sed 's/^[^:]*: \(.*\)$/\1/' | \
+ awk 'BEGIN{RS=","} {print}'; do
+ echo " -> Considering $INSTALLPKG"
+ if echo "$INSTALLPKG" | grep '[' > /dev/null ; then
+ # this package has arch-deps.
+ if echo "$INSTALLPKG" | sed 's/.*\(\[.*\]\)/\1/' | grep "[[ ]!$ARCH[] ]" > /dev/null; then
+ # don't install this on this arch
+ continue;
+ fi
+ if ! echo "$INSTALLPKG" | sed 's/.*\(\[.*\]\)/\1/' | grep "[[ ]$ARCH[] ]" > /dev/null; then
+ # this arch is not listed.
+ continue;
+ fi
+ fi
+ echo " -> Installing $INSTALLPKG"
+ $CHROOTEXEC usr/bin/apt-get -y install $(echo "$INSTALLPKG" | awk '{print $1}')
+ done;
+ for INSTALLPKG in grep "^Build-Conflicts\(-Indep\|\): " "$BUILDPLACE/"tmp/buildd/*/debian/control | \
+ sed 's/^[^:]*: \(.*\)$/\1/' | \
+ awk 'BEGIN{RS=","} {print}'; do
+ echo " -> Considering $INSTALLPKG"
+ if echo "$INSTALLPKG" | grep '[' > /dev/null ; then
+ # this package has arch-deps.
+ if echo "$INSTALLPKG" | sed 's/.*\(\[.*\]\)/\1/' | grep "[[ ]!$ARCH[] ]" > /dev/null; then
+ # don't install this on this arch
+ continue;
+ fi
+ if ! echo "$INSTALLPKG" | sed 's/.*\(\[.*\]\)/\1/' | grep "[[ ]$ARCH[] ]" > /dev/null; then
+ # this arch is not listed.
+ continue;
+ fi
+ fi
+ echo " -> Removing $INSTALLPKG"
+ $CHROOTEXEC usr/bin/apt-get -y remove $(echo "$INSTALLPKG" | awk '{print $1}')
+ done;
+}
+
+function checkbuilddep_using_dpkgcheckbuilddeps () {
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
+ 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
+ awk 'BEGIN{RS=", "} {print $1}'); do
echo " -> Removing $REMOVEPKG"
$CHROOTEXEC usr/bin/apt-get -y remove "$REMOVEPKG"
done;
}
+function checkbuilddep () {
+ if [ -x "$BUILDPLACE/usr/bin/dpkg-checkbuilddeps" ]; then
+ checkbuilddep_using_dpkgcheckbuilddeps;
+ else
+ checkbuilddep_internal;
+ fi
+}
+
. /usr/lib/pbuilder/pbuilder-checkparams
. /usr/lib/pbuilder/pbuilder-modules
PACKAGENAME="$1"