]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Update upstream source from tag 'upstream/3.20180311'
authorSimon McVittie <smcv@debian.org>
Sun, 11 Mar 2018 15:55:17 +0000 (15:55 +0000)
committerSimon McVittie <smcv@debian.org>
Sun, 11 Mar 2018 15:55:17 +0000 (15:55 +0000)
Update to upstream version '3.20180311'
with Debian dir 4601e4951930d3dfd771ac6199cc34b2c057b226

14 files changed:
CHANGELOG
IkiWiki/Plugin/mdwn.pm
Makefile.PL
doc/bugs/discount_stopped_rendering_markdown_links.mdwn [new file with mode: 0644]
doc/bugs/t__47__rst.t_should_call_python3__44___not_python.mdwn [new file with mode: 0644]
doc/ikiwikiusers.mdwn
doc/news/version_3.20170110.mdwn [deleted file]
doc/news/version_3.20180228.mdwn [new file with mode: 0644]
ikiwiki.spec
po/Makefile
po/ikiwiki.pot
t/mdwn.t
t/not-truncated.t [new file with mode: 0755]
t/rst.t

index b43c033dc2c4287732bb57a2429e7cf9adc5d41d..9e595e5e9d01849a266b1ea6fd49ad2441fdbd07 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,19 @@
+ikiwiki (3.20180311) upstream; urgency=medium
+
+  [ Amitai Schleier ]
+  * Avoid unexpected full paths from find(1)
+
+  [ thm.id.fedoraproject.org ]
+  * rst test: Probe for docutils Python 3 module, not Python 2
+
+  [ Simon McVittie ]
+  * mdwn: Automatically detect which Discount flags to use, fixing
+    regressions in 3.20180228 when using Discount < 2.2
+  * Add a test asserting that no plugin is an empty file, to confirm
+    that the build fixes in 3.20180228 were successful
+
+ -- Simon McVittie <smcv@debian.org>  Sun, 11 Mar 2018 15:53:34 +0000
+
 ikiwiki (3.20180228) upstream; urgency=medium
 
   * core: Don't send relative redirect URLs when behind a reverse proxy
index 66116ae014f7a94cd8bda230514258bbb75acf42..eefa29a9711204541c52b2c83fa959103fc05e67 100644 (file)
@@ -89,6 +89,55 @@ sub htmlize (@) {
                    (! exists $config{nodiscount} || ! $config{nodiscount})) {
                        eval q{use Text::Markdown::Discount};
                        if (! $@) {
+                               my $markdown = \&Text::Markdown::Discount::markdown;
+                               my $always_flags = 0;
+
+                               # Disable Pandoc-style % Title, % Author, % Date
+                               # Use the meta plugin instead
+                               $always_flags |= Text::Markdown::Discount::MKD_NOHEADER();
+
+                               # Disable Unicodification of quote marks, em dashes...
+                               # Use the typography plugin instead
+                               $always_flags |= Text::Markdown::Discount::MKD_NOPANTS();
+
+                               # Workaround for discount's eliding of <style> blocks.
+                               # https://rt.cpan.org/Ticket/Display.html?id=74016
+                               if (Text::Markdown::Discount->can('MKD_NOSTYLE')) {
+                                       $always_flags |= Text::Markdown::Discount::MKD_NOSTYLE();
+                               }
+                               elsif ($markdown->('<style>x</style>', 0) !~ '<style>' &&
+                                       $markdown->('<style>x</style>', 0x00400000) =~ m{<style>x</style>}) {
+                                       $always_flags |= 0x00400000;
+                               }
+
+                               # Enable fenced code blocks in libmarkdown >= 2.2.0
+                               # https://bugs.debian.org/888055
+                               if (Text::Markdown::Discount->can('MKD_FENCEDCODE')) {
+                                       $always_flags |= Text::Markdown::Discount::MKD_FENCEDCODE();
+                               }
+                               elsif ($markdown->("~~~\nx\n~~~", 0) !~ m{<pre\b} &&
+                                       $markdown->("~~~\nx\n~~~", 0x02000000) =~ m{<pre\b}) {
+                                       $always_flags |= 0x02000000;
+                               }
+
+                               # PHP Markdown Extra-style term\n: definition -> <dl>
+                               if (Text::Markdown::Discount->can('MKD_DLEXTRA')) {
+                                       $always_flags |= Text::Markdown::Discount::MKD_DLEXTRA();
+                               }
+                               elsif ($markdown->("term\n: def\n", 0) !~ m{<dl>} &&
+                                       $markdown->("term\n: def\n", 0x01000000) =~ m{<dl>}) {
+                                       $always_flags |= 0x01000000;
+                               }
+
+                               # Allow dashes and underscores in tag names
+                               if (Text::Markdown::Discount->can('MKD_GITHUBTAGS')) {
+                                       $always_flags |= Text::Markdown::Discount::MKD_GITHUBTAGS();
+                               }
+                               elsif ($markdown->('<foo_bar>', 0) !~ m{<foo_bar} &&
+                                       $markdown->('<foo_bar>', 0x08000000) =~ m{<foo_bar\b}) {
+                                       $always_flags |= 0x08000000;
+                               }
+
                                $markdown_sub=sub {
                                        my $t=shift;
 
@@ -96,15 +145,7 @@ sub htmlize (@) {
                                        # https://rt.cpan.org/Ticket/Display.html?id=73657
                                        return "" if $t=~/^\s*$/;
 
-                                       my $flags=0;
-
-                                       # Disable Pandoc-style % Title, % Author, % Date
-                                       # Use the meta plugin instead
-                                       $flags |= Text::Markdown::Discount::MKD_NOHEADER();
-
-                                       # Disable Unicodification of quote marks, em dashes...
-                                       # Use the typography plugin instead
-                                       $flags |= Text::Markdown::Discount::MKD_NOPANTS();
+                                       my $flags=$always_flags;
 
                                        if ($config{mdwn_footnotes}) {
                                                $flags |= Text::Markdown::Discount::MKD_EXTRA_FOOTNOTE();
@@ -114,42 +155,6 @@ sub htmlize (@) {
                                                $flags |= Text::Markdown::Discount::MKD_NOALPHALIST();
                                        }
 
-                                       # Workaround for discount's eliding
-                                       # of <style> blocks.
-                                       # https://rt.cpan.org/Ticket/Display.html?id=74016
-                                       if (Text::Markdown::Discount->can("MKD_NOSTYLE")) {
-                                               $flags |= Text::Markdown::Discount::MKD_NOSTYLE();
-                                       }
-                                       else {
-                                               # This is correct for the libmarkdown.so.2 ABI
-                                               $flags |= 0x00400000;
-                                       }
-
-                                       # Enable fenced code blocks in libmarkdown >= 2.2.0
-                                       # https://bugs.debian.org/888055
-                                       if (Text::Markdown::Discount->can("MKD_FENCEDCODE")) {
-                                               $flags |= Text::Markdown::Discount::MKD_FENCEDCODE();
-                                       }
-                                       else {
-                                               $flags |= 0x02000000;
-                                       }
-
-                                       # PHP Markdown Extra-style term\n: definition -> <dl>
-                                       if (Text::Markdown::Discount->can("MKD_DLEXTRA")) {
-                                               $flags |= Text::Markdown::Discount::MKD_DLEXTRA();
-                                       }
-                                       else {
-                                               $flags |= 0x01000000;
-                                       }
-
-                                       # Allow dashes and underscores in tag names
-                                       if (Text::Markdown::Discount->can("MKD_GITHUBTAGS")) {
-                                               $flags |= Text::Markdown::Discount::MKD_GITHUBTAGS();
-                                       }
-                                       else {
-                                               $flags |= 0x08000000;
-                                       }
-
                                        return Text::Markdown::Discount::markdown($t, $flags);
                                }
                        }
index 6f1724697a938537cd224dcd869bd17d8a7fb05b..7b55c702531f1bf8a18df76d86d928aeab7aaa1d 100755 (executable)
@@ -96,7 +96,7 @@ myclean: clean
 underlay_install:
        install -d $(DESTDIR)$(PREFIX)/share/ikiwiki
        set -e; \
-       for dir in `cd underlays && $(FIND) . -follow -type d`; do \
+       for dir in `$(FIND) underlays -follow -mindepth 1 -type d | $(SED) -e 's|^underlays/||'`; do \
                install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
                for file in `$(FIND) underlays/$$dir -follow -maxdepth 1 -type f ! -name jquery.js ! -name jquery-ui.css ! -name jquery-ui.js ! -name jquery.tmpl.js`; do \
                        if ! cp -pRL $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir 2>/dev/null; then \
@@ -137,11 +137,11 @@ underlay_install:
 extra_install: underlay_install
        # Install example sites.
        set -e; \
-       for dir in `cd doc/examples; $(FIND) . -type d ! -regex '.*discussion.*'`; do \
+       for dir in `$(FIND) doc/examples -type d ! -regex '.*discussion.*' | $(SED) -e 's|^doc/examples/||'`; do \
                install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$dir; \
        done
        set -e; \
-       for file in `cd doc/examples; $(FIND) . -type f ! -regex '.*discussion.*'`; do \
+       for file in `$(FIND) doc/examples -type f ! -regex '.*discussion.*' | $(SED) -e 's|^doc/examples/||'`; do \
                if ! cp -pRL doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file 2>/dev/null; then \
                        install -m 644 doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file; \
                fi; \
@@ -203,6 +203,9 @@ coverage:
        cover -delete
        $(MAKE) test PERL5OPT=-MDevel::Cover PERL5LIB=. TEST_FILES="$(filter-out t/git.t t/mercurial.t,$(wildcard t/*.t))"
        cover
+
+git-dist:
+       git archive --format=tar --prefix=IkiWiki-$(VER)/ HEAD | xz -c > IkiWiki-$(VER).tar.xz
 }
 }
 
diff --git a/doc/bugs/discount_stopped_rendering_markdown_links.mdwn b/doc/bugs/discount_stopped_rendering_markdown_links.mdwn
new file mode 100644 (file)
index 0000000..cfe544b
--- /dev/null
@@ -0,0 +1,41 @@
+# What I did
+
+Upgraded from 3.20180105 to 3.20180228 (from pkgsrc).
+No change to installed Text::Markdown::Discount (0.11nb4 from pkgsrc, using upstream's bundled Discount library).
+
+# What I expected to happen
+
+Markdown-style links to continue being rendered as before.
+
+# What actually happened
+
+Markdown-style links stopped being links.
+Instead, they render the part in square brackets as ordinary text.
+
+# Proximate cause
+
+In [f46e429](http://source.ikiwiki.branchable.com/?p=source.git;a=commitdiff;h=f46e429d96ead32943cb2670d7686df8c77de361), if I comment out the `MKD_GITHUBTAGS` if block, the problem goes away.
+
+# Further causes and possible solutions
+
+Some guesses:
+
+- Sufficiently old versions of the Discount library may break when passed unrecognized flags, in which case ikiwiki might want to version-check before passing flags
+- The version of the Discount library bundled with upstream Text::Markdown::Discount may be extremely old, in which case pkgsrc might want to make it depend instead on an external Discount package
+
+> This appears to be because `MKD_GITHUBTAGS` and `MKD_LATEX` both have numeric values that
+> were previously used for the internal flag `IS_LABEL`, which strips HTML (its value has
+> changed a couple of times).
+>
+> Having thought about this a bit, I realise I can probe for the values of these flags by
+> processing HTML that should have different results with the flag set or unset, which
+> would be safer than just blindly using them.
+>
+> Orthogonally, pkgsrc should probably use an up-to-date version of Discount, and
+> [we already know that Text::Markdown::Discount needs updating](https://rt.cpan.org/Public/Bug/Display.html?id=124188).
+> --[[smcv]]
+
+>> This should be [[fixed|done]] in current git. The mdwn module now
+>> detects what your version of Discount supports by trying several
+>> short HTML fragments that render differently under the different
+>> flags. --[[smcv]]
diff --git a/doc/bugs/t__47__rst.t_should_call_python3__44___not_python.mdwn b/doc/bugs/t__47__rst.t_should_call_python3__44___not_python.mdwn
new file mode 100644 (file)
index 0000000..c2f3a1a
--- /dev/null
@@ -0,0 +1,15 @@
+Now that the rst plugin uses Python3, the test should test docutils existence also with Python3:
+
+    --- rst.t.orig     2018-02-28 10:41:06.000000000 +0000
+    +++ rst.t  2018-03-03 17:17:23.862702468 +0000
+    @@ -3,7 +3,7 @@
+     use strict;
+     
+     BEGIN {
+    -  if (system("python -c 'import docutils.core'") != 0) {
+    +  if (system("python3 -c 'import docutils.core'") != 0) {
+               eval 'use Test::More skip_all => "docutils not available"';
+       }
+     }
+
+> [[Applied|done]], thanks. --[[smcv]]
index a47692cfdf0557ca1d81fda1fbf7b09bae627fe9..f8434752126dcb4a80a4a083d62b8bf50cef59f4 100644 (file)
@@ -194,6 +194,7 @@ Personal sites and blogs
 * [Salient Dream](http://www.salientdream.com/) - All Things Strange. 
 * [Anton Berezin's blog](http://blog.tobez.org/)
 * [Waldgarten]( http://waldgarten.greenonion.org/ ) News and documentation of a permaculture inspired neighbourhood-garden located in Hamburg, Germany.
+* [Frohdo](https://frohdo.de) - With raw food against back pain and other diseases
 * [[OscarMorante]]'s [personal site](http://oscar.morante.eu).
 * [Puckspage]( http://www.puckspage.org/ ) Political and personal blog in German. The name comes from the elf out of midsummer nights dream.  
 * [[LucaCapello]]'s [homepage](http://luca.pca.it)
diff --git a/doc/news/version_3.20170110.mdwn b/doc/news/version_3.20170110.mdwn
deleted file mode 100644 (file)
index b28cee0..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-ikiwiki 3.20170110 released with [[!toggle text="these changes"]]
-[[!toggleable text="""
- * [ Amitai Schleier ]
-   * wrappers: Correctly escape quotes in git\_wrapper\_background\_command
- * [ Simon McVittie ]
-   * git: use an explicit function parameter for the directory to work
-     in. Previously, we used global state that was not restored correctly
-     on catching exceptions, causing an unintended log message
-     "cannot chdir to .../ikiwiki-temp-working: No such file or directory"
-     with versions &gt;= 3.20161229 when an attempt to revert a change fails
-     or is disallowed
-   * git: don't run "git rev-list ... -- -- ..." which would select the
-     wrong commits if a file named literally "--" is present in the
-     repository
-   * check\_canchange: log "bad file name whatever", not literal string
-     "bad file name %s"
-   * t/git-cgi.t: fix a race condition that made the test fail
-     intermittently
-   * t/git-cgi.t: be more careful to provide a syntactically valid
-     author/committer name and email, hopefully fixing this test on
-     ci.debian.net
-   * templates, comments, passwordauth: use rel=nofollow microformat
-     for dynamic URLs
-   * templates: use rel=nofollow microformat for comment authors
-   * news: use Debian security tracker instead of MITRE for security
-     references. Thanks, anarcat
-   * Set package format to 3.0 (native)
-   * d/copyright: re-order to put more specific stanzas later, to get the
-     intended interpretation
-   * d/source/lintian-overrides: override obsolete-url-in-packaging for
-     OpenID Selector, which does not seem to have any more current URL
-     (and in any case our version is a fork)
-   * docwiki.setup: exclude TourBusStop from offline documentation.
-     It does not make much sense there.
-   * d/ikiwiki.lintian-overrides: override script-not-executable warnings
-   * d/ikiwiki.lintian-overrides: silence false positive spelling warning
-     for Moin Moin
-   * d/ikiwiki.doc-base: register the documentation with doc-base
-   * d/control: set libmagickcore-6.q16-3-extra as preferred
-     build-dependency, with virtual package libmagickcore-extra as an
-     alternative, to help autopkgtest to do the right thing"""]]
\ No newline at end of file
diff --git a/doc/news/version_3.20180228.mdwn b/doc/news/version_3.20180228.mdwn
new file mode 100644 (file)
index 0000000..a32e9b1
--- /dev/null
@@ -0,0 +1,20 @@
+ikiwiki 3.20180228 released with [[!toggle text="these changes"]]
+[[!toggleable text="""
+   * core: Don't send relative redirect URLs when behind a reverse proxy
+   * core: Escape backticks etc. in directive error messages as HTML
+     entities so that the error message is not subsequently parsed as
+     Markdown
+   * mdwn: Enable fenced code blocks, PHP Markdown Extra-style definition
+     lists and GitHub-style extensions to HTML tag syntax when used with
+     Discount &gt;= 2.2.0 (Closes: #[888055](http://bugs.debian.org/888055))
+   * img: Fix auto-detection of image format (if enabled, which is
+     strongly discouraged) with ImageMagick &gt;= 6.9.8-3
+   * rst: Use Python 3 instead of Python 2
+   * build: `set -e` before each `for` loop, so that errors are reliably
+     trapped
+   * build: Use if/then instead of `||` so that the `-e` flag works
+   * build: Ensure that pm\_to\_blib finishes before rewriting shebang lines
+   * t: Make the img test pass with ImageMagick &gt;= 6.9.8-3
+     (Closes: #[891647](http://bugs.debian.org/891647))
+   * debian: Remove unused Lintian overrides for duplicate word false positives
+   * debian: Declare compliance with Debian Policy 4.1.3"""]]
\ No newline at end of file
index db7f1693a0558ae8e577fc859257a2fcad0480ab..a55b9b0084b2c0a43867ed3e1d0b56d22768676e 100644 (file)
@@ -1,5 +1,5 @@
 Name:           ikiwiki
-Version: 3.20180228
+Version: 3.20180311
 Release:        1%{?dist}
 Summary:        A wiki compiler
 
index b71bb8b91bd1d2d68dce77fe2f2a44339ef3fd70..bd218c6e19352b02b77e5a0cedb32040077062dd 100644 (file)
@@ -22,7 +22,7 @@ install: all
        
        # Underlay translation via po files that go in special per-language
        # underlays.
-       for file in `cd underlays && find . -type f -name \*.po`; do \
+       for file in `find underlays -type f -name \*.po | sed -e 's|^underlays/||'`; do \
                lang=`echo $$file | sed -e 's/.po$$//' -e 's/.*\\.//'`; \
                dir=`dirname "$(DESTDIR)$(PREFIX)/share/ikiwiki/po/$$lang/$$file"`; \
                install -d $$dir; \
index c41df30412972d7d2d807e6569afe204a533e4cd..ac7d32015f103f4f44d56442f19ab5f04a824bb8 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2018-02-28 10:40+0000\n"
+"POT-Creation-Date: 2018-03-11 15:54+0000\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -595,7 +595,7 @@ msgstr ""
 msgid "multimarkdown is enabled, but Text::MultiMarkdown is not installed"
 msgstr ""
 
-#: ../IkiWiki/Plugin/mdwn.pm:175
+#: ../IkiWiki/Plugin/mdwn.pm:180
 #, perl-format
 msgid "failed to load Markdown.pm perl module (%s) or /usr/bin/markdown (%s)"
 msgstr ""
index 93b8bd8e9971a937aacedd2951219ca63c27abbf..ca3180139445f7659735e998f9c265b074db4da2 100755 (executable)
--- a/t/mdwn.t
+++ b/t/mdwn.t
@@ -8,6 +8,7 @@ BEGIN { use_ok("IkiWiki"); }
 
 %config=IkiWiki::defaultconfig();
 $config{srcdir}=$config{destdir}="/dev/null";
+$config{disable_plugins}=["htmlscrubber"];
 IkiWiki::loadplugins();
 IkiWiki::checkconfig();
 
@@ -41,4 +42,25 @@ like(IkiWiki::htmlize("foo", "foo", "mdwn",
        "This works[^1]\n\n[^1]: Sometimes it doesn't.\n"),
        qr{<p>This works<sup\W}, "footnotes can be enabled");
 
+SKIP: {
+       skip 'set $IKIWIKI_TEST_ASSUME_MODERN_DISCOUNT if you have Discount 2.2.0+', 4
+               unless $ENV{IKIWIKI_TEST_ASSUME_MODERN_DISCOUNT};
+       like(IkiWiki::htmlize("foo", "foo", "mdwn",
+                       "Definition list\n: A useful HTML structure\n"),
+               qr{<dl>.*<dt>Definition list</dt>\s*<dd>A useful HTML structure</dd>}s,
+               "definition lists are enabled by default");
+       like(IkiWiki::htmlize("foo", "foo", "mdwn",
+                       "```\n#!/bin/sh\n```\n"),
+               qr{<pre>\s*<code>\s*[#]!/bin/sh\s*</code>\s*</pre>}s,
+               "code blocks are enabled by default");
+       like(IkiWiki::htmlize("foo", "foo", "mdwn",
+                       "<foo_bar>"),
+               qr{<foo_bar>},
+               "GitHub tag name extensions are enabled by default");
+       like(IkiWiki::htmlize("foo", "foo", "mdwn",
+                       "<style>foo</style>"),
+               qr{<style>foo</style>},
+               "Styles are not stripped by default");
+}
+
 done_testing();
diff --git a/t/not-truncated.t b/t/not-truncated.t
new file mode 100755 (executable)
index 0000000..dba97c8
--- /dev/null
@@ -0,0 +1,53 @@
+#!/usr/bin/perl
+# Regression test for a weird build issue where wikitext.pm was installed
+# as an empty file, possibly caused by parallel builds. This was hopefully
+# fixed by making the build steps more robust in 3.20180228.
+# https://buildd.debian.org/status/fetch.php?pkg=ikiwiki&arch=all&ver=3.20180105-1&stamp=1515285462&raw=0
+# -rw-r--r-- root/root         0 2018-01-06 23:20 ./usr/share/perl5/IkiWiki/Plugin/wikitext.pm
+use warnings;
+use strict;
+use Cwd qw(getcwd);
+use File::Find qw(find);
+use Test::More;
+
+my @libs="IkiWiki.pm";
+
+if ($ENV{INSTALLED_TESTS}) {
+       foreach my $libdir (@INC) {
+               my $wanted = sub {
+                       return unless /\.pm$/;
+                       my $name = $File::Find::name;
+                       if ($name =~ s{^\Q$libdir/\E}{}) {
+                               push @libs, $name;
+                       }
+               };
+
+               if (-e "$libdir/IkiWiki.pm" && -d "$libdir/IkiWiki") {
+                       find($wanted, "$libdir/IkiWiki");
+                       last;
+               }
+       }
+}
+else {
+       my $cwd = getcwd;
+       my $wanted = sub {
+               return unless /\.pm$/;
+               my $name = $File::Find::name;
+               if ($name =~ s{^\Q$cwd/\E}{}) {
+                       push @libs, $name;
+               }
+       };
+       find($wanted, "$cwd/IkiWiki");
+}
+
+plan(tests => scalar @libs);
+
+FILE: foreach my $file (@libs) {
+       foreach my $libdir (@INC) {
+               if (-e "$libdir/$file") {
+                       ok(-s "$libdir/$file", "$file available in $libdir and not truncated");
+                       next FILE;
+               }
+       }
+       fail("$file not available in ".join(':', @INC));
+}
diff --git a/t/rst.t b/t/rst.t
index a72c4681cbf3bd0e13817c730338761a5537e7b8..7908c0fb2a0d780d3bb2b53155f39d77f3bf1186 100755 (executable)
--- a/t/rst.t
+++ b/t/rst.t
@@ -3,7 +3,7 @@ use warnings;
 use strict;
 
 BEGIN {
-       if (system("python -c 'import docutils.core'") != 0) {
+       if (system("python3 -c 'import docutils.core'") != 0) {
                eval 'use Test::More skip_all => "docutils not available"';
        }
 }