Package: src:ruby-pygments.rb Followup-For: Bug #972481 Control: tags -1 + patch
Hello. The attached 0004 suggestion fixes the release-critical bug #972481, which is about to trigger the removal of reverse dependencies from testing. Could you please review and upload the attached suggestions, or else approve an NMU of 0004? Thanks.
>From 218f1f4eeff211d5fdf1fc10bb51f182333926e1 Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nico...@debian.org> Date: Sun, 15 Nov 2020 09:59:56 +0100 Subject: [PATCH 1/5] Uscan v4 and Files-Excluded replace get-orig-source.sh --- debian/README.source | 16 ---------------- debian/get-orig-source.sh | 29 ----------------------------- debian/watch | 8 +++++--- 3 files changed, 5 insertions(+), 48 deletions(-) delete mode 100644 debian/README.source delete mode 100755 debian/get-orig-source.sh diff --git a/debian/README.source b/debian/README.source deleted file mode 100644 index e7d7c5e..0000000 --- a/debian/README.source +++ /dev/null @@ -1,16 +0,0 @@ -git-buildpackage -================ - -updating package ----------------- - -In order to download a repacked version of the upstream tarball execute - - debian/rules get-orig-source - -Import the generated tarball as normal with - - git import-orig <generated-tarball> - - - -- Per Andersson <avtob...@gmail.com> Fri, 04 Apr 2014 02:05:06 +0200 diff --git a/debian/get-orig-source.sh b/debian/get-orig-source.sh deleted file mode 100755 index c6bbf18..0000000 --- a/debian/get-orig-source.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -set -e - -# bail if we already are up to date -if ! uscan --no-symlink ; then - echo "Already up-to-date." - exit 0 -fi - -upstream_version=$(uscan --report --verbose | sed -n '/Newest version/ {s/.*site is \(.*\),.*/\1/;p}') -upstream_tarball=../v$upstream_version.tar.gz -version="$(uscan --report --verbose | sed -n '/Newest version/ {s/.*site is \(.*\),.*/\1/;p}')~ds1" -repack_dir="../ruby-pygments.rb-$version" - -tar zxvf $upstream_tarball -C .. -mv ../pygments.rb-* $repack_dir - -## remove vendor libraries -rm -rf $repack_dir/vendor - -tar zcvf ../ruby-pygments.rb-$version.tar.gz $repack_dir - -echo "Deleting downloaded files.." -rm -rf $repack_dir -rm -f $upstream_tarball - -echo "New repackaged orig source tarball is at" -echo " ../ruby-pygments.rb-$version.tar.gz" diff --git a/debian/watch b/debian/watch index 2b1a980..4a84678 100644 --- a/debian/watch +++ b/debian/watch @@ -1,3 +1,5 @@ -version=3 -opts=dversionmangle=s/~ds\d+$// \ - https://github.com/tmm1/pygments.rb/tags .*/v(.*).tar.gz +version=4 + +opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%ruby-pygments.rb-$1.tar.gz%" \ +https://github.com/tmm1/pygments.rb/tags \ +(?:.*?/)?v?(\d[\d.]*)\.tar\.gz -- 2.20.1
>From f19fcc44542b10339b097b7e1a2e8497fd6ac69f Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nico...@debian.org> Date: Sun, 15 Nov 2020 10:05:32 +0100 Subject: [PATCH 2/5] Debhelper 13 (no changes) --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index cddc095..9716c9d 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Debian Ruby Team <pkg-ruby-extras-maintain...@lists.alioth.debian.org> Uploaders: Per Andersson <avtob...@gmail.com>, Dominique Dumont <d...@debian.org> -Build-Depends: debhelper-compat (= 12), +Build-Depends: debhelper-compat (= 13), gem2deb (>= 1), rake, rake-compiler, -- 2.20.1
>From a5813241f2f76b3e8c43d763c4c76a1adebb5787 Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nico...@debian.org> Date: Sun, 15 Nov 2020 10:06:31 +0100 Subject: [PATCH 3/5] Slightly shorten d/rules --- debian/clean | 1 + debian/rules | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) create mode 100644 debian/clean diff --git a/debian/clean b/debian/clean new file mode 100644 index 0000000..6628c9b --- /dev/null +++ b/debian/clean @@ -0,0 +1 @@ +lexers diff --git a/debian/rules b/debian/rules index d344b4a..a50cddd 100755 --- a/debian/rules +++ b/debian/rules @@ -8,13 +8,8 @@ export DH_RUBY_GEM_INSTALL_BLACKLIST_APPEND = vendor/* %: dh $@ --buildsystem=ruby --with ruby -override_dh_auto_build: +execute_before_dh_auto_build: rake lexers - dh_auto_build - -override_dh_auto_clean: - $(RM) -f lexers - dh_auto_clean override_dh_compress: dh_compress -- 2.20.1
>From fea0a6c436cdf73a3ae1dc0ad783d32b0286d4cd Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nico...@debian.org> Date: Sun, 15 Nov 2020 10:51:11 +0100 Subject: [PATCH 4/5] Make the test less dependent on the pygments version, closes: #972481 --- debian/patches/series | 1 + ...t-less-dependency-on-pygments-version.diff | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 debian/patches/test-less-dependency-on-pygments-version.diff diff --git a/debian/patches/series b/debian/patches/series index 7ab1c50..208d5a3 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -12,3 +12,4 @@ 0012-mentos.py-decode-header-when-getting-its-length.patch 0013-test-drop-test-that-depends-on-Python-internals.patch 0014-Port-to-python3.patch +test-less-dependency-on-pygments-version.diff diff --git a/debian/patches/test-less-dependency-on-pygments-version.diff b/debian/patches/test-less-dependency-on-pygments-version.diff new file mode 100644 index 0000000..37be423 --- /dev/null +++ b/debian/patches/test-less-dependency-on-pygments-version.diff @@ -0,0 +1,34 @@ +Description: make the test less dependent on the pygments version + Some tests are too strict, and fail when pygments is updated and a + detail changes in the formatting. +Bug-Debian: https://bugs.debian.org/768615 +Bug-Debian: https://bugs.debian.org/775631 +Bug-Debian: https://bugs.debian.org/972481 +Forwarded: https://github.com/tmm1/pygments.rb/issues/195 +Author: Antonio Terceiro <terce...@debian.org> +Author: Nicolas Boulenguez <nico...@debian.org> +Author: Per Andersson <avtob...@gmail.com> +Author: Tomasz Buchert <tomasz.buch...@inria.fr> + +--- a/test/test_pygments.rb ++++ b/test/test_pygments.rb +@@ -35,7 +35,8 @@ + def test_highlight_works_with_larger_files + code = P.highlight(REDIS_CODE) + assert_match 'used_memory_peak_human', code +- assert_equal 458511, code.bytesize.to_i ++ # An equality would fail every time pygments change details in formatting. ++ assert 450_000 < code.bytesize.to_i + end + + def test_highlight_works_with_null_bytes +@@ -86,7 +87,8 @@ + + def test_highlight_works_with_single_character_input + code = P.highlight("a") +- assert_match "a\n</pre>", code ++ # With an ambiguous input, the output is unreproducible. ++ # assert_match "a\n</pre>", code + end + + def test_highlight_works_with_trailing_newline -- 2.20.1
>From 188fd846eaa4b7952aa6a7973bd8aa1e634432da Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nico...@debian.org> Date: Sun, 15 Nov 2020 11:34:00 +0100 Subject: [PATCH 5/5] Comment explaining why dh_compress is overridden without options --- debian/rules | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/rules b/debian/rules index a50cddd..c807b2e 100755 --- a/debian/rules +++ b/debian/rules @@ -11,5 +11,7 @@ export DH_RUBY_GEM_INSTALL_BLACKLIST_APPEND = vendor/* execute_before_dh_auto_build: rake lexers +# The ruby debhelper module passes -X.rb to dh_compress, but this +# exclusion pattern would match debian/ruby-pygments.rb/. override_dh_compress: dh_compress -- 2.20.1