]>
git.wh0rd.org - home.git/blob - .bin/er-close
3 . ~
/.profile.d
/gentoo.sh
8 [[ ${op} == "er" ]] && op
+=" -q"
9 tdir
="${HOME}/.cache/bugz"
11 find "${tdir}" -mmin +30 -type f
-delete
15 Usage: ${0##*/} <bugid> <reason> [<bugid> <reason> ...]
17 if [[ $# -gt 0 ]] ; then
18 printf '\nerror: %s\n' "$*"
26 while [[ $# -ne 0 ]] ; do
29 shift 2 || usage
"invalid args"
31 if [[ -z ${bug} ||
-n ${bug//[0-9#]} ]] ; then
41 bugs
=( "${bugs[@]}" ${b} )
42 comments
=( "${comments[@]}" "${reason}" )
44 xml
="${tdir}/${b}.xml"
45 # server doesn't support timestamps, so cannot use -N
46 if [[ ! -s $xml ]] ; then
47 wget
-q -O $xml https
://bugs.gentoo.org
/${b}?ctype
=xml
49 name
=$
(xml sel
-E utf8
-t -m bugzilla
/bug
/long_desc
-c who
-n $xml | \
50 head -${c} |
tail -1 |
grep -o 'name=".*">' | cut
-d\" -f2)
51 if [[ -z ${name} ]] ; then
52 name
=$
(xml sel
-E utf8
-t -m bugzilla
/bug
/long_desc
-v who
-n $xml | \
53 head -${c} |
tail -1 | cut
-d@
-f1)
56 if [[ -n ${cl_msg} ]] ; then
59 cl_msg
+="${reason} #${bug} by ${name}."
72 run
"$@" $op "${cl_msg}" ||
exit 1
74 for (( n
=0; n
< ${#bugs[@]}; ++n
)) ; do
77 local msg
="Commit message: $c$(printf '\n%s' ${urls})"
81 run
"$@" gbugz
-q modify
${b} --fixed -c "\
82 should be all set now in the tree; thanks for the report!
87 run
"$@" gbugz
-q modify
${b} -c "${msg}"
95 files
=$
(echo "$cvs" |
awk '$1 ~ /^[MA]/ { print $NF }' |
grep -v '^Manifest$')
96 unk_files
=$
(echo "$cvs" |
awk '$1 !~ /^[MARU]/')
97 if [[ -n ${unk_files} ]] ; then
102 urls
=$
(cvs_gentoo_url
${files} | LC_ALL
=C
sort -V)
107 printf "\nOk to go? [Y/n/e] "
112 echo "${cmds}" > "${t}"
113 ${EDITOR:-nano} "${t}" || rm "${t}"