Support old repoman versions.

If repoman doesn't support '-a', drop it and ask before calling it.
This commit is contained in:
Michał Górny 2010-07-12 10:20:31 +02:00
parent 94e04f960c
commit fd1dc7ae28

View File

@ -4,13 +4,17 @@
# Released under the terms of the 3-clause BSD license.
# Few output helpers.
die() {
say() {
echo "${@}" >&2
}
die() {
say "${@}"
exit 1
}
sayv() {
[ -n "${SC_VERBOSE}" ] && echo "${@}" >&2
[ -n "${SC_VERBOSE}" ] && say "${@}"
}
req() {
@ -159,8 +163,36 @@ main() {
vcs_status
echo
# Do we have repoman new enough?
local old_repoman
repoman --version -a >/dev/null 2>&1
if [ $? -eq 2 ]; then
old_repoman=
say 'Please update portage to newer version in order to have repoman supporting'
say "--ask option and thus delay the following question until after 'repoman full'."
say
while true; do
local answ
printf '%s' 'Commit changes? [Yes/No] ' >&2
read answ
case "${answ}" in
[yY]|[yY][eE]|[yY][eE][sS])
break
;;
[nN]|[nN][oO])
die 'Aborting.'
;;
*)
say "Response '${answ}' not understood, try again."
esac
done
fi
sayv "Now, let's let repoman do its job..."
exec repoman commit -a -m "${SC_CP}: ${commitmsg}"
exec repoman commit ${old_repoman--a} -m "${SC_CP}: ${commitmsg}"
;;
esac
}