Skip to content

Commit

Permalink
avoid redownloading pkgbuilds
Browse files Browse the repository at this point in the history
  • Loading branch information
keenerd committed Nov 24, 2010
1 parent 307a1cd commit 237e511
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packer
Expand Up @@ -121,9 +121,7 @@ existsinlocal() {

# Scrapes the aur deps from PKGBUILDS and puts in globally available dependencies array
scrapeaurdeps() {
if ! [[ -f "$tmpdir/$1.PKGBUILD" ]]; then
curl -fs "$PKGURL/$1/$1/PKGBUILD" > "$tmpdir/$1.PKGBUILD"
fi
pkginfo_bg "$1"
. "$tmpdir/$1.PKGBUILD"
IFS=$'\n'
dependencies=( $(echo -e "${depends[*]}\n${makedepends[*]}" | sed -e 's/=.*//' -e 's/>.*//' -e 's/<.*//'| sort -u) )
Expand Down Expand Up @@ -239,6 +237,12 @@ rpcinfo_bg() {
fi
}

pkginfo_bg() {
if ! [[ -f "$tmpdir/$1.PKGBUILD" ]]; then
curl -fs "$PKGURL/$1/$1/PKGBUILD" > "$tmpdir/$1.PKGBUILD"
fi
}

aurversionisnewer_bg() {
unset aurversion
if ! grep -Fq ':"No result found"' "$tmpdir/$1.info"; then
Expand Down Expand Up @@ -538,7 +542,7 @@ if [[ $option = update ]]; then
checkignores+=("${packages[i]}")
continue
fi
curl -fs "$PKGURL/$pkg/$pkg/PKGBUILD" > "$tmpdir/$pkg.PKGBUILD" &
pkginfo_bg "$pkg" &
nap
done
for ((i=0; i<$total; i++)); do
Expand Down Expand Up @@ -741,8 +745,8 @@ if [[ $option = info ]]; then
$outputpacman -Si -- "$package"
exit
else # Check to see if it is in the aur
curl -fs "$PKGURL/$package/$package/PKGBUILD" > "$tmpdir/$package.PKGBUILD"
[[ $? -eq 0 ]] || err "${COLOR7}error:${ENDCOLOR} package '$package' was not found"
pkginfo_bg "$package"
[[ -s "$tmpdir/$package.PKGBUILD" ]] || err "${COLOR7}error:${ENDCOLOR} package '$package' was not found"
. "$tmpdir/$package.PKGBUILD"

# Echo out the -Si formatted package information
Expand Down

0 comments on commit 237e511

Please sign in to comment.