summaryrefslogtreecommitdiff
path: root/find-deprecated-pkgs
diff options
context:
space:
mode:
authorDavid P <megver83@parabola.nu>2018-09-06 00:48:26 -0300
committerDavid P <megver83@parabola.nu>2018-09-06 00:48:26 -0300
commitb6d936095ddfd0374ed501583d7c2755d5e69a6f (patch)
tree7b26c1eda32a654e802fa5344dac617dc63473c4 /find-deprecated-pkgs
parent402bdfe3d33ebc6d31c003ce7d700c6a0b45cdcc (diff)
find-deprecated-pkgs: advise when there are no pkgs to remove
Signed-off-by: David P <megver83@parabola.nu>
Diffstat (limited to 'find-deprecated-pkgs')
-rwxr-xr-xfind-deprecated-pkgs20
1 files changed, 14 insertions, 6 deletions
diff --git a/find-deprecated-pkgs b/find-deprecated-pkgs
index 246369e..e2bd276 100755
--- a/find-deprecated-pkgs
+++ b/find-deprecated-pkgs
@@ -128,7 +128,6 @@ submsg() {
"$(tput bold;tput setaf 4)" \
"$(tput sgr0)" \
"$1"
- out=x
}
get_libre_pkgs() {
@@ -150,6 +149,10 @@ get_libre_pkgs() {
fi
}
+add(){
+ list=$(( $list + 1 ))
+}
+
compare_pkgs(){
# $1 is the pkgname and replacement (used when checking Arch pkgs)
# $2 is the packages file list
@@ -206,8 +209,10 @@ compare_pkgs(){
# Arch
if [[ ${is_not_for[@]} = "x86_64 i686 armv7h" ]]; then
submsg "$package was not found"
+ add
elif [[ ${to_be_removed[@]} = "x86_64 i686 armv7h" ]]; then
submsg "$package was not found, but we've [libre] replacements which should be removed"
+ add
elif ! [[ ${is_not_for[@]} = "" ]] || ! [[ ${to_be_removed[@]} = "" ]]; then
for arch in ${to_be_removed[@]}; do
# If the replacement is available for the three arch'es supported
@@ -217,6 +222,7 @@ compare_pkgs(){
done
if ! [[ ${arches[*]} = "x86_64 i686 armv7h" ]]; then
submsg "$package ($arch) was not found, but we've a [libre] replacement which should be removed"
+ add
fi
unset arches
done
@@ -225,9 +231,11 @@ compare_pkgs(){
# Parabola
if [[ ${isnt_for[@]} = "x86_64 i686 armv7h" ]]; then
submsg "$package was not found"
+ add
elif ! [[ ${isnt_for[@]} = "" ]]; then
for arch in ${to_be_deleted[@]}; do
submsg "$package ($arch) was not found, but we've $replacement as replacement and should be removed"
+ add
done
fi
@@ -249,9 +257,7 @@ check(){
for p in $pkgs; do
compare_pkgs $p $parabola_pkgs
done
- rm -f $parabola_pkgs $libre_pkgs
- if [[ $out = x ]]; then submsg 'The blacklist matches all packages correctly'; fi
- msg 'done'
+ rm -f $parabola_pkgs
;;
arch) msg 'Comparing blacklists with Arch packages ...'
pkgs=$(for bl in $blacklists; do grep -v ^# $bl | awk '{print $1}'; done)
@@ -259,12 +265,14 @@ check(){
compare_pkgs $p $arch_pkgs
done
rm -f $arch_pkgs $libre_pkgs
- if [[ $out = x ]]; then submsg 'The blacklist matches all packages correctly'; fi
- msg 'done'
;;
*) err "$1 is not a valid argument"
;;
esac
+ if ! [[ $list -gt 0 ]]; then
+ submsg 'No packages to show'
+ fi
+ msg 'done'
}
if [[ $@ = "" ]]; then