3 . ~/.profile.d/gentoo.sh
4 . ~/.profile.d/aliases.sh
9 [[ ${op} == "er" ]] && op+=" -q"
10 tdir="${HOME}/.cache/bugz"
12 find "${tdir}" -mmin +30 -type f -delete
16 Usage: ${0##*/} <bugid> <reason> [<bugid> <reason> ...]
18 if [[ $# -gt 0 ]] ; then
19 printf '\nerror: %s\n' "$*"
27 while [[ $# -ne 0 ]] ; do
30 shift 2 || usage "invalid args"
32 if [[ -z ${bug} || -n ${bug//[0-9#]} ]] ; then
42 bugs=( "${bugs[@]}" ${b} )
43 comments=( "${comments[@]}" "${reason}" )
45 xml="${tdir}/${b}.xml"
46 # server doesn't support timestamps, so cannot use -N
47 if [[ ! -s $xml ]] ; then
48 wget -q -O $xml https://bugs.gentoo.org/${b}?ctype=xml
50 name=$(xml sel -E utf8 -t -m bugzilla/bug/long_desc -c who -n $xml | \
51 head -${c} | tail -1 | grep -o 'name=".*">' | cut -d\" -f2)
52 if [[ -z ${name} ]] ; then
53 name=$(xml sel -E utf8 -t -m bugzilla/bug/long_desc -v who -n $xml | \
54 head -${c} | tail -1 | cut -d@ -f1)
56 new_name=$(echo "${name}" | scrub_html | sed "s: [(\"'][^()\"']*[)\"']::g")
57 if [[ ${new_name} != "${name}" ]] ; then
58 echo "Normalizing '${name}' to '${new_name}'"
62 if [[ -n ${cl_msg} ]] ; then
65 cl_msg+="${reason} #${bug} by ${name}."
78 run "$@" $op "${cl_msg}" || exit 1
80 for (( n=0; n < ${#bugs[@]}; ++n )) ; do
83 local msg="Commit message: $c$(printf '\n%s' ${urls})"
87 run "$@" gbugz -q modify ${b} --fixed -c "\
88 should be all set now in the tree; thanks for the report!
93 run "$@" gbugz -q modify ${b} -c "${msg}"
101 files=$(echo "$cvs" | awk '$1 ~ /^[MA]/ { print $NF }' | grep -v '^Manifest$')
102 unk_files=$(echo "$cvs" | awk '$1 !~ /^[MARU]/')
103 if [[ -n ${unk_files} ]] ; then
104 echo "unknown files:"
108 urls=$(cvs_gentoo_url ${files} | LC_ALL=C sort -V)
113 printf "\nOk to go? [Y/n/e] "
118 echo "${cmds}" > "${t}"
119 ${EDITOR:-nano} "${t}" || rm "${t}"