summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2009-08-24 18:19:26 +0200
committerDan McGee <dan@archlinux.org>2009-09-24 05:46:38 +0200
commit2071286770b3dbe531423aa3e8517dac68f04154 (patch)
treed6f393817d3fbb3be71218f1bbd294228d62acfa
parent86d4b8a3aad8317ee4f7db9dc0d897a0809c0c04 (diff)
downloadpacman-2071286770b3dbe531423aa3e8517dac68f04154.tar.gz
pacman-2071286770b3dbe531423aa3e8517dac68f04154.tar.xz
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>
-rw-r--r--scripts/repo-add.sh.in13
1 files changed, 1 insertions, 12 deletions
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index a1e5f7f4..6aa7fe73 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -418,12 +418,6 @@ case "$1" in
-V|--version) version; exit 0;;
esac
-# check for correct number of args
-if [ $# -lt 2 ]; then
- usage
- exit 1
-fi
-
# figure out what program we are
cmd="$(basename $0)"
if [ "$cmd" != "repo-add" -a "$cmd" != "repo-remove" ]; then
@@ -445,12 +439,6 @@ success=0
for arg in "$@"; do
case "$arg" in
-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
REPO_DB_FILE="$arg"
@@ -493,6 +481,7 @@ if [ $success -eq 1 ]; then
[ -f "$tmpdir/$filename" ] && mv "$tmpdir/$filename" "$REPO_DB_FILE"
else
msg "$(gettext "No packages modified, nothing to do.")"
+ exit 1
fi
exit 0