mirror of
https://github.com/moparisthebest/pacman
synced 2025-01-10 05:18:16 -05:00
repo-add: clean up options parsing
-f/--force has been dead for a while, so kill it off. In addition, the check for > 2 args is pretty useless when you do something like: repo-add -q -q or a more legit: repo-add -q /path/to/mine.db.tar.gz So instead make repo-add just return 1 when it doesn't do anything with the database which seems to make more sense. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
86d4b8a3aa
commit
2071286770
@ -418,12 +418,6 @@ case "$1" in
|
|||||||
-V|--version) version; exit 0;;
|
-V|--version) version; exit 0;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# check for correct number of args
|
|
||||||
if [ $# -lt 2 ]; then
|
|
||||||
usage
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# figure out what program we are
|
# figure out what program we are
|
||||||
cmd="$(basename $0)"
|
cmd="$(basename $0)"
|
||||||
if [ "$cmd" != "repo-add" -a "$cmd" != "repo-remove" ]; then
|
if [ "$cmd" != "repo-add" -a "$cmd" != "repo-remove" ]; then
|
||||||
@ -445,12 +439,6 @@ success=0
|
|||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
-q|--quiet) QUIET=1;;
|
-q|--quiet) QUIET=1;;
|
||||||
|
|
||||||
-f|--force)
|
|
||||||
warning "$(gettext "the -f and --force options are no longer recognized")"
|
|
||||||
msg2 "$(gettext "use options=(force) in the PKGBUILD instead")"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
*)
|
||||||
if [ -z "$REPO_DB_FILE" ]; then
|
if [ -z "$REPO_DB_FILE" ]; then
|
||||||
REPO_DB_FILE="$arg"
|
REPO_DB_FILE="$arg"
|
||||||
@ -493,6 +481,7 @@ if [ $success -eq 1 ]; then
|
|||||||
[ -f "$tmpdir/$filename" ] && mv "$tmpdir/$filename" "$REPO_DB_FILE"
|
[ -f "$tmpdir/$filename" ] && mv "$tmpdir/$filename" "$REPO_DB_FILE"
|
||||||
else
|
else
|
||||||
msg "$(gettext "No packages modified, nothing to do.")"
|
msg "$(gettext "No packages modified, nothing to do.")"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user