diff options
Diffstat (limited to 'debian/patches')
-rw-r--r-- | debian/patches/0001-dfsg.patch | 22 | ||||
-rw-r--r-- | debian/patches/0005-author-name.patch | 21 | ||||
-rw-r--r-- | debian/patches/0007-Update-HgExtractor-to-work-with-mercurial-using-pyth.patch | 92 | ||||
-rw-r--r-- | debian/patches/0007-irkerhook-git.patch | 28 | ||||
-rw-r--r-- | debian/patches/0008-Update-irkerhook-to-recent-mercurial-changes.patch | 25 | ||||
-rw-r--r-- | debian/patches/0009-env-service.patch | 29 | ||||
-rw-r--r-- | debian/patches/0015-Update-irkerhook-documentation-to-python-3.patch | 32 | ||||
-rw-r--r-- | debian/patches/0016-Update-shebangs.patch | 78 | ||||
-rw-r--r-- | debian/patches/series | 8 |
9 files changed, 335 insertions, 0 deletions
diff --git a/debian/patches/0001-dfsg.patch b/debian/patches/0001-dfsg.patch new file mode 100644 index 0000000..891eaeb --- /dev/null +++ b/debian/patches/0001-dfsg.patch @@ -0,0 +1,22 @@ +From: Daniel Baumann <mail@daniel-baumann.ch> +Date: Sun, 13 May 2018 15:07:57 +0200 +Subject: Removing logo (no origin known and no source available) + +--- + Makefile | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 50da117..681a5d1 100644 +--- a/Makefile ++++ b/Makefile +@@ -92,8 +92,7 @@ SOURCES = \ + + EXTRA_DIST = \ + org.catb.irkerd.plist \ +- irkerd.service \ +- irker-logo.png ++ irkerd.service + + version: + @echo $(VERS) diff --git a/debian/patches/0005-author-name.patch b/debian/patches/0005-author-name.patch new file mode 100644 index 0000000..864e497 --- /dev/null +++ b/debian/patches/0005-author-name.patch @@ -0,0 +1,21 @@ +From: Daniel Baumann <mail@daniel-baumann.ch> +Date: Sun, 13 May 2018 15:07:57 +0200 +Subject: Use author_name instead of author in Git notifications. + +--- + irkerhook.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/irkerhook.py b/irkerhook.py +index 7dcd6b2..661071b 100755 +--- a/irkerhook.py ++++ b/irkerhook.py +@@ -325,7 +325,7 @@ class GitExtractor(GenericExtractor): + # 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 = commit.author_name + commit.author_date, commit.commit_date = \ + do("git log -1 '--pretty=format:%ai|%ci' " + shellquote(commit.commit)).split("|") + return commit diff --git a/debian/patches/0007-Update-HgExtractor-to-work-with-mercurial-using-pyth.patch b/debian/patches/0007-Update-HgExtractor-to-work-with-mercurial-using-pyth.patch new file mode 100644 index 0000000..b341444 --- /dev/null +++ b/debian/patches/0007-Update-HgExtractor-to-work-with-mercurial-using-pyth.patch @@ -0,0 +1,92 @@ +From: Neil Muller <drnlmuller+debian@gmail.com> +Date: Mon, 8 Feb 2021 17:05:21 +0200 +Subject: Update HgExtractor to work with mercurial using python 3 + +From upstream commit: 6e9372a2e297b0925d951d178ce39840d99277c6 + +Forwarded: not-needed +--- + irkerhook.py | 45 +++++++++++++++++++++++++-------------------- + 1 file changed, 25 insertions(+), 20 deletions(-) + +diff --git a/irkerhook.py b/irkerhook.py +index bf697ab..e6b8f04 100755 +--- a/irkerhook.py ++++ b/irkerhook.py +@@ -369,6 +369,7 @@ class HgExtractor(GenericExtractor): + def is_repository(directory): + return has(directory, [".hg"]) + def __init__(self, arguments): ++ from mercurial.encoding import unifromlocal + # This fiddling with arguments is necessary since the Mercurial hook can + # be run in two different ways: either directly via Python (in which + # case hg should be pointed to the hg_hook function below) or as a +@@ -395,24 +396,27 @@ class HgExtractor(GenericExtractor): + + GenericExtractor.__init__(self, arguments) + # Extract global values from the hg configuration file(s) +- self.project = ui.config('irker', 'project') +- self.repo = ui.config('irker', 'repo') +- self.server = ui.config('irker', 'server') +- 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 = ui.config('irker', 'template') or '%(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.tinyifier = ui.config('irker', 'tinyifier') or default_tinyifier +- self.color = ui.config('irker', 'color') +- self.urlprefix = (ui.config('irker', 'urlprefix') or +- ui.config('web', 'baseurl') or '') ++ self.project = unifromlocal(ui.config(b'irker', b'project') or b'') ++ self.repo = unifromlocal(ui.config(b'irker', b'repo') or b'') ++ self.server = unifromlocal(ui.config(b'irker', b'server') or b'') ++ self.channels = unifromlocal(ui.config(b'irker', b'channels') or b'') ++ self.email = unifromlocal(ui.config(b'irker', b'email') or b'') ++ self.tcp = str(ui.configbool(b'irker', b'tcp')) # converted to bool again in do_overrides ++ self.template = unifromlocal(ui.config(b'irker', b'template') or b'') ++ if not self.template: ++ 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.tinyifier = unifromlocal(ui.config(b'irker', b'tinyifier') ++ or default_tinyifier.encode('utf-8')) ++ self.color = unifromlocal(ui.config(b'irker', b'color') or b'') ++ self.urlprefix = unifromlocal((ui.config(b'irker', b'urlprefix') or ++ ui.config(b'web', b'baseurl') or b'')) + if self.urlprefix: + # self.commit is appended to this by do_overrides + self.urlprefix = self.urlprefix.rstrip('/') + '/rev/' +- self.cialike = ui.config('irker', 'cialike') +- self.filtercmd = ui.config('irker', 'filtercmd') ++ self.cialike = unifromlocal(ui.config(b'irker', b'cialike') or b'') ++ self.filtercmd = unifromlocal(ui.config(b'irker', b'filtercmd') or b'') + if not self.project: +- self.project = os.path.basename(self.repository.root.rstrip('/')) ++ self.project = os.path.basename(unifromlocal(self.repository.root).rstrip('/')) + self.do_overrides() + def head(self): + "Return a symbolic reference to the tip commit of the current branch." +@@ -421,19 +425,20 @@ class HgExtractor(GenericExtractor): + "Make a Commit object holding data for a specified commit ID." + from mercurial.node import short + from mercurial.templatefilters import person +- node = self.repository.lookup(commit_id) +- commit = Commit(self, short(node)) ++ from mercurial.encoding import unifromlocal ++ ctx = self.repository[commit_id] ++ commit = Commit(self, unifromlocal(short(ctx.hex()))) + # Extract commit-specific values from a "context" object + ctx = self.repository.changectx(node) + commit.rev = '%d:%s' % (ctx.rev(), commit.commit) +- commit.branch = ctx.branch() +- commit.author = person(ctx.user()) ++ commit.branch = unifromlocal(ctx.branch()) ++ commit.author = unifromlocal(person(ctx.user())) + commit.author_date = \ + datetime.datetime.fromtimestamp(ctx.date()[0]).strftime('%Y-%m-%d %H:%M:%S') +- commit.logmsg = ctx.description() ++ commit.logmsg = unifromlocal(ctx.description()) + # Extract changed files from status against first parent + st = self.repository.status(ctx.p1().node(), ctx.node()) +- commit.files = ' '.join(st.modified + st.added + st.removed) ++ commit.files = unifromlocal(b' '.join(st.modified + st.added + st.removed)) + return commit + + def hg_hook(ui, repo, **kwds): diff --git a/debian/patches/0007-irkerhook-git.patch b/debian/patches/0007-irkerhook-git.patch new file mode 100644 index 0000000..1daf868 --- /dev/null +++ b/debian/patches/0007-irkerhook-git.patch @@ -0,0 +1,28 @@ +From: Neil Muller <drnlmuller+debian@gmail.com> +Date: Sun, 13 May 2018 15:07:57 +0200 +Subject: Add description for the irkerhook-git helper script. + +The debian packages add a irkerhook-git helper script, which simplifies +the most common use case for irkerhook with git. This patch mentions the +helper script in the irkerhook manpage. +Last-Update: 2016-03-15 +--- + irkerhook.xml | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/irkerhook.xml b/irkerhook.xml +index d6f7b51..2160166 100644 +--- a/irkerhook.xml ++++ b/irkerhook.xml +@@ -220,6 +220,11 @@ while read old new refname; do + done + </programlisting> + ++<para>For convenience, this is implemented by the irkerhook-git ++helper script. This script will complain about some common configuration ++isssues. For simplicity, irkerhook-git does not support all the ++options of irkerhook.py, and is thus not suitable for all applications.</para> ++ + <para>Preferences may be set in the repo <filename>config</filename> + file in an [irker] section. Here is an example of what that can look + like:</para> diff --git a/debian/patches/0008-Update-irkerhook-to-recent-mercurial-changes.patch b/debian/patches/0008-Update-irkerhook-to-recent-mercurial-changes.patch new file mode 100644 index 0000000..884e915 --- /dev/null +++ b/debian/patches/0008-Update-irkerhook-to-recent-mercurial-changes.patch @@ -0,0 +1,25 @@ +From: Neil Muller <drnlmuller+debian@gmail.com> +Date: Mon, 8 Feb 2021 17:06:55 +0200 +Subject: Update irkerhook to recent mercurial changes + +Drop call to deprecated / removed mercurial internal method. + +From upstream commits: ad8f8552bc8bb7ff31848ccdc729f79aa63e88aa + +Forwarded: not-needed +--- + irkerhook.py | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/irkerhook.py b/irkerhook.py +index e6b8f04..0f66a64 100755 +--- a/irkerhook.py ++++ b/irkerhook.py +@@ -429,7 +429,6 @@ class HgExtractor(GenericExtractor): + ctx = self.repository[commit_id] + commit = Commit(self, unifromlocal(short(ctx.hex()))) + # Extract commit-specific values from a "context" object +- ctx = self.repository.changectx(node) + commit.rev = '%d:%s' % (ctx.rev(), commit.commit) + commit.branch = unifromlocal(ctx.branch()) + commit.author = unifromlocal(person(ctx.user())) diff --git a/debian/patches/0009-env-service.patch b/debian/patches/0009-env-service.patch new file mode 100644 index 0000000..08abe7f --- /dev/null +++ b/debian/patches/0009-env-service.patch @@ -0,0 +1,29 @@ +From: Python Applications Packaging Team + <python-apps-team@lists.alioth.debian.org> +Date: Sun, 13 May 2018 15:07:57 +0200 +Subject: env-service + + Properly import environment from /etc/defaults (Closes: #832322) + + This fixes a regression in the systemd unit, which doesn't support + the equivalent /etc/default/irker configuration supported by the + sysvinit startup scripts. +--- + irkerd.service | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/irkerd.service b/irkerd.service +index 4e75ae2..70b67d5 100644 +--- a/irkerd.service ++++ b/irkerd.service +@@ -8,8 +8,8 @@ Documentation=man:irkerd(8) man:irkerhook(1) man:irk(1) + + [Service] + User=irker +-ExecStart=/usr/bin/irkerd +-User=irker ++EnvironmentFile=-/etc/default/irker ++ExecStart=/usr/bin/irkerd $IRKER_OPTIONS + + [Install] + WantedBy=multi-user.target diff --git a/debian/patches/0015-Update-irkerhook-documentation-to-python-3.patch b/debian/patches/0015-Update-irkerhook-documentation-to-python-3.patch new file mode 100644 index 0000000..0b1b1a8 --- /dev/null +++ b/debian/patches/0015-Update-irkerhook-documentation-to-python-3.patch @@ -0,0 +1,32 @@ +From: Neil Muller <drnlmuller+debian@gmail.com> +Date: Thu, 5 Sep 2019 18:08:11 +0200 +Subject: Update irkerhook documentation to python 3 + +Change the example program to use python3 in the irkerhook +documentation. +--- + irkerhook.xml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/irkerhook.xml b/irkerhook.xml +index 2160166..77b5d9f 100644 +--- a/irkerhook.xml ++++ b/irkerhook.xml +@@ -365,7 +365,7 @@ representation of (possibly altered) metadata.</para> + <para>Below is an example filter:</para> + + <programlisting> +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # This is a trivial example of a metadata filter. + # All it does is change the name of the commit's author. + # +@@ -374,7 +374,7 @@ metadata = json.loads(sys.argv[1]) + + metadata['author'] = "The Great and Powerful Oz" + +-print json.dumps(metadata) ++print(json.dumps(metadata)) + # end + </programlisting> + diff --git a/debian/patches/0016-Update-shebangs.patch b/debian/patches/0016-Update-shebangs.patch new file mode 100644 index 0000000..b7ed871 --- /dev/null +++ b/debian/patches/0016-Update-shebangs.patch @@ -0,0 +1,78 @@ +From: Neil Muller <drnlmuller+debian@gmail.com> +Date: Thu, 5 Sep 2019 18:08:51 +0200 +Subject: Update shebangs + +Change the shebangs to use python3 so we get the correct result +when we build the package. +--- + filter-example.py | 4 ++-- + filter-test.py | 4 ++-- + irk | 2 +- + irkerd | 2 +- + irkerhook.py | 2 +- + 5 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/filter-example.py b/filter-example.py +index 12908b4..094d0b7 100755 +--- a/filter-example.py ++++ b/filter-example.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # This is a trivial example of a metadata filter. + # All it does is change the name of the commit's author. + # It could do other things, including modifying the +@@ -9,5 +9,5 @@ metadata = json.loads(sys.argv[1]) + + metadata['author'] = "The Great and Powerful Oz" + +-print json.dumps(metadata) ++print(json.dumps(metadata)) + # end +diff --git a/filter-test.py b/filter-test.py +index 030d3d4..82c0660 100755 +--- a/filter-test.py ++++ b/filter-test.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + # Test hook to launch an irker instance (if it doesn't already exist) + # just before shipping the notification. We start it in in another terminal +@@ -31,5 +31,5 @@ else: + + time.sleep(1.5) # Avoid a race condition + +-print json.dumps(metadata) ++print(json.dumps(metadata)) + # end +diff --git a/irk b/irk +index fc9e153..22918d6 100755 +--- a/irk ++++ b/irk +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # Illustrates how to test irkerd. + # + # First argument must be a channel URL. If it does not begin with "irc", +diff --git a/irkerd b/irkerd +index d42f56e..92ff8b1 100755 +--- a/irkerd ++++ b/irkerd +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + """ + irkerd - a simple IRC multiplexer daemon + +diff --git a/irkerhook.py b/irkerhook.py +index 661071b..bf697ab 100755 +--- a/irkerhook.py ++++ b/irkerhook.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # Copyright (c) 2012 Eric S. Raymond <esr@thyrsus.com> + # SPDX-License-Identifier: BSD-2-Clause + # diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..9dca8d6 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,8 @@ +0001-dfsg.patch +0005-author-name.patch +0007-irkerhook-git.patch +0009-env-service.patch +0015-Update-irkerhook-documentation-to-python-3.patch +0016-Update-shebangs.patch +0007-Update-HgExtractor-to-work-with-mercurial-using-pyth.patch +0008-Update-irkerhook-to-recent-mercurial-changes.patch |