From b9b4bb5cb924ce74b2eb8a9cd5e25fb4bed69ef9 Mon Sep 17 00:00:00 2001 From: "http://jmtd.livejournal.com/" Date: Fri, 2 Oct 2009 14:20:35 -0400 Subject: weird tag/brokenlinks bug --- doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn (limited to 'doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn') diff --git a/doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn b/doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn new file mode 100644 index 000000000..4b9743094 --- /dev/null +++ b/doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn @@ -0,0 +1,11 @@ +After several runs of ikiwiki --refresh, the page I use with the [[plugin/brokenlinks]] directive on it accumulates multiple repeated lists of pages on the RHS. For example: + + * ?freebies from free kilowatts, free kilowatts, free kilowatts, free kilowatts, free kilowatts + +In this case the page "free kilowatts" has one link to "freebies" (it's tagged freebies). + +I think this may just be links caused by tags, actually. + +ikiwiki version 3.14159265. + +-- [[Jon]] -- cgit v1.2.3 From 10ef2091362d623a848c6b17f2f70c725f93dd75 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 2 Oct 2009 15:02:02 -0400 Subject: followup --- doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn') diff --git a/doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn b/doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn index 4b9743094..395c7789e 100644 --- a/doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn +++ b/doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn @@ -9,3 +9,12 @@ I think this may just be links caused by tags, actually. ikiwiki version 3.14159265. -- [[Jon]] + +> Is it possible that you upgraded from a version older than 3.12, +> and have not rebuilt your wiki since, but just refreshed? And did not run +> `ikiwiki-transition deduplinks`? If so, suggest you rebuild the wiki, +> or run that, either would probably fix the problem. +> +> If you can get to the problem after rebuilding with the current ikiwiki, +> and then refreshing a few times, I guess I will need a copy of the wiki +> source and the `.ikiwiki` directory to reproduce this. --[[Joey]] -- cgit v1.2.3 From c1ca46a785164eec099e003c0883245ca728e461 Mon Sep 17 00:00:00 2001 From: "http://jmtd.livejournal.com/" Date: Fri, 2 Oct 2009 17:23:37 -0400 Subject: response --- doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn') diff --git a/doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn b/doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn index 395c7789e..2091570d1 100644 --- a/doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn +++ b/doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn @@ -18,3 +18,5 @@ ikiwiki version 3.14159265. > If you can get to the problem after rebuilding with the current ikiwiki, > and then refreshing a few times, I guess I will need a copy of the wiki > source and the `.ikiwiki` directory to reproduce this. --[[Joey]] + +>> Hi Joey, thanks for your response. I've reproduced it post rebuild and after having ran ikiwiki-transition and many refreshes (both resulting from content changes and otherwise) unfortunately, with ikiwiki 3.14159265 (different machine to above report, though). I will contact you privately to provide a git URL and a copy of my .ikiwiki. -- [[Jon]] -- cgit v1.2.3 From ffa73790b5c381df6e0385995b720dd24188969b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 3 Oct 2009 14:14:30 -0400 Subject: Fix a bug that could lead to duplicate links being recorded for tags. Here I was bitten by perl's aliasing of foreach variables to the loop array contents, and match_link accidentially changed the contents of %links. In Jon's testcase, a tag added an absolute link, which was made relative by the above bug, and then the link was added again in preprocess, and turned into a duplicate. --- IkiWiki.pm | 6 +++--- debian/changelog | 2 ++ doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn') diff --git a/IkiWiki.pm b/IkiWiki.pm index 974e36902..2637f6017 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -2052,10 +2052,10 @@ sub match_link ($$;@) { else { return IkiWiki::SuccessReason->new("$page links to page $p matching $link") if match_glob($p, $link, %params); - $p=~s/^\///; + my ($p_rel)=$p=~/^\/?(.*)/; $link=~s/^\///; - return IkiWiki::SuccessReason->new("$page links to page $p matching $link") - if match_glob($p, $link, %params); + return IkiWiki::SuccessReason->new("$page links to page $p_rel matching $link") + if match_glob($p_rel, $link, %params); } } return IkiWiki::FailReason->new("$page does not link to $link"); diff --git a/debian/changelog b/debian/changelog index b6383bacb..ca5409af7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ ikiwiki (3.14159266) UNRELEASED; urgency=low to the body tag. * Support RPC::XML 0.69's incompatable object instantiation method. * mirrorlist: Display nothing if list is empty. + * Fix a bug that could lead to duplicate links being recorded + for tags. -- Joey Hess Sun, 27 Sep 2009 17:40:03 -0400 diff --git a/doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn b/doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn index 2091570d1..d07b2381d 100644 --- a/doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn +++ b/doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn @@ -20,3 +20,6 @@ ikiwiki version 3.14159265. > source and the `.ikiwiki` directory to reproduce this. --[[Joey]] >> Hi Joey, thanks for your response. I've reproduced it post rebuild and after having ran ikiwiki-transition and many refreshes (both resulting from content changes and otherwise) unfortunately, with ikiwiki 3.14159265 (different machine to above report, though). I will contact you privately to provide a git URL and a copy of my .ikiwiki. -- [[Jon]] + +>>> Found the bug that was causing duplicates to get in, and fixed it. +>>> [[done]] --[[Joey]] -- cgit v1.2.3 From 204e733d795d94218465982701cdb8a776893ba0 Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Mon, 5 Oct 2009 15:17:11 +0100 Subject: good work, thank you! --- doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn') diff --git a/doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn b/doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn index d07b2381d..7fe92f7a9 100644 --- a/doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn +++ b/doc/bugs/brokenlinks_accumulates_duplicate_items.mdwn @@ -23,3 +23,5 @@ ikiwiki version 3.14159265. >>> Found the bug that was causing duplicates to get in, and fixed it. >>> [[done]] --[[Joey]] + +>>>> Good work Joey, thanks! -- [[Jon]] -- cgit v1.2.3