* 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
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
ubuntu-dev-tools (0.73) karmic; urgency=low

View File

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