From 93f41ac47ffd35b001f800ca4c56606818871b31 Mon Sep 17 00:00:00 2001 From: David P Date: Thu, 6 Sep 2018 18:51:18 -0300 Subject: find-deprecated-pkgs: add add_parabola_mirrors() function and arrange the rest of the f()'s Signed-off-by: David P --- find-deprecated-pkgs | 30 ++++++++++++++++-------------- 1 file 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 < $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) -- cgit v1.2.2