diff options
Diffstat (limited to 'chicken-wranglers/debian/fixup-scratchbox')
-rwxr-xr-x | chicken-wranglers/debian/fixup-scratchbox | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/chicken-wranglers/debian/fixup-scratchbox b/chicken-wranglers/debian/fixup-scratchbox new file mode 100755 index 0000000..5e9896d --- /dev/null +++ b/chicken-wranglers/debian/fixup-scratchbox @@ -0,0 +1,53 @@ +#! /bin/sh + +# XXX - this needs to run under fakeroot... + +exec 3>&1 1>&2 + +real_dpkg_checkbuilddeps () { + SBOX_REDIRECT_IGNORE=/usr/bin/perl /usr/bin/perl /usr/bin/dpkg-checkbuilddeps "$@" +} + +finish () { + if ! real_dpkg_checkbuilddeps; then + echo "This package does not use any devkits." + echo "Please install all build dependencies as real packages." + echo >&3 FAIL + fi + exit 0 +} + +# The stamp file can not be in the source tree because then it would +# end up in the source package, which is not what we want. We put it +# into /var/tmp so that it gets deleted when a new rootstrap is +# extracted. + +STAMP=/var/tmp/SANITIZED.$(head debian/changelog | md5sum | cut -d' ' -f1) + +if [ -e $STAMP ]; then + exit 0; +fi + +# Only do permanent changes if this is BIFH + +echo "$USER" | grep -q 'bifh[0-9]' || finish + +# prevent bash from killing the system +rm -f /var/lib/bash/provide-sh + +# clean ~/.texmf-var to avoid trouble with stale things hiding there. +rm -rf ~/.texmf-var/ + +pfx="dpkg-checkbuilddeps: Unmet build dependencies:" +deps=`real_dpkg_checkbuilddeps 2>&1 | grep "^$pfx" | \ + sed -e "s/$pfx//" -e s'/([^)]*)//g' -e 's/|//'` +deps="$deps build-essential automake autoconf libtool ed gawk diff dpkg-dev" +for d in $deps; do + echo apt-get "$@" install $d + apt-get -o DPkg::Options::=--force-confold -q --force-yes --yes install $d +done +apt-get -o DPkg::Options::=--force-confold -q --force-yes --yes dist-upgrade + +touch $STAMP + +finish |