aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-updatebuildenv
diff options
context:
space:
mode:
authordancer <dancer>2005-06-03 19:55:03 +0000
committerdancer <dancer>2005-06-03 19:55:03 +0000
commit838c57007b99dd4d886645f463fd8b7279607f5c (patch)
treeb2d39882d6fe52adfb787898dc22da9e219dd0e1 /pbuilder-updatebuildenv
parentb2e9d6d5057c7a493e7c7b369681277988d5655c (diff)
downloadpbuilder-838c57007b99dd4d886645f463fd8b7279607f5c.tar
pbuilder-838c57007b99dd4d886645f463fd8b7279607f5c.tar.gz
+ * pbuilder.8: document --autocleanaptcache
+ + * pbuilder-updatebuildenv: + * pbuilder-checkparams (AUTOCLEANAPTCACHE): support auto-clean of aptcache + (IGNORE_UMOUNT): add --autocleanaptcache +
Diffstat (limited to 'pbuilder-updatebuildenv')
-rwxr-xr-xpbuilder-updatebuildenv15
1 files changed, 15 insertions, 0 deletions
diff --git a/pbuilder-updatebuildenv b/pbuilder-updatebuildenv
index 8dc2463..112007e 100755
--- a/pbuilder-updatebuildenv
+++ b/pbuilder-updatebuildenv
@@ -47,6 +47,21 @@ $TRAP saveaptcache_umountproc_cleanbuildplace exit
$CHROOTEXEC /usr/bin/apt-get -y --force-yes "${FORCE_CONFNEW[@]}" dist-upgrade
$CHROOTEXEC /usr/bin/apt-get -y --force-yes install build-essential dpkg-dev apt $EXTRAPACKAGES
save_aptcache
+
+# clean aptcache
+if [ "${AUTOCLEANAPTCACHE}" = "yes" -a -n "$APTCACHE" ]; then
+ echo " -> Cleaning the cached apt archive"
+ $CHROOTEXEC /usr/bin/apt-get autoclean || true
+ find "$APTCACHE/" -name \*.deb -maxdepth 1 | \
+ while rezad A; do
+ if [ ! -f "$BUILDPLACE/var/cache/apt/archives/"$(basename "$A") -a \
+ -f "$A" ]; then
+ echo " -> obsolete cache content "$(basename "$A")" removed"
+ rm -f "$A" || true
+ fi
+ done
+fi
+
$TRAP umountproc_cleanbuildplace exit
$CHROOTEXEC /usr/bin/apt-get clean || true