[Reproducible-commits] [blog] 01/01: add a plugin to automatically linkify bugs and packages to bugs.d.o and tracker.d.o
Mattia Rizzolo
mattia at debian.org
Sun May 1 17:49:08 UTC 2016
This is an automated email from the git hooks/post-receive script.
mattia pushed a commit to branch master
in repository blog.
commit 32bdc51f2811b20c05e7ee5929c1704c9d27536b
Author: Mattia Rizzolo <mattia at debian.org>
Date: Sun May 1 17:49:02 2016 +0000
add a plugin to automatically linkify bugs and packages to bugs.d.o and tracker.d.o
---
Makefile | 1 +
TODO | 3 ---
blog.setup | 3 ++-
drafts/53.mdwn | 4 ++--
libdir/IkiWiki/Plugin/DebianMacros.pm | 45 +++++++++++++++++++++++++++++++++++
5 files changed, 50 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index 8202e7e..83e0478 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@ all: local
# build and serve locally, for testing
# view it at http://localhost:8000/blog/
serve: local
+ @echo The local instance is available at http://127.0.0.1:8000/blog
cd local && python -m SimpleHTTPServer
local: blog-local.setup
diff --git a/TODO b/TODO
index 05deff0..1972c29 100644
--- a/TODO
+++ b/TODO
@@ -27,6 +27,3 @@ ikiwiki polishing:
import posts 1-47 or add a pointer
https://people.debian.org/~lunar/blog/posts/reproducible_builds_stretch_week_47/
-
-Write a plugin (or find one already written somewhere) to simplify the linkage of
-bugs (to bugs.d.o) and packages (to tracker.d.o). https://ikiwiki.info/plugins/write/
diff --git a/blog.setup b/blog.setup
index d49a15d..d2b3b48 100644
--- a/blog.setup
+++ b/blog.setup
@@ -37,6 +37,7 @@ add_plugins:
- trail
- localstyle
- calendar
+- DebianMacros
# plugins to disable
disable_plugins:
- recentchanges
@@ -84,7 +85,7 @@ hardlink: 0
# group for wrappers to run in
#wrappergroup: ikiwiki
# extra library and plugin directory
-#libdir: /srv/home/users/holger/.ikiwiki
+libdir: libdir
# environment variables
ENV: {}
# time zone name
diff --git a/drafts/53.mdwn b/drafts/53.mdwn
index 83c42e3..005ed5b 100644
--- a/drafts/53.mdwn
+++ b/drafts/53.mdwn
@@ -27,7 +27,7 @@ Packages fixed
The following 12 packages have become reproducible due to changes in their
build dependencies:
-[hhvm](https://tracker.debian.org/hhvm)
+[[!pkg hhvm]]
[jcsp](https://tracker.debian.org/jcsp)
[libfann](https://tracker.debian.org/libfann)
[libflexdock-java](https://tracker.debian.org/libflexdock-java)
@@ -81,7 +81,7 @@ Some uploads have fixed some reproducibility issues, but not all of them:
Patches submitted that have not made their way to the archive yet:
- * [822566](https://bugs.debian.org/822566) against [stk](https://tracker.debian.org/stk) by Alexis Bienvenüe: sort lists of object files for reproducible linking order.
+ * [[!bug 822566]] against [stk](https://tracker.debian.org/stk) by Alexis Bienvenüe: sort lists of object files for reproducible linking order.
* [822948](https://bugs.debian.org/822948) against [shotwell](https://tracker.debian.org/shotwell) by Alexis Bienvenüe: normalize tarball permissions and use locale/timezone-independent modification time.
* [822963](https://bugs.debian.org/822963) against [htop](https://tracker.debian.org/htop) by Alexis Bienvenüe: use *SOURCE_DATE_EPOCH* for embedded copyright year, which has before already been applied [in git](https://anonscm.debian.org/cgit/collab-maint/htop.git/commit/?id=cef9e7933e5c9704eaa5a6330067967f32e52798) and [upstream](https://github.com/hishamhm/htop/pull/476).
diff --git a/libdir/IkiWiki/Plugin/DebianMacros.pm b/libdir/IkiWiki/Plugin/DebianMacros.pm
new file mode 100644
index 0000000..99f570b
--- /dev/null
+++ b/libdir/IkiWiki/Plugin/DebianMacros.pm
@@ -0,0 +1,45 @@
+#!/usr/bin/perl
+#
+# Copyright © 2016 Mattia Rizzolo <mattia at debian.org>
+# License: WTFPLv2
+
+package IkiWiki::Plugin::DebianMacros;
+
+use warnings;
+use strict;
+use IkiWiki 3.00;
+
+sub import {
+ hook(type => "preprocess", id => "pkg", call => \&pkg);
+ hook(type => "preprocess", id => "bug", call => \&bug);
+ hook(type => "preprocess", id => "patch", call => \&patch);
+}
+
+sub pkg {
+ my $pkg = shift;
+ my $title = $pkg;
+ if (defined $_{title}) {
+ $title = $_{title};
+ }
+ return "[$pkg](https://tracker.debian.org/$pkg)";
+}
+
+sub bug_out {
+ my ($bug, $title) = @_;
+ if ($bug =~ /\d+/) {
+ error("The bug $bug is not a valid bug format.");
+ }
+ return "[$title](https://bugs.debian.org/$bug)";
+}
+
+sub bug {
+ my $bug = shift;
+ return bug_out($bug, "#$bug");
+}
+
+sub patch {
+ my $bug = shift;
+ return bug_out($bug, "original patch");
+}
+
+1
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/blog.git
More information about the Reproducible-commits
mailing list