diff options
author | dancer <dancer> | 2002-02-11 16:05:14 +0000 |
---|---|---|
committer | dancer <dancer> | 2002-02-11 16:05:14 +0000 |
commit | 227462e44f207e740aae37864da5c2fe4f8b9d61 (patch) | |
tree | 81a4815ac9daddb23c5ad3e479a4802c8f180303 /pbuilder-modules | |
parent | f18b7f5d5970f2c5329e250e9c0b132282a87e75 (diff) | |
download | pbuilder-227462e44f207e740aae37864da5c2fe4f8b9d61.tar pbuilder-227462e44f207e740aae37864da5c2fe4f8b9d61.tar.gz |
changes.
Diffstat (limited to 'pbuilder-modules')
-rw-r--r-- | pbuilder-modules | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/pbuilder-modules b/pbuilder-modules index 30ff7ff..0f73378 100644 --- a/pbuilder-modules +++ b/pbuilder-modules @@ -173,10 +173,14 @@ function recover_aptcache() { # recover the aptcache archive if [ -n "$APTCACHE" ]; then echo "Obtaining the cached apt archive contents" - if [ "$APTCACHEHARDLINK" = "yes" ]; then - ln "$APTCACHE"/*.deb "$BUILDPLACE/var/cache/apt/archives/" || true + if ls "$APTCACHE"/*.deb > /dev/null 2> /dev/null ; then + if [ "$APTCACHEHARDLINK" = "yes" ]; then + ln "$APTCACHE"/*.deb "$BUILDPLACE/var/cache/apt/archives/" || true + else + cp "$APTCACHE"/*.deb "$BUILDPLACE/var/cache/apt/archives/" || true + fi else - cp "$APTCACHE"/*.deb "$BUILDPLACE/var/cache/apt/archives/" || true + echo "W: No cache contents yet." fi fi } @@ -187,12 +191,12 @@ function save_aptcache() { echo "Copying back the cached apt archive contents" mkdir -p "$APTCACHE" ; for A in "$BUILDPLACE/var/cache/apt/archives/"*.deb; do - if [ ! -f "$APTCACHE/"$(basename "$A") ]; then + if [ ! -f "$APTCACHE/"$(basename "$A") -a -f "$A" ]; then echo " -> new cache content "$(basename "$A")" added" if [ "$APTCACHEHARDLINK" = "yes" ]; then - ln "$A" "$APTCACHE/" + ln "$A" "$APTCACHE/" || true else - cp "$A" "$APTCACHE/" + cp "$A" "$APTCACHE/" || true fi fi done |