added echo error on ignored when ignored packages file does not exist
This commit is contained in:
10
pman.sh
10
pman.sh
@@ -48,6 +48,11 @@ elif [ "$command_args" = "reflector" ]; then
|
|||||||
fi
|
fi
|
||||||
su_needed=true
|
su_needed=true
|
||||||
elif [ "$command_args" = "ignored" ]; then
|
elif [ "$command_args" = "ignored" ]; then
|
||||||
|
if [ ! -f "$ignoredpkgs_file" ]; then
|
||||||
|
echo "Error: $ignoredpkgs_file does not exist, no packages ignored" >&2
|
||||||
|
echo "use $0 ignore <pkgname> to start" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
command="echo"
|
command="echo"
|
||||||
command_args="$(cat $ignoredpkgs_file | sed 's/IgnorePkg = //' | sort)"
|
command_args="$(cat $ignoredpkgs_file | sed 's/IgnorePkg = //' | sort)"
|
||||||
elif [ "$command_args" = "ignore" ]; then
|
elif [ "$command_args" = "ignore" ]; then
|
||||||
@@ -63,6 +68,11 @@ elif [ "$command_args" = "ignore" ]; then
|
|||||||
done
|
done
|
||||||
exit 0
|
exit 0
|
||||||
elif [ "$command_args" = "unignore" ]; then
|
elif [ "$command_args" = "unignore" ]; then
|
||||||
|
if [ ! -f "$ignoredpkgs_file" ]; then
|
||||||
|
echo "Error: $ignoredpkgs_file does not exist, no packages ignored" >&2
|
||||||
|
echo "use $0 ignore <pkgname> to start" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
for pkg in "${@}"; do
|
for pkg in "${@}"; do
|
||||||
command="sed"
|
command="sed"
|
||||||
su_needed=true
|
su_needed=true
|
||||||
|
|||||||
Reference in New Issue
Block a user