summaryrefslogtreecommitdiff
path: root/configs/install-iso/download-repo.sh
diff options
context:
space:
mode:
authorGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2009-11-19 01:35:49 -0300
committerGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2009-11-19 01:35:49 -0300
commitbce6a11544d4c5e33d0128e01eb90be8ec233dcd (patch)
tree654e2f1957d939cc2311f57281491d42135c91d4 /configs/install-iso/download-repo.sh
parent3f39d91541e8d5f858e1c6d0741d707b4df95f92 (diff)
downloadarchiso32-bce6a11544d4c5e33d0128e01eb90be8ec233dcd.tar.xz
Do not redownload/rebuild core-pkgs when making the repo
Another small step forward to avoid rebuilding of squashfs images if are alredy up-to-date core-repo. Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Diffstat (limited to 'configs/install-iso/download-repo.sh')
-rwxr-xr-xconfigs/install-iso/download-repo.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/configs/install-iso/download-repo.sh b/configs/install-iso/download-repo.sh
index ead5a44..800d49a 100755
--- a/configs/install-iso/download-repo.sh
+++ b/configs/install-iso/download-repo.sh
@@ -20,6 +20,8 @@
REPO="$1"
DEST="$2"
+REPO_CHANGED=n
+
if [ -z "$REPO" -o -z "$DEST" ]; then
echo "usage: $(basename $0) <reponame> <dest-dir>"
exit 1
@@ -45,13 +47,19 @@ if [ -n "$PKGS" ]; then
baseurl="$(dirname "$url")" #save for later
pkgname="$(basename "$url")"
cachedpkg="$cachedir/$pkgname"
- if [ -e "$cachedpkg" ]; then
- cp "$cachedpkg" "$DEST/$pkgname"
- else
+ if [ ! -e "$DEST/$pkgname" ]; then
+ if [ -e "$cachedpkg" ]; then
+ cp -v "$cachedpkg" "$DEST/$pkgname"
+ REPO_CHANGED=y
+ else
wget -nv "$url" -O "$DEST/$pkgname"
+ REPO_CHANGED=y
+ fi
fi
done
- wget -nv "$baseurl/$REPO.db.tar.gz" -O "$DEST/$REPO.db.tar.gz"
+ if [ "$REPO_CHANGED" = "y" ]; then
+ wget -nv "$baseurl/$REPO.db.tar.gz" -O "$DEST/$REPO.db.tar.gz"
+ fi
else
echo "No packages to download... what'd you break?"
exit 1