aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Meier <maekke@gentoo.org>2010-07-19 22:12:28 +0200
committerMarkus Meier <maekke@gentoo.org>2010-07-19 22:12:28 +0200
commit5562fefacce940aff4ab4dbbf4566d09bcce7ee3 (patch)
treeaba456fe52fe15daa96b086005f0a193c90a5117 /scripts
parentin tree (diff)
downloadmaekke-5562fefacce940aff4ab4dbbf4566d09bcce7ee3.tar.gz
maekke-5562fefacce940aff4ab4dbbf4566d09bcce7ee3.tar.bz2
maekke-5562fefacce940aff4ab4dbbf4566d09bcce7ee3.zip
several improvements
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/keyword.sh20
1 files changed, 15 insertions, 5 deletions
diff --git a/scripts/keyword.sh b/scripts/keyword.sh
index 64be74e..5832d30 100755
--- a/scripts/keyword.sh
+++ b/scripts/keyword.sh
@@ -18,6 +18,7 @@ if [[ $# -lt 3 ]] ; then
echo " ${0} 2345 ppc =sys-kernel/vanilla-sources-2.6.25"
echo " ${0} 456 \"amd64 x86 sparc\" sys-apps/baselayout-2.0.0"
echo " ${0} 0 x86 media-gfx/graphviz (will generate a message w/o bug#)"
+ echo " ${0} -m \"some bug message\+ 1234 \"amd64 arm\+ sys-apps/baselayout-2.0.0"
exit 1
fi
@@ -33,6 +34,12 @@ if [[ ! -d ${REPODIR} ]] ; then
exit 1
fi
+if [[ ${1} == "-m" ]]; then
+ shift
+ bugz_message="$1"
+ shift
+fi
+
bugid="${1}"
arches="${2}"
shift 2
@@ -82,11 +89,14 @@ fi
[[ ${bugid} == 0 ]] && echo "done, as bug# is 0" && exit 0
tmpfile="$(mktemp)"
-${BUGZ} --base=https://bugs.gentoo.org get ${bugid} > ${tmpfile}
-aliases="$(grep ^CC ${tmpfile} | sed -e "s|CC +: ||g")"
-assignee="$(grep ^Assignee ${tmpfile} | sed -e "s|Assignee +: ||")"
+${BUGZ} get --base=https://bugs.gentoo.org ${bugid} > ${tmpfile}
+aliases="$(grep ^CC ${tmpfile} | awk '{ print $3 }')"
+assignee="$(grep ^Assignee ${tmpfile} | awk '{ print $3 }')"
rm ${tmpfile}
+[[ -z ${assignee} ]] && die "problem with bugz: assignee empty"
+[[ -z ${aliases} ]] && die "problem with bugz: aliases empty"
+
# only accept arches, no herds/users etc
for alias in ${aliases} ; do
if [[ $(grep ^${alias/@gentoo.org}\$ ${REPODIR}/profiles/arch.list | wc -l) -gt 0 ]] ; then
@@ -109,10 +119,10 @@ for arch in ${arches} ; do
done
if [[ ${lastarch} == "1" ]] ; then
- bugz_message="${arches// //} stable, all arches done."
+ [[ -z ${bugz_message} ]] && bugz_message="${arches// //} stable, all arches done."
[[ ${assignee} != "security@gentoo.org" ]] && bugz_options="${bugz_options} --fixed"
else
- bugz_message="${arches// //} stable"
+ [[ -z ${bugz_message} ]] && bugz_message="${arches// //} stable"
fi
echo "running ${BUGZ} modify ${bugid} ${bugz_options} --comment=\"${bugz_message}\""