summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-irc/irker/files')
-rw-r--r--net-irc/irker/files/2.7-Register-author_name-as-author-instead-of-email-user.patch32
-rw-r--r--net-irc/irker/files/2.7-irkerhook-Remove-file-listing.patch105
-rw-r--r--net-irc/irker/files/irker.conf.d4
-rw-r--r--net-irc/irker/files/irker.init25
-rw-r--r--net-irc/irker/files/irkerd.confd21
-rw-r--r--net-irc/irker/files/irkerd.initd47
6 files changed, 234 insertions, 0 deletions
diff --git a/net-irc/irker/files/2.7-Register-author_name-as-author-instead-of-email-user.patch b/net-irc/irker/files/2.7-Register-author_name-as-author-instead-of-email-user.patch
new file mode 100644
index 000000000000..a19da1f4a48d
--- /dev/null
+++ b/net-irc/irker/files/2.7-Register-author_name-as-author-instead-of-email-user.patch
@@ -0,0 +1,32 @@
+From 108e898c600cf7a80a3d01a83a270c7579460b42 Mon Sep 17 00:00:00 2001
+From: Bertrand Jacquin <beber@meleeweb.net>
+Date: Mon, 23 Sep 2013 23:10:23 +0200
+Subject: [PATCH 1/3] Register author_name as author instead of email userpart
+
+Signed-off-by: Bertrand Jacquin <beber@meleeweb.net>
+---
+ irkerhook.py | 11 ++---------
+ 1 file changed, 2 insertions(+), 9 deletions(-)
+
+diff --git a/irkerhook.py b/irkerhook.py
+index 5f15032..36a875e 100755
+--- a/irkerhook.py
++++ b/irkerhook.py
+@@ -275,15 +275,8 @@ class GitExtractor(GenericExtractor):
+ # Design choice: for git we ship only the first message line, which is
+ # conventionally supposed to be a summary of the commit. Under
+ # other VCSes a different choice may be appropriate.
+- commit.author_name, commit.mail, commit.logmsg = \
+- do("git log -1 '--pretty=format:%an%n%ae%n%s' " + shellquote(commit.commit)).split("\n")
+- # This discards the part of the author's address after @.
+- # Might be be nice to ship the full email address, if not
+- # for spammers' address harvesters - getting this wrong
+- # would make the freenode #commits channel into harvester heaven.
+- commit.author = commit.mail.split("@")[0]
+- commit.author_date, commit.commit_date = \
+- do("git log -1 '--pretty=format:%ai|%ci' " + shellquote(commit.commit)).split("|")
++ commit.logmsg = do("git log -1 '--pretty=format:%s' " + shellquote(commit.commit))
++ commit.author = do("git log -1 '--pretty=format:%an' " + shellquote(commit.commit))
+ return commit
+
+ class SvnExtractor(GenericExtractor):
diff --git a/net-irc/irker/files/2.7-irkerhook-Remove-file-listing.patch b/net-irc/irker/files/2.7-irkerhook-Remove-file-listing.patch
new file mode 100644
index 000000000000..cbbb38c22ea6
--- /dev/null
+++ b/net-irc/irker/files/2.7-irkerhook-Remove-file-listing.patch
@@ -0,0 +1,105 @@
+From 82376d74107035950ef4181fdc889ae9409378b6 Mon Sep 17 00:00:00 2001
+From: Bertrand Jacquin <beber@meleeweb.net>
+Date: Mon, 7 Oct 2013 13:33:30 +0200
+Subject: [PATCH 2/3] irkerhook: Remove file listing
+
+Signed-off-by: Bertrand Jacquin <beber@meleeweb.net>
+---
+ irkerhook.py | 34 +++-------------------------------
+ 1 file changed, 3 insertions(+), 31 deletions(-)
+
+diff --git a/irkerhook.py b/irkerhook.py
+index 36a875e..f2f82cf 100755
+--- a/irkerhook.py
++++ b/irkerhook.py
+@@ -57,7 +57,6 @@ class Commit:
+ self.rev = None
+ self.mail = None
+ self.author = None
+- self.files = None
+ self.logmsg = None
+ self.url = None
+ self.author_date = None
+@@ -224,7 +223,7 @@ class GitExtractor(GenericExtractor):
+ self.channels = do("git config --get irker.channels")
+ self.email = do("git config --get irker.email")
+ self.tcp = do("git config --bool --get irker.tcp")
+- self.template = '%(bold)s%(project)s:%(reset)s %(green)s%(author)s%(reset)s %(repo)s:%(yellow)s%(branch)s%(reset)s * %(bold)s%(rev)s%(reset)s / %(bold)s%(files)s%(reset)s: %(logmsg)s %(brown)s%(url)s%(reset)s'
++ self.template = '%(bold)s%(project)s:%(reset)s %(green)s%(author)s%(reset)s %(repo)s:%(yellow)s%(branch)s%(reset)s * %(bold)s%(rev)s%(reset)s: %(logmsg)s %(brown)s%(url)s%(reset)s'
+ self.tinyifier = do("git config --get irker.tinyifier") or default_tinyifier
+ self.color = do("git config --get irker.color")
+ self.urlprefix = do("git config --get irker.urlprefix") or "gitweb"
+@@ -269,9 +268,6 @@ class GitExtractor(GenericExtractor):
+ commit.rev = do("git describe %s 2>/dev/null" % shellquote(commit.commit))
+ if not commit.rev:
+ commit.rev = commit.commit[:12]
+- # Extract the meta-information for the commit
+- commit.files = do("git diff-tree -r --name-only " + shellquote(commit.commit))
+- commit.files = " ".join(commit.files.strip().split("\n")[1:])
+ # Design choice: for git we ship only the first message line, which is
+ # conventionally supposed to be a summary of the commit. Under
+ # other VCSes a different choice may be appropriate.
+@@ -292,7 +288,7 @@ class SvnExtractor(GenericExtractor):
+ if tok.startswith("--repository="):
+ self.repository = tok[13:]
+ self.project = os.path.basename(self.repository)
+- self.template = '%(bold)s%(project)s%(reset)s: %(green)s%(author)s%(reset)s %(repo)s * %(bold)s%(rev)s%(reset)s / %(bold)s%(files)s%(reset)s: %(logmsg)s %(brown)s%(url)s%(reset)s'
++ self.template = '%(bold)s%(project)s%(reset)s: %(green)s%(author)s%(reset)s %(repo)s * %(bold)s%(rev)s%(reset)s: %(logmsg)s %(brown)s%(url)s%(reset)s'
+ self.urlprefix = "viewcvs"
+ self.load_preferences(os.path.join(self.repository, "irker.conf"))
+ self.do_overrides()
+@@ -306,7 +302,6 @@ class SvnExtractor(GenericExtractor):
+ commit.rev = "r%s" % self.id
+ commit.author = self.svnlook("author")
+ commit.commit_date = self.svnlook("date").partition('(')[0]
+- commit.files = self.svnlook("dirs-changed").strip().replace("\n", " ")
+ commit.logmsg = self.svnlook("log").strip()
+ return commit
+ def svnlook(self, info):
+@@ -350,7 +345,7 @@ class HgExtractor(GenericExtractor):
+ self.channels = ui.config('irker', 'channels')
+ self.email = ui.config('irker', 'email')
+ self.tcp = str(ui.configbool('irker', 'tcp')) # converted to bool again in do_overrides
+- self.template = '%(bold)s%(project)s:%(reset)s %(green)s%(author)s%(reset)s %(repo)s:%(yellow)s%(branch)s%(reset)s * %(bold)s%(rev)s%(reset)s / %(bold)s%(files)s%(reset)s: %(logmsg)s %(brown)s%(url)s%(reset)s'
++ self.template = '%(bold)s%(project)s:%(reset)s %(green)s%(author)s%(reset)s %(repo)s:%(yellow)s%(branch)s%(reset)s * %(bold)s%(rev)s%(reset)s: %(logmsg)s %(brown)s%(url)s%(reset)s'
+ self.tinyifier = ui.config('irker', 'tinyifier') or default_tinyifier
+ self.color = ui.config('irker', 'color')
+ self.urlprefix = (ui.config('irker', 'urlprefix') or
+@@ -380,9 +375,6 @@ class HgExtractor(GenericExtractor):
+ commit.author_date = \
+ datetime.datetime.fromtimestamp(ctx.date()[0]).strftime('%Y-%m-%d %H:%M:%S')
+ commit.logmsg = ctx.description()
+- # Extract changed files from status against first parent
+- st = self.repository.status(ctx.p1().node(), ctx.node())
+- commit.files = ' '.join(st[0] + st[1] + st[2])
+ return commit
+
+ def hg_hook(ui, repo, **kwds):
+@@ -423,27 +415,7 @@ def ship(extractor, commit, debug):
+ sys.stderr.write("irkerhook.py: could not decode JSON: %s\n" % data)
+ raise SystemExit, 1
+
+- # Rewrite the file list if too long. The objective here is only
+- # to be easier on the eyes.
+- if extractor.cialike \
+- and extractor.cialike.lower() != "none" \
+- and len(metadata.files) > int(extractor.cialike):
+- files = metadata.files.split()
+- dirs = set([d.rpartition('/')[0] for d in files])
+- if len(dirs) == 1:
+- metadata.files = "(%s files)" % (len(files),)
+- else:
+- metadata.files = "(%s files in %s dirs)" % (len(files), len(dirs))
+- # Message reduction. The assumption here is that IRC can't handle
+- # lines more than 510 characters long. If we exceed that length, we
+- # try knocking out the file list, on the theory that for notification
+- # purposes the commit text is more important. If it's still too long
+- # there's nothing much can be done other than ship it expecting the IRC
+- # server to truncate.
+ privmsg = unicode(metadata)
+- if len(privmsg) > 510:
+- metadata.files = ""
+- privmsg = unicode(metadata)
+
+ # Anti-spamming guard. It's deliberate that we get maxchannels not from
+ # the user-filtered metadata but from the extractor data - means repo
diff --git a/net-irc/irker/files/irker.conf.d b/net-irc/irker/files/irker.conf.d
new file mode 100644
index 000000000000..b7974bce91a3
--- /dev/null
+++ b/net-irc/irker/files/irker.conf.d
@@ -0,0 +1,4 @@
+# /etc/conf.d/irkerd: config file for /etc/init.d/irkerd
+
+# see man pages for irkerd for valid cmdline options
+#IRKERD_OPTS=""
diff --git a/net-irc/irker/files/irker.init b/net-irc/irker/files/irker.init
new file mode 100644
index 000000000000..367d548205e0
--- /dev/null
+++ b/net-irc/irker/files/irker.init
@@ -0,0 +1,25 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+command="/usr/bin/irkerd"
+command_args="${IRKERD_OPTS}"
+pidfile="/var/run/${SVCNAME}.pid"
+
+depend() {
+ use net
+}
+
+start () {
+ ebegin "Starting irkerd"
+ start-stop-daemon --start --quiet --exec $command
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping irkerd"
+ start-stop-daemon --stop --quiet --exec $command
+ eend $?
+}
+
diff --git a/net-irc/irker/files/irkerd.confd b/net-irc/irker/files/irkerd.confd
new file mode 100644
index 000000000000..f176e6246b36
--- /dev/null
+++ b/net-irc/irker/files/irkerd.confd
@@ -0,0 +1,21 @@
+# /etc/conf.d/irkerd: config file for /etc/init.d/irkerd
+
+# Nick-Serv login
+# IRKERD_NICK=""
+
+# Nick-Server password
+# IRKERD_PASSWORD=""
+
+# Log file, intended for debug purpose only, no logrotate will
+# handle this logfile
+# IRKERD_LOGFILE=""
+
+# Debug Level (critical, error, warning, info, debug)
+# IRKERD_LOGLEVEL=""
+
+# To run an anonymous irkerd safely. It should not able able
+# to write to anywhere on your system
+# IRKERD_USER=""
+
+# see man pages for irkerd for valid cmdline options
+# IRKERD_OPTS=""
diff --git a/net-irc/irker/files/irkerd.initd b/net-irc/irker/files/irkerd.initd
new file mode 100644
index 000000000000..246fcf4823b9
--- /dev/null
+++ b/net-irc/irker/files/irkerd.initd
@@ -0,0 +1,47 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+: ${pidfile:=/run/${RC_SVCNAME}.pid}
+
+: ${IRKERD_NICK:=}
+: ${IRKERD_PASSWORD:=}
+: ${IRKERD_LOGFILE:=/var/log/${RC_SVCNAME}.log}
+: ${IRKERD_LOGLEVEL:=0}
+: ${IRKERD_USER:=nobody}
+
+depend() {
+ use net
+}
+
+start () {
+ if [[ ${IRKERD_LOGLEVEL} ]] ; then
+ IRKERD_OPTS="${IRKERD_OPTS} -d ${IRKERD_LOGLEVEL}"
+
+ ewarn "IRKERD_LOGLEVEL is intended to be used for debugging purpose only"
+ ewarn "No logrotate can handle ${IRKERD_LOGFILE}"
+
+ checkpath -f \
+ -o "${IRKERD_USER}" \
+ "${IRKERD_LOGFILE}" \
+ || return 1
+ fi
+
+ if [[ -z "${IRKERD_USER}" ]] ; then
+ die "IRKERD_USER is mandatory"
+ fi
+
+ [[ -n "${IRKERD_LOGFILE}" ]] && IRKERD_OPTS="${IRKERD_OPTS} -l ${IRKERD_LOGFILE}"
+ [[ -n "${IRKERD_NICK}" ]] && IRKERD_OPTS="${IRKERD_OPTS} -n ${IRKERD_NICK}"
+ [[ -n "${IRKERD_PASSWORD}" ]] && IRKERD_OPTS="${IRKERD_OPTS} -p ${IRKERD_PASSWORD}"
+
+ ebegin "Starting ${RC_SVCNAME}"
+ start-stop-daemon --start \
+ --quiet --background \
+ --user "${IRKERD_USER}" \
+ --make-pidfile --pidfile "${pidfile}" \
+ --exec /usr/bin/irkerd \
+ -- ${IRKERD_OPTS} < /dev/null
+ eend $?
+}