[debhelper-devel] Bug#869780: debhelper: recommended compat version substitution is totally broken

Colin Watson cjwatson at debian.org
Wed Jul 26 11:20:39 UTC 2017


Package: debhelper
Version: 10.6.4
Severity: normal

The recommended compat version substitution is broken in three ways.

Firstly, it fails to build with Ubuntu's version suffix as follows:

  cat debhelper.pod | \
  	perl -e ' undef $/; foreach (@ARGV) { open (IN, $_) or die "$_: $!"; $file=<IN>; close IN; if ($file=~m/=head1 .*?\n\n(.*?) - (.*?)\n\n/s) { my $item="=item $1(1)\n\n$2\n\n"; if (" dh_installmanpages " !~ / $1 /) { $list.=$item; } else { $list_deprecated.=$item; } } } END { my $recommended_compat = 10.6.4ubuntu1; $recommended_compat =~ s{\..*}{}; while (<STDIN>) { s/#LIST#/$list/; s/#LIST_DEPRECATED#/$list_deprecated/; s/#RECOMMEDED_COMPAT#/$recommeded_compat/; print; }; }' dh_auto_build dh_auto_clean dh_auto_configure dh_auto_install dh_auto_test dh_bugfiles dh_builddeb dh_clean dh_compress dh_fixperms dh_gconf dh_gencontrol dh_icons dh_install dh_installcatalogs dh_installchangelogs dh_installcron dh_installdeb dh_installdebconf dh_installdirs dh_installdocs dh_installemacsen dh_installexamples dh_installgsettings dh_installifupdown dh_installinfo dh_installinit dh_installlogcheck dh_installlogrotate dh_installman dh_installmanpages dh_installmenu dh_installmime dh_installmodules dh_installpam dh_installppp dh_installudev dh_installwm dh_installxfonts dh_link dh_lintian dh_listpackages dh_makeshlibs dh_md5sums dh_missing dh_movefiles dh_perl dh_prep dh_shlibdeps dh_strip dh_systemd_enable dh_systemd_start dh_testdir dh_testroot dh_ucf dh_update_autotools_config dh_usrlocal | \
  	pod2man --utf8 -c Debhelper -r "10.6.4ubuntu1" --name="debhelper" --section=7  > debhelper.7
  Bareword found where operator expected at -e line 1, near "10.6.4ubuntu1"
  	(Missing operator before ubuntu1?)
  syntax error at -e line 1, near "10.6.4ubuntu1"
  Execution of -e aborted due to compilation errors.

Secondly, the variable that's substituted into POD files is misspelled:
it should be RECOMMENDED_COMPAT, not RECOMMEDED_COMPAT.  Relatedly, the
Perl variable that's substituted is spelled $recommended_compat in one
place and $recommeded_compat in another, which means the substitution
just doesn't work at all.

Thirdly, due to "undef $/" arranging for <STDIN> to read the whole file,
the substitutions need to be performed with the /g flag, otherwise only
the first occurrence is handled.

The attached patch should fix all of this.

-- 
Colin Watson                                       [cjwatson at debian.org]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-substitution-of-recommended-compat-version.patch
Type: text/x-diff
Size: 16323 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/debhelper-devel/attachments/20170726/74992f8a/attachment-0003.patch>


More information about the debhelper-devel mailing list