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>
This commit is contained in:
parent
3f39d91541
commit
bce6a11544
@ -20,6 +20,8 @@
|
|||||||
REPO="$1"
|
REPO="$1"
|
||||||
DEST="$2"
|
DEST="$2"
|
||||||
|
|
||||||
|
REPO_CHANGED=n
|
||||||
|
|
||||||
if [ -z "$REPO" -o -z "$DEST" ]; then
|
if [ -z "$REPO" -o -z "$DEST" ]; then
|
||||||
echo "usage: $(basename $0) <reponame> <dest-dir>"
|
echo "usage: $(basename $0) <reponame> <dest-dir>"
|
||||||
exit 1
|
exit 1
|
||||||
@ -45,13 +47,19 @@ if [ -n "$PKGS" ]; then
|
|||||||
baseurl="$(dirname "$url")" #save for later
|
baseurl="$(dirname "$url")" #save for later
|
||||||
pkgname="$(basename "$url")"
|
pkgname="$(basename "$url")"
|
||||||
cachedpkg="$cachedir/$pkgname"
|
cachedpkg="$cachedir/$pkgname"
|
||||||
if [ -e "$cachedpkg" ]; then
|
if [ ! -e "$DEST/$pkgname" ]; then
|
||||||
cp "$cachedpkg" "$DEST/$pkgname"
|
if [ -e "$cachedpkg" ]; then
|
||||||
else
|
cp -v "$cachedpkg" "$DEST/$pkgname"
|
||||||
|
REPO_CHANGED=y
|
||||||
|
else
|
||||||
wget -nv "$url" -O "$DEST/$pkgname"
|
wget -nv "$url" -O "$DEST/$pkgname"
|
||||||
|
REPO_CHANGED=y
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
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
|
else
|
||||||
echo "No packages to download... what'd you break?"
|
echo "No packages to download... what'd you break?"
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user