diff options
-rwxr-xr-x | find-deprecated-pkgs | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/find-deprecated-pkgs b/find-deprecated-pkgs index e2bd276..9306281 100755 --- a/find-deprecated-pkgs +++ b/find-deprecated-pkgs @@ -37,21 +37,22 @@ for r in $repos_armv7h; do mirrors+=(https://fl.us.mirror.archlinuxarm.org/armv7h/$r/) done -# Parabola mirrors, used to check [libre] and [pcr] packages -if [[ $1 = parabola ]]; then -for r in $repos_parabola; do - mirrors+=(https://mirror.grapentin.org/parabola/$r/os/x86_64/) - mirrors+=(https://mirror.grapentin.org/parabola/$r/os/i686/) - mirrors+=(https://mirror.grapentin.org/parabola/$r/os/armv7h/) -done +add_parabola_mirrors(){ + # Parabola mirrors, used to check [libre] and [pcr] packages + for r in $repos_parabola; do + mirrors+=(https://mirror.grapentin.org/parabola/$r/os/x86_64/) + mirrors+=(https://mirror.grapentin.org/parabola/$r/os/i686/) + mirrors+=(https://mirror.grapentin.org/parabola/$r/os/armv7h/) + done fi +} # Sed expresion tested for Nginx, change if needed sedexp='s/.*href="//;s/\.pkg.tar.xz.*//' # extra sedexps for special characters/symbols sedexp+=';s/%2B/+/g;s/%3A/:/g;s/%40/@/g' -usage() { +usage(){ cat <<EOM Usage: ${0##*/} [arch|parabola] Check if there are inexistent packages in the blacklists. @@ -79,11 +80,12 @@ To easily remove a line, you can use the following sed expresion: EOM } -mkpkglist() { +mkpkglist(){ parabola_pkgs=$(mktemp) arch_pkgs=$(mktemp) case $1 in - parabola) curl -s ${mirrors[@]} | grep '".*.pkg.tar.xz"' | sed $sedexp > $parabola_pkgs + parabola) add_parabola_mirrors + curl -s ${mirrors[@]} | grep '".*.pkg.tar.xz"' | sed $sedexp > $parabola_pkgs # Separate packages by architecture for arch in x86_64 i686 armv7h any; do @@ -108,7 +110,7 @@ mkpkglist() { esac } -err() { +err(){ printf '%s==> Error:%s %s\n' \ "$(tput bold;tput setaf 1)" \ "$(tput sgr0)" \ @@ -116,21 +118,21 @@ err() { exit 1 } -msg() { +msg(){ printf '%s==>%s %s\n' \ "$(tput bold;tput setaf 2)" \ "$(tput sgr0)" \ "$1" } -submsg() { +submsg(){ printf ' %s->%s %s\n' \ "$(tput bold;tput setaf 4)" \ "$(tput sgr0)" \ "$1" } -get_libre_pkgs() { +get_libre_pkgs(){ # We'll use this when we check Arch's pkgs only if ! [[ -e $libre_pkgs ]]; then libre_pkgs=$(mktemp) |