Skip to content

Instantly share code, notes, and snippets.

@nkpro2000
Created August 29, 2023 12:23
Show Gist options
  • Save nkpro2000/c5c4400dd084e9934a9c8fde3348bd82 to your computer and use it in GitHub Desktop.
Save nkpro2000/c5c4400dd084e9934a9c8fde3348bd82 to your computer and use it in GitHub Desktop.
Just to download pkgbuild files of all packages in AUR
#!/bin/sh
get () {
curl 'https://aur.archlinux.org/packages?PP=2500&SB=n&O='"$(echo "($1 - 1) * 2500" |bc)" > "$1.html"
grep -oP --color '(?<="/packages/)[^"]+(?=")' "$1.html" > "$1.list"
}
if test -n "$2"; then
for i in $(seq "$1" "$(qalc -t "ceil ($2 / 2500)")"); do
get "$i"
done
else
get "$1"
fi
#!/bin/sh
get_pkgbuild () {
curl 'https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h='"$2" > "$1/$2"
}
mkdir -p "$1"
for i in $(cat "$1.list"); do
get_pkgbuild "$1" "$i"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment