* update-maintainer:

- Convert to getopt so that '--section main' works as well as
    '--section=main'.
This commit is contained in:
Colin Watson 2009-05-12 00:05:06 +01:00
parent f25358a175
commit 0a28dbb15d
2 changed files with 28 additions and 18 deletions

5
debian/changelog vendored
View File

@ -30,6 +30,11 @@ ubuntu-dev-tools (0.74) UNRELEASED; urgency=low
- Check if user has upload privileges instead of checking for team - Check if user has upload privileges instead of checking for team
membership when seeing if operations are permitted membership when seeing if operations are permitted
[ Colin Watson ]
* update-maintainer:
- Convert to getopt so that '--section main' works as well as
'--section=main'.
-- Iain Lane <laney@ubuntu.com> Sun, 10 May 2009 19:13:34 +0100 -- Iain Lane <laney@ubuntu.com> Sun, 10 May 2009 19:13:34 +0100
ubuntu-dev-tools (0.73) karmic; urgency=low ubuntu-dev-tools (0.73) karmic; urgency=low

View File

@ -29,27 +29,32 @@ Usage: $0 [--path=PATH] [--section=SECTION]
EOF EOF
} }
for argv in "$@"; do eval set -- "$(getopt -o '' -l path:,section:,help -- "$@")" || { usage >&2; exit 1; }
param=${argv%=*} while :; do
value=${argv#*=} case $1 in
case $param in --path)
"--path") path="$2"
path="$value" shift 2
;; ;;
"--section") --section)
[ "$value" != "main" ] && [ "$2" != "main" ] &&
[ "$value" != "restricted" ] && [ "$2" != "restricted" ] &&
[ "$value" != "universe" ] && [ "$2" != "universe" ] &&
[ "$value" != "multiverse" ] && echo "Invalid section. Valid sections: main restricted universe multiverse" >&2 && exit 1 [ "$2" != "multiverse" ] && echo "Invalid section. Valid sections: main restricted universe multiverse" >&2 && exit 1
section=$value section="$2"
shift 2
;; ;;
"--help") --help)
usage usage
exit 0 exit 0
;; ;;
--)
shift
break
;;
*) *)
echo "Bad parameter." echo "Bad parameter."
usage usage >&2
exit 1 exit 1
;; ;;
esac esac