Look into cache before fetching the pkg remotely.
The script download-rep.sh in config/install-iso should first check if a package is present in local pacman cache before downloading it with wget. [Aaron: Added missing 'then' on added if statement] Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
This commit is contained in:
parent
bbc0f720c5
commit
195521a185
1 changed files with 7 additions and 1 deletions
|
@ -40,10 +40,16 @@ PKGS=$(/usr/bin/pacman -Sl $REPO | cut -d' ' -f1,2 | tr ' ' '/')
|
|||
|
||||
if [ -n "$PKGS" ]; then
|
||||
baseurl=""
|
||||
cachedir="/var/cache/pacman/pkg"
|
||||
for url in $(/usr/bin/pacman -Sp $PKGS | grep '://'); do
|
||||
baseurl="$(dirname "$url")" #save for later
|
||||
pkgname="$(basename "$url")"
|
||||
wget -nv "$url" -O "$DEST/$pkgname"
|
||||
cachedpkg="$cachedir/$pkgname"
|
||||
if [ -e "$cachedpkg" ]; then
|
||||
cp "$cachedpkg" "$DEST/$pkgname"
|
||||
else
|
||||
wget -nv "$url" -O "$DEST/$pkgname"
|
||||
fi
|
||||
done
|
||||
wget -nv "$baseurl/$REPO.db.tar.gz" -O "$DEST/$REPO.db.tar.gz"
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue