diff options
author | Joey Hess <joey@kitenet.net> | 2013-05-25 11:31:40 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-05-25 11:31:40 -0400 |
commit | 2849f4e33bc6ae46335f64d62d33c73e606f7c41 (patch) | |
tree | 68978c6682d865da4a12e6ff98f047cfd817aa00 | |
parent | 7a7b1ca082897cd5ff3e421075f4d5f92ac87397 (diff) |
dh_installchangelogs: No longer automatically converts html changelogs. A plain text version can be provided as a second parameter, or it will generate a file with a pointer to the html changelog if not. html2text's reign of terror has ended. Closes: #562874
-rw-r--r-- | debian/changelog | 4 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rwxr-xr-x | dh_installchangelogs | 44 |
3 files changed, 34 insertions, 16 deletions
diff --git a/debian/changelog b/debian/changelog index 922d3817..43975a2f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,9 @@ debhelper (9.20130519) UNRELEASED; urgency=low + * dh_installchangelogs: No longer automatically converts html changelogs. + A plain text version can be provided as a second parameter, or it will + generate a file with a pointer to the html changelog if not. + html2text's reign of terror has ended. Closes: #562874 * Allow building debhelper with USE_NLS=no to not require po4a to build. Closes: #709557 diff --git a/debian/control b/debian/control index bfc5b97c..b99342d5 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,7 @@ Homepage: http://kitenet.net/~joey/code/debhelper/ Package: debhelper Architecture: all -Depends: ${perl:Depends}, ${misc:Depends}, file (>= 3.23), dpkg (>= 1.16.2), dpkg-dev (>= 1.16.2), html2text, binutils, po-debconf, man-db (>= 2.5.1-1) +Depends: ${perl:Depends}, ${misc:Depends}, file (>= 3.23), dpkg (>= 1.16.2), dpkg-dev (>= 1.16.2), binutils, po-debconf, man-db (>= 2.5.1-1) Suggests: dh-make Conflicts: dpkg-cross (<< 1.18), python-support (<< 0.5.3), python-central (<< 0.5.6), automake (<< 1.11.2) Multi-Arch: foreign diff --git a/dh_installchangelogs b/dh_installchangelogs index 58dad3c2..d1e79492 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -23,11 +23,14 @@ specified, it looks for files with names that seem likely to be changelogs. (In compatibility level 7 and above.) If there is an upstream F<changelog> file, it will be be installed as -F<usr/share/doc/package/changelog> in the package build directory. If the -changelog is a F<html> file (determined by file extension), it will be -installed as F<usr/share/doc/package/changelog.html> instead, and will be -converted to plain text with B<html2text> to generate -F<usr/share/doc/package/changelog>. +F<usr/share/doc/package/changelog> in the package build directory. + +If the upstream changelog is is a F<html> file (determined by file +extension), it will be installed as F<usr/share/doc/package/changelog.html> +instead. If the html changelog is converted to plain text, that variant +can be specified as a second upstream changelog file. When no plain +text variant is specified, a short F<usr/share/doc/package/changelog> +is generated, pointing readers at the html changelog file. =head1 FILES @@ -129,8 +132,12 @@ sub install_binNMU_changelog { init(); -my $upstream=shift; +my $news_name="NEWS.Debian"; my $changelog_name="changelog.Debian"; + +my $upstream=shift; +my $upstream_text=$upstream; +my $upstream_html; if (! defined $upstream) { if (! isnative($dh{MAINPACKAGE}) && !compat(6)) { foreach my $dir (qw{. doc docs}) { @@ -150,7 +157,10 @@ if (! defined $upstream) { $changelog_name='changelog'; } } -my $news_name="NEWS.Debian"; +elsif ($upstream=~m/\.html?$/i) { + $upstream_html=$upstream; + $upstream_text=shift; +} foreach my $package (@{$dh{DOPACKAGES}}) { next if is_udeb($package); @@ -201,17 +211,21 @@ foreach my $package (@{$dh{DOPACKAGES}}) { if (defined $upstream) { my $link_to; - if ($upstream=~m/\.html?$/i) { - # HTML changelog + my $base="$tmp/usr/share/doc/$package"; + if (defined $upstream_text) { doit("install","-o",0,"-g",0,"-p","-m644", - $upstream,"$tmp/usr/share/doc/$package/changelog.html"); - doit("html2text","-nobs","-o","$tmp/usr/share/doc/$package/changelog",$upstream); - $link_to='changelog.html'; + $upstream_text,"$base/changelog"); + $link_to='changelog'; } - else { + if (defined $upstream_html) { doit("install","-o",0,"-g",0,"-p","-m644", - $upstream,"$tmp/usr/share/doc/$package/changelog"); - $link_to='changelog'; + $upstream_html,"$base/changelog.html"); + $link_to='changelog.html'; + if (! defined $upstream_text) { + complex_doit("echo 'See changelog.html.gz' > $base/changelog"); + doit("chmod","644","$base/changelog"); + doit("chown","0:0","$base/changelog"); + } } if ($dh{K_FLAG}) { # Install symlink to original name of the upstream changelog file. |