summaryrefslogtreecommitdiff
path: root/find-deprecated-pkgs
diff options
context:
space:
mode:
authorDavid P <megver83@parabola.nu>2018-05-17 12:30:19 -0400
committerDavid P <megver83@parabola.nu>2018-05-17 12:31:49 -0400
commita6cf9d62ca120ffdb93d83010b804223207cf438 (patch)
treedc486b5883f0fc7bb4c659bcb792dfa4adfdb499 /find-deprecated-pkgs
parentc914523aa7fb48abea19f391bf5ebf3a2486fb69 (diff)
improve find-deprecated-pkgs
fix line 42 and make check() fail if there's an invalid argument Signed-off-by: David P <megver83@parabola.nu>
Diffstat (limited to 'find-deprecated-pkgs')
-rwxr-xr-xfind-deprecated-pkgs12
1 files changed, 10 insertions, 2 deletions
diff --git a/find-deprecated-pkgs b/find-deprecated-pkgs
index c2e599c..3be7b0f 100755
--- a/find-deprecated-pkgs
+++ b/find-deprecated-pkgs
@@ -39,7 +39,7 @@ for r in $repos_armv7h; do
done
# Parabola mirrors, used to check [libre] and [pcr] packages
-if [ $1 = parabola ]; then
+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/)
@@ -72,6 +72,8 @@ probably also from their -multilib, -testing and -multilib-testing derivatives.
This program only takes one argument, meaning that (for example) if you run
\`${0##*/} parabola arch' only 'parabola' is considered
EOM
+
+exit $STATUS
}
mkpkglist() {
@@ -98,11 +100,17 @@ check(){
grep ^$p $arch_pkgs &> /dev/null || printf '%s was not found\n' "$p"
done
;;
+ *) printf '%sError:%s %s is not a valid argument\n' \
+ "$(tput setaf 1)" \
+ "$(tput sgr0)" \
+ "$1"
+ false
+ ;;
esac
}
if [ -s $1 ]; then
usage
else
- check $1
+ check $1 || STATUS=$? usage
fi