proc bugzilla:display:bug {bug_id} { global botnick bugzilla set chan {#gentoo-bots} set bugreport "[bugzilla:mysql:query ${bug_id}]" putloglev d * "bugreport=$bugreport" # crap crap... Is this line of text working? # lets change it from PRIVMSG/to a NOTICE as a test.. # - test worked. Bug #54499 set str "${bugreport}" set short_bugreport "[lindex $str 0] [lindex $str 4] [lrange $str 7 end]" set short_bugreport "[join $short_bugreport]" # try this fulgy hack. set str [join [split [lindex $str 4] "->"]] set from [lindex $str 0] set to [lindex $str 1] set to_dom [lindex [split $to "@"] 1] set from_dom [lindex [split $from "@"] 1] if {"${to_dom}" == "@gentoo"} { set to [lindex [split $to "@"] 0] } if {"${from_dom}" == "@gentoo"} { set from_dom [lindex [split $to "@"] 0] } set platform [string tolower [lindex "${bugreport}" 3]] set whom [lindex [split [lindex "${bugreport}" 4] ">"] 1] set whom [lindex "[split $whom @]" 0] if { "$whom" == "bug-wranglers" || "$whom" == "security" } { set maintainer "" foreach x [lrange ${short_bugreport} 2 end] { if {[string first / "$x" 0] != "-1" } { set pkg [string trim "$x" "*:?"] # time to lookup maintainer or herd set stripmagic "./>=-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ" if {[string trim "[string toupper $pkg]" "${stripmagic}" ] == "" } { if { "${maintainer}" == "" } { set maintainer "[exec ~/maintainer.py $pkg]" } else { break } } } } if { "${maintainer}" != "" } { set extra "(Reassign bug to ${maintainer} ?)" if { "$whom" == "security" } { set extra "(CC: ${maintainer} ?)" } set short_bugreport "${short_bugreport} ${extra}" set bugreport "${bugreport} ${extra}" } puthelp "PRIVMSG #gentoo-bugs :\[New Bug\] ${bugreport}"; } putquick "PRIVMSG #gentoo-bots :${short_bugreport}" # 04:45PM solar: yeah, we need emacs, xemacs, scheme, and common-lisp, not lisp # strait fwd mappings # General & Development Channels foreach item {embedded hardened security netmon releng devrel kernel games java eselect qa vdr cluster python guis} { if {"$whom" == "${item}"} { puthelp "PRIVMSG #gentoo-${whom} :\[New Bug\] ${bugreport}" return 0 } } if { "$whom" == "amd64" || "${platform}" == "amd64,"} { puthelp "PRIVMSG #gentoo-amd64-dev :${short_bugreport}" # Dont return for this mapping. It goes to two channels total. } # Platform Specific/support channels foreach item {hppa sparc mips amd64 bsd alpha arm alt} { if { "${whom}" == "${item}" || "${platform}" == "${whom}," } { puthelp "PRIVMSG #gentoo-${whom} :\[New Bug\] ${bugreport}" return 0 } } if { "$whom" == "x11" || "$whom" == "x11-drivers" || "$whom" == "gnome" || "$whom" == "xfce" || "$whom" == "rox" || "${whom}" == "kde" } { puthelp "PRIVMSG #gentoo-desktop :\[New Bug\] ${bugreport}" if { "$whom" == "xfce" || "$whom" == "kde" } { puthelp "PRIVMSG #gentoo-${whom} :\[New Bug\] ${bugreport}" } } if { "$whom" == "mysql-bugs" || "$whom" == "pgsql-bugs" } { puthelp "PRIVMSG #gentoo-db :\[New Bug\] ${bugreport}" } # 04:45PM solar: yeah, we need emacs, xemacs, scheme, and common-lisp, not lisp # hkBst: So to be clear. You say that emacs, xemacs, scheme, and common-lisp need to # go to #gentoo-lisp and there is no lisp@gentoo bugzilla user # 05:13PM solar: yes if { "$whom" == "emacs" || "$whom" == "xemacs" || "$whom" == "scheme" || "$whom" == "common-lisp" } { puthelp "PRIVMSG #gentoo-lisp :\[New Bug\] ${bugreport}" } # oddball remappings if { "$whom" == "ppc" || "$whom" == "ppc64" || "$platform" == "ppc," || "$platform" == "ppc64," } { puthelp "PRIVMSG #gentoo-powerpc :\[New Bug\] ${bugreport}" } if { "$whom" == "infra-bugs"} { puthelp "PRIVMSG #gentoo-infra :${short_bugreport}"; return 0;} if { "$whom" == "pms-bugs"} { puthelp "PRIVMSG #gentoo-pms :${bugreport}"; return 0;} if { "$whom" == "php-bugs"} { puthelp "PRIVMSG #gentoo-php :\[New Bug\] ${bugreport}"; return 0;} if { "$whom" == "gli-bugs"} { puthelp "PRIVMSG #gentoo-installer :\[New Bug\] ${bugreport}"; return 0;} if { "$whom" == "dev-portage"} { puthelp "PRIVMSG #gentoo-portage :\[New Bug\] ${bugreport}"; return 0; } if { "$whom" == "tools-portage"} { puthelp "PRIVMSG #gentoo-portage :\[New Bug\] ${bugreport}"; return 0; } if { "$whom" == "mirror-admin"} { puthelp "PRIVMSG #gentoo-mirrors :\[New Bug\] ${bugreport}"; return 0; } if { "$whom" == "apache-bugs"} { puthelp "PRIVMSG #gentoo-apache :\[New Bug\] ${bugreport}"; return 0; } if { "$whom" == "net-mail"} { puthelp "NOTICE #gentoo-netmail :[unixtime] - \[New Bug\] ${bugreport}"; return 0; } if { "$whom" == "toolchain"} { puthelp "NOTICE #gentoo-base :[unixtime] - \[New Bug\] ${bugreport}"; return 0; } if { "$whom" == "base-system"} { puthelp "NOTICE #gentoo-base :[unixtime] - \[New Bug\] ${bugreport}"; return 0; } if { "$whom" == "ppc-macos"} { puthelp "NOTICE #gentoo-osx :[unixtime] - \[New Bug\] ${bugreport}"; return 0; } if { "$whom" == "recruiters"} { # I want to know about these. puthelp "NOTICE solar :[unixtime] - \[FRESHMEAT\] ${short_bugreport}" puthelp "PRIVMSG #gentoo-devrel :\[New Bug\] ${short_bugreport}" return 0; } if { "$whom" == "docs-team"} { puthelp "NOTICE #gentoo-doc :[unixtime] - \[New Bug\] ${bugreport}"; return 0; } if { "$whom" == "web-apps"} { puthelp "NOTICE #gentoo-web :[unixtime] - \[New Bug\] ${bugreport}"; return 0; } if { "$whom" == "release"} { puthelp "NOTICE #gentoo-releng :[unixtime] - \[New Bug\] ${bugreport}"; return 0; } if { "$whom" == "crypto" || "$whom" == "forensics"} { puthelp "PRIVMSG #gentoo-netmon :\[New Bug\] ${bugreport}" return 0 } if { "$to" == "${from}," } { putlog "No reason to tell whom that they just filed a bug for themself ( $whom )" return 0 } # Try to hunt the dev down in the channel they most recently spoke in that we are on foreach min {1 2 3 4 5 10 30 60} { foreach c [channels] { if {[onchan "${whom}" "$c"]} { set itime [getchanidle "${whom}" "${c}"] if {($itime < $min)} { #putlog "PRIVMSG ${c} :${whom}: (itime ${itime}) ${bugreport}" #putserv "PRIVMSG $c :${whom}: ${bugreport}" putserv "PRIVMSG #gentoo-test :${whom}: ${bugreport} unixtime=$bugzilla(unixtime) lastbug=$bugzilla(lastbug) found=${c} ($itime < $min)" return 0 } } } } # Still nothing? - make this smarter! #putlog "Suppressing ${whom} / ${bugreport}" return 0 }