[DRE-commits] [ruby-sqlite3] 01/02: use slugs for the FAQ to make package reproducible. Thanks Lunar (Closes: #782884)

Cédric Boutillier boutil at moszumanska.debian.org
Sat Mar 5 15:24:33 UTC 2016


This is an automated email from the git hooks/post-receive script.

boutil pushed a commit to branch master
in repository ruby-sqlite3.

commit 1d32640ed25a0be18f26c903a45a5705b696c49d
Author: Cédric Boutillier <boutil at debian.org>
Date:   Sat Mar 5 16:17:32 2016 +0100

    use slugs for the FAQ to make package reproducible. Thanks Lunar (Closes: #782884)
---
 debian/patches/series                |  1 +
 debian/patches/use-slugs-in-faq.diff | 37 ++++++++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..7f1323f
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+use-slugs-in-faq.diff
diff --git a/debian/patches/use-slugs-in-faq.diff b/debian/patches/use-slugs-in-faq.diff
new file mode 100644
index 0000000..38c24c3
--- /dev/null
+++ b/debian/patches/use-slugs-in-faq.diff
@@ -0,0 +1,37 @@
+Description: Use slugs in FAQ instead of object_id
+ In order to make the FAQ build reproducibly we use “slugs” for
+ internal links instead of object ids.
+Author: Jérémy Bobbio <lunar at debian.org>
+Bug-Debian: https://bugs.debian.org/782884
+
+--- ruby-sqlite3-1.3.9.orig/faq/faq.rb
++++ ruby-sqlite3-1.3.9/faq/faq.rb
+@@ -1,6 +1,10 @@
+ require 'yaml'
+ require 'redcloth'
+ 
++def slugify( str )
++  str.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
++end
++
+ def process_faq_list( faqs )
+   puts "<ul>"
+   faqs.each do |faq|
+@@ -20,7 +24,7 @@ def process_faq_list_item( faq )
+     puts question_text
+     process_faq_list answer
+   else
+-    print "<a href='##{question.object_id}'>#{question_text}</a>"
++    print "<a href='##{slugify(question)}'>#{question_text}</a>"
+   end
+ 
+   puts "</li>"
+@@ -43,7 +47,7 @@ def process_faq_description( faq, path )
+     title = RedCloth.new( path ).to_html.gsub( %r{</?p>}, "" )
+     answer = RedCloth.new( answer || "" )
+ 
+-    puts "<a name='#{question.object_id}'></a>"
++    puts "<a name='#{slugify(question)}'></a>"
+     puts "<div class='faq-title'>#{title}</div>"
+     puts "<div class='faq-answer'>#{add_api_links(answer.to_html)}</div>"
+   end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-sqlite3.git



More information about the Pkg-ruby-extras-commits mailing list