Verified Commit 819e4a69 authored by Paul Wise's avatar Paul Wise

Add a script to check usertags for typos and other issues (Closes: #824904)

This will help ensure that usertags are on the right email addresses.
parent 2a2c2b80
# Print out BTS commands to fix typos and other usertags issues
# CRON=46 19 * * *
set -e
print_bts_usertags_cmdline () {
bad="$(basename "$2")"
echo -n "bts user $bad , "
for tag in $(sed --quiet "s/Tag: //p" "$2") ; do
for bug in $(sed --quiet "/^Tag: $tag/,/^$/{/^Tag: /d;p}" "$2" | grep --only-matching '[0-9]*') ; do
echo -n "usertags $bug - $tag , "
echo -n "user $good , "
for tag in $(sed --quiet "s/Tag: //p" "$2") ; do
for bug in $(sed --quiet "/^Tag: $tag/,/^$/{/^Tag:/d;p}" "$2" | grep --only-matching '[0-9]*') ; do
echo -n "usertags $bug + $tag , "
find_and_correct () {
local f
test -d "$1" || return 0
find "$1/" -type f | while read -r f ; do
print_bts_usertags_cmdline "$(basename "$f" | sed "$2")" "$f"
copy () {
mkdir --parents "$dir"
find all -type f -wholename "all/*/$1" -print0 |
xargs --null --no-run-if-empty cp --target-directory "$dir"
mkdir --parents "$scratchdir"
cd "$scratchdir"
rsync --timeout=60 --recursive --delete rsync:// all/
# tagsregex=$(ssh "sed '/^1;$/i print join \"|\", @gTags;' < /srv/ | perl")
#grep -rE "^Tag: ($tagsregex)$" all || true
rm --recursive --force fixes
mkdir fixes
copy '*.or' or
copy '*.ort' ort
copy '*.ogr' ogr
copy '*.rog' rog
copy '*.orge' orge
copy '*.orrg' orrg
copy '*.d.o' d.o
copy '*.d.n' d.n
copy '*debia[.-]*' debia
copy '*debiarn*' debiarn
copy '*dbeian*' dbeian
copy '*debain*' debain
copy '*deban*' deban
copy '*.debian' debian
copy '*.debian-org' debian-org
copy '*.debian-net' debian-net
copy '*.debian-com' debian-com
#copy '*'
copy '*'
copy '*'
copy '*packge*' packge
copy '*' package
copy '*' list
copy '*' alioth
copy '**' qa
copy '' 68k
copy '' s390
copy '' power
copy '' ppc
copy '*mulitarch*' mulitarch
cd fixes
find . -type f -print0 | xargs --null --no-run-if-empty rename 's/%40/@/'
find . -empty -delete
find_and_correct or 's/\.or$/.org/'
find_and_correct ort 's/\.ort$/.org/'
find_and_correct ogr 's/\.ogr$/.org/'
find_and_correct rog 's/\.rog$/.org/'
find_and_correct orge 's/\.orge$/.org/'
find_and_correct orrg 's/\.orrg$/.org/'
find_and_correct d.o 's/\.d\.o$/'
find_and_correct d.n 's/\.d\.n$/'
find_and_correct debiarn 's/debiarn/debian/g'
find_and_correct dbeian 's/dbeian/debian/g'
find_and_correct debain 's/debain/debian/g'
find_and_correct debia 's/debia\([-.]\)/debian\1/g'
find_and_correct deban 's/deban/debian/g'
find_and_correct debian 's/\.debian$/&.org/'
find_and_correct debian-org 's/debian-org/'
find_and_correct debian-net 's/debian-net/'
find_and_correct debian-com 's/debian-com/'
find_and_correct 's/\.debian\.com$/'
#find_and_correct 's/\.debian\.net$/'
find_and_correct 's/packages\.qa\.debian\.org$/'
find_and_correct package 's/package\.debian\.org$/'
find_and_correct packge 's/packges\?\.debian\.org$/'
find_and_correct list 's/list\.debian\.org$/'
find_and_correct qa 's/\.debian\.org@bugs\.debian\.org$/'
find_and_correct alioth 's/@alioth\.debian\.org$/'
find_and_correct 68k 's/m68k/68k/g'
find_and_correct s390 's/s390x/s390/g'
find_and_correct power 's/power@/powerpc@/'
find_and_correct ppc 's/ppc/powerpc/g'
find_and_correct mulitarch 's/mulitarch/multiarch/g'
rm -rf fixes
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment