diff -Nru debhelper-9.20160115ubuntu3/autoscripts/postinst-init debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-init --- debhelper-9.20160115ubuntu3/autoscripts/postinst-init 2016-01-19 18:54:31.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-init 2017-07-29 18:08:37.000000000 +0000 @@ -1,8 +1,6 @@ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then if [ -x "/etc/init.d/#SCRIPT#" ]; then update-rc.d #SCRIPT# #INITPARMS# >/dev/null - fi - if [ -x "/etc/init.d/#SCRIPT#" ] || [ -e "/etc/init/#SCRIPT#.conf" ]; then invoke-rc.d #SCRIPT# start || #ERROR_HANDLER# fi fi diff -Nru debhelper-9.20160115ubuntu3/autoscripts/postinst-init-restart debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-init-restart --- debhelper-9.20160115ubuntu3/autoscripts/postinst-init-restart 2016-01-19 18:54:31.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-init-restart 2017-07-29 18:08:37.000000000 +0000 @@ -1,8 +1,6 @@ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then if [ -x "/etc/init.d/#SCRIPT#" ]; then update-rc.d #SCRIPT# #INITPARMS# >/dev/null - fi - if [ -x "/etc/init.d/#SCRIPT#" ] || [ -e "/etc/init/#SCRIPT#.conf" ]; then if [ -n "$2" ]; then _dh_action=restart else diff -Nru debhelper-9.20160115ubuntu3/autoscripts/postinst-makeshlibs debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-makeshlibs --- debhelper-9.20160115ubuntu3/autoscripts/postinst-makeshlibs 2016-01-15 20:19:12.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-makeshlibs 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -if [ "$1" = "configure" ]; then - ldconfig -fi diff -Nru debhelper-9.20160115ubuntu3/autoscripts/postinst-moveconffile debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-moveconffile --- debhelper-9.20160115ubuntu3/autoscripts/postinst-moveconffile 2016-01-06 15:55:12.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-moveconffile 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -if [ "$1" = configure ]; then - if [ -e "#OLD#" ]; then - echo "Preserving user changes to #NEW# ..." - if [ -e "#NEW#" ]; then - mv -f "#NEW#" "#NEW#.dpkg-new" - fi - mv -f "#OLD#" "#NEW#" - fi -fi diff -Nru debhelper-9.20160115ubuntu3/autoscripts/postinst-suid debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-suid --- debhelper-9.20160115ubuntu3/autoscripts/postinst-suid 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-suid 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -if [ "$1" = "configure" ]; then - if which suidregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; then - suidregister -s #PACKAGE# /#FILE# #OWNER# #GROUP# #PERMS# - elif [ -e /#FILE# ]; then - chown #OWNER#:#GROUP# /#FILE# - chmod #PERMS# /#FILE# - fi -fi diff -Nru debhelper-9.20160115ubuntu3/autoscripts/postinst-systemd-dont-enable debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-systemd-dont-enable --- debhelper-9.20160115ubuntu3/autoscripts/postinst-systemd-dont-enable 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-systemd-dont-enable 2017-07-29 18:08:37.000000000 +0000 @@ -0,0 +1,13 @@ +if deb-systemd-helper debian-installed #UNITFILE#; then + # This will only remove masks created by d-s-h on package removal. + deb-systemd-helper unmask #UNITFILE# >/dev/null || true + + if deb-systemd-helper --quiet was-enabled #UNITFILE#; then + # Create new symlinks, if any. + deb-systemd-helper enable #UNITFILE# >/dev/null || true + fi +fi + +# Update the statefile to add new symlinks (if any), which need to be cleaned +# up on purge. Also remove old symlinks. +deb-systemd-helper update-state #UNITFILE# >/dev/null || true diff -Nru debhelper-9.20160115ubuntu3/autoscripts/postinst-systemd-enable debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-systemd-enable --- debhelper-9.20160115ubuntu3/autoscripts/postinst-systemd-enable 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-systemd-enable 2017-07-29 18:08:37.000000000 +0000 @@ -0,0 +1,13 @@ +# This will only remove masks created by d-s-h on package removal. +deb-systemd-helper unmask #UNITFILE# >/dev/null || true + +# was-enabled defaults to true, so new installations run enable. +if deb-systemd-helper --quiet was-enabled #UNITFILE#; then + # Enables the unit on first installation, creates new + # symlinks on upgrades if the unit file has changed. + deb-systemd-helper enable #UNITFILE# >/dev/null || true +else + # Update the statefile to add new symlinks (if any), which need to be + # cleaned up on purge. Also remove old symlinks. + deb-systemd-helper update-state #UNITFILE# >/dev/null || true +fi diff -Nru debhelper-9.20160115ubuntu3/autoscripts/postinst-systemd-restart debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-systemd-restart --- debhelper-9.20160115ubuntu3/autoscripts/postinst-systemd-restart 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-systemd-restart 2017-11-28 12:40:27.000000000 +0000 @@ -0,0 +1,9 @@ +if [ -d /run/systemd/system ]; then + systemctl --system daemon-reload >/dev/null || true + if [ -n "$2" ]; then + _dh_action=restart + else + _dh_action=start + fi + deb-systemd-invoke $_dh_action #UNITFILES# >/dev/null || true +fi diff -Nru debhelper-9.20160115ubuntu3/autoscripts/postinst-systemd-restartnostart debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-systemd-restartnostart --- debhelper-9.20160115ubuntu3/autoscripts/postinst-systemd-restartnostart 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-systemd-restartnostart 2017-11-28 12:40:27.000000000 +0000 @@ -0,0 +1,6 @@ +if [ -d /run/systemd/system ]; then + systemctl --system daemon-reload >/dev/null || true + if [ -n "$2" ]; then + deb-systemd-invoke try-restart #UNITFILES# >/dev/null || true + fi +fi diff -Nru debhelper-9.20160115ubuntu3/autoscripts/postinst-systemd-start debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-systemd-start --- debhelper-9.20160115ubuntu3/autoscripts/postinst-systemd-start 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/postinst-systemd-start 2017-07-29 18:08:37.000000000 +0000 @@ -0,0 +1,4 @@ +if [ -d /run/systemd/system ]; then + systemctl --system daemon-reload >/dev/null || true + deb-systemd-invoke start #UNITFILES# >/dev/null || true +fi diff -Nru debhelper-9.20160115ubuntu3/autoscripts/postrm-makeshlibs debhelper-11ubuntu1~16.04.york0/autoscripts/postrm-makeshlibs --- debhelper-9.20160115ubuntu3/autoscripts/postrm-makeshlibs 2016-01-15 20:19:12.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/postrm-makeshlibs 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -if [ "$1" = "remove" ]; then - ldconfig -fi diff -Nru debhelper-9.20160115ubuntu3/autoscripts/postrm-suid debhelper-11ubuntu1~16.04.york0/autoscripts/postrm-suid --- debhelper-9.20160115ubuntu3/autoscripts/postrm-suid 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/postrm-suid 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -if [ "$1" = remove ] && [ -e /etc/suid.conf ] && \ - which suidunregister >/dev/null 2>&1; then - suidunregister -s #PACKAGE# /#FILE# -fi diff -Nru debhelper-9.20160115ubuntu3/autoscripts/postrm-systemd debhelper-11ubuntu1~16.04.york0/autoscripts/postrm-systemd --- debhelper-9.20160115ubuntu3/autoscripts/postrm-systemd 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/postrm-systemd 2017-07-29 18:08:37.000000000 +0000 @@ -0,0 +1,12 @@ +if [ "$1" = "remove" ]; then + if [ -x "/usr/bin/deb-systemd-helper" ]; then + deb-systemd-helper mask #UNITFILES# >/dev/null + fi +fi + +if [ "$1" = "purge" ]; then + if [ -x "/usr/bin/deb-systemd-helper" ]; then + deb-systemd-helper purge #UNITFILES# >/dev/null + deb-systemd-helper unmask #UNITFILES# >/dev/null + fi +fi diff -Nru debhelper-9.20160115ubuntu3/autoscripts/postrm-systemd-reload-only debhelper-11ubuntu1~16.04.york0/autoscripts/postrm-systemd-reload-only --- debhelper-9.20160115ubuntu3/autoscripts/postrm-systemd-reload-only 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/postrm-systemd-reload-only 2017-07-29 18:08:37.000000000 +0000 @@ -0,0 +1,3 @@ +if [ -d /run/systemd/system ]; then + systemctl --system daemon-reload >/dev/null || true +fi diff -Nru debhelper-9.20160115ubuntu3/autoscripts/preinst-moveconffile debhelper-11ubuntu1~16.04.york0/autoscripts/preinst-moveconffile --- debhelper-9.20160115ubuntu3/autoscripts/preinst-moveconffile 2016-01-06 15:55:12.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/preinst-moveconffile 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -if [ "$1" = install ] || [ "$1" = upgrade ]; then - if [ -e "#OLD#" ]; then - if [ "`md5sum \"#OLD#\" | sed -e \"s/ .*//\"`" = \ - "`dpkg-query -W -f='${Conffiles}' #PACKAGE# | sed -n -e \"\\\\' #OLD# '{s/ obsolete$//;s/.* //p}\"`" ] - then - rm -f "#OLD#" - fi - fi -fi diff -Nru debhelper-9.20160115ubuntu3/autoscripts/preinst-sgmlcatalog debhelper-11ubuntu1~16.04.york0/autoscripts/preinst-sgmlcatalog --- debhelper-9.20160115ubuntu3/autoscripts/preinst-sgmlcatalog 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/preinst-sgmlcatalog 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -if test -f #CENTRALCAT# -a "(" "$1" = "upgrade" -o "$1" = "install" -a -n "$2" ")" && - ! dpkg-query -S #CENTRALCAT# >/dev/null 2>&1; then - # If the dpkg-query command returns non-zero, the central catalog is - # not owned by any package. This is due to an old behaviour of - # debhelper. Now that file becomes a conffile. In order to avoid a - # question during installation, we remove the old non-conffile. - mv #CENTRALCAT# #CENTRALCAT#.old -fi diff -Nru debhelper-9.20160115ubuntu3/autoscripts/prerm-init debhelper-11ubuntu1~16.04.york0/autoscripts/prerm-init --- debhelper-9.20160115ubuntu3/autoscripts/prerm-init 2016-01-19 18:54:31.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/prerm-init 2017-07-10 18:48:25.000000000 +0000 @@ -1,3 +1,3 @@ -if [ -x "/etc/init.d/#SCRIPT#" ] || [ -e "/etc/init/#SCRIPT#.conf" ]; then +if [ -x "/etc/init.d/#SCRIPT#" ]; then invoke-rc.d #SCRIPT# stop || #ERROR_HANDLER# fi diff -Nru debhelper-9.20160115ubuntu3/autoscripts/prerm-init-norestart debhelper-11ubuntu1~16.04.york0/autoscripts/prerm-init-norestart --- debhelper-9.20160115ubuntu3/autoscripts/prerm-init-norestart 2016-01-19 18:54:31.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/prerm-init-norestart 2017-07-10 18:48:25.000000000 +0000 @@ -1,4 +1,3 @@ -if ([ -x "/etc/init.d/#SCRIPT#" ] || [ -e "/etc/init/#SCRIPT#.conf" ]) && \ - [ "$1" = remove ]; then +if [ -x "/etc/init.d/#SCRIPT#" ] && [ "$1" = remove ]; then invoke-rc.d #SCRIPT# stop || #ERROR_HANDLER# fi diff -Nru debhelper-9.20160115ubuntu3/autoscripts/prerm-systemd debhelper-11ubuntu1~16.04.york0/autoscripts/prerm-systemd --- debhelper-9.20160115ubuntu3/autoscripts/prerm-systemd 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/prerm-systemd 2017-07-29 18:08:37.000000000 +0000 @@ -0,0 +1,3 @@ +if [ -d /run/systemd/system ]; then + deb-systemd-invoke stop #UNITFILES# >/dev/null +fi diff -Nru debhelper-9.20160115ubuntu3/autoscripts/prerm-systemd-restart debhelper-11ubuntu1~16.04.york0/autoscripts/prerm-systemd-restart --- debhelper-9.20160115ubuntu3/autoscripts/prerm-systemd-restart 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/autoscripts/prerm-systemd-restart 2017-07-29 18:08:37.000000000 +0000 @@ -0,0 +1,3 @@ +if [ -d /run/systemd/system ] && [ "$1" = remove ]; then + deb-systemd-invoke stop #UNITFILES# >/dev/null +fi diff -Nru debhelper-9.20160115ubuntu3/debhelper-obsolete-compat.pod debhelper-11ubuntu1~16.04.york0/debhelper-obsolete-compat.pod --- debhelper-9.20160115ubuntu3/debhelper-obsolete-compat.pod 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/debhelper-obsolete-compat.pod 2017-07-29 18:08:37.000000000 +0000 @@ -0,0 +1,128 @@ +=head1 NAME + +debhelper-obsolete-compat - List of no longer supported compat levels + +=head1 SYNOPSIS + +This document contains the upgrade guidelines from all compat levels +which are no longer supported. Accordingly it is mostly for +historical purposes and to assist people upgrading from a +non-supported compat level to a supported level. + +For upgrades from supported compat levels, please see L. + +=head1 UPGRADE LIST FOR COMPAT LEVELS + +The following is the list of now obsolete compat levels and their +changes. + +=over 4 + +=item v1 + +This is the original debhelper compatibility level, and so it is the default +one. In this mode, debhelper will use F as the package tree +directory for the first binary package listed in the control file, while using +debian/I for all other packages listed in the F file. + +This mode is deprecated. + +=item v2 + +In this mode, debhelper will consistently use debian/I +as the package tree directory for every package that is built. + +This mode is deprecated. + +=item v3 + +This mode works like v2, with the following additions: + +=over 8 + +=item - + +Debhelper config files support globbing via B<*> and B, when appropriate. To +turn this off and use those characters raw, just prefix with a backslash. + +=item - + +B makes the F and F scripts call B. + +=item - + +Every file in F is automatically flagged as a conffile by B. + +=back + +This mode is deprecated. + +=item v4 + +Changes from v3 are: + +=over 8 + +=item - + +B will not include the Debian part of the version number in +the generated dependency line in the shlibs file. + +=item - + +You are encouraged to put the new B<${misc:Depends}> into F to +supplement the B<${shlibs:Depends}> field. + +=item - + +B will make all files in F directories and in F +executable. + +=item - + +B will correct existing links to conform with policy. + +=back + +This mode is deprecated. + +=item v5 + +This is the lowest supported compatibility level. + +Changes from v4 are: + +=over 8 + +=item - + +Comments are ignored in debhelper config files. + +=item - + +B now specifies the name of a package to put debugging +symbols in, not the packages to take the symbols from. + +=item - + +B skips installing empty files. + +=item - + +B errors out if wildcards expand to nothing. + +=back + +=back + +=head1 SEE ALSO + +L + +=head1 AUTHORS + +Niels Thykier + +Joey Hess + +=cut diff -Nru debhelper-9.20160115ubuntu3/debhelper.pod debhelper-11ubuntu1~16.04.york0/debhelper.pod --- debhelper-9.20160115ubuntu3/debhelper.pod 2016-01-11 19:07:51.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/debhelper.pod 2017-12-16 15:41:17.000000000 +0000 @@ -1,10 +1,12 @@ +=encoding UTF-8 + =head1 NAME debhelper - the debhelper tool suite =head1 SYNOPSIS -BI<*> [B<-v>] [B<-a>] [B<-i>] [B<-s>] [B<--no-act>] [B<-p>I] [B<-N>I] [B<-P>I] +BI<*> [B<-v>] [B<-a>] [B<-i>] [B<--no-act>] [B<-p>I] [B<-N>I] [B<-P>I] =head1 DESCRIPTION @@ -26,6 +28,11 @@ automates the process. For a more gentle introduction, the B Debian package contains a tutorial about making your first package using debhelper. +Except where tool explicitly denotes otherwise, all of the debhelper +tools assumes that they run from root directory of an unpacked source +package. This is so they can locate find F and +F when needed. + =head1 DEBHELPER COMMANDS Here is the list of debhelper commands you can use. See their man @@ -111,7 +118,7 @@ =item B<-a>, B<--arch> Act on architecture dependent packages that should be built for the -build architecture. +B architecture. =item B<-i>, B<--indep> @@ -124,8 +131,7 @@ =item B<-s>, B<--same-arch> -This used to be a smarter version of the B<-a> flag, but the B<-a> flag is now -equally smart. +Deprecated alias of B<-a>. =item B<-N>I, B<--no-package=>I @@ -273,19 +279,20 @@ to debhelper, to keep it clean and well-designed as needs change and its author gains more experience. To prevent such major changes from breaking existing packages, the concept of debhelper compatibility levels was -introduced. You tell debhelper which compatibility level it should use, and -it modifies its behavior in various ways. +introduced. You must tell debhelper which compatibility level it should use, and +it modifies its behavior in various ways. The compatibility level is +specified in the F file and the file must be present. Tell debhelper what compatibility level to use by writing a number to -F. For example, to turn on v9 mode: +F. For example, to use v#RECOMMENDED_COMPAT# mode: - % echo 9 > debian/compat + % echo #RECOMMENDED_COMPAT# > debian/compat Your package will also need a versioned build dependency on a version of debhelper equal to (or greater than) the compatibility level your package -uses. So for compatibility level 9, ensure debian/control has: +uses. So for compatibility level #RECOMMENDED_COMPAT#, ensure debian/control has: - Build-Depends: debhelper (>= 9) + Build-Depends: debhelper (>= #RECOMMENDED_COMPAT#) Unless otherwise indicated, all debhelper documentation assumes that you are using the most recent compatibility level, and in most cases does not @@ -294,70 +301,21 @@ read below for notes about what is different in earlier compatibility levels. +=head2 Supported compatibility levels + These are the available compatibility levels: =over 4 -=item v3 +=item v5 This is the lowest supported compatibility level. -This mode is deprecated. - -=item v4 - -Changes from v3 are: - -=over 8 - -=item - - -B will not include the Debian part of the version number in -the generated dependency line in the shlibs file. - -=item - - -You are encouraged to put the new B<${misc:Depends}> into F to -supplement the B<${shlibs:Depends}> field. - -=item - - -B will make all files in F directories and in F -executable. - -=item - - -B will correct existing links to conform with policy. - -=back +If you are upgrading from an earlier compatibility level, please +review L. This mode is deprecated. -=item v5 - -Changes from v4 are: - -=over 8 - -=item - - -Comments are ignored in debhelper config files. - -=item - - -B now specifies the name of a package to put debugging -symbols in, not the packages to take the symbols from. - -=item - - -B skips installing empty files. - -=item - - -B errors out if wildcards expand to nothing. - -=back - =item v6 Changes from v5 are: @@ -388,6 +346,8 @@ =back +This mode is deprecated. + =item v7 Changes from v6 are: @@ -416,6 +376,8 @@ =back +This mode is deprecated. + =item v8 Changes from v7 are: @@ -445,9 +407,9 @@ =back -=item v9 +This mode is deprecated. -This is the recommended mode of operation. +=item v9 Changes from v8 are: @@ -479,6 +441,10 @@ B does not default to enabling --with=python-support +(Obsolete: As the B tool was removed from Debian +stretch. Since debhelper/10.3, B no longer enables this sequence +add-on regardless of compat level) + =item - All of the BI<*> debhelper programs and B set @@ -504,8 +470,6 @@ =item v10 -This compatibility level is still open for development; use with caution. - Changes from v9 are: =over 8 @@ -549,7 +513,7 @@ The B command will not accept any of the deprecated "manual sequence control" parameters (B<--before>, B<--after>, etc.). Please -migrate to use override targets instead. +use override targets instead. =item - @@ -557,7 +521,7 @@ have been run. The B command I keeps track of whether it already ran the "build" sequence and skip it if it did. -The main affects of this are: +The main effects of this are: =over 4 @@ -571,7 +535,7 @@ The main caveat is that B now only keeps track of what happened in a single override target. When all the calls to a given B -command happens in the same override target every thing will work as +command happens in the same override target everything will work as before. Example of where it can go wrong: @@ -590,6 +554,215 @@ =back +=item - + +The B command now shell-escapes the lines in the +F config file. This was the original intent but it did +not work properly and packages have begun to rely on the incomplete +shell escaping (e.g. quoting file names). + +=item - + +The B command now defaults to +B<--restart-after-upgrade>. For packages needing the previous +behaviour, please use B<--no-restart-after-upgrade>. + +=item - + +The B sequence is now enabled by default. Please pass +B<--without autoreconf> to B if this is not desirable for a given +package + +=item - + +The B sequence is now enabled by default. Please pass +B<--without systemd> to B if this is not desirable for a given +package. + +=back + +=item v11 + +This is the recommended mode of operation. + +Changes from v10 are: + +=over 8 + +=item - + +B no longer installs F or F files, +nor generates maintainer scripts for those files. Please use the new +B helper. + +=item - + +The B and B helpers have been +replaced by the new B helper. For the same reason, +the B sequence for B has also been removed. If you need +to disable the B helper tool, please use an empty +override target. + +Please note that the B tool has a slightly +different behaviour in some cases (e.g. when using the B<--name> +parameter). + +=item - + +B no longer creates debian/I directories +unless explicitly requested (or it has to create a subdirectory in +it). + +The vast majority of all packages will be unaffected by this change. + +=item - + +The B buildsystem now passes B to L. Derivative buildsystems +(e.g. B or B) are unaffected by this change. + +=item - + +The B buildsystem now passes B<--runstatedir=/run> to +F<./configure>. + +=item - + +The B buildsystem now passes +B<-DCMAKE_INSTALL_RUNSTATEDIR=/run> to L. + +B: This option silently does nothing in cmake versions prior +to 3.8. Please keep this in mind if your package is regularly +backported to a suite (e.g. stretch-backports) where cmake is older +than 3.8. + +=item - + +B will now prefer detecting the language from the +path name rather than the extension. + +=item - + +B will now only create the destination +directory it needs. Previously, it would create the package build +directory for all packages. This will not affect packages that only +build with debhelper commands, but it may expose bugs in commands not +included in debhelper. + +=item - + +The helpers B, B, B, +and B now error out if their config has a pattern that +does not match anything or reference a path that does not exist. + +Known exceptions include building with the B profile, where the +above tools will silently permit failed matches where the patterns +are used to specify documentation. + +=item - + +The helpers B, B, B, +and B now accept the parameter B<--sourcedir> with same +meaning as B. Furthermore, they now also fall back to +F like B. + +=item - + +The B and B build systems no longer pass +B<-I.> to perl. Packages that still need this behaviour can emulate +it by using the B environment variable. E.g. by adding +B in their debian/rules file (or similar). + +=item - + +The B environment variable is no longer set by +B or any of the B tools. It was added as a temporary +work around to avoid a lot of packages failing to build at the same +time. + +Note this item will eventually become obsolete as upstream intends +to drop support for the B environment variable. +When perl drops support for it, then this variable will be removed +retroactively from existing compat levels as well. + +=item - + +The B helper will now exit with an error if objdump +returns a non-zero exit from analysing a given file. + +=item - + +The B and B tools will now attempt +to guess the "main package" for a given documentation package +(e.g. I will have I as main package if the latter +exists). If a main package is found, I of the documentation +will be installed into F<< /usr/share/doc/I >> by default as +recommended by Debian policy §12.3 since version 3.9.7. Notable +exceptions include the copyright file and changelog files. + +The B<--doc-main-package> option can be used when the auto-detection +is insufficient. + +=item - + +The B and B tools no longer uses filename +patterns to determine which files to process. Instead, they open the +file and look for an ELF header to determine if a given file is an +shared object or an ELF executable. + +This change may cause the tools to process more files than previously. + +=back + +=item v12 + +This compatibility level is still open for development; use with caution. + +Changes from v11 are: + +=over 8 + +=item - + +The B<-s> (B<--same-arch>) option is removed. Please use B<-a> (B<--arch>) instead. + +=item - + +Invoking B now causes an error instead of a deprecation +warning. + +=item - + +The B<--no-restart-on-upgrade> option in B has been removed. +Please use the new name B<--no-stop-on-upgrade> + +=item - + +There was a bug in the B (and similar) functions from +L that made them spawn a shell in one +particular circumstance. This bug is now removed and will cause +helpers that rely on the bug to fail with a "command not found"-error. + +=item - + +The B<--list-missing> and B<--fail-missing> in B has been +removed. Please use B and its corresponding options, +which can also see the files installed by other helpers. + +=item - + +The B helper no longer installs configuration for +the upstart init system. Instead, it will abort the build if it +finds an old upstart configuration file. The error is there to +remind the package maintainer to ensure the proper removal of the +conffiles shipped in previous versions of the package (if any). + +=item - + +The B tool will do basic validation of some +L commands and will error out if the +commands appear to be invalid. + =back =back @@ -613,7 +786,7 @@ in the control file, with the exceptions below. First, any package whose B field in B does not -match the build architecture will be excluded +match the B architecture will be excluded (L). Also, some additional packages may be excluded based on the contents of the @@ -621,6 +794,38 @@ binary package stanzas in B, according to the draft policy at L. +=head3 Interaction between package selections and Build-Profiles + +Build-Profiles affect which packages are included in the package +selections mechanisms in debhelper. Generally, the package selections +are described from the assumption that all packages are enabled. This +section describes how the selections react when a package is disabled +due to the active Build-Profiles (or lack of active Build-Profiles). + +=over 4 + +=item -a/--arch, -i/--indep OR no selection options (a raw "dh_X" call) + +The package disabled by Build-Profiles is silently excluded from the +selection. + +Note you will receive a warning if I packages related to these +selections are disabled. In that case, it generally does not make +sense to do the build in the first place. + +=item -N I / --no-package I + +The option is accepted and effectively does nothing. + +=item -p I / --package I + +The option is accepted, but debhelper will not act on the package. + +=back + +Note that it does not matter whether a package is enabled or disabled +by default. + =head2 Automatic generation of Debian install scripts Some debhelper commands will automatically generate parts of Debian diff -Nru debhelper-9.20160115ubuntu3/debian/changelog debhelper-11ubuntu1~16.04.york0/debian/changelog --- debhelper-9.20160115ubuntu3/debian/changelog 2016-03-31 17:57:01.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/debian/changelog 2018-01-26 10:08:56.000000000 +0000 @@ -1,3 +1,1538 @@ +debhelper (11ubuntu1~16.04.york0) xenial; urgency=medium + + * Merge from Debian 11~bpo9+1: + - Disable R³ support + - Lower deps, BDs + + -- Jonathon Fernyhough Fri, 26 Jan 2018 10:07:22 +0000 + +debhelper (11ubuntu1) bionic; urgency=medium + + * Merge with Debian; remaining changes: + - Generate ddebs from debhelper instead of pkg-create-dbgsym + + Make debhelper Conflict/Replace pkg-create-dbgsym to force it off. + + Set DBGSYM_PACKAGE_TYPE to ddeb to get correct debian/files output. + - dh_installchangelogs: Do not install upstream changelog in compat + level 7 and higher to avoid pointlessly bloating installed packages. + + -- Matthias Klose Sun, 17 Dec 2017 16:46:01 +0100 + +debhelper (11) unstable; urgency=medium + + [ Niels Thykier ] + * dh_installdeb: Do basic validation of rm_conffile and mv_conffile + parameters in "maintscript" parameters in compat 10 and newer. + In compat 12, this is an error. Thanks to Andreas Beckmann for + the suggestions. (Closes: #882626) + * dh_strip: Fix bug where the Build-Id field would not be properly + filled when using --dbg-package. Thanks to Paul Wise for finding + and reporting the bug. (Closes: #884152) + * d/control: Bump Standards-Version to 4.1.2 - no changes required. + * dh_installsystemd: Remove neutering of dh_installsystemd in compat + levels prior to 11 now that compat 11 is stable. + + [ Chris Leick ] + * debhelper.pod: Improve the wording of two parapraphs. + + [ Translations ] + * Update Portuguese translation (Américo Monteiro) + (Closes: #883635) + * Update German translation (Chris Leick) (Closes: #884205) + + -- Niels Thykier Sat, 16 Dec 2017 15:41:17 +0000 + +debhelper (10.10.9ubuntu1) bionic; urgency=medium + + * Merge from current Debian unstable. Remaining changes: + - Generate ddebs from debhelper instead of pkg-create-dbgsym + + Make debhelper Conflict/Replace pkg-create-dbgsym to force it off. + + Set DBGSYM_PACKAGE_TYPE to ddeb to get correct debian/files output. + - dh_installchangelogs: Do not install upstream changelog in compat + level 7 and higher to avoid pointlessly bloating installed packages. + + -- Adam Conrad Tue, 21 Nov 2017 14:26:40 -0700 + +debhelper (10.10.9) unstable; urgency=medium + + [ Dmitry Shachnev ] + * qmake.pm: Add missing import of generated_file. + * meson.pm: Find typo of meson in the name of the cross config + file. + * qmake.pm: Push compiler information as ‘early’ flags to qmake, to + make sure qmake calls the right compiler to get library paths. + * qmake.pm: Add all possible settings to generated qmake-cross.conf. + Now output of ‘qmake -query’ with and without using this file is + identical. This makes cross-building Qt’s own modules possible. + + [ Niels Thykier ] + * dh_missing: Permit a missing debian/tmp without failing in + compat 11 when debian/tmp is an implicit source directory. + Thanks to Christoph Biedl for reporting the bug. + (Closes: #882083) + * dh_missing: Improve the wording about "debian/not-installed". + + -- Niels Thykier Sun, 19 Nov 2017 11:04:45 +0000 + +debhelper (10.10.8ubuntu1) bionic; urgency=medium + + * Merge from current Debian unstable. Remaining changes: + - Generate ddebs from debhelper instead of pkg-create-dbgsym + + Make debhelper Conflict/Replace pkg-create-dbgsym to force it off. + + Set DBGSYM_PACKAGE_TYPE to ddeb to get correct debian/files output. + - dh_installchangelogs: Do not install upstream changelog in compat + level 7 and higher to avoid pointlessly bloating installed packages. + + -- Gianfranco Costamagna Thu, 16 Nov 2017 11:36:13 +0100 + +debhelper (10.10.8) unstable; urgency=medium + + [ Niels Thykier ] + * Document that compat 11 is now in its open beta phase. + * Dh_Getopt: Improve warning message when a package is excluded + due to profiles or architecture restrictions. + * dh_install: Properly allow patterns to be excluded without + complaining about missing files. (Closes: #881658) + * qmake.pm: Ensure that the qmake cross-build config file + survives until clean. + + [ Dmitry Shachnev ] + * qmake.pm: Set QMAKE_LINK correctly for cross-builds. + + -- Niels Thykier Wed, 15 Nov 2017 19:46:00 +0000 + +debhelper (10.10.7ubuntu2) bionic; urgency=medium + + * Revert e5fce9b0a40357f9ed54426f2e04495b1442e8f1, + breaking libguestfs dh_install usr/lib/*-*/ regex + + -- Gianfranco Costamagna Mon, 13 Nov 2017 22:53:16 +0100 + +debhelper (10.10.7ubuntu1) bionic; urgency=medium + + * Merge from current Debian unstable. Remaining changes: + - Generate ddebs from debhelper instead of pkg-create-dbgsym + + Make debhelper Conflict/Replace pkg-create-dbgsym to force it off. + + Set DBGSYM_PACKAGE_TYPE to ddeb to get correct debian/files output. + - dh_installchangelogs: Do not install upstream changelog in compat + level 7 and higher to avoid pointlessly bloating installed packages. + + -- Gianfranco Costamagna Sun, 12 Nov 2017 19:40:53 +0100 + +debhelper (10.10.7) unstable; urgency=medium + + * dh_strip: Fix a regression that caused debug symbols for + executables to be discarded instead of included into + debug packages. + * Dh_Lib: Ensure that $dh{U_PARAMS} is always defined as a + list. Thanks to Adrian Bunk for the bug report. + + -- Niels Thykier Sat, 11 Nov 2017 14:10:21 +0000 + +debhelper (10.10.6) unstable; urgency=medium + + [ Axel Beckert ] + * Cleanup trailing whitespace in ancient debian/changelog entries and + debian/rules. + * Fix typo "belive" in debian/copyright and ancient debian/changelog + entries. + * Use HTTPS in debian/copyright format URL. + + [ Niels Thykier ] + * Remove support for named compat levels. + * dh_perl: Make dh_perl faster on packages with large doc + directories by pruning the entire doc directory. + * dh,dh_auto_*: Support skipping all of the dh_auto_* helpers if the + package does not seem to have a build system (and there are no build + system related options passed to dh). + * Dh_Lib.pm: Define a (hardcoded) extension for dbgsym packages. + * dh_gencontrol: Pass -DPackage-Type to dpkg-gencontrol when the + package type for dbgsym is different than for regular deb packages. + * dh_builddeb: Automatically handle renaming of dbgsym packages when + the extension of the dbgsym packages are different than for regular + deb packages. + * dh_installsystemd,dh_systemd_start: Use "restart" instead of the + "try-restart" action. This ensures that newly added services are + started the first time they are installed. (Closes: #879727, + LP: #1707880) + * dh_install: Fix regression where it was no longer possible to + exclude an entire pattern / source file. Thanks to James Cowgill + for the report. (Closes: #814856, LP: #1554979) + * dh_installsystemd: Permit missing explicitly requested file in + package as long as another on being acted on ships it. + * dh_installsystemd: Optimize the search for files installed in the + tmpfiles.d directories to only look in the tmpfiles.d directories. + * Add experimental support for building some packages for "TARGET" + rather than "HOST" via the X-DH-Build-For-Type field. The field + is subject to removal and changes without notice. The field is + not considered by dpkg tooling and therefore you will still have + to manually work around tools like dpkg-gencontrol (even when + called via dh_gencontrol). + * dh_makeshlibs: Ignore non-ELF files even if they are named ".so". + (Closes: #880480) + * Dh_Lib: Improve the performance of isnative by using + Dpkg::Changelog::Parse instead of calling dpkg-parsechangelog as + an external process. This improves the performance of + dh_installchangelogs by ~10%. + + [ Felipe Sateler ] + * dh_installsystemd: Fix a bug where dh_installsystemd would generate + invalid maintscript, when there were no units to start or enable. + Thanks to Ben Hutchings and Bastian Blank for the bug report. + (Closes: #881190) + + -- Niels Thykier Sat, 11 Nov 2017 11:18:11 +0000 + +debhelper (10.10.5ubuntu1) bionic; urgency=medium + + * Merge from current Debian unstable. Remaining changes: + - Generate ddebs from debhelper instead of pkg-create-dbgsym + + Make debhelper Conflict/Replace pkg-create-dbgsym to force it off. + + Mirror udeb code in dh_builddeb to allow us to alter file extension. + + Set dbgsym Package-Type to ddeb to get correct debian/files output. + - dh_installchangelogs: Do not install upstream changelog in compat + level 7 and higher to avoid pointlessly bloating installed packages. + + -- Gianfranco Costamagna Fri, 27 Oct 2017 08:01:25 +0200 + +debhelper (10.10.5) unstable; urgency=medium + + * meson.pm: Add missing import of generated_file that broke + cross building. + * Dh_Lib: Fix regression where an empty line before the source + paragraph in d/control would cause parse error. + (Closes: #879762) + + -- Niels Thykier Thu, 26 Oct 2017 19:10:51 +0000 + +debhelper (10.10.4ubuntu1) bionic; urgency=medium + + * Merge from current Debian unstable. Remaining changes: + - Generate ddebs from debhelper instead of pkg-create-dbgsym + + Make debhelper Conflict/Replace pkg-create-dbgsym to force it off. + + Mirror udeb code in dh_builddeb to allow us to alter file extension. + + Set dbgsym Package-Type to ddeb to get correct debian/files output. + - dh_installchangelogs: Do not install upstream changelog in compat + level 7 and higher to avoid pointlessly bloating installed packages. + + -- Adam Conrad Wed, 25 Oct 2017 18:39:43 -0600 + +debhelper (10.10.4) unstable; urgency=medium + + * meson.pm: Keep the meson cross file until dh_clean is + called as otherwise ninja tries and fails to regenerate the + build rules. Thanks to Helmut Grohne for reporting the + bug. (Closes: #879658) + * dh_dwz: Add new experimental tool to run dwz(1) to deduplicate + ELF debugging symbols. It should be generally be run before + dh_strip (as dh_strip compresses the debug symbols and dwz + expects uncompressed debug symbols). (Closes: #878888) + * dwz.pm: New sequence to add dh_dwz to the sequence. + * d/control: Add a Suggets on dwz for the optional dh_dwz tool. + * Dh_Lib.pm: Fix regression where the source section would not + be parsed leading to dbgsym packages possibly getting an + incorrect value in the Section field. Thanks to Mihai + Moldovan for reporting the issue. (Closes: #879667) + + -- Niels Thykier Wed, 25 Oct 2017 06:00:13 +0000 + +debhelper (10.10.3) unstable; urgency=medium + + * dh_strip: Skip the entire directory when an exclude rule + parameter matches it. + * dh_fixperms: Improve the documentation to assume less familarity + with "Rules-Requires-Root" (R³). + * dh_usrlocal: Ditto. + * dh_builddeb: Ditto. + * dh_usrlocal: Correct the group name when creating directories + owned by "root:staff". Thanks to Paul Gevers for reporting + the bug. (Closes: #879643) + * dh_usrlocal: Fix inverted boolean logic that made dh_usrlocal + ignore ownership of directories when it should have preserved + them. + + -- Niels Thykier Mon, 23 Oct 2017 21:24:08 +0000 + +debhelper (10.10.2) unstable; urgency=medium + + * Dh_Lib: Fix uninitialized warning in find_hardlinks that + broke dh_compress's ability to deal with hardlinks. Thanks + to Ondřej Surý for finding the bug. + + -- Niels Thykier Sun, 22 Oct 2017 21:21:58 +0000 + +debhelper (10.10.1) unstable; urgency=medium + + * debhelper.pod: Document that all tools by default must be run + in the root of an unpacked source. + * dh: Clarify that --list can be run anywhere. + * dh_testroot: Temporarily cope with being run outside a source + root. (Closes: #879478) + * dh_testroot: Update manpage to mention its new scope. + * d/control: Bump (build-)dependency on dpkg to 1.19.0.3~. That + was technically necessary already in the previous upload. + + -- Niels Thykier Sun, 22 Oct 2017 09:00:12 +0000 + +debhelper (10.10) unstable; urgency=medium + + * dh_installsystemd: Improve error messages to include the actual + error caused by attempted to open the file. + * dh_systemd_enable: Ditto. + * dh_systemd_start: Ditto. + * dh_installinit: In compat 12, error out if an upstart init file + is provided with a reminder message about how to remove the + obsolete conffile. (Closes: #876453) + * dh_systemd_enable: Permit missing explicitly requested file in + package as long as another on being acted on ships it. + (Closes: #878911) + * dh_systemd_start: Ditto. + * Dh_Lib.pm: Add support for R³ (Rules-Requires-Root field) to + enable package builds without requiring root (or only + selectively require root). + * dh_fixperms: Skip "chown" calls when R³ is set to anything but + "binary-targets". + * dh_installchangelogs: Ditto. + * dh_installdocs: Ditto. + * dh_testroot: Update check for root to support R³. + * makefile.pm: Call "make install" with DPKG_GAIN_ROOT_CMD when + R³ contains the "debhelper/upstream-make-install" keyword. + * dh_builddeb: Pass --root-owner-group to dpkg-deb in packages + with R³ (except for "binary-targets"). + * dh_usrlocal: When R³ is enabled (and not "binary-targets"), + ignore the ownership/mode information on the directories. + Instead, the ownership "root:staff" and the mode 02775 is used. + * d/control: Bump (Build-)Dependency on dpkg-dev to support to + support R³. + * d/control: Set R³ to "no". + + -- Niels Thykier Sat, 21 Oct 2017 17:59:46 +0000 + +debhelper (10.9.2) unstable; urgency=medium + + [ Niels Thykier ] + * dh_install: Defer the removal of --list-missing and + --fail-missing until compat 12. + * dh: Run the new dh_installsystemd helper by default in compat 11. + * systemd.pm: Remove the sequence in compat 11. It has been replaced + by the new dh_installsystemd helper. + + [ Lisandro Damián Nicanor Pérez Meyer ] + * qmake.pm: Remove unnecessary "-nocache" parameter. + (Closes: #878427, LP: #1206234) + + [ Ville Skyttä ] + * Fix a number of spelling mistakes. (Closes: #878325) + + [ Felipe Sateler ] + * dh_installsystemd: New command (currently noop except when used in + the experimental compat 11). This new helper: + - Generates postinst code for tmpfiles (now that dh_installinit + does not). + - Follows the naming convention for other built-in dh_* commands. + - Replaces dh_systemd_enable and dh_systemd_start in compat 11 + and later. + - Only acts on units with the name specified by "--name" when this + option is given. + (Closes: #752521, #857306, #870768, #876486) + * dh_systemd_enable: Remove as obsolete in compat 11. + * dh_systemd_start: Ditto. + + [ Helmut Grohne ] + * cmake.pm: Also supply PKGCONFIG_EXECUTABLE for obsolete + UsePkgConfig.cmake. (Closes: #878460) + + -- Niels Thykier Sat, 14 Oct 2017 07:19:38 +0000 + +debhelper (10.9.1) unstable; urgency=medium + + [ Niels Thykier ] + * dh_builddeb: Add some missing error checks. + * Dh_Lib.pm: Fix bug where debhelper could discard some error + messages during parsing when -O options were passed via + DH_OPTIONS (among other). Thanks to Adrian Bunk and + Andrew Shadura for reporting the issue. (Closes: #876689) + * Dh_Getopt.pm: Gracefully reduce the tool to a no-op when given + a -p and is disabled by a Build-Profile. + * debhelper.7: Document how package selections interact with + Build-Profiles. Thanks to Helmut Grohne for the report. + (Closes: #872745) + * dh_installdocs: Validate that the package passed to + --doc-main-package are listed in debian/control. + * dh_installexamples: Ditto. + * dh_systemd_start: Regex escape two paths used in a regex. + * Dh_Lib: Open compat 12. + * dh_clean: Defer making -k an error until compat 12. + * Dh_Getopt: Defer making -s an error until compat 12. + * dh_installinit: Defer making --no-restart-on-upgrade an error + until compat 12. + * Dh_Lib: Defer making the "shell-spawning bug" in doit an error + until compat 12. + * dh_systemd_enable: Fix regression in debhelper/10.9 where + template units would be installed as regular units (and + possibly replace regular units). (Closes: #877989) + * dh_systemd_enable: Drop versioned dependency on + init-system-helpers that is satisfied in oldstable. + * Dh_Lib: Fix regression where --no-act would actually create + maintscript snippets. + * dh_systemd_*: If an unit file cannot be read (e.g. to check for + the [Install] section), error out instead of emitting a warning + and continuing. + * t: Add tests for dh_systemd_* based on WIP tests from Felipe + Sateler related to a new dh_installsystemd helper. + * dh_systemd_enable: Properly quote unit names to preserve + escaped names like "\x2d". Thanks to Bernd Zeimetz for + reporting the issue. (Closes: #764730) + * dh_systemd_start: Ditto. + * meson.pm: Add prototype support for cross building by relying + on /usr/share/meson/debcrossgen. Note that this is currently + not functional due to #875703. + * debian/control: Bump Standards-Versions to 4.1.1 - No changes + required. + + [ Dmitry Shachnev ] + * qmake.pm: Add basic cross-building support. (Closes: #877357) + + -- Niels Thykier Tue, 10 Oct 2017 19:01:00 +0000 + +debhelper (10.9) unstable; urgency=medium + + [ Niels Thykier ] + * debhelper.pod: Fix typo. + * dh_fixperms: Reset permissions of .scss and .sass files to + 0644. Thanks to Jonas Smedegaard for the suggestion. + (Closes: #875586) + * dh_shlibdeps: Disable unused file(1) tests. + * dh_strip: In compat 11, rely on file headers/magic to + determine whether files are ELF binaries worth processing + instead of using filenames/extensions. (Closes: #35733) + * dh_shlibdeps: Ditto. + * d/control: Bump Standards-Versions to 4.1.0: + - Bump priority of dh-systemd to "optional". + * dh_makeshlibs: Avoid gratious warning about a non-existing + directory, when the packaging directory does not exist. + (Closes: #626685) + * dh_gencontrol: Ensure that dbgsym packages do not inherit the + "Important" field. + * dh_installinfo: Merge two chmod calls into one to save a + fork+exec. + * dh_builddeb: Use -z6 compression for udebs (up from -z1). + Thanks to Adrian Bunk for the suggestion and Aurelien Jarno + for confirming it would be fine for d-i. (Closes: #870201) + * dh_fixperms: Set the permissions of /usr/lib/nodejs/*/{cli,bin}.js + to 0755. Thanks to Pirate Praveen for the report. + (Closes: #840913) + * Dh_lib.pm: Expand *_doit and doit to also support a chdir in the + child process. + * Dh_Getopt.pm: Validate package names passed via -p and -N to ensure + they are present in d/control. Thanks to Matthias Klose for the + report. (Closes: #795432) + * debhelper.7: Fix typo of compatibility. + + [ Felipe Sateler ] + * dh_systemd_enable: Refactor and add support for timer units. + (Closes: #841746) + + -- Niels Thykier Tue, 19 Sep 2017 18:49:57 +0000 + +debhelper (10.8) unstable; urgency=medium + + [ Niels Thykier ] + * Dh_Lib: Introduce a qx_cmd sub to behave like a mix of qx + and doit (i.e. avoid the shell while capturing stdout). + * dh_makeshlibs: Avoid forking a shell when calling objdump in + compat 11. + * dh_shlibdeps: Avoid forking a shell when calling file. + * dh_shlibdeps: Avoid passing files with "newline" to + subprocesses. + * dh_installdocs: Ignore missing files in compat 11 for packages + that are not processed (e.g. arch:all packages during a -B build). + Thanks to Jens Reyer for reporting the issue. (Closes: #870892) + * dh_installexamples: Ditto. + * dh_installinfo: Ditto. + * dh_installman: Ditto. + * dh_compress: Avoid forking a shell for a find command. + * dh_gconf: Ditto. + * dh_installgsettings: Ditto. + * dh_perl: Avoid forking a shell for a dpkg call. + * dh_gencontrol: Set the priority of all dbgsym packages to + optional to be compliant with Standards-Version 4.0.1. + Thanks to Mattia Rizzolo for the report. (Closes: #870905) + * dh_installdocs: Accept "nodoc" via DEB_BUILD_OPTIONS as well. + Thanks to Sébastien Villemot for the suggestion. + (Closes: #866619) + * dh_installexamples: Ditto. + * dh_installinfo: Ditto. + * dh_installman: Ditto. + * dh_installwm: Ditto. + * debhelper.pod: Tweak text for some compat 11 changes. + * dh_installdeb: Stop emitting versioned Pre-Depends on dpkg for + symlink_to_dir and dir_to_symlink maintscripts. The version + requirements are satisfied in oldoldstable. + * dh_installdocs: Merge two chmod calls to save a fork+exec. + * dh_strip: Disable parallelism when --dbg-package is used as it + causes non-deterministic failures in some cases. Thanks to + Helmut Grohne for reporting the issue. (Closes: #872007) + * dh_installdocs: Auto-detect "main package" for documentation + packages in compat 11 to assist with Debian policy §12.3. This + auto-detection can be overruled with the new --doc-main-package. + (Closes: #824221) + * dh_installexamples: Ditto. + * dh_update_autotools_config: Improve detection to also catch very + old versions of config.{guess,sub} that do not have the + "timestamp" variable. Thanks to Guillem Jover for reporting the + bug. (Closes: #872510) + + [ Adam Conrad ] + * dh_gencontrol: Change the synopsis of dbgsym packages so it + follows best practises. (Closes: #872274) + + [ Geoffrey Thomas ] + * Support building debhelper on case-insensitive filesystems by + moving the Debian (perl package) to the lib subdirectory. + (Closes: #873043) + + -- Niels Thykier Sat, 09 Sep 2017 15:07:38 +0000 + +debhelper (10.7.2ubuntu2) artful; urgency=high + + * Define U_PARAMS correctly in dh_builddeb, and don't try to use it when it + isn't defined. + + -- Simon Quigley Sun, 06 Aug 2017 10:13:33 -0500 + +debhelper (10.7.2ubuntu1) artful; urgency=low + + * Merge from Debian unstable. Remaining changes: + - dh_installchangelogs: Do not install upstream changelog in compat + level 7. This floods packages with huge upstream changelogs which + are unnecessary on an installed system. + - Restore maintainer ability to override ddeb compression + - Generate ddebs from debhelper instead of pkg-create-dbgsym + + Make debhelper Conflict/Replace pkg-create-dbgsym to force it off. + + Mirror udeb code in dh_builddeb to allow us to alter file extension. + + Set dbgsym Package-Type to ddeb to get correct debian/files output. + + Depend on dpkg-dev (>= 1.18.23ubuntu3) so the above works correctly. + + -- Simon Quigley Sun, 06 Aug 2017 10:43:01 +0200 + +debhelper (10.7.2) unstable; urgency=medium + + * Dh_Lib: Fix inverted boolean logic that causes a + compatibility rule to be ignored. Thanks to Adrian Bunk, + Andreas Beckmann, Markus Koschany and Emmanuel Bourg for + reporting and analysing the issue. (Closes: #870339) + + -- Niels Thykier Tue, 01 Aug 2017 16:51:58 +0000 + +debhelper (10.7.1) unstable; urgency=medium + + * Dh_Lib: Fix doit's new call to ensure it does not call a shell + (like the documentation promises). + * dh: Ensure that we do not fork a shell for running a simple + command. + * autoconf: Revert expansion of ${var} variables passed to + configure as several packages implicitly assume that are not + expanded. E.g. liblockfile relies on ${prefix} being + unexpanded for DESTDIR to work. Reopens: #813266 + + -- Niels Thykier Mon, 31 Jul 2017 19:00:45 +0000 + +debhelper (10.7) unstable; urgency=medium + + [ Niels Thykier ] + * dh_usrlocal: Fix call to doit to avoid making it fork a shell. + * autoconf.pm: Ditto. + * cmake.pm: Ditto. + * meson.pm: Ditto. + * dh_installmodules: Ensure maintscripts are reproducible even with + multiple kernel versions detected. + * Apply patches from gregor herrmann to improve autopkgtests. + * Dh_Lib: Introduce a print_and_complex_doit. + * Buildsystem: Introduce a complex_doit_in_builddir, which is needed + by gradle-debian-helper. + * Dh_Lib: Fix bug in doit + doit_* that made them fork a shell in + some cases. For backwards compatibility, there is detection code + that should make it warn for this case and retain bug-compatibility. + This can cause a weird "Please specify the compatibility level in + debian/compat" error if the tools have chdir to a different directory. + * Dh_Lib: Support an optional hashref in doit + doit_* to enable some + trivial operations in the child process (e.g. redirect stdout). + * dh_installman: Avoid forking a shell where a simple subprocess call + is sufficient. + * Dh_Lib: Avoid forking 2 to 7 subprocesses for adding an autosnippet + when helper tools use a subroutine rather then a sed snippet. + * Dh_Lib: Extend autoscript to accept a hashref and use that for + substituting into the snippet. This variant (like the subroutine + variant) avoids forking a lot of subprocesses and need not worry + about a shell possibly interpreting metacharacters. + * dh_installman: Pass "-l" to man when recoding the manpages. + * dh_icons: Use hashref based autoscripts generation. + * dh_installcatalogs: Ditto. + * dh_installemacsen: Ditto. + * dh_installmenu: Ditto. + * dh_installmodules: Ditto. + * dh_installwm: Ditto. + * dh_installxfonts: Ditto. + * dh_systemd_enable: Ditto. + * dh_systemd_start: Ditto. + * Dh_Lib: Reduce the use of shell and external commands for + generating the final maintscripts. + * Dh_Lib: Make getpackages without any arguments return all + packages as the documentation promises it should. Previously, + it would hide packages not built (e.g. due to Build-Profiles). + * Dh_Lib: Provide a better error message when getpackages() is called + by a helper in the wrong directory. Unfortunately, dh cannot rely + on dh_testdir to do this as dh_testdir is called too late. + * dh: optimize out the call to dh_testdir. It is useless for + printing a helpful error message when called by dh. + * dh_installdocs: Apply patch from Sven Joachim to revert an + incorrect regression "fix". Thanks to Adrian Bunk for + reporting the issue. (Closes: #868649) + * dh_installexamples: Ditto. + * dh_installinfo: Ditto. + * dh_installman: Ditto. + * dh_gencontrol: Rewrite code that ensures that misc:Depends and + misc:Pre-Depends are present to avoid relying external processes + for this. + * dh_builddeb: Let dpkg-deb choose the default compression level for + dbgsym packages instead of using xz -1e. The current default (xz -6) + is likely to be a better default value for dbgsym packages. Thanks to + Adrian Bunk for the suggestion. (Closes: #868674) + * cmake.pm: Pass -DCMAKE_INSTALL_RUNSTATEDIR=/run to cmake in compat 11. + Thanks to Felix Geyer for the suggestion. (Closes: #869697) + * cmake.pm: Avoid using the user specific cmake package registry. Thanks + to Christian Seiler and Felix Geyer. (Closes: #868584) + + [ Colin Watson ] + * Quote assignment to $recommended_compat in case it isn't a valid Perl + version string (e.g. for Debian derivatives). Fix typos that caused it + not to be used correctly. Use the /g flag so that all instances of the + substitution variable are handled. (Closes: #869780) + + [ Isaac Jurado ] + * Make the autoconf buildsystem expand "${var}" values send to configure + (e.g. pass --mandir=/usr/share/man instead of --mandir=${prefix}/share/man). + (Closes: #813266) + + -- Niels Thykier Sat, 29 Jul 2017 18:00:24 +0000 + +debhelper (10.6.4ubuntu1) artful; urgency=low + + * Merge from Debian unstable. Remaining changes: + - dh_installchangelogs: Do not install upstream changelog in compat + level 7. This floods packages with huge upstream changelogs which + are unnecessary on an installed system. + - Restore maintainer ability to override ddeb compression + - Generate ddebs from debhelper instead of pkg-create-dbgsym + + Make debhelper Conflict/Replace pkg-create-dbgsym to force it off. + + Mirror udeb code in dh_builddeb to allow us to alter file extension. + + Set dbgsym Package-Type to ddeb to get correct debian/files output. + + Depend on dpkg-dev (>= 1.18.23ubuntu3) so the above works correctly. + * Drop cherry-picks included in new release: + - Dh_Lib: When passing -a/-i only, and there are no arch/indep packages, + exit. This was accidentally removed when optimising a common case. + (regression introduced by commit 91b064a0baea0ef37937bce56e5b080ac5a52595, + see Debian #863961.) + - Revert commit 80c955221e83327efb984845f59648678c729978 from upstream. This + causes empty override_...-{arch,indep} targets to skip the command + completely instead of just for the arch or indep build. (See Debian + #863887) + - dh_install: Pass --exclude/-X to dh_missing. (See Debian #863447) + + [ Colin Watson ] + * Quote assignment to $recommended_compat in case it isn't a valid Perl + version string (e.g. for Debian derivatives). Fix typos that caused it + not to be used correctly. Use the /g flag so that all instances of the + substitution variable are handled (Closes: #869780). + + [ Sven Joachim, Niels Thykier ] + * dh_installdocs: Apply patch from Sven Joachim to revert an + incorrect regression "fix". Thanks to Adrian Bunk for + reporting the issue. (Closes: #868649) + * dh_installexamples: Ditto. + * dh_installinfo: Ditto. + * dh_installman: Ditto. + + -- Gianfranco Costamagna Wed, 26 Jul 2017 12:22:01 +0200 + +debhelper (10.6.4) unstable; urgency=medium + + * dh_installmenu: Revert "Stop installing menu files in compat 11 + (menu-methods are still installed)". + * dh: Revert "--without=build-stamp by default in compat 11". Keep + the compat 10 behaviour while enable packages to opt-in by + explicitly passing --without=build-stamp themselves. + * dh_installman: Apply patch from Sven Joachim to fix regression, + where dh_installman would fail to remove the compressed manpage. + With hardlinks involved, this could make dh_compress fail later. + (Closes: #867846) + * Dh_lib.pm: Rewrite reset_perm_and_owner to it does chmod + chown + using perl built-ins rather than forking+exec. + * dh_compress: Apply patch from Sven Joachim to make dh_compress + gracefully handle hardlinks, where the target files already + exists. (Closes: #867881) + * dh_install: Re-instate bug compatibility with debhelper (<< 10.6) + where (some) path arguments where split on space as if it had + been parsed in the config file. (Closes: #867866) + * dh_installdocs: Ditto. + * dh_installexamples: Ditto. + * dh_installinfo: Ditto. + * dh_installman: Ditto. + * Dh_Lib.pm: Fix a regression in handling of dangling symlinks for + native file copying that caused dh_installdocs to no longer replace + dangling symlinks with real files. Thanks to Stéphane Glondu + for the report. (Closes: #868204) + * dh_install: Silently disable bulk optimization when two source paths + have the same destination. Thanks to Gianfranco Costamagna for + reporting the regression. (Closes: #868169) + * d/control: Set Testsuite to autopkgtest-pkg-perl to enable + autopkgtests. + + -- Niels Thykier Fri, 14 Jul 2017 17:49:46 +0000 + +debhelper (10.6.3) unstable; urgency=medium + + * Makefile: Use "dpkg-parsechangelog -S" rather than + "dpkg-parsechangelog | grep". + * debhelper.pod: Use substitution to ensure examples always use the + recommended compatibility level. + * Dh_Lib.pm: Embed tool versions into autoscripts so lintian can + extract and display them. Tools that want to rely on this + feature should set "$main::VERSION" to the version of the tool. + * dh_install: Rewrite and re-enable optimization so it + deterministically and gracefully handles cases like #866405. + * dh: Support new "pkgfile-logged" hint, which can be used by + helpers that log what files they install. It enables dh to + see that it may need to run a helper that would install no + files, but log what it would have done to avoid making + dh_missing complain. Thanks to Michael Stapelberg for + reporting the issue and testing the fix. (Closes: #867246) + * PROGRAMMING: Document how to write "logging" helpers that work + with dh_missing. + + -- Niels Thykier Sun, 09 Jul 2017 08:24:34 +0000 + +debhelper (10.6.2) unstable; urgency=medium + + * Refactor test suite and support running tests in parallel. + * Add a test case for #866570. + * dh_compress: Apply patch from Sven Joachim to fix a + regression in 10.5.1. (Closes: #866713) + * dh_installman: Fix regression introduced in 10.5.1 that + caused a "file not found" error when using -P with an + absolute argument. Thanks to Adrian Bunk for reporting + it over IRC. + + -- Niels Thykier Wed, 05 Jul 2017 08:40:00 +0000 + +debhelper (10.6.1) unstable; urgency=medium + + * Makefile: Enable running some tasks in parallel to better + utilize multiple cores. + * Dh_Lib: Revert a change that caused dh_install (and other + tools) to take filenames as absolute if they started with + a leading slash. Thanks to Sven Joachim for the prompt + discovery and notification. (Closes: #866570) + * dh_install: Make optimization conditional on compat 11 + for now. (Closes: #866405) + + -- Niels Thykier Fri, 30 Jun 2017 06:50:10 +0000 + +debhelper (10.6) unstable; urgency=medium + + * dh_installinfo: Use "xargs" so it works even if there are + "a lot" of info files. + * Dh_Lib: Introduce a is_build_profile_active function, which + can be used to check if a given Build-Profile was specified. + * dh_installdocs: Ignore given documentation files when the + "nodoc" build profile is specified in DEB_BUILD_PROFILES. + Note that dh_installdocs is not a complete noop in this case + as it still ensures the package has a copyright file (or a + symlinked doc directory). (Closes: #865869) + * dh_installman: Fix regression in compat 5 that could make it + ignore one manpage per invocation. + * dh_installdocs: Warn if a pattern in the config file matches + nothing. In compat 11, this becomes a hard error. + * dh_installexamples: Ditto. + * dh_installinfo: Ditto. + * dh_installman: Ditto. + * dh_installexamples: Support missing documentation under the nodoc + profile. + * dh_installinfo: Ditto. + * dh_installman: Ditto. + * dh_installwm: Ditto. (Closes: #865707) + * dh_installdocs: Log installed files so dh_missing can see them. + * dh_installexamples: Ditto. (Closes: #863456) + * dh_installinfo: Ditto. + * dh_installdocs: In compat 11, automatically fall back to debian/tmp + if the files are not found in ".". Furthermore, accept the option + --sourcedir with the same meaning as dh_install. + * dh_installexamples: Ditto. + * dh_installinfo: Ditto. + * dh_installman: Ditto. + * dh_installman: Fix bug in how it handled language auto-detection in + compat 11. Previously, it did not work as intended. + * dh_installdocs: Revert change in compat 11, where it would install + documentation into /usr/share/doc/mainpackage. (Reopens: #824221) + * Dh_Lib: Stop setting PERL_USE_UNSAFE_INC in compat 11. + * perl_build.pm: Stop passing -I. to perl in compat 11. + * perl_makemaker.pm: Ditto. + + -- Niels Thykier Thu, 29 Jun 2017 17:15:00 +0000 + +debhelper (10.5.1) unstable; urgency=medium + + * Dh_Lib.pm: Fix rounding error when computing how many processes + to use. This rounding error could cause dh-tools to use one more + process than permitted by DEB_BUILD_OPTIONS. + * Dh_Lib.pm: Check return value of open+close when creating a log of + installed files. + * Dh_Lib.pm: Implement subroutines to facility file removal and + symlink creation without a fork+exec. + * Dh_Lib: Avoid a fork+exec for rm -f and ln -s. + * dh_compress: Ditto. + * dh_installman: Ditto. + * dh_clean: Avoid a fork+exec for rm -f. + * dh_installdeb: Ditto. + * dh_makeshlibs: Ditto. + * dh_md5sums: Ditto. + * dh_installdocs: Avoid a fork+exec for ln -s. + * dh_strip: Ditto. + * Dh_Lib: Avoid 1-2 stat calls in make_symlink by reusing existing + stat calls. + * dh_installman: Avoid a fork+exec for renaming a path. + * dh_installdocs: Avoid unnecssary stat call. + * dh_installman: Ditto. + * dh_strip: Ditto. + * dh_shlibdeps: Fix a regression where non-detached debug symbol files + where not properly processed. Thanks to Sven Joachim for reporting + the issue. (Closes: #865982) + * dh_installman: When re-encoding manpages, use the actual manpages as + tasks to split rather than packages. This provides a much better + performance if the manpages are unevenly split between the packages. + * dh_install: Optimize some patterns into bulked "cp" calls. This + optimization is only applicable in some cases (notably, it is always + disabled by --exclude). + * dh_builddeb: Account for dbgsym packages separately when determining + how many tasks can be run in parallel. + * dh_strip: Process packages in parallel. + + -- Niels Thykier Mon, 26 Jun 2017 17:25:00 +0000 + +debhelper (10.5) unstable; urgency=medium + + * Upload to unstable. (Closes: #865363) + + [ Niels Thykier ] + * dh_installman: Remove unncessary "chown" call that made things a + lot slower. Thanks to Kurt Roeckx for reporting it. + * dh_installman: Fix wrong permission of man pages (set 0755 instead + of 0644). Regression introduced in 10.2.2. + * dh_installman: Batch chmod calls to reduce the overhead for + packages with many manpages. + * dh: Undo an unsafe optimisation that caused "-indep" and "-arch" + override targets to be ignored. Thanks to Gianfranco Costamagna + for reporting it and Iain Lane for tracing it to the commit + that introduced the issue. (Closes: #863887) + * dh_clean, dh_prep: Bulk delete most files and directories, which + gives a noticeable speed up for source packages building many + binary packages. + * dh_shlibdeps: Avoid creating debian//DEBIAN directory if it + is not needed. + * Dh_Lib.pm: Fix typo in error message. + * Dh_Lib.pm: Rewrite install_* to use File::Copy to avoid the + overhead of a fork+exec per file. For simplicity, the verbose + output still claim debhelper uses "install -p -m " for this. + * Dh_Lib.pm: Replace most of the fork+exec calls to mv for simple + file renames. + * Dh_Lib.pm: Add sub to make common dh_* tools do their thing in + parallel with very little coding effort. This parallel support + accounts for DEB_BUILD_OPTIONS to set the upper limit. + * dh_fixperms: Run package updates in parallel if DEB_BUILD_OPTIONS + permits it. + * dh_installchangelogs: Ditto. + * dh_compress: Ditto. + * dh_installman: Ditto. + * dh_genchanges: Ditto. + * dh_shlibdeps: Ditto. + * dh_md5sums: Ditto. + * dh_builddeb: Rewrite the hand-written parallel code to use the new + simpler way of doing it. + * dh_shlibdeps: Avoid calling file(1) on debug symbols. + * SUPPORT-POLICY: Include new document that describes the current + support policy of debhelper compat levels. + * Dh_Lib.pm: Pass ":unix" layer when using the ":gzip" layer due to + PerlIO-gzip bug RT#114557. + * Dh_Lib.pm: Ignore empty dpkg-architecture variables. + (Closes: #862844) + * dh_installchangelogs: Avoid trying to install a directory by default + as a changelog file. Thanks to Markus Koschany for reporting the + issue. (Closes: #861852) + * dh_installwm.1: Correct documentation to reflect the behaviour in + compat 10. Thanks to Robert Luberda for reporting the issue. + (Closes: #865708) + * dh_installcatalogs: Use explicit await triggers to avoid trigger + a lintian warning. + * dh_installman: In compat 11, attempt to detect the language of the + manpage based on the directory (/man//manX/) before using the + extension. This is more reliably for packages using dh_installman + to install manpages from the temporary install dir. + (Closes: #761024) + * dh_installcatalogs: Check the return code of close when generating + a catalog for sgml-base. + * Dh_Lib.pm: Emulate "install -d" with File::Path to avoid a fork+exec + for creating directories. For simplicity, the verbose output still + claim debhelper uses "install -d" for this. + * dh_auto_install: In compat 11, do noot create package build + directories (except if one of them happens to be the default + "destdir" for dh_auto_install). + + [ Iain Lane ] + * Dh_Lib: Re-add warning + exit 0 for the -i/-a shortcut that was + added in 10.3. (Closes: #863961) + * dh_install: Pass --exclude/-X to dh_missing. (Closes: #863447) + + [ Michael Stapelberg ] + * Dh_Getopt: Provide a more detailed error message when there are + no buildable packages caused by architecture restrictions. + (Closes: #858467) + * Dh_Lib: Split package_arch($package) into three distinct functions. + + -- Niels Thykier Sun, 25 Jun 2017 17:00:00 +0000 + +debhelper (10.4ubuntu3) artful; urgency=medium + + * Dh_Lib: When passing -a/-i only, and there are no arch/indep packages, + exit. This was accidentally removed when optimising a common case. + (regression introduced by commit 91b064a0baea0ef37937bce56e5b080ac5a52595, + see Debian #863961.) + + -- Iain Lane Fri, 02 Jun 2017 11:42:57 +0100 + +debhelper (10.4ubuntu2) artful; urgency=medium + + * Revert commit 80c955221e83327efb984845f59648678c729978 from upstream. This + causes empty override_...-{arch,indep} targets to skip the command + completely instead of just for the arch or indep build. (See Debian + #863887) + * dh_install: Pass --exclude/-X to dh_missing. (See Debian #863447) + + -- Iain Lane Thu, 01 Jun 2017 16:59:24 +0100 + +debhelper (10.4ubuntu1) artful; urgency=medium + + * Merge from Debian unstable. Remaining changes: + - dh_installchangelogs: Do not install upstream changelog in compat + level 7. This floods packages with huge upstream changelogs which + are unnecessary on an installed system. + - Restore maintainer ability to override ddeb compression + - Generate ddebs from debhelper instead of pkg-create-dbgsym + + Make debhelper Conflict/Replace pkg-create-dbgsym to force it off. + + Mirror udeb code in dh_builddeb to allow us to alter file extension. + + Set dbgsym Package-Type to ddeb to get correct debian/files output. + + Depend on dpkg-dev (>= 1.18.23ubuntu3) so the above works correctly. + + -- Iain Lane Wed, 31 May 2017 15:31:00 +0100 + +debhelper (10.4) experimental; urgency=medium + + * Team upload. + + [ Niels Thykier ] + * meson.pm: Pass --wrap-mode=nodownload to meson (requires meson + 0.40-1 or later). + * dh_install: Fix initialized warning when --sourcedir is absent + on the cmd-line. + * dh_missing: Accept --sourcedir (given it is passed by dh_install). + (Closes: #862049) + * Dh_Lib.pm: Fix a bug in pkgfile that caused dh to skip helpers + that had configuration files. Thanks to Michael Biebl for finding + and reporting. (Closes: #863387) + + [ Chris Lamb ] + * dh_fixperms: Fix regression where dh_fixperms would fail to correct + permissions because it used an invalid find expression. + (Closes: #862003) + + -- Michael Biebl Fri, 26 May 2017 22:08:37 +0200 + +debhelper (10.3) experimental; urgency=medium + + [ Helmut Grohne ] + * Supply PKG_CONFIG for cross compilation with the makefile buildsystem. + (Closes: #853881) + * Disable stripping during dh_auto_* in makefile buildsystem in compat 11. + (Closes: #844077) + * Remove explicit "Multi-Arch: no" stanzas as they are auto-rejected. + (Closes: #857028) + + [ Niels Thykier ] + * Dh_Lib.pm: Make getpackages() produce the correct result independently + of the order of the fields in a given paragraph of debian/control. + (Closes: #847138) + * dh_installman: Report installed manpages so the new dh_missing tool + is informed about them. + * dh_install: Deprecate --list-missing/--fail-missing in favor of the + new dh_missing tool. The options will be removed in compat 11. + * dh: Run dh_missing by default (in no op mode). + * dh_prep: Clean up generated files so they work like other temporary + debhelper files. + * dh_installinit: Clarify that it might make sense to skip dh_installinit + for a package if it provides a systemd service but no sysvinit file. + (Closes: #800043) + * dh_installinit: Deprecate --no-restart-on-upgrade in favor of the new + name --no-stop-on-upgrade, which does the same thing but is less + likely to be confused with --no-restart-after-upgrade and is more + descriptive of what it actually does. Thanks to Simon McVittie and + Michael Biebl for the help. (Closes: #837528) + * debian/rules: Only apply the --no-parallel to dh_auto_test. The rest + of debhelper's build appears to work fine with --parallel. + * dh_systemd_enable.1: Clarify that --no-enable does not control + whether a service is started and that dh_systemd_start is the tool + that does that. (Closes: #770281) + * autoconf.pm: Set --runstatedir to "/run" in compat 11. Thanks to + Michael Biebl for the suggestion. + * dh_fixperms: Refactor to reduce the constant overhead a bit and + extract some patterns into data list. The latter hopefully reducing + the need for tweaking dh_fixperms' logic. + * dh_installdocs: Document that --link-doc has limitations on source and + target package plus that compat 10 will reject unsupported + combinations. + * dh_gencontrol: Avoid adding Homepage fields to dbgsym packages. Avoids + non-overridable warnings from lintian when there is an issue in the + homepage field of the original binary. (Closes: #812248) + * dh_strip: Fix a check that could cause dh_strip to generate dbgsym + packages when it should not. + * dh: Stop loading python-support in all compat levels as dh_pysupport + has been removed in stretch. + * python_support.pm: Remove the content with a deprecation warning as + the module can no longer do anything. + * dh_installman.1: Improve the manpage to clarify the scope of + dh_installman and provide an examples. (Closes: LP: #184156) + * makefile.pm: Disable parallel installation if libtool is present to + avoid a race-condition in automake when using libtool. + (Closes: #861627) + + [ Steven Chamberlain ] + * When cross-compiling for GNU/kFreeBSD host systems, set + CMAKE_SYSTEM_NAME to the correct value "kFreeBSD", not "FreeBSD". + (Closes: #856688) + + [ Felipe Sateler ] + * dh_systemd_enable.1: Improve the wording of the documentation for + the --no-enable option. (Closes: #844602) + + [ Michael Biebl ] + * Add support for meson + ninja build systems. (Closes: #795253) + + [ Michael Stapelberg ] + * dh_missing: New tool to handle --list-missing/--fail-missing. + (Closes: #415396, #616070) + * Dh_Lib.pm: Introduce a log_installed_files sub that can be used + to inform dh_missing that a given file has been installed. + + [ Johannes Schauer ] + * dh_link.1: Improve the documentation and use ln(1) as a reference + to make it simpler for people, who are used to the terms from ln. + (Closes: #860091) + + -- Niels Thykier Sat, 06 May 2017 13:29:31 +0000 + +debhelper (10.2.5ubuntu3) artful; urgency=medium + + * Restore maintainer ability to override ddeb compression (LP: #1691078) + + -- Adam Conrad Wed, 17 May 2017 10:03:45 -0600 + +debhelper (10.2.5ubuntu2) artful; urgency=medium + + * Generate ddebs from debhelper instead of pkg-create-dbgsym (LP: #1623256) + - Make debhelper Conflict/Replace pkg-create-dbgsym to force it off. + - Revert the revert that disabled debhelper's attempts to do dbgsyms. + - Mirror udeb code in dh_builddeb to allow us to alter file extension. + - Set dbgsym Package-Type to ddeb to get correct debian/files output. + - Depend on dpkg-dev (>= 1.18.23ubuntu3) so the above works correctly. + + -- Adam Conrad Thu, 20 Apr 2017 20:19:06 -0600 + +debhelper (10.2.5ubuntu1) artful; urgency=medium + + * Merge from Debian unstable. Remaining changes: + - dh_installchangelogs: Do not install upstream changelog in compat + level 7. This floods packages with huge upstream changelogs which + are unnecessary on an installed system. + - dh_strip: Revert commit f1a803456 to disable ddebs generation by + default. This first needs adjustments in Launchpad and ddebs.u.c., and + dropping pkg-create-dbgsym. + + -- Adam Conrad Thu, 20 Apr 2017 19:01:01 -0600 + +debhelper (10.2.5) unstable; urgency=medium + + [ Translations ] + * Add Japanese translation (Hideki Yamane) (Closes: #852520) + + -- Niels Thykier Wed, 25 Jan 2017 20:47:27 +0000 + +debhelper (10.2.4) unstable; urgency=medium + + [ Niels Thykier ] + * d/changelog: Add missing changelog entry in 10.2.3 for a + compat 11 change. + * dh: Show when the "create-stamp" "command" is being run. + * dh: Fix a bug where dh would repeat part of the build sequence + when an add-on modified the build sequence after "dh_auto_test". + Thanks to Sean Whitton for reporting the issue. + (Closes: #851071) + + [ Luca Boccassi ] + * dh_systemd_enable: Correct installation for "mount" units. + (Closes: #851744) + + [ Translations ] + * Update Portuguese translation (Américo Monteiro) + (Closes: #851207) + * Update French translation (Baptiste Jammet) (Closes: #852211) + * Update German translation (Chris Leick) (Closes: #851962) + + -- Niels Thykier Mon, 23 Jan 2017 20:28:37 +0000 + +debhelper (10.2.3) unstable; urgency=medium + + [ Axel Beckert ] + * Fix wrong German translation of dh_systemd_start man page. Thanks to + Thorsten Alteholz for spotting the mistake! (Closes: #839655) + + [ Mattia Rizzolo ] + * dh_auto_test: Apply patch from Mattia Rizzolo to update + documentation about running tests during cross-building. + + [ Niels Thykier ] + * Bump dependency on dh-strip-nondeterminism to ensure + stable-backports uses a functional version. Thanks to Christoph + Biedl for the report. (Closes: #843813) + * Massage md5sum output to avoid GNU-specific escaping extension + while we wait for dpkg-gendigests for a more compatible tool. + Thanks to Bernd Zeimetz for the report. (Closes: #843163) + * In compat 11, dh will now skip creating a stamp file unless the + package explicitly requests it with "--with build-stamp". + + [ Felipe Sateler ] + * dh_systemd_start: Fix a bug where --restart-after-upgrade with + --no-start would still start the service. (Closes: #805878) + * dh_installinit: Leave the handling of debian/pkg.service and + debian/pkg.tmpfiles to dh_systemd_*. (Closes: #830208) + + -- Niels Thykier Sat, 31 Dec 2016 21:27:54 +0000 + +debhelper (10.2.2ubuntu1) zesty; urgency=medium + + * Merge from Debian unstable. Remaining changes: + - dh_installchangelogs: Do not install upstream changelog in compat + level 7. This floods packages with huge upstream changelogs which + are unnecessary on an installed system. + - dh_strip: Revert commit f1a803456 to disable ddebs generation by + default. This first needs adjustments in Launchpad and ddebs.u.c., and + dropping pkg-create-dbgsym. + + -- Martin Pitt Mon, 17 Oct 2016 21:34:23 +0200 + +debhelper (10.2.2) unstable; urgency=medium + + * Fix typo in changelog entry for release 10.2. Thanks to + Peter Pentchev for reporting it. + * Deprecate all compat levels lower than 9. + * dh: Discard override log files before running the override + rather than after. + * dh_compress,dh_fixperms: Remove references to long + obsolete directories such as usr/info, usr/man and + usr/X11*/man. + * autoreconf.pm: Apply patch from Helmut Grohne to fix + autoconf/cross regression from #836988. The autoreconf + build-system is now also used directly for "clean" and + "build" (while still usin the "make" build-system for the + heavy lifting). (Closes: #839681) + * dh_installdirs: In compat 11, avoid creating debian/ + directories except when required to do so. This fixes a + corner case, where an arch:all build would behave + differently than an arch:all+arch:any when dh_installdir is + optimised out only for the arch:all build. + * Dh_Lib.pm: Fix typo of positive. Thanks to Matthias Klose + for spotting it. + + -- Niels Thykier Sat, 08 Oct 2016 10:16:23 +0000 + +debhelper (10.2.1) unstable; urgency=medium + + * d/rules: Add a ./run in front of dh_auto_install. It is + technically not needed, but it prevents lintian from assuming + that we need to Build-Depend debhelper. + + -- Niels Thykier Sun, 02 Oct 2016 06:51:49 +0000 + +debhelper (10.2) unstable; urgency=medium + + * Apply patch from Peter Pentchev to fix some typos. + * Apply patch from Michael Biebl to undo a major + regression where all of debhelpers functionality was + missing (introduced in 10.1). (Closes: #839557) + * dh_installinit,dh_systemd_start: Introduce a new + --no-stop-on-upgrade as an alternative to + --no-restart-on-upgrade. This new option should + reduce the confusion of what it does. Thanks to + Michael Biebl for the suggestion. + + -- Niels Thykier Sun, 02 Oct 2016 06:20:56 +0000 + +debhelper (10.1) unstable; urgency=medium + + * Apply patch from Michael Biebl to take over dh-systemd + package to ease backporting to jessie-backports. + (Closes: #837585) + * Apply patch from Helmut Grohne and Julian Andres Klode + to improve cross-building support in the cmake build + system. (Closes: #833789) + * Make the makefile.pm buildsystem (but not subclasses thereof) + pass the CC and CXX variables set to the host compilers when + cross-building. Thanks to Helmut Grohne for the idea and + the initial patch. (Closes: #836988) + * dh_md5sums.1: Mention dpkg --verify as a consumer of the + output file. Thanks to Guillem Jover for reporting it. + * debhelper-obsolete-compat.pod: Add a manpage for the + upgrade checklist for all obsolete/removed compat levels. + Thanks to Jakub Wilk for the suggestion. + * Dh_Getopt,dh_*: Rename --onlyscripts to --only-scripts and + --noscripts to --no-scripts for consistency with other + options. The old variants are accepted for compatibility. + Thanks to Raphaël Hertzog for the suggestion. + (Closes: #838446) + * cmake.pm: If cmake fails, also dump CMakeFiles/CMakeOutput.log + and CMakeFiles/CMakeError.log if they are present. Thanks to + Michael Banck for the suggestion. (Closes: #839389) + * d/copyright: Correct copyright and license of dh_systemd* + tools. + + -- Niels Thykier Sat, 01 Oct 2016 20:45:27 +0000 + +debhelper (10ubuntu1) yakkety; urgency=medium + + * Merge from Debian unstable. Remaining changes: + - dh_installchangelogs: Do not install upstream changelog in compat + level 7. This floods packages with huge upstream changelogs which + are unnecessary on an installed system. + - dh_strip: Revert commit f1a803456 to disable ddebs generation by + default. This first needs adjustments in Launchpad and ddebs.u.c., and + dropping pkg-create-dbgsym. + + -- Martin Pitt Mon, 12 Sep 2016 07:12:45 +0200 + +debhelper (10) unstable; urgency=medium + + [ Niels Thykier ] + * Dh_Lib.pm: Support a new named "beta-tester" compat level. + If you want to participate in beta testing of new compat + levels, please review "man 7 debhelper" for more + information. + * Dh_Lib.pm: Fix bug in detection of existing auto-trigger. + + [ Axel Beckert ] + * Apply patch by Jens Reyer to fix typo in dh_installdocs man page. + (Closes: #836344) + * Use uppercase "Debian" in package description when the project is + meant. Fixes lintian warning capitalization-error-in-description. + * Apply "wrap-and-sort -a" + * Add a .mailmap file for making "git shortlog" work properly. + + [ Translations ] + * Update German translation (Chris Leick) (Closes: #835593) + * Update Portuguese translation (Américo Monteiro) + (Closes: #835403) + * Update French translation (Baptiste Jammet) (Closes: #836693) + + -- Niels Thykier Sun, 11 Sep 2016 09:00:23 +0000 + +debhelper (9.20160814) unstable; urgency=medium + + * dh_installdocs: Apply patch from Sven Joachim to make + --link-doc work again in compat 11 (See: #830309) + * t: Apply patch from Sven Joachim to add some test cases + to dh_installdocs's --link-doc behaviour. + (Closes: #831465) + * dh_installinit,dh_systemd_start: Apply patches from + Peter Pentchev to make -R default in compat 10 (as + documented, but not as implemented). + * perl_{build,makemaker}.pm: Apply patch from Dominic + Hargreaves to explicitly pass -I. to perl. This is to + assist with the fix for CVE-2016-1238. (Closes: #832436) + * dh_install: Clarify that "debian/not-installed" is not + related to the --exclude parameter. + * dh_install: Apply patch from Sven Joachim to support + the "debian/tmp" prefix being optional in + "debian/not-installed". (Closes: #815506) + * Dh_Lib.pm: Apply patch from Dominic Hargreaves to set + PERL_USE_UNSAFE_INC to fix a further set of packages + which fail to build with . removed from @INC. + (Closes: #832436) + * Dh_Buildsystems.pm: Enable auto-detection of the maven + and gradle buildsystems (provided they are installed). + Thanks to Emmanuel Bourg for the suggestion. + (Closes: #801732) + + -- Niels Thykier Sun, 14 Aug 2016 09:19:35 +0000 + +debhelper (9.20160709ubuntu1) yakkety; urgency=medium + + * Merge from Debian unstable. Remaining changes: + - dh_installchangelogs: Do not install upstream changelog in compat + level 7. This floods packages with huge upstream changelogs which + take precious CD space. + - dh_strip: Revert commit f1a803456 to disable ddebs generation by + default. This first needs adjustments in Launchpad and ddebs.u.c., and + dropping pkg-create-dbgsym. + + -- Martin Pitt Mon, 11 Jul 2016 22:17:30 +0200 + +debhelper (9.20160709) unstable; urgency=medium + + * Explicitly Build-Depends on perl:any for pod2man instead + of relying on it implicitly via libdpkg-perl. + * dh_shlibdeps: Clarify that -L is also useful for packages + using debian/shlibs.local for private libraries. + * dh_installdocs: Apply patch from Sven Joachim to fix a + regression with --link-doc and installing extra + documentation. (Closes: #830309) + * Apply patches from Michael Biebl to merge dh_systemd_enable + and dh_systemd_start from the dh-systemd package. + (Closes: #822670) + * dh: Enable the systemd helpers by default in compat 10 and + later. + + -- Niels Thykier Sat, 09 Jul 2016 09:53:02 +0000 + +debhelper (9.20160702) unstable; urgency=medium + + * Start on compat 11. + * dh_installmenu: Stop installing menu files in compat 11 + (menu-methods are still installed). + * dh_*: Deprecate -s in favor of -a. The -s option is + removed in compat 11. + * dh_strip: Fix regression in 9.20160618, which caused + issues when there were hardlinked ELF binaries in a + package. Thanks to Sven Joachim for the report, the + analysis/testing and for providing a patch for the + most common case. (Closes: #829142) + * Dh_Lib.pm: Cope with the parallel options in make 4.2. + Thanks to Martin Dorey for the report. (Closes: #827132) + * dh_installdocs: In compat 11, install documentation into + /usr/share/doc/mainpackage as requested by policy 3.9.7. + Thanks to Sandro Knauß for the report. (Closes: #824221) + * dh_perl: Emit perl:any dependencies when a package only + contains perl programs (but no modules of any kind). + Thanks to Javier Serrano Polo and Niko Tyni for the + report and feedback. (Closes: #824696) + + [ Translations ] + * Update German translation (Chris Leick + Eduard Bloch) + (Closes: #827699) + + -- Niels Thykier Sat, 02 Jul 2016 13:24:21 +0000 + +debhelper (9.20160618.1ubuntu1) yakkety; urgency=medium + + * Merge from Debian unstable. Remaining changes: + - dh_installchangelogs: Do not install upstream changelog in compat + level 7. This floods packages with huge upstream changelogs which + take precious CD space. + - dh_strip: Revert commit f1a803456 to disable ddebs generation by + default. This first needs adjustments in Launchpad and ddebs.u.c., and + dropping pkg-create-dbgsym. + * Dropped changes: + - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. + We don't support upstart for system init any more, and moreover we + stopped dropping SysV init scripts as they are required for insserv. + - Clean up older Ubuntu changelog records which were an endless repetition + of "remaining changes". + + -- Martin Pitt Wed, 22 Jun 2016 09:25:16 +0200 + +debhelper (9.20160618.1) unstable; urgency=medium + + * Dh_Lib.pm: Reject requests for compat 4 instead of + silently accepting it (while all helpers no longer + check for it). + + -- Niels Thykier Sat, 18 Jun 2016 20:52:29 +0000 + +debhelper (9.20160618) unstable; urgency=medium + + * dh: Fix bug where "--help" or "--list" would not work + unless "debian/compat" existed and had a supported + compat level. (Closes: #820508) + * dh_compress: Gracefully handle debian (or any other + path segment in the package "tmpdir") being a symlink + pointing outside the same directory. Thanks to + Bernhard Miklautz for the report. (Closes: #820711) + * Dh_Lib.pm: Compat files are now mandatory. + * dh_clean: Remove work around for missing compat file. + This removes a confusing warning when the package is + not built by CDBS. (Closes: #811059) + * debhelper.pod: Add a line stating that debian/compat + is mandatory. (Closes: #805405) + * dh_strip: Apply patch from Peter Pentchev to only strip + static libraries with a basename matching "lib.*\.a". + (Closes: #820446) + * ant.pm: Apply patch from Emmanuel Bourg to pass a + normalised "user.name" parameter to ant. + (Closes: #824490) + * dh_installudev/dh_installmodules: Drop maintainer + script snippets for migrating conffiles. + - Side effect, avoids portability issue with certain + shell implementations. (Closes: #815158) + * autoscripts/*inst-moveconffile: Remove unused files. + * dh: Update documentation to reflect the current + implementation. + * Remove support for compat 4. + * dh_strip: Add debuglinks to ELF binaries even with + DEB_BUILD_OPTIONS=noautodbgsym to make the regular deb + bit-for-bit reproducible with vs. without this flag. + Thanks to Helmut Grohne for the report. + * dh_installcatalogs: Apply patch from Helmut Grohne to + explicitly trigger a new update-sgmlcatalog trigger, + since dpkg does not triger conffiles on package removal. + (Closes: #825005) + * dh_installcatalos: Apply patch from Helmut Grohne to + remove autoscript for a transition that completed in + Wheezy. + * dh_strip: Unconditionally pass --enable-deterministic-archives + to strip for static libs as the stable version of binutils + supports it. + * dh_strip: Use file(1) to determine the build-id when + available. This saves an readelf call for every binary in + the package. + * dh_strip: Cache file(1) output to avoid calling file(1) + twice on all ELF binaries in the package. + * Dh_Lib.pm: Add better error messages when a debhelper program + fails due to an executable config file not terminating with + success. (Closes: #818933) + * dh_strip: Pass -e to file(1) to skip tests for file formats + that dh_strip does not care about. + * Bump standards-version to 3.9.8 - no changes required. + + -- Niels Thykier Sat, 18 Jun 2016 14:41:05 +0000 + +debhelper (9.20160403ubuntu1) yakkety; urgency=medium + + * Merge from Debian unstable. Remaining changes: + - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. + (Must be kept as long as we support system upstart on touch.) + - dh_installchangelogs: Do not install upstream changelog in compat + level 7. This floods packages with huge upstream changelogs which + take precious CD space. + - dh_strip: Revert commit f1a803456 to disable ddebs generation by + default. This first needs adjustments in Launchpad and ddebs.u.c., and + dropping pkg-create-dbgsym. + + -- Martin Pitt Fri, 22 Apr 2016 16:07:52 +0200 + +debhelper (9.20160403) unstable; urgency=medium + + * d/control: Requre dh-autoreconf (>= 12) to ensure + non-autotools can be built in compat 10. + * dh: In a "PROMISE: DH NOOP" clause, make no assumptions + about being able to skip "foo(bar)" if "foo" is not known. + * debhelper.pod: Use DEB_HOST_ARCH instead of the incorrect + "build architecture". Thanks to Helmut Grohne for the + report. + * dh_makeshlibs: Use same regex for extracting SONAME as + dpkg-shlibdeps. (Closes: #509931) + * dh_makeshlibs: Add an ldconfig trigger if there is an + unversioned SONAME and the maintainer provides a + symbols file. + + -- Niels Thykier Sun, 03 Apr 2016 08:56:07 +0000 + +debhelper (9.20160402) unstable; urgency=medium + + * Remove dh_desktop. + * dh_install: Fix a regression where a non-existing file + was ignored if another file was matched for the same + destination dir. Thanks to Ben Hutchings for reporting + the issue. (Closes: #818834) + * d/rules: Use overrides to disable unnecessary helpers + (for which debhelper does not Build-Depend on the + necessary packages to run the tools). + * dh: Enable "autoreconf" sequence by default in compat + 10 (or higher). (Closes: #480576) + * d/control: Add a dependency on dh-autoreconf due to + the above. + * autoscripts/*-makeshlibs: Remove again. Most of the + reverse dependencies have migrated already. + * Declare compat 10 ready for testing. + + -- Niels Thykier Sat, 02 Apr 2016 19:20:17 +0000 + +debhelper (9.20160313) unstable; urgency=medium + + * Remove dh_undocumented. + * dh_install: Attempt to improve the documentation of the + config file "debian/not-installed". + * dh_compress: Gracefully handle absolute paths passed via + the -P option. Thanks to Andreas Beckmann for reporting + the issue. (Closes: #818049) + + -- Niels Thykier Sun, 13 Mar 2016 14:21:02 +0000 + +debhelper (9.20160306) unstable; urgency=medium + + [ Niels Thykier ] + * Remove dh_suidregister and related autoscripts. No package + (that can be built in unstable) invokes this tool. + * dh: Do not create stamp files when running with --no-act. + * dh_strip/dh_gencontrol: Move "is_udeb" guard to dh_strip. + This should avoid adding build-ids to udebs without having + the actual debug symbols available. Thanks to Jérémy Bobbio + for reporting the issue. (Closes: #812879) + * dh_makeshlibs: Do not claim to be using maintainer scripts + for invoking ldconfig. Thanks to Eugene V. Lyubimkin for + the report. (Closes: #815401) + * Remove dh_scrollkeeper. It is no longer used in unstable. + * autoconf.pm: Apply patch from Gergely Nagy to set "VERBOSE=1" + when running tests to make sure that the build logs are + dumped on error with automake. (Closes: #798648, #744380) + * dh_installdeb: In compat 10, properly shell escape lines + from the maintscript config file. This will *not* be fixed + retroactively since people have begun to rely on the bug + in previous versions (e.g. by quoting the file names). + Thanks to Jakub Wilk for reporting the issue. + (Closes: #803341) + * dh_installdeb: In compat 10, avoid adding two comments per line + in the maintscript file. Thanks to Didier Raboud for + reporting the bug. (Closes: #615854) + * cmake.pm: Apply patch from Helmut Grohne to correct the + name of the default cross compilers. (Closes: #812136) + * dh_installdeb: Clarify what goes in the "maintscript" config + files. Thanks to Julian Andres Klode for the report. + (Closes: #814761) + * dh_compress: Correct and warn if given a path with a package + tmp dir prefix (e.g. "debian//path/to/file"). + * dh_compress: Handle file resolution failures more gracefully. + Thanks to Daniel Leidert for reporting this issue. + (Closes: #802274) + * dh_installinit: Make --restart-after-upgrade the default in + compat 10. Packages can undo this by using the new + --no-restart-after-upgrade parameter. + * d/control: Update Vcs links. + * d/control: Bump Standards-Version to 3.9.7 - no changes + required. + * Import newer German translations from Chris Leick. + (Closes: #812790) + + [ Joachim Breitner ] + * addsubstvar: Pass -a to grep to handle substvars with unicode content + gracefully (Closes: #815620) + + -- Niels Thykier Sun, 06 Mar 2016 13:14:43 +0000 + debhelper (9.20160115ubuntu3) xenial; urgency=medium * Backport upstream commit 9ca73a0a ("Pass -a to grep to handle @@ -71,22 +1606,6 @@ -- Niels Thykier Thu, 14 Jan 2016 22:01:03 +0000 -debhelper (9.20151225ubuntu1) xenial; urgency=medium - - * Merge from Debian unstable. Remaining changes: - - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - - dh_installinit: Add dependency to lsb-base >= 4.1+Debian11ubuntu7 that - provides the upstart LSB hook, to avoid upgrade breakage. This change - can be dropped after 16.04 LTS. - * dh_strip: Revert commit f1a803456 to disable ddebs generation by default. - This first needs adjustments in Launchpad and ddebs.u.c., and dropping - pkg-create-dbgsym. - - -- Martin Pitt Mon, 04 Jan 2016 11:07:56 +0100 - debhelper (9.20151225) unstable; urgency=medium * dh_installmanpages: Fix call to getpackages. Thanks to @@ -125,21 +1644,6 @@ -- Niels Thykier Sat, 19 Dec 2015 22:01:53 +0000 -debhelper (9.20151126ubuntu1) xenial; urgency=medium - - * Merge from Debian unstable. Remaining changes: - - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. This - uses the #SCRIPT# macro twice, thus in dh_installinit, replace all - occurrences of that not just the first one. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - - dh_installinit: Add dependency to lsb-base >= 4.1+Debian11ubuntu7 that - provides the upstart LSB hook, to avoid upgrade breakage. This change - can be dropped after 16.04 LTS. - - -- Martin Pitt Sat, 28 Nov 2015 12:57:41 +0100 - debhelper (9.20151126) unstable; urgency=medium * dh_compress: Apply patch from Michael Biebl to skip @@ -150,37 +1654,6 @@ -- Niels Thykier Thu, 26 Nov 2015 18:06:06 +0100 -debhelper (9.20151117ubuntu2) xenial; urgency=medium - - * autoscripts/postinst-init: Fix merge error that caused dh_installinit to - generate broken postinsts. - - -- Martin Pitt Wed, 25 Nov 2015 06:05:07 +0100 - -debhelper (9.20151117ubuntu1) xenial; urgency=medium - - * Merge from Debian unstable. Remaining changes: - - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. This - uses the #SCRIPT# macro twice, thus in dh_installinit, replace all - occurrences of that not just the first one. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - - dh_installinit: Add dependency to lsb-base >= 4.1+Debian11ubuntu7 that - provides the upstart LSB hook, to avoid upgrade breakage. This change - can be dropped after 16.04 LTS. - * Dropped Ubuntu changes: - - dh_installudev: Change default rules.d symlink priority to 40. This - change has been pointless for a long time, Debian and Ubuntu use the - upstream udev rules. - - dh_installinit: Add no-op --upstart-only option for compatibility. The - remaining packages that used this got fixed. (LP: #1519228) - - autoscripts/preinst-upstart-compatibility: Handle upgrades from older - versions that created the /lib/init/upstart-job symlink. This was done - in saucy and thus finished in trusty. - - -- Martin Pitt Tue, 24 Nov 2015 08:43:50 +0100 - debhelper (9.20151117) unstable; urgency=medium [ Niels Thykier ] @@ -239,28 +1712,6 @@ -- Niels Thykier Mon, 16 Nov 2015 21:05:53 +0100 -debhelper (9.20151005ubuntu2) xenial; urgency=medium - - * Put back dh-strip-nondeterminism dependency, MIR got approved. - - -- Martin Pitt Tue, 03 Nov 2015 13:32:54 -0600 - -debhelper (9.20151005ubuntu1) xenial; urgency=medium - - * Merge from Debian unstable. Remaining changes: - - autoscripts/preinst-upstart-compatibility: Handle upgrades from older - versions that created the /lib/init/upstart-job symlink. - - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. - - dh_installinit: Add no-op --upstart-only option for compatibility. - - dh_installudev: Change default rules.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - * Drop dh-strip-nondeterminism dependency for now, until the MIR gets - processed (LP: #1508999) - - -- Martin Pitt Thu, 22 Oct 2015 17:52:54 +0200 - debhelper (9.20151005) unstable; urgency=medium * dh_strip: Sort build-ids to make the Build-Ids header @@ -303,7 +1754,7 @@ when "-V" is passed to dpkg-gencontrol. This relies on dpkg-deb getting everything but the extension correct (see #575059, #452273 for why it does not produce the - correct extesion). + correct extension). (Closes: #516721, #677353, #672282) * Dh_Lib.pm: Drop now unused "udeb_filename" subroutine. * dh_strip.1: Correct the documentation about ddebs to @@ -319,7 +1770,7 @@ with --list-missing. Thanks to Peter Eisentraut for the suggestion. (Closes: #436240) * Dh_Lib: Cherry-pick patch from Chris Lamb to only read - the latest changelog entry when determing the + the latest changelog entry when determining the SOURCE_DATE_EPOCH. * debhelper.7: Provide a better example of how to insert the debhelper maintainer script snippets into a maintainer @@ -373,30 +1824,6 @@ -- Niels Thykier Sun, 04 Oct 2015 17:34:16 +0200 -debhelper (9.20150811ubuntu2) wily; urgency=medium - - * dh_movefiles: Expand globs in arguments passed in all - compat levels (and not just compat 1 and 2). - (Closes: #800332) (cherry-picked from Debian) - - -- Martin Pitt Mon, 05 Oct 2015 14:33:20 +0200 - -debhelper (9.20150811ubuntu1) wily; urgency=medium - - * Merge from Debian unstable. Remaining changes: - - autoscripts/preinst-upstart-compatibility: Handle upgrades from older - versions that created the /lib/init/upstart-job symlink. - - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. - - dh_installinit: Add no-op --upstart-only option for compatibility. - - dh_installudev: Change default rules.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - * Drop dependency on dh-apparmor. This was a transitional measure in 2012, - if there are still packages left that require it let's fix them properly. - - -- Martin Pitt Wed, 12 Aug 2015 16:15:58 +0200 - debhelper (9.20150811) unstable; urgency=medium * d/changelog: Add missing entry for dh_md5sums/#786695 in @@ -491,21 +1918,6 @@ -- Niels Thykier Tue, 19 May 2015 21:56:55 +0200 -debhelper (9.20150507ubuntu1) wily; urgency=low - - * Merge from Debian unstable. Remaining changes: - - Depend on dh-apparmor. - - autoscripts/preinst-upstart-compatibility: Handle upgrades from older - versions that created the /lib/init/upstart-job symlink. - - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. - - dh_installinit: Add no-op --upstart-only option for compatibility. - - dh_installudev: Change default rules.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - - -- Iain Lane Thu, 14 May 2015 17:18:00 +0100 - debhelper (9.20150507) unstable; urgency=medium [ Niels Thykier ] @@ -663,21 +2075,6 @@ -- Niels Thykier Fri, 01 May 2015 14:53:16 +0200 -debhelper (9.20150101ubuntu1) vivid; urgency=low - - * Merge from Debian unstable. Remaining changes: - - Depend on dh-apparmor. - - autoscripts/preinst-upstart-compatibility: Handle upgrades from older - versions that created the /lib/init/upstart-job symlink. - - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. - - dh_installinit: Add no-op --upstart-only option for compatibility. - - dh_installudev: Change default rules.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - - -- Iain Lane Wed, 07 Jan 2015 09:48:12 +0000 - debhelper (9.20150101) unstable; urgency=medium [ Niels Thykier ] @@ -727,21 +2124,6 @@ -- Joey Hess Fri, 07 Nov 2014 17:15:10 -0400 -debhelper (9.20141022ubuntu1) vivid; urgency=medium - - * Merge from Debian unstable. Remaining changes: - - Depend on dh-apparmor. - - autoscripts/preinst-upstart-compatibility: Handle upgrades from older - versions that created the /lib/init/upstart-job symlink. - - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. - - dh_installinit: Add no-op --upstart-only option for compatibility. - - dh_installudev: Change default rules.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - - -- Michael Vogt Thu, 30 Oct 2014 10:44:35 +0100 - debhelper (9.20141022) unstable; urgency=low * dh_installdeb: Sort conffile list so there is a stable order for @@ -763,21 +2145,6 @@ -- Joey Hess Fri, 10 Oct 2014 17:42:56 -0400 -debhelper (9.20141003ubuntu1) vivid; urgency=medium - - * Resynchronise with Debian. Remaining changes: - - Depend on dh-apparmor. - - autoscripts/preinst-upstart-compatibility: Handle upgrades from older - versions that created the /lib/init/upstart-job symlink. - - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. - - dh_installinit: Add no-op --upstart-only option for compatibility. - - dh_installudev: Change default rules.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - - -- Colin Watson Thu, 23 Oct 2014 17:01:31 -0400 - debhelper (9.20141003) unstable; urgency=medium * dh_clean: Skip over .git, .svn, .bzr, .hg, and CVS directories @@ -804,38 +2171,6 @@ -- Joey Hess Sat, 09 Aug 2014 11:24:41 -0400 -debhelper (9.20140613ubuntu2) utopic; urgency=medium - - * Remove ubuntu delta and thus call update-rc.d remove in postrm, upon - removing init.d scripts even if a matching upstart job is - present. (LP: #1326327) - - -- Dimitri John Ledkov Thu, 31 Jul 2014 10:02:24 +0100 - -debhelper (9.20140613ubuntu1) utopic; urgency=medium - - * Resynchronise with Debian. Remaining changes: - - Depend on dh-apparmor. - - autoscripts/preinst-upstart-compatibility: Handle upgrades from older - versions that created the /lib/init/upstart-job symlink. - - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. - - dh_installinit: Add no-op --upstart-only option for compatibility. - - dh_installudev: Change default rules.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - - * Drop changes since last merge, due to support init.d scripts and - upstart jobs co-installation: - - dh_installinit, autoscripts/postinst-upstart-replace: Prefer upstart - jobs where they exist. - - autoscripts/postinst-init*: Only call update-rc.d when there's no - upstart job. - - * Execute po4a man/po4a/po4a.cfg to update manpages. - - -- Dimitri John Ledkov Mon, 07 Jul 2014 18:25:48 +0100 - debhelper (9.20140613) unstable; urgency=medium * Pass --disable-silent-rules in dh_auto_configure if DH_VERBOSE is set. @@ -845,67 +2180,6 @@ -- Joey Hess Fri, 13 Jun 2014 11:50:09 -0400 -debhelper (9.20140228ubuntu6) utopic; urgency=medium - - * Fix the previous upload, by not calling update-rc.d on packages that - just have upstart job without init.d. - - -- Dimitri John Ledkov Thu, 29 May 2014 11:50:53 +0100 - -debhelper (9.20140228ubuntu5) utopic; urgency=medium - - * Enable calling update-rc.d, if an init.d script is installed, - regardless presence of the upstart jobs. (LP: #1312836) - - -- Dimitri John Ledkov Wed, 28 May 2014 11:00:44 +0200 - -debhelper (9.20140228ubuntu4) utopic; urgency=medium - - * Re-introduce the dh_installinit change but this time depending on - lsb-base where the hook was moved. This should prevent upgrade breakage. - - -- Stéphane Graber Tue, 27 May 2014 16:21:35 +0200 - -debhelper (9.20140228ubuntu3) utopic; urgency=medium - - * Revert the last change as it's causing apt upgrade resolution - failure breaking all buildds. - - -- Stéphane Graber Tue, 27 May 2014 15:37:20 +0200 - -debhelper (9.20140228ubuntu2) utopic; urgency=medium - - * Add upstart versioned dependency on upstart that provides lsb hook, to - make sure sourcing lsb init-functions triggers transparent launching - of the upstart job instead. (LP: #1323274). - - -- Dimitri John Ledkov Mon, 26 May 2014 14:39:04 +0200 - -debhelper (9.20140228ubuntu1) utopic; urgency=medium - - * Resynchronise with Debian. Remaining changes: - - Depend on dh-apparmor. - - dh_installinit, autoscripts/postinst-upstart-replace: Prefer upstart - jobs where they exist. - - autoscripts/preinst-upstart-compatibility: Handle upgrades from older - versions that created the /lib/init/upstart-job symlink. - - autoscripts/postinst-init*: Only call update-rc.d when there's no - upstart job. - - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. - - dh_installinit: Add no-op --upstart-only option for compatibility. - - dh_installudev: Change default rules.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - - * Drop change required for upgrades to trusty: - - preserve the change that adds versioned dependency on sysv-rc to - support precise->trusty upgrades. - - * Execute po4a man/po4a/po4a.cfg to update manpages. - - -- Dimitri John Ledkov Fri, 09 May 2014 13:01:47 +0100 - debhelper (9.20140228) unstable; urgency=medium * Fix breakage in no-act mode introduced in last release. @@ -935,27 +2209,6 @@ -- Joey Hess Thu, 27 Feb 2014 11:49:56 -0400 -debhelper (9.20131227ubuntu1) trusty; urgency=medium - - * Resynchronise with Debian. Remaining changes: - - Depend on dh-apparmor. - - dh_installinit, autoscripts/postinst-upstart-replace: Prefer upstart - jobs where they exist. - - autoscripts/preinst-upstart-compatibility: Handle upgrades from older - versions that created the /lib/init/upstart-job symlink. - - autoscripts/postinst-init*: Only call update-rc.d when there's no - upstart job. - - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. - - dh_installinit: Add no-op --upstart-only option for compatibility. - - dh_installudev: Change default rules.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - - preserve the change that adds versioned dependency on sysv-rc to - support precise->trusty upgrades. - - -- Dimitri John Ledkov Wed, 19 Feb 2014 14:18:57 +0000 - debhelper (9.20131227) unstable; urgency=medium [ Guillem Jover ] @@ -979,34 +2232,6 @@ -- Joey Hess Fri, 13 Dec 2013 14:46:26 -0400 -debhelper (9.20131127ubuntu2) trusty; urgency=low - - * Revert 9.20131110 - * Additional changes: - - preserve the change that adds versioned dependency on sysv-rc to - support precise->trusty upgrades. - - -- Dimitri John Ledkov Mon, 09 Dec 2013 17:13:25 +0000 - -debhelper (9.20131127ubuntu1) trusty; urgency=low - - * Resynchronise with Debian. Remaining changes: - - Depend on dh-apparmor. - - dh_installinit, autoscripts/postinst-upstart-replace: Prefer upstart - jobs where they exist. - - autoscripts/preinst-upstart-compatibility: Handle upgrades from older - versions that created the /lib/init/upstart-job symlink. - - autoscripts/postinst-init*: Only call update-rc.d when there's no - upstart job. - - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. - - dh_installinit: Add no-op --upstart-only option for compatibility. - - dh_installudev: Change default rules.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - - -- Dmitrijs Ledkovs Mon, 09 Dec 2013 12:06:22 +0000 - debhelper (9.20131127) unstable; urgency=low * dh_compress: Exclude several more compressed file formats. @@ -1051,25 +2276,6 @@ -- Joey Hess Mon, 04 Nov 2013 15:34:21 -0400 -debhelper (9.20130921ubuntu1) trusty; urgency=low - - * Resynchronise with Debian. Remaining changes: - - Depend on dh-apparmor. - - dh_installinit, autoscripts/postinst-upstart-replace: Prefer upstart - jobs where they exist. - - autoscripts/preinst-upstart-compatibility: Handle upgrades from older - versions that created the /lib/init/upstart-job symlink. - - autoscripts/postinst-init*: Only call update-rc.d when there's no - upstart job. - - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. - - dh_installinit: Add no-op --upstart-only option for compatibility. - - dh_installudev: Change default rules.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - - -- Colin Watson Mon, 21 Oct 2013 09:28:05 +0100 - debhelper (9.20130921) unstable; urgency=low * dh: Call dh_installxfonts after dh_link, so that it will @@ -1100,25 +2306,6 @@ -- Joey Hess Tue, 20 Aug 2013 12:46:25 -0400 -debhelper (9.20130630ubuntu1) saucy; urgency=low - - * Resynchronise with Debian. Remaining changes: - - Depend on dh-apparmor. - - dh_installinit, autoscripts/postinst-upstart-replace: Prefer upstart - jobs where they exist. - - autoscripts/preinst-upstart-compatibility: Handle upgrades from older - versions that created the /lib/init/upstart-job symlink. - - autoscripts/postinst-init*: Only call update-rc.d when there's no - upstart job. - - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. - - dh_installinit: Add no-op --upstart-only option for compatibility. - - dh_installudev: Change default rules.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - - -- Colin Watson Mon, 01 Jul 2013 11:20:37 +0100 - debhelper (9.20130630) unstable; urgency=low * perl_build: Use -- long option names, for compatibility with @@ -1127,25 +2314,6 @@ -- Joey Hess Sun, 30 Jun 2013 14:20:51 -0400 -debhelper (9.20130626ubuntu1) saucy; urgency=low - - * Resynchronise with Debian. Remaining changes: - - Depend on dh-apparmor. - - dh_installinit, autoscripts/postinst-upstart-replace: Prefer upstart - jobs where they exist. - - autoscripts/preinst-upstart-compatibility: Handle upgrades from older - versions that created the /lib/init/upstart-job symlink. - - autoscripts/postinst-init*: Only call update-rc.d when there's no - upstart job. - - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. - - dh_installinit: Add no-op --upstart-only option for compatibility. - - dh_installudev: Change default rules.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - - -- Colin Watson Thu, 27 Jun 2013 12:59:50 +0100 - debhelper (9.20130626) unstable; urgency=low * dh_strip: Run readelf in C locale. Closes: #714187 @@ -1169,25 +2337,6 @@ -- Joey Hess Wed, 05 Jun 2013 12:28:51 -0400 -debhelper (9.20130604ubuntu1) saucy; urgency=low - - * Resynchronise with Debian. Remaining changes: - - Depend on dh-apparmor. - - dh_installinit, autoscripts/postinst-upstart-replace: Prefer upstart - jobs where they exist. - - autoscripts/preinst-upstart-compatibility: Handle upgrades from older - versions that created the /lib/init/upstart-job symlink. - - autoscripts/postinst-init*: Only call update-rc.d when there's no - upstart job. - - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. - - dh_installinit: Add no-op --upstart-only option for compatibility. - - dh_installudev: Change default rules.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - - -- Colin Watson Wed, 05 Jun 2013 11:00:43 +0100 - debhelper (9.20130604) unstable; urgency=low * dh_installchangelogs: No longer automatically converts html changelogs. @@ -1204,25 +2353,6 @@ -- Joey Hess Tue, 04 Jun 2013 11:27:29 -0400 -debhelper (9.20130518ubuntu1) saucy; urgency=low - - * Resynchronise with Debian. Remaining changes: - - Depend on dh-apparmor. - - dh_installinit, autoscripts/postinst-upstart-replace: Prefer upstart - jobs where they exist. - - autoscripts/preinst-upstart-compatibility: Handle upgrades from older - versions that created the /lib/init/upstart-job symlink. - - autoscripts/postinst-init*: Only call update-rc.d when there's no - upstart job. - - autoscripts/*-init*: Test for /etc/init/*.conf where necessary. - - dh_installinit: Add no-op --upstart-only option for compatibility. - - dh_installudev: Change default rules.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - - -- Colin Watson Tue, 04 Jun 2013 11:46:28 +0100 - debhelper (9.20130518) unstable; urgency=low * dh_installchangelogs: Write the changelog entry used for a binNMU, @@ -1314,44 +2444,6 @@ -- Joey Hess Sat, 04 May 2013 23:32:27 -0400 -debhelper (9.20120909ubuntu3) saucy; urgency=low - - * Now that we no longer create /lib/init/upstart-job symlinks, fix the - init-related autoscript fragments to also test for /etc/init/*.conf - where necessary (LP: #1183807). - - -- Colin Watson Fri, 24 May 2013 15:46:20 +0100 - -debhelper (9.20120909ubuntu2) saucy; urgency=low - - * Align upstart job handling with upstream debhelper: install both init - scripts and upstart jobs, and rely on the policy layer in invoke-rc.d - and our handling of update-rc.d to give the right behavior. - * Drops preinst-removeconffile, introduces preinst-upstart-compatibility - in its place. - - -- Steve Langasek Sat, 18 May 2013 18:20:03 -0500 - -debhelper (9.20120909ubuntu1) raring; urgency=low - - * Merge from Debian unstable, remaining changes: - - Depend on dh-apparmor. - - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes. - - continue to use /lib/init/upstart-job symlinks in Ubuntu, since - insserv is not yet usable with upstart. - - Add autoscripts for above: postinst-upstart-replace, - preinst-removeconffile. - - autoscripts/postinst-init, autoscripts/postinst-init-restart: Only - call update-rc.d when there's no upstart job. - - autoscripts/postinst-init-nostart: also handle the upstart case; - otherwise we call update-rc.d to add, and again to remove! - - dh_installudev: Change default init.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - - -- Adam Conrad Wed, 07 Nov 2012 13:12:10 -0700 - debhelper (9.20120909) unstable; urgency=low * autoscript() can now be passed a perl sub to run to s/// lines of @@ -1374,29 +2466,6 @@ -- Joey Hess Thu, 30 Aug 2012 11:04:10 -0400 -debhelper (9.20120608ubuntu1) quantal; urgency=low - - * Merge from Debian unstable, remaining changes: - - Depend on dh-apparmor. - - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes. - - continue to use /lib/init/upstart-job symlinks in Ubuntu, since - insserv is not yet usable with upstart. - - Add autoscripts for above: postinst-upstart-replace, - preinst-removeconffile. - - autoscripts/postinst-init, autoscripts/postinst-init-restart: Only - call update-rc.d when there's no upstart job. - - autoscripts/postinst-init-nostart: also handle the upstart case; - otherwise we call update-rc.d to add, and again to remove! - - dh_installudev: Change default init.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - * Dropped changes, superseded in Debian: - - Mark debhelper Multi-Arch: foreign, so it's recognized as satisfying - cross-dependencies and cross-build-dependencies. - - -- Adam Conrad Tue, 19 Jun 2012 14:25:04 -0600 - debhelper (9.20120608) unstable; urgency=low * dh: When there's an -indep override target without -arch, or vice versa, @@ -1447,39 +2516,6 @@ -- Joey Hess Wed, 09 May 2012 12:59:15 -0400 -debhelper (9.20120419ubuntu2) quantal; urgency=low - - * dh_installinit: drop the --onlyscripts-upstart option, which was only - used temporarily for compatibility with some packages in karmic. - - -- Steve Langasek Sun, 29 Apr 2012 09:58:05 -0700 - -debhelper (9.20120419ubuntu1) quantal; urgency=low - - * Merge from Debian unstable, remaining changes: - - Depend on dh-apparmor. - - Mark debhelper Multi-Arch: foreign, so it's recognized as satisfying - cross-dependencies and cross-build-dependencies. - - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes. - - continue to use /lib/init/upstart-job symlinks in Ubuntu, since - insserv is not yet usable with upstart. - - Add autoscripts for above: postinst-upstart-replace, - preinst-removeconffile. - - autoscripts/postinst-init, autoscripts/postinst-init-restart: Only - call update-rc.d when there's no upstart job. - - dh_installudev: Change default init.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - * Dropped changes, superseded in Debian: - - autoscripts postinst-upstart, postinst-upstart-restart, prerm-upstart, - prerm-upstart-norestart dropped, the logic has merged into the main - autoscripts. - * autoscripts/postinst-init-nostart: also handle the upstart case; - otherwise we call update-rc.d to add, and again to remove! - - -- Steve Langasek Sun, 29 Apr 2012 07:46:42 +0000 - debhelper (9.20120419) unstable; urgency=low * Fix compat level checking for cmake. Closes: #669181 @@ -1547,40 +2583,6 @@ -- Joey Hess Sun, 11 Mar 2012 18:28:33 -0400 -debhelper (9.20120115ubuntu3) precise; urgency=low - - * remove dh_apparmor and corresponding autoscripts and adjust debian/control - to Depends on dh-apparmor. This can be dropped once all packages that use - dh_apparmor Build-Depends on dh-apparmor. - - -- Jamie Strandboge Fri, 02 Mar 2012 08:13:33 -0600 - -debhelper (9.20120115ubuntu2) precise; urgency=low - - * Make dh_apparmor executable again. - - -- Colin Watson Tue, 24 Jan 2012 00:12:27 +0000 - -debhelper (9.20120115ubuntu1) precise; urgency=low - - * Resynchronise with Debian. Remaining changes: - - Mark debhelper Multi-Arch: foreign, so it's recognized as satisfying - cross-dependencies and cross-build-dependencies. - - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes. - - Add various autoscripts for above: postinst-upstart, - postinst-upstart-replace, postinst-upstart-restart, prerm-upstart, - prerm-upstart-norestart, preinst-removeconffile. - - autoscripts/postinst-init, autoscripts/postinst-init-restart: Only - call update-rc.d when there's no upstart job, which will let us get - rid of the separate postinst-upstart{,-restart} scripts. - - dh_installudev: Change default init.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat - level 7. This floods packages with huge upstream changelogs which - take precious CD space. - - Add dh_apparmor and autoscripts. - - -- Colin Watson Mon, 23 Jan 2012 13:00:43 +0000 - debhelper (9.20120115) unstable; urgency=low * Finalized v9 mode, which is the new recommended default. @@ -1642,65 +2644,14 @@ -- Joey Hess Wed, 16 Nov 2011 11:54:59 -0400 -debhelper (8.9.9ubuntu1) precise; urgency=low - - * Merge from Debian testing, remaining changes: - - mark debhelper Multi-Arch: foreign, so it's recognized as satisfying - cross-dependencies and cross-build-dependencies. - - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes. - - Add various autoscripts for above: postinst-upstart, - postinst-upstart-replace, postinst-upstart-restart, - prerm-upstart, prerm-upstart-norestart, preinst-removeconffile. - - autoscripts/postinst-init, autoscripts/postinst-init-restart: only - call update-rc.d when there's no upstart job, which will let us get - rid of the separate postinst-upstart{,-restart} scripts. - - dh_installudev: Change default init.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat level - 7. This floods packages with huge upstream changelogs which take - precious CD space. - - add dh_apparmor and autoscripts - * Dropped changes: - - debian/rules: set executable bit for dh_apparmor: fix this in the - source tarball instead, like it's set for all other scripts. - - -- Steve Langasek Wed, 16 Nov 2011 16:24:58 -0800 - debhelper (8.9.9) unstable; urgency=low - * dh_auto_build: Use target architecture (not host architecture) + * dh_auto_build: Use target architecture (not host architecture) for build directory name. Closes: #644553 Thanks, Tom Hughes * dh: Add dh_auto_configure parameter example. Closes: #645335 -- Joey Hess Fri, 04 Nov 2011 17:01:58 -0400 -debhelper (8.9.8ubuntu2) precise; urgency=low - - * autoscripts/postinst-init, autoscripts/postinst-init-restart: only call - update-rc.d when there's no upstart job, letting us get rid of the - separate postinst-upstart{,-restart} scripts. - * mark debhelper Multi-Arch: foreign, so it's recognized as satisfying - cross-dependencies and cross-build-dependencies. - - -- Steve Langasek Sat, 05 Nov 2011 00:41:42 -0400 - -debhelper (8.9.8ubuntu1) precise; urgency=low - - * Merge with Debian; remaining Ubuntu changes: - - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes. - - Add various autoscripts for above: postinst-upstart, - postinst-upstart-replace, postinst-upstart-restart, - prerm-upstart, prerm-upstart-norestart, preinst-removeconffile. - - dh_installudev: Change default init.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat level - 7. This floods packages with huge upstream changelogs which take - precious CD space. - - add dh_apparmor and autoscripts - - debian/rules: set executable bit for dh_apparmor before actually running - dh build, that is in order to get the manpage built for dh_apparmor. - - dh_installinit: drop redundant definition of -O. - - -- Martin Pitt Tue, 11 Oct 2011 06:36:38 +0200 - debhelper (8.9.8) unstable; urgency=low * dh_fixperms: Operate on .ali files throughout /usr/lib, including @@ -1731,7 +2682,7 @@ overrides, because mixing the two types of overrides would have been too complicated. In particular, it's difficult to ensure an old override target will work if it's sometimes constrained to only - acting on half the packages it would normally run on. This would be + acting on half the packages it would normally run on. This would be a source of subtle bugs, so is avoided. * dh: Don't bother running dh_shlibdebs, dh_makeshlibs, or dh_strip in the binary target when all packages being acted on are indep. @@ -1806,26 +2757,6 @@ -- Joey Hess Sun, 17 Jul 2011 16:31:27 -0400 -debhelper (8.9.0ubuntu1) oneiric; urgency=low - - * Merge with Debian (LP: #801884); remaining changes: - - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes. - - Add various autoscripts for above: postinst-upstart, - postinst-upstart-replace, postinst-upstart-restart, - prerm-upstart, prerm-upstart-norestart, preinst-removeconffile. - - dh_installudev: Change default init.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat level - 7. This floods packages with huge upstream changelogs which take - precious CD space. - - add dh_apparmor and autoscripts - - debian/rules: set executable bit for dh_apparmor before actually running - dh build, that is in order to get the manpage built for dh_apparmor. - - dh_installinit: drop redundant definition of -O. - - debian/control: dpkg-dev dependency needs to be on 1.16.0~ubuntu4 for - multiarch, not just 1.16.0~. - - -- أحمد المحمودي (Ahmed El-Mahmoudy) Sat, 02 Jul 2011 00:04:09 +0200 - debhelper (8.9.0) unstable; urgency=low * dh: In v9, any standard rules file targets, including build-arch, @@ -1848,32 +2779,6 @@ -- Joey Hess Fri, 24 Jun 2011 14:28:52 -0400 -debhelper (8.1.6ubuntu2) oneiric; urgency=low - - * dh_installinit: drop redundant definition of -O. - * debian/control: dpkg-dev dependency needs to be on 1.16.0~ubuntu4 for - multiarch, not just 1.16.0~. - - -- Steve Langasek Fri, 20 May 2011 17:49:44 -0700 - -debhelper (8.1.6ubuntu1) oneiric; urgency=low - - * Merge with Debian (LP: #773932); remaining changes: - - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes. - - Add various autoscripts for above: postinst-upstart, - postinst-upstart-replace, postinst-upstart-restart, - prerm-upstart, prerm-upstart-norestart, preinst-removeconffile. - - dh_installudev: Change default init.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat level - 7. This floods packages with huge upstream changelogs which take - precious CD space. - - add dh_apparmor and autoscripts - - debian/rules: override build target to set executable bit for - dh_apparmor before actually running dh build, that is in order to get - the manpage built for dh_apparmor. - - -- أحمد المحمودي (Ahmed El-Mahmoudy) Thu, 28 Apr 2011 21:02:28 +0200 - debhelper (8.1.6) unstable; urgency=low * dh_ucf: Fix missing space before ']'s in postrm autoscript. @@ -1883,7 +2788,7 @@ debhelper (8.1.5) unstable; urgency=low * dh_ucf: New command, contributed by Jeroen Schot. Closes: #213078 - * dh_installgsettings: Correct bug in use of find that caused some + * dh_installgsettings: Correct bug in use of find that caused some gsettings files to be missed. Closes: #624377 -- Joey Hess Wed, 27 Apr 2011 21:33:50 -0400 @@ -1895,7 +2800,7 @@ when passed bundled options (like "-Nfoo" instead of "-N foo") that it does not understand; and it was not possible to fix that for any compat level before v8. But also, such logs can occur - for other reasons, like interrupted builds during development, + for other reasons, like interrupted builds during development, and it should be safe to clean them all. Closes: #623446 * Fix Typos in documentation regarding {pre,post}{inst,rm} Closes: #623709 @@ -1929,60 +2834,6 @@ -- Joey Hess Tue, 05 Apr 2011 13:09:43 -0400 -debhelper (8.1.2ubuntu4) natty; urgency=low - - * debhelper.pod: v9 info was added in the wrong place by mistake; move it - to where it belongs so the manpage reads sensibly again. - - -- Steve Langasek Mon, 21 Mar 2011 15:59:12 -0700 - -debhelper (8.1.2ubuntu3) natty; urgency=low - - * Revert the patch for env variable expansion based on feedback from Joey - Hess. It appears this patch is not as far along the path to upstream - inclusion as I thought it was; sorry for the misunderstanding, Joey. - - -- Steve Langasek Tue, 15 Mar 2011 13:12:50 -0700 - -debhelper (8.1.2ubuntu2) natty; urgency=low - - * multiarch support. FFe LP: #733501. - * merge changes from upstream git: - - Started work on Debhelper v9. It is still experimental, and more - changes may be added to that mode. - - Support multiarch in v9. Thanks, Steve Langasek. Closes: #617761 - - dh_auto_configure: Support multiarch in v9 by passing multiarch - directories to --libdir and --libexecdir. - - dh_makeshlibs: Detect packages using multiarch directories and - make ${misc:Pre-Depends} expand to multiarch-support. - - Depend on dpkg-dev (>= 1.16.0) for multiarch support. Note to - backporters: If you remove that dependency, debhelper will fall back - to not doing multiarch stuff in v9 mode, which is probably what you - want. - * Add Daniel Silverstone's patch to give us env variable expansions in - .install/.link files, needed in order to let us use DEB_HOST_MULTIARCH - without cumbersome .in files everywhere. Closes: #614731. - - -- Steve Langasek Mon, 14 Mar 2011 20:20:18 -0700 - -debhelper (8.1.2ubuntu1) natty; urgency=low - - * Merge with Debian (LP: #719150); remaining changes: - - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes. - - Add various autoscripts for above: postinst-upstart, - postinst-upstart-replace, postinst-upstart-restart, - prerm-upstart, prerm-upstart-norestart, preinst-removeconffile. - - dh_installudev: Change default init.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat level - 7. This floods packages with huge upstream changelogs which take - precious CD space. - - add dh_apparmor and autoscripts - - debian/rules: override build target to set executable bit for - dh_apparmor before actually running dh build, that is in order to get - the manpage built for dh_apparmor. - - -- أحمد المحمودي (Ahmed El-Mahmoudy) Tue, 15 Feb 2011 06:46:24 +0200 - debhelper (8.1.2) unstable; urgency=low * Fix logging at end of an override target that never actually runs @@ -1990,27 +2841,6 @@ -- Joey Hess Mon, 14 Feb 2011 14:22:17 -0400 -debhelper (8.1.1ubuntu1) natty; urgency=low - - * Merge with Debian (LP: #716844); remaining changes: - - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes. - - Add various autoscripts for above: postinst-upstart, - postinst-upstart-replace, postinst-upstart-restart, - prerm-upstart, prerm-upstart-norestart, preinst-removeconffile. - - dh_installudev: Change default init.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat level - 7. This floods packages with huge upstream changelogs which take - precious CD space. - - add dh_apparmor and autoscripts - - debian/rules: override build target to set executable bit for - dh_apparmor before actually running dh build, that is in order to get - the manpage built for dh_apparmor. - * Dropped changes that got fixed upstream: - - dh_strip, dh_makeshlibs: use triplet-objdump, triplet-objcopy and - triplet-strip from cross-binutils when cross-compiling; Debian #412118. - - -- أحمد المحمودي (Ahmed El-Mahmoudy) Fri, 11 Feb 2011 06:38:43 +0200 - debhelper (8.1.1) unstable; urgency=low * dh_strip, dh_makeshlibs: use triplet-objdump, triplet-objcopy and @@ -2024,26 +2854,6 @@ -- Joey Hess Thu, 10 Feb 2011 19:58:34 -0400 -debhelper (8.1.0ubuntu1) natty; urgency=low - - * Merge with Debian (LP: #714705); remaining changes: - - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes. - - Add various autoscripts for above: postinst-upstart, - postinst-upstart-replace, postinst-upstart-restart, - prerm-upstart, prerm-upstart-norestart, preinst-removeconffile. - - dh_installudev: Change default init.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat level - 7. This floods packages with huge upstream changelogs which take - precious CD space. - - dh_strip, dh_makeshlibs: use triplet-objdump, triplet-objcopy and - triplet-strip from cross-binutils when cross-compiling; Debian #412118. - - add dh_apparmor and autoscripts - - debian/rules: override build target to set executable bit for - dh_apparmor before actually running dh build, that is in order to get - the manpage built for dh_apparmor. - - -- أحمد المحمودي (Ahmed El-Mahmoudy) Mon, 07 Feb 2011 17:16:49 +0200 - debhelper (8.1.0) unstable; urgency=low [ Joey Hess ] @@ -2083,43 +2893,14 @@ * dh_installinit: never call init scripts directly, only through invoke-rc.d Closes: #610340 (Thanks, Steve Langasek) - + [ Valery Perrin ] * update french translation. * Fix french misspelling. - * French translation update after massive man page typography + * French translation update after massive man page typography -- Joey Hess Sat, 05 Feb 2011 12:00:04 -0400 -debhelper (8.0.0ubuntu2) natty; urgency=low - - * autoscripts postinst-upstart, prerm-upstart, prerm-upstart-norestart - need to use invoke-rc.d instead of calling start/stop directly, so that - they're well-behaved in chroots and other places policy-rc.d may be used. - LP: #690640. - - -- Steve Langasek Sun, 23 Jan 2011 12:38:00 -0800 - -debhelper (8.0.0ubuntu1) maverick; urgency=low - - * Merge with Debian (LP: #614787); remaining changes: - - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes. - - Add various autoscripts for above: postinst-upstart, - postinst-upstart-replace, postinst-upstart-restart, - prerm-upstart, prerm-upstart-norestart, preinst-removeconffile. - - dh_installudev: Change default init.d symlink priority to 40. - - dh_installchangelogs: Do not install upstream changelog in compat level - 7. This floods packages with huge upstream changelogs which take - precious CD space. - - dh_strip, dh_makeshlibs: use triplet-objdump, triplet-objcopy and - triplet-strip from cross-binutils when cross-compiling; Debian #412118. - - add dh_apparmor and autoscripts - * debian/rules: override build target to set executable bit for dh_apparmor - before actually running dh build, that is in order to get the manpage - built for dh_apparmor. - - -- أحمد المحمودي (Ahmed El-Mahmoudy) Tue, 10 Aug 2010 12:45:25 +0300 - debhelper (8.0.0) unstable; urgency=low [ Carsten Hey ] @@ -2150,7 +2931,7 @@ changes are planned for that mode. * dh_installman: Support .so links relative to the current section. * dh_installman: Avoid converting .so links to symlinks if the link - target is not present in the same binary package, on advice of + target is not present in the same binary package, on advice of Colin Watson. (To support eventual so search paths.) * Add deprecation warning for dh_clean -k. * dh_testversion: Removed this deprecated and unused command. @@ -2181,55 +2962,6 @@ -- Joey Hess Wed, 16 Jun 2010 13:44:48 -0400 -debhelper (7.4.20ubuntu6) maverick; urgency=low - - * autoscripts/postinst-apparmor: don't 'echo' to stdout. As nice as it - looks, it doesn't play well with debconf and isn't translated. Thanks - to dhcp3 for pointing this out. - - -- Jamie Strandboge Fri, 06 Aug 2010 17:11:13 -0500 - -debhelper (7.4.20ubuntu5) maverick; urgency=low - - * autoscripts/postinst-apparmor: - - tweak logic slightly to be more efficient and add some comments - - chmod 644 the local include file - * dh_apparmor: add note about using -p - - -- Jamie Strandboge Fri, 06 Aug 2010 12:04:08 -0500 - -debhelper (7.4.20ubuntu4) maverick; urgency=low - - * add dh_apparmor and autoscripts - - -- Jamie Strandboge Fri, 06 Aug 2010 08:32:41 -0500 - -debhelper (7.4.20ubuntu3) maverick; urgency=low - - * dh_strip, dh_makeshlibs: use triplet-objdump, triplet-objcopy and - triplet-strip from cross-binutils when cross-compiling; Debian #412118. - - -- Loïc Minier Tue, 03 Aug 2010 16:36:12 -0400 - -debhelper (7.4.20ubuntu2) maverick; urgency=low - - * dh_installchangelogs: Do not install upstream changelog in compat level 7. - This floods packages with huge upstream changelogs which take precious CD - space. - - -- Martin Pitt Sun, 01 Aug 2010 21:07:12 +0200 - -debhelper (7.4.20ubuntu1) maverick; urgency=low - - * Merge with Debian (LP: #583352); remaining changes: - - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes. - - Add various autoscripts for above: postinst-upstart, - postinst-upstart-replace, postinst-upstart-restart, - prerm-upstart, prerm-upstart-norestart, preinst-removeconffile. - - dh_installudev: Change default init.d symlink priority to 40. - - -- أحمد المحمودي (Ahmed El-Mahmoudy) Thu, 20 May 2010 14:37:56 +0300 - debhelper (7.4.20) unstable; urgency=low * Drop one more call to dpkg-architecture. Closes: #580837 @@ -2241,21 +2973,6 @@ -- Joey Hess Wed, 12 May 2010 20:06:02 -0400 -debhelper (7.4.19ubuntu1) maverick; urgency=low - - * Merge with Debian; remaining changes: - - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes. - - Add various autoscripts for above: postinst-upstart, - postinst-upstart-replace, postinst-upstart-restart, - prerm-upstart, prerm-upstart-norestart, preinst-removeconffile. - - dh_installudev: Change default init.d symlink priority to 40. - * dh_installudev: Drop conffile migration code, it was only needed until - lucid. - * dh_gconf: Temporarily lower generated gconf dependency to a version which - we actually have. - - -- Martin Pitt Mon, 03 May 2010 11:22:01 +0200 - debhelper (7.4.19) unstable; urgency=low * Memoize architecture comparisons in samearch, and avoid calling @@ -2302,23 +3019,11 @@ -- Joey Hess Tue, 06 Apr 2010 22:06:50 -0400 -debhelper (7.4.15ubuntu1) lucid; urgency=low - - * Resynchronise with Debian. Remaining changes: - - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes. - - Add various autoscripts for above: postinst-upstart, - postinst-upstart-replace, postinst-upstart-restart, - prerm-upstart, prerm-upstart-norestart, preinst-removeconffile. - - dh_installudev: Handle conffile migration from old Ubuntu defaults - (needed until after the next LTS release). - - -- Colin Watson Mon, 22 Feb 2010 12:46:04 +0000 - debhelper (7.4.15) unstable; urgency=low * The fix for #563557 caused some new trouble involving makefile that misbehave when stderr is closed. Reopen it to /dev/null - when testing for the existance of a makefile target. Closes: #570443 + when testing for the existance of a makefile target. Closes: #570443 -- Joey Hess Thu, 18 Feb 2010 16:37:34 -0500 @@ -2329,18 +3034,6 @@ -- Joey Hess Tue, 16 Feb 2010 14:47:10 -0500 -debhelper (7.4.13ubuntu1) lucid; urgency=low - - * Resynchronise with Debian. Remaining changes: - - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes. - - Add various autoscripts for above: postinst-upstart, - postinst-upstart-replace, postinst-upstart-restart, - prerm-upstart, prerm-upstart-norestart, preinst-removeconffile. - - dh_installudev: Handle conffile migration from old Ubuntu defaults - (needed until after the next LTS release). - - -- Colin Watson Thu, 11 Feb 2010 19:02:31 +0000 - debhelper (7.4.13) unstable; urgency=low * dh_compress: Avoid compressing images in /usr/share/info. Closes: #567586 @@ -2366,18 +3059,6 @@ -- Joey Hess Sat, 30 Jan 2010 20:23:02 -0500 -debhelper (7.4.11ubuntu1) lucid; urgency=low - - * Merge with Debian; remaining changes: - - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes. - - Add various autoscripts for above: postinst-upstart, - postinst-upstart-replace, postinst-upstart-restart, - prerm-upstart, prerm-upstart-norestart, preinst-removeconffile. - - dh_installudev: Handle conffile migration from old Ubuntu defaults - (needed until after the next LTS release). - - -- Matthias Klose Thu, 28 Jan 2010 10:44:11 +0100 - debhelper (7.4.11) unstable; urgency=low * dh(1): Minor rewording of documentation of override commands. @@ -2394,22 +3075,6 @@ -- Joey Hess Thu, 31 Dec 2009 11:32:34 -0500 -debhelper (7.4.10ubuntu1) lucid; urgency=low - - [ أحمد المحمودي (Ahmed El-Mahmoudy) ] - * Merge with Debian unstable (LP: #485956). Remaining Ubuntu changes: - - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes. - - Add various autoscripts for above: postinst-upstart, - postinst-upstart-replace, postinst-upstart-restart, - prerm-upstart, prerm-upstart-norestart, preinst-removeconffile. - - dh_installudev: Handle conffile migration from old Ubuntu defaults - (needed until after the next LTS release). - - [ Daniel Holbach ] - * Port merge from 7.4.7 to 7.4.10. - - -- أحمد المحمودي (Ahmed El-Mahmoudy) Wed, 16 Dec 2009 09:01:54 +0100 - debhelper (7.4.10) unstable; urgency=low * Add --parallel option that can be used to enable parallel building @@ -2497,25 +3162,6 @@ -- Joey Hess Wed, 18 Nov 2009 14:44:21 -0500 -debhelper (7.4.3ubuntu2) lucid; urgency=low - - * dh_installinit: Fix merge error which caused init.d-autoscripts to be - run for upstartified packages. (LP: #470326) - - -- Martin Pitt Mon, 02 Nov 2009 13:01:48 +0100 - -debhelper (7.4.3ubuntu1) lucid; urgency=low - - * Merge with Debian unstable. Remaining Ubuntu changes: - - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes. - - Add various autoscripts for above: postinst-upstart, - postinst-upstart-replace, postinst-upstart-restart, - prerm-upstart, prerm-upstart-norestart, preinst-removeconffile. - - dh_installudev: Handle conffile migration from old Ubuntu defaults - (needed until after the next LTS release). - - -- Martin Pitt Fri, 30 Oct 2009 14:11:17 +0100 - debhelper (7.4.3) unstable; urgency=low [ Valery Perrin ] @@ -2526,7 +3172,7 @@ dh_installudev, dh_lintian, dh_prep into po4a.cfg manpages list * fix a spelling mistake in dh_makeshlibs man french translation (#494300 part 2) - + [ Joey Hess ] * dh_perl: Do not look at perl scripts under /usr/share/doc. Closes: #546683 @@ -2563,7 +3209,7 @@ symlinks in /etc/init.d for sysv-rc implementations. Closes: #536035. [ Joey Hess ] - * Add FILES sections to man pages. Closes: #545041 + * Add FILES sections to man pages. Closes: #545041 * dh_prep(1): Clarify when it should be called. Closes: #544969 -- Joey Hess Sun, 06 Sep 2009 18:44:40 -0400 @@ -2597,54 +3243,6 @@ -- Joey Hess Wed, 26 Aug 2009 17:10:53 -0400 -debhelper (7.3.15ubuntu3) karmic; urgency=low - - * dh_installinit: - - Create the upstart-job symlink even when --upstart-only is called, - since this simplifies implementation of... - - --restart-after-upgrade: we can't use the upstart 'restart' command here - because this will give wrong behavior if we're adding a new job to an - existing package; instead just use the standard invoke-rc.d snippet, - which (combined with the above) will at least give us compatibility - with policy-rc.d for preventing stopped jobs from starting on upgrade. - (N.B.: prerm scripts could also safely reuse the invoke-rc.d handling - instead of calling 'stop' directly, but leaving this alone for now - because the current behavior is only minorly buggy.) - - Drop unnecessary UPSTART_ONLY check; --upstart-only should never be set - without having an upstart job so this is redundant. - - postinst-reboot-required is never the right snippet to include here. - - Merge in the final changes to the upstartification as accepted into - debhelper upstream, dropping the --onlyscripts-upstart option from - the documentation but mapping it to --onlyscripts for compatibility in - karmic. - * autoscript/postinst-upstart: typo fix. - - -- Steve Langasek Wed, 30 Sep 2009 13:57:14 -0700 - -debhelper (7.3.15ubuntu2) karmic; urgency=low - - FFE LP: #427356. - - * dh_installinit: handle upstart job files in preference over init - scripts, supplying appropriate maintainer scripts to stop, start or - restart the jobs over upgrades. - - currently unlike init scripts, these accept failures because Upstart - considers "start when already running" failure. - * dh_installinit: --upstart-only will not include maintainer script code - to replace an init script with an upstart job, otherwise a compatibilty - symlink to /lib/init/upstart-job is left in its place - - -- Scott James Remnant Tue, 15 Sep 2009 03:32:13 +0100 - -debhelper (7.3.15ubuntu1) karmic; urgency=low - - * Resynchronise with Debian. Remaining changes: - - dh_installudev: Default priority is now 40 by default. - - dh_installudev: Handle conffile migration from old Ubuntu defaults - (needed until after the next LTS release). - - -- Colin Watson Tue, 25 Aug 2009 11:10:18 +0100 - debhelper (7.3.15) unstable; urgency=low * dh_installudev: Install rules files into new location @@ -2652,7 +3250,7 @@ * dh_installudev: Add code to delete old conffiles unless they're modified, and in that case, rename them to override the corresponding file in /lib/udev. (Based on patch by - Martin Pitt.) (Note that this file will not be deleted on purge -- + Martin Pitt.) (Note that this file will not be deleted on purge -- I can't see a good way to determine when it's appropriate to do that.) * dh_installudev: Set default priority to 60; dropping the "z". @@ -2719,17 +3317,6 @@ -- Joey Hess Sat, 01 Aug 2009 15:59:07 -0400 -debhelper (7.3.8ubuntu1) karmic; urgency=low - - * Merge with Debian unstable (LP: #404561). Remaining Ubuntu changes: - - dh_installudev: Default priority is now 40 by default, the target - directory is /lib/udev/rules.d, and rules use '-' as separator instead of - '_'. Remove files from /etc/udev/rules.d unless they are user modified; - if modified and of default priority, take care to rename. - This should eventually go to Debian as well, see Debian #491117. - - -- أحمد المحمودي (Ahmed El-Mahmoudy) Sat, 25 Jul 2009 17:17:24 +0300 - debhelper (7.3.8) unstable; urgency=low * Fix t/override_target to use ./run. Closes: #538315 @@ -3087,7 +3674,7 @@ complaining about it when it's empty. Closes: #498666 * dh: Fix typo in example. Closes: #500836 * Allow individual debhelper programs to define their own special options - by passing a hash to init(), which is later passed on the Getopt::Long. + by passing a hash to init(), which is later passed on the Getopt::Long. Closes: #370823 * Move many command-specific options to only be accepted by the command that uses them. Affected options are: @@ -3135,7 +3722,7 @@ * dh: Support debian/rules calling make with -B, which is useful to avoid issues with phony implicit rules (see bug #509756). - + -- Joey Hess Fri, 27 Feb 2009 15:25:52 -0500 debhelper (7.0.17) unstable; urgency=low @@ -3228,7 +3815,7 @@ debhelper (7.0.8) unstable; urgency=low * dh: Add an interface that third-party packages providing debhelper commands - can use to insert them into a command sequence. + can use to insert them into a command sequence. (See dh(1), "SEQUENCE ADDONS".) * dh: --with=foo can be used to include such third-party commands. So, for example, --with=cli could add the dh_cli* commands from @@ -3587,7 +4174,7 @@ * Update urls to web page. * Add some checks for attempts to act on packages not defined in the control file. (Thanks Wakko) - * Use dpkg-query to retrieve conffile info in udev rules upgrade code + * Use dpkg-query to retrieve conffile info in udev rules upgrade code rather than parsing status directly. (Thanks Guillem) -- Joey Hess Thu, 31 May 2007 13:14:06 -0400 @@ -3745,7 +4332,7 @@ [ Valery Perrin ] * Update french translation with recent change in dh_installmodules - + [ Joey Hess] * ACK last three NMUs with thanks to Raphael Hertzog for making the best of a difficult situation. @@ -4179,7 +4766,7 @@ level and changes from earlier levels are concentrated in the "Debhelper compatibility levels" section of debhelper.1. Closes: #336906 * Deprecate v3. - * dh_install: Add package name to missing files error. Closes: #336908 + * dh_install: Add package name to missing files error. Closes: #336908 -- Joey Hess Tue, 1 Nov 2005 18:54:29 -0500 @@ -4229,8 +4816,8 @@ debhelper (4.9.9) unstable; urgency=low - * dh_shlibdeps: Avoid a use strict warning in some cases if - LD_LIBRARY_PATH is not set. + * dh_shlibdeps: Avoid a use strict warning in some cases if + LD_LIBRARY_PATH is not set. * ACK NMU. Closes: #327209 -- Joey Hess Wed, 7 Sep 2005 15:32:53 -0400 @@ -4238,7 +4825,7 @@ debhelper (4.9.8.1) unstable; urgency=low * NMU with maintainer approval. - * dh_gconf: delegate schema registration the gconf-schemas script, + * dh_gconf: delegate schema registration the gconf-schemas script, which moves schemas to /var/lib/gconf, and require gconf2 2.10.1-2, where it can be found. Closes: #327209 @@ -4309,7 +4896,7 @@ debhelper (4.9.0) unstable; urgency=low * Begin work on compatibility level 5. The set of changes in this mode is - still being determined, and will be until debhelper version 5.0 is + still being determined, and will be until debhelper version 5.0 is released, so use at your own risk. * dh_strip: In v5, make --dbg-package specify a single debugging package that gets the debugging symbols from the other packages acted on. @@ -4651,7 +5238,7 @@ * dh_strip: Add note to man page that the detached debugging symbols options mean the package must build-depend on a new enough version of binutils. Closes: #231382 - * dh_installdebconf: The debconf dependency has changed to include + * dh_installdebconf: The debconf dependency has changed to include "| debconf-2.0". Closes: #230622 -- Joey Hess Sat, 7 Feb 2004 15:10:10 -0500 @@ -5145,7 +5732,7 @@ debhelper (4.1.25) unstable; urgency=low - * Added a dh_python command, by Josselin Mouette + * Added a dh_python command, by Josselin Mouette . -- Joey Hess Thu, 21 Nov 2002 00:55:35 -0500 @@ -5461,7 +6048,7 @@ debhelper (4.0.4) unstable; urgency=low * Set DH_ALWAYS_EXCLUDE=CVS and debhelper will exclude CVS directories - from processing by any command that takes a -X option, and dh_builddeb + from processing by any command that takes a -X option, and dh_builddeb will also go in and rm -rf any that still sneak into the build tree. * dh_install: A patch from Eric Dorland adds support for --sourcedir, which allows debian/package.files files to be moved over to @@ -5519,7 +6106,7 @@ bad design, you are incouraged to just use dh_install instead. * dh_fixperms: in v4 only, make all files in bin/ dirs +x. Closes: #119039 * dh_fixperms: in v4 only, make all files in etc/init.d executable (of - course there's -X ..) + course there's -X ..) * dh_link: in v4 only, finds existing, non-policy-conformant symlinks and corrects them. This has the side effect of making dh_link idempotent. * Added a -h/--help option. This seems very obvious, but it never occured to @@ -5674,7 +6261,7 @@ * Added referneces to menufile in dh_installmenu man page. Closes: #127978 (dh_make is not a part of debhelper, if you want it changed, file a bug on dh-make.) - + -- Joey Hess Sat, 5 Jan 2002 22:45:09 -0500 debhelper (3.0.54) unstable; urgency=low @@ -5712,7 +6299,7 @@ * dh_installdeb: changed the #!/bin/sh -e to set -e on a new line. Whether this additional bloat is worth it to make it easier for people to sh -x a script by hand is debatable either way, I guess. Closes: #119046 - * Added a check for duplicated package stanzas in debian/control, + * Added a check for duplicated package stanzas in debian/control, Closes: #118805 -- Joey Hess Sat, 17 Nov 2001 14:00:54 -0500 @@ -5761,7 +6348,7 @@ * dh_perl: made it use doit commands so -v mode works. Yeah, uglier. Closes: #92826 - Also some indentation fixes. + Also some indentation fixes. -- Joey Hess Fri, 24 Aug 2001 15:34:55 -0400 @@ -5770,8 +6357,8 @@ * dh_movefiles: Typo, Closes: #106532 * Use -x to test for existance of init scripts, rather then -e since we'll be running them, Closes: #109692 - * dh_clean: remove debian/*.debhelper. No need to name files - specifically; any file matching that is a debhelper temp file. + * dh_clean: remove debian/*.debhelper. No need to name files + specifically; any file matching that is a debhelper temp file. Closes: #106514, #85520 -- Joey Hess Thu, 23 Aug 2001 15:47:35 -0400 @@ -5879,17 +6466,17 @@ of options after --. Now that it's fixed, any and all programs that support a -- and options after it, do not require any special quoting of the succeeding options. Quote just like you would in whatever - program those options go to. So, for example, + program those options go to. So, for example, dh_gencontrol -Vblah:Depends='foo, bar (>= 1.2)' will work just as you would hope. This fix does NOT apply to -u; don't use -u if you must do something complex. Closes: #89311 * Made escape_shell output a lot better. - + -- Joey Hess Tue, 29 May 2001 17:54:19 -0400 debhelper (3.0.26) unstable; urgency=low - * Always include package name in maintainer script fragment filenames + * Always include package name in maintainer script fragment filenames and generated shlibs files (except for in DH_COMPAT=1 mode). This is a purely cosmetic change, and if it breaks anything, you were using an undocumented interface. Closes: #95387 @@ -5914,7 +6501,7 @@ debhelper (3.0.23) unstable; urgency=low * dh_shlibdeps: the -l switch now just adds to LD_LIBRARY_PATH, if it is - already set. Newer fakeroots set it, and clobbering their settings + already set. Newer fakeroots set it, and clobbering their settings breaks things since they LD_PRELOAD a library that is specified in the LD_LIBRARY_PATH. (blah) Closes: #97494 @@ -6050,7 +6637,7 @@ debhelper (3.0.7) unstable; urgency=low - * dh_makeshlibs: only generate call to ldconfig if it really looks like + * dh_makeshlibs: only generate call to ldconfig if it really looks like a given *.so* file is indeed a shared library. -- Joey Hess Fri, 23 Feb 2001 14:38:50 -0800 @@ -6086,8 +6673,8 @@ debhelper (3.0.0) unstable; urgency=low * Added dh_installman, a new program that replaces dh_installmanpages. - It is not DWIM. You tell it what to install and it figures out where - based on .TH section field and filename extention. I reccommend everyone + It is not DWIM. You tell it what to install and it figures out where + based on .TH section field and filename extension. I reccommend everyone begin using it, since this is much better then dh_installmanpages's evilness. I've been meaning to do this for a very long time.. Closes: #38673, #53964, #64297, #16933, #17061, #54059, #54373, #61816 @@ -6158,7 +6745,7 @@ debhelper (2.2.17) unstable; urgency=medium - * dh_installdebconf: marge in templates with a .ll_LL extention, + * dh_installdebconf: marge in templates with a .ll_LL extension, they were previously ignored. -- Joey Hess Mon, 29 Jan 2001 13:05:21 -0800 @@ -6208,7 +6795,7 @@ debhelper (2.2.11) unstable; urgency=medium - * Fixed dh_installwm. Oops. Closes: #81124 + * Fixed dh_installwm. Oops. Closes: #81124 -- Joey Hess Wed, 3 Jan 2001 10:18:38 -0800 @@ -6226,7 +6813,7 @@ debhelper (2.2.8) unstable; urgency=medium - * dh_installwm: Moved update-alternatives --remove call to prerm, + * dh_installwm: Moved update-alternatives --remove call to prerm, Closes: #80209 * ALso guarded all update-alternatives --remove calls. @@ -6261,7 +6848,7 @@ * If DH_COMPAT=3 is set, the following happens: - Various debian/foo files like debian/docs, debian/examples, etc, begin to support filename globbing. use \* to escape the wildcards of - course. I doubt this will bite anyone (Debian doesn't seem to contain + course. I doubt this will bite anyone (Debian doesn't seem to contain files with "*" or "?" in their names..), but it is guarded by v3 just to be sure. Closes: #34120, #37694, #39846, #46249 @@ -6290,7 +6877,7 @@ * DH_COMPAT=3 now enables the following new features which I can't just turn on by default for fear of breaking backwards compatibility: - dh_makeshlibs makes the postinst/postrm call ldconfig. Closes: #77154 - Patch from Masato Taruishi (modified). If you + Patch from Masato Taruishi (modified). If you use this, be sure dh_makeshlibs runs before dh_installdeb; many old rules files have the ordering backwards. - dh_installdeb now causes all files in /etc to be registered as @@ -6405,7 +6992,7 @@ debhelper (2.1.16) unstable; urgency=low - * dh_movefiles: fixed a regexp quoting problem with --sourcedir. + * dh_movefiles: fixed a regexp quoting problem with --sourcedir. Closes: #75434 * Whoops, I think I overwrote bod's NMU with 2.2.15. Let's merge those in: @@ -6654,7 +7241,7 @@ debhelper (2.0.92) unstable; urgency=low - * Detect changelog parse failures and use a better error message. + * Detect changelog parse failures and use a better error message. Closes: #62058 -- Joey Hess Sat, 8 Apr 2000 20:02:16 -0700 @@ -6684,7 +7271,7 @@ * dh_installwm now behaves like a proper debhelper command, and reads debian/.wm too. This is a small behavior change; filenames specified on the command line no longer apply to all packages it acts - on. I can't belive this program existed for 2 years with such a glaring + on. I can't believe this program existed for 2 years with such a glaring problem; I guess most people don't need ot register 5 wm's in 3 sub-packages. Anyway, it can handle such things now. :-) * Moved Dh_*.pm to /usr/lib/perl5/Debian/Debhelper. *big* change. @@ -6712,7 +7299,7 @@ debhelper (2.0.85) unstable; urgency=low - * Downgraded fileutils dependancy just a bit for the Hurd foks. + * Downgraded fileutils dependancy just a bit for the Hurd foks. Closes: #54620 -- Joey Hess Mon, 10 Jan 2000 16:41:29 -0800 @@ -6740,7 +7327,7 @@ debhelper (2.0.81) unstable; urgency=low - * dh_installxaw: Patch from Josip Rodin to update to fhs paths, + * dh_installxaw: Patch from Josip Rodin to update to fhs paths, Closes: #53029 -- Joey Hess Mon, 20 Dec 1999 12:21:34 -0800 @@ -6771,7 +7358,7 @@ link, and then removing its suid bit. This messed up the registration of the other had links, since their permissions were now changed, leading to unpredictable results. The fix is to just not remove suid - bits until all files have been registered. + bits until all files have been registered. -- Joey Hess Tue, 30 Nov 1999 00:26:42 -0800 @@ -6779,20 +7366,20 @@ * dh_installmanpages: - Added support for translated man pages, with a patch from Kis Gergely - . Closes: #51268 - - Fixed the undefined value problem in Kis's patch. - - This also Closes: #37092 come to think of it. + . Closes: #51268 + - Fixed the undefined value problem in Kis's patch. + - This also Closes: #37092 come to think of it. * dh_shlibdeps, dh_shlibdeps.1: - Added -X option, which makes it not examine some files. This is - useful in rare cases. Closes: #51100 + useful in rare cases. Closes: #51100 - Always pass "-dDepends" before the list of files, which makes it easier to specify other -d parameters in the uparams, and doesn't - otherwise change the result at all. + otherwise change the result at all. * doc/TODO: - dh_installdebfiles is no longer a part of debhelper. This affects exactly one package in unstable, biss-awt, which has had a bug filed against it for 200+ days now asking that it stop using the program. - dh_installdebfiles has been depreacted for nearly 2 years now.. + dh_installdebfiles has been depreacted for nearly 2 years now.. * This changelog was automatically generated from CVS commit information. Fear makechangelog. @@ -6810,7 +7397,7 @@ act on files that don't exist. * dh_installchangelogs: to comply with policy, if it's told to act on a html changelog, it installs it as changelog.html.gz and dumps a plain - text version to changelog.gz. The dumping is done with lynx. + text version to changelog.gz. The dumping is done with lynx. (Closes: #51099) * Dh_Getopt.pm: Modified it so any options specified after -- are added to U_PARAMS. This means that instead of passing '-u"something nasty"' to @@ -6945,7 +7532,7 @@ * dh_installdocs: if $TMP/usr/share/doc/$PACKAGE is a broken symlink, leaves it alone, assumming that the maintainer knows what they're doing - and is probably linking to the doc dir of another package. + and is probably linking to the doc dir of another package. (Closes: #46183) -- Joey Hess Mon, 4 Oct 1999 16:27:28 -0700 @@ -7130,7 +7717,7 @@ debhelper (2.0.28) unstable; urgency=low - * Oops, dh_installpam was omitted from the package. Added back. + * Oops, dh_installpam was omitted from the package. Added back. Closes: #43652 -- Joey Hess Fri, 27 Aug 1999 19:16:38 -0700 @@ -7153,7 +7740,7 @@ debhelper (2.0.24) unstable; urgency=low - * dh_installdocs: Handle trailing whitespace after Document: name. + * dh_installdocs: Handle trailing whitespace after Document: name. Closes: #43148. -- Joey Hess Wed, 18 Aug 1999 10:23:17 -0700 @@ -7263,7 +7850,7 @@ debhelper (2.0.10) unstable; urgency=low * dh_compress: compress changelog.html files. (Closes: #40626) - * dh_installchangelogs: installs a link from changelog.html.gz to changelog.gz, + * dh_installchangelogs: installs a link from changelog.html.gz to changelog.gz, because I think it's important that upstream changelogs always be accessable at that name. * dh_compress: removed the usr/share/X11R6/man bit. Note part of FHS. @@ -7324,7 +7911,7 @@ debhelper (2.0.02) unstable; urgency=low - * If you're going to use v2, it's reccommended you call + * If you're going to use v2, it's reccommended you call "dh_testversion 2". Added a note about that to doc/v2. * Dh_Lib.pm compat: if a version that is greater than the highest supported compatibility level is specified, abort with an error. Perhaps @@ -7345,7 +7932,7 @@ * If DH_COMPAT=2, then debian/ will be used for the temporary build directory for all packages. debian/tmp is no more! (Well, except dh_movefiles still uses it.) - * debhelper.1: documented this. + * debhelper.1: documented this. * Dh_lib.pm: added compat(), pass in a number, it returns true if the current compatibility level is equal to that number. * doc/PROGRAMMING: documented that. @@ -7522,7 +8109,7 @@ debhelper (1.2.63) unstable; urgency=low * dh_installxaw: updated to work with xaw-wrappers 0.90 and above. It - actually has to partially parse the xaw-wrappers config files now. + actually has to partially parse the xaw-wrappers config files now. -- Joey Hess Sun, 2 May 1999 19:13:34 -0700 @@ -7584,7 +8171,7 @@ debhelper (1.2.54) unstable; urgency=low * dh_installinit.1: man page fixups (#34160). - * *.1: the date of each man page is now automatically updated when + * *.1: the date of each man page is now automatically updated when debhelper is built to be the last modification time of the man page. -- Joey Hess Thu, 8 Apr 1999 20:28:00 -0700 @@ -7707,7 +8294,7 @@ debhelper (1.2.37) unstable; urgency=low * dh_installdocs: Patch from Jim Pick , fixes regexp error (Closes: #33431). - * dh_installxaw: new program by Daniel Martin + * dh_installxaw: new program by Daniel Martin , handles xaw-wrappers integration. * dh_installxaw.1: wrote man page. @@ -7722,7 +8309,7 @@ debhelper (1.2.35) unstable; urgency=low - * Dh_Lib.pm filearray(): Deal with multiple spaces and spaces at the + * Dh_Lib.pm filearray(): Deal with multiple spaces and spaces at the beginning of lines in files. (closes: #33161) -- Joey Hess Tue, 9 Feb 1999 21:01:07 -0800 @@ -7879,7 +8466,7 @@ * dh_makeshlibs: relaxed regexp to find library name and number a little so it will work on libraries with a major but no minor version in their filename (examples of such: libtcl8.0.so.1, libBLT-unoff.so.1) - * dh_movefiles: added --sourcedir option to make it move files out of + * dh_movefiles: added --sourcedir option to make it move files out of some directory besides debian/tmp (#30221) -- Joey Hess Fri, 4 Dec 1998 13:56:57 -0800 @@ -7971,7 +8558,7 @@ * The perl conversion is complete. . - * dh_compress: perlized (yay, perl has readlink, no more ls -l | awk + * dh_compress: perlized (yay, perl has readlink, no more ls -l | awk garbage!) * dh_lib, dh_getopt.pl: deleted, nothing uses them anymore. * debian/rules: don't install above 2 files. @@ -8076,7 +8663,7 @@ debhelper (1.1.19) unstable; urgency=low * dh_installmanpages: look at basename of man pacges specified on command - line to skip, for backwards compatibility. + line to skip, for backwards compatibility. -- Joey Hess Thu, 10 Sep 1998 11:31:42 -0700 @@ -8104,14 +8691,14 @@ debhelper (1.1.16) unstable; urgency=low - * dh_fixperms: remove execute bits from static libraries as well as + * dh_fixperms: remove execute bits from static libraries as well as shared libraries. (#26414) -- Joey Hess Fri, 4 Sep 1998 14:46:37 -0700 debhelper (1.1.15) unstable; urgency=medium - * dh_installmanpages: the new perl version had a nasty habit of + * dh_installmanpages: the new perl version had a nasty habit of installing .so.x library files as man pages. Fixed. * dh_installmanpages: the code to exclude searching for man pages in debian/tmp directories was broken. Fixed. @@ -8235,7 +8822,7 @@ * Made all perl code work with use strict and -w (well, except dh_getopt.pl, but that's a hack that'll go away one day). * I didn't realize, but rewriting dh_installdocs in perl fixed bug #24686 - (blank lines in debian/docs file problem), although this same problem + (blank lines in debian/docs file problem), although this same problem applies to other debhelper programs... like dh_installexamples, which had the same bug fixed when I rewrote it in perl just now. * Dh_Lib.pm: accidentially didn't check DH_VERBOSE if commands were not @@ -8283,7 +8870,7 @@ debhelper (1.1.0) unstable; urgency=low * New unstable branch of debhelper. - + * TODO: list all current bugs, in order I plan to tackle them. * Added debhelper.1 man page, which groups all the debhelper options that are common to all commands in once place so I can add new options w/o @@ -8291,7 +8878,7 @@ * dh_*.1: updated all debheper man pages to refer to debhelper(1) where appropriate. Also corrected a host of little errors. * doc/README: moved a lot of this file into debhelper.1. - * dh_*: -N option now excludes a package from the list of packages the + * dh_*: -N option now excludes a package from the list of packages the programs act on. (#25247) -- Joey Hess Sat, 8 Aug 1998 17:49:56 -0700 @@ -8299,7 +8886,7 @@ debhelper (1.0) stable unstable; urgency=low * 1.0 at last! - + * This relelase is not really intended for stable. I throw a copy into stable-updates because I want it to be available as an upgrade for people using debian 2.0 (the current version in debian 2.0 has no @@ -8360,10 +8947,10 @@ debhelper (0.97) unstable; urgency=low * doc/from-debstd: fixed a typo. - * examples/*: install-stamp no longer depends on phony build targey; now + * examples/*: install-stamp no longer depends on phony build targey; now install-stamp depends on build-stamp instead (#24234). * dh_fixperms: applied patch from Herbert Xu - to fix bad uses of the find command, so it should now work on packages + to fix bad uses of the find command, so it should now work on packages with files with spaces in them (#22005). It's also much cleaner. Thanks, Herbert! * dh_getopt.pl, doc/PROGRAMMING: added DH_EXCLUDE_FIND, to make the above @@ -8388,7 +8975,7 @@ debhelper (0.94) unstable; urgency=low - * dh_md5sums: fixed so it handles spaces and other odd characters in + * dh_md5sums: fixed so it handles spaces and other odd characters in filenames correctly. (#23046, #23700, #22010) * As a side effect, got rid of the nasty temporary file dh_md5sums used before. @@ -8430,7 +9017,7 @@ output the sequence of debhelper commands that approximate what debstd would do in the same situation. * dh_debstd is completly untested, I don't have the source to any packages - that use debstd available. Once this is tested, I plan to release + that use debstd available. Once this is tested, I plan to release debhelper 1.0! * Added a from-debstd document that gives a recipe to convert from debstd to debhelper. @@ -8438,7 +9025,7 @@ permissions changed. * dh_testroot: test for uid == 0, instead of username == root, becuase some people enjoy changing root's name. - * dh_installinit: handle debian/init.d as well as debian/init files, + * dh_installinit: handle debian/init.d as well as debian/init files, for backwards compatibility with debstd. Unlike with debstd, the two files are treated identically. * dh_lib, PROGRAMMING: added "warning" function. @@ -8514,7 +9101,7 @@ * Moved under cvs (so I can fork a stable and an unstable version). * dh_movefiles: first move real files, then move symlinks. (#18220) - Thanks to Bdale Garbee and Adam Heath + Thanks to Bdale Garbee and Adam Heath for help on the implementation. * dh_installchangelogs: use debian/package.changelog files if they exist rather than debian/changelog. It appears some people do need per-package @@ -8648,8 +9235,8 @@ debian-policy that du control files are bad. * examples/*: removed dh_du calls. * debian/rules: removed dh_du call. - * Modified dh_gencontrol, dh_makeshlibs, and dh_md5sums to generate files - with the correct permissions even if the umask is set to unusual + * Modified dh_gencontrol, dh_makeshlibs, and dh_md5sums to generate files + with the correct permissions even if the umask is set to unusual values. (#18283) -- Joey Hess Mon, 16 Feb 1998 23:34:36 -0800 @@ -8858,7 +9445,7 @@ * A side effect of this (of interest only to the debhelper programmer) is that doit() can no longer handle complex commands now. (ie, pipes, `;', `&', etc separating multiple commands, or redirection) - * dh_makeshlibs, dh_md5sums, dh_installdebfiles, dh_du, dh_clean, + * dh_makeshlibs, dh_md5sums, dh_installdebfiles, dh_du, dh_clean, dh_installdirs: don't pass complex commands to doit(). -- Joey Hess Thu, 4 Dec 1997 13:56:14 -0500 @@ -8934,7 +9521,7 @@ debhelper (0.18) unstable; urgency=low * examples/*: added source, diff targets that just print an error. - * dh_clean: clean up more files - *.orig, *.rej, *.bak, .*.orig, .*.rej, + * dh_clean: clean up more files - *.orig, *.rej, *.bak, .*.orig, .*.rej, .SUMS, TAGS, and empty files. * dh_lib: doit(): use eval on parameters, instead of directly running them. This lets me clean up several nasty areas where I had to echo the @@ -8952,14 +9539,14 @@ debhelper (0.16) unstable; urgency=low - * dh_compress: always compress changelog and upstream changelog, no + * dh_compress: always compress changelog and upstream changelog, no matter what their size (#14604) (policy 5.8) -- Joey Hess Thu, 6 Nov 1997 19:50:36 -0500 debhelper (0.15) unstable; urgency=low - * README: documented what temporary directories are used by default for + * README: documented what temporary directories are used by default for installing package files into. * dh_*: added -P flag, to let a different package build directory be specified. @@ -9078,7 +9665,7 @@ * dh_clean: allow specification of additional files to remove as parameters. * dh_compress: fixed it to not compress doc/package/copyright - * dh_installmanpage: allow listing of man pages that should not be + * dh_installmanpage: allow listing of man pages that should not be auto-installed as parameters. * dh_installdebfiles: make sure all installed files have proper ownerships and permissions. diff -Nru debhelper-9.20160115ubuntu3/debian/compat debhelper-11ubuntu1~16.04.york0/debian/compat --- debhelper-9.20160115ubuntu3/debian/compat 2015-11-02 20:30:42.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/debian/compat 2017-11-28 12:40:27.000000000 +0000 @@ -1 +1 @@ -10 +12 diff -Nru debhelper-9.20160115ubuntu3/debian/control debhelper-11ubuntu1~16.04.york0/debian/control --- debhelper-9.20160115ubuntu3/debian/control 2016-01-19 18:54:31.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/debian/control 2018-01-26 10:06:03.000000000 +0000 @@ -3,21 +3,48 @@ Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debhelper Maintainers -Uploaders: Niels Thykier , Bernhard R. Link , Tianon Gravi -Build-Depends: po4a (>= 0.24), dpkg-dev (>= 1.18.0~) -Standards-Version: 3.9.6 -Vcs-Git: git://anonscm.debian.org/debhelper/debhelper.git -Vcs-Browser: https://anonscm.debian.org/cgit/debhelper/debhelper.git +Uploaders: Niels Thykier , + Bernhard R. Link +Build-Depends: dpkg-dev (>= 1.17), + perl, + po4a +Standards-Version: 4.1.2 +Testsuite: autopkgtest-pkg-perl +Vcs-Git: https://anonscm.debian.org/git/debhelper/debhelper.git +Vcs-Browser: https://anonscm.debian.org/git/debhelper/debhelper.git Package: debhelper Architecture: all -Depends: ${perl:Depends}, ${misc:Depends}, file (>= 3.23), dpkg (>= 1.16.2), dpkg-dev (>= 1.18.2~), binutils, po-debconf, man-db (>= 2.5.1-1), libdpkg-perl (>= 1.17.14), dh-strip-nondeterminism, autotools-dev -Suggests: dh-make +Depends: autotools-dev, + binutils, + dh-autoreconf (>= 12~), + dh-strip-nondeterminism (>= 0.028~), + dpkg (>= 1.16.2~), + dpkg-dev (>= 1.17), + file (>= 3.23), + libdpkg-perl (>= 1.17), + man-db, + po-debconf, + ${misc:Depends}, + ${perl:Depends} +Breaks: dh-systemd (<< 1.38) +Replaces: dh-systemd (<< 1.38), pkg-create-dbgsym +Conflicts: pkg-create-dbgsym +Suggests: dh-make, dwz Multi-Arch: foreign Description: helper programs for debian/rules A collection of programs that can be used in a debian/rules file to - automate common tasks related to building debian packages. Programs - are included to install various files into your package, compress - files, fix file permissions, integrate your package with the debian - menu system, debconf, doc-base, etc. Most debian packages use debhelper + automate common tasks related to building Debian packages. Programs + are included to install various files into your package, compress + files, fix file permissions, integrate your package with the Debian + menu system, debconf, doc-base, etc. Most Debian packages use debhelper as part of their build process. + +Package: dh-systemd +Section: oldlibs +Architecture: all +Multi-Arch: foreign +Depends: debhelper (>= 9.20160709), + ${misc:Depends}, +Description: debhelper add-on to handle systemd unit files - transitional package + This package is for transitional purposes and can be removed safely. diff -Nru debhelper-9.20160115ubuntu3/debian/copyright debhelper-11ubuntu1~16.04.york0/debian/copyright --- debhelper-9.20160115ubuntu3/debian/copyright 2016-01-10 11:06:37.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/debian/copyright 2017-11-28 12:40:27.000000000 +0000 @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Files: * Copyright: 1997-2011 Joey Hess @@ -10,7 +10,7 @@ License: public-domain These files are in the public domain. . - Pedants who belive I cannot legally say that code I have written is in + Pedants who believe I cannot legally say that code I have written is in the public domain may consider them instead to be licensed as follows: . Redistribution and use in source and binary forms, with or without @@ -24,10 +24,6 @@ Copyright: Adam Di Carlo License: GPL-2+ -Files: dh_scrollkeeper -Copyright: Ross Burton -License: GPL-2+ - Files: dh_usrlocal Copyright: Andrew Stribblehill License: GPL-2+ @@ -66,11 +62,15 @@ Copyright: 2011 Jeroen Schot License: GPL-2+ -Files: Debian/Debhelper/Buildsystem* Debian/Debhelper/Dh_Buildsystems.pm +Files: dh_systemd_enable dh_systemd_start +Copyright: 2013 Michael Stapelberg +License: BSD-3-clause + +Files: lib/Debian/Debhelper/Buildsystem* lib/Debian/Debhelper/Dh_Buildsystems.pm Copyright: 2008-2009 Modestas Vainius License: GPL-2+ -Files: Debian/Debhelper/Buildsystem/qmake.pm +Files: lib/Debian/Debhelper/Buildsystem/qmake.pm Copyright: 2010 Kel Modderman License: GPL-2+ @@ -94,3 +94,30 @@ The full text of the GPL version 3 is distributed in /usr/share/common-licenses/GPL-3 on Debian systems. +License: BSD-3-clause + All rights reserved. + . + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + . + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + . + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + . + * Neither the name of Michael Stapelberg nor the + names of contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY Michael Stapelberg ''AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL Michael Stapelberg BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -Nru debhelper-9.20160115ubuntu3/debian/rules debhelper-11ubuntu1~16.04.york0/debian/rules --- debhelper-9.20160115ubuntu3/debian/rules 2016-01-10 10:52:15.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/debian/rules 2017-11-28 12:40:27.000000000 +0000 @@ -1,10 +1,20 @@ #!/usr/bin/make -f # If you're looking for an example debian/rules that uses debhelper, see # the examples directory. -# +# # Each debhelper command in this rules file has to be run using ./run, # to ensure that the commands and libraries in the source tree are used, # rather than the installed ones. +# +# We disable autoreconf to avoid build-depending on it (it does +# nothing for debhelper and it keeps the set of B-D smaller) %: - ./run dh $@ + ./run dh $@ --without autoreconf --with build-stamp + +# Disable as they are unneeded (and we can then be sure debhelper +# builds without needing autotools-dev, dh-strip-nondetermism etc.) +override_dh_update_autotools_config override_dh_strip_nondeterminism: + +override_dh_auto_install: + ./run dh_auto_install --destdir=debian/debhelper diff -Nru debhelper-9.20160115ubuntu3/debian/tests/pkg-perl/skip-syntax debhelper-11ubuntu1~16.04.york0/debian/tests/pkg-perl/skip-syntax --- debhelper-9.20160115ubuntu3/debian/tests/pkg-perl/skip-syntax 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/debian/tests/pkg-perl/skip-syntax 2017-11-28 12:40:27.000000000 +0000 @@ -0,0 +1 @@ +Dummy/Entry.pm diff -Nru debhelper-9.20160115ubuntu3/debian/tests/pkg-perl/smoke-files debhelper-11ubuntu1~16.04.york0/debian/tests/pkg-perl/smoke-files --- debhelper-9.20160115ubuntu3/debian/tests/pkg-perl/smoke-files 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/debian/tests/pkg-perl/smoke-files 2017-11-28 12:40:27.000000000 +0000 @@ -0,0 +1,4 @@ +t/ +debian/compat +debian/control +debian/changelog diff -Nru debhelper-9.20160115ubuntu3/debian/tests/pkg-perl/smoke-skip debhelper-11ubuntu1~16.04.york0/debian/tests/pkg-perl/smoke-skip --- debhelper-9.20160115ubuntu3/debian/tests/pkg-perl/smoke-skip 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/debian/tests/pkg-perl/smoke-skip 2017-11-28 12:40:27.000000000 +0000 @@ -0,0 +1,5 @@ +# If we set the path to /usr/bin when run under autopkgtest, +# other dh_* commands are tested as well. This might be nice +# or not but it currently fails for dh_autotools-dev_updateconfig. +# So let's skip t/size.t for now. +t/size.t diff -Nru debhelper-9.20160115ubuntu3/debian/tests/pkg-perl/use-name debhelper-11ubuntu1~16.04.york0/debian/tests/pkg-perl/use-name --- debhelper-9.20160115ubuntu3/debian/tests/pkg-perl/use-name 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/debian/tests/pkg-perl/use-name 2017-11-28 12:40:27.000000000 +0000 @@ -0,0 +1 @@ +Debian::Debhelper::Dh_Lib diff -Nru debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem/ant.pm debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem/ant.pm --- debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem/ant.pm 2015-07-01 17:17:30.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem/ant.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -# A debhelper build system class for handling Ant based projects. -# -# Copyright: © 2009 Joey Hess -# License: GPL-2+ - -package Debian::Debhelper::Buildsystem::ant; - -use strict; -use warnings; -use parent qw(Debian::Debhelper::Buildsystem); - -sub DESCRIPTION { - "Ant (build.xml)" -} - -sub check_auto_buildable { - my $this=shift; - return (-e $this->get_sourcepath("build.xml")) ? 1 : 0; -} - -sub new { - my $class=shift; - my $this=$class->SUPER::new(@_); - $this->enforce_in_source_building(); - return $this; -} - -sub build { - my $this=shift; - my $d_ant_prop = $this->get_sourcepath('debian/ant.properties'); - my @args; - if ( -f $d_ant_prop ) { - push(@args, '-propertyfile', $d_ant_prop); - } - $this->doit_in_sourcedir("ant", @args, @_); -} - -sub clean { - my $this=shift; - my $d_ant_prop = $this->get_sourcepath('debian/ant.properties'); - my @args; - if ( -f $d_ant_prop ) { - push(@args, '-propertyfile', $d_ant_prop); - } - $this->doit_in_sourcedir("ant", @args, "clean", @_); -} - -1 - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem/autoconf.pm debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem/autoconf.pm --- debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem/autoconf.pm 2016-01-10 10:01:54.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem/autoconf.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -# A debhelper build system class for handling Autoconf based projects -# -# Copyright: © 2008 Joey Hess -# © 2008-2009 Modestas Vainius -# License: GPL-2+ - -package Debian::Debhelper::Buildsystem::autoconf; - -use strict; -use warnings; -use Debian::Debhelper::Dh_Lib qw(dpkg_architecture_value sourcepackage compat); -use parent qw(Debian::Debhelper::Buildsystem::makefile); - -sub DESCRIPTION { - "GNU Autoconf (configure)" -} - -sub check_auto_buildable { - my $this=shift; - my ($step)=@_; - - # Handle configure; the rest - next class (compat with 7.0.x code path) - if ($step eq "configure") { - return 1 if -x $this->get_sourcepath("configure"); - } - return 0; -} - -sub configure { - my $this=shift; - - # Standard set of options for configure. - my @opts; - push @opts, "--build=" . dpkg_architecture_value("DEB_BUILD_GNU_TYPE"); - push @opts, "--prefix=/usr"; - push @opts, "--includedir=\${prefix}/include"; - push @opts, "--mandir=\${prefix}/share/man"; - push @opts, "--infodir=\${prefix}/share/info"; - push @opts, "--sysconfdir=/etc"; - push @opts, "--localstatedir=/var"; - if (defined $ENV{DH_QUIET} && $ENV{DH_QUIET} ne "") { - push @opts, "--enable-silent-rules"; - } else { - push @opts, "--disable-silent-rules"; - } - my $multiarch=dpkg_architecture_value("DEB_HOST_MULTIARCH"); - if (! compat(8)) { - if (defined $multiarch) { - push @opts, "--libdir=\${prefix}/lib/$multiarch"; - push @opts, "--libexecdir=\${prefix}/lib/$multiarch"; - } - else { - push @opts, "--libexecdir=\${prefix}/lib"; - } - } - else { - push @opts, "--libexecdir=\${prefix}/lib/" . sourcepackage(); - } - push @opts, "--disable-maintainer-mode"; - push @opts, "--disable-dependency-tracking"; - # Provide --host only if different from --build, as recommended in - # autotools-dev README.Debian: When provided (even if equal) - # autoconf 2.52+ switches to cross-compiling mode. - if (dpkg_architecture_value("DEB_BUILD_GNU_TYPE") - ne dpkg_architecture_value("DEB_HOST_GNU_TYPE")) { - push @opts, "--host=" . dpkg_architecture_value("DEB_HOST_GNU_TYPE"); - } - - $this->mkdir_builddir(); - eval { - $this->doit_in_builddir($this->get_source_rel2builddir("configure"), @opts, @_); - }; - if ($@) { - if (-e $this->get_buildpath("config.log")) { - $this->doit_in_builddir("tail -v -n +0 config.log"); - } - die $@; - } -} - -1 - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem/cmake.pm debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem/cmake.pm --- debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem/cmake.pm 2015-11-06 21:22:08.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem/cmake.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,114 +0,0 @@ -# A debhelper build system class for handling CMake based projects. -# It prefers out of source tree building. -# -# Copyright: © 2008-2009 Modestas Vainius -# License: GPL-2+ - -package Debian::Debhelper::Buildsystem::cmake; - -use strict; -use warnings; -use Debian::Debhelper::Dh_Lib qw(compat dpkg_architecture_value error is_cross_compiling); -use parent qw(Debian::Debhelper::Buildsystem::makefile); - -my @STANDARD_CMAKE_FLAGS = qw( - -DCMAKE_INSTALL_PREFIX=/usr - -DCMAKE_VERBOSE_MAKEFILE=ON - -DCMAKE_BUILD_TYPE=None - -DCMAKE_INSTALL_SYSCONFDIR=/etc - -DCMAKE_INSTALL_LOCALSTATEDIR=/var -); - -my %DEB_HOST2CMAKE_SYSTEM = ( - 'linux' => 'Linux', - 'kfreebsd' => 'FreeBSD', - 'hurd' => 'GNU', -); - -sub DESCRIPTION { - "CMake (CMakeLists.txt)" -} - -sub check_auto_buildable { - my $this=shift; - my ($step)=@_; - if (-e $this->get_sourcepath("CMakeLists.txt")) { - my $ret = ($step eq "configure" && 1) || - $this->SUPER::check_auto_buildable(@_); - # Existence of CMakeCache.txt indicates cmake has already - # been used by a prior build step, so should be used - # instead of the parent makefile class. - $ret++ if ($ret && -e $this->get_buildpath("CMakeCache.txt")); - return $ret; - } - return 0; -} - -sub new { - my $class=shift; - my $this=$class->SUPER::new(@_); - $this->prefer_out_of_source_building(@_); - return $this; -} - -sub configure { - my $this=shift; - # Standard set of cmake flags - my @flags = @STANDARD_CMAKE_FLAGS; - - if (is_cross_compiling()) { - my $deb_host = dpkg_architecture_value("DEB_HOST_ARCH_OS"); - if (my $cmake_system = $DEB_HOST2CMAKE_SYSTEM{$deb_host}) { - push(@flags, "-DCMAKE_SYSTEM_NAME=${cmake_system}"); - } else { - error("Cannot cross-compile - CMAKE_SYSTEM_NAME not known for ${deb_host}"); - } - push @flags, "-DCMAKE_SYSTEM_PROCESSOR=" . dpkg_architecture_value("DEB_HOST_GNU_CPU"); - if ($ENV{CC}) { - push @flags, "-DCMAKE_C_COMPILER=" . $ENV{CC}; - } else { - push @flags, "-DCMAKE_C_COMPILER=" . dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "-cc"; - } - if ($ENV{CXX}) { - push @flags, "-DCMAKE_CXX_COMPILER=" . $ENV{CXX}; - } else { - push @flags, "-DCMAKE_CXX_COMPILER=" . dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "-c++"; - } - } - - # CMake doesn't respect CPPFLAGS, see #653916. - if ($ENV{CPPFLAGS} && ! compat(8)) { - $ENV{CFLAGS} .= ' ' . $ENV{CPPFLAGS}; - $ENV{CXXFLAGS} .= ' ' . $ENV{CPPFLAGS}; - } - - $this->mkdir_builddir(); - eval { - $this->doit_in_builddir("cmake", $this->get_source_rel2builddir(), @flags, @_); - }; - if (my $err = $@) { - if (-e $this->get_buildpath("CMakeCache.txt")) { - $this->doit_in_builddir("tail -v -n +0 CMakeCache.txt"); - } - die $err; - } -} - -sub test { - my $this=shift; - - # Unlike make, CTest does not have "unlimited parallel" setting (-j implies - # -j1). So in order to simulate unlimited parallel, allow to fork a huge - # number of threads instead. - my $parallel = ($this->get_parallel() > 0) ? $this->get_parallel() : 999; - $ENV{CTEST_OUTPUT_ON_FAILURE} = 1; - return $this->SUPER::test(@_, "ARGS+=-j$parallel"); -} - -1 - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem/makefile.pm debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem/makefile.pm --- debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem/makefile.pm 2015-07-01 17:17:30.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem/makefile.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,159 +0,0 @@ -# A debhelper build system class for handling simple Makefile based projects. -# -# Copyright: © 2008 Joey Hess -# © 2008-2009 Modestas Vainius -# License: GPL-2+ - -package Debian::Debhelper::Buildsystem::makefile; - -use strict; -use warnings; -use Debian::Debhelper::Dh_Lib qw(escape_shell clean_jobserver_makeflags); -use parent qw(Debian::Debhelper::Buildsystem); - -# make makes things difficult by not providing a simple way to test -# whether a Makefile target exists. Using -n and checking for a nonzero -# exit status is not good enough, because even with -n, make will -# run commands needed to eg, generate include files -- and those commands -# could fail even though the target exists -- and we should let the target -# run and propagate any failure. -# -# Using -n and checking for at least one line of output is better. -# That will indicate make either wants to run one command, or -# has output a "nothing to be done" message if the target exists but is a -# noop. -# -# However, that heuristic is also not good enough, because a Makefile -# could run code that outputs something, even though the -n is asking -# it not to run anything. (Again, done for includes.) To detect this false -# positive, there is unfortunately only one approach left: To -# look for the error message printed by make when a target does not exist. -# -# This could break if make's output changes. It would only break a minority -# of packages where this latter test is needed. The best way to avoid that -# problem would be to fix make to have this simple and highly useful -# missing feature. -# -# A final option would be to use -p and parse the output data base. -# It's more practical for dh to use that method, since it operates on -# only special debian/rules files, and not arbitrary Makefiles which -# can be arbitrarily complicated, use implicit targets, and so on. -sub exists_make_target { - my $this=shift; - my $target=shift; - - my @opts=("-s", "-n", "--no-print-directory"); - my $buildpath = $this->get_buildpath(); - unshift @opts, "-C", $buildpath if $buildpath ne "."; - - my $pid = open(MAKE, "-|"); - defined($pid) || die "can't fork: $!"; - if (! $pid) { - open(STDERR, ">&STDOUT"); - $ENV{LC_ALL}='C'; - exec($this->{makecmd}, @opts, $target, @_); - exit(1); - } - - local $/=undef; - my $output=; - chomp $output; - close MAKE; - - return defined $output - && length $output - && $output !~ /\*\*\* No rule to make target (`|')\Q$target\E'/; -} - -sub do_make { - my $this=shift; - - # Avoid possible warnings about unavailable jobserver, - # and force make to start a new jobserver. - clean_jobserver_makeflags(); - - # Note that this will override any -j settings in MAKEFLAGS. - unshift @_, "-j" . ($this->get_parallel() > 0 ? $this->get_parallel() : ""); - - $this->doit_in_builddir($this->{makecmd}, @_); -} - -sub make_first_existing_target { - my $this=shift; - my $targets=shift; - - foreach my $target (@$targets) { - if ($this->exists_make_target($target, @_)) { - $this->do_make($target, @_); - return $target; - } - } - return undef; -} - -sub DESCRIPTION { - "simple Makefile" -} - -sub new { - my $class=shift; - my $this=$class->SUPER::new(@_); - $this->{makecmd} = (exists $ENV{MAKE}) ? $ENV{MAKE} : "make"; - return $this; -} - -sub check_auto_buildable { - my $this=shift; - my ($step) = @_; - - if (-e $this->get_buildpath("Makefile") || - -e $this->get_buildpath("makefile") || - -e $this->get_buildpath("GNUmakefile")) - { - # This is always called in the source directory, but generally - # Makefiles are created (or live) in the build directory. - return 1; - } elsif ($step eq "clean" && defined $this->get_builddir() && - $this->check_auto_buildable("configure")) - { - # Assume that the package can be cleaned (i.e. the build directory can - # be removed) as long as it is built out-of-source tree and can be - # configured. This is useful for derivative buildsystems which - # generate Makefiles. - return 1; - } - return 0; -} - -sub build { - my $this=shift; - $this->do_make(@_); -} - -sub test { - my $this=shift; - $this->make_first_existing_target(['test', 'check'], @_); -} - -sub install { - my $this=shift; - my $destdir=shift; - $this->make_first_existing_target(['install'], - "DESTDIR=$destdir", - "AM_UPDATE_INFO_DIR=no", @_); -} - -sub clean { - my $this=shift; - if (!$this->rmdir_builddir()) { - $this->make_first_existing_target(['distclean', 'realclean', 'clean'], @_); - } -} - -1 - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem/perl_build.pm debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem/perl_build.pm --- debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem/perl_build.pm 2015-07-01 17:17:30.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem/perl_build.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,84 +0,0 @@ -# A build system class for handling Perl Build based projects. -# -# Copyright: © 2008-2009 Joey Hess -# © 2008-2009 Modestas Vainius -# License: GPL-2+ - -package Debian::Debhelper::Buildsystem::perl_build; - -use strict; -use warnings; -use Debian::Debhelper::Dh_Lib qw(compat); -use parent qw(Debian::Debhelper::Buildsystem); -use Config; - -sub DESCRIPTION { - "Perl Module::Build (Build.PL)" -} - -sub check_auto_buildable { - my ($this, $step) = @_; - - # Handles everything - my $ret = -e $this->get_sourcepath("Build.PL"); - if ($step ne "configure") { - $ret &&= -e $this->get_sourcepath("Build"); - } - return $ret ? 1 : 0; -} - -sub do_perl { - my $this=shift; - $this->doit_in_sourcedir("perl", @_); -} - -sub new { - my $class=shift; - my $this= $class->SUPER::new(@_); - $this->enforce_in_source_building(); - return $this; -} - -sub configure { - my $this=shift; - my @flags; - $ENV{PERL_MM_USE_DEFAULT}=1; - if ($ENV{CFLAGS} && ! compat(8)) { - push @flags, "--config", "optimize=$ENV{CFLAGS} $ENV{CPPFLAGS}"; - } - if ($ENV{LDFLAGS} && ! compat(8)) { - push @flags, "--config", "ld=$Config{ld} $ENV{CFLAGS} $ENV{LDFLAGS}"; - } - $this->do_perl("Build.PL", "--installdirs", "vendor", @flags, @_); -} - -sub build { - my $this=shift; - $this->do_perl("Build", @_); -} - -sub test { - my $this=shift; - $this->do_perl("Build", "test", "--verbose", 1, @_); -} - -sub install { - my $this=shift; - my $destdir=shift; - $this->do_perl("Build", "install", "--destdir", "$destdir", "--create_packlist", 0, @_); -} - -sub clean { - my $this=shift; - if (-e $this->get_sourcepath("Build")) { - $this->do_perl("Build", "realclean", "--allow_mb_mismatch", 1, @_); - } -} - -1 - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem/perl_makemaker.pm debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem/perl_makemaker.pm --- debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem/perl_makemaker.pm 2015-07-01 17:17:30.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem/perl_makemaker.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,93 +0,0 @@ -# A debhelper build system class for handling Perl MakeMaker based projects. -# -# Copyright: © 2008-2009 Joey Hess -# © 2008-2009 Modestas Vainius -# License: GPL-2+ - -package Debian::Debhelper::Buildsystem::perl_makemaker; - -use strict; -use warnings; -use Debian::Debhelper::Dh_Lib qw(compat); -use parent qw(Debian::Debhelper::Buildsystem::makefile); -use Config; - -sub DESCRIPTION { - "Perl ExtUtils::MakeMaker (Makefile.PL)" -} - -sub check_auto_buildable { - my $this=shift; - my ($step)=@_; - - # Handles everything if Makefile.PL exists. Otherwise - next class. - if (-e $this->get_sourcepath("Makefile.PL")) { - if ($step eq "configure") { - return 1; - } - else { - return $this->SUPER::check_auto_buildable(@_); - } - } - return 0; -} - -sub new { - my $class=shift; - my $this=$class->SUPER::new(@_); - $this->enforce_in_source_building(); - return $this; -} - -sub configure { - my $this=shift; - my @flags; - # If set to a true value then MakeMaker's prompt function will - # # always return the default without waiting for user input. - $ENV{PERL_MM_USE_DEFAULT}=1; - # This prevents Module::Install from interactive behavior. - $ENV{PERL_AUTOINSTALL}="--skipdeps"; - - if ($ENV{CFLAGS} && ! compat(8)) { - push @flags, "OPTIMIZE=$ENV{CFLAGS} $ENV{CPPFLAGS}"; - } - if ($ENV{LDFLAGS} && ! compat(8)) { - push @flags, "LD=$Config{ld} $ENV{CFLAGS} $ENV{LDFLAGS}"; - } - - $this->doit_in_sourcedir("perl", "Makefile.PL", "INSTALLDIRS=vendor", - # if perl_build is not tested first, need to pass packlist - # option to handle fallthrough case - (compat(7) ? "create_packlist=0" : ()), - @flags, @_); -} - -sub test { - my $this=shift; - # Make tests verbose - $this->SUPER::test("TEST_VERBOSE=1", @_); -} - -sub install { - my $this=shift; - my $destdir=shift; - - # Special case for Makefile.PL that uses - # Module::Build::Compat. PREFIX should not be passed - # for those; it already installs into /usr by default. - my $makefile=$this->get_sourcepath("Makefile"); - if (system(qq{grep -q "generated automatically by MakeMaker" $makefile}) != 0) { - $this->SUPER::install($destdir, @_); - } - else { - $this->SUPER::install($destdir, "PREFIX=/usr", @_); - } -} - -1 - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem/python_distutils.pm debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem/python_distutils.pm --- debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem/python_distutils.pm 2015-07-01 17:17:30.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem/python_distutils.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,217 +0,0 @@ -# A debhelper build system class for building Python Distutils based -# projects. It prefers out of source tree building. -# -# Copyright: © 2008 Joey Hess -# © 2008-2009 Modestas Vainius -# License: GPL-2+ - -package Debian::Debhelper::Buildsystem::python_distutils; - -use strict; -use warnings; -use Cwd (); -use Debian::Debhelper::Dh_Lib qw(error); -use parent qw(Debian::Debhelper::Buildsystem); - -sub DESCRIPTION { - "Python Distutils (setup.py)" -} - -sub DEFAULT_BUILD_DIRECTORY { - my $this=shift; - return $this->canonpath($this->get_sourcepath("build")); -} - -sub new { - my $class=shift; - my $this=$class->SUPER::new(@_); - # Out of source tree building is preferred. - $this->prefer_out_of_source_building(@_); - return $this; -} - -sub check_auto_buildable { - my $this=shift; - return -e $this->get_sourcepath("setup.py") ? 1 : 0; -} - -sub not_our_cfg { - my $this=shift; - my $ret; - if (open(my $cfg, $this->get_buildpath(".pydistutils.cfg"))) { - $ret = not "# Created by dh_auto\n" eq <$cfg>; - close $cfg; - } - return $ret; -} - -sub create_cfg { - my $this=shift; - if (open(my $cfg, ">", $this->get_buildpath(".pydistutils.cfg"))) { - print $cfg "# Created by dh_auto", "\n"; - print $cfg "[build]\nbuild-base=", $this->get_build_rel2sourcedir(), "\n"; - close $cfg; - return 1; - } - return 0; -} - -sub pre_building_step { - my $this=shift; - my $step=shift; - - return unless grep /$step/, qw(build install clean); - - if ($this->get_buildpath() ne $this->DEFAULT_BUILD_DIRECTORY()) { - # --build-base can only be passed to the build command. However, - # it is always read from the config file (really weird design). - # Therefore create such a cfg config file. - # See http://bugs.python.org/issue818201 - # http://bugs.python.org/issue1011113 - not $this->not_our_cfg() or - error("cannot set custom build directory: .pydistutils.cfg is in use"); - $this->mkdir_builddir(); - $this->create_cfg() or - error("cannot set custom build directory: unwritable .pydistutils.cfg"); - # Distutils reads $HOME/.pydistutils.cfg - $ENV{HOME} = Cwd::abs_path($this->get_buildpath()); - } - - $this->SUPER::pre_building_step($step); -} - -sub dbg_build_needed { - my $this=shift; - my $act=shift; - - # Return a list of python-dbg package which are listed - # in the build-dependencies. This is kinda ugly, but building - # dbg extensions without checking if they're supposed to be - # built may result in various FTBFS if the package is not - # built in a clean chroot. - - my @dbg; - open (CONTROL, 'debian/control') || - error("cannot read debian/control: $!\n"); - foreach my $builddeps (join('', ) =~ - /^Build-Depends[^:]*:.*\n(?:^[^\w\n].*\n)*/gmi) { - while ($builddeps =~ /(python[^, ]*-dbg)/g) { - push @dbg, $1; - } - } - - close CONTROL; - return @dbg; - -} - -sub setup_py { - my $this=shift; - my $act=shift; - - # We need to to run setup.py with the default python last - # as distutils/setuptools modifies the shebang lines of scripts. - # This ensures that #!/usr/bin/python is installed last and - # not pythonX.Y - # Take into account that the default Python must not be in - # the requested Python versions. - # Then, run setup.py with each available python, to build - # extensions for each. - - my $python_default = `pyversions -d`; - if ($? == -1) { - error("failed to run pyversions") - } - my $ecode = $? >> 8; - if ($ecode != 0) { - error("pyversions -d failed [$ecode]") - } - $python_default =~ s/^\s+//; - $python_default =~ s/\s+$//; - my @python_requested = split ' ', `pyversions -r`; - if ($? == -1) { - error("failed to run pyversions") - } - $ecode = $? >> 8; - if ($ecode != 0) { - error("pyversions -r failed [$ecode]") - } - if (grep /^\Q$python_default\E/, @python_requested) { - @python_requested = ( - grep(!/^\Q$python_default\E/, @python_requested), - "python", - ); - } - - my @python_dbg; - my @dbg_build_needed = $this->dbg_build_needed(); - foreach my $python (map { $_."-dbg" } @python_requested) { - if (grep /^(python-all-dbg|\Q$python\E)/, @dbg_build_needed) { - push @python_dbg, $python; - } - elsif (($python eq "python-dbg") - and (grep /^\Q$python_default\E/, @dbg_build_needed)) { - push @python_dbg, $python_default."-dbg"; - } - } - - foreach my $python (@python_dbg, @python_requested) { - if (-x "/usr/bin/".$python) { - # To allow backports of debhelper we don't pass - # --install-layout=deb to 'setup.py install` for - # those Python versions where the option is - # ignored by distutils/setuptools. - if ( $act eq "install" and not - ( ($python =~ /^python(?:-dbg)?$/ - and $python_default =~ /^python2\.[2345]$/) - or $python =~ /^python2\.[2345](?:-dbg)?$/ )) { - $this->doit_in_sourcedir($python, "setup.py", - $act, @_, "--install-layout=deb"); - } - else { - $this->doit_in_sourcedir($python, "setup.py", - $act, @_); - } - } - } -} - -sub build { - my $this=shift; - $this->setup_py("build", - "--force", - @_); -} - -sub install { - my $this=shift; - my $destdir=shift; - $this->setup_py("install", - "--force", - "--root=$destdir", - "--no-compile", - "-O0", - @_); -} - -sub clean { - my $this=shift; - $this->setup_py("clean", "-a", @_); - - # Config file will remain if it was created by us - if (!$this->not_our_cfg()) { - unlink($this->get_buildpath(".pydistutils.cfg")); - $this->rmdir_builddir(1); # only if empty - } - # The setup.py might import files, leading to python creating pyc - # files. - $this->doit_in_sourcedir('find', '.', '-name', '*.pyc', '-exec', 'rm', '{}', '+'); -} - -1 - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem/qmake.pm debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem/qmake.pm --- debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem/qmake.pm 2015-11-06 21:29:22.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem/qmake.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,90 +0,0 @@ -# A debhelper build system class for Qt projects -# (based on the makefile class). -# -# Copyright: © 2010 Kelvin Modderman -# License: GPL-2+ - -package Debian::Debhelper::Buildsystem::qmake; - -use strict; -use warnings; -use Debian::Debhelper::Dh_Lib qw(error); -use parent qw(Debian::Debhelper::Buildsystem::makefile); - -our $qmake="qmake"; - -sub DESCRIPTION { - "qmake (*.pro)"; -} - -sub check_auto_buildable { - my $this=shift; - my @projects=glob($this->get_sourcepath('*.pro')); - my $ret=0; - - if (@projects > 0) { - $ret=1; - # Existence of a Makefile generated by qmake indicates qmake - # class has already been used by a prior build step, so should - # be used instead of the parent makefile class. - my $mf=$this->get_buildpath("Makefile"); - if (-e $mf) { - $ret = $this->SUPER::check_auto_buildable(@_); - open(my $fh, '<', $mf) - or error("unable to open Makefile: $mf"); - while(<$fh>) { - if (m/^# Generated by qmake/i) { - $ret++; - last; - } - } - close($fh); - } - } - - return $ret; -} - -sub configure { - my $this=shift; - my @options; - my @flags; - - push @options, '-makefile'; - push @options, '-nocache'; - - if ($ENV{CFLAGS}) { - push @flags, "QMAKE_CFLAGS_RELEASE=$ENV{CFLAGS} $ENV{CPPFLAGS}"; - push @flags, "QMAKE_CFLAGS_DEBUG=$ENV{CFLAGS} $ENV{CPPFLAGS}"; - } - if ($ENV{CXXFLAGS}) { - push @flags, "QMAKE_CXXFLAGS_RELEASE=$ENV{CXXFLAGS} $ENV{CPPFLAGS}"; - push @flags, "QMAKE_CXXFLAGS_DEBUG=$ENV{CXXFLAGS} $ENV{CPPFLAGS}"; - } - if ($ENV{LDFLAGS}) { - push @flags, "QMAKE_LFLAGS_RELEASE=$ENV{LDFLAGS}"; - push @flags, "QMAKE_LFLAGS_DEBUG=$ENV{LDFLAGS}"; - } - push @flags, "QMAKE_STRIP=:"; - push @flags, "PREFIX=/usr"; - - $this->mkdir_builddir(); - $this->doit_in_builddir($qmake, @options, @flags, @_); -} - -sub install { - my $this=shift; - my $destdir=shift; - - # qmake generated Makefiles use INSTALL_ROOT in install target - # where one would expect DESTDIR to be used. - $this->SUPER::install($destdir, "INSTALL_ROOT=$destdir", @_); -} - -1 - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem/qmake_qt4.pm debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem/qmake_qt4.pm --- debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem/qmake_qt4.pm 2015-07-01 17:17:30.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem/qmake_qt4.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -package Debian::Debhelper::Buildsystem::qmake_qt4; - -use strict; -use warnings; -use Debian::Debhelper::Dh_Lib qw(error); -use parent qw(Debian::Debhelper::Buildsystem::qmake); - -sub DESCRIPTION { - "qmake for QT 4 (*.pro)"; -} - -sub configure { - my $this=shift; - $Debian::Debhelper::Buildsystem::qmake::qmake="qmake-qt4"; - $this->SUPER::configure(@_); -} - -1 - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem.pm debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem.pm --- debhelper-9.20160115ubuntu3/Debian/Debhelper/Buildsystem.pm 2015-11-06 21:10:49.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Buildsystem.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,465 +0,0 @@ -# Defines debhelper build system class interface and implementation -# of common functionality. -# -# Copyright: © 2008-2009 Modestas Vainius -# License: GPL-2+ - -package Debian::Debhelper::Buildsystem; - -use strict; -use warnings; -use Cwd (); -use File::Spec; -use Debian::Debhelper::Dh_Lib; - -# Build system name. Defaults to the last component of the class -# name. Do not override this method unless you know what you are -# doing. -sub NAME { - my $this=shift; - my $class = ref($this) || $this; - if ($class =~ m/^.+::([^:]+)$/) { - return $1; - } - else { - error("ınvalid build system class name: $class"); - } -} - -# Description of the build system to be shown to the users. -sub DESCRIPTION { - error("class lacking a DESCRIPTION"); -} - -# Default build directory. Can be overriden in the derived -# class if really needed. -sub DEFAULT_BUILD_DIRECTORY { - "obj-" . dpkg_architecture_value("DEB_HOST_GNU_TYPE"); -} - -# Constructs a new build system object. Named parameters: -# - sourcedir- specifies source directory (relative to the current (top) -# directory) where the sources to be built live. If not -# specified or empty, defaults to the current directory. -# - builddir - specifies build directory to use. Path is relative to the -# current (top) directory. If undef or empty, -# DEFAULT_BUILD_DIRECTORY directory will be used. -# - parallel - max number of parallel processes to be spawned for building -# sources (-1 = unlimited; 1 = no parallel) -# Derived class can override the constructor to initialize common object -# parameters. Do NOT use constructor to execute commands or otherwise -# configure/setup build environment. There is absolutely no guarantee the -# constructed object will be used to build something. Use pre_building_step(), -# $build_step() or post_building_step() methods for this. -sub new { - my ($class, %opts)=@_; - - my $this = bless({ sourcedir => '.', - builddir => undef, - parallel => undef, - cwd => Cwd::getcwd() }, $class); - - if (exists $opts{sourcedir}) { - # Get relative sourcedir abs_path (without symlinks) - my $abspath = Cwd::abs_path($opts{sourcedir}); - if (! -d $abspath || $abspath !~ /^\Q$this->{cwd}\E/) { - error("invalid or non-existing path to the source directory: ".$opts{sourcedir}); - } - $this->{sourcedir} = File::Spec->abs2rel($abspath, $this->{cwd}); - } - if (exists $opts{builddir}) { - $this->_set_builddir($opts{builddir}); - } - if (defined $opts{parallel}) { - $this->{parallel} = $opts{parallel}; - } - return $this; -} - -# Private method to set a build directory. If undef, use default. -# Do $this->{builddir} = undef or pass $this->get_sourcedir() to -# unset the build directory. -sub _set_builddir { - my $this=shift; - my $builddir=shift || $this->DEFAULT_BUILD_DIRECTORY; - - if (defined $builddir) { - $builddir = $this->canonpath($builddir); # Canonicalize - - # Sanitize $builddir - if ($builddir =~ m#^\.\./#) { - # We can't handle those as relative. Make them absolute - $builddir = File::Spec->catdir($this->{cwd}, $builddir); - } - elsif ($builddir =~ /\Q$this->{cwd}\E/) { - $builddir = File::Spec->abs2rel($builddir, $this->{cwd}); - } - - # If build directory ends up the same as source directory, drop it - if ($builddir eq $this->get_sourcedir()) { - $builddir = undef; - } - } - $this->{builddir} = $builddir; - return $builddir; -} - -# This instance method is called to check if the build system is able -# to build a source package. It will be called during the build -# system auto-selection process, inside the root directory of the debian -# source package. The current build step is passed as an argument. -# Return 0 if the source is not buildable, or a positive integer -# otherwise. -# -# Generally, it is enough to look for invariant unique build system -# files shipped with clean source to determine if the source might -# be buildable or not. However, if the build system is derived from -# another other auto-buildable build system, this method -# may also check if the source has already been built with this build -# system partitially by looking for temporary files or other common -# results the build system produces during the build process. The -# latter checks must be unique to the current build system and must -# be very unlikely to be true for either its parent or other build -# systems. If it is determined that the source has already built -# partitially with this build system, the value returned must be -# greater than the one of the SUPER call. -sub check_auto_buildable { - my $this=shift; - my ($step)=@_; - return 0; -} - -# Derived class can call this method in its constructor -# to enforce in source building even if the user requested otherwise. -sub enforce_in_source_building { - my $this=shift; - if ($this->get_builddir()) { - $this->{warn_insource} = 1; - $this->{builddir} = undef; - } -} - -# Derived class can call this method in its constructor to *prefer* -# out of source building. Unless build directory has already been -# specified building will proceed in the DEFAULT_BUILD_DIRECTORY or -# the one specified in the 'builddir' named parameter (which may -# match the source directory). Typically you should pass @_ from -# the constructor to this call. -sub prefer_out_of_source_building { - my $this=shift; - my %args=@_; - if (!defined $this->get_builddir()) { - if (!$this->_set_builddir($args{builddir}) && !$args{builddir}) { - # If we are here, DEFAULT_BUILD_DIRECTORY matches - # the source directory, building might fail. - error("default build directory is the same as the source directory." . - " Please specify a custom build directory"); - } - } -} - -# Enhanced version of File::Spec::canonpath. It collapses .. -# too so it may return invalid path if symlinks are involved. -# On the other hand, it does not need for the path to exist. -sub canonpath { - my ($this, $path)=@_; - my @canon; - my $back=0; - foreach my $comp (split(m%/+%, $path)) { - if ($comp eq '.') { - next; - } - elsif ($comp eq '..') { - if (@canon > 0) { pop @canon; } else { $back++; } - } - else { - push @canon, $comp; - } - } - return (@canon + $back > 0) ? join('/', ('..')x$back, @canon) : '.'; -} - -# Given both $path and $base are relative to the $root, converts and -# returns path of $path being relative to the $base. If either $path or -# $base is absolute, returns another $path (converted to) absolute. -sub _rel2rel { - my ($this, $path, $base, $root)=@_; - $root = $this->{cwd} unless defined $root; - - if (File::Spec->file_name_is_absolute($path)) { - return $path; - } - elsif (File::Spec->file_name_is_absolute($base)) { - return File::Spec->rel2abs($path, $root); - } - else { - return File::Spec->abs2rel( - File::Spec->rel2abs($path, $root), - File::Spec->rel2abs($base, $root) - ); - } -} - -# Get path to the source directory -# (relative to the current (top) directory) -sub get_sourcedir { - my $this=shift; - return $this->{sourcedir}; -} - -# Convert path relative to the source directory to the path relative -# to the current (top) directory. -sub get_sourcepath { - my ($this, $path)=@_; - return File::Spec->catfile($this->get_sourcedir(), $path); -} - -# Get path to the build directory if it was specified -# (relative to the current (top) directory). undef if the same -# as the source directory. -sub get_builddir { - my $this=shift; - return $this->{builddir}; -} - -# Convert path that is relative to the build directory to the path -# that is relative to the current (top) directory. -# If $path is not specified, always returns build directory path -# relative to the current (top) directory regardless if builddir was -# specified or not. -sub get_buildpath { - my ($this, $path)=@_; - my $builddir = $this->get_builddir() || $this->get_sourcedir(); - if (defined $path) { - return File::Spec->catfile($builddir, $path); - } - return $builddir; -} - -# When given a relative path to the source directory, converts it -# to the path that is relative to the build directory. If $path is -# not given, returns a path to the source directory that is relative -# to the build directory. -sub get_source_rel2builddir { - my $this=shift; - my $path=shift; - - my $dir = '.'; - if ($this->get_builddir()) { - $dir = $this->_rel2rel($this->get_sourcedir(), $this->get_builddir()); - } - if (defined $path) { - return File::Spec->catfile($dir, $path); - } - return $dir; -} - -sub get_parallel { - my $this=shift; - return $this->{parallel}; -} - -# When given a relative path to the build directory, converts it -# to the path that is relative to the source directory. If $path is -# not given, returns a path to the build directory that is relative -# to the source directory. -sub get_build_rel2sourcedir { - my $this=shift; - my $path=shift; - - my $dir = '.'; - if ($this->get_builddir()) { - $dir = $this->_rel2rel($this->get_builddir(), $this->get_sourcedir()); - } - if (defined $path) { - return File::Spec->catfile($dir, $path); - } - return $dir; -} - -# Creates a build directory. -sub mkdir_builddir { - my $this=shift; - if ($this->get_builddir()) { - doit("mkdir", "-p", $this->get_builddir()); - } -} - -sub _cd { - my ($this, $dir)=@_; - verbose_print("cd $dir"); - if (! $dh{NO_ACT}) { - chdir $dir or error("error: unable to chdir to $dir"); - } -} - -# Changes working directory to the source directory (if needed), -# calls print_and_doit(@_) and changes working directory back to the -# top directory. -sub doit_in_sourcedir { - my $this=shift; - if ($this->get_sourcedir() ne '.') { - my $sourcedir = $this->get_sourcedir(); - $this->_cd($sourcedir); - eval { - print_and_doit(@_); - }; - my $saved_exception = $@; - $this->_cd($this->_rel2rel($this->{cwd}, $sourcedir)); - die $saved_exception if $saved_exception; - } - else { - print_and_doit(@_); - } - return 1; -} - -# Changes working directory to the source directory (if needed), -# calls print_and_doit(@_) and changes working directory back to the -# top directory. Errors are ignored. -sub doit_in_sourcedir_noerror { - my $this=shift; - my $ret; - if ($this->get_sourcedir() ne '.') { - my $sourcedir = $this->get_sourcedir(); - $this->_cd($sourcedir); - $ret = print_and_doit_noerror(@_); - $this->_cd($this->_rel2rel($this->{cwd}, $sourcedir)); - } - else { - $ret = print_and_doit_noerror(@_); - } - return $ret; -} - -# Changes working directory to the build directory (if needed), -# calls print_and_doit(@_) and changes working directory back to the -# top directory. -sub doit_in_builddir { - my $this=shift; - if ($this->get_buildpath() ne '.') { - my $buildpath = $this->get_buildpath(); - $this->_cd($buildpath); - eval { - print_and_doit(@_); - }; - my $saved_exception = $@; - $this->_cd($this->_rel2rel($this->{cwd}, $buildpath)); - die $saved_exception if $saved_exception; - } - else { - print_and_doit(@_); - } - return 1; -} - -# Changes working directory to the build directory (if needed), -# calls print_and_doit(@_) and changes working directory back to the -# top directory. Errors are ignored. -sub doit_in_builddir_noerror { - my $this=shift; - my $ret; - if ($this->get_buildpath() ne '.') { - my $buildpath = $this->get_buildpath(); - $this->_cd($buildpath); - $ret = print_and_doit_noerror(@_); - $this->_cd($this->_rel2rel($this->{cwd}, $buildpath)); - } - else { - $ret = print_and_doit_noerror(@_); - } - return $ret; -} - -# In case of out of source tree building, whole build directory -# gets wiped (if it exists) and 1 is returned. If build directory -# had 2 or more levels, empty parent directories are also deleted. -# If build directory does not exist, nothing is done and 0 is returned. -sub rmdir_builddir { - my $this=shift; - my $only_empty=shift; - if ($this->get_builddir()) { - my $buildpath = $this->get_buildpath(); - if (-d $buildpath) { - my @dir = File::Spec->splitdir($this->get_build_rel2sourcedir()); - my $peek; - if (not $only_empty) { - doit("rm", "-rf", $buildpath); - pop @dir; - } - # If build directory is relative and had 2 or more levels, delete - # empty parent directories until the source or top directory level. - if (not File::Spec->file_name_is_absolute($buildpath)) { - while (($peek=pop @dir) && $peek ne '.' && $peek ne '..') { - my $dir = $this->get_sourcepath(File::Spec->catdir(@dir, $peek)); - doit("rmdir", "--ignore-fail-on-non-empty", $dir); - last if -d $dir; - } - } - } - return 1; - } - return 0; -} - -# Instance method that is called before performing any step (see below). -# Action name is passed as an argument. Derived classes overriding this -# method should also call SUPER implementation of it. -sub pre_building_step { - my $this=shift; - my ($step)=@_; - - # Warn if in source building was enforced but build directory was - # specified. See enforce_in_source_building(). - if ($this->{warn_insource}) { - warning("warning: " . $this->NAME() . - " does not support building out of source tree. In source building enforced."); - delete $this->{warn_insource}; - } -} - -# Instance method that is called after performing any step (see below). -# Action name is passed as an argument. Derived classes overriding this -# method should also call SUPER implementation of it. -sub post_building_step { - my $this=shift; - my ($step)=@_; -} - -# The instance methods below provide support for configuring, -# building, testing, install and cleaning source packages. -# In case of failure, the method may just error() out. -# -# These methods should be overriden by derived classes to -# implement build system specific steps needed to build the -# source. Arbitary number of custom step arguments might be -# passed. Default implementations do nothing. -sub configure { - my $this=shift; -} - -sub build { - my $this=shift; -} - -sub test { - my $this=shift; -} - -# destdir parameter specifies where to install files. -sub install { - my $this=shift; - my $destdir=shift; -} - -sub clean { - my $this=shift; -} - -1 - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/Debian/Debhelper/Dh_Buildsystems.pm debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Dh_Buildsystems.pm --- debhelper-9.20160115ubuntu3/Debian/Debhelper/Dh_Buildsystems.pm 2015-11-06 21:10:49.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Dh_Buildsystems.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,236 +0,0 @@ -# A module for loading and managing debhelper build system classes. -# This module is intended to be used by all dh_auto_* programs. -# -# Copyright: © 2009 Modestas Vainius -# License: GPL-2+ - -package Debian::Debhelper::Dh_Buildsystems; - -use strict; -use warnings; -use Debian::Debhelper::Dh_Lib; -use File::Spec; - -use Exporter qw(import); -our @EXPORT=qw(&buildsystems_init &buildsystems_do &load_buildsystem &load_all_buildsystems); - -use constant BUILD_STEPS => qw(configure build test install clean); - -# Historical order must be kept for backwards compatibility. New -# build systems MUST be added to the END of the list. -our @BUILDSYSTEMS = ( - "autoconf", - (! compat(7) ? "perl_build" : ()), - "perl_makemaker", - "makefile", - "python_distutils", - (compat(7) ? "perl_build" : ()), - "cmake", - "ant", - "qmake", - "qmake_qt4", -); - -my $opt_buildsys; -my $opt_sourcedir; -my $opt_builddir; -my $opt_list; -my $opt_parallel; - -sub create_buildsystem_instance { - my $system=shift; - my %bsopts=@_; - my $module = "Debian::Debhelper::Buildsystem::$system"; - - eval "use $module"; - if ($@) { - error("unable to load build system class '$system': $@"); - } - - if (!exists $bsopts{builddir} && defined $opt_builddir) { - $bsopts{builddir} = ($opt_builddir eq "") ? undef : $opt_builddir; - } - if (!exists $bsopts{sourcedir} && defined $opt_sourcedir) { - $bsopts{sourcedir} = ($opt_sourcedir eq "") ? undef : $opt_sourcedir; - } - if (!exists $bsopts{parallel}) { - $bsopts{parallel} = $opt_parallel; - } - return $module->new(%bsopts); -} - -# Autoselect a build system from the list of instances -sub autoselect_buildsystem { - my $step=shift; - my $selected; - my $selected_level = 0; - - foreach my $inst (@_) { - # Only derived (i.e. more specific) build system can be - # considered beyond the currently selected one. - next if defined $selected && !$inst->isa(ref $selected); - - # If the build system says it is auto-buildable at the current - # step and it can provide more specific information about its - # status than its parent (if any), auto-select it. - my $level = $inst->check_auto_buildable($step); - if ($level > $selected_level) { - $selected = $inst; - $selected_level = $level; - } - } - return $selected; -} - -# Similar to create_build system_instance(), but it attempts to autoselect -# a build system if none was specified. In case autoselection fails, undef -# is returned. -sub load_buildsystem { - my $system=shift; - my $step=shift; - if (defined $system) { - my $inst = create_buildsystem_instance($system, @_); - return $inst; - } - else { - # Try to determine build system automatically - my @buildsystems; - foreach $system (@BUILDSYSTEMS) { - push @buildsystems, create_buildsystem_instance($system, @_); - } - return autoselect_buildsystem($step, @buildsystems); - } -} - -sub load_all_buildsystems { - my $incs=shift || \@INC; - my (%buildsystems, @buildsystems); - - foreach my $inc (@$incs) { - my $path = File::Spec->catdir($inc, "Debian/Debhelper/Buildsystem"); - if (-d $path) { - foreach my $module_path (glob "$path/*.pm") { - my $name = basename($module_path); - $name =~ s/\.pm$//; - next if exists $buildsystems{$name}; - $buildsystems{$name} = create_buildsystem_instance($name, @_); - } - } - } - - # Standard debhelper build systems first - foreach my $name (@BUILDSYSTEMS) { - error("standard debhelper build system '$name' could not be found/loaded") - if not exists $buildsystems{$name}; - push @buildsystems, $buildsystems{$name}; - delete $buildsystems{$name}; - } - - # The rest are 3rd party build systems - foreach my $name (keys %buildsystems) { - my $inst = $buildsystems{$name}; - $inst->{thirdparty} = 1; - push @buildsystems, $inst; - } - - return @buildsystems; -} - -sub buildsystems_init { - my %args=@_; - - # Compat 10 defaults to --parallel by default - my $max_parallel = compat(9) ? 1 : -1; - - # Available command line options - my %options = ( - "D=s" => \$opt_sourcedir, - "sourcedirectory=s" => \$opt_sourcedir, - - "B:s" => \$opt_builddir, - "builddirectory:s" => \$opt_builddir, - - "S=s" => \$opt_buildsys, - "buildsystem=s" => \$opt_buildsys, - - "l" => \$opt_list, - "list" => \$opt_list, - - "parallel" => sub { $max_parallel = -1 }, - 'no-parallel' => sub { $max_parallel = 1 }, - "max-parallel=i" => \$max_parallel, - ); - $args{options}{$_} = $options{$_} foreach keys(%options); - Debian::Debhelper::Dh_Lib::init(%args); - Debian::Debhelper::Dh_Lib::set_buildflags(); - set_parallel($max_parallel); -} - -sub set_parallel { - my $max=shift; - - # Get number of processes from parallel=n option, limiting it - # with $max if needed - $opt_parallel=get_buildoption("parallel") || 1; - - if ($max > 0 && $opt_parallel > $max) { - $opt_parallel = $max; - } -} - -sub buildsystems_list { - my $step=shift; - - my @buildsystems = load_all_buildsystems(); - my $auto = autoselect_buildsystem($step, grep { ! $_->{thirdparty} } @buildsystems); - my $specified; - - # List build systems (including auto and specified status) - foreach my $inst (@buildsystems) { - if (! defined $specified && defined $opt_buildsys && $opt_buildsys eq $inst->NAME()) { - $specified = $inst; - } - printf("%-20s %s", $inst->NAME(), $inst->DESCRIPTION()); - print " [3rd party]" if $inst->{thirdparty}; - print "\n"; - } - print "\n"; - print "Auto-selected: ", $auto->NAME(), "\n" if defined $auto; - print "Specified: ", $specified->NAME(), "\n" if defined $specified; - print "No system auto-selected or specified\n" - if ! defined $auto && ! defined $specified; -} - -sub buildsystems_do { - my $step=shift; - - if (!defined $step) { - $step = basename($0); - $step =~ s/^dh_auto_//; - } - - if (grep(/^\Q$step\E$/, BUILD_STEPS) == 0) { - error("unrecognized build step: " . $step); - } - - if ($opt_list) { - buildsystems_list($step); - exit 0; - } - - my $buildsystem = load_buildsystem($opt_buildsys, $step); - if (defined $buildsystem) { - $buildsystem->pre_building_step($step); - $buildsystem->$step(@_, @{$dh{U_PARAMS}}); - $buildsystem->post_building_step($step); - } - return 0; -} - -1 - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/Debian/Debhelper/Dh_Getopt.pm debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Dh_Getopt.pm --- debhelper-9.20160115ubuntu3/Debian/Debhelper/Dh_Getopt.pm 2015-09-02 20:49:46.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Dh_Getopt.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,295 +0,0 @@ -#!/usr/bin/perl -# -# Debhelper option processing library. -# -# Joey Hess GPL copyright 1998-2002 - -package Debian::Debhelper::Dh_Getopt; -use strict; -use warnings; - -use Debian::Debhelper::Dh_Lib; -use Getopt::Long; - -my %exclude_package; - -sub showhelp { - my $prog=basename($0); - print "Usage: $prog [options]\n\n"; - print " $prog is a part of debhelper. See debhelper(7)\n"; - print " and $prog(1) for complete usage instructions.\n"; - exit(1); -} - -# Passed an option name and an option value, adds packages to the list -# of packages. We need this so the list will be built up in the right -# order. -sub AddPackage { my($option,$value)=@_; - if ($option eq 'i' or $option eq 'indep') { - push @{$dh{DOPACKAGES}}, getpackages('indep'); - $dh{DOINDEP}=1; - } - elsif ($option eq 'a' or $option eq 'arch' or - $option eq 's' or $option eq 'same-arch') { - push @{$dh{DOPACKAGES}}, getpackages('arch'); - $dh{DOARCH}=1; - } - elsif ($option eq 'p' or $option eq 'package') { - push @{$dh{DOPACKAGES}}, $value; - } - else { - error("bad option $option - should never happen!\n"); - } -} - -# Adds packages to the list of debug packages. -sub AddDebugPackage { my($option,$value)=@_; - push @{$dh{DEBUGPACKAGES}}, $value; -} - -# Add a package to a list of packages that should not be acted on. -sub ExcludePackage { my($option,$value)=@_; - $exclude_package{$value}=1; -} - -# Add another item to the exclude list. -sub AddExclude { my($option,$value)=@_; - push @{$dh{EXCLUDE}},$value; -} - -# Add a file to the ignore list. -sub AddIgnore { my($option,$file)=@_; - $dh{IGNORE}->{$file}=1; -} - -# This collects non-options values. -sub NonOption { - push @{$dh{ARGV}}, @_; -} - -sub getoptions { - my $array=shift; - my %params=@_; - - if (! exists $params{bundling} || $params{bundling}) { - Getopt::Long::config("bundling"); - } - - my @test; - my %options=( - "v" => \$dh{VERBOSE}, - "verbose" => \$dh{VERBOSE}, - - "no-act" => \$dh{NO_ACT}, - - "i" => \&AddPackage, - "indep" => \&AddPackage, - - "a" => \&AddPackage, - "arch" => \&AddPackage, - - "p=s" => \&AddPackage, - "package=s" => \&AddPackage, - - "N=s" => \&ExcludePackage, - "no-package=s" => \&ExcludePackage, - - "remaining-packages" => \$dh{EXCLUDE_LOGGED}, - - "dbg-package=s" => \&AddDebugPackage, - - "s" => \&AddPackage, - "same-arch" => \&AddPackage, - - "n" => \$dh{NOSCRIPTS}, - "noscripts" => \$dh{NOSCRIPTS}, - "o" => \$dh{ONLYSCRIPTS}, - "onlyscripts" => \$dh{ONLYSCRIPTS}, - - "X=s" => \&AddExclude, - "exclude=s" => \&AddExclude, - - "d" => \$dh{D_FLAG}, - - "k" => \$dh{K_FLAG}, - "keep" => \$dh{K_FLAG}, - - "P=s" => \$dh{TMPDIR}, - "tmpdir=s" => \$dh{TMPDIR}, - - "u=s", => \$dh{U_PARAMS}, - - "V:s", => \$dh{V_FLAG}, - - "A" => \$dh{PARAMS_ALL}, - "all" => \$dh{PARAMS_ALL}, - - "priority=s" => \$dh{PRIORITY}, - - "h|help" => \&showhelp, - - "mainpackage=s" => \$dh{MAINPACKAGE}, - - "name=s" => \$dh{NAME}, - - "error-handler=s" => \$dh{ERROR_HANDLER}, - - "ignore=s" => \&AddIgnore, - - "O=s" => sub { push @test, $_[1] }, - - (ref $params{options} ? %{$params{options}} : ()) , - - "<>" => \&NonOption, - ); - - if ($params{test}) { - foreach my $key (keys %options) { - $options{$key}=sub {}; - } - } - - my $oldwarn; - if ($params{test} || $params{ignore_unknown_options}) { - $oldwarn=$SIG{__WARN__}; - $SIG{__WARN__}=sub {}; - } - my $ret=Getopt::Long::GetOptionsFromArray($array, %options); - if ($oldwarn) { - $SIG{__WARN__}=$oldwarn; - } - - foreach my $opt (@test) { - # Try to parse an option, and skip it - # if it is not known. - if (getoptions([$opt], %params, - ignore_unknown_options => 0, - test => 1)) { - getoptions([$opt], %params); - } - } - - return 1 if $params{ignore_unknown_options}; - return $ret; -} - -sub split_options_string { - my $str=shift; - $str=~s/^\s+//; - return split(/\s+/,$str); -} - -# Parse options and set %dh values. -sub parseopts { - my %params=@_; - - my @ARGV_extra; - - # DH_INTERNAL_OPTIONS is used to pass additional options from - # dh through an override target to a command. - if (defined $ENV{DH_INTERNAL_OPTIONS}) { - @ARGV_extra=split(/\x1e/, $ENV{DH_INTERNAL_OPTIONS}); - getoptions(\@ARGV_extra, %params); - - # Avoid forcing acting on packages specified in - # DH_INTERNAL_OPTIONS. This way, -p can be specified - # at the command line to act on a specific package, but when - # nothing is specified, the excludes will cause the set of - # packages DH_INTERNAL_OPTIONS specifies to be acted on. - if (defined $dh{DOPACKAGES}) { - foreach my $package (getpackages()) { - if (! grep { $_ eq $package } @{$dh{DOPACKAGES}}) { - $exclude_package{$package}=1; - } - } - } - delete $dh{DOPACKAGES}; - delete $dh{DOINDEP}; - delete $dh{DOARCH}; - } - - # DH_OPTIONS can contain additional options to be parsed like @ARGV - if (defined $ENV{DH_OPTIONS}) { - @ARGV_extra=split_options_string($ENV{DH_OPTIONS}); - my $ret=getoptions(\@ARGV_extra, %params); - if (!$ret) { - warning("warning: ignored unknown options in DH_OPTIONS"); - } - } - - my $ret=getoptions(\@ARGV, %params); - if (!$ret) { - if (! compat(7)) { - error("unknown option; aborting"); - } - } - - # Check to see if -V was specified. If so, but no parameters were - # passed, the variable will be defined but empty. - if (defined($dh{V_FLAG})) { - $dh{V_FLAG_SET}=1; - } - - # If we have not been given any packages to act on, assume they - # want us to act on them all. Note we have to do this before excluding - # packages out, below. - if (! defined $dh{DOPACKAGES} || ! @{$dh{DOPACKAGES}}) { - if ($dh{DOINDEP} || $dh{DOARCH}) { - # User specified that all arch (in)dep package be - # built, and there are none of that type. - if (! $dh{BLOCK_NOOP_WARNINGS}) { - warning("You asked that all arch in(dep) packages be built, but there are none of that type."); - } - exit(0); - } - push @{$dh{DOPACKAGES}},getpackages("both"); - } - - # Remove excluded packages from the list of packages to act on. - # Also unique the list, in case some options were specified that - # added a package to it twice. - my @package_list; - my $package; - my %packages_seen; - foreach $package (@{$dh{DOPACKAGES}}) { - if (defined($dh{EXCLUDE_LOGGED}) && - grep { $_ eq basename($0) } load_log($package)) { - $exclude_package{$package}=1; - } - if (! $exclude_package{$package}) { - if (! exists $packages_seen{$package}) { - $packages_seen{$package}=1; - push @package_list, $package; - } - } - } - @{$dh{DOPACKAGES}}=@package_list; - - if (! defined $dh{DOPACKAGES} || ! @{$dh{DOPACKAGES}}) { - if (! $dh{BLOCK_NOOP_WARNINGS}) { - warning("No packages to build."); - } - exit(0); - } - - if (defined $dh{U_PARAMS}) { - # Split the U_PARAMS up into an array. - my $u=$dh{U_PARAMS}; - undef $dh{U_PARAMS}; - push @{$dh{U_PARAMS}}, split(/\s+/,$u); - } - - # Anything left in @ARGV is options that appeared after a -- - # These options are added to the U_PARAMS array, while the - # non-option values we collected replace them in @ARGV; - push @{$dh{U_PARAMS}}, @ARGV, @ARGV_extra; - @ARGV=@{$dh{ARGV}} if exists $dh{ARGV}; -} - -1 - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/Debian/Debhelper/Dh_Lib.pm debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Dh_Lib.pm --- debhelper-9.20160115ubuntu3/Debian/Debhelper/Dh_Lib.pm 2016-03-31 17:57:01.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Dh_Lib.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,1409 +0,0 @@ -#!/usr/bin/perl -# -# Library functions for debhelper programs, perl version. -# -# Joey Hess, GPL copyright 1997-2008. - -package Debian::Debhelper::Dh_Lib; -use strict; -use warnings; - -use constant { - # Lowest compat level supported - 'MIN_COMPAT_LEVEL' => 4, - # Lowest compat level that does *not* cause deprecation - # warnings - 'LOWEST_NON_DEPRECATED_COMPAT_LEVEL' => 5, - # Highest compat level permitted - 'MAX_COMPAT_LEVEL' => 10, -}; - -use Exporter qw(import); -use vars qw(@EXPORT %dh); -@EXPORT=qw(&init &doit &doit_noerror &complex_doit &verbose_print &error - &nonquiet_print &print_and_doit &print_and_doit_noerror - &warning &tmpdir &pkgfile &pkgext &pkgfilename &isnative - &autoscript &filearray &filedoublearray - &getpackages &basename &dirname &xargs %dh - &compat &addsubstvar &delsubstvar &excludefile &package_arch - &is_udeb &debhelper_script_subst &escape_shell - &inhibit_log &load_log &write_log &commit_override_log - &dpkg_architecture_value &sourcepackage &make_symlink - &is_make_jobserver_unavailable &clean_jobserver_makeflags - &cross_command &set_buildflags &get_buildoption - &install_dh_config_file &error_exitcode &package_multiarch - &install_file &install_prog &install_lib &install_dir - &get_source_date_epoch &is_cross_compiling - &generated_file &autotrigger &package_section - &restore_file_on_clean &restore_all_files -); - -my $max_compat=10; - -# The Makefile changes this if debhelper is installed in a PREFIX. -my $prefix="/usr"; - -sub init { - my %params=@_; - - # Check to see if an option line starts with a dash, - # or DH_OPTIONS is set. - # If so, we need to pass this off to the resource intensive - # Getopt::Long, which I'd prefer to avoid loading at all if possible. - if ((defined $ENV{DH_OPTIONS} && length $ENV{DH_OPTIONS}) || - (defined $ENV{DH_INTERNAL_OPTIONS} && length $ENV{DH_INTERNAL_OPTIONS}) || - grep /^-/, @ARGV) { - eval "use Debian::Debhelper::Dh_Getopt"; - error($@) if $@; - Debian::Debhelper::Dh_Getopt::parseopts(%params); - } - - # Another way to set excludes. - if (exists $ENV{DH_ALWAYS_EXCLUDE} && length $ENV{DH_ALWAYS_EXCLUDE}) { - push @{$dh{EXCLUDE}}, split(":", $ENV{DH_ALWAYS_EXCLUDE}); - } - - # Generate EXCLUDE_FIND. - if ($dh{EXCLUDE}) { - $dh{EXCLUDE_FIND}=''; - foreach (@{$dh{EXCLUDE}}) { - my $x=$_; - $x=escape_shell($x); - $x=~s/\./\\\\./g; - $dh{EXCLUDE_FIND}.="-regex .\\*$x.\\* -or "; - } - $dh{EXCLUDE_FIND}=~s/ -or $//; - } - - # Check to see if DH_VERBOSE environment variable was set, if so, - # make sure verbose is on. Otherwise, check DH_QUIET. - if (defined $ENV{DH_VERBOSE} && $ENV{DH_VERBOSE} ne "") { - $dh{VERBOSE}=1; - } elsif (defined $ENV{DH_QUIET} && $ENV{DH_QUIET} ne "") { - $dh{QUIET}=1; - } - - # Check to see if DH_NO_ACT environment variable was set, if so, - # make sure no act mode is on. - if (defined $ENV{DH_NO_ACT} && $ENV{DH_NO_ACT} ne "") { - $dh{NO_ACT}=1; - } - - # Get the name of the main binary package (first one listed in - # debian/control). Only if the main package was not set on the - # command line. - if (! exists $dh{MAINPACKAGE} || ! defined $dh{MAINPACKAGE}) { - my @allpackages=getpackages(); - $dh{MAINPACKAGE}=$allpackages[0]; - } - - # Check if packages to build have been specified, if not, fall back to - # the default, building all relevant packages. - if (! defined $dh{DOPACKAGES} || ! @{$dh{DOPACKAGES}}) { - push @{$dh{DOPACKAGES}}, getpackages('both'); - } - - # Check to see if -P was specified. If so, we can only act on a single - # package. - if ($dh{TMPDIR} && $#{$dh{DOPACKAGES}} > 0) { - error("-P was specified, but multiple packages would be acted on (".join(",",@{$dh{DOPACKAGES}}).")."); - } - - # Figure out which package is the first one we were instructed to build. - # This package gets special treatement: files and directories specified on - # the command line may affect it. - $dh{FIRSTPACKAGE}=${$dh{DOPACKAGES}}[0]; - - # If no error handling function was specified, just propagate - # errors out. - if (! exists $dh{ERROR_HANDLER} || ! defined $dh{ERROR_HANDLER}) { - $dh{ERROR_HANDLER}='exit \$?'; - } -} - -# Run at exit. Add the command to the log files for the packages it acted -# on, if it's exiting successfully. -my $write_log=1; -sub END { - if ($? == 0 && $write_log && (compat(9) || $ENV{DH_INTERNAL_OVERRIDE})) { - write_log(basename($0), @{$dh{DOPACKAGES}}); - } -} - -sub logfile { - my $package=shift; - my $ext=pkgext($package); - return "debian/${ext}debhelper.log" -} - -sub add_override { - my $line=shift; - $line="override_$ENV{DH_INTERNAL_OVERRIDE} $line" - if defined $ENV{DH_INTERNAL_OVERRIDE}; - return $line; -} - -sub remove_override { - my $line=shift; - $line=~s/^\Qoverride_$ENV{DH_INTERNAL_OVERRIDE}\E\s+// - if defined $ENV{DH_INTERNAL_OVERRIDE}; - return $line; -} - -sub load_log { - my ($package, $db)=@_; - - my @log; - open(LOG, "<", logfile($package)) || return; - while () { - chomp; - my $command=remove_override($_); - push @log, $command; - $db->{$package}{$command}=1 if defined $db; - } - close LOG; - return @log; -} - -sub write_log { - my $cmd=shift; - my @packages=@_; - - return if $dh{NO_ACT}; - - foreach my $package (@packages) { - my $log=logfile($package); - open(LOG, ">>", $log) || error("failed to write to ${log}: $!"); - print LOG add_override($cmd)."\n"; - close LOG; - } -} - -sub commit_override_log { - my @packages=@_; - - return if $dh{NO_ACT}; - - foreach my $package (@packages) { - my @log=map { remove_override($_) } load_log($package); - my $log=logfile($package); - open(LOG, ">", $log) || error("failed to write to ${log}: $!"); - print LOG $_."\n" foreach @log; - close LOG; - } -} - -sub inhibit_log { - $write_log=0; -} - -# Pass it an array containing the arguments of a shell command like would -# be run by exec(). It turns that into a line like you might enter at the -# shell, escaping metacharacters and quoting arguments that contain spaces. -sub escape_shell { - my @args=@_; - my $line=""; - my @ret; - foreach my $word (@args) { - if ($word=~/\s/) { - # Escape only a few things since it will be quoted. - # Note we use double quotes because you cannot - # escape ' in single quotes, while " can be escaped - # in double. - # This does make -V"foo bar" turn into "-Vfoo bar", - # but that will be parsed identically by the shell - # anyway.. - $word=~s/([\n`\$"\\])/\\$1/g; - push @ret, "\"$word\""; - } - else { - # This list is from _Unix in a Nutshell_. (except '#') - $word=~s/([\s!"\$()*+#;<>?@\[\]\\`|~])/\\$1/g; - push @ret,$word; - } - } - return join(' ', @ret); -} - -# Run a command, and display the command to stdout if verbose mode is on. -# Throws error if command exits nonzero. -# -# All commands that modify files in $TMP should be run via this -# function. -# -# Note that this cannot handle complex commands, especially anything -# involving redirection. Use complex_doit instead. -sub doit { - doit_noerror(@_) || error_exitcode(join(" ", @_)); -} - -sub doit_noerror { - verbose_print(escape_shell(@_)); - - if (! $dh{NO_ACT}) { - return (system(@_) == 0) - } - else { - return 1; - } -} - -sub print_and_doit { - print_and_doit_noerror(@_) || error_exitcode(join(" ", @_)); -} - -sub print_and_doit_noerror { - nonquiet_print(escape_shell(@_)); - - if (! $dh{NO_ACT}) { - return (system(@_) == 0) - } - else { - return 1; - } -} - -# Run a command and display the command to stdout if verbose mode is on. -# Use doit() if you can, instead of this function, because this function -# forks a shell. However, this function can handle more complicated stuff -# like redirection. -sub complex_doit { - verbose_print(join(" ",@_)); - - if (! $dh{NO_ACT}) { - # The join makes system get a scalar so it forks off a shell. - system(join(" ", @_)) == 0 || error_exitcode(join(" ", @_)) - } -} - -sub error_exitcode { - my $command=shift; - if ($? == -1) { - error("$command failed to to execute: $!"); - } - elsif ($? & 127) { - error("$command died with signal ".($? & 127)); - } - elsif ($?) { - error("$command returned exit code ".($? >> 8)); - } - else { - warning("This tool claimed that $command have failed, but it"); - warning("appears to have returned 0."); - error("Probably a bug in this tool is hiding the actual problem."); - } -} - -# Some shortcut functions for installing files and dirs to always -# have the same owner and mode -# install_file - installs a non-executable -# install_prog - installs an executable -# install_lib - installs a shared library (some systems may need x-bit, others don't) -# install_dir - installs a directory -sub install_file { - doit('install', '-p', '-m0644', @_); -} -sub install_prog { - doit('install', '-p', '-m0755', @_); -} -sub install_lib { - doit('install', '-p', '-m0644', @_); -} -sub install_dir { - doit('install', '-d', @_); -} - -# Run a command that may have a huge number of arguments, like xargs does. -# Pass in a reference to an array containing the arguments, and then other -# parameters that are the command and any parameters that should be passed to -# it each time. -sub xargs { - my $args=shift; - - # The kernel can accept command lines up to 20k worth of characters. - my $command_max=20000; # LINUX SPECIFIC!! - # (And obsolete; it's bigger now.) - # I could use POSIX::ARG_MAX, but that would be slow. - - # Figure out length of static portion of command. - my $static_length=0; - foreach (@_) { - $static_length+=length($_)+1; - } - - my @collect=(); - my $length=$static_length; - foreach (@$args) { - if (length($_) + 1 + $static_length > $command_max) { - error("This command is greater than the maximum command size allowed by the kernel, and cannot be split up further. What on earth are you doing? \"@_ $_\""); - } - $length+=length($_) + 1; - if ($length < $command_max) { - push @collect, $_; - } - else { - doit(@_,@collect) if $#collect > -1; - @collect=($_); - $length=$static_length + length($_) + 1; - } - } - doit(@_,@collect) if $#collect > -1; -} - -# Print something if the verbose flag is on. -sub verbose_print { - my $message=shift; - - if ($dh{VERBOSE}) { - print "\t$message\n"; - } -} - -# Print something unless the quiet flag is on -sub nonquiet_print { - my $message=shift; - - if (!$dh{QUIET}) { - print "\t$message\n"; - } -} - -# Output an error message and die (can be caught). -sub error { - my $message=shift; - - die basename($0).": $message\n"; -} - -# Output a warning. -sub warning { - my $message=shift; - - print STDERR basename($0).": $message\n"; -} - -# Returns the basename of the argument passed to it. -sub basename { - my $fn=shift; - - $fn=~s/\/$//g; # ignore trailing slashes - $fn=~s:^.*/(.*?)$:$1:; - return $fn; -} - -# Returns the directory name of the argument passed to it. -sub dirname { - my $fn=shift; - - $fn=~s/\/$//g; # ignore trailing slashes - $fn=~s:^(.*)/.*?$:$1:; - return $fn; -} - -# Pass in a number, will return true iff the current compatibility level -# is less than or equal to that number. -{ - my $warned_compat=0; - my $c; - - sub compat { - my $num=shift; - my $nowarn=shift; - - if (! defined $c) { - $c=1; - if (-e 'debian/compat') { - open (COMPAT_IN, "debian/compat") || error "debian/compat: $!"; - my $l=; - close COMPAT_IN; - if (! defined $l || ! length $l) { - warning("debian/compat is empty, assuming level $c") - unless defined $ENV{DH_COMPAT}; - } - else { - chomp $l; - $c=$l; - $c =~ s/^\s*+//; - $c =~ s/\s*+$//; - if ($c !~ m/^\d+$/) { - error("debian/compat must contain a postive number (found: \"$c\")"); - } - } - } - else { - warning("No compatibility level specified in debian/compat"); - warning("This package will soon FTBFS; time to fix it!"); - } - - if (defined $ENV{DH_COMPAT}) { - $c=$ENV{DH_COMPAT}; - } - } - if ($c < MIN_COMPAT_LEVEL) { - error("Compatibility levels before ${\MIN_COMPAT_LEVEL} are no longer supported (level $c requested)"); - } - - if ($c < LOWEST_NON_DEPRECATED_COMPAT_LEVEL && ! $warned_compat && ! $nowarn) { - warning("Compatibility levels before ${\LOWEST_NON_DEPRECATED_COMPAT_LEVEL} are deprecated (level $c in use)"); - $warned_compat=1; - } - - if ($c > MAX_COMPAT_LEVEL) { - error("Sorry, but ${\MAX_COMPAT_LEVEL} is the highest compatibility level supported by this debhelper."); - } - - return ($c <= $num); - } -} - -# Pass it a name of a binary package, it returns the name of the tmp dir to -# use, for that package. -sub tmpdir { - my $package=shift; - - if ($dh{TMPDIR}) { - return $dh{TMPDIR}; - } - else { - return "debian/$package"; - } -} - -# Pass this the name of a binary package, and the name of the file wanted -# for the package, and it will return the actual existing filename to use. -# -# It tries several filenames: -# * debian/package.filename.buildarch -# * debian/package.filename.buildos -# * debian/package.filename -# * debian/filename (if the package is the main package) -# If --name was specified then the files -# must have the name after the package name: -# * debian/package.name.filename.buildarch -# * debian/package.name.filename.buildos -# * debian/package.name.filename -# * debian/name.filename (if the package is the main package) -sub pkgfile { - my $package=shift; - my $filename=shift; - - if (defined $dh{NAME}) { - $filename="$dh{NAME}.$filename"; - } - - # First, check for files ending in buildarch and buildos. - my $match; - foreach my $file (glob("debian/$package.$filename.*")) { - next if ! -f $file; - next if $dh{IGNORE} && exists $dh{IGNORE}->{$file}; - if ($file eq "debian/$package.$filename.".buildarch()) { - $match=$file; - # buildarch files are used in preference to buildos files. - last; - } - elsif ($file eq "debian/$package.$filename.".buildos()) { - $match=$file; - } - } - return $match if defined $match; - - my @try=("debian/$package.$filename"); - if ($package eq $dh{MAINPACKAGE}) { - push @try, "debian/$filename"; - } - - foreach my $file (@try) { - if (-f $file && - (! $dh{IGNORE} || ! exists $dh{IGNORE}->{$file})) { - return $file; - } - - } - - return ""; - -} - -# Pass it a name of a binary package, it returns the name to prefix to files -# in debian/ for this package. -sub pkgext { - my ($package) = @_; - return "$package."; -} - -# Pass it the name of a binary package, it returns the name to install -# files by in eg, etc. Normally this is the same, but --name can override -# it. -sub pkgfilename { - my $package=shift; - - if (defined $dh{NAME}) { - return $dh{NAME}; - } - return $package; -} - -# Returns 1 if the package is a native debian package, null otherwise. -# As a side effect, sets $dh{VERSION} to the version of this package. -{ - # Caches return code so it only needs to run dpkg-parsechangelog once. - my %isnative_cache; - - sub isnative { - my $package=shift; - - return $isnative_cache{$package} if defined $isnative_cache{$package}; - - # Make sure we look at the correct changelog. - my $isnative_changelog=pkgfile($package,"changelog"); - if (! $isnative_changelog) { - $isnative_changelog="debian/changelog"; - } - # Get the package version. - my $version=`dpkg-parsechangelog -l$isnative_changelog -SVersion`; - chomp($dh{VERSION} = $version); - # Did the changelog parse fail? - if ($dh{VERSION} eq q{}) { - error("changelog parse failure"); - } - - # Is this a native Debian package? - if ($dh{VERSION}=~m/.*-/) { - return $isnative_cache{$package}=0; - } - else { - return $isnative_cache{$package}=1; - } - } -} - -# Automatically add a shell script snippet to a debian script. -# Only works if the script has #DEBHELPER# in it. -# -# Parameters: -# 1: package -# 2: script to add to -# 3: filename of snippet -# 4: either text: shell-quoted sed to run on the snippet. Ie, 's/#PACKAGE#/$PACKAGE/' -# or a sub to run on each line of the snippet. Ie sub { s/#PACKAGE#/$PACKAGE/ } -sub autoscript { - my $package=shift; - my $script=shift; - my $filename=shift; - my $sed=shift || ""; - - # This is the file we will modify. - my $outfile="debian/".pkgext($package)."$script.debhelper"; - - # Figure out what shell script snippet to use. - my $infile; - if (defined($ENV{DH_AUTOSCRIPTDIR}) && - -e "$ENV{DH_AUTOSCRIPTDIR}/$filename") { - $infile="$ENV{DH_AUTOSCRIPTDIR}/$filename"; - } - else { - if (-e "$prefix/share/debhelper/autoscripts/$filename") { - $infile="$prefix/share/debhelper/autoscripts/$filename"; - } - else { - error("$prefix/share/debhelper/autoscripts/$filename does not exist"); - } - } - - if (-e $outfile && ($script eq 'postrm' || $script eq 'prerm') - && !compat(5)) { - # Add fragments to top so they run in reverse order when removing. - complex_doit("echo \"# Automatically added by ".basename($0)."\"> $outfile.new"); - autoscript_sed($sed, $infile, "$outfile.new"); - complex_doit("echo '# End automatically added section' >> $outfile.new"); - complex_doit("cat $outfile >> $outfile.new"); - complex_doit("mv $outfile.new $outfile"); - } - else { - complex_doit("echo \"# Automatically added by ".basename($0)."\">> $outfile"); - autoscript_sed($sed, $infile, $outfile); - complex_doit("echo '# End automatically added section' >> $outfile"); - } -} - -sub autoscript_sed { - my $sed = shift; - my $infile = shift; - my $outfile = shift; - if (ref($sed) eq 'CODE') { - open(IN, $infile) or die "$infile: $!"; - open(OUT, ">>$outfile") or die "$outfile: $!"; - while () { $sed->(); print OUT } - close(OUT) or die "$outfile: $!"; - close(IN) or die "$infile: $!"; - } - else { - complex_doit("sed \"$sed\" $infile >> $outfile"); - } -} - -# Adds a trigger to the package -{ - my %VALID_TRIGGER_TYPES = map { $_ => 1 } qw( - interest interest-await interest-noawait - activate activate-await activate-noawait - ); - - sub autotrigger { - my ($package, $trigger_type, $trigger_target) = @_; - my ($triggers_file, $ifd); - - if (not exists($VALID_TRIGGER_TYPES{$trigger_type})) { - require Carp; - confess("Invalid/unknown trigger ${trigger_type}"); - } - return if $dh{NO_ACT}; - - $triggers_file = generated_file($package, 'triggers'); - if ( -f $triggers_file ) { - open($ifd, '<', $triggers_file) - or error("open $triggers_file failed $!"); - } else { - open($ifd, '<', '/dev/null') - or error("open /dev/null failed $!"); - } - open(my $ofd, '>', "${triggers_file}.new") - or error("open ${triggers_file}.new failed: $!"); - while (my $line = <$ifd>) { - next if $line =~ m{\A \Q${triggers_file}\E \s+ - \Q${trigger_target}\E (?:\s|\Z) - }x; - print {$ofd} $line; - } - print {$ofd} '# Triggers added by ' . basename($0) . "\n"; - print {$ofd} "${trigger_type} ${trigger_target}\n"; - close($ofd) or error("closing ${triggers_file}.new failed: $!"); - close($ifd); - doit('mv', '-f', "${triggers_file}.new", $triggers_file); - } -} - -sub generated_file { - my ($package, $filename, $mkdirs) = @_; - my $dir = "debian/.debhelper/generated/${package}"; - my $path = "${dir}/${filename}"; - $mkdirs //= 1; - if ($mkdirs and not -d $dir) { - install_dir($dir); - } - return $path; -} - -# Removes a whole substvar line. -sub delsubstvar { - my $package=shift; - my $substvar=shift; - - my $ext=pkgext($package); - my $substvarfile="debian/${ext}substvars"; - - if (-e $substvarfile) { - complex_doit("grep -a -s -v '^${substvar}=' $substvarfile > $substvarfile.new || true"); - doit("mv", "$substvarfile.new","$substvarfile"); - } -} - -# Adds a dependency on some package to the specified -# substvar in a package's substvar's file. -sub addsubstvar { - my $package=shift; - my $substvar=shift; - my $deppackage=shift; - my $verinfo=shift; - my $remove=shift; - - my $ext=pkgext($package); - my $substvarfile="debian/${ext}substvars"; - my $str=$deppackage; - $str.=" ($verinfo)" if defined $verinfo && length $verinfo; - - # Figure out what the line will look like, based on what's there - # now, and what we're to add or remove. - my $line=""; - if (-e $substvarfile) { - my %items; - open(SUBSTVARS_IN, "$substvarfile") || error "read $substvarfile: $!"; - while () { - chomp; - if (/^\Q$substvar\E=(.*)/) { - %items = map { $_ => 1} split(", ", $1); - - last; - } - } - close SUBSTVARS_IN; - if (! $remove) { - $items{$str}=1; - } - else { - delete $items{$str}; - } - $line=join(", ", sort keys %items); - } - elsif (! $remove) { - $line=$str; - } - - if (length $line) { - complex_doit("(grep -a -s -v ${substvar} $substvarfile; echo ".escape_shell("${substvar}=$line").") > $substvarfile.new"); - doit("mv", "$substvarfile.new", $substvarfile); - } - else { - delsubstvar($package,$substvar); - } -} - -# Reads in the specified file, one line at a time. splits on words, -# and returns an array of arrays of the contents. -# If a value is passed in as the second parameter, then glob -# expansion is done in the directory specified by the parameter ("." is -# frequently a good choice). -sub filedoublearray { - my $file=shift; - my $globdir=shift; - - # executable config files are a v9 thing. - my $x=! compat(8) && -x $file; - if ($x) { - require Cwd; - my $cmd=Cwd::abs_path($file); - $ENV{"DH_CONFIG_ACT_ON_PACKAGES"} = join(",", @{$dh{"DOPACKAGES"}}); - open (DH_FARRAY_IN, "$cmd |") || error("cannot run $file: $!"); - delete $ENV{"DH_CONFIG_ACT_ON_PACKAGES"}; - } - else { - open (DH_FARRAY_IN, $file) || error("cannot read $file: $!"); - } - - my @ret; - while () { - chomp; - # Only ignore comments and empty lines in v5 mode. - if (! compat(4) && ! $x) { - next if /^#/ || /^$/; - } - my @line; - # The tricky bit is that the glob expansion is done - # as if we were in the specified directory, so the - # filenames that come out are relative to it. - if (defined($globdir) && ! $x) { - foreach (map { glob "$globdir/$_" } split) { - s#^$globdir/##; - push @line, $_; - } - } - else { - @line = split; - } - push @ret, [@line]; - } - - close DH_FARRAY_IN || error("problem reading $file: $!"); - - return @ret; -} - -# Reads in the specified file, one word at a time, and returns an array of -# the result. Can do globbing as does filedoublearray. -sub filearray { - return map { @$_ } filedoublearray(@_); -} - -# Passed a filename, returns true if -X says that file should be excluded. -sub excludefile { - my $filename = shift; - foreach my $f (@{$dh{EXCLUDE}}) { - return 1 if $filename =~ /\Q$f\E/; - } - return 0; -} - -{ - my %dpkg_arch_output; - sub dpkg_architecture_value { - my $var = shift; - if (exists($ENV{$var})) { - return $ENV{$var}; - } - elsif (! exists($dpkg_arch_output{$var})) { - local $_; - open(PIPE, '-|', 'dpkg-architecture') - or error("dpkg-architecture failed"); - while () { - chomp; - my ($k, $v) = split(/=/, $_, 2); - $dpkg_arch_output{$k} = $v; - } - close(PIPE); - } - return $dpkg_arch_output{$var}; - } -} - -# Returns the build architecture. -sub buildarch { - dpkg_architecture_value('DEB_HOST_ARCH'); -} - -# Returns the build OS. -sub buildos { - dpkg_architecture_value("DEB_HOST_ARCH_OS"); -} - -# Returns a truth value if this seems to be a cross-compile -sub is_cross_compiling { - return dpkg_architecture_value("DEB_BUILD_GNU_TYPE") - ne dpkg_architecture_value("DEB_HOST_GNU_TYPE"); -} - -# Passed an arch and a list of arches to match against, returns true if matched -{ - my %knownsame; - - sub samearch { - my $arch=shift; - my @archlist=split(/\s+/,shift); - - foreach my $a (@archlist) { - if (exists $knownsame{$arch}{$a}) { - return 1 if $knownsame{$arch}{$a}; - next; - } - - require Dpkg::Arch; - if (Dpkg::Arch::debarch_is($arch, $a)) { - return $knownsame{$arch}{$a}=1; - } - else { - $knownsame{$arch}{$a}=0; - } - } - - return 0; - } -} - -# Returns source package name -sub sourcepackage { - open (CONTROL, 'debian/control') || - error("cannot read debian/control: $!\n"); - while () { - chomp; - s/\s+$//; - if (/^Source:\s*(.*)/i) { - close CONTROL; - return $1; - } - } - - close CONTROL; - error("could not find Source: line in control file."); -} - -# Returns a list of packages in the control file. -# Pass "arch" or "indep" to specify arch-dependant (that will be built -# for the system's arch) or independant. If nothing is specified, -# returns all packages. Also, "both" returns the union of "arch" and "indep" -# packages. -# -# As a side effect, populates %package_arches and %package_types -# with the types of all packages (not only those returned). -my (%package_types, %package_arches, %package_multiarches, %packages_by_type, - %package_sections); -sub getpackages { - my ($type) = @_; - error("getpackages: First argument must be one of \"arch\", \"indep\", or \"both\"") - if defined($type) and $type ne 'both' and $type ne 'indep' and $type ne 'arch'; - - $type //= 'all-listed-in-control-file'; - - if (%packages_by_type) { - return @{$packages_by_type{$type}}; - } - - $packages_by_type{$_} = [] for qw(both indep arch all-listed-in-control-file); - - - my $package=""; - my $arch=""; - my $section=""; - my ($package_type, $multiarch, %seen, @profiles, $source_section, - $included_in_build_profile); - if (exists $ENV{'DEB_BUILD_PROFILES'}) { - @profiles=split /\s+/, $ENV{'DEB_BUILD_PROFILES'}; - } - open (CONTROL, 'debian/control') || - error("cannot read debian/control: $!\n"); - while () { - chomp; - s/\s+$//; - if (/^Package:\s*(.*)/i) { - $package=$1; - # Detect duplicate package names in the same control file. - if (! $seen{$package}) { - $seen{$package}=1; - } - else { - error("debian/control has a duplicate entry for $package"); - } - $package_type="deb"; - $included_in_build_profile=1; - } - if (/^Section:\s(.*)\s*$/i) { - $section = $1; - } - if (/^Architecture:\s*(.*)/i) { - $arch=$1; - } - if (/^(?:X[BC]*-)?Package-Type:\s*(.*)/i) { - $package_type=$1; - } - if (/^Multi-Arch: \s*(.*)\s*/i) { - $multiarch = $1; - } - # rely on libdpkg-perl providing the parsing functions because - # if we work on a package with a Build-Profiles field, then a - # high enough version of dpkg-dev is needed anyways - if (/^Build-Profiles:\s*(.*)/i) { - my $build_profiles=$1; - eval { - require Dpkg::BuildProfiles; - my @restrictions=Dpkg::BuildProfiles::parse_build_profiles($build_profiles); - if (@restrictions) { - $included_in_build_profile=Dpkg::BuildProfiles::evaluate_restriction_formula(\@restrictions, \@profiles); - } - }; - if ($@) { - error("The control file has a Build-Profiles field. Requires libdpkg-perl >= 1.17.14"); - } - } - - if (!$_ or eof) { # end of stanza. - if ($package) { - $package_types{$package}=$package_type; - $package_arches{$package}=$arch; - $package_multiarches{$package} = $multiarch; - $package_sections{$package} = $section || $source_section; - if ($included_in_build_profile) { - push(@{$packages_by_type{'all-listed-in-control-file'}}, $package); - if ($arch eq 'all') { - push(@{$packages_by_type{'indep'}}, $package); - push(@{$packages_by_type{'both'}}, $package); - } elsif ($arch eq 'any' || - ($arch ne 'all' && samearch(buildarch(), $arch))) { - push(@{$packages_by_type{'arch'}}, $package); - push(@{$packages_by_type{'both'}}, $package); - } - } - } elsif ($section and not defined($source_section)) { - $source_section = $section; - } - $package=''; - $arch=''; - $section=''; - } - } - close CONTROL; - - return @{$packages_by_type{$type}}; -} - -# Returns the arch a package will build for. -sub package_arch { - my $package=shift; - - if (! exists $package_arches{$package}) { - warning "package $package is not in control info"; - return buildarch(); - } - return $package_arches{$package} eq 'all' ? "all" : buildarch(); -} - -# Returns the multiarch value of a package. -sub package_multiarch { - my $package=shift; - - # Test the architecture field instead, as it is common for a - # package to not have a multi-arch value. - if (! exists $package_arches{$package}) { - warning "package $package is not in control info"; - # The only sane default - return 'no'; - } - return $package_multiarches{$package} // 'no'; -} - -# Returns the (raw) section value of a package (possibly including component). -sub package_section { - my ($package) = @_; - - # Test the architecture field instead, as it is common for a - # package to not have a multi-arch value. - if (! exists $package_sections{$package}) { - warning "package $package is not in control info"; - return 'unknown'; - } - return $package_sections{$package} // 'unknown'; -} - -# Return true if a given package is really a udeb. -sub is_udeb { - my $package=shift; - - if (! exists $package_types{$package}) { - warning "package $package is not in control info"; - return 0; - } - return $package_types{$package} eq 'udeb'; -} - -# Handles #DEBHELPER# substitution in a script; also can generate a new -# script from scratch if none exists but there is a .debhelper file for it. -sub debhelper_script_subst { - my $package=shift; - my $script=shift; - - my $tmp=tmpdir($package); - my $ext=pkgext($package); - my $file=pkgfile($package,$script); - - if ($file ne '') { - if (-f "debian/$ext$script.debhelper") { - # Add this into the script, where it has #DEBHELPER# - complex_doit("perl -pe 's~#DEBHELPER#~qx{cat debian/$ext$script.debhelper}~eg' < $file > $tmp/DEBIAN/$script"); - } - else { - # Just get rid of any #DEBHELPER# in the script. - complex_doit("sed s/#DEBHELPER#// < $file > $tmp/DEBIAN/$script"); - } - doit("chown","0:0","$tmp/DEBIAN/$script"); - doit("chmod","0755","$tmp/DEBIAN/$script"); - } - elsif ( -f "debian/$ext$script.debhelper" ) { - complex_doit("printf '#!/bin/sh\nset -e\n' > $tmp/DEBIAN/$script"); - complex_doit("cat debian/$ext$script.debhelper >> $tmp/DEBIAN/$script"); - doit("chown","0:0","$tmp/DEBIAN/$script"); - doit("chmod","0755","$tmp/DEBIAN/$script"); - } -} - - -# make_symlink($dest, $src[, $tmp]) creates a symlink from $dest -> $src. -# if $tmp is given, $dest will be created within it. -# Usually $tmp should be the value of tmpdir($package); -sub make_symlink{ - my $dest = shift; - my $src = _expand_path(shift); - my $tmp = shift; - $tmp = '' if not defined($tmp); - $src=~s:^/::; - $dest=~s:^/::; - - if ($src eq $dest) { - warning("skipping link from $src to self"); - return; - } - - # Make sure the directory the link will be in exists. - my $basedir=dirname("$tmp/$dest"); - if (! -e $basedir) { - install_dir($basedir); - } - - # Policy says that if the link is all within one toplevel - # directory, it should be relative. If it's between - # top level directories, leave it absolute. - my @src_dirs=split(m:/+:,$src); - my @dest_dirs=split(m:/+:,$dest); - if (@src_dirs > 0 && $src_dirs[0] eq $dest_dirs[0]) { - # Figure out how much of a path $src and $dest - # share in common. - my $x; - for ($x=0; $x < @src_dirs && $src_dirs[$x] eq $dest_dirs[$x]; $x++) {} - # Build up the new src. - $src=""; - for (1..$#dest_dirs - $x) { - $src.="../"; - } - for ($x .. $#src_dirs) { - $src.=$src_dirs[$_]."/"; - } - if ($x > $#src_dirs && ! length $src) { - $src="."; # special case - } - $src=~s:/$::; - } - else { - # Make sure it's properly absolute. - $src="/$src"; - } - - if (-d "$tmp/$dest" && ! -l "$tmp/$dest") { - error("link destination $tmp/$dest is a directory"); - } - doit("rm", "-f", "$tmp/$dest"); - doit("ln","-sf", $src, "$tmp/$dest"); -} - -# _expand_path expands all path "." and ".." components, but doesn't -# resolve symbolic links. -sub _expand_path { - my $start = @_ ? shift : '.'; - my @pathname = split(m:/+:,$start); - my @respath; - for my $entry (@pathname) { - if ($entry eq '.' || $entry eq '') { - # Do nothing - } - elsif ($entry eq '..') { - if ($#respath == -1) { - # Do nothing - } - else { - pop @respath; - } - } - else { - push @respath, $entry; - } - } - - my $result; - for my $entry (@respath) { - $result .= '/' . $entry; - } - if (! defined $result) { - $result="/"; # special case - } - return $result; -} - -# Checks if make's jobserver is enabled via MAKEFLAGS, but -# the FD used to communicate with it is actually not available. -sub is_make_jobserver_unavailable { - if (exists $ENV{MAKEFLAGS} && - $ENV{MAKEFLAGS} =~ /(?:^|\s)--jobserver-fds=(\d+)/) { - if (!open(my $in, "<&$1")) { - return 1; # unavailable - } - else { - close $in; - return 0; # available - } - } - - return; # no jobserver specified -} - -# Cleans out jobserver options from MAKEFLAGS. -sub clean_jobserver_makeflags { - if (exists $ENV{MAKEFLAGS}) { - if ($ENV{MAKEFLAGS} =~ /(?:^|\s)--jobserver-fds=(\d+)/) { - $ENV{MAKEFLAGS} =~ s/(?:^|\s)--jobserver-fds=\S+//g; - $ENV{MAKEFLAGS} =~ s/(?:^|\s)-j\b//g; - } - delete $ENV{MAKEFLAGS} if $ENV{MAKEFLAGS} =~ /^\s*$/; - } -} - -# If cross-compiling, returns appropriate cross version of command. -sub cross_command { - my $command=shift; - if (is_cross_compiling()) { - return dpkg_architecture_value("DEB_HOST_GNU_TYPE")."-$command"; - } - else { - return $command; - } -} - -# Returns the SOURCE_DATE_EPOCH ENV variable if set OR computes it -# from the latest changelog entry, sets the SOURCE_DATE_EPOCH ENV -# variable and returns the computed value. -sub get_source_date_epoch { - return $ENV{SOURCE_DATE_EPOCH} if exists($ENV{SOURCE_DATE_EPOCH}); - eval "use Dpkg::Changelog::Debian"; - if ($@) { - warning "unable to set SOURCE_DATE_EPOCH: $@"; - return; - } - eval "use Time::Piece"; - if ($@) { - warning "unable to set SOURCE_DATE_EPOCH: $@"; - return; - } - - my $changelog = Dpkg::Changelog::Debian->new(range => {"count" => 1}); - $changelog->load("debian/changelog"); - - my $tt = @{$changelog}[0]->get_timestamp(); - $tt =~ s/\s*\([^\)]+\)\s*$//; # Remove the optional timezone codename - my $timestamp = Time::Piece->strptime($tt, "%a, %d %b %Y %T %z"); - - return $ENV{SOURCE_DATE_EPOCH} = $timestamp->epoch(); -} - -# Sets environment variables from dpkg-buildflags. Avoids changing -# any existing environment variables. -sub set_buildflags { - return if $ENV{DH_INTERNAL_BUILDFLAGS}; - $ENV{DH_INTERNAL_BUILDFLAGS}=1; - - # For the side effect of computing the SOURCE_DATE_EPOCH variable. - get_source_date_epoch(); - - return if compat(8); - - eval "use Dpkg::BuildFlags"; - if ($@) { - warning "unable to load build flags: $@"; - return; - } - - my $buildflags = Dpkg::BuildFlags->new(); - $buildflags->load_config(); - foreach my $flag ($buildflags->list()) { - next unless $flag =~ /^[A-Z]/; # Skip flags starting with lowercase - if (! exists $ENV{$flag}) { - $ENV{$flag} = $buildflags->get($flag); - } - } -} - -# Gets a DEB_BUILD_OPTIONS option, if set. -sub get_buildoption { - my $wanted=shift; - - return undef unless exists $ENV{DEB_BUILD_OPTIONS}; - - foreach my $opt (split(/\s+/, $ENV{DEB_BUILD_OPTIONS})) { - # currently parallel= is the only one with a parameter - if ($opt =~ /^parallel=(-?\d+)$/ && $wanted eq 'parallel') { - return $1; - } - elsif ($opt eq $wanted) { - return 1; - } - } -} - -# install a dh config file (e.g. debian/.lintian-overrides) into -# the package. Under compat 9+ it may execute the file and use its -# output instead. -# -# install_dh_config_file(SOURCE, TARGET[, MODE]) -sub install_dh_config_file { - my ($source, $target, $mode) = @_; - $mode = 0644 if not defined($mode); - - if (!compat(8) and -x $source) { - my @sstat = stat($source) || error("cannot stat $source: $!"); - open(my $tfd, '>', $target) || error("cannot open $target: $!"); - chmod($mode, $tfd) || error("cannot chmod $target: $!"); - open(my $sfd, '-|', $source) || error("cannot run $source: $!"); - while (my $line = <$sfd>) { - print ${tfd} $line; - } - if (!close($sfd)) { - error("cannot close handle from $source: $!") if $!; - error_exitcode($source); - } - close($tfd) || error("cannot close $target: $!"); - # Set the mtime (and atime) to ensure reproducibility. - utime($sstat[9], $sstat[9], $target); - } else { - my $str_mode = sprintf('%#4o', $mode); - doit('install', '-p', "-m${str_mode}", $source, $target); - } - return 1; -} - -sub restore_file_on_clean { - my ($file) = @_; - my $bucket_index = 'debian/.debhelper/bucket/index'; - my $bucket_dir = 'debian/.debhelper/bucket/files'; - my $checksum; - if (not -d $bucket_dir) { - install_dir($bucket_dir); - } - if ($file =~ m{^/}) { - error("restore_file_on_clean requires a path relative to the package dir"); - } - $file =~ s{^\./}{}g; - $file =~ s{//++}{}g; - if ($file =~ m{^\.} or $file =~ m{/CVS/} or $file =~ m{/\.svn/}) { - # We do not want to smash a Vcs repository by accident. - warning("Attempt to store $file, which looks like a VCS file or"); - warning("a hidden package file (like quilt's \".pc\" directory"); - error("This tool probably contains a bug."); - } - if (-l $file or not -f _) { - error("Cannot store $file, which is a non-file (incl. a symlink)"); - } - require Digest::SHA; - - $checksum = Digest::SHA->new('256')->addfile($file, 'b')->hexdigest; - - if (not $dh{NO_ACT}) { - my ($in_index); - open(my $fd, '+>>', $bucket_index) - or error("open($bucket_index, a+) failed: $!"); - seek($fd, 0, 0); - while (my $line = <$fd>) { - my ($cs, $stored_file); - chomp($line); - ($cs, $stored_file) = split(m/ /, $line, 2); - next if ($stored_file ne $file); - $in_index = 1; - } - if (not $in_index) { - # Copy and then rename so we always have the full copy of - # the file in the correct place (if any at all). - doit('cp', '-an', '--reflink=auto', $file, "${bucket_dir}/${checksum}.tmp"); - doit('mv', '-f', "${bucket_dir}/${checksum}.tmp", "${bucket_dir}/${checksum}"); - print {$fd} "${checksum} ${file}\n"; - } - close($fd) or error("close($bucket_index) failed: $!"); - } - - return 1; -} - -sub restore_all_files { - my $bucket_index = 'debian/.debhelper/bucket/index'; - my $bucket_dir = 'debian/.debhelper/bucket/files'; - - return if not -f $bucket_index; - open(my $fd, '<', $bucket_index) - or error("open($bucket_index) failed: $!"); - - while (my $line = <$fd>) { - my ($cs, $stored_file, $bucket_file); - chomp($line); - ($cs, $stored_file) = split(m/ /, $line, 2); - $bucket_file = "${bucket_dir}/${cs}"; - # Restore by copy and then rename. This ensures that: - # 1) If dh_clean is interrupted, we can always do a full restore again - # (otherwise, we would be missing some of the files and have to handle - # that with scary warnings) - # 2) The file is always fully restored or in its "pre-restore" state. - doit('cp', '-an', '--reflink=auto', $bucket_file, "${bucket_file}.tmp"); - doit('mv', '-Tf', "${bucket_file}.tmp", $stored_file); - } - close($fd); - return; -} - - -1 - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/Debian/Debhelper/Sequence/python_support.pm debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Sequence/python_support.pm --- debhelper-9.20160115ubuntu3/Debian/Debhelper/Sequence/python_support.pm 2015-05-15 16:20:39.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/Debian/Debhelper/Sequence/python_support.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -#!/usr/bin/perl -# debhelper sequence file for python-support - -use warnings; -use strict; -use Debian::Debhelper::Dh_Lib; - -# Test if dh_pysupport is available before inserting it. -# (This would not be needed if this file was contained in the python-support -# package.) -if (-x "/usr/bin/dh_pysupport") { - insert_before("dh_installinit", "dh_pysupport"); -} - -1 - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh debhelper-11ubuntu1~16.04.york0/dh --- debhelper-9.20160115ubuntu3/dh 2016-01-14 21:33:45.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh 2017-12-02 08:46:03.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B I [B<--with> I[B<,>I ...]] [B<--list>] [S>] @@ -62,6 +64,10 @@ List all available addons. +When called only with this option, B can be called from any +directory (i.e. it does not need access to files from a source +package). + =item B<--no-act> Prints commands that would run for a given sequence, but does not run them. @@ -127,18 +133,8 @@ dh_fixperms chmod 4755 debian/foo/usr/bin/foo -If your package uses autotools and you want to freshen F and -F with newer versions from the B package -at build time, you can use some commands provided in B -that automate it, like this. - - #!/usr/bin/make -f - %: - dh $@ --with autotools_dev - Python tools are not run by dh by default, due to the continual change -in that area. (Before compatibility level v9, dh does run B.) -Here is how to use B. +in that area. Here is how to use B. #!/usr/bin/make -f %: @@ -222,15 +218,29 @@ If you're curious about B's internals, here's how it works under the hood. -Each debhelper command will record when it's successfully run in -F. (Which B deletes.) So B can tell -which commands have already been run, for which packages, and skip running -those commands again. - -Each time B is run, it examines the log, and finds the last logged command -that is in the specified sequence. It then continues with the next command -in the sequence. The B<--until>, B<--before>, B<--after>, and B<--remaining> -options can override this behavior. +In compat 10 (or later), B creates a stamp file +F after the build step(s) are complete +to avoid re-running them. It is possible to avoid the stamp file by +passing B<--without=build-stamp> to B. This makes "no clean" +builds behave more like what some people expect at the expense of +possibly running the build and test twice (the second time as root or +under L). + +Inside an override target, B commands will create a log file +F to keep track of which packages the +command(s) have been run for. These log files are then removed once +the override target is complete. + +In compat 9 or earlier, each debhelper command will record +when it's successfully run in F. (Which +B deletes.) So B can tell which commands have already +been run, for which packages, and skip running those commands again. + +Each time B is run (in compat 9 or earlier), it examines the log, +and finds the last logged command that is in the specified +sequence. It then continues with the next command in the sequence. The +B<--until>, B<--before>, B<--after>, and B<--remaining> options can +override this behavior (though they were removed in compat 10). A sequence can also run dependent targets in debian/rules. For example, the "binary" sequence runs the "install" target. @@ -282,11 +292,19 @@ # Stash this away before init modifies it. my @ARGV_orig=@ARGV; -if (compat(8, 1)) { - # python-support was enabled by default before v9. - # (and comes first so python-central loads later and can disable it). - unshift @ARGV, "--with=python-support"; +if (not compat(9, 1)) { + # Enable autoreconf'ing by default in compat 10 or later. Use the + # sequence add-on so existing --without=autoreconf + unshift(@ARGV, "--with=autoreconf"); + # Enable systemd support by default in compat 10 or later. + # - compat 11 injects the dh_installsystemd tool directly in the + # sequence instead of using a --with sequence. + unshift(@ARGV, "--with=systemd") if compat(10, 1); + unshift(@ARGV, "--with=build-stamp"); } + + +inhibit_log(); init(options => { "until=s" => \$dh{UNTIL}, @@ -311,7 +329,6 @@ # Bundling does not work well since there are unknown options. bundling => 0, ); -inhibit_log(); set_buildflags(); warn_deprecated(); @@ -360,15 +377,12 @@ my @bd_minimal = qw{ dh_testdir }; -my @bd = (qw{ - dh_testdir +my @bd = (@bd_minimal, qw{ dh_update_autotools_config dh_auto_configure dh_auto_build dh_auto_test -}, - "create-stamp ${build_stamp_file}", -); +}); my @i = (qw{ dh_testroot dh_prep @@ -388,6 +402,10 @@ dh_installifupdown dh_installinfo dh_installinit +}, + (!compat(10) ? qw(dh_installsystemd) : qw()), + +qw{ dh_installmenu dh_installmime dh_installmodules @@ -408,11 +426,10 @@ dh_link dh_installwm dh_installxfonts -}, - optional_command('dh_strip_nondeterminism'), -qw{ + dh_strip_nondeterminism dh_compress dh_fixperms + dh_missing }); my @ba=qw{ dh_strip @@ -428,8 +445,7 @@ dh_md5sums dh_builddeb }; -$sequences{clean} = [qw{ - dh_testdir +$sequences{clean} = [@bd_minimal, qw{ dh_auto_clean dh_clean }]; @@ -460,9 +476,7 @@ # sequence addon interface sub _insert { - my $offset=shift; - my $existing=shift; - my $new=shift; + my ($offset, $existing, $new) = @_; foreach my $sequence (keys %sequences) { my @list=@{$sequences{$sequence}}; next unless grep $existing, @list; @@ -487,27 +501,30 @@ _insert(1, @_); } sub remove_command { - my $command=shift; + my ($command) = @_; foreach my $sequence (keys %sequences) { $sequences{$sequence}=[grep { $_ ne $command } @{$sequences{$sequence}}]; } } sub add_command { - my $command=shift; - my $sequence=shift; + my ($command, $sequence) = @_; unshift @{$sequences{$sequence}}, $command; } +sub add_command_at_end { + my ($command, $sequence) = @_; + push(@{$sequences{$sequence}}, $command); +} sub add_command_options { my $command=shift; push @{$command_opts{$command}}, @_; } sub remove_command_options { - my $command=shift; - if (@_) { + my ($command, @cmd_options) = @_; + if (@cmd_options) { # Remove only specified options if (my $opts = $command_opts{$command}) { - foreach my $opt (@_) { + foreach my $opt (@cmd_options) { $opts = [ grep { $_ ne $opt } @$opts ]; } $command_opts{$command} = $opts; @@ -523,7 +540,7 @@ my %addons; for my $inc (@INC) { - eval q{use File::Spec}; + require File::Spec; my $path = File::Spec->catdir($inc, "Debian/Debhelper/Sequence"); if (-d $path) { for my $module_path (glob "$path/*.pm") { @@ -565,6 +582,7 @@ # Filter out options intended only for this program. my @options; my $user_specified_options=0; +my $build_system_options = 0; if ($sequence eq 'build-arch' || $sequence eq 'install-arch' || $sequence eq 'binary-arch') { @@ -606,6 +624,7 @@ next if $max_parallel == 1; } push @options, "-O".$opt; + $build_system_options = 1 if $opt ne '--no-parallel' and $opt ne '--parallel'; $user_specified_options=1 unless $opt =~ /^--((?:no-)?parallel|buildsystem|sourcedirectory|builddirectory|)/; } @@ -637,12 +656,23 @@ close($fd); } +# Lazy cache of the result of optimize_sequence on the "build" +# sequence +my $optimized_build_seq; foreach my $package (@packages) { my @log; if (compat(9)) { @log = load_log($package, \%logged); } elsif (exists($stamp_file{$package})) { - @log = @bd; + if (not defined($optimized_build_seq)) { + # Expand "build" so we can accurately filter out + # everything (admittedly, it is bit of an over + # approximation) + # Related bug: #851071 + my @seq = optimize_sequence(@{$sequences{'build'}}); + $optimized_build_seq = \@seq; + } + @log = @{$optimized_build_seq}; # We do not need %logged in compat 10 } if ($dh{AFTER}) { @@ -714,12 +744,18 @@ next; } if (my $stamp_file = stamp_target($command)) { - my @contents; + my %seen; + print " create-stamp ".escape_shell($stamp_file)."\n"; + + next if $dh{NO_ACT}; open(my $fd, '+>>', $stamp_file) or error("open($stamp_file, rw) failed: $!"); # Seek to the beginning seek($fd, 0, 0) or error("seek($stamp_file) failed: $!"); - @contents = map { chomp } <$fd>; - for my $pkg (@todo) { + while (my $line = <$fd>) { + chomp($line); + $seen{$line} = 1; + } + for my $pkg (grep { not exists $seen{$_} } @todo) { print {$fd} "$pkg\n"; } close($fd) or error("close($stamp_file) failed: $!"); @@ -764,8 +800,7 @@ } sub run { - my $command=shift; - my @options=@_; + my ($command, @options) = @_; # Include additional command options if any unshift @options, @{$command_opts{$command}} @@ -778,8 +813,8 @@ } return if $dh{NO_ACT}; - - my $ret=system($command, @options); + + my $ret=system { $command } $command, @options; if ($ret >> 8 != 0) { exit $ret >> 8; } @@ -791,10 +826,7 @@ # Tries to run an override target for a command. Returns the list of # packages that it was unable to run an override target for. sub run_override { - my $override_type=shift; # arch, indep, or undef - my $command=shift; - my @packages=@{shift()}; - my @options=@_; + my ($override_type, $command, $packages, @options) = @_; my $override="override_$command". (defined $override_type ? "-".$override_type : ""); @@ -802,25 +834,25 @@ # Check which packages are of the right architecture for the # override_type. my (@todo, @rest); + my $has_explicit_target = rules_explicit_target($override); + if (defined $override_type) { - foreach my $package (@packages) { - my $isall=package_arch($package) eq 'all'; + foreach my $package (@{$packages}) { + my $isall=package_is_arch_all($package); if (($override_type eq 'indep' && $isall) || - ($override_type eq 'arch' && !$isall)) { + ($override_type eq 'arch' && !$isall)) { push @todo, $package; - } - else { + } else { push @rest, $package; push @options, "-N$package"; } } } else { - @todo=@packages; + @todo=@{$packages}; } - my $has_explicit_target = rules_explicit_target($override); - return @packages unless defined $has_explicit_target; # no such override + return @{$packages} unless defined $has_explicit_target; # no such override return @rest if ! $has_explicit_target; # has empty override return @rest unless @todo; # has override, but no packages to act on @@ -831,6 +863,12 @@ push @options, $opt unless grep { $_ eq $opt } @options; } + # Discard any override log files before calling the override + # target + if (not compat(9)) { + my @files = glob('debian/*.debhelper.log'); + rm_files(@files) if @files; + } # This passes the options through to commands called # inside the target. $ENV{DH_INTERNAL_OPTIONS}=join("\x1e", @options); @@ -838,7 +876,6 @@ run("debian/rules", $override); delete $ENV{DH_INTERNAL_OPTIONS}; delete $ENV{DH_INTERNAL_OVERRIDE}; - complex_doit("rm","-f","debian/*.debhelper.log") if not compat(9); # Update log for overridden command now that it has # finished successfully. @@ -849,12 +886,17 @@ commit_override_log(@todo); } + # Override targets may introduce new helper files. Strictly + # speaking this *shouldn't* be necessary, but lets make no + # assumptions. + Debian::Debhelper::Dh_Lib::dh_clear_unsafe_cache(); + return @rest; } sub optimize_sequence { - my @sequence; - my %seen; + my (@commands) = @_; + my (@sequence, %seen); my $add=sub { # commands can appear multiple times when sequences are # inlined together; only the first should be needed @@ -864,7 +906,7 @@ push @sequence, $command; } }; - foreach my $command (@_) { + foreach my $command (@commands) { my $rules_target=rules_target($command); if (defined $rules_target && ! defined rules_explicit_target($rules_target)) { @@ -879,7 +921,7 @@ } sub rules_target { - my $command=shift; + my ($command) = @_; if ($command =~ /^debian\/rules\s+(.*)/) { return $1 } @@ -909,7 +951,7 @@ # in debian/rules. # undef is returned if target does not exist, 0 if target is noop # and 1 if target has dependencies or executes commands. - my $target=shift; + my ($target) = @_; if (! $rules_parsed) { my $processing_targets = 0; @@ -975,8 +1017,7 @@ } sub command_pos { - my $command=shift; - my @sequence=@_; + my ($command, @sequence) = @_; foreach my $i (0..$#sequence) { if ($command eq $sequence[$i]) { @@ -1000,8 +1041,7 @@ my %skipinfo; sub can_skip { - my $command=shift; - my @packages=@_; + my ($command, @packages) = @_; return 0 if $user_specified_options || (exists $ENV{DH_OPTIONS} && length $ENV{DH_OPTIONS}); @@ -1011,43 +1051,57 @@ } my @skipinfo=@{$skipinfo{$command}}; return 0 unless @skipinfo; + return 1 if scalar(@skipinfo) == 1 and $skipinfo[0] eq 'always-skip'; + my $all_pkgs; - foreach my $package (@packages) { - foreach my $skipinfo (@skipinfo) { - if ($skipinfo=~/^tmp\((.*)\)$/) { - my $need=$1; - my $tmp=tmpdir($package); - return 0 if -e "$tmp/$need"; - } - elsif (pkgfile($package, $skipinfo) ne '') { + foreach my $skipinfo (@skipinfo) { + if ($skipinfo=~/^([a-zA-Z0-9-_]+)\((.*)\)$/) { + my $type = $1; + my $need = $2; + if ($type eq 'tmp') { + foreach my $package (@packages) { + my $tmp = tmpdir($package); + return 0 if -e "$tmp/$need"; + } + } elsif ($type eq 'pkgfile' or $type eq 'pkgfile-logged') { + my $pkgs; + if ($type eq 'pkgfile') { + $pkgs = \@packages; + } else { + $all_pkgs //= [getpackages()]; + $pkgs = $all_pkgs; + } + # Use the secret bulk check call + return 0 if pkgfile($pkgs, $need) ne ''; + } elsif ($type eq 'buildsystem') { + # If there are any buildsystem options, we assume that + # the build needs a buildsystem. + return 0 if $build_system_options; + require Debian::Debhelper::Dh_Buildsystems; + my $system = Debian::Debhelper::Dh_Buildsystems::load_buildsystem(undef, $need); + return 0 if defined($system); + } else { + # Unknown hint - make no assumptions return 0; } + } else { + # Use the secret bulk check call + return 0 if pkgfile(\@packages, $skipinfo) ne ''; } } return 1; } -sub optional_command { - my ($command) = @_; - - foreach my $dir (split(':', $ENV{'PATH'})) { - if (open(my $h, '<', "$dir/$command")) { - close($h); - return ($command); - } - } - return; -} - sub extract_skipinfo { - my $command=shift; + my ($command) = @_; foreach my $dir (split (':', $ENV{PATH})) { if (open (my $h, "<", "$dir/$command")) { while (<$h>) { - if (m/PROMISE: DH NOOP WITHOUT\s+(.*)/) { + if (m/PROMISE: DH NOOP( WITHOUT\s+(.*))?\s*$/) { close $h; - return split(' ', $1); + return split(' ', $2) if defined($2); + return ('always-skip'); } } close $h; @@ -1067,9 +1121,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_auto_build debhelper-11ubuntu1~16.04.york0/dh_auto_build --- debhelper-9.20160115ubuntu3/dh_auto_build 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_auto_build 2017-11-28 12:40:27.000000000 +0000 @@ -8,8 +8,11 @@ use strict; use warnings; +use Debian::Debhelper::Dh_Lib; use Debian::Debhelper::Dh_Buildsystems; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [S>] [S I>] @@ -42,6 +45,8 @@ =cut +# PROMISE: DH NOOP WITHOUT buildsystem(build) + buildsystems_init(); buildsystems_do(); @@ -56,9 +61,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_auto_clean debhelper-11ubuntu1~16.04.york0/dh_auto_clean --- debhelper-9.20160115ubuntu3/dh_auto_clean 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_auto_clean 2017-11-28 12:40:27.000000000 +0000 @@ -11,6 +11,8 @@ use Debian::Debhelper::Dh_Lib; use Debian::Debhelper::Dh_Buildsystems; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [S>] [S I>] @@ -44,6 +46,8 @@ =cut +# PROMISE: DH NOOP WITHOUT buildsystem(clean) + inhibit_log(); buildsystems_init(); buildsystems_do(); @@ -59,9 +63,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_auto_configure debhelper-11ubuntu1~16.04.york0/dh_auto_configure --- debhelper-9.20160115ubuntu3/dh_auto_configure 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_auto_configure 2017-11-28 12:40:27.000000000 +0000 @@ -8,8 +8,11 @@ use strict; use warnings; +use Debian::Debhelper::Dh_Lib; use Debian::Debhelper::Dh_Buildsystems; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [S>] [S I>] @@ -47,6 +50,8 @@ =cut +# PROMISE: DH NOOP WITHOUT buildsystem(configure) + buildsystems_init(); buildsystems_do(); @@ -61,9 +66,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_auto_install debhelper-11ubuntu1~16.04.york0/dh_auto_install --- debhelper-9.20160115ubuntu3/dh_auto_install 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_auto_install 2017-11-28 12:40:27.000000000 +0000 @@ -13,6 +13,8 @@ use File::Spec; use Cwd; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [S>] [S I>] @@ -69,6 +71,8 @@ "destdir=s" => \$destdir, }); +# PROMISE: DH NOOP WITHOUT buildsystem(install) + # If destdir is not specified, determine it automatically if (!$destdir) { my @allpackages=getpackages(); @@ -81,11 +85,11 @@ } $destdir = File::Spec->rel2abs($destdir, cwd()); -foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - if (! -e $tmp) { - install_dir($tmp); - } +if (compat(10)) { + # Ensure that all debian/ directories exist + install_dir(map { tmpdir($_) } @{$dh{DOPACKAGES}}); +} else { + install_dir($destdir); } buildsystems_do("install", $destdir); @@ -101,9 +105,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_auto_test debhelper-11ubuntu1~16.04.york0/dh_auto_test --- debhelper-9.20160115ubuntu3/dh_auto_test 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_auto_test 2017-11-28 12:40:27.000000000 +0000 @@ -11,6 +11,8 @@ use Debian::Debhelper::Dh_Lib; use Debian::Debhelper::Dh_Buildsystems; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [S>] [S I>] @@ -48,11 +50,10 @@ If the B environment variable contains B, no tests will be performed. -dh_auto_test does not run the test suite when a package is being cross -compiled. - =cut +# PROMISE: DH NOOP WITHOUT buildsystem(test) + if (get_buildoption("nocheck")) { exit 0; } @@ -71,9 +72,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_bugfiles debhelper-11ubuntu1~16.04.york0/dh_bugfiles --- debhelper-9.20160115ubuntu3/dh_bugfiles 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_bugfiles 2017-11-28 13:11:33.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [B<-A>] [S>] @@ -103,11 +105,11 @@ elsif (scalar(keys(%bugfiles)) > 0) { if (-f $dir) { # Move usr/share/bug/$package to usr/share/bug/$package/script - doit("mv", $dir, "${dir}.tmp"); + rename_path($dir, "${dir}.tmp"); install_dir($dir); - doit("mv", "${dir}.tmp", "$dir/script"); + rename_path("${dir}.tmp", "$dir/script"); } - elsif (! -d $dir) { + else { install_dir($dir); } while (my ($type, $srcfile) = each(%bugfiles)) { @@ -121,10 +123,10 @@ # Ensure that the bug script is executable if (-f $dir) { - chmod 0755, $dir; + reset_perm_and_owner(0755, $dir); } elsif (-f "$dir/script") { - chmod 0755, "$dir/script"; + reset_perm_and_owner(0755, "$dir/script"); } } @@ -141,15 +143,3 @@ Modestas Vainius =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_builddeb debhelper-11ubuntu1~16.04.york0/dh_builddeb --- debhelper-9.20160115ubuntu3/dh_builddeb 2016-01-14 19:51:16.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_builddeb 2017-11-28 12:40:27.000000000 +0000 @@ -1,5 +1,7 @@ #!/usr/bin/perl +=encoding UTF-8 + =head1 NAME dh_builddeb - build Debian binary packages @@ -10,6 +12,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<--destdir=>I] [B<--filename=>I] [S I>] @@ -23,6 +27,10 @@ It supports building multiple binary packages in parallel, when enabled by DEB_BUILD_OPTIONS. +When the I field is not (effectively) +I, B will pass B<--root-owner-group> to +L. + =head1 OPTIONS =over 4 @@ -68,128 +76,108 @@ $dh{FILENAME}="/$dh{FILENAME}"; } -my $max_procs=get_buildoption("parallel") || 1; - -my $processes=1; -my $exit=0; -sub reap { - if (wait == -1) { - $processes=0; - } - else { - $processes--; - $exit=1 if $? != 0; - } -} - -sub default_compressor_args { - my ($default_comp, @args) = @_; - - for my $arg (@args) { - # Explicit compressor arg given - return @args if $arg =~ m/^-Z/; - } - - return (@{$default_comp}, @args); -} - sub build_and_rename_deb { my ($package, $destdir, $cmd, $rename_sub) = @_; my $build_dir = "debian/.debhelper/scratch-space/build-${package}"; my ($dpkg_filename, $desired_filename); - if ( ! -d $build_dir) { - install_dir($build_dir); - } + install_dir($build_dir); doit(@${cmd}, $build_dir); - opendir(my $fd, $build_dir); + opendir(my $fd, $build_dir) or error("opendir($build_dir) failed: $!"); for my $name (readdir($fd)) { next if $name eq '.' or $name eq '..'; if ($dpkg_filename) { - error("\"@{$cmd}\" produced two debs: $dpkg_filename and $name"); + error("\"@{$cmd} ${build_dir}\" produced two debs: $dpkg_filename and $name"); } $dpkg_filename = $name; } closedir($fd); + if (not defined($dpkg_filename)) { + error("\"@{$cmd} ${build_dir}\" did not produce *any* file but was successful!?"); + } local $_ = $dpkg_filename; $rename_sub->(); $desired_filename = $_; if ($desired_filename ne $dpkg_filename) { print "\tRenaming $dpkg_filename to $desired_filename\n"; } - doit('mv', '-f', "${build_dir}/${dpkg_filename}", - "${destdir}/${desired_filename}"); + rename_path("${build_dir}/${dpkg_filename}", + "${destdir}/${desired_filename}"); } -foreach my $package (@{$dh{DOPACKAGES}}) { - my $pid=fork(); - if (! defined $pid) { - error("fork failed! $!"); - } - if ($pid) { # parent - $processes++; - reap while $processes > $max_procs; - next; - } - - # child - my $tmp=tmpdir($package); - my $dbgsym_tmpdir = "debian/.debhelper/${package}/dbgsym-root"; - if (exists $ENV{DH_ALWAYS_EXCLUDE} && length $ENV{DH_ALWAYS_EXCLUDE}) { - if (! compat(5)) { - complex_doit("find $tmp $dh{EXCLUDE_FIND} | xargs rm -rf"); - } - else { - # Old broken code here for compatibility. Does not - # remove everything. - complex_doit("find $tmp -name $_ | xargs rm -rf") - foreach split(":", $ENV{DH_ALWAYS_EXCLUDE}); - } - } - if ( -d $dbgsym_tmpdir) { +my @items; +my @dpkg_options; +push(@dpkg_options, '--root-owner-group') if not should_use_root(); + +for my $package (@{$dh{DOPACKAGES}}) { + push(@items, [$package, 0]); + if (not is_udeb($package)) { + my $dbgsym_tmpdir = dbgsym_tmpdir($package); my $dbgsym_control = "${dbgsym_tmpdir}/DEBIAN/control"; - # Only build the dbgsym package if it has a control file. - # People might have skipped dh_gencontrol. - if ( -f $dbgsym_control ) { - # XXX: Should we blindly overrule the maintainer here? It - # is not apparent that their explicit -z was intended for - # the dbgsym package. - my @args = default_compressor_args(["-z1", "-Zxz", "-Sextreme"], - @{$dh{U_PARAMS}}); - doit("dpkg-deb", @args, - "--build", $dbgsym_tmpdir, $dh{DESTDIR}); - } elsif (not is_udeb($package)) { + if ( -f $dbgsym_control) { + # Only build the dbgsym package if it has a control file. + # People might have skipped dh_gencontrol. + push(@items, [$package, 1]); + } elsif (-d $dbgsym_tmpdir) { warning("Not building dbgsym package for ${package} as it has no control file"); warning("Please use dh_gencontrol to avoid this issue"); } } - if (! is_udeb($package)) { - doit("dpkg-deb", @{$dh{U_PARAMS}}, "--build", $tmp, $dh{DESTDIR}.$dh{FILENAME}); - } - else { - my $filename=$dh{FILENAME}; - my @cmd = qw(dpkg-deb -z1 -Zxz -Sextreme); - push(@cmd, @{$dh{U_PARAMS}}) if $dh{U_PARAMS}; - push(@cmd, '--build', $tmp); - if (! $filename) { - # dpkg-gencontrol does not include "Package-Type" in the - # control file (see #575059, #452273) for political - # reasons. - # - # dh_builddeb used to guess the "correct" filename, but it - # fell short when dpkg-gencontrol -V was used. The best - # solution so far: Let dpkg-deb build the deb and - # have dh_builddeb fix the extension. - build_and_rename_deb($package, $dh{DESTDIR}, \@cmd, - sub { s/\.deb$/\.udeb/g }); - } else { - doit(@cmd, $dh{DESTDIR}.$filename); - } - } - exit 0; } -reap while $processes; -exit $exit; +on_items_in_parallel(\@items, sub { + foreach my $item (@_) { + my ($package, $dbgsym) = @{$item}; + my $tmp=tmpdir($package); + + if ($dbgsym) { + my $dbgsym_tmpdir = dbgsym_tmpdir($package); + my @cmd = ("dpkg-deb", @dpkg_options, @{$dh{U_PARAMS}}, + "--build", $dbgsym_tmpdir); + if (DBGSYM_PACKAGE_TYPE eq DEFAULT_PACKAGE_TYPE) { + doit(@cmd, $dh{DESTDIR}); + } else { + build_and_rename_deb($package, $dh{DESTDIR}, \@cmd, + sub {s/\.\Q${\DEFAULT_PACKAGE_TYPE}\E$/\.\Q${\DBGSYM_PACKAGE_TYPE}\E/g}); + } + next; + } + if (exists $ENV{DH_ALWAYS_EXCLUDE} && length $ENV{DH_ALWAYS_EXCLUDE}) { + if (! compat(5)) { + complex_doit("find $tmp $dh{EXCLUDE_FIND} | xargs rm -rf"); + } + else { + # Old broken code here for compatibility. Does not + # remove everything. + complex_doit("find $tmp -name $_ | xargs rm -rf") + foreach split(":", $ENV{DH_ALWAYS_EXCLUDE}); + } + } + if (! is_udeb($package)) { + doit("dpkg-deb", @dpkg_options, @{$dh{U_PARAMS}}, "--build", $tmp, $dh{DESTDIR}.$dh{FILENAME}); + } + else { + my $filename=$dh{FILENAME}; + my @cmd = qw(dpkg-deb -z6 -Zxz -Sextreme); + push(@cmd, @dpkg_options); + push(@cmd, @{$dh{U_PARAMS}}) if $dh{U_PARAMS}; + push(@cmd, '--build', $tmp); + if (! $filename) { + # dpkg-gencontrol does not include "Package-Type" in the + # control file (see #575059, #452273) for political + # reasons. + # + # dh_builddeb used to guess the "correct" filename, but it + # fell short when dpkg-gencontrol -V was used. The best + # solution so far: Let dpkg-deb build the deb and + # have dh_builddeb fix the extension. + build_and_rename_deb($package, $dh{DESTDIR}, \@cmd, + sub { s/\.deb$/\.udeb/g }); + } else { + doit(@cmd, $dh{DESTDIR}.$filename); + } + } + } +}); =head1 SEE ALSO @@ -202,9 +190,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_clean debhelper-11ubuntu1~16.04.york0/dh_clean --- debhelper-9.20160115ubuntu3/dh_clean 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_clean 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-k>] [B<-d>] [B<-X>I] [S ...>] @@ -50,6 +52,8 @@ This is deprecated, use L instead. +The option is removed in compat 12. + =item B<-d>, B<--dirs-only> Only clean the package build directories, do not clean up any other files @@ -72,45 +76,41 @@ =cut -if ( not -f 'debian/compat' and not $ENV{'DH_COMPAT'}) { - # Temporary work around - Permit a missing compat to work with - # cdbs's feature of auto-creating a d/compat file. - # - Auto-bump to compat 5 to match cdbs (Not that it matters a lot, - # since there is no compat conditions for 4 or less) - warning("Pretending DH_COMPAT was set to 5"); - warning(" - this is a temporary measure to avoid FTBFS in packages"); - warning(" relying on cdbs to set debian/compat to 5 during the build"); - $ENV{'DH_COMPAT'} = 5; -} - init(options => { "dirs-only" => \$dh{D_FLAG}, }); inhibit_log(); if ($dh{K_FLAG}) { - # dh_prep will be emulated (mostly) by the code below. - warning("dh_clean -k is deprecated; use dh_prep instead"); + deprecated_functionality('dh_clean -k is deprecated; use dh_prep instead', + 12, + 'The -k option is not supported in compat 12; use dh_prep instead'); } # Remove the debhelper stamp file -doit('rm', '-f', 'debian/debhelper-build-stamp') if not $dh{D_FLAG}; +rm_files('debian/debhelper-build-stamp') if not $dh{D_FLAG}; + +my (@clean_files, @clean_dirs, %seen); foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); my $ext=pkgext($package); + my $source_dir = default_sourcedir($package); if (! $dh{D_FLAG}) { - doit("rm","-f","debian/${ext}substvars") + push(@clean_files, "debian/${ext}substvars") unless excludefile("debian/${ext}substvars"); # These are all debhelper temp files, and so it is safe to # wildcard them. - complex_doit("rm -f debian/$ext*.debhelper"); + my @temp = glob("debian/$ext*.debhelper"); + push(@clean_files, @temp); } - doit ("rm","-rf",$tmp."/") + push(@clean_dirs , "${tmp}/") unless excludefile($tmp); + push(@clean_dirs, "${source_dir}/") + if (not $seen{$source_dir}++ and not excludefile($source_dir)); } @@ -125,11 +125,11 @@ # Remove all debhelper logs. if (! $dh{D_FLAG} && ! $dh{K_FLAG}) { - complex_doit("rm","-f","debian/*.debhelper.log"); + my @logs = glob('debian/*.debhelper.log'); + rm_files(@logs) if @logs; } if (! $dh{D_FLAG}) { - my (@clean_files, @clean_dirs); if (@ARGV) { push(@clean_files, grep { !m@/$@ } @ARGV); push(@clean_dirs, grep { m@/$@ } @ARGV); @@ -137,19 +137,24 @@ if (! $dh{K_FLAG}) { if (!compat(6) && -e "debian/clean") { - my @clean=grep { ! excludefile($_) } - filearray("debian/clean", "."); + my @clean=grep { + ! excludefile($_) + # Silently ignore missing files - for all we know, dh_clean is run before + # they have been created. + } filearray('debian/clean', ["."], \&glob_expand_error_handler_silently_ignore); push(@clean_files, grep { !m@/$@ } @clean); push(@clean_dirs, grep { m@/$@ } @clean); } - doit("rm","-f","debian/files") + push(@clean_files, 'debian/files') unless excludefile("debian/files"); } +} - doit('rm', '-f', '--', @clean_files) if @clean_files; - doit('rm', '-fr', '--', @clean_dirs) if @clean_dirs; +xargs(\@clean_files, 'rm', '-f', '--') if @clean_files; +xargs(\@clean_dirs, 'rm', '-fr', '--') if @clean_dirs; +if (! $dh{D_FLAG}) { # See if some files that would normally be deleted are excluded. my $find_options=''; if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { @@ -171,11 +176,9 @@ \\( -type d -a -name autom4te.cache -prune -exec rm -rf {} + \\) \\)"); } -doit('rm', '-rf', 'debian/tmp') if -x 'debian/tmp' && - ! excludefile("debian/tmp"); - if (!compat(6) && !$dh{K_FLAG}) { - complex_doit('rm -f *-stamp'); + my @stamp_files = glob('*-stamp'); + rm_files(@stamp_files) if @stamp_files; } =head1 SEE ALSO @@ -189,9 +192,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_compress debhelper-11ubuntu1~16.04.york0/dh_compress --- debhelper-9.20160115ubuntu3/dh_compress 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_compress 2017-11-28 13:07:26.000000000 +0000 @@ -12,6 +12,8 @@ use File::Spec::Functions qw(abs2rel); use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-X>I] [B<-A>] [S ...>] @@ -77,147 +79,159 @@ init(); -my $olddir; +on_pkgs_in_parallel { + my $olddir; -foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); + foreach my $package (@_) { + my $tmp=tmpdir($package); - my $compress=pkgfile($package,"compress"); + my $compress=pkgfile($package,"compress"); - # Run the file name gathering commands from within the directory - # structure that will be effected. - next unless -d $tmp; - $olddir = getcwd() if not defined $olddir; - verbose_print("cd $tmp"); - chdir($tmp) || error("Can't cd to $tmp: $!"); - - # Figure out what files to compress. - my @files; - # First of all, deal with any files specified right on the command line. - if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { - push @files, map { s{^/+}{}; $_ } @ARGV; - } - if ($compress) { - # The compress file is a sh script that outputs the files to be compressed - # (typically using find). - warning("$compress is deprecated; use -X or avoid calling dh_compress instead"); - push @files, split(/\n/,`sh $olddir/$compress 2>/dev/null`); - } - else { - # Note that all the excludes of odd things like _z - # are because gzip refuses to compress such files, assuming - # they are zip files. I looked at the gzip source to get the - # complete list of such extensions: ".gz", ".z", ".taz", - # ".tgz", "-gz", "-z", "_z" - push @files, split(/\n/,` - find usr/info usr/share/info usr/man usr/share/man usr/X11*/man -type f ! -iname "*.gz" \\ - ! -iname "*.gif" ! -iname "*.png" ! -iname "*.jpg" \\ - ! -iname "*.jpeg" \\ - 2>/dev/null || true; - find usr/share/doc \\ - \\( -type d -name _sources -prune -false \\) -o \\ - -type f \\( -size +4k -o -name "changelog*" -o -name "NEWS*" \\) \\ - \\( -name changelog.html -o ! -iname "*.htm*" \\) \\ - ! -iname "*.xhtml" \\ - ! -iname "*.gif" ! -iname "*.png" ! -iname "*.jpg" \\ - ! -iname "*.jpeg" ! -iname "*.gz" ! -iname "*.taz" \\ - ! -iname "*.tgz" ! -iname "*.z" ! -iname "*.bz2" \\ - ! -iname "*-gz" ! -iname "*-z" ! -iname "*_z" \\ - ! -iname "*.epub" ! -iname "*.jar" ! -iname "*.zip" \\ - ! -iname "*.odg" ! -iname "*.odp" ! -iname "*.odt" \\ - ! -iname ".htaccess" ! -iname "*.css" \\ - ! -iname "*.xz" ! -iname "*.lz" ! -iname "*.lzma" \\ - ! -iname "*.svg" ! -iname "*.svgz" ! -iname "*.js" \\ - ! -name "index.sgml" ! -name "objects.inv" ! -name "*.map" \\ - ! -name "*.devhelp2" \\ - ! -name "copyright" 2>/dev/null || true; - find usr/share/fonts/X11 -type f -name "*.pcf" 2>/dev/null || true; - `); - } + # Run the file name gathering commands from within the directory + # structure that will be effected. + next unless -d $tmp; + $olddir = getcwd() if not defined $olddir; + verbose_print("cd $tmp"); + chdir($tmp) || error("Can't cd to $tmp: $!"); + + # Figure out what files to compress. + my @files; + # First of all, deal with any files specified right on the command line. + if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @files, map { s{^/+}{}; $_ } @ARGV; + } + if ($compress) { + # The compress file is a sh script that outputs the files to be compressed + # (typically using find). + warning("$compress is deprecated; use -X or avoid calling dh_compress instead"); + push @files, split(/\n/,`sh $olddir/$compress 2>/dev/null`); + } else { + # Note that all the excludes of odd things like _z + # are because gzip refuses to compress such files, assuming + # they are zip files. I looked at the gzip source to get the + # complete list of such extensions: ".gz", ".z", ".taz", + # ".tgz", "-gz", "-z", "_z" + push @files, split(/\n/,` + find usr/share/info usr/share/man -type f ! -iname "*.gz" \\ + ! -iname "*.gif" ! -iname "*.png" ! -iname "*.jpg" \\ + ! -iname "*.jpeg" \\ + 2>/dev/null || true; + find usr/share/doc \\ + \\( -type d -name _sources -prune -false \\) -o \\ + -type f \\( -size +4k -o -name "changelog*" -o -name "NEWS*" \\) \\ + \\( -name changelog.html -o ! -iname "*.htm*" \\) \\ + ! -iname "*.xhtml" \\ + ! -iname "*.gif" ! -iname "*.png" ! -iname "*.jpg" \\ + ! -iname "*.jpeg" ! -iname "*.gz" ! -iname "*.taz" \\ + ! -iname "*.tgz" ! -iname "*.z" ! -iname "*.bz2" \\ + ! -iname "*-gz" ! -iname "*-z" ! -iname "*_z" \\ + ! -iname "*.epub" ! -iname "*.jar" ! -iname "*.zip" \\ + ! -iname "*.odg" ! -iname "*.odp" ! -iname "*.odt" \\ + ! -iname ".htaccess" ! -iname "*.css" \\ + ! -iname "*.xz" ! -iname "*.lz" ! -iname "*.lzma" \\ + ! -iname "*.svg" ! -iname "*.svgz" ! -iname "*.js" \\ + ! -name "index.sgml" ! -name "objects.inv" ! -name "*.map" \\ + ! -name "*.devhelp2" \\ + ! -name "copyright" 2>/dev/null || true; + find usr/share/fonts/X11 -type f -name "*.pcf" 2>/dev/null || true; + `); + } - # Exclude files from compression. - if (@files && defined($dh{EXCLUDE}) && $dh{EXCLUDE}) { - my @new=(); - foreach (@files) { - my $ok=1; - foreach my $x (@{$dh{EXCLUDE}}) { - if (/\Q$x\E/) { - $ok=''; - last; + # Exclude files from compression. + if (@files && defined($dh{EXCLUDE}) && $dh{EXCLUDE}) { + my @new=(); + foreach (@files) { + my $ok=1; + foreach my $x (@{$dh{EXCLUDE}}) { + if (/\Q$x\E/) { + $ok=''; + last; + } } + push @new,$_ if $ok; } - push @new,$_ if $ok; + @files=@new; } - @files=@new; - } - - # Look for files with hard links. If we are going to compress both, - # we can preserve the hard link across the compression and save - # space in the end. - my @f=(); - my %hardlinks; - my %seen; - foreach (@files) { - my ($dev, $inode, undef, $nlink)=stat($_); - if (defined $nlink && $nlink > 1) { - if (! $seen{"$inode.$dev"}) { - $seen{"$inode.$dev"}=$_; - push @f, $_; - } - else { - # This is a hardlink. - $hardlinks{$_}=$seen{"$inode.$dev"}; - } + + # Look for files with hard links. If we are going to compress both, + # we can preserve the hard link across the compression and save + # space in the end. + my ($unique_files, $hardlinks) = find_hardlinks(@files); + my @f = @{$unique_files}; + + # normalize file names and remove duplicates + my $norm_from_dir = $tmp; + if ($norm_from_dir !~ m{^/}) { + $norm_from_dir = "${olddir}/${tmp}"; } - else { - push @f, $_; + my $resolved = abs_path($norm_from_dir) + or error("Cannot resolve $norm_from_dir: $!"); + my @normalized = normalize_paths($norm_from_dir, $resolved, $tmp, @f); + my %uniq_f; @uniq_f{@normalized} = (); + @f = sort keys %uniq_f; + + # do it + if (@f) { + # Make executables not be anymore. + xargs(\@f,"chmod","a-x"); + xargs(\@f,"gzip","-9nf"); } - } - # normalize file names and remove duplicates - my @normalized = map abs2rel(abs_path($_)), @f; - my %uniq_f; @uniq_f{@normalized} = (); - @f = sort keys %uniq_f; - - # do it - if (@f) { - # Make executables not be anymore. - xargs(\@f,"chmod","a-x"); - - xargs(\@f,"gzip","-9nf"); - } - - # Now change over any files we can that used to be hard links so - # they are again. - foreach (keys %hardlinks) { - # Remove old file. - doit("rm","-f","$_"); - # Make new hardlink. - doit("ln","$hardlinks{$_}.gz","$_.gz"); - } + # Now change over any files we can that used to be hard links so + # they are again. + foreach (keys %{$hardlinks}) { + # Remove old file. + rm_files($_); + # Make new hardlink. + doit("ln", "-f", "$hardlinks->{$_}.gz", "$_.gz"); + } + + verbose_print("cd '$olddir'"); + chdir($olddir); - verbose_print("cd '$olddir'"); - chdir($olddir); + # Fix up symlinks that were pointing to the uncompressed files. + my %links = map { chomp; $_ => 1 } qx_cmd('find', $tmp, '-type', 'l'); + my $changed; + # Keep looping through looking for broken links until no more + # changes are made. This is done in case there are links pointing + # to links, pointing to compressed files. + do { + $changed = 0; + foreach my $link (keys %links) { + my ($directory) = $link =~ m:(.*)/:; + my $linkval = readlink($link); + if (! -e "$directory/$linkval" && -e "$directory/$linkval.gz") { + rm_files($link, "$link.gz"); + make_symlink_raw_target("$linkval.gz","$link.gz"); + delete $links{$link}; + $changed++; + } + } + } while $changed; + } +}; - # Fix up symlinks that were pointing to the uncompressed files. - my %links = map { chomp; $_ => 1 } `find $tmp -type l`; - my $changed; - # Keep looping through looking for broken links until no more - # changes are made. This is done in case there are links pointing - # to links, pointing to compressed files. - do { - $changed = 0; - foreach my $link (keys %links) { - my ($directory) = $link =~ m:(.*)/:; - my $linkval = readlink($link); - if (! -e "$directory/$linkval" && -e "$directory/$linkval.gz") { - doit("rm","-f",$link); - doit("ln","-sf","$linkval.gz","$link.gz"); - delete $links{$link}; - $changed++; +sub normalize_paths { + my ($cwd, $cwd_resolved, $tmp, @paths) = @_; + my @normalized; + my $prefix = qr{\Q${tmp}/}; + + for my $path (@paths) { + my $abs = abs_path($path); + if (not defined($abs)) { + my $err = $!; + my $alt = $path; + if ($alt =~ s/^$prefix//) { + $abs = abs_path($alt); } + error(qq{Cannot resolve "$path": $err (relative to "${cwd}")}) + if (not defined($abs)); + warning(qq{Interpreted "$path" as "$alt"}); } - } while $changed; + error("${abs} does not exist") if not -e $abs; + push(@normalized, abs2rel($abs, $cwd_resolved)); + } + return @normalized; } =head1 SEE ALSO @@ -231,9 +245,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_desktop debhelper-11ubuntu1~16.04.york0/dh_desktop --- debhelper-9.20160115ubuntu3/dh_desktop 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_desktop 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -#!/usr/bin/perl - -=head1 NAME - -dh_desktop - deprecated no-op - -=cut - -use strict; -use warnings; -use Debian::Debhelper::Dh_Lib; - -=head1 SYNOPSIS - -B [S>] - -=head1 DESCRIPTION - -B was a debhelper program that registers F<.desktop> files. -However, it no longer does anything, and is now deprecated. - -If a package ships F files, they just need to be installed in the -correct location (F) and they will be registered by -the appropriate tools for the corresponding desktop environments. - -=cut - -init(); - -warning("This program is deprecated, and does nothing anymore."); - -=head1 SEE ALSO - -L - -This program is a part of debhelper. - -=head1 AUTHOR - -Ross Burton - -=cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_dwz debhelper-11ubuntu1~16.04.york0/dh_dwz --- debhelper-9.20160115ubuntu3/dh_dwz 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_dwz 2017-11-28 12:40:27.000000000 +0000 @@ -0,0 +1,129 @@ +#!/usr/bin/perl + +=head1 NAME + +dh_dwz - optimize DWARF debug information in ELF binaries via dwz + +=cut + +use strict; +use warnings; +use File::Find; +use Debian::Debhelper::Dh_Lib; + +our $VERSION = DH_BUILTIN_VERSION; + +=head1 SYNOPSIS + +B [S>] [B<-X>I] [S I>] + +=head1 DESCRIPTION + +B: This tool is experimental and may disappear or change +behaviour without any notice. + +B is a debhelper program that will optimize the (uncompressed) +size of the DWARF debug information in ELF binaries. It does so by +running L on all the ELF binaries in the package. + +=head1 OPTIONS + +=over 4 + +=item B<-X>I, B<--exclude=>I + +Exclude files that contain I anywhere in their filename from being +stripped. You may use this option multiple times to build up a list of +things to exclude. + +=item B<--> I + +Pass I to L when it processes ELF binaries. This is +mostly useful for setting memory related parameters (e.g. -l and -L). + +=back + +=head1 NOTES + +If the B environment variable contains B, +nothing will be stripped, in accordance with Debian policy (section +10.1 "Binaries"). + +While this tool technically does not remove debug information from +binaries, it is still skipped when the B +environment variable contains B. This is because B +is often used to optimize build times (e.g. for "build and +test"-cycles) rather than optimizing for size. + +=cut + +init(); + +# This variable can be used to turn off stripping (see Policy). +exit 0 if get_buildoption('nostrip'); + +warning('This tool is experimental and may change (or be retired) without any notice'); + +my @elf_files; + +sub testfile { + my $fn = $_; + return if -l $fn; # Always skip symlinks. + + # See if we were asked to exclude this file. + # Note that we have to test on the full filename, including directory. + foreach my $f (@{$dh{EXCLUDE}}) { + if ($fn =~ m/\Q$f\E/) { + $File::Find::prune = 1 if -d _; + return; + } + } + return if -d _; + # Do not process output files from dwz + return if index($fn, '/debug/.dwz/') > -1; + if (is_so_or_exec_elf_file($fn)) { + push(@elf_files, $fn); + } + return; +} + +for my $package (@{$dh{DOPACKAGES}}) { + my $tmp = tmpdir($package); + + next if not -d $tmp; + + @elf_files = (); + find({ + wanted => \&testfile, + no_chdir => 1, + }, $tmp); + next if not @elf_files; + # Consistent order; + @elf_files = sort(@elf_files); + my ($unique_files, $hardlinks) = find_hardlinks(@elf_files); + + # TODO: Support multifile (-m) + + xargs($unique_files, 'dwz', '-q', @{$dh{U_PARAMS}}, '--'); + # Now change over any files we can that used to be hard links so + # they are again. + for my $hardlink (keys %{$hardlinks}) { + my $target = $hardlinks->{$hardlink}; + # Remove old file. + rm_files($hardlink); + # Make new hardlink. + doit('ln', '-f', $target, $hardlink); + } +} + +=head1 SEE ALSO + +L + +This program is a part of debhelper. + +=head1 AUTHOR + +Niels Thykier + +=cut diff -Nru debhelper-9.20160115ubuntu3/dh_fixperms debhelper-11ubuntu1~16.04.york0/dh_fixperms --- debhelper-9.20160115ubuntu3/dh_fixperms 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_fixperms 2017-12-02 08:46:03.000000000 +0000 @@ -11,6 +11,8 @@ use Config; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-X>I] @@ -21,14 +23,19 @@ permissions of files and directories in package build directories to a sane state -- a state that complies with Debian policy. -B makes all files in F in the package build directory -(excluding files in the F directory) be mode 644. It also changes -the permissions of all man pages to mode 644. It makes all files be owned -by root, and it removes group and other write permission from all files. It -removes execute permissions from any libraries, headers, Perl modules, or -desktop files that have it set. It makes all files in the standard F and -F directories, F and F executable (since v4). Finally, -it removes the setuid and setgid bits from all files in the package. +B makes all files in F in the package +build directory (excluding files in the F directory) be +mode 644. It also changes the permissions of all man pages to mode +644. It removes group and other write permission from all files. It +removes execute permissions from any libraries, headers, Perl modules, +or desktop files that have it set. It makes all files in the standard +F and F directories, F and F +executable (since v4). Finally, it removes the setuid and setgid bits +from all files in the package. + +When the I field has the (effective) value of +I, B will also reset the ownership of +all paths to "root:root". =head1 OPTIONS @@ -46,104 +53,111 @@ init(); +sub patterns2find_expr { + return sprintf('\\( -name %s \\)', join(' -o -name ', map { "'$_'" } @_)); +} + + my $vendorlib = substr $Config{vendorlib}, 1; my $vendorarch = substr $Config{vendorarch}, 1; +my @executable_files_dirs = ( + qw{usr/bin bin usr/sbin sbin usr/games etc/init.d}, +); my @mode_0644_patterns = ( # Libraries and related files '*.so.*', '*.so', '*.la', '*.a', # Web application related files - '*.js', '*.css', + '*.js', '*.css', '*.scss', '*.sass', # Images '*.jpeg', '*.jpg', '*.png', '*.gif', # OCaml native-code shared objects '*.cmxs', ); -# Turn the patterns in to a find pattern -my $mode_0644_find_pattern = sprintf('\\( -name %s \\)', - join(' -o -name ', - map { "'$_'" } @mode_0644_patterns)); - +my @mode_0755_patterns = ( + # None for Debian +); +my $find_exclude_options='-true'; +if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { + $find_exclude_options="! \\( $dh{EXCLUDE_FIND} \\)"; +} -foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - - my $find_options=''; - if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { - $find_options="! \\( $dh{EXCLUDE_FIND} \\)"; +sub find_and_reset_perm { + my ($in_dirs, $mode, $raw_find_expr, $raw_find_expr_late) = @_; + my (@dirs, $dir_string); + if (ref ($in_dirs) ) { + @dirs = grep { -d } @{$in_dirs}; + return if not @dirs; + } else { + return if not -d $in_dirs; + @dirs = ($in_dirs); } + $dir_string = escape_shell(@dirs); + $raw_find_expr //= ''; + $raw_find_expr_late //= '-true'; + complex_doit("find ${dir_string} ${raw_find_expr} -a ${find_exclude_options} -a ${raw_find_expr_late} -print0", + "2>/dev/null | xargs -0r chmod ${mode}"); +} - # General permissions fixing. - complex_doit("find $tmp $find_options -print0", - "2>/dev/null | xargs -0r chown --no-dereference 0:0"); - complex_doit("find $tmp ! -type l $find_options -print0", - "2>/dev/null | xargs -0r chmod go=rX,u+rw,a-s"); - - # Fix up permissions in usr/share/doc, setting everything to not - # executable by default, but leave examples directories alone. - complex_doit("find $tmp/usr/share/doc -type f $find_options ! -regex '$tmp/usr/share/doc/[^/]*/examples/.*' -print0 2>/dev/null", - "| xargs -0r chmod 0644"); - complex_doit("find $tmp/usr/share/doc -type d $find_options -print0 2>/dev/null", - "| xargs -0r chmod 0755"); - - # Executable man pages are a bad thing.. - complex_doit("find $tmp/usr/share/man $tmp/usr/man/ $tmp/usr/X11*/man/ -type f", - "$find_options -print0 2>/dev/null | xargs -0r chmod 0644"); - - # ..and header files .. - complex_doit("find $tmp/usr/include -type f $find_options -print0", - "2>/dev/null | xargs -0r chmod 0644"); - - # ..and desktop files .. - complex_doit("find $tmp/usr/share/applications -type f $find_options -print0", - "2>/dev/null | xargs -0r chmod 0644"); +on_pkgs_in_parallel { + foreach my $package (@_) { + my $tmp=tmpdir($package); + + next if not -d $tmp; + + # General permissions fixing. + complex_doit("find $tmp ${find_exclude_options} -print0", + "2>/dev/null | xargs -0r chown --no-dereference 0:0") if should_use_root(); + find_and_reset_perm($tmp, 'go=rX,u+rw,a-s', '! -type l'); - # .. and perl modules. - complex_doit("find $tmp/$vendorarch $tmp/$vendorlib -type f", - "-perm -5 -name '*.pm' $find_options -print0", - "2>/dev/null | xargs -0r chmod a-X"); - - complex_doit("find $tmp -perm -5 -type f ${mode_0644_find_pattern}", - "${find_options} -print0 2>/dev/null", - "| xargs -0r chmod 0644"); - - # Programs in the bin and init.d dirs should be executable.. - for my $dir (qw{usr/bin bin usr/sbin sbin usr/games etc/init.d}) { - if (-d "$tmp/$dir") { - complex_doit("find $tmp/$dir -type f $find_options -print0 2>/dev/null", - "| xargs -0r chmod a+x"); - } - } + # Fix up permissions in usr/share/doc, setting everything to not + # executable by default, but leave examples directories alone. + find_and_reset_perm("${tmp}/usr/share/doc", '0644', '-type f', "! -regex '$tmp/usr/share/doc/[^/]*/examples/.*'"); + find_and_reset_perm("${tmp}/usr/share/doc", '0755', '-type d'); + + # Manpages, include file, desktop files, etc., shouldn't be executable + find_and_reset_perm([ + "${tmp}/usr/share/man", + "${tmp}/usr/include", + "${tmp}/usr/share/applications", + "${tmp}/usr/share/lintian/overrides", + ], '0644', '-type f'); + + # nor should perl modules. + find_and_reset_perm(["${tmp}/${vendorarch}", "${tmp}/${vendorlib}"], + 'a-X', "-type f -perm -5 -name '*.pm'"); + + find_and_reset_perm($tmp, '0644', '-type f ' . patterns2find_expr(@mode_0644_patterns)) if @mode_0644_patterns; + find_and_reset_perm($tmp, '0755', '-type f ' . patterns2find_expr(@mode_0755_patterns)) if @mode_0755_patterns; + + # Programs in the bin and init.d dirs should be executable.. + find_and_reset_perm([map { "${tmp}/$_"} @executable_files_dirs], 'a+x', '-type f'); - # ADA ali files should be mode 444 to avoid recompilation - complex_doit("find $tmp/usr/lib -type f", - "-name '*.ali' $find_options -print0", - "2>/dev/null | xargs -0r chmod uga-w"); - - if ( -d "$tmp/usr/share/bug/$package") { - complex_doit("find $tmp/usr/share/bug/$package -type f", - "! -name 'script' $find_options -print0", - "2>/dev/null | xargs -0r chmod 644"); - if ( -f "$tmp/usr/share/bug/$package/script" ) { - doit('chmod', '0755', "$tmp/usr/share/bug/$package/script"); + # ADA ali files should be mode 444 to avoid recompilation + find_and_reset_perm("${tmp}/usr/lib", 'uga-w', "-type f -name '*.ali'"); + + if ( -d "$tmp/usr/lib/nodejs/") { + my @nodejs_exec_patterns = qw(*/cli.js */bin.js); + my @exec_files = grep { + not excludefile($_) and -f $_; + } glob_expand(["$tmp/usr/lib/nodejs"], \&glob_expand_error_handler_silently_ignore, @nodejs_exec_patterns); + reset_perm_and_owner(0755, @exec_files) } - } elsif ( -f "$tmp/usr/share/bug/$package" ) { - doit('chmod', '0755', "$tmp/usr/share/bug/$package"); - } - # Lintian overrides should never be executable, too. - if (-d "$tmp/usr/share/lintian") { - complex_doit("find $tmp/usr/share/lintian/overrides", - "-type f $find_options -print0", - "2>/dev/null | xargs -0r chmod 0644"); - } + if ( -d "$tmp/usr/share/bug/$package") { + complex_doit("find $tmp/usr/share/bug/$package -type f", + "! -name 'script' ${find_exclude_options} -print0", + "2>/dev/null | xargs -0r chmod 644"); + if ( -f "$tmp/usr/share/bug/$package/script" ) { + reset_perm_and_owner(0755, "$tmp/usr/share/bug/$package/script"); + } + } elsif ( -f "$tmp/usr/share/bug/$package" ) { + reset_perm_and_owner(0755, "$tmp/usr/share/bug/$package"); + } - # Files in $tmp/etc/sudoers.d/ must be mode 0440. - if (-d "$tmp/etc/sudoers.d") { - complex_doit("find $tmp/etc/sudoers.d", - "-type f ! -perm 440 $find_options -print0", - "2>/dev/null | xargs -0r chmod 0440"); + # Files in $tmp/etc/sudoers.d/ must be mode 0440. + find_and_reset_perm("${tmp}/etc/sudoers.d", '0440', "-type f ! -perm 440"); } -} +}; =head1 SEE ALSO @@ -156,9 +170,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_gconf debhelper-11ubuntu1~16.04.york0/dh_gconf --- debhelper-9.20160115ubuntu3/dh_gconf 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_gconf 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<--priority=>I] @@ -72,7 +74,7 @@ } my $defaults = pkgfile($package,"gconf-defaults"); if ($defaults ne '') { - doit("mkdir","-p","$tmp/usr/share/gconf/defaults"); + install_dir("$tmp/usr/share/gconf/defaults"); install_file($defaults, "$tmp/usr/share/gconf/defaults/${priority}_$package"); } @@ -81,14 +83,15 @@ # Migrate schemas from /etc/gconf/schemas to /usr/share/gconf/schemas if (-d $old_schemas_dir) { - doit("mkdir","-p",$new_schemas_dir) unless -d $new_schemas_dir; + install_dir($new_schemas_dir); complex_doit("mv $old_schemas_dir/*.schemas $new_schemas_dir/"); doit("rmdir","-p","--ignore-fail-on-non-empty",$old_schemas_dir); } if (-d "$new_schemas_dir") { # Get a list of the schemas - my $schemas = `find $new_schemas_dir -type f -name \\*.schemas -printf '%P '`; + my $schemas = qx_cmd('find', $new_schemas_dir, '-type', 'f', '-name', '*.schemas', + '-printf', '%P'); if ($schemas ne '') { addsubstvar($package, "misc:Depends", "gconf2 (>= 2.28.1-2)"); } @@ -107,9 +110,3 @@ Josselin Mouette =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_gencontrol debhelper-11ubuntu1~16.04.york0/dh_gencontrol --- debhelper-9.20160115ubuntu3/dh_gencontrol 2016-01-14 19:52:01.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_gencontrol 2017-12-16 13:06:41.000000000 +0000 @@ -8,8 +8,11 @@ use strict; use warnings; +use Errno qw(ENOENT); use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [S I>] @@ -53,105 +56,124 @@ "dpkg-gencontrol-params=s", => \$dh{U_PARAMS}, }); - -foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $ext=pkgext($package); - my $dbgsym_info_dir = "debian/.debhelper/${package}"; - my $dbgsym_tmp = "${dbgsym_info_dir}/dbgsym-root"; - - my $substvars="debian/${ext}substvars"; - - my $changelog=pkgfile($package,'changelog'); - if (! $changelog) { - $changelog='debian/changelog'; +sub ensure_substvars_are_present { + my ($file, @substvars) = @_; + my (%vars, $fd); + return 1 if $dh{NO_ACT}; + if (open($fd, '+<', $file)) { + while (my $line = <$fd>) { + my $k; + ($k, undef) = split(m/=/, $line, 2); + $vars{$k} = 1 if $k; + } + # Fall-through and append the missing vars if any. + } else { + error("open(${file}) failed: $!") if $! != ENOENT; + open($fd, '>', $file) or error("open(${file}) failed: $!"); } - if ( ! -d "$tmp/DEBIAN" ) { - install_dir("$tmp/DEBIAN"); + for my $var (@substvars) { + if (not exists($vars{$var})) { + verbose_print("echo ${var}= >> ${file}"); + print ${fd} "${var}=\n"; + $vars{$var} = 1; + } } + close($fd) or error("close(${file}) failed: $!"); + return 1; +} - # avoid gratuitous warning - if (! -e $substvars || system("grep -q '^misc:Depends=' $substvars") != 0) { - complex_doit("echo misc:Depends= >> $substvars"); - } - # avoid (another) gratuitous warning - if (! -e $substvars || system("grep -q '^misc:Pre-Depends=' $substvars") != 0) { - complex_doit("echo misc:Pre-Depends= >> $substvars"); - } +on_pkgs_in_parallel { + foreach my $package (@_) { + my $tmp=tmpdir($package); + my $ext=pkgext($package); + my $dbgsym_info_dir = "debian/.debhelper/${package}"; + my $dbgsym_tmp = dbgsym_tmpdir($package); + + my $substvars="debian/${ext}substvars"; + + my $changelog=pkgfile($package,'changelog'); + if (! $changelog) { + $changelog='debian/changelog'; + } - my (@debug_info_params, $build_ids); - if ( -d $dbgsym_info_dir ) { - $build_ids = read_dbgsym_build_ids($dbgsym_info_dir); - } + install_dir("$tmp/DEBIAN"); - # Temporary workaround: Do not build dbgsym packages for udebs as - # dpkg-gencontrol and dpkg-deb does not agree on the file - # extension. - if ( -d $dbgsym_tmp and not is_udeb($package)) { - my $multiarch = package_multiarch($package); - my $section = package_section($package); - my $replaces = read_dbgsym_migration($dbgsym_info_dir); - my $component = ''; - if ($section =~ m{^(.*)/[^/]+$}) { - $component = "${1}/"; - # This should not happen, but lets not propogate the error - # if does. - $component = '' if $component eq 'main/'; - } + # avoid gratuitous warnings + ensure_substvars_are_present($substvars, 'misc:Depends', 'misc:Pre-Depends'); - # Remove and override more or less every standard field. - my @dbgsym_options = (qw( - -UPre-Depends -URecommends -USuggests -UEnhances -UProvides -UEssential - -UConflicts -DPriority=extra - -DAuto-Built-Package=debug-symbols - ), - "-DPackage=${package}-dbgsym", - "-DDepends=${package} (= \${binary:Version})", - "-DDescription=Debug symbols for ${package}", - "-DBuild-Ids=${build_ids}", - "-DSection=${component}debug", - ); - # Disable multi-arch unless the original package is an - # multi-arch: same package. In all other cases, we do not - # need a multi-arch value. - if ($multiarch ne 'same') { - push(@dbgsym_options, '-UMulti-Arch'); + my (@debug_info_params, $build_ids, @multiarch_params); + if ( -d $dbgsym_info_dir ) { + $build_ids = read_dbgsym_build_ids($dbgsym_info_dir); } - # If the dbgsym package is replacing an existing -dbg package, - # then declare the necessary Breaks + Replaces. Otherwise, - # clear the fields. - if ($replaces) { - push(@dbgsym_options, "-DReplaces=${replaces}", - "-DBreaks=${replaces}"); - } else { - push(@dbgsym_options, '-UReplaces', '-UBreaks'); - } - if ( ! -d "${dbgsym_tmp}/DEBIAN" ) { + + if ( -d $dbgsym_tmp) { + my $multiarch = package_multiarch($package); + my $section = package_section($package); + my $replaces = read_dbgsym_migration($dbgsym_info_dir); + my $component = ''; + if ($section =~ m{^(.*)/[^/]+$}) { + $component = "${1}/"; + # This should not happen, but lets not propagate the error + # if does. + $component = '' if $component eq 'main/'; + } + + # Remove and override more or less every standard field. + my @dbgsym_options = (qw( + -UPre-Depends -URecommends -USuggests -UEnhances -UProvides -UEssential + -UConflicts -DPriority=optional -UHomepage -UImportant + -DAuto-Built-Package=debug-symbols + ), + "-DPackage=${package}-dbgsym", + "-DDepends=${package} (= \${binary:Version})", + "-DDescription=debug symbols for ${package}", + "-DBuild-Ids=${build_ids}", + "-DSection=${component}debug", + ); + push(@dbgsym_options, "-DPackage-Type=${\DBGSYM_PACKAGE_TYPE}") + if DBGSYM_PACKAGE_TYPE ne DEFAULT_PACKAGE_TYPE; + # Disable multi-arch unless the original package is an + # multi-arch: same package. In all other cases, we do not + # need a multi-arch value. + if ($multiarch ne 'same') { + push(@dbgsym_options, '-UMulti-Arch'); + } + # If the dbgsym package is replacing an existing -dbg package, + # then declare the necessary Breaks + Replaces. Otherwise, + # clear the fields. + if ($replaces) { + push(@dbgsym_options, "-DReplaces=${replaces}", + "-DBreaks=${replaces}"); + } else { + push(@dbgsym_options, '-UReplaces', '-UBreaks'); + } install_dir("${dbgsym_tmp}/DEBIAN"); + doit("dpkg-gencontrol", "-p${package}", "-l$changelog", "-T$substvars", + "-P${dbgsym_tmp}",@{$dh{U_PARAMS}}, @dbgsym_options); + + reset_perm_and_owner(0644, "${dbgsym_tmp}/DEBIAN/control"); + } elsif ($build_ids) { + # Only include the build-id if there is no dbgsym package (if + # there is a dbgsym package, the build-ids into the control + # file of the dbgsym package) + push(@debug_info_params, "-DBuild-Ids=${build_ids}"); } - doit("dpkg-gencontrol", "-p${package}", "-l$changelog", "-T$substvars", - "-P${dbgsym_tmp}",@{$dh{U_PARAMS}}, @dbgsym_options); - doit("chmod","0644","${dbgsym_tmp}/DEBIAN/control"); - doit("chown","0:0","${dbgsym_tmp}/DEBIAN/control"); - } elsif ($build_ids) { - # Only include the build-id if there is no dbgsym package (if - # there is a dbgsym package, the build-ids into the control - # file of the dbgsym package) - push(@debug_info_params, "-DBuild-Ids=${build_ids}"); + # Remove explicit "Multi-Arch: no" headers to avoid autorejects by dak. + push (@multiarch_params, '-UMulti-Arch') + if (package_multiarch($package) eq 'no'); + + # Generate and install control file. + doit("dpkg-gencontrol", "-p$package", "-l$changelog", "-T$substvars", + "-P$tmp", @debug_info_params, @multiarch_params, + @{$dh{U_PARAMS}}); + + # This chmod is only necessary if the user sets the umask to + # something odd. + reset_perm_and_owner(0644, "${tmp}/DEBIAN/control"); } - - # Generate and install control file. - doit("dpkg-gencontrol", "-p$package", "-l$changelog", "-T$substvars", - "-P$tmp", @debug_info_params, @{$dh{U_PARAMS}}); - - # This chmod is only necessary if the user sets the umask to - # something odd. - doit("chmod","0644","$tmp/DEBIAN/control"); - - doit("chown","0:0","$tmp/DEBIAN/control"); -} +}; sub read_dbgsym_file { my ($dbgsym_info_file, $dbgsym_info_dir) = @_; @@ -161,6 +183,7 @@ open(my $fd, '<', $dbgsym_path) or error("open $dbgsym_path failed: $!"); chomp($result = <$fd>); + $result =~ s/\s++$//; close($fd); } return $result; @@ -185,9 +208,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_icons debhelper-11ubuntu1~16.04.york0/dh_icons --- debhelper-9.20160115ubuntu3/dh_icons 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_icons 2017-11-28 12:40:27.000000000 +0000 @@ -11,6 +11,8 @@ use File::Find; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-n>] @@ -32,7 +34,7 @@ =over 4 -=item B<-n>, B<--noscripts> +=item B<-n>, B<--no-scripts> Do not modify maintainer scripts. @@ -64,8 +66,8 @@ closedir($dirfd); if (@dirlist and ! $dh{NOSCRIPTS}) { my $list=join(" ", sort @dirlist); - autoscript($package,"postinst","postinst-icons","s%#DIRLIST#%$list%g"); - autoscript($package,"postrm","postrm-icons","s%#DIRLIST#%$list%g"); + autoscript($package, 'postinst', 'postinst-icons', { 'DIRLIST' => $list }); + autoscript($package, 'postrm', 'postrm-icons', { 'DIRLIST' => $list }); } } } @@ -83,9 +85,3 @@ Josselin Mouette =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_install debhelper-11ubuntu1~16.04.york0/dh_install --- debhelper-9.20160115ubuntu3/dh_install 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_install 2017-11-28 12:40:27.000000000 +0000 @@ -8,9 +8,10 @@ use strict; use warnings; -use File::Find; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [B<-X>I] [B<--autodest>] [B<--sourcedir=>I] [S>] [S ... I>] @@ -48,7 +49,7 @@ installed in. The name of the files (or directories) to install should be given relative to the current directory, while the installation directory is given relative to the package build directory. You may use wildcards in the names of -the files to install (in v3 mode and above). +the files to install. Note that if you list exactly one filename or wildcard-pattern on a line by itself, with no explicit destination, then B @@ -57,9 +58,11 @@ =item debian/not-installed -List the files that are deliberately not installed in any package. -This is used with B<--list-missing> (or B<--fail-missing>) as an -exclude file. +List the files that are deliberately not installed in I binary +package. Paths listed in this file are (I) ignored by the check +done via B<--list-missing> (or B<--fail-missing>). However, it is +B a method to exclude files from being installed. Please use +B<--exclude> for that. Please keep in mind that dh_install will B expand wildcards in this file. @@ -72,6 +75,8 @@ =item B<--list-missing> +B: Please use B instead. + This option makes B keep track of the files it installs, and then at the end, compare that list with the files in the source directory. If any of the files (and symlinks) in the source directory were not installed to @@ -85,6 +90,8 @@ =item B<--fail-missing> +B: Please use B instead. + This option is like B<--list-missing>, except if a file was missed, it will not only list the missing files, but also fail with a nonzero exit code. @@ -128,23 +135,36 @@ "autodest" => \$dh{AUTODEST}, "list-missing" => \$dh{LIST_MISSING}, "fail-missing" => \$dh{FAIL_MISSING}, - "sourcedir=s" => \$dh{SOURCEDIR}, + "sourcedir=s" => \$dh{SOURCEDIR}, }); -my @installed; - my $srcdir = '.'; $srcdir = $dh{SOURCEDIR} if defined $dh{SOURCEDIR}; my $missing_files = 0; -# PROMISE: DH NOOP WITHOUT install +if ($dh{LIST_MISSING} || $dh{FAIL_MISSING}) { + deprecated_functionality('Please use dh_missing --list-missing/--fail-missing instead', 12); +} + +# Support for -X flag. +my $exclude = ''; +if ($dh{EXCLUDE_FIND}) { + $exclude = '! \( '.$dh{EXCLUDE_FIND}.' \)'; +} + +# PROMISE: DH NOOP WITHOUT pkgfile-logged(install) foreach my $package (getpackages()) { + my (@installed, %dest2sources); + my $default_source_dir = default_sourcedir($package); + my @search_dirs = ($srcdir); + push(@search_dirs, $default_source_dir) if not compat(6); + # Look at the install files for all packages to handle # list-missing/fail-missing, but skip really installing for # packages that are not being acted on. - my $skip_install=! grep { $_ eq $package } @{$dh{DOPACKAGES}}; + my $skip_install = process_pkg($package) ? 0 : 1; my $tmp=tmpdir($package); my $file=pkgfile($package,"install"); @@ -153,68 +173,115 @@ if ($file) { @install=filedoublearray($file); # no globbing here; done below } + + + # With autodest, we can just pretend every pattern was on its own line + @install = map { [$_] } map { @$_ } @install if $dh{AUTODEST}; if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { - push @install, [@ARGV]; + if ($dh{AUTODEST}) { + # Same as above, with autodest, we can just isolate each entry + # - the split is for bug-backwards compatibility (#867866). + push(@install, map { [$_] } map { split } @ARGV); + } else { + # Bug backwards compatibility (#867866). The new "glob_expand" + # interface is smart enough to not split on spaces, but dh_install + # used to do that... *except* for the "DEST" since it was never + # passed to the glob function. + my @a = @ARGV; + my $dest = pop(@a) if @a > 1; + my @srcs = map { split } @a; + push(@srcs, $dest) if defined($dest); + push(@install, \@srcs); + } } - # Support for -X flag. - my $exclude = ''; - if ($dh{EXCLUDE_FIND}) { - $exclude = '! \( '.$dh{EXCLUDE_FIND}.' \)'; - } - + + my $glob_error_handler = sub { + # Do not require a match for packages that not acted on + # (directly). After all, the files might not have been + # generated/compiled. + return if $skip_install; + ++$missing_files; + goto \&glob_expand_error_handler_warn_and_discard; + }; + foreach my $set (@install) { - my $dest; - my $tmpdest=0; - - if (! defined $dh{AUTODEST} && @$set > 1) { + my ($dest, @filelist, @patterns); + + if (@$set > 1) { $dest=pop @$set; } + # Skip excluded patterns. We will need two exclude checks per pattern; + # 1) exclude the entire pattern as people expect this to work (#814856) + # 2) exclude files matched by the pattern as people could have just + # excluded a single file of a "dir/*"-pattern. + # This line below filters entire patterns + @patterns = grep { not excludefile($_) } @{$set}; + next if not @patterns; + foreach my $glob (@patterns) { + my @found = glob_expand(\@search_dirs, $glob_error_handler, $glob); + push(@filelist, map { tr{/}{/}s; $_ } @found); + } - my @filelist; - foreach my $glob (@$set) { - my @found = glob "$srcdir/$glob"; - if (! compat(6)) { - # Fall back to looking in debian/tmp. - if (! @found || ! (-e $found[0] || -l $found[0])) { - @found = glob "debian/tmp/$glob" - if $glob !~ m{^(?:\./)?debian/tmp/}; - } - } - if (@found && (-e $found[0] || -l $found[0])) { - push @filelist, @found; - } + if (! @filelist && ! $skip_install) { + warning("$package missing files: @$set"); + ++$missing_files; + next; } - if (! compat(4)) { # check added in v5 - if (! @filelist && ! $skip_install) { - warning("$package missing files: @$set"); - ++$missing_files; - next; + # Do a quick bulk handling of excluded files and update @installed. + # - this is for filtering files matched by the pattern + @filelist = grep { not excludefile($_) } @filelist if $exclude; + push(@installed, @filelist); + + # ... because then we can short-curcit here. + next if $skip_install or $missing_files; + + if (not $exclude) { + my @unoptimized; + for my $src (@filelist) { + my $d = $dest // compute_dest($default_source_dir, $src); + my $basename = basename($src); + if (exists($dest2sources{$d}{$basename})) { + # If there is a clash, silently undo the optimizations. + # See #866405 and #868169. + my $replaced = delete($dest2sources{$d}{$basename}); + # Associate the $replaced the destination + # directory. We cannot be sure that compute_dest will + # get it right nor can we blindly set $dest. + # + # It is technically unnecessary for $src, but we + # might as well do it to possibly save a + # compute_dest call. + push(@unoptimized, [$replaced, $d], [$src, $d]); + next; + } + $dest2sources{$d}{$basename} = $src; } + next if not @unoptimized; + @filelist = @unoptimized; } - foreach my $src (@filelist) { - next if excludefile($src); - - push @installed, $src; - next if $skip_install or $missing_files; - - if (! defined $dest) { - # Guess at destination directory. - $dest=$src; - $dest=~s/^(.*\/)?\Q$srcdir\E\///; - $dest=~s/^(.*\/)?debian\/tmp\///; - $dest=dirname("/".$dest); - $tmpdest=1; + foreach my $src (@filelist) { + + my $target_dest; + + if (ref($src)) { + # On a failed optimization, we will have the + # destination directory. + ($src, $target_dest) = @{$src}; + } else { + $target_dest = $dest; + if (! defined $target_dest) { + # Guess at destination directory. + $target_dest = compute_dest($default_source_dir, $src); + } } # Make sure the destination directory exists. - if (! -e "$tmp/$dest") { - install_dir("$tmp/$dest"); - } - + install_dir("$tmp/$target_dest"); + if (-d $src && $exclude) { my $basename = basename($src); my $dir = ($basename eq '.') ? $src : "$src/.."; @@ -222,64 +289,54 @@ chomp $pwd; complex_doit("cd '$dir' && " . "find '$basename' $exclude \\( -type f -or -type l \\) -print0 | LC_ALL=C sort -z | " . - "xargs -0 -I {} cp --reflink=auto --parents -dp {} $pwd/$tmp/$dest/"); + "xargs -0 -I {} cp --reflink=auto --parents -dp {} $pwd/$tmp/$target_dest/"); # cp is annoying so I need a separate pass # just for empty directories complex_doit("cd '$dir' && " . "find '$basename' $exclude \\( -type d -and -empty \\) -print0 | LC_ALL=C sort -z | " . - "xargs -0 -I {} cp --reflink=auto --parents -a {} $pwd/$tmp/$dest/"); + "xargs -0 -I {} cp --reflink=auto --parents -a {} $pwd/$tmp/$target_dest/"); } else { - doit("cp", '--reflink=auto', "-a", $src, "$tmp/$dest/"); - } - - if ($tmpdest) { - $dest=undef; + doit("cp", '--reflink=auto', "-a", $src, "$tmp/$target_dest/"); } } } -} -if ($dh{LIST_MISSING} || $dh{FAIL_MISSING}) { - # . as srcdir makes no sense, so this is a special case. - if ($srcdir eq '.') { - $srcdir='debian/tmp'; - } - - my @missing; - if ( -f 'debian/not-installed') { - # Pretend that these are also installed. - push(@installed, filearray('debian/not-installed')); - } - my $installed=join("|", map { - # Kill any extra slashes, for robustness. - y:/:/:s; - s:/+$::; - s:^(\./)*::; - "\Q$_\E\/.*|\Q$_\E"; - } @installed); - $installed=qr{^($installed)$}; - find(sub { - -f || -l || return; - $_="$File::Find::dir/$_"; - if (! /$installed/ && ! excludefile($_)) { - my $file=$_; - $file=~s/^\Q$srcdir\E\///; - push @missing, $file; - } - }, $srcdir); - if (@missing) { - warning "$_ exists in $srcdir but is not installed to anywhere" foreach @missing; - if ($dh{FAIL_MISSING}) { - error("missing files, aborting"); - } + for my $dest (sort(keys(%dest2sources))) { + my @srcs = sort(values(%{$dest2sources{$dest}})); + # Make sure the destination directory exists. + install_dir("$tmp/$dest"); + xargs(\@srcs, "cp", '--reflink=auto', "-a", XARGS_INSERT_PARAMS_HERE, "$tmp/$dest/"); } + log_installed_files($package, @installed); } if ($missing_files) { + # There were files we could not install (e.g. patterns that matched nothing) error("missing files, aborting"); } +if ($dh{LIST_MISSING} || $dh{FAIL_MISSING}) { + my @options; + foreach (@{$dh{EXCLUDE}}) { + push(@options, '--exclude', $_); + } + push(@options, '--sourcedir', $dh{SOURCEDIR}) if defined($dh{SOURCEDIR}); + push @options, "--list-missing" if $dh{LIST_MISSING}; + push @options, "--fail-missing" if $dh{FAIL_MISSING}; + doit("dh_missing", @options); +} + +sub compute_dest { + my ($source_dir, $dest) = @_; + + $dest =~ s/^(.*\/)?\Q$srcdir\E\///; + $dest =~ s/^(.*\/)?\Q$source_dir\E\///; + $dest = dirname("/".$dest); + + return $dest; +} + =head1 LIMITATIONS B cannot rename files or directories, it can only install them @@ -316,9 +373,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installcatalogs debhelper-11ubuntu1~16.04.york0/dh_installcatalogs --- debhelper-9.20160115ubuntu3/dh_installcatalogs 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installcatalogs 2017-11-28 12:40:27.000000000 +0000 @@ -10,7 +10,9 @@ use warnings; use Debian::Debhelper::Dh_Lib; -my $sgmlbasever = "1.26+nmu2"; +our $VERSION = DH_BUILTIN_VERSION; + +my $sgmlbasever = "1.28"; =head1 SYNOPSIS @@ -26,9 +28,10 @@ This command automatically adds maintainer script snippets for registering and unregistering the catalogs and supercatalogs (unless -B<-n> is used). These snippets are inserted into the maintainer scripts -by B; see L for an explanation of -Debhelper maintainer script snippets. +B<-n> is used). These snippets are inserted into the maintainer +scripts and the B file by B; see +L for an explanation of Debhelper maintainer script +snippets. A dependency on B will be added to B<${misc:Depends}>, so be sure your package uses that variable in F. @@ -51,9 +54,10 @@ =over 4 -=item B<-n>, B<--noscripts> +=item B<-n>, B<--no-scripts> -Do not modify F/F/F scripts. +Do not modify F/F/F scripts nor add an +activation trigger. =back @@ -80,10 +84,11 @@ foreach my $line (filedoublearray($sgmlcatlistfile)) { my $source = $line->[0]; my $dest = $line->[1]; - my $fulldest = "$tmpdir/$dest"; + my $fulldest = "$tmpdir/$dest"; $fulldest =~ s|//|/|g; # beautification if (! -d dirname($fulldest)) { + # Ensure the parent exist install_dir($tmpdir."/".dirname($dest)); } @@ -95,23 +100,20 @@ if (@sgmlinstalled) { addsubstvar($package, "misc:Depends", "sgml-base", ">= $sgmlbasever"); - if (! -d "$tmpdir/etc/sgml") { - install_dir("$tmpdir/etc/sgml"); - } + install_dir("$tmpdir/etc/sgml"); my $centralcat = "/etc/sgml/$package.cat"; - open(CENTRALCAT, ">", "$tmpdir$centralcat") || error("failed to write to $tmpdir$centralcat"); + open(my $fd, ">", "$tmpdir$centralcat") || error("failed to write to $tmpdir$centralcat"); foreach my $sgmldest (@sgmlinstalled) { - print CENTRALCAT "CATALOG " . $sgmldest . "\n"; + print {$fd} "CATALOG " . $sgmldest . "\n"; } - close CENTRALCAT; + close($fd) or error("close $tmpdir$centralcat: $!"); if (! $dh{NOSCRIPTS}) { - autoscript($package, "preinst", "preinst-sgmlcatalog", - "s%#CENTRALCAT#%$centralcat%g;"); + autotrigger($package, "activate-await", "update-sgmlcatalog"); autoscript($package, "postrm", "postrm-sgmlcatalog", - "s%#CENTRALCAT#%$centralcat%g;"); + { 'CENTRALCAT' => $centralcat }); } } else { @@ -131,9 +133,3 @@ Adam Di Carlo =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installchangelogs debhelper-11ubuntu1~16.04.york0/dh_installchangelogs --- debhelper-9.20160115ubuntu3/dh_installchangelogs 2016-01-19 18:54:31.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installchangelogs 2018-01-26 10:06:40.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-k>] [B<-X>I] [I] @@ -95,7 +97,7 @@ my $output_fn="$tmp/usr/share/doc/$package/$changelog_name"; open my $output, ">", $output_fn or error("could not open $output_fn for writing: $!"); - my $arch=package_arch($package); + my $arch=package_binary_arch($package); my $output_fn_binary="$output_fn.$arch"; open my $output_binary, ">", $output_fn_binary or error("could not open $output_fn_binary for writing: $!"); @@ -116,8 +118,9 @@ close $output or error("Couldn't close $output_fn: $!"); utime $stat[8], $stat[9], $output_fn; - chown 0, 0, $output_fn, $output_fn_binary - or error "chown: $!"; + if (should_use_root()) { + chown(0, 0, $output_fn, $output_fn_binary) or error("chown: $!"); + } umask $mask; @@ -147,77 +150,76 @@ $upstream_text=shift; } -foreach my $package (@{$dh{DOPACKAGES}}) { - next if is_udeb($package); +on_pkgs_in_parallel { + foreach my $package (@_) { + next if is_udeb($package); - my $tmp=tmpdir($package); - my $changelog=pkgfile($package,"changelog"); - my $news=pkgfile($package,"NEWS"); + my $tmp=tmpdir($package); + my $changelog=pkgfile($package,"changelog"); + my $news=pkgfile($package,"NEWS"); - if (!$changelog) { - $changelog="debian/changelog"; - } - if (!$news) { - $news="debian/NEWS"; - } + if (!$changelog) { + $changelog="debian/changelog"; + } + if (!$news) { + $news="debian/NEWS"; + } - if (! -e $changelog) { - error("could not find changelog $changelog"); - } + if (! -e $changelog) { + error("could not find changelog $changelog"); + } - # If it is a symlink to a documentation directory from the same - # source package, then don't do anything. Think multi-binary - # packages that depend on each other and want to link doc dirs. - if (-l "$tmp/usr/share/doc/$package") { - my $linkval=readlink("$tmp/usr/share/doc/$package"); - my %allpackages=map { $_ => 1 } getpackages(); - if ($allpackages{basename($linkval)}) { - next; - } - # Even if the target doesn't seem to be a doc dir from the - # same source package, don't do anything if it's a dangling - # symlink. - next unless -d "$tmp/usr/share/doc/$package"; - } + # If it is a symlink to a documentation directory from the same + # source package, then don't do anything. Think multi-binary + # packages that depend on each other and want to link doc dirs. + if (-l "$tmp/usr/share/doc/$package") { + my $linkval=readlink("$tmp/usr/share/doc/$package"); + my %allpackages=map { $_ => 1 } getpackages(); + if ($allpackages{basename($linkval)}) { + next; + } + # Even if the target doesn't seem to be a doc dir from the + # same source package, don't do anything if it's a dangling + # symlink. + next unless -d "$tmp/usr/share/doc/$package"; + } - if (! -d "$tmp/usr/share/doc/$package") { install_dir("$tmp/usr/share/doc/$package"); - } - if (! $dh{NO_ACT}) { - if (! install_binNMU_changelog($package, $changelog, $changelog_name)) { - install_file($changelog, - "$tmp/usr/share/doc/$package/$changelog_name"); + if (! $dh{NO_ACT}) { + if (! install_binNMU_changelog($package, $changelog, $changelog_name)) { + install_file($changelog, + "$tmp/usr/share/doc/$package/$changelog_name"); + } } - } - if (-e $news) { - install_file($news, "$tmp/usr/share/doc/$package/$news_name"); - } + if (-e $news) { + install_file($news, "$tmp/usr/share/doc/$package/$news_name"); + } - if (defined $upstream) { - my $link_to; - my $base="$tmp/usr/share/doc/$package"; - if (defined $upstream_text) { - install_file($upstream_text, "$base/changelog"); - $link_to='changelog'; - } - if (defined $upstream_html) { - install_file($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 (defined $upstream) { + my $link_to; + my $base="$tmp/usr/share/doc/$package"; + if (defined $upstream_text) { + install_file($upstream_text, "$base/changelog"); + $link_to='changelog'; + } + if (defined $upstream_html) { + install_file($upstream_html,"$base/changelog.html"); + $link_to='changelog.html'; + if (! defined $upstream_text) { + complex_doit("echo 'See changelog.html.gz' > $base/changelog"); + reset_perm_and_owner(0644,"$base/changelog"); + } + } + if ($dh{K_FLAG}) { + # Install symlink to original name of the upstream changelog file. + # Use basename in case original file was in a subdirectory or something. + doit("ln","-sf",$link_to,"$tmp/usr/share/doc/$package/".basename($upstream)); } - } - if ($dh{K_FLAG}) { - # Install symlink to original name of the upstream changelog file. - # Use basename in case original file was in a subdirectory or something. - doit("ln","-sf",$link_to,"$tmp/usr/share/doc/$package/".basename($upstream)); } } -} +}; =head1 SEE ALSO @@ -230,9 +232,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installcron debhelper-11ubuntu1~16.04.york0/dh_installcron --- debhelper-9.20160115ubuntu3/dh_installcron 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installcron 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<--name=>I] @@ -61,18 +63,14 @@ foreach my $type (qw{hourly daily weekly monthly}) { my $cron=pkgfile($package,"cron.$type"); if ($cron) { - if (! -d "$tmp/etc/cron.$type") { - install_dir("$tmp/etc/cron.$type"); - } + install_dir("$tmp/etc/cron.$type"); install_prog($cron,"$tmp/etc/cron.$type/".pkgfilename($package)); } } # Separate because this needs to be mode 644. my $cron=pkgfile($package,"cron.d"); if ($cron) { - if (! -d "$tmp/etc/cron.d") { - install_dir("$tmp/etc/cron.d"); - } + install_dir("$tmp/etc/cron.d"); install_file($cron,"$tmp/etc/cron.d/".pkgfilename($package)); } } @@ -88,9 +86,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installdeb debhelper-11ubuntu1~16.04.york0/dh_installdeb --- debhelper-9.20160115ubuntu3/dh_installdeb 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installdeb 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] @@ -56,11 +58,31 @@ =item I.maintscript -Lines in this file correspond to L commands and -parameters. Any shell metacharacters will be escaped, so arbitrary shell -code cannot be inserted here. For example, a line such as C will insert maintainer script snippets -into all maintainer scripts sufficient to move that conffile. +Lines in this file correspond to L +commands and parameters. However, the "maint-script-parameters" +should I be included as debhelper will add those automatically. + +Example: + + # Correct + rm_conffile /etc/obsolete.conf 0.2~ foo + # INCORRECT + rm_conffile /etc/obsolete.conf 0.2~ foo -- "$@" + +In compat 10 or later, any shell metacharacters will be escaped, so +arbitrary shell code cannot be inserted here. For example, a line +such as C will insert +maintainer script snippets into all maintainer scripts sufficient to +move that conffile. + +It was also the intention to escape shell metacharacters in previous +compat levels. However, it did not work properly and as such it was +possible to embed arbitrary shell code in earlier compat levels. + +The B tool will do some basic validation of some of +the commands listed in this file to catch common mistakes. The +validation is enabled as a warning since compat 10 and as a hard +error in compat 12. =back @@ -73,16 +95,18 @@ my %maintscript_predeps = ( "rm_conffile" => "", "mv_conffile" => "", - "symlink_to_dir" => "1.17.14", - "dir_to_symlink" => "1.17.13", + "symlink_to_dir" => "", + "dir_to_symlink" => "", +); +my %maintscript_validator = ( + "rm_conffile" => \&_validate_conffile_args, + "mv_conffile" => \&_validate_conffile_args, ); foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); - if (! -d "$tmp/DEBIAN") { - install_dir("$tmp/DEBIAN"); - } + install_dir("$tmp/DEBIAN"); if (is_udeb($package)) { # For udebs, only do the postinst, and no #DEBHELPER#. @@ -100,17 +124,47 @@ my $maintscriptfile=pkgfile($package, "maintscript"); if ($maintscriptfile) { - foreach my $line (filedoublearray($maintscriptfile)) { - my $cmd=$line->[0]; - error("unknown dpkg-maintscript-helper command: $cmd") - unless exists $maintscript_predeps{$cmd}; - addsubstvar($package, "misc:Pre-Depends", "dpkg", - ">= $maintscript_predeps{$cmd}") - if length $maintscript_predeps{$cmd}; - my $params=escape_shell(@$line); + if (compat(9)) { + foreach my $line (filedoublearray($maintscriptfile)) { + my $cmd=$line->[0]; + error("unknown dpkg-maintscript-helper command: $cmd") + unless exists $maintscript_predeps{$cmd}; + addsubstvar($package, "misc:Pre-Depends", "dpkg", + ">= $maintscript_predeps{$cmd}") + if length $maintscript_predeps{$cmd}; + my $params=escape_shell(@$line); + foreach my $script (qw{postinst preinst prerm postrm}) { + autoscript($package, $script, "maintscript-helper", + "s!#PARAMS#!$params!g"); + } + } + } else { + my @maintscripts = filedoublearray($maintscriptfile); + my @params; + foreach my $line (@maintscripts) { + my $cmd=$line->[0]; + error("unknown dpkg-maintscript-helper command: $cmd") + unless exists $maintscript_predeps{$cmd}; + addsubstvar($package, "misc:Pre-Depends", "dpkg", + ">= $maintscript_predeps{$cmd}") + if length $maintscript_predeps{$cmd}; + if (my $validator = $maintscript_validator{$cmd}) { + $validator->($package, @{$line}); + } + push(@params, escape_shell(@{$line}) ); + } foreach my $script (qw{postinst preinst prerm postrm}) { - autoscript($package, $script, "maintscript-helper", - "s!#PARAMS#!$params!g"); + my $subst = sub { + my @res; + chomp; + for my $param (@params) { + my $line = $_; + $line =~ s{#PARAMS#}{$param}g; + push(@res, $line); + } + $_ = join("\n", @res) . "\n"; + }; + autoscript($package, $script, "maintscript-helper", $subst); } } } @@ -139,10 +193,10 @@ complex_doit("find $tmp/etc -type f -printf '/etc/%P\n' | LC_ALL=C sort >> $tmp/DEBIAN/conffiles"); # Anything found? if (-z "$tmp/DEBIAN/conffiles") { - doit("rm","-f","$tmp/DEBIAN/conffiles"); + rm_files("$tmp/DEBIAN/conffiles"); } else { - doit("chmod","0644","$tmp/DEBIAN/conffiles"); + reset_perm_and_owner(0644, "$tmp/DEBIAN/conffiles"); } } } @@ -172,6 +226,43 @@ install_file($sources[0], $target); } +sub _validate_conffile_args { + my ($package, $cmd, @args) = @_; + my ($current_conffile, $new_conffile, $prior_version, $owning_package, $other); + for my $arg (@args) { + if ($arg eq '--') { + _maybe_error("The maintscripts file for $package includes a \"--\" for one of the ${cmd} commands, but it should not"); + } + } + if ($cmd eq 'rm_conffile') { + ($current_conffile, $prior_version, $owning_package, $other) = @args; + } else { + ($current_conffile, $new_conffile, $prior_version, $owning_package, $other) = @args; + } + $current_conffile //= ''; + _maybe_error("The current conffile path for ${cmd} must be present and absolute, got ${current_conffile}") + if not $current_conffile or substr($current_conffile, 0, 1) ne '/'; + _maybe_error("The new conffile path for ${cmd} must be present and absolute, got ${new_conffile}") + if $cmd eq 'mv_conffile' and (not $new_conffile or substr($new_conffile, 0, 1) ne '/'); + + _maybe_error("The version for ${cmd} ${current_conffile} is not valid, got ${prior_version}") + if $prior_version and $prior_version !~ m{^${Debian::Debhelper::Dh_Lib::PKGVERSION_REGEX}$}o; + _maybe_error("The owning package for ${cmd} ${current_conffile} is not valid, got ${owning_package}") + if $owning_package and $owning_package !~ m{^${Debian::Debhelper::Dh_Lib::PKGNAME_REGEX}$}o; + if (defined($other)) { + warning("Too many arguments for ${cmd} ${current_conffile}"); + } +} + +sub _maybe_error { + my ($msg) = @_; + if (compat(11)) { + warning($msg); + } else { + error($msg); + } +} + =head1 SEE ALSO L @@ -183,9 +274,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installdebconf debhelper-11ubuntu1~16.04.york0/dh_installdebconf --- debhelper-9.20160115ubuntu3/dh_installdebconf 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installdebconf 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-n>] [S I>] @@ -63,7 +65,7 @@ =over 4 -=item B<-n>, B<--noscripts> +=item B<-n>, B<--no-scripts> Do not modify F script. @@ -89,9 +91,7 @@ my $config=pkgfile($package,"config"); my $templates=pkgfile($package,"templates"); - if (! -d "$tmp/DEBIAN") { - install_dir("$tmp/DEBIAN"); - } + install_dir("$tmp/DEBIAN"); if (! is_udeb($package)) { debhelper_script_subst($package, "config"); @@ -136,9 +136,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installdirs debhelper-11ubuntu1~16.04.york0/dh_installdirs --- debhelper-9.20160115ubuntu3/dh_installdirs 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installdirs 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-A>] [S ...>] @@ -63,9 +65,7 @@ my $tmp=tmpdir($package); my $file=pkgfile($package,"dirs"); - if (! -e $tmp) { - install_dir($tmp); - } + install_dir($tmp) if compat(10); my @dirs; @@ -105,9 +105,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installdocs debhelper-11ubuntu1~16.04.york0/dh_installdocs --- debhelper-9.20160115ubuntu3/dh_installdocs 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installdocs 2017-12-02 08:46:03.000000000 +0000 @@ -1,5 +1,7 @@ #!/usr/bin/perl +=encoding UTF-8 + =head1 NAME dh_installdocs - install documentation into package build directories @@ -10,6 +12,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-A>] [B<-X>I] [S ...>] @@ -19,6 +23,16 @@ B is a debhelper program that is responsible for installing documentation into F in package build directories. +In compat 10 and earlier, L may be a better tool for handling +the upstream documentation, when upstream's own build system installs all the desired documentation +correctly. In this case, B is still useful for installing +packaging related documentation (e.g. the F file). + +In compat 11 and later, B offers many of the features that +L also have. Furthermore, B also supports +the B build profile to exclude documentation (regardless of compat +level). + =head1 FILES =over 4 @@ -83,6 +97,26 @@ Exclude files that contain I anywhere in their filename from being installed. Note that this includes doc-base files. +=item B<--doc-main-package=>I + +Set the main package for a documentation package. This is used to +install the documentation of the documentation package in F<< +/usr/share/doc/I >> as recommended by the Debian policy +manual 3.9.7 in §12.3. + +In compat 11 (or later), this option is only useful if debhelper's +auto-detection of the main package is wrong. The option can also be +used to silence a warning from debhelper when the auto-detection fails +but the default happens to be correct. + +This option cannot be used when B is instructed to act +on multiple packages. If you need this option, you will generally +need to combine it with B<-p> to ensure exactly one package is acted +on. + +Please keep in mind that some documentation (the copyright file, +README.Debian, etc.) will be unaffected by this option. + =item B<--link-doc=>I Make the documentation directory of all packages acted on be a symlink to @@ -101,7 +135,13 @@ is to make the documentation directory of a package be a dangling symlink, before calling B.) -B: If a previous version of the package was built without this +Please note that this option only applies to the documentation +directory for the package itself. When the package ships +documentation for another package (e.g. see B<--doc-main-package>), it +will not use a symlink for the documentation of the other package. + + +B: If a previous version of the package was built without this option and is now built with it (or vice-versa), it requires a "dir to symlink" (or "symlink to dir") migration. Since debhelper has no knowledge of previous versions, you have to enable this migration @@ -111,6 +151,12 @@ and using L to provide the relevant maintainer script snippets. +B: The use of B<--link-doc> should only be done when the +packages have same "architecture" type. A link from a architecture +independent package to a architecture dependent package (or vice +versa) will not work. Since compat 10, debhelper will actively reject +unsupported combinations. + =item I ... Install these files as documentation into the first package acted on. (Or @@ -163,87 +209,114 @@ init(options => { "link-doc=s" => \$dh{LINK_DOC}, + "sourcedir=s" => \$dh{SOURCEDIR}, + 'doc-main-package=s' => \$dh{DOC_MAIN_PACKAGE}, }); my $called_getpackages = 0; +my $default_error_handler = compat(10) ? \&glob_expand_error_handler_warn_and_discard : \&glob_expand_error_handler_reject; +my $nodocs = is_build_profile_active('nodoc') || get_buildoption('nodoc') ? 1 : 0; +# We cannot assume documentation is built under nodoc, but if it is we must flag it as handled +# or dh_missing might make noise. +$default_error_handler = \&glob_expand_error_handler_silently_ignore if $nodocs; + +if (@{$dh{DOPACKAGES}} > 1 and $dh{DOC_MAIN_PACKAGE}) { + error('--doc-main-package should be used with -p'); +} -foreach my $package (@{$dh{DOPACKAGES}}) { +if ($dh{DOC_MAIN_PACKAGE}) { + assert_opt_is_known_package($dh{DOC_MAIN_PACKAGE}, '--doc-main-package'); +} + +foreach my $package (getpackages()) { next if is_udeb($package); my $tmp=tmpdir($package); my $file=pkgfile($package,"docs"); my $link_doc=($dh{LINK_DOC} && $dh{LINK_DOC} ne $package); - - if ($link_doc) { - getpackages('both') unless $called_getpackages++; - - if (package_arch($package) ne package_arch($dh{LINK_DOC})) { - if (compat(9)) { - warning("WARNING: --link-doc between architecture all and not all packages breaks binNMUs"); - } else { - error("--link-doc not allowed between ${package} and $dh{LINK_DOC} (one is arch:all and the other not)"); + my $skip_install = process_pkg($package) ? 0 : 1; + my @search_dirs = ('.'); + my $error_handler = $skip_install ? \&glob_expand_error_handler_silently_ignore : $default_error_handler; + @search_dirs = ($dh{SOURCEDIR} // '.', default_sourcedir($package)) if not compat(10); + + if (not $skip_install) { + if ($link_doc) { + getpackages('both') unless $called_getpackages++; + + if (package_binary_arch($package) ne package_binary_arch($dh{LINK_DOC})) { + if (compat(9)) { + warning("WARNING: --link-doc between architecture all and not all packages breaks binNMUs"); + } else { + error("--link-doc not allowed between ${package} and $dh{LINK_DOC} (one is arch:all and the other not)"); + } } - } - # Make sure that the parent directory exists. - if (! -d "$tmp/usr/share/doc" && ! -l "$tmp/usr/share/doc") { - install_dir("$tmp/usr/share/doc"); - } - # Create symlink to another documentation directory if - # necessary. - if (! -d "$tmp/usr/share/doc/$package" && - ! -l "$tmp/usr/share/doc/$package") { - doit("ln", "-sf", $dh{LINK_DOC}, "$tmp/usr/share/doc/$package"); - # Policy says that if you make your documentation - # directory a symlink, then you have to depend on - # the target. - addsubstvar($package, 'misc:Depends', "$dh{LINK_DOC} (= \${binary:Version})"); + # Make sure that the parent directory exists. + if (!-d "$tmp/usr/share/doc" && !-l "$tmp/usr/share/doc") { + install_dir("$tmp/usr/share/doc"); + } + # Create symlink to another documentation directory if + # necessary. + if (!-d "$tmp/usr/share/doc/$package" && + !-l "$tmp/usr/share/doc/$package") { + make_symlink_raw_target($dh{LINK_DOC}, "$tmp/usr/share/doc/$package"); + # Policy says that if you make your documentation + # directory a symlink, then you have to depend on + # the target. + addsubstvar($package, 'misc:Depends', "$dh{LINK_DOC} (= \${binary:Version})"); + } + } else { + ensure_docdir($package); } } - else { - ensure_docdir($package); - } my @docs; if ($file) { - @docs=filearray($file, "."); + @docs = filearray($file, \@search_dirs, $error_handler); } - if (($package eq $dh{FIRSTPACKAGE} || ($dh{PARAMS_ALL} && ! $link_doc)) && @ARGV) { + if (($package eq $dh{FIRSTPACKAGE} || ($dh{PARAMS_ALL} && !$link_doc)) && @ARGV) { push @docs, @ARGV; } - if (@docs) { - my $exclude = ''; + log_installed_files($package, @docs); + + next if $skip_install; + + if (not $nodocs and @docs) { + my $exclude = ' -and ! -empty'; + my $target_package = compute_doc_main_package($package); + if (not defined($target_package)) { + warning("Cannot auto-detect main package for ${package}. If the default is wrong, please use --doc-main-package"); + $target_package = $package; + } if ($dh{EXCLUDE_FIND}) { $exclude .= ' -and ! \( '.$dh{EXCLUDE_FIND}.' \)'; } - if (! compat(4)) { - # ignore empty files in subdirs - $exclude .= ' -and ! -empty'; - } + my $target_dir = "${tmp}/usr/share/doc/${target_package}"; + install_dir($target_dir) unless -l $target_dir; + foreach my $doc (@docs) { next if excludefile($doc); - next if -e $doc && ! -s $doc && ! compat(4); # ignore empty files + next if -f $doc && ! -s _; # ignore empty files ensure_docdir($package); if (-d $doc && length $exclude) { my $basename = basename($doc); my $dir = ($basename eq '.') ? $doc : "$doc/.."; my $pwd=`pwd`; chomp $pwd; - my $docdir = "$pwd/$tmp/usr/share/doc/$package"; + # Gracefully handling tmpdir being absolute (-P/...) + my $docdir = $target_dir =~ m{^/} ? $target_dir : "${pwd}/${target_dir}"; complex_doit("cd '$dir' && " . "find '$basename' \\( -type f -or -type l \\)$exclude -print0 | LC_ALL=C sort -z | " . "xargs -0 -I {} cp --reflink=auto --parents -dp {} $docdir"); } else { - doit("cp", '--reflink=auto', "-a", $doc, - "$tmp/usr/share/doc/$package"); + doit("cp", '--reflink=auto', "-a", $doc, $target_dir); } } - doit("chown","-R","0:0","$tmp/usr/share/doc"); - doit("chmod","-R","go=rX","$tmp/usr/share/doc"); - doit("chmod","-R","u+rw","$tmp/usr/share/doc"); + doit("chown","-R","0:0","$tmp/usr/share/doc") if should_use_root(); + doit("chmod","-R","u+rw,go=rX","$tmp/usr/share/doc"); } # .Debian is correct, according to policy, but I'm easy. @@ -287,6 +360,8 @@ } } + next if $nodocs; + # Handle doc-base files. There are two filename formats, the usual # plus an extended format (debian/package.*). my %doc_ids; @@ -304,8 +379,8 @@ next if $fn=~/\.EX$/; next if excludefile($fn); # Parse the file to get the doc id. - open (IN, "debian/$fn") || die "Cannot read debian/$fn."; - while () { + open(my $fd, '<', "debian/$fn") || die "Cannot read debian/$fn."; + while (<$fd>) { s/\s*$//; if (/^Document\s*:\s*(.*)/) { $doc_ids{$fn}=$1; @@ -315,14 +390,12 @@ if (! exists $doc_ids{$fn}) { warning("Could not parse $fn for doc-base Document id; skipping"); } - close IN; + close($fd); } closedir(DEB); if (%doc_ids) { - if (! -d "$tmp/usr/share/doc-base/") { - install_dir("$tmp/usr/share/doc-base/"); - } + install_dir("$tmp/usr/share/doc-base/"); } # check for duplicate document ids my %used_doc_ids; @@ -362,9 +435,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installemacsen debhelper-11ubuntu1~16.04.york0/dh_installemacsen --- debhelper-9.20160115ubuntu3/dh_installemacsen 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installemacsen 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-n>] [B<--priority=>I] [B<--flavor=>I] @@ -55,7 +57,7 @@ =over 4 -=item B<-n>, B<--noscripts> +=item B<-n>, B<--no-scripts> Do not modify F/F scripts. @@ -100,42 +102,34 @@ my $emacsen_startup=pkgfile($package,"emacsen-startup"); if ($emacsen_compat ne '') { - if (! -d "$tmp/usr/lib/emacsen-common/packages/compat") { - install_dir("$tmp/usr/lib/emacsen-common/packages/compat"); - } + install_dir("$tmp/usr/lib/emacsen-common/packages/compat"); install_file($emacsen_compat, "$tmp/usr/lib/emacsen-common/packages/compat/$package"); } if ($emacsen_install ne '') { - if (! -d "$tmp/usr/lib/emacsen-common/packages/install") { - install_dir("$tmp/usr/lib/emacsen-common/packages/install"); - } + install_dir("$tmp/usr/lib/emacsen-common/packages/install"); install_prog($emacsen_install,"$tmp/usr/lib/emacsen-common/packages/install/$package"); } if ($emacsen_remove ne '') { - if (! -d "$tmp/usr/lib/emacsen-common/packages/remove") { - install_dir("$tmp/usr/lib/emacsen-common/packages/remove"); - } + install_dir("$tmp/usr/lib/emacsen-common/packages/remove"); install_prog("$emacsen_remove","$tmp/usr/lib/emacsen-common/packages/remove/$package"); } if ($emacsen_startup ne '') { - if (! -d "$tmp/etc/$dh{FLAVOR}/site-start.d/") { - install_dir("$tmp/etc/$dh{FLAVOR}/site-start.d/"); - } + install_dir("$tmp/etc/$dh{FLAVOR}/site-start.d/"); install_file($emacsen_startup,"$tmp/etc/$dh{FLAVOR}/site-start.d/$dh{PRIORITY}$package.el"); } if ($emacsen_install ne '' || $emacsen_remove ne '') { if (! $dh{NOSCRIPTS}) { autoscript($package,"preinst","preinst-emacsen", - "s/#PACKAGE#/$package/g"); + { 'PACKAGE' => $package }); autoscript($package,"postinst","postinst-emacsen", - "s/#PACKAGE#/$package/g"); + { 'PACKAGE' => $package }); autoscript($package,"prerm","prerm-emacsen", - "s/#PACKAGE#/$package/g"); + { 'PACKAGE' => $package }); } } } @@ -152,9 +146,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installexamples debhelper-11ubuntu1~16.04.york0/dh_installexamples --- debhelper-9.20160115ubuntu3/dh_installexamples 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installexamples 2017-11-28 12:40:27.000000000 +0000 @@ -1,5 +1,7 @@ #!/usr/bin/perl +=encoding UTF-8 + =head1 NAME dh_installexamples - install example files into package build directories @@ -10,6 +12,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-A>] [B<-X>I] [S ...>] @@ -39,6 +43,33 @@ Install any files specified by command line parameters in ALL packages acted on. +=item B<--sourcedir=>I + +Look in the specified directory for files to be installed. This option +requires compat 11 or later (it is silently ignored in compat 10 or earlier). + +Note that this is not the same as the B<--sourcedirectory> option used +by the BI<*> commands. You rarely need to use this option, since +B automatically looks for files in F in debhelper +compatibility level 11 and above. + +=item B<--doc-main-package=>I + +Set the main package for a documentation package. This is used to +install the documentation of the documentation package in F<< +/usr/share/doc/I >> as recommended by the Debian policy +manual 3.9.7 in §12.3. + +In compat 11 (or later), this option is only useful if debhelper's +auto-detection of the main package is wrong. The option can also be +used to silence a warning from debhelper when the auto-detection fails +but the default happens to be correct. + +This option cannot be used when B is instructed to act +on multiple packages. If you need this option, you will generally +need to combine it with B<-p> to ensure exactly one package is acted +on. + =item B<-X>I, B<--exclude=>I Exclude files that contain I anywhere in their filename from @@ -59,31 +90,60 @@ =cut -init(); +init(options => { + "sourcedir=s" => \$dh{SOURCEDIR}, + 'doc-main-package=s' => \$dh{DOC_MAIN_PACKAGE}, +}); + +# PROMISE: DH NOOP WITHOUT pkgfile-logged(examples) + +my $pwd; +my $default_error_handler = compat(10) ? \&glob_expand_error_handler_warn_and_discard : \&glob_expand_error_handler_reject; +my $nodocs = is_build_profile_active('nodoc') || get_buildoption('nodoc') ? 1 : 0; +# We cannot assume documentation is built under nodoc, but if it is we must flag it as handled +# or dh_missing might make noise. +$default_error_handler = \&glob_expand_error_handler_silently_ignore if $nodocs; -# PROMISE: DH NOOP WITHOUT examples +if (@{$dh{DOPACKAGES}} > 1 and $dh{DOC_MAIN_PACKAGE}) { + error('--doc-main-package should be used with -p'); +} +if ($dh{DOC_MAIN_PACKAGE}) { + assert_opt_is_known_package($dh{DOC_MAIN_PACKAGE}, '--doc-main-package'); +} -foreach my $package (@{$dh{DOPACKAGES}}) { +foreach my $package (getpackages()) { next if is_udeb($package); my $tmp=tmpdir($package); my $file=pkgfile($package,"examples"); + my @search_dirs = ('.'); + my $skip_install = process_pkg($package) ? 0 : 1; + my $error_handler = $skip_install ? \&glob_expand_error_handler_silently_ignore : $default_error_handler; + @search_dirs = ($dh{SOURCEDIR} // '.', default_sourcedir($package)) if not compat(10); my @examples; if ($file) { - @examples=filearray($file, "."); + @examples = filearray($file, \@search_dirs, $error_handler) if $file; } if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { push @examples, @ARGV; } - + + log_installed_files($package, @examples); + + next if $skip_install or $nodocs; + if (@examples) { - if (! -d "$tmp/usr/share/doc/$package/examples") { - install_dir("$tmp/usr/share/doc/$package/examples"); + my $target_package = compute_doc_main_package($package); + if (not defined($target_package)) { + warning("Cannot auto-detect main package for ${package}. If the default is wrong, please use --doc-main-package"); + $target_package = $package; } - + my $target_dir = "${tmp}/usr/share/doc/${target_package}/examples"; + install_dir($target_dir); + my $exclude = ''; if ($dh{EXCLUDE_FIND}) { $exclude .= ' -and ! \( '.$dh{EXCLUDE_FIND}.' \)'; @@ -94,16 +154,15 @@ if (-d $example && $exclude) { my $basename = basename($example); my $dir = ($basename eq '.') ? $example : "$example/.."; - my $pwd=`pwd`; - chomp $pwd; - my $exclude2 = '-type f'.$exclude; + chomp($pwd=`pwd`) if not defined($pwd); + # Gracefully handling tmpdir being absolute (-P/...) + my $destdir = $target_dir =~ m{^/} ? $target_dir : "${pwd}/${target_dir}"; complex_doit("cd '$dir' && " . "find '$basename' -type f$exclude -print0 | LC_ALL=C sort -z | " . - "xargs -0 -I {} cp --reflink=auto --parents -dp {} $pwd/$tmp/usr/share/doc/$package/examples"); + "xargs -0 -I {} cp --reflink=auto --parents -dp {} ${destdir}"); } else { - doit("cp", '--reflink=auto', "-a", $example, - "$tmp/usr/share/doc/$package/examples"); + doit("cp", '--reflink=auto', "-a", $example, $target_dir); } } } @@ -120,9 +179,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installgsettings debhelper-11ubuntu1~16.04.york0/dh_installgsettings --- debhelper-9.20160115ubuntu3/dh_installgsettings 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installgsettings 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<--priority=>] @@ -76,7 +78,9 @@ if (-d "$gsettings_schemas_dir") { # Get a list of the schemas - my $schemas = `find $gsettings_schemas_dir -type f \\( -name \\*.xml -o -name \\*.override \\) -printf '%P '`; + my $schemas = qx_cmd('find', $gsettings_schemas_dir, '-type', 'f', + '(', '-name', '*.xml', '-o', '-name', '*.override', + ')', '-printf', '%P'); if ($schemas ne '') { addsubstvar($package, "misc:Depends", "dconf-gsettings-backend | gsettings-backend"); } @@ -98,9 +102,3 @@ =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installifupdown debhelper-11ubuntu1~16.04.york0/dh_installifupdown --- debhelper-9.20160115ubuntu3/dh_installifupdown 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installifupdown 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<--name=>I] @@ -61,9 +63,7 @@ foreach my $script (qw(pre-up up down post-down)) { my $file=pkgfile($package, "if-$script"); if ($file ne '') { - if (! -d "$tmp/etc/network/if-$script.d") { - install_dir("$tmp/etc/network/if-$script.d"); - } + install_dir("$tmp/etc/network/if-$script.d"); install_prog($file,"$tmp/etc/network/if-$script.d/".pkgfilename($package)); } } @@ -80,9 +80,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installinfo debhelper-11ubuntu1~16.04.york0/dh_installinfo --- debhelper-9.20160115ubuntu3/dh_installinfo 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installinfo 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-A>] [S ...>] @@ -38,6 +40,16 @@ Install all files specified by command line parameters in ALL packages acted on. +=item B<--sourcedir=>I + +Look in the specified directory for files to be installed. This option +requires compat 11 or later (it is silently ignored in compat 10 or earlier). + +Note that this is not the same as the B<--sourcedirectory> option used +by the BI<*> commands. You rarely need to use this option, since +B automatically looks for files in F in debhelper +compatibility level 11 and above. + =item I ... Install these info files into the first package acted on. (Or in @@ -51,27 +63,36 @@ # PROMISE: DH NOOP WITHOUT info -foreach my $package (@{$dh{DOPACKAGES}}) { +my $default_error_handler = compat(10) ? \&glob_expand_error_handler_warn_and_discard : \&glob_expand_error_handler_reject; +my $nodocs = is_build_profile_active('nodoc') || get_buildoption('nodoc') ? 1 : 0; +# We cannot assume documentation is built under nodoc, but if it is we must flag it as handled +# or dh_missing might make noise. +$default_error_handler = \&glob_expand_error_handler_silently_ignore if $nodocs; + +foreach my $package (getpackages()) { my $tmp=tmpdir($package); my $file=pkgfile($package,"info"); + my @search_dirs = ('.'); + my $skip_install = process_pkg($package) ? 0 : 1; + my $error_handler = $skip_install ? \&glob_expand_error_handler_silently_ignore : $default_error_handler; + @search_dirs = ($dh{SOURCEDIR} // '.', default_sourcedir($package)) if not compat(10); my @info; if ($file) { - @info=filearray($file, "."); + @info = filearray($file, \@search_dirs, $error_handler) if $file; } if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { push @info, @ARGV; } + next if $skip_install or $nodocs; + if (@info) { - if ( ! -d "$tmp/usr/share/info") { - install_dir("$tmp/usr/share/info"); - } - doit("cp", '--reflink=auto', @info, "$tmp/usr/share/info"); - doit("chmod","-R", "go=rX","$tmp/usr/share/info/"); - doit("chmod","-R", "u+rw","$tmp/usr/share/info/"); + install_dir("$tmp/usr/share/info"); + xargs(\@info, "cp", '--reflink=auto', XARGS_INSERT_PARAMS_HERE, "$tmp/usr/share/info"); + doit("chmod","-R", "u+rw,go=rX","$tmp/usr/share/info/"); } } @@ -86,9 +107,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installinit debhelper-11ubuntu1~16.04.york0/dh_installinit --- debhelper-9.20160115ubuntu3/dh_installinit 2016-01-19 18:54:31.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installinit 2017-11-28 12:40:27.000000000 +0000 @@ -11,6 +11,8 @@ use Debian::Debhelper::Dh_Lib; use File::Find; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<--name=>I] [B<-n>] [B<-R>] [B<-r>] [B<-d>] [S I>] @@ -18,13 +20,19 @@ =head1 DESCRIPTION B is a debhelper program that is responsible for installing -init scripts with associated defaults files, as well as upstart job files, -and systemd service files into package build directories. +init scripts with associated defaults files. In compatibility levels up to +11, B also handled upstart job files and systemd service files. It also automatically generates the F and F and F commands needed to set up the symlinks in F to start and stop the init scripts. +In compat 10 or earlier: If a package only ships a systemd service +file and no sysvinit script is provided, you may want to exclude the +call to dh_installinit for that package (e.g. via B<-N>). Otherwise, +you may get warnings from lintian about init.d scripts not being +included in the package. + =head1 FILES =over 4 @@ -41,19 +49,24 @@ =item debian/I.upstart -If this exists, it is installed into etc/init/I.conf in the package -build directory. +In compatibility level 11, this file will trigger an error with a reminder +about ensuring the proper removal of the upstart file in the previous package +version. Please consider using the "rm_conffile" feature from +L to ensure the proper removal of previous upstart files. + +In compatibility level 10, if this file exists, it is installed into +etc/init/I.conf in the package build directory. =item debian/I.service If this exists, it is installed into lib/systemd/system/I.service in -the package build directory. +the package build directory. Only used in compat levels 10 and below. =item debian/I.tmpfile If this exists, it is installed into usr/lib/tmpfiles.d/I.conf in the package build directory. (The tmpfiles.d mechanism is currently only used -by systemd.) +by systemd.) Only used in compat levels 10 and below. =back @@ -61,11 +74,11 @@ =over 4 -=item B<-n>, B<--noscripts> +=item B<-n>, B<--no-scripts> Do not modify F/F/F scripts. -=item B<-o>, B<--onlyscripts> +=item B<-o>, B<--only-scripts> Only modify F/F/F scripts, do not actually install any init script, default files, upstart job or systemd service file. May be @@ -78,23 +91,43 @@ call. Example: override_dh_installinit: - dh_installinit -pfoo --onlyscripts + dh_installinit -pfoo --only-scripts dh_installinit --remaining =item B<-R>, B<--restart-after-upgrade> Do not stop the init script until after the package upgrade has been -completed. This is different than the default behavior, which stops the -script in the F, and starts it again in the F. +completed. This is the default behaviour in compat 10. + +In early compat levels, the default was to stop the script in the +F, and starts it again in the F. This can be useful for daemons that should not have a possibly long downtime during upgrade. But you should make sure that the daemon will not get confused by the package being upgraded while it's running before using this option. -=item B<-r>, B<--no-restart-on-upgrade> +=item B<--no-restart-after-upgrade> -Do not stop init script on upgrade. +Undo a previous B<--restart-after-upgrade> (or the default of compat +10). If no other options are given, this will cause the service to be +stopped in the F script and started again in the F +script. + +=item B<-r>, B<--no-stop-on-upgrade>, B<--no-restart-on-upgrade> + +Do not stop init script on upgrade. This has the side-effect of not +restarting the service as a part of the upgrade. + +If you want to restart the service with minimal downtime, please use +B<--restart-after-upgrade> (default in compat 10 or later). If you want +the service to be restarted but be stopped during the upgrade, then please +use B<--no-restart-after-upgrade> (note the "after-upgrade"). + +Note that the B<--no-restart-on-upgrade> alias is deprecated and will +be removed in compat 12. This is to avoid confusion with the +B<--no-restart-after-upgrade> option. The B<--no-stop-on-upgrade> +variant was introduced in debhelper 10.2 (included in Debian stretch). =item B<--no-start> @@ -155,11 +188,18 @@ =cut +$dh{RESTART_AFTER_UPGRADE} = 1 if not compat(9); + init(options => { "r" => \$dh{R_FLAG}, - "no-restart-on-upgrade" => \$dh{R_FLAG}, + 'no-stop-on-upgrade' => \$dh{R_FLAG}, + "no-restart-on-upgrade" => sub { + $dh{R_FLAG} = 1; + deprecated_functionality("--no-restart-on-upgrade has been renamed to --no-stop-on-upgrade", + 12); + }, "no-start" => \$dh{NO_START}, - "R|restart-after-upgrade" => \$dh{RESTART_AFTER_UPGRADE}, + "R|restart-after-upgrade!" => \$dh{RESTART_AFTER_UPGRADE}, "init-script=s" => \$dh{INIT_SCRIPT}, "update-rcd-params=s", => \$dh{U_PARAMS}, "remove-d" => \$dh{D_FLAG}, @@ -204,42 +244,42 @@ } } - my $service=pkgfile($package,"service"); + my $service=''; + $service=pkgfile($package,"service") if compat(10); if ($service ne '' && ! $dh{ONLYSCRIPTS}) { my $path="$tmp/lib/systemd/system"; - if (! -d $path) { - install_dir($path); - } - + install_dir($path); install_file($service, "$path/$script.service"); } - my $tmpfile=pkgfile($package,"tmpfile"); + my $tmpfile=''; + $tmpfile=pkgfile($package,"tmpfile") if compat(10); if ($tmpfile ne '' && ! $dh{ONLYSCRIPTS}) { my $path="$tmp/usr/lib/tmpfiles.d"; - if (! -d $path) { - install_dir($path); - } - + install_dir($path); install_file($tmpfile, "$path/$script.conf"); } my $job=pkgfile($package,"upstart"); + if ($job ne '' and not compat(11)) { + isnative($package); # For the side-effect of setting $dh{VERSION} + warning("Detected an upstart file; these are no longer supported by dh_installinit in compat 11"); + warning("Please ensure a proper removal by adding a \"rm_conffile\" line in debian/.maintscript"); + warning("Example maintscript line:"); + warning(" rm_conffile /etc/init/${jobfile}.conf $dh{VERSION}"); + warning("(Note: the example is a best-effort guess and it is not always correct! Please verify before use)"); + warning("see \"man dh_installdeb\" for more information about the maintscript file"); + warning(""); + error("upstart jobs are no longer supported! Please remove $job and check if you need to add a conffile removal"); + } if ($job ne '' && ! $dh{ONLYSCRIPTS}) { - if (! -d "$tmp/etc/init") { - install_dir("$tmp/etc/init"); - } - + install_dir("$tmp/etc/init"); install_file($job, "$tmp/etc/init/$jobfile.conf"); - # Add dependency on lsb-base that provides the upstart lsb-hook - addsubstvar($package, "misc:Depends", "lsb-base", ">= 4.1+Debian11ubuntu7"); } my $default=pkgfile($package,'default'); if ($default ne '' && ! $dh{ONLYSCRIPTS}) { - if (! -d "$tmp/etc/default") { - install_dir("$tmp/etc/default"); - } + install_dir("$tmp/etc/default"); install_file($default, "$tmp/etc/default/$script"); } @@ -247,10 +287,7 @@ pkgfile($package,"init.d"); if ($init ne '' && ! $dh{ONLYSCRIPTS}) { - if (! -d "$tmp/etc/init.d") { - install_dir("$tmp/etc/init.d"); - } - + install_dir("$tmp/etc/init.d"); install_prog($init,"$tmp/etc/init.d/$script"); } @@ -258,7 +295,7 @@ error("Can't use --init-script with an upstart job"); } - if (!$dh{NOSCRIPTS}) { + if (compat(10) && !$dh{NOSCRIPTS}) { # Include postinst-init-tmpfiles if the package ships any files # in /usr/lib/tmpfiles.d or /etc/tmpfiles.d my @tmpfiles; @@ -345,9 +382,3 @@ Michael Stapelberg =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installlogcheck debhelper-11ubuntu1~16.04.york0/dh_installlogcheck --- debhelper-9.20160115ubuntu3/dh_installlogcheck 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installlogcheck 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] @@ -68,11 +70,9 @@ $typenod=~s/\.d//; my $logcheck=pkgfile($package,"logcheck.$typenod"); if ($logcheck) { - if (! -d "$tmp/etc/logcheck/$type") { - install_dir("$tmp/etc/logcheck/$type"); - } my $packagenodot=pkgfilename($package); # run-parts.. $packagenodot=~s/\./_/g; + install_dir("$tmp/etc/logcheck/$type"); install_file($logcheck, "$tmp/etc/logcheck/$type/$packagenodot"); } } @@ -89,9 +89,3 @@ Jon Middleton =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installlogrotate debhelper-11ubuntu1~16.04.york0/dh_installlogrotate --- debhelper-9.20160115ubuntu3/dh_installlogrotate 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installlogrotate 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<--name=>I] @@ -43,9 +45,7 @@ my $file=pkgfile($package,"logrotate"); if ($file) { - if (! -d "$tmp/etc/logrotate.d") { - install_dir("$tmp/etc/logrotate.d"); - } + install_dir("$tmp/etc/logrotate.d"); install_file($file,"$tmp/etc/logrotate.d/".pkgfilename($package)); } } @@ -61,9 +61,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installman debhelper-11ubuntu1~16.04.york0/dh_installman --- debhelper-9.20160115ubuntu3/dh_installman 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installman 2017-11-28 13:11:33.000000000 +0000 @@ -11,21 +11,38 @@ use File::Find; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [S ...>] =head1 DESCRIPTION -B is a debhelper program that handles installing -man pages into the correct locations in package build directories. You tell -it what man pages go in your packages, and it figures out where to install -them based on the section field in their B<.TH> or B<.Dt> line. If you have -a properly formatted B<.TH> or B<.Dt> line, your man page will be installed -into the right directory, with the right name (this includes proper handling -of pages with a subsection, like B<3perl>, which are placed in F, and -given an extension of F<.3perl>). If your B<.TH> or B<.Dt> line is incorrect -or missing, the program may guess wrong based on the file extension. +B is a debhelper program that handles installing man +pages into the correct locations in package build directories. + +In compat 10 and earlier, this program was primarily for when +upstream's build system does not properly install them as a part of +its install step (or it does not have an install step). In compat 11 +and later, it supports the same features of L and +has the advantage that it respects the B build profile (unlike +L). + +Even if you prefer to use L for installing the manpages, +B can still be useful for converting the manpage encoding +to UTF-8 and for converting F<.so> links (as described below). However, +that part happens automatically without any explicit configuration. + + +You tell B what man pages go in your packages, and it figures out +where to install them based on the section field in their B<.TH> or +B<.Dt> line. If you have a properly formatted B<.TH> or B<.Dt> line, +your man page will be installed into the right directory, with the +right name (this includes proper handling of pages with a subsection, +like B<3perl>, which are placed in F, and given an extension of +F<.3perl>). If your B<.TH> or B<.Dt> line is incorrect or missing, the +program may guess wrong based on the file extension. It also supports translated man pages, by looking for extensions like F<.ll.8> and F<.ll_LL.8>, or by use of the B<--language> switch. @@ -73,6 +90,16 @@ Use this to specify that the man pages being acted on are written in the specified language. +=item B<--sourcedir=>I + +Look in the specified directory for files to be installed. This option +requires compat 11 or later (it is silently ignored in compat 10 or earlier). + +Note that this is not the same as the B<--sourcedirectory> option used +by the BI<*> commands. You rarely need to use this option, since +B automatically looks for files in F in debhelper +compatibility level 11 and above. + =item I ... Install these man pages into the first package acted on. (Or in all @@ -80,6 +107,20 @@ =back +=head1 EXAMPLES + +An example F file could look like this: + + doc/man/foo.1 + # Translations + doc/man/foo.da.1 + doc/man/foo.de.1 + doc/man/foo.fr.1 + # NB: The following line is considered a polish translation + # of "foo.1" (and not a manpage written in perl called "foo.pl") + doc/man/foo.pl.1 + # ... + =head1 NOTES An older version of this program, L, is still used @@ -91,156 +132,208 @@ init(options => { "language=s" => \$dh{LANGUAGE}, + "sourcedir=s" => \$dh{SOURCEDIR}, }); -my @sofiles; -my @sodests; -# PROMISE: DH NOOP WITHOUT manpages tmp(usr/share/man) +# PROMISE: DH NOOP WITHOUT pkgfile-logged(manpages) tmp(usr/share/man) -foreach my $package (@{$dh{DOPACKAGES}}) { - next if is_udeb($package); +my (@sofiles, @sodests); +my @all_packages = getpackages(); - my $tmp=tmpdir($package); - my $file=pkgfile($package,"manpages"); - my @manpages; +my $default_error_handler = compat(10) ? \&glob_expand_error_handler_warn_and_discard : \&glob_expand_error_handler_reject; +my $nodocs = is_build_profile_active('nodoc') || get_buildoption('nodoc') ? 1 : 0; +# We cannot assume documentation is built under nodoc, but if it is we must flag it as handled +# or dh_missing might make noise. +$default_error_handler = \&glob_expand_error_handler_silently_ignore if $nodocs; - @manpages=filearray($file, ".") if $file; +on_items_in_parallel(\@all_packages, sub { - if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { - push @manpages, @ARGV; - } + foreach my $package (@_) { + next if is_udeb($package); - foreach my $page (@manpages) { - my $basename=basename($page); + my $tmp = tmpdir($package); + my $file = pkgfile($package, "manpages"); + my @manpages; + my @search_dirs = ('.'); + my $skip_install = process_pkg($package) ? 0 : 1; + my $error_handler = $skip_install ? \&glob_expand_error_handler_silently_ignore : $default_error_handler; + @search_dirs = ($dh{SOURCEDIR} // '.', default_sourcedir($package)) if not compat(10); - # Support compressed pages. - my $gz=''; - if ($basename=~m/(.*)(\.gz)/) { - $basename=$1; - $gz=$2; - } + @manpages = filearray($file, \@search_dirs, $error_handler) if $file; - my $section; - # See if there is a .TH or .Dt entry in the man page. If so, - # we'll pull the section field from that. - if ($gz) { - open (IN, "zcat $page|") or die "$page: $!"; + if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @manpages, @ARGV; } - else { - open (IN, $page) or die "$page: $!"; - } - while () { - if (/^\.TH\s+\S+\s+"?(\d+[^"\s]*)"?/ || - /^\.Dt\s+\S+\s+(\d+[^\s]*)/) { - $section=$1; - last; + + log_installed_files($package, @manpages); + + next if $skip_install or $nodocs; + + foreach my $page (@manpages) { + my $basename = basename($page); + + # Support compressed pages. + my $gz = ''; + if ($basename =~ m/(.*)(\.gz)/) { + $basename = $1; + $gz = $2; } - } - close(IN); - # Failing that, we can try to get it from the filename. - if (! $section) { - ($section)=$basename=~m/.*\.([1-9]\S*)/; - } - # Now get the numeric component of the section. - my ($realsection)=$section=~m/^(\d)/ if defined $section; - if (! $realsection) { - error("Could not determine section for $page"); - } - - # Get the man page's name -- everything up to the last dot. - my ($instname)=$basename=~m/^(.*)\./; - - my $destdir="$tmp/usr/share/man/man$realsection/"; - my $langcode; - if (! defined $dh{LANGUAGE} || ! exists $dh{LANGUAGE}) { - # Translated man pages are typically specified by adding the - # language code to the filename, so detect that and - # redirect to appropriate directory, stripping the code. - ($langcode)=$basename=~m/.*\.([a-z][a-z](?:_[A-Z][A-Z])?)\.(?:[1-9]|man)/; - } - elsif ($dh{LANGUAGE} ne 'C') { - $langcode=$dh{LANGUAGE}; - } - - if (defined $langcode && $langcode ne '') { - # Strip the language code from the instname. - $instname=~s/\.$langcode$//; - } - - if (defined $langcode && $langcode ne '') { - $destdir="$tmp/usr/share/man/$langcode/man$realsection/"; - } - $destdir=~tr:/:/:s; # just for looks - my $instpage="$destdir$instname.$section"; + my ($fd, $section); + # See if there is a .TH or .Dt entry in the man page. If so, + # we'll pull the section field from that. + if ($gz) { + $fd = open_gz($page) or die "$page: $!"; + } + else { + open($fd, '<', $page) or die "$page: $!"; + } + while (<$fd>) { + if (/^\.TH\s+\S+\s+"?(\d+[^"\s]*)"?/ || + /^\.Dt\s+\S+\s+(\d+[^\s]*)/) { + $section = $1; + last; + } + } + close($fd); + # Failing that, we can try to get it from the filename. + if (!$section) { + ($section) = $basename =~ m/\.([1-9]\S*)/; + } - next if -l $instpage; - next if compat(5) && -e $instpage; + # Now get the numeric component of the section. + my ($realsection) = $section =~ m/^(\d)/ if defined $section; + if (!$realsection) { + error("Could not determine section for $page"); + } + + # Get the man page's name -- everything up to the last dot. + my ($instname) = $basename =~ m/^(.*)\./; + + my $destdir = "$tmp/usr/share/man/man$realsection/"; + my $langcode; + if (!defined $dh{LANGUAGE} || !exists $dh{LANGUAGE}) { + if (not compat(10) and $page =~ m{/man/(?:([a-z][a-z](?:_[A-Z][A-Z])?)(?:\.[^/]+)?)?/man[1-9]/}) { + # If it looks like it was installed in a proper man dir, assume the language + # from that is correct. + $langcode = $1; + } else { + # Translated man pages are typically specified by adding the + # language code to the filename, so detect that and + # redirect to appropriate directory, stripping the code. + ($langcode) = $basename =~ m/\.([a-z][a-z](?:_[A-Z][A-Z])?)\.(?:[1-9]|man)/; + } + } elsif ($dh{LANGUAGE} ne 'C') { + $langcode = $dh{LANGUAGE}; + } + + if (defined $langcode && $langcode ne '') { + # Strip the language code from the instname. + $instname =~ s/\.$langcode$//; + } + + if (defined $langcode && $langcode ne '') { + $destdir = "$tmp/usr/share/man/$langcode/man$realsection/"; + } + $destdir =~ tr:/:/:s; # just for looks + my $instpage = "$destdir$instname.$section"; + + next if -l $instpage; + next if -e _ && compat(5); - if (! -d $destdir) { install_dir($destdir); + if ($gz) { + doit({ stdout => $instpage }, 'zcat', $page); + } + else { + install_file($page, $instpage); + } } - if ($gz) { - complex_doit "zcat \Q$page\E > \Q$instpage\E"; + + # Now the .so conversion. + @sofiles = @sodests = (); + foreach my $dir (qw{usr/share/man}) { + if (-e "$tmp/$dir") { + find(\&find_so_man, "$tmp/$dir"); + } } - else { - install_file($page, $instpage); + foreach my $sofile (@sofiles) { + my $sodest = shift(@sodests); + rm_files($sofile); + make_symlink_raw_target($sodest, $sofile); } } - # Now the .so conversion. - @sofiles=@sodests=(); - foreach my $dir (qw{usr/share/man}) { - if (-e "$tmp/$dir") { - find(\&find_so_man, "$tmp/$dir"); - } - } - foreach my $sofile (@sofiles) { - my $sodest=shift(@sodests); - doit "rm","-f",$sofile; - doit "ln","-sf",$sodest,$sofile; - } +}); - # Now utf-8 conversion. - if (defined `man --version`) { +# Now utf-8 conversion. +if (defined `man --version`) { + my (@manpages_to_reencode, @issues); + for my $package (@{$dh{DOPACKAGES}}) { + next if is_udeb($package); + my $tmp = tmpdir($package); foreach my $dir (qw{usr/share/man}) { next unless -e "$tmp/$dir"; find(sub { - return if ! -f $_ || -l $_; - my ($tmp, $orig)=($_.".new", $_); - complex_doit "man --recode UTF-8 ./\Q$orig\E > \Q$tmp\E"; - # recode uncompresses compressed pages - doit "rm", "-f", $orig if s/\.(gz|Z)$//; - doit "chmod", 644, $tmp; - doit "mv", "-f", $tmp, $_; - }, "$tmp/$dir"); + return if -l $_ || !-f _; + if ($_ =~ m/\.dh-new$/) { + push(@issues, "${File::Find::dir}/${_}"); + return; + } + push(@manpages_to_reencode, "${File::Find::dir}/${_}"); + }, "$tmp/$dir"); + } + if (@issues) { + warning("Removing temporary manpages from another dh_installman instance"); + rm_files(@issues); + warning("Possibly race-condition detected or left-overs from an interrupted dh_installman (e.g. with ^C)"); + error("Please ensure there are no parallel dh_installman's running (for this pkg) and then re-run dh_installman"); } } + if (@manpages_to_reencode) { + on_items_in_parallel(\@manpages_to_reencode, sub { + for my $manpage (@_) { + my $manpage_tmp = "${manpage}.dh-new"; + my $manpage_cmd = ($manpage =~ m{^/}) ? $manpage : "./${manpage}"; + doit({ stdout => $manpage_tmp }, 'man', '-l', '--recode', 'UTF-8', $manpage_cmd); + # recode uncompresses compressed pages + my $orig = $manpage; + rm_files($orig) if $manpage =~ s/\.(gz|Z)$//; + rename_path($manpage_tmp, $manpage); + } + # Bulk reset permissions of all re-encoded files + xargs(\@_, 'chmod', '0644', '--'); + }); + } +} else { + # Should only occur during debhelper building itself (to avoid a B-D on man-db). + warning("man is not available. Skipping re-encode of UTF-8 manpages") } # Check if a file is a .so man page, for use by File::Find. sub find_so_man { # The -s test is because a .so file tends to be small. We don't want # to open every man page. 1024 is arbitrary. - if (! -f $_ || -s $_ > 1024 || -s == 0) { + if (! -f $_ || -s _ > 1024 || -s _ == 0) { return; } # Test first line of file for the .so thing. + my $fd; if (/\.gz$/) { - open (SOTEST, "zcat $_|") or die "$_: $!"; + $fd = open_gz($_) or die "$_: $!"; } else { - open (SOTEST,$_) || die "$_: $!"; + open($fd, '<', $_) || die "$_: $!"; } - my $l=; - close SOTEST; + my $l = <$fd>; + close($fd); if (! defined $l) { error("failed to read $_"); } - + if ($l=~m/\.so\s+(.*)\s*/) { my $solink=$1; # This test is here to prevent links like ... man8/../man8/foo.8 @@ -254,7 +347,7 @@ elsif ($solink =~ m!/!) { $solink="../$solink"; } - + if (-e $solink || -e "$solink.gz") { push @sofiles,"$File::Find::dir/$_"; push @sodests,$solink; @@ -273,9 +366,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installmanpages debhelper-11ubuntu1~16.04.york0/dh_installmanpages --- debhelper-9.20160115ubuntu3/dh_installmanpages 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installmanpages 2017-11-28 12:40:27.000000000 +0000 @@ -11,6 +11,8 @@ use File::Find; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [S ...>] @@ -110,9 +112,9 @@ } # Test first line of file for the .so thing. - open (SOTEST,$_); - my $l=; - close SOTEST; + open(my $fd, '<', $_); + my $l = <$fd>; + close($fd); if ($l=~m/\.so\s+(.*)/) { my $solink=$1; # This test is here to prevent links like ... man8/../man8/foo.8 @@ -158,13 +160,13 @@ if ($install) { my $extdir="share"; - my ($section)=$basename=~m/.*\.([1-9])/; + my ($section)=$basename=~m/\.([1-9])/; my $destdir="$tmp/usr/$extdir/man/man$section/"; # Handle translated man pages. my $instname=$basename; - my ($langcode)=$basename=~m/.*\.([a-z][a-z])\.([1-9])/; + my ($langcode)=$basename=~m/\.([a-z][a-z])\.([1-9])/; if (defined $langcode && $langcode ne '') { $destdir="$tmp/usr/$extdir/man/$langcode/man$section/"; $instname=~s/\.$langcode\./\./; @@ -173,9 +175,7 @@ $destdir=~tr:/:/:s; # just for looks if (! -e "$destdir/$basename" && !-l "$destdir/$basename") { - if (! -d $destdir) { - install_dir($destdir); - } + install_dir($destdir); install_file($page,$destdir.$instname); } } @@ -206,9 +206,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installmenu debhelper-11ubuntu1~16.04.york0/dh_installmenu --- debhelper-9.20160115ubuntu3/dh_installmenu 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installmenu 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-n>] @@ -43,7 +45,7 @@ =over 4 -=item B<-n>, B<--noscripts> +=item B<-n>, B<--no-scripts> Do not modify F/F scripts. @@ -61,9 +63,7 @@ my $menu_method=pkgfile($package,"menu-method"); if ($menu ne '') { - if (! -d "$tmp/usr/share/menu") { - install_dir("$tmp/usr/share/menu"); - } + install_dir("$tmp/usr/share/menu"); install_file($menu,"$tmp/usr/share/menu/$package"); # Add the scripts if a menu-method file doesn't exist. @@ -75,14 +75,12 @@ } if ($menu_method ne '') { - if (!-d "$tmp/etc/menu-methods") { - install_dir("$tmp/etc/menu-methods"); - } + install_dir("$tmp/etc/menu-methods"); install_file($menu_method,"$tmp/etc/menu-methods/$package"); if (! $dh{NOSCRIPTS}) { - autoscript($package,"postinst","postinst-menu-method","s/#PACKAGE#/$package/g"); - autoscript($package,"postrm","postrm-menu-method","s/#PACKAGE#/$package/g"); + autoscript($package, 'postinst', 'postinst-menu-method', { 'PACKAGE' => $package }); + autoscript($package, 'postrm', 'postrm-menu-method', { 'PACKAGE' => $package }); } } } @@ -100,9 +98,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installmime debhelper-11ubuntu1~16.04.york0/dh_installmime --- debhelper-9.20160115ubuntu3/dh_installmime 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installmime 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] @@ -46,17 +48,13 @@ my $mime=pkgfile($package,"mime"); if ($mime ne '') { - if (! -d "$tmp/usr/lib/mime/packages") { - install_dir("$tmp/usr/lib/mime/packages"); - } + install_dir("$tmp/usr/lib/mime/packages"); install_file($mime, "$tmp/usr/lib/mime/packages/$package"); } my $sharedmimeinfo=pkgfile($package,"sharedmimeinfo"); if ($sharedmimeinfo ne '') { - if (! -d "$tmp/usr/share/mime/packages") { - install_dir("$tmp/usr/share/mime/packages"); - } + install_dir("$tmp/usr/share/mime/packages"); install_file($sharedmimeinfo, "$tmp/usr/share/mime/packages/$package.xml"); } @@ -73,9 +71,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installmodules debhelper-11ubuntu1~16.04.york0/dh_installmodules --- debhelper-9.20160115ubuntu3/dh_installmodules 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installmodules 2017-11-28 12:40:27.000000000 +0000 @@ -11,6 +11,8 @@ use Debian::Debhelper::Dh_Lib; use File::Find; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-n>] [B<--name=>I] @@ -40,7 +42,7 @@ =over 4 -=item B<-n>, B<--noscripts> +=item B<-n>, B<--no-scripts> Do not modify F/F/F scripts. @@ -81,7 +83,7 @@ } }, $searchdir); - return keys %versions; + return sort(keys(%versions)); } # PROMISE: DH NOOP WITHOUT modprobe tmp(lib/modules) @@ -90,25 +92,16 @@ my $tmp=tmpdir($package); my $modprobe_file=pkgfile($package,"modprobe"); - if (! -e $tmp) { - install_dir($tmp); - } - if ($modprobe_file) { - if (! -e "$tmp/etc/modprobe.d") { - install_dir("$tmp/etc/modprobe.d"); - } - my $old="/etc/modprobe.d/".pkgfilename($package); - my $new=$old.".conf"; - install_file($modprobe_file, "$tmp/$new"); - autoscript($package,"preinst","preinst-moveconffile","s!#OLD#!$old!g;s!#PACKAGE#!$package!g"); - autoscript($package,"postinst","postinst-moveconffile","s!#OLD#!$old!g;s!#NEW#!$new!g"); + my $path = '/etc/modprobe.d/' . pkgfilename($package) . '.conf'; + install_dir("$tmp/etc/modprobe.d"); + install_file($modprobe_file, "$tmp/$path"); } if (! $dh{NOSCRIPTS}) { foreach my $kvers (find_kernel_modules("$tmp/lib/modules")) { - autoscript($package,"postinst","postinst-modules","s/#KVERS#/$kvers/g"); - autoscript($package,"postrm","postrm-modules","s/#KVERS#/$kvers/g"); + autoscript($package, 'postinst', 'postinst-modules', { 'KVERS' => $kvers }); + autoscript($package, 'postrm', 'postrm-modules', { 'KVERS' => $kvers }); } } } @@ -124,9 +117,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installpam debhelper-11ubuntu1~16.04.york0/dh_installpam --- debhelper-9.20160115ubuntu3/dh_installpam 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installpam 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<--name=>I] @@ -52,9 +54,7 @@ my $pam=pkgfile($package,"pam"); if ($pam ne '') { - if (! -d "$tmp/etc/pam.d") { - install_dir("$tmp/etc/pam.d"); - } + install_dir("$tmp/etc/pam.d"); install_file($pam,"$tmp/etc/pam.d/".pkgfilename($package)); } } @@ -70,9 +70,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installppp debhelper-11ubuntu1~16.04.york0/dh_installppp --- debhelper-9.20160115ubuntu3/dh_installppp 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installppp 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<--name=>I] @@ -57,9 +59,7 @@ foreach my $script (qw(up down)) { my $file=pkgfile($package, "ppp.ip-$script"); if ($file ne '') { - if (! -d "$tmp/etc/ppp/ip-$script.d") { - install_dir("$tmp/etc/ppp/ip-$script.d"); - } + install_dir("$tmp/etc/ppp/ip-$script.d"); install_prog($file,"$tmp/etc/ppp/ip-$script.d/".pkgfilename($package)); } } @@ -76,9 +76,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installsystemd debhelper-11ubuntu1~16.04.york0/dh_installsystemd --- debhelper-9.20160115ubuntu3/dh_installsystemd 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installsystemd 2017-12-16 15:37:57.000000000 +0000 @@ -0,0 +1,409 @@ +#!/usr/bin/perl -w + +=head1 NAME + +dh_installsystemd - install systemd unit files + +=cut + +use strict; +use warnings; +use Debian::Debhelper::Dh_Lib; +use File::Find; +use Cwd qw(getcwd abs_path); + +our $VERSION = DH_BUILTIN_VERSION; + +=head1 SYNOPSIS + +B [S>] [B<--restart-after-upgrade>] [B<--no-stop-on-upgrade>] [B<--no-enable>] [B<--name=>I] [S ...>] + +=head1 DESCRIPTION + +B is a debhelper program that is responsible for enabling, +disabling, starting, stopping and restarting systemd unit files. + +In the simple case, it finds all unit files installed by a package (e.g. +bacula-fd.service) and enables them. It is not necessary that the machine +actually runs systemd during package installation time, enabling happens on all +machines in order to be able to switch from sysvinit to systemd and back. + +For only generating blocks for specific service files, you need to pass them as +arguments, e.g. B and B. + +=head1 FILES + +=over 4 + +=item debian/I.service, debian/I@.service + +If this exists, it is installed into lib/systemd/system/I.service (or +lib/systemd/system/I@.service) in the package build directory. + +=item debian/I.tmpfile + +If this exists, it is installed into usr/lib/tmpfiles.d/I.conf in the +package build directory. (The tmpfiles.d mechanism is currently only used +by systemd.) + +=item debian/I.target, debian/I@.target + +If this exists, it is installed into lib/systemd/system/I.target (or +lib/systemd/system/I@.target) in the package build directory. + +=item debian/I.socket, debian/I@.socket + +If this exists, it is installed into lib/systemd/system/I.socket (or +lib/systemd/system/I@.socket) in the package build directory. + +=item debian/I.mount + +If this exists, it is installed into lib/systemd/system/I.mount +in the package build directory. + +=item debian/I.path, debian/I@.path + +If this exists, it is installed into lib/systemd/system/I.path (or +lib/systemd/system/I@.path) in the package build directory. + +=item debian/I.timer, debian/I@.timer + +If this exists, it is installed into lib/systemd/system/I.timer (or +lib/systemd/system/I@.timer) in the package build directory. + +=back + +=head1 OPTIONS + +=over 4 + +=item B<--no-enable> + +Disable the service(s) on purge, but do not enable them on install. + +B that this option does not affect whether the services are +started. Please remember to also use B<--no-start> if the service +should not be started. + +=item B<--name=>I + +Install the service file as I instead of the default filename, +which is the I. When this parameter is used, +B looks for and installs files named +F instead of the usual F. +Moreover, maintainer scripts are only generated for units that match the given +I. + +=item B<--restart-after-upgrade> + +Do not stop the unit file until after the package upgrade has been completed. +This is the default behaviour in compat 10. + +In earlier compat levels the default was to stop the unit file in the +F, and start it again in the F. + +This can be useful for daemons that should not have a possibly long +downtime during upgrade. But you should make sure that the daemon will not +get confused by the package being upgraded while it's running before using +this option. + +=item B<--no-restart-after-upgrade> + +Undo a previous B<--restart-after-upgrade> (or the default of compat +10). If no other options are given, this will cause the service to be +stopped in the F script and started again in the F +script. + +=item B<-r>, B<--no-stop-on-upgrade>, B<--no-restart-on-upgrade> + +Do not stop service on upgrade. + +=item B<--no-start> + +Do not start the unit file after upgrades and after initial installation (the +latter is only relevant for services without a corresponding init script). + +B that this option does not affect whether the services are +enabled. Please remember to also use B<--no-enable> if the services +should not be enabled. + +=back + +=head1 NOTES + +Note that this command is not idempotent. L should be called +between invocations of this command (with the same arguments). Otherwise, it +may cause multiple instances of the same text to be added to maintainer +scripts. + +=cut + +$dh{RESTART_AFTER_UPGRADE} = 1; + +init(options => { + "no-enable" => \$dh{NO_ENABLE}, + "r" => \$dh{R_FLAG}, + 'no-stop-on-upgrade' => \$dh{R_FLAG}, + "no-restart-on-upgrade" => \$dh{R_FLAG}, + "no-start" => \$dh{NO_START}, + "R|restart-after-upgrade!" => \$dh{RESTART_AFTER_UPGRADE}, + "no-also" => \$dh{NO_ALSO}, +}); + +sub contains_install_section { + my ($unit_path) = @_; + + open(my $fh, '<', $unit_path) or error("Cannot open($unit_path) to check for [Install]: $!"); + + while (my $line = <$fh>) { + chomp($line); + return 1 if $line =~ /^\s*\[Install\]$/i; + } + close($fh); + return 0; +} + +sub install_unit { + my ($package, $script, $pkgsuffix, $path, $installsuffix) = @_; + $installsuffix = $installsuffix || $pkgsuffix; + my $unit = pkgfile($package, $pkgsuffix); + return if $unit eq ''; + install_dir($path); + install_file($unit, "${path}/${script}.${installsuffix}"); +} + +# Extracts the Also= or Alias= line(s) from a unit file. +# In case this produces horribly wrong results, you can pass --no-also, but +# that should really not be necessary. Please report bugs to +# pkg-systemd-maintainers. +sub extract_key { + my ($unit_path, $key) = @_; + my @values; + + return @values if $dh{NO_ALSO}; + + open(my $fh, '<', $unit_path) or error("Cannot open($unit_path) for extracting the Also= line(s): $!"); + + while (my $line = <$fh>) { + chomp($line); + + # The keys parsed from the unit file below can only have + # unit names as values. Since unit names can't have + # whitespace in systemd, simply use split and strip any + # leading/trailing quotes. See systemd-escape(1) for + # examples of valid unit names. + if ($line =~ /^\s*$key=(.+)$/i) { + for my $value (split(/\s+/, $1)) { + $value =~ s/^(["'])(.*)\g1$/$2/; + push @values, $value; + } + } + } + close($fh); + return @values; +} + + +# PROMISE: DH NOOP WITHOUT tmp(lib/systemd/system) mount path service socket target tmpfile timer + +my %requested_files = map { basename($_) => 1 } @ARGV; +my %installed_files; + +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmpdir = tmpdir($package); + my (@installed_units, @start_units, @enable_units, %aliases, @tmpfiles); + + # Figure out what filename to install it as. + my $script; + if (defined $dh{NAME}) { + $script=$dh{NAME}; + } + else { + $script=$package; + } + + for my $service_type (qw(service target socket path timer)) { + install_unit($package, $script, $service_type, "$tmpdir/lib/systemd/system"); + install_unit("${package}@", "${script}@", $service_type, "$tmpdir/lib/systemd/system"); + } + + install_unit($package, $script, 'mount', "$tmpdir/lib/systemd/system"); + install_unit($package, $script, 'tmpfile', "$tmpdir/usr/lib/tmpfiles.d", 'conf'); + + my $oldcwd = getcwd(); + find({ + wanted => sub { + my $name = $File::Find::name; + return unless -f $name; + return unless $name =~ m,^\Q${tmpdir}\E/lib/systemd/system/[^/]+$,; + if (-l) { + my $target = abs_path(readlink()); + $target =~ s,^\Q${oldcwd}\E/,,g; + $aliases{$target} = [ $_ ]; + } else { + push @installed_units, $name; + } + }, + no_chdir => 1, + }, "${tmpdir}/lib/systemd/system") if -d "${tmpdir}/lib/systemd/system"; + + # Handle either only the unit files which were passed as arguments or + # all unit files that are installed in this package. + my @args; + if (@ARGV > 0) { + @args = @ARGV; + } + elsif ($dh{NAME}) { + # treat --name flag as if the corresponding units were passed in the command line + @args = grep /(^|\/)$dh{NAME}\.(mount|path|service|socket|target|tmpfile)$/, @installed_units; + } + else { + @args = @installed_units; + } + + # support excluding units via -X + foreach my $x (@{$dh{EXCLUDE}}) { + @args = grep !/(^|\/)$x$/, @args; + } + + # This hash prevents us from looping forever in the following while loop. + # An actual real-world example of such a loop is systemd’s + # systemd-readahead-drop.service, which contains + # Also=systemd-readahead-collect.service, and that file in turn + # contains Also=systemd-readahead-drop.service, thus forming an endless + # loop. + my %seen; + # We use while/shift because we push to the list in the body. + while (@args) { + my $name = shift @args; + my $base = basename($name); + + # Try to make the path absolute, so that the user can call + # dh_installsystemd bacula-fd.service + if ($base eq $name) { + # NB: This works because @installed_units contains + # files from precisely one directory. + my ($full) = grep { basename($_) eq $base } @installed_units; + if (defined($full)) { + $name = $full; + } else { + warning(qq|Could not find "$name" in the /lib/systemd/system directory of $package. | . + qq|This could be a typo, or using Also= with a service file from another package. | . + qq|Please check carefully that this message is harmless.|); + } + } + + $installed_files{$base} = 1 if exists($requested_files{$base}); + + # Skip template service files like e.g. getty@.service. + # Enabling, disabling, starting or stopping those services + # without specifying the instance (e.g. getty@ttyS0.service) is + # not useful. + if ($name =~ /\@/) { + next; + } + + # Handle all unit files specified via Also= explicitly. + # This is not necessary for enabling, but for disabling, as we + # cannot read the unit file when disabling (it was already + # deleted). + my @also = grep { !exists($seen{$_}) } extract_key($name, 'Also'); + $seen{$_} = 1 for @also; + @args = (@args, @also); + + push @{$aliases{$name}}, $_ for extract_key($name, 'Alias'); + my @sysv = grep { + my $base = $_; + $base =~ s/\.(?:mount|service|socket|target|path)$//g; + -f "$tmpdir/etc/init.d/$base" + } ($base, @{$aliases{$name}}); + if (@sysv == 0 && !grep { $_ eq $name } @start_units) { + push @start_units, $name; + } + + if (contains_install_section($name) && !grep { $_ eq $name } @enable_units) { + push @enable_units, $name; + } + } + + # Include postinst-init-tmpfiles if the package ships any files + # in /usr/lib/tmpfiles.d or /etc/tmpfiles.d + if (-d $tmpdir) { + my @dirs = grep { -d } map { "${tmpdir}/$_" } qw(usr/lib/tmpfiles.d etc/tmpfiles.d); + find({ + wanted => sub { + my $name = $File::Find::name; + return unless -f $name; + $name =~ s/^\Q$tmpdir\E//g; + push(@tmpfiles, $name); + }, + no_chdir => 1, + }, @dirs) if @dirs; + if (@tmpfiles > 0) { + autoscript($package, 'postinst', 'postinst-init-tmpfiles', { 'TMPFILES' => join(' ', sort @tmpfiles) }); + } + } + + if (@enable_units) { + for my $unit (sort @enable_units) { + my $base = q{'} . basename($unit) . q{'}; + if ($dh{NO_ENABLE}) { + autoscript($package, 'postinst', 'postinst-systemd-dont-enable', { 'UNITFILE' => $base }); + } else { + autoscript($package, 'postinst', 'postinst-systemd-enable', { 'UNITFILE' => $base }); + } + } + my $enableunitargs = join(' ', sort map { q{'} . basename($_) . q{'} } @enable_units); + autoscript($package, 'postrm', 'postrm-systemd', {'UNITFILES' => $enableunitargs }); + } + + if (@start_units) { + # The $package and $sed parameters are always the same. + # This wrapper function makes the following logic easier to read. + my $startunitargs = join(' ', sort map { q{'} . basename($_) . q{'} } @start_units); + my $start_autoscript = sub { + my ($script, $filename) = @_; + autoscript($package, $script, $filename, { 'UNITFILES' => $startunitargs }); + }; + + if ($dh{RESTART_AFTER_UPGRADE}) { + my $snippet = "postinst-systemd-restart" . ($dh{NO_START} ? "nostart" : ""); + $start_autoscript->("postinst", $snippet); + } elsif (!$dh{NO_START}) { + # We need to stop/start before/after the upgrade. + $start_autoscript->("postinst", "postinst-systemd-start"); + } + + $start_autoscript->("postrm", "postrm-systemd-reload-only"); + + if ($dh{R_FLAG} || $dh{RESTART_AFTER_UPGRADE}) { + # stop service only on remove + $start_autoscript->("prerm", "prerm-systemd-restart"); + } elsif (!$dh{NO_START}) { + # always stop service + $start_autoscript->("prerm", "prerm-systemd"); + } + } +} + +if (%requested_files) { + my $any_missing = 0; + for my $name (sort(keys(%requested_files))) { + if (not exists($installed_files{$name})) { + warning(qq{Requested unit "$name" but it was not found in any package acted on.}); + $any_missing = 1; + } + } + error("Could not handle all of the requested services") if $any_missing; +} + +=head1 SEE ALSO + +L + +=head1 AUTHORS + +pkg-systemd-maintainers@lists.alioth.debian.org + +=cut diff -Nru debhelper-9.20160115ubuntu3/dh_installudev debhelper-11ubuntu1~16.04.york0/dh_installudev --- debhelper-9.20160115ubuntu3/dh_installudev 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installudev 2017-11-28 12:40:27.000000000 +0000 @@ -9,7 +9,8 @@ use strict; use warnings; use Debian::Debhelper::Dh_Lib; -use File::Find; + +our $VERSION = DH_BUILTIN_VERSION; =head1 SYNOPSIS @@ -20,9 +21,6 @@ B is a debhelper program that is responsible for installing B rules files. -Code is added to the F and F to handle the upgrade from the -old B rules file location. - =head1 FILES =over 4 @@ -47,10 +45,6 @@ Sets the priority the file. Default is 60. -=item B<-n>, B<--noscripts> - -Do not modify F/F scripts. - =back =head1 NOTES @@ -92,26 +86,14 @@ $filename = "$package.udev"; } $filename=~s/\.udev$/.rules/; - my $oldfilename=$filename; if (defined $dh{NAME}) { $filename="$dh{NAME}.rules"; } if ($rules_file) { - if (! -e "$tmp/lib/udev/rules.d") { - install_dir("$tmp/lib/udev/rules.d"); - } my $rule="/lib/udev/rules.d/$dh{PRIORITY}$filename"; + install_dir("$tmp/lib/udev/rules.d"); install_file($rules_file, "${tmp}${rule}"); - if (! $dh{NOSCRIPTS}) { - # Remove old rule from /etc, unless it's modified, - # in which case we rename it to match the new - # file in /lib, so it will override. - my $old="/etc/udev/rules.d/$old_priority$oldfilename"; - $rule=~s/^\/lib/\/etc/; - autoscript($package,"preinst","preinst-moveconffile","s!#OLD#!$old!g;s!#NEW#!$rule!g;s!#PACKAGE#!$package!g"); - autoscript($package,"postinst","postinst-moveconffile","s!#OLD#!$old!g;s!#NEW#!$rule!g"); - } } } @@ -126,9 +108,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installwm debhelper-11ubuntu1~16.04.york0/dh_installwm --- debhelper-9.20160115ubuntu3/dh_installwm 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installwm 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-n>] [B<--priority=>I] [S ...>] @@ -19,8 +21,9 @@ B is a debhelper program that is responsible for generating the F and F commands that register a window manager with L. The window manager's man page is also -registered as a slave symlink (in v6 mode and up), if it is found in -F in the package build directory. +registered as a slave symlink (in v6 mode and up). It must be installed in +F in the package build directory prior to calling +B. In compat 9 and earlier, the manpage was optional. =head1 FILES @@ -42,7 +45,7 @@ most window managers; see the Debian Policy document for instructions on calculating the correct value. -=item B<-n>, B<--noscripts> +=item B<-n>, B<--no-scripts> Do not modify F/F scripts. Turns this command into a no-op. @@ -74,6 +77,8 @@ } } +my $nodocs = is_build_profile_active('nodoc') || get_buildoption('nodoc') ? 1 : 0; + # PROMISE: DH NOOP WITHOUT wm foreach my $package (@{$dh{DOPACKAGES}}) { @@ -91,23 +96,25 @@ if (! $dh{NOSCRIPTS}) { WM: foreach my $wm (@wm) { - autoscript($package,"prerm","prerm-wm","s:#WM#:$wm:g"); + autoscript($package,"prerm","prerm-wm", { 'WM' => $wm }); my $wmman; if (! compat(5)) { foreach my $ext (".1", ".1x") { $wmman="/usr/share/man/man1/".basename($wm).$ext; if (-e "$tmp$wmman" || -e "$tmp$wmman.gz") { - autoscript($package,"postinst","postinst-wm","s:#WM#:$wm:g;s:#WMMAN#:$wmman.gz:g;s/#PRIORITY#/$dh{PRIORITY}/g",); + autoscript($package,"postinst","postinst-wm", { 'WM' => $wm, 'WMMAN' => "${wmman}.gz" , 'PRIORITY' => $dh{PRIORITY} }); next WM; } } } - if (! compat(9)) { + if (not compat(9) and not $nodocs) { error("no manpage found (creating an x-window-manager alternative requires a slave symlink for the manpage)"); + } else { + warning("no manpage found (creating an x-window-manager alternative requires a slave symlink for the manpage)"); } # Reaching this code means a broken package will be produced. - autoscript($package,"postinst","postinst-wm-noman","s:#WM#:$wm:g;s/#PRIORITY#/$dh{PRIORITY}/g",); + autoscript($package,"postinst","postinst-wm-noman", { 'WM' => $wm, 'PRIORITY' => $dh{PRIORITY} }); } } } @@ -123,9 +130,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_installxfonts debhelper-11ubuntu1~16.04.york0/dh_installxfonts --- debhelper-9.20160115ubuntu3/dh_installxfonts 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_installxfonts 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] @@ -79,9 +81,9 @@ } autoscript($package, "postinst", "postinst-xfonts", - "s:#CMDS#:".join(";", @cmds, @cmds_postinst).":g"); + { 'CMDS' => join(";", @cmds, @cmds_postinst) }); autoscript($package, "postrm", "postrm-xfonts", - "s:#CMDS#:".join(";", @cmds, @cmds_postrm).":g"); + { 'CMDS' => join(";", @cmds, @cmds_postrm) }); addsubstvar($package, "misc:Depends", "xfonts-utils"); } @@ -98,9 +100,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_link debhelper-11ubuntu1~16.04.york0/dh_link --- debhelper-9.20160115ubuntu3/dh_link 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_link 2017-11-28 12:40:27.000000000 +0000 @@ -11,6 +11,8 @@ use File::Find; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-A>] [B<-X>I] [S ...>] @@ -20,14 +22,16 @@ B is a debhelper program that creates symlinks in package build directories. -B accepts a list of pairs of source and destination files. The source -files are the already existing files that will be symlinked from. The -destination files are the symlinks that will be created. There B be -an equal number of source and destination files specified. - -Be sure you B specify the full filename to both the source and -destination files (unlike you would do if you were using something like -L). +B accepts a list of pairs of source and destination +files. The source files are the already existing files that will be +symlinked from (called B by L). The destination files +are the symlinks that will be created (called B by +L). There B be an equal number of source and destination +files specified. + +Be sure you B specify the absolute path to both the source and +destination files (unlike you would do if you were using something +like L). Please note that the leading slash is optional. B will generate symlinks that comply with Debian policy - absolute when policy says they should be absolute, and relative links with as short @@ -49,6 +53,14 @@ should be put on its own line, with the source and destination separated by whitespace. +In each pair the source file (called B by L) comes +first and is followed by the destination file (called B by +L). Thus the pairs of source and destination files in each line +are give in the same order as they would be given to L. + +In contrast to L, source and destination paths must be absolute +(the leading slash is optional). + =back =head1 OPTIONS @@ -85,6 +97,11 @@ Make F be a link to F, and F be a symlink to the F + var/lib/foo usr/lib/foo + usr/share/man/man1/foo.1 usr/share/man/man1/bar.1 + +Same as above but as content for a debian/I.links file. + =cut init(); @@ -154,9 +171,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_lintian debhelper-11ubuntu1~16.04.york0/dh_lintian --- debhelper-9.20160115ubuntu3/dh_lintian 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_lintian 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] @@ -50,9 +52,7 @@ my $overrides=pkgfile($package,"lintian-overrides"); if ($overrides ne '') { - if (! -d $or_dir) { - install_dir($or_dir); - } + install_dir($or_dir); install_dh_config_file($overrides, "$or_dir/$package"); } } @@ -70,9 +70,3 @@ Steve Robbins =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_listpackages debhelper-11ubuntu1~16.04.york0/dh_listpackages --- debhelper-9.20160115ubuntu3/dh_listpackages 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_listpackages 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] @@ -39,9 +41,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_makeshlibs debhelper-11ubuntu1~16.04.york0/dh_makeshlibs --- debhelper-9.20160115ubuntu3/dh_makeshlibs 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_makeshlibs 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-m>I] [B<-V>I<[dependencies]>] [B<-n>] [B<-X>I] [S I>] @@ -19,8 +21,10 @@ B is a debhelper program that automatically scans for shared libraries, and generates a shlibs file for the libraries it finds. -It also adds a call to ldconfig in the F and F scripts (in -v3 mode and above only) to any packages in which it finds shared libraries. +It will also ensure that ldconfig is invoked during install and removal when +it finds shared libraries. Since debhelper 9.20151004, this is done via a +dpkg trigger. In older versions of debhelper, B would +generate a maintainer script for this purpose. =head1 FILES @@ -79,10 +83,10 @@ might end up with dependencies that are too tight and so find it harder to be upgraded. -=item B<-n>, B<--noscripts> +=item B<-n>, B<--no-scripts> Do not add the "ldconfig" trigger even if it seems like the package -might need it. The option is called B<--noscripts> for historical +might need it. The option is called B<--no-scripts> for historical reasons as B would previously generate maintainer scripts that called B. @@ -134,8 +138,6 @@ "add-udeb=s" => \$dh{SHLIBS_UDEB}, }); -my $objdump=cross_command("objdump"); - my $ok=1; foreach my $package (@{$dh{DOPACKAGES}}) { @@ -143,11 +145,13 @@ my $tmp=tmpdir($package); - my %seen; + my $objdump = cross_command($package, "objdump"); + + my (%seen, $unversioned_so); my $need_ldconfig = 0; my $shlibs_file = pkgfile($package, 'shlibs'); - doit("rm", "-f", "$tmp/DEBIAN/shlibs"); + rm_files("$tmp/DEBIAN/shlibs"); # So, we look for files or links to existing files with names that # match "*.so.*". And we only look at real files not @@ -160,29 +164,31 @@ if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { $exclude="! \\( $dh{EXCLUDE_FIND} \\) "; } - open (FIND, "find $tmp -type f \\( -name '*.so' -or -name '*.so.*' \\) $exclude | LC_ALL=C sort |"); + open (FIND, "test -d $tmp && find $tmp -type f \\( -name '*.so' -or -name '*.so.*' \\) $exclude | LC_ALL=C sort |"); while () { my ($library, $major); + chomp; + next if not is_so_or_exec_elf_file($_); push @lib_files, $_; - my $ret=`$objdump -p $_`; - if ($ret=~m/\s+SONAME\s+(.+)\.so\.(.+)/) { + my $ret = compat(10) ? `$objdump -p "$_"` : qx_cmd($objdump, '-p', $_); + if ($ret=~m/\s+SONAME\s+(.*)\.so\.(.*)/) { # proper soname format $library=$1; $major=$2; } - elsif ($ret=~m/\s+SONAME\s+(.+)-(.+)\.so/) { + elsif ($ret=~m/\s+SONAME\s+(.*)-(\d.*)\.so/) { # idiotic crap soname format $library=$1; $major=$2; + } elsif ($ret =~ m/\s+SONAME\s+(?:.*)\.so/) { + $unversioned_so = 1; } if (defined($dh{M_PARAMS}) && $dh{M_PARAMS} ne '') { $major=$dh{M_PARAMS}; } - if (! -d "$tmp/DEBIAN") { - install_dir("$tmp/DEBIAN"); - } + install_dir("$tmp/DEBIAN"); my $deps=$package; if ($dh{V_FLAG_SET}) { if ($shlibs_file) { @@ -208,10 +214,10 @@ } } if (defined($library) && defined($major) && defined($deps) && - $library ne '' && $major ne '' && $deps ne '') { - $need_ldconfig=1; - # Prevent duplicate lines from entering the file. - my $line="$library $major $deps"; + $library ne '' && $major ne '' && $deps ne '') { + $need_ldconfig=1; + # Prevent duplicate lines from entering the file. + my $line="$library $major $deps"; if (! $seen{$line}) { $seen{$line}=1; complex_doit("echo '$line' >>$tmp/DEBIAN/shlibs"); @@ -231,22 +237,13 @@ complex_doit("echo '$_' >>$tmp/DEBIAN/shlibs"); } - # Historically, --noscripts would disable the creation of - # maintscripts for calling ldconfig. - if (! $dh{NOSCRIPTS} && $need_ldconfig) { - autotrigger($package, 'activate-noawait', 'ldconfig'); - } - if ($shlibs_file) { - if (! -d "$tmp/DEBIAN") { - install_dir("$tmp/DEBIAN"); - } + install_dir("$tmp/DEBIAN"); install_file($shlibs_file, "$tmp/DEBIAN/shlibs"); } if (-e "$tmp/DEBIAN/shlibs") { - doit("chmod","0644","$tmp/DEBIAN/shlibs"); - doit("chown","0:0","$tmp/DEBIAN/shlibs"); + reset_perm_and_owner(0644, "$tmp/DEBIAN/shlibs"); } # dpkg-gensymbols files @@ -270,9 +267,21 @@ ) && $ok; if (-f "$tmp/DEBIAN/symbols" and -s _ == 0) { - doit("rm", "-f", "$tmp/DEBIAN/symbols"); + rm_files("$tmp/DEBIAN/symbols"); + } elsif ($unversioned_so) { + # There are a few "special" libraries (e.g. nss/nspr) + # which do not have versioned SONAMES. However the + # maintainer provides a symbols file for them and we can + # then use that to add an ldconfig trigger. + $need_ldconfig = 1; } } + + # Historically, --no-scripts would disable the creation of + # maintscripts for calling ldconfig. + if (! $dh{NOSCRIPTS} && $need_ldconfig) { + autotrigger($package, 'activate-noawait', 'ldconfig'); + } } unless ($ok) { @@ -290,9 +299,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_md5sums debhelper-11ubuntu1~16.04.york0/dh_md5sums --- debhelper-9.20160115ubuntu3/dh_md5sums 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_md5sums 2017-11-28 12:40:27.000000000 +0000 @@ -11,6 +11,8 @@ use Cwd; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-x>] [B<-X>I] [B<--include-conffiles>] @@ -19,7 +21,7 @@ B is a debhelper program that is responsible for generating a F file, which lists the md5sums of each file in the package. -These files are used by the B package. +These files are used by B or the L program. All files in F are omitted from the F file, as are all conffiles (unless you use the B<--include-conffiles> switch). @@ -49,61 +51,60 @@ "include-conffiles" => \$dh{INCLUDE_CONFFILES}, }); -foreach my $package (@{$dh{DOPACKAGES}}) { - next if is_udeb($package); +on_pkgs_in_parallel { + foreach my $package (@_) { + next if is_udeb($package); - my $dbgsym_tmp = "debian/.debhelper/${package}/dbgsym-root"; - my $tmp=tmpdir($package); + my $dbgsym_tmp = dbgsym_tmpdir($package); + my $tmp=tmpdir($package); - if (! -d "$tmp/DEBIAN") { install_dir("$tmp/DEBIAN"); - } - # Check if we should exclude conffiles. - my $exclude=""; - if (! $dh{INCLUDE_CONFFILES} && -r "$tmp/DEBIAN/conffiles") { - # Generate exclude regexp. - open (CONFF,"$tmp/DEBIAN/conffiles"); - while () { - chomp; - s/^\///; - $exclude.="! -path \"./$_\" "; + # Check if we should exclude conffiles. + my $exclude=""; + if (! $dh{INCLUDE_CONFFILES} && -r "$tmp/DEBIAN/conffiles") { + # Generate exclude regexp. + open(my $fd, '<', "$tmp/DEBIAN/conffiles") + or die("open $tmp/DEBIAN/conffiles failed: $!"); + while (<$fd>) { + chomp; + s/^\///; + $exclude.="! -path \"./$_\" "; + } + close($fd); } - close CONFF; - } - - # See if we should exclude other files. - if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { - $exclude.="! \\( $dh{EXCLUDE_FIND} \\) "; - } - - my $find="find . -type f $exclude ! -regex './DEBIAN/.*' -printf '%P\\0'"; - complex_doit("(cd $tmp >/dev/null ; $find | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums) >/dev/null"); - # If the file's empty, no reason to waste inodes on it. - if (-z "$tmp/DEBIAN/md5sums") { - doit("rm","-f","$tmp/DEBIAN/md5sums"); - } - else { - doit("chmod", "0644", "$tmp/DEBIAN/md5sums"); - doit("chown", "0:0", "$tmp/DEBIAN/md5sums"); - } - if ( -d $dbgsym_tmp) { - if (! -d "${dbgsym_tmp}/DEBIAN") { - install_dir("${dbgsym_tmp}/DEBIAN"); + + # See if we should exclude other files. + if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { + $exclude.="! \\( $dh{EXCLUDE_FIND} \\) "; } - $find = "find . -type f ! -regex './DEBIAN/.*' -printf '%P\\0'"; - complex_doit("(cd $dbgsym_tmp >/dev/null ; $find | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums) >/dev/null"); + my $find="find . -type f $exclude ! -regex './DEBIAN/.*' -printf '%P\\0'"; + complex_doit("(cd $tmp >/dev/null ; $find | LC_ALL=C sort -z | xargs -r0 md5sum | " . + q{perl -pe 'if (s@^\\\\@@) { s/\\\\\\\\/\\\\/g; }' > DEBIAN/md5sums) >/dev/null}); # If the file's empty, no reason to waste inodes on it. - if (-z "${dbgsym_tmp}/DEBIAN/md5sums") { - doit('rm', '-f', "${dbgsym_tmp}/DEBIAN/md5sums"); + if (-z "$tmp/DEBIAN/md5sums") { + rm_files("$tmp/DEBIAN/md5sums"); } else { - doit('chmod', '0644', "${dbgsym_tmp}/DEBIAN/md5sums"); - doit('chown', '0:0', "${dbgsym_tmp}/DEBIAN/md5sums"); + reset_perm_and_owner(0644, "$tmp/DEBIAN/md5sums"); + } + if ( -d $dbgsym_tmp) { + install_dir("${dbgsym_tmp}/DEBIAN"); + + $find = "find . -type f ! -regex './DEBIAN/.*' -printf '%P\\0'"; + complex_doit("(cd $dbgsym_tmp >/dev/null ; $find | LC_ALL=C sort -z | xargs -r0 md5sum | " . + q{perl -pe 'if (s@^\\\\@@) { s/\\\\\\\\/\\\\/g; }' > DEBIAN/md5sums) >/dev/null}); + # If the file's empty, no reason to waste inodes on it. + if (-z "${dbgsym_tmp}/DEBIAN/md5sums") { + rm_files("${dbgsym_tmp}/DEBIAN/md5sums"); + } + else { + reset_perm_and_owner(0644, "${dbgsym_tmp}/DEBIAN/md5sums"); + } } } -} +}; =head1 SEE ALSO @@ -116,9 +117,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_missing debhelper-11ubuntu1~16.04.york0/dh_missing --- debhelper-9.20160115ubuntu3/dh_missing 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_missing 2017-11-28 12:40:27.000000000 +0000 @@ -0,0 +1,196 @@ +#!/usr/bin/perl + +=head1 NAME + +dh_missing - check for missing files + +=cut + +use strict; +use warnings; +use Debian::Debhelper::Dh_Lib; + +our $VERSION = DH_BUILTIN_VERSION; + +=head1 SYNOPSIS + +B [B<-X>I] [B<--sourcedir=>I] [S>] + +=head1 DESCRIPTION + +B compares the list of installed files with the files in +the source directory. If any of the files (and symlinks) in the source +directory were not installed to somewhere, it will warn on stderr +about that (B<--list-missing>) or fail (B<--fail-missing>). Please +note that without either of these options, B will silently +do nothing. + +This may be useful if you have a large package and want to make sure that +you don't miss installing newly added files in new upstream releases. + +Remember to test different kinds of builds (dpkg-buildpackage -A/-B/...) as +you may experience varying results when only a subset of the packages are +built. + +=head1 FILES + +=over 4 + +=item debian/not-installed + +List the files that are deliberately not installed in I binary +package. Paths listed in this file are ignored by B. +However, it is B a method to exclude files from being installed +by any of the debhelper tool. If you want a tool to not install a +given file, please use its B<--exclude> option (where available). + +Please keep in mind that B will B expand wildcards in +this file. + +=back + +=head1 OPTIONS + +=over 4 + +=item B<--list-missing> + +Warn on stderr about source files not installed to somewhere. + +Note that files that are excluded from being moved via the B<-X> option are not +warned about. + +=item B<--fail-missing> + +This option is like B<--list-missing>, except if a file was missed, it will +not only list the missing files, but also fail with a nonzero exit code. + +=back + +=cut + +init(options => { + "list-missing" => \$dh{LIST_MISSING}, + "fail-missing" => \$dh{FAIL_MISSING}, + "sourcedir=s" => \$dh{SOURCEDIR}, +}); + +my (@installed, %helpers); + +my $srcdir = '.'; +$srcdir = $dh{SOURCEDIR} if defined $dh{SOURCEDIR}; + +if (!$dh{LIST_MISSING} && !$dh{FAIL_MISSING}) { + exit 0; +} + +# . as srcdir makes no sense, so this is a special case. +if ($srcdir eq '.') { + $srcdir='debian/tmp'; +} + +if (! -d $srcdir) { + if (scalar(getpackages()) == 1 && not defined($dh{SOURCEDIR})) { + warning("$srcdir does not exist and there is only binary package."); + warning("Assuming everything is installed directly into the package directory."); + exit(0); + } + # If there was no explicit source directory, then we do not care + # if it is missing. + exit(0) if not defined $dh{SOURCEDIR}; + if (compat(10)) { + # Prevent "dh $@ --list-missing --destdir=... ..." from failing in compat 10. + warning("Cannot check if installation is missing files: $srcdir does not exist"); + exit(0); + } else { + error("Cannot check if installation is missing files: $srcdir does not exist"); + } +} + +for my $file () { + my ($target_pkg, $helper) = ('unknown', 'unknown'); + my $had_files = 0; + my %seen; + if ($file =~ m@.*/([^/]+)/installed-by-(.*)@) { + ($target_pkg, $helper) = ($1, $2); + } + + open(my $fh, '<', $file) or die "could not open $file: $!"; + while (my $line = <$fh>) { + chomp($line); + next if $line =~ m/^\s*$/; + next if $seen{$line}++; # Ignore duplicates + $had_files++; + push(@installed, $line); + } + $helpers{$helper}{$target_pkg} = $had_files; + close($fh); +} + +my @missing; +if ( -f 'debian/not-installed') { + my @not_installed = filearray('debian/not-installed'); + foreach (@not_installed) { + s:^\s*:debian/tmp/: unless m:^\s*debian/tmp/:; + } + # Pretend that these are also installed. + push(@installed, @not_installed); +} +my $installed=join("|", map { + # Kill any extra slashes, for robustness. + y:/:/:s; + s:/+$::; + s:^(\./)*::; + "\Q$_\E\/.*|\Q$_\E"; +} @installed); +$installed=qr{^($installed)$}; + +# Lazy load File::Find +require File::Find; + +File::Find::find(sub { + # Lazy loading of File::Find makes perl think that File::Find::dir is only used once + # and we might have typo'ed something + no warnings qw(once); + -f || -l || return; + $_="$File::Find::dir/$_"; + if (! /$installed/ && ! excludefile($_)) { + my $file=$_; + $file=~s/^\Q$srcdir\E\///; + push @missing, $file; + } +}, $srcdir); +if (@missing) { + warning "$_ exists in $srcdir but is not installed to anywhere" foreach @missing; + nonquiet_print("The following debhelper tools have reported what they installed (with files per package)"); + for my $helper (sort(keys(%helpers))) { + my $pkg_info = $helpers{$helper}; + my @results; + for my $pkg (sort(keys(%{$pkg_info}))) { + my $no = $pkg_info->{$pkg}; + push(@results, "${pkg} (${no})") + } + nonquiet_print(" * ${helper}: " . join(', ', @results)); + } + nonquiet_print("If the missing files are installed by another tool, please file a bug against it."); + nonquiet_print('When filing the report, if the tool is not part of debhelper itself, please reference the'); + nonquiet_print('"Logging helpers and dh_missing" section from the "PROGRAMMING" guide for debhelper (10.6.3+).'); + nonquiet_print(' (in the debhelper package: /usr/share/doc/debhelper/PROGRAMMING.gz)'); + nonquiet_print("Be sure to test with dpkg-buildpackage -A/-B as the results may vary when only a subset is built"); + nonquiet_print("For a short-term work-around: Add the files to debian/not-installed"); + if ($dh{FAIL_MISSING}) { + error("missing files, aborting"); + } +} + +=head1 SEE ALSO + +L + +This program is a part of debhelper. + +=head1 AUTHOR + +Michael Stapelberg + +=cut diff -Nru debhelper-9.20160115ubuntu3/dh_movefiles debhelper-11ubuntu1~16.04.york0/dh_movefiles --- debhelper-9.20160115ubuntu3/dh_movefiles 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_movefiles 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<--sourcedir=>I] [B<-X>I] [S ...>] @@ -118,9 +120,7 @@ push(@tomove, @tomove_expanded); if (@tomove) { - if (! -d $tmp) { - install_dir($tmp); - } + install_dir($tmp); doit("rm","-f","debian/movelist"); foreach (@tomove) { @@ -169,9 +169,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_perl debhelper-11ubuntu1~16.04.york0/dh_perl --- debhelper-9.20160115ubuntu3/dh_perl 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_perl 2017-11-28 12:40:27.000000000 +0000 @@ -12,6 +12,8 @@ use File::Find; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-d>] [S ...>] @@ -81,7 +83,6 @@ my $perl = 'perl'; # If -d is given, then the dependency is on perl-base rather than perl. $perl .= '-base' if $dh{D_FLAG}; -my $version; # dependency types use constant PROGRAM => 1; @@ -109,28 +110,33 @@ # find scripts find sub { - return unless -f and (-x or /\.pl$/); - return if $File::Find::dir=~/\/usr\/share\/doc\//; - - local *F; - return unless open F, $_; - if (read F, local $_, 32 and m%^#!\s*(/usr/bin/perl|/usr/bin/env\s+perl)\s%) { + return unless -f and (-x _ or /\.pl$/); + if ($File::Find::dir =~ m{/usr/share/doc/}) { + $File::Find::prune = 1 if -d _; + return; + } + + return unless open(my $fd, '<', $_); + if (read($fd, local $_, 32) and m%^#!\s*(/usr/bin/perl|/usr/bin/env\s+perl)\s%) { $deps |= PROGRAM; } - close F; + close($fd); }, $tmp; if ($deps) { my $version=""; if ($deps & XS_MODULE or $dh{V_FLAG_SET}) { - ($version) = `dpkg -s $perl` =~ /^Version:\s*(\S+)/m + ($version) = qx_cmd('dpkg', '-s', $perl) =~ /^Version:\s*(\S+)/m unless $version; $version = ">= $version"; } - + + my $perlarch = $perl; + $perlarch .= ':any' if $deps == PROGRAM and not $dh{V_FLAG_SET}; + # no need to depend on an un-versioned perl-base -- it's # essential - addsubstvar($package, "perl:Depends", $perl, $version) + addsubstvar($package, "perl:Depends", $perlarch, $version) unless $perl eq 'perl-base' && ! length($version); # add perlapi- for XS modules and other modules @@ -161,9 +167,3 @@ Brendan O'Dea =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_prep debhelper-11ubuntu1~16.04.york0/dh_prep --- debhelper-9.20160115ubuntu3/dh_prep 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_prep 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-X>I] @@ -40,23 +42,30 @@ init(); +my (@clean_files, @clean_dirs, %seen); + foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); my $ext=pkgext($package); + my $source_dir = default_sourcedir($package); - doit("rm","-f","debian/${ext}substvars") + push(@clean_files, "debian/${ext}substvars") unless excludefile("debian/${ext}substvars"); # These are all debhelper temp files, and so it is safe to # wildcard them. - complex_doit("rm -f debian/$ext*.debhelper"); - - doit ("rm","-rf",$tmp."/") + my @temp = glob("debian/$ext*.debhelper"); + push(@clean_files, @temp); + push(@clean_dirs, "debian/.debhelper/generated/${package}/"); + push(@clean_dirs , "${tmp}/") unless excludefile($tmp); + + push(@clean_dirs, "${source_dir}/") + if (not $seen{$source_dir}++ and not excludefile($source_dir)); } -doit('rm', '-rf', 'debian/tmp') if -x 'debian/tmp' && - ! excludefile("debian/tmp"); +xargs(\@clean_files, 'rm', '-f', '--') if @clean_files; +xargs(\@clean_dirs, 'rm', '-fr', '--') if @clean_dirs; =head1 SEE ALSO @@ -69,9 +78,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_scrollkeeper debhelper-11ubuntu1~16.04.york0/dh_scrollkeeper --- debhelper-9.20160115ubuntu3/dh_scrollkeeper 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_scrollkeeper 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -#!/usr/bin/perl - -=head1 NAME - -dh_scrollkeeper - deprecated no-op - -=cut - -use strict; -use warnings; -use Debian::Debhelper::Dh_Lib; - -=head1 SYNOPSIS - -B [S>] [B<-n>] [S>] - -=head1 DESCRIPTION - -B was a debhelper program that handled -registering OMF files for ScrollKeeper. However, it no longer does -anything, and is now deprecated. - -=cut - -init(); - -warning("This program is deprecated, and does nothing anymore."); - -=head1 SEE ALSO - -L - -This program is a part of debhelper. - -=head1 AUTHOR - -Ross Burton - -=cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_shlibdeps debhelper-11ubuntu1~16.04.york0/dh_shlibdeps --- debhelper-9.20160115ubuntu3/dh_shlibdeps 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_shlibdeps 2017-11-28 12:40:27.000000000 +0000 @@ -9,8 +9,11 @@ use strict; use warnings; use Cwd; +use File::Find; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-L>I] [B<-l>I] [B<-X>I] [S I>] @@ -60,7 +63,8 @@ =item B<-L>I, B<--libpackage=>I With recent versions of B, this option is generally not -needed, unless your package builds multiple flavors of the same library. +needed, unless your package builds multiple flavors of the same library +or is relying on F for an internal library. It tells B (via its B<-S> parameter) to look first in the package build directory for the specified package, when searching for libraries, @@ -103,55 +107,96 @@ warning("You probably wanted to pass -V to dh_makeshlibs, it has no effect on dh_shlibdeps"); } -foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $ext=pkgext($package); - - # dpkg-shlibdeps expects this directory to exist - if (! -d "$tmp/DEBIAN") { - install_dir("$tmp/DEBIAN"); - } +on_pkgs_in_parallel { + foreach my $package (@_) { + my $tmp=tmpdir($package); + my $ext=pkgext($package); + my (@filelist); + + # Generate a list of ELF binaries in the package, ignoring any + # we were told to exclude. + my $find_options=''; + if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { + $find_options="! \\( $dh{EXCLUDE_FIND} \\)"; + } + next if not -d $tmp; + if (compat(10)) { + foreach my $file (split(/\n/, `find $tmp -type f \\( -perm /111 -or -name "*.so*" -or -name "*.cmxs" -or -name "*.node" \\) $find_options -print`)) { + # Prune directories that contain separated debug symbols. + # CAVEAT: There are files in /usr/lib/debug that are not detached debug symbols, + # which should be processed. (see #865982) + next if $file =~ m!^\Q$tmp\E/usr/lib/debug/(lib|lib64|usr|bin|sbin|opt|dev|emul|\.build-id)/!; + # TODO this is slow, optimize. Ie, file can run once on + # multiple files.. + my $ff = qx_cmd('file', '-e', 'apptype', '-e', 'ascii', '-e', 'encoding', + '-e', 'cdf', '-e', 'compress', '-e', 'tar', $file); + if ($ff =~ m/ELF/ && $ff !~ /statically linked/) { + push @filelist, $file; + } + } + } else { + my $find_elf_files = sub { + my $fn = $_; + return if -l $fn; # Ignore symlinks + # See if we were asked to exclude this file. + # Note that we have to test on the full filename, including directory. + foreach my $f (@{$dh{EXCLUDE}}) { + if ($fn =~ m/\Q$f\E/) { + $File::Find::prune = 1 if -d _; + return; + } + } + if (-d _) { + # Prune directories that contain separated debug symbols. + # CAVEAT: There are files in /usr/lib/debug that are not detached debug symbols, + # which should be processed. (see #865982) + if ($fn =~ m!^\Q$tmp\E/usr/lib/debug/(lib|lib64|usr|bin|sbin|opt|dev|emul|\.build-id)/!) { + $File::Find::prune = 1; + } + return; + } + + return if not -f _; + return if not is_so_or_exec_elf_file($fn); + # TODO this is slow, optimize. Ie, file can run once on + # multiple files.. + my $ff = qx_cmd('file', '-e', 'apptype', '-e', 'ascii', '-e', 'encoding', + '-e', 'cdf', '-e', 'compress', '-e', 'tar', $fn); + if ($ff =~ m/ELF/ && $ff !~ /statically linked/) { + push(@filelist, $fn); + } + }; + find({ + wanted => $find_elf_files, + no_chdir => 1, + }, $tmp); + } - my @filelist; - my $ff; + if (@filelist) { + my @opts; - # Generate a list of ELF binaries in the package, ignoring any - # we were told to exclude. - my $find_options=''; - if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { - $find_options="! \\( $dh{EXCLUDE_FIND} \\)"; - } - foreach my $file (split(/\n/,`find $tmp -type f \\( -perm /111 -or -name "*.so*" -or -name "*.cmxs" -or -name "*.node" \\) $find_options -print`)) { - # Prune directories that contain separated debug symbols. - next if $file=~m!^\Q$tmp\E/usr/lib/debug/(lib|lib64|usr|bin|sbin|opt|dev|emul)/!; - # TODO this is slow, optimize. Ie, file can run once on - # multiple files.. - $ff=`file "$file"`; - if ($ff=~m/ELF/ && $ff!~/statically linked/) { - push @filelist,$file; - } - } + # dpkg-shlibdeps expects this directory to exist + install_dir("$tmp/DEBIAN"); - if (@filelist) { - my @opts; - if (defined($dh{LIBPACKAGE})) { - @opts = map { '-S' . tmpdir($_) } @{$dh{LIBPACKAGE}}; - } - - push @opts, "-tudeb" if is_udeb($package); - - if ($dh{L_PARAMS}) { - foreach (split(/:/, $dh{L_PARAMS})) { - # Force the path absolute. - my $libdir = m:^/: ? $_ : "/$_"; - push @opts, "-l$libdir"; + if (defined($dh{LIBPACKAGE})) { + @opts = map { '-S' . tmpdir($_) } @{$dh{LIBPACKAGE}}; + } + + push @opts, "-tudeb" if is_udeb($package); + + if ($dh{L_PARAMS}) { + foreach (split(/:/, $dh{L_PARAMS})) { + # Force the path absolute. + my $libdir = m:^/: ? $_ : "/$_"; + push @opts, "-l$libdir"; + } } + + doit("dpkg-shlibdeps","-Tdebian/${ext}substvars", + @opts,@{$dh{U_PARAMS}},@filelist); } - - doit("dpkg-shlibdeps","-Tdebian/${ext}substvars", - @opts,@{$dh{U_PARAMS}},@filelist); } -} +}; =head1 SEE ALSO @@ -164,9 +209,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_strip debhelper-11ubuntu1~16.04.york0/dh_strip --- debhelper-9.20160115ubuntu3/dh_strip 2016-01-20 06:58:03.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_strip 2017-12-16 13:10:45.000000000 +0000 @@ -11,6 +11,8 @@ use File::Find; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-X>I] [B<--dbg-package=>I] [B<--keep-debug>] @@ -60,12 +62,6 @@ For example, if your packages are libfoo and foo and you want to include a I package with debugging symbols, use BI. -Note that this option behaves significantly different in debhelper -compatibility levels 4 and below. Instead of specifying the name of a debug -package to put symbols in, it specifies a package (or packages) which -should have separated debug symbols, and the separated symbols are placed -in packages with B<-dbg> added to their name. - This option implies B<--no-automatic-dbgsym> and I be used with B<--automatic-dbgsym> or B<--dbgsym-migration>. @@ -129,7 +125,10 @@ The automatic creation of debug symbol packages can also be prevented by adding B to the B environment -variable. +variable. However, B will still add debuglinks to ELF +binaries when this flag is set. This is to ensure that the regular +deb package will be identical with and without this flag (assuming it +is otherwise "bit-for-bit" reproducible). =head1 CONFORMS TO @@ -147,20 +146,14 @@ }); -if ($dh{K_FLAG} and $dh{MIGRATE_DBGSYM}) { - error("--keep-debug and --dbgsym-migration are mutually exclusive"); -} -if ($dh{DEBUGPACKAGES} and $dh{MIGRATE_DBGSYM}) { - error("--dbg-package and --dbgsym-migration are mutually exclusive"); +if ($dh{MIGRATE_DBGSYM}) { + error("--keep-debug and --dbgsym-migration are mutually exclusive") if ($dh{K_FLAG}); + error("--dbg-package and --dbgsym-migration are mutually exclusive") if ($dh{DEBUGPACKAGE}); } -if ($dh{ENABLE_DBGSYM} and $dh{ENABLE_DBGSYM} ne 'auto') { - if ($dh{K_FLAG}) { - error("--keep-debug and explicit --automatic-dbgsym are mutually exclusive"); - } - if ($dh{DEBUGPACKAGES}) { - error("--dbg-package and explicit --automatic-dbgsym are mutually exclusive"); - } +if ($dh{ENABLE_DBGSYM}) { + error("--keep-debug and explicit --automatic-dbgsym are mutually exclusive") if ($dh{K_FLAG}); + error("--dbg-package and explicit --automatic-dbgsym are mutually exclusive") if ($dh{DEBUGPACKAGE}); } $dh{ENABLE_DBGSYM} = 1 if not defined($dh{ENABLE_DBGSYM}); @@ -169,228 +162,259 @@ error("--dbgsym-migration and --no-automatic-dbgsym are mutually exclusive"); } -$dh{ENABLE_DBGSYM} = 0 if not $ENV{'DH_BUILD_DDEBS'}; - # This variable can be used to turn off stripping (see Policy). -if (get_buildoption('nostrip')) { - exit; -} +exit 0 if (get_buildoption('nostrip')); -my $objcopy = cross_command("objcopy"); -my $strip = cross_command("strip"); -$dh{ENABLE_DBGSYM} = 0 if get_buildoption('noautodbgsym') or get_buildoption('noddebs'); - -# I could just use `file $_[0]`, but this is safer -sub get_file_type { - my $file=shift; - open (FILE, '-|') # handle all filenames safely - || exec('file', $file) - || die "can't exec file: $!"; - my $type=; - close FILE; - return $type; -} +my $no_auto_dbgsym = 0; +$no_auto_dbgsym = 1 if get_buildoption('noautodbgsym') or get_buildoption('noddebs'); # Check if a file is an elf binary, shared library, or static library, # for use by File::Find. It'll fill the 3 first arrays with anything # it finds. The @build_ids will be the collected build-ids (if any) -my (@shared_libs, @executables, @static_libs, @build_ids); +my (@shared_libs, @executables, @static_libs, @build_ids, %file_output); sub testfile { - return if -l $_ or -d $_; # Skip directories and symlinks always. + my $fn = $_; + return if -l $fn; # Always skip symlinks. # See if we were asked to exclude this file. # Note that we have to test on the full filename, including directory. - my $fn="$File::Find::dir/$_"; foreach my $f (@{$dh{EXCLUDE}}) { - return if ($fn=~m/\Q$f\E/); + if ($fn =~ m/\Q$f\E/) { + $File::Find::prune = 1 if -d _; + return; + } } + return if -d _; # Is it a debug library in a debug subdir? return if $fn=~m/debug\/.*\.so/; - # Does its filename look like a shared library? - # - *.cmxs are OCaml native code shared libraries - # - *.node are also native ELF binaries (for node-js) - if (m/.*\.(?:so.*?|cmxs|node)$/) { - # Ok, do the expensive test. - my $type=get_file_type($_); - if ($type=~m/.*ELF.*shared.*/) { - push @shared_libs, $fn; - return; + # Exploit the previous stat call to get the $mode, so we can check + # later if it is executable or not. + # + # NB: compat() can issue a stat, so we /should/ do this now + my (undef, undef, $mode, undef) = stat(_); + + if (compat(10)) { + # In compat 10 and earlier, we used filenames and file(1) + + # Does its filename look like a shared library? + # - *.cmxs are OCaml native code shared libraries + # - *.node are also native ELF binaries (for node-js) + if ($fn =~ m/\.(?:so.*?|cmxs|node)$/) { + # Ok, do the expensive test. + my $type = get_file_type($fn, 1); + if ($type =~ m/ELF.*shared/) { + push @shared_libs, $fn; + return; + } } - } - - # Is it executable? -x isn't good enough, so we need to use stat. - my (undef,undef,$mode,undef)=stat(_); - if ($mode & 0111) { - # Ok, expensive test. - my $type=get_file_type($_); - if ($type=~m/.*ELF.*(executable|shared).*/) { - push @executables, $fn; + + # -x is not good enough for this test + if ($mode & 0111) { + # Ok, expensive test. + my $type = get_file_type($fn, 1); + if ($type =~ m/ELF.*(executable|shared)/) { + push(@executables, $fn); + return; + } + } + } else { + # In compat 11, we check the ELF header manually (because bulking file(1) is a pain and + # it is too slow otherwise) + + if (is_so_or_exec_elf_file($fn)) { + # -x is not good enough for this test + if ($mode & 0111) { + push(@executables, $fn); + } else { + push(@shared_libs, $fn); + } return; } } - # Is it a static library, and not a debug library? - if (m/lib.*\.a$/ && ! m/.*_g\.a$/) { + if ($fn =~ m/\/lib[^\/]*\.a$/ && $fn !~ m/.*_g\.a$/) { # Is it a binary file, or something else (maybe a linker # script on Hurd, for example? I don't use file, because # file returns a variety of things on static libraries. - if (-B $_) { + if (-B $fn) { push @static_libs, $fn; return; } } } -sub make_debug { - my ($file, $tmp, $desttmp, $use_build_id, $package) = @_; +sub write_buildid_file { + my ($package, $build_ids) = @_; + my $dir = "debian/.debhelper/${package}"; + my $path = "${dir}/dbgsym-build-ids"; + install_dir($dir); + open(my $fd, '>>', $path) or error("open $path failed: $!"); + print {$fd} join(q{ }, sort(@{$build_ids})) . ' '; + close($fd) or error("close $path failed: $!"); +} - # Don't try to copy debug symbols out if the file is already - # stripped. - return unless get_file_type($file) =~ /not stripped/; +# I could just use `file $_[0]`, but this is safer +sub get_file_type { + my ($file, $cache_ok) = @_; + return $file_output{$file} if $cache_ok && $file_output{$file}; + open (FILE, '-|') # handle all filenames safely + || exec('file', '-e', 'apptype', '-e', 'ascii', '-e', 'encoding', + '-e', 'cdf', '-e', 'compress', '-e', 'tar', $file) + || die "can't exec file: $!"; + my $type=; + close FILE; + return $file_output{$file} = $type; +} - my ($base_file)=$file=~/^\Q$tmp\E(.*)/; +sub make_debug { + my ($objcopy, $file, $tmp, $desttmp, $use_build_id) = @_; my ($debug_path, $debug_build_id); - if ($use_build_id && - `LC_ALL=C readelf -n $file`=~ /^\s+Build ID: ([0-9a-f]{2})([0-9a-f]+)$/m) { - $debug_path=$desttmp."/usr/lib/debug/.build-id/$1/$2.debug"; - $debug_build_id="${1}${2}"; - } - elsif ($use_build_id > 1) { - # For dbgsyms, we need build-id (else it will not be - # co-installable). - return; + # Don't try to copy debug symbols out if the file is already + # stripped. + # + # Disable caching for non-build-id based extractions. + # Unfortunately, it breaks when there are hardlinks to the same + # ELF files. + my $file_info = get_file_type($file, $use_build_id ? 1 : 0); + return unless $file_info =~ /not stripped/; + + if ($use_build_id) { + if ($file_info =~ m/BuildID\[sha1]\s*=\s*([0-9a-f]{2})([0-9a-f]+)/ or + `LC_ALL=C readelf -n $file`=~ /^\s+Build ID: ([0-9a-f]{2})([0-9a-f]+)$/m) { + $debug_path=$desttmp."/usr/lib/debug/.build-id/$1/$2.debug"; + $debug_build_id="${1}${2}"; + push(@build_ids, $debug_build_id); + } else { + # For dbgsyms, we need build-id (else it will not be + # co-installable). + return if $use_build_id > 1; + } } - else { + if (not $debug_path) { + # Either not using build_id OR no build-id available + my ($base_file)=$file=~/^\Q$tmp\E(.*)/; $debug_path=$desttmp."/usr/lib/debug/".$base_file; } - my $debug_dir=dirname($debug_path); - if (! -d $debug_dir) { - install_dir($debug_dir); - } + install_dir(dirname($debug_path)); if (compat(8) && $use_build_id < 2) { doit($objcopy, "--only-keep-debug", $file, $debug_path); } else { # Compat 9 OR a dbgsym package. - doit($objcopy, "--only-keep-debug", "--compress-debug-sections", $file, $debug_path); - } - - if ($use_build_id and defined($debug_build_id)) { - push(@build_ids, $debug_build_id); + doit($objcopy, "--only-keep-debug", "--compress-debug-sections", $file, $debug_path) unless -e $debug_path; } # No reason for this to be executable. - doit("chmod", "0644", $debug_path); + reset_perm_and_owner(0644, $debug_path); return $debug_path; } sub attach_debug { - my $file=shift; - my $debug_path=shift; + my ($objcopy, $file, $debug_path) = @_; doit($objcopy, "--add-gnu-debuglink", $debug_path, $file); } my %all_packages = map { $_ => 1 } getpackages(); -foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - - # Support for keeping the debugging symbols in a detached file. - my $keep_debug=$dh{K_FLAG}; - my $debugtmp=$tmp; - my $use_build_id = compat(8) ? 0 : 1; - if (! compat(4)) { - if (ref $dh{DEBUGPACKAGES}) { +sub process_packages { + foreach my $package (@_) { + my $tmp=tmpdir($package); + my $objcopy = cross_command($package, "objcopy"); + my $strip = cross_command($package, "strip"); + + # Support for keeping the debugging symbols in a detached file. + my $keep_debug=$dh{K_FLAG}; + my $debugtmp=$tmp; + my $use_build_id = compat(8) ? 0 : 1; + if ($dh{DEBUGPACKAGE}) { $keep_debug=1; - # Note that it's only an array for the v4 stuff; - # for v5 only one value is used. - my $debugpackage=@{$dh{DEBUGPACKAGES}}[0]; - if (!$all_packages{$debugpackage}) { - error("debug package $debugpackage is not listed in the control file"); - } + my $debugpackage=$dh{DEBUGPACKAGE}; + error("debug package $debugpackage is not listed in the control file") if (!$all_packages{$debugpackage}); $debugtmp=tmpdir($debugpackage); } - } - else { - if (ref $dh{DEBUGPACKAGES} && grep { $_ eq $package } @{$dh{DEBUGPACKAGES}}) { - $keep_debug=1; - $debugtmp=tmpdir($package."-dbg"); + # Temporary workaround: Do not build dbgsym packages for udebs as + # dpkg-gencontrol and dpkg-deb does not agree on the file + # extension. + if ($dh{ENABLE_DBGSYM} and not $keep_debug and not package_is_arch_all($package) and not is_udeb($package)) { + # Avoid creating a dbgsym that would clash with a registered + # package or looks like a manual -dbg package. + if (not $all_packages{"${package}-dbgsym"} and $package !~ m/-dbg(?:sym)?$/) { + $debugtmp = dbgsym_tmpdir($package); + $keep_debug = 1; + $use_build_id = 2; + } } - } - if ($dh{ENABLE_DBGSYM} and not $keep_debug and package_arch($package) ne 'all') { - # Avoid creating a dbgsym that would clash with a registered - # package or looks like a manual -dbg package. - if (!$all_packages{"${package}-dbgsym"} or $package =~ m/-dbg$/) { - $debugtmp = "debian/.debhelper/${package}/dbgsym-root"; - $keep_debug = 1; - $use_build_id = 2; + %file_output=@shared_libs=@executables=@static_libs=(); + find({ + wanted => \&testfile, + no_chdir => 1, + }, $tmp); + + foreach (@shared_libs) { + my $debug_path = make_debug($objcopy, $_, $tmp, $debugtmp, $use_build_id) if $keep_debug; + # Note that all calls to strip on shared libs + # *must* include the --strip-unneeded. + doit($strip, "--remove-section=.comment", "--remove-section=.note", "--strip-unneeded", $_); + attach_debug($objcopy, $_, $debug_path) if defined $debug_path; + } + + foreach (@executables) { + my $debug_path = make_debug($objcopy, $_, $tmp, $debugtmp, $use_build_id) if $keep_debug; + doit($strip, "--remove-section=.comment", "--remove-section=.note", $_); + attach_debug($objcopy, $_, $debug_path) if defined $debug_path; } - } - @shared_libs=@executables=@static_libs=@build_ids=(); - find(\&testfile,$tmp); - foreach (@shared_libs) { - my $debug_path = make_debug($_, $tmp, $debugtmp, $use_build_id, $package) if $keep_debug; - # Note that all calls to strip on shared libs - # *must* include the --strip-unneeded. - doit($strip,"--remove-section=.comment", - "--remove-section=.note","--strip-unneeded",$_); - attach_debug($_, $debug_path) if defined $debug_path; - } - - foreach (@executables) { - my $debug_path = make_debug($_, $tmp, $debugtmp, $use_build_id, $package) if $keep_debug; - doit($strip,"--remove-section=.comment", - "--remove-section=.note",$_); - attach_debug($_, $debug_path) if defined $debug_path; - } - - if (@static_libs) { - my $strip_help = qx{$strip 2>&1}; - my @opts = ('--strip-debug', '--remove-section=.comment', - '--remove-section=.note'); - if (index($strip_help, '--enable-deterministic-archives') > -1) { + foreach (@static_libs) { # NB: The short variant (-D) is broken in Jessie # (binutils/2.25-3) - push(@opts, '--enable-deterministic-archives'); + doit($strip, '--strip-debug', '--remove-section=.comment', + '--remove-section=.note', '--enable-deterministic-archives', $_); } - foreach (@static_libs) { - doit($strip, @opts, $_); + if ($no_auto_dbgsym and $use_build_id > 1) { + # When DEB_BUILD_OPTIONS contains noautodbgsym, remove the + # dbgsym dir and clear the build-ids. + # + # Note we have to extract the dbg symbols as usual, since + # attach_debug (objcopy --add-gnu-debuglink) requires the dbg + # file to exist. + doit('rm', '-fr', $debugtmp); + @build_ids = (); + } + if ($use_build_id > 1 and -d $debugtmp) { + my $dbgsym_docdir = "${debugtmp}/usr/share/doc"; + my $doc_symlink = "${dbgsym_docdir}/${package}-dbgsym"; + if ( not -l $doc_symlink and not -e _ ) { + install_dir($dbgsym_docdir); + make_symlink_raw_target($package, $doc_symlink); + } + if ($dh{MIGRATE_DBGSYM}) { + my $path = "debian/.debhelper/${package}/dbgsym-migration"; + open(my $fd, '>', $path) or error("open $path failed: $!"); + print {$fd} "$dh{MIGRATE_DBGSYM}\n"; + close($fd) or error("close $path failed: $!"); + } } - } - if ($use_build_id > 1 and -d $debugtmp) { - my $dbgsym_docdir = "${debugtmp}/usr/share/doc"; - my $doc_symlink = "${dbgsym_docdir}/${package}-dbgsym"; - if ( not -l $doc_symlink and not -e $doc_symlink ) { - install_dir($dbgsym_docdir) if not -d $dbgsym_docdir; - doit('ln', '-s', $package, $doc_symlink); - } - if ($dh{MIGRATE_DBGSYM}) { - my $path = "debian/.debhelper/${package}/dbgsym-migration"; - open(my $fd, '>', $path) or error("open $path failed: $!"); - print {$fd} "$dh{MIGRATE_DBGSYM}\n"; - close($fd) or error("close $path failed: $!"); + if ($use_build_id > 1 and @build_ids) { + write_buildid_file($package, \@build_ids); + @build_ids = (); } } - if (@build_ids && ($use_build_id > 1 || ref($dh{DEBUGPACKAGES}))) { - my ($dir, $path); - if ($use_build_id > 1) { - $dir = "debian/.debhelper/${package}"; - } else { - my $dbg_pkg = @{$dh{DEBUGPACKAGES}}[0]; - $dir = "debian/.debhelper/${dbg_pkg}"; - } - $path = "${dir}/dbgsym-build-ids"; - install_dir($dir) if ! -d $dir; - open(my $fd, '>>', $path) or error("open $path failed: $!"); - print {$fd} join(q{ }, sort(@build_ids)) . "\n"; - close($fd) or error("close $path failed: $!"); + if (@build_ids and $dh{DEBUGPACKAGE}) { + write_buildid_file($dh{DEBUGPACKAGE}, \@build_ids); } } +if ($dh{DEBUGPACKAGE}) { + # Non-deterministic issues with --dbg-package and parallelism (see + # #872007). Analysis and patches welcome for this case. + process_packages(@{$dh{DOPACKAGES}}); +} else { + on_pkgs_in_parallel(\&process_packages); +} + =head1 SEE ALSO L @@ -402,9 +426,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_suidregister debhelper-11ubuntu1~16.04.york0/dh_suidregister --- debhelper-9.20160115ubuntu3/dh_suidregister 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_suidregister 1970-01-01 00:00:00.000000000 +0000 @@ -1,134 +0,0 @@ -#!/usr/bin/perl - -=head1 NAME - -dh_suidregister - suid registration program (deprecated) - -=head1 SYNOPSIS - -Do not run! - -=head1 DESCRIPTION - -This program used to register suid and sgid files with L, -but with the introduction of L, registration of files -in this way is unnecessary, and even harmful, so this program is deprecated -and should not be used. - -=head1 CONVERTING TO STATOVERRIDE - -Converting a package that uses this program to use the new statoverride -mechanism is easy. Just remove the call to B from -F, and add a versioned conflicts into your F file, as -follows: - - Conflicts: suidmanager (<< 0.50) - -The conflicts is only necessary if your package used to register things -with suidmanager; if it did not, you can just remove the call to this -program from your rules file. - -=cut - -use strict; -use warnings; -use Debian::Debhelper::Dh_Lib; -init(); - -my $notused=1; - -foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $suid=pkgfile($package,"suid"); - my $tostrip=''; - - my @files; - if ($suid) { - @files=filearray($suid, $tmp); - } - - if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { - push @files, @ARGV; - } - - if (! @files && ! $suid) { - # No files specified (and no empty debian/suid file), so - # guess what files to process. - @files=split(/\n/,`find $tmp -type f -perm /6000`); - - # Strip the debian working directory off of the filenames. - $tostrip="$tmp/"; - } - else { - # We will strip leading /'s, so the user can feed this - # program either absolute filenames, or relative filenames, - # and it will do the right thing either way. - $tostrip="/"; - } - - # Register files with suidregister. - foreach my $file (@files) { - # Strip leading $tostrip from $file. - $file=~s/^$tostrip//; - - # Create the sed string that will be used to - # fill in the blanks in the autoscript files. - # Fill with the owner, group, and perms of the file. - my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat("$tmp/$file"); - # Now come up with the user and group names for the uid and - # gid. - my $user=getpwuid($uid); - if (! defined $user) { - warning("$file has odd uid $uid, not in /etc/passwd"); - $user=$uid; - } - my $group=getgrgid($gid); - if (! defined $group) { - warning("$file has odd gid $gid not in /etc/group"); - $group=$gid; - } - # Note that I have to print mode in octal, stripping file - # type. - my $sedstr=sprintf("s:#FILE#:$file:;s/#PACKAGE#/$package/;s/#OWNER#/$user/;s/#GROUP#/$group/;s/#PERMS#/%#o/", - $mode & 07777); - autoscript($package,"postinst","postinst-suid",$sedstr); - autoscript($package,"postrm","postrm-suid","$sedstr"); - } - - # Remove suid bits from files. This is delayed to this point, because - # of a situation with hard linked files if it is done earlier. - # See changelog for 2.0.77. - foreach my $file (@files) { - if ( -e "$tmp/$file") { - doit("chmod","a-s","$tmp/$file"); - } - } - - if (@files) { - warning("This program should no longer be used. Please read the dh_suidregister(1) man page."); - $notused=0; - } -} - -# Although they called it, it's not going to do anything. -if ($notused) { - warning("This program is obsolete, does nothing, and may be safely removed from your rules file."); -} - -=head1 SEE ALSO - -L - -This program is a part of debhelper. - -=head1 AUTHOR - -Joey Hess - -=cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_systemd_enable debhelper-11ubuntu1~16.04.york0/dh_systemd_enable --- debhelper-9.20160115ubuntu3/dh_systemd_enable 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_systemd_enable 2017-11-28 12:40:27.000000000 +0000 @@ -0,0 +1,289 @@ +#!/usr/bin/perl -w + +=head1 NAME + +dh_systemd_enable - enable/disable systemd unit files + +=cut + +use strict; +use warnings; +use Debian::Debhelper::Dh_Lib; +use File::Find; + +our $VERSION = DH_BUILTIN_VERSION; + +=head1 SYNOPSIS + +B [S>] [B<--no-enable>] [B<--name=>I] [S ...>] + +=head1 DESCRIPTION + +B is a debhelper program that is responsible for enabling +and disabling systemd unit files. + +In the simple case, it finds all unit files installed by a package (e.g. +bacula-fd.service) and enables them. It is not necessary that the machine +actually runs systemd during package installation time, enabling happens on all +machines in order to be able to switch from sysvinit to systemd and back. + +In the complex case, you can call B and B +manually (by overwriting the debian/rules targets) and specify flags per unit +file. An example is colord, which ships colord.service, a dbus-activated +service without an [Install] section. This service file cannot be enabled or +disabled (a state called "static" by systemd) because it has no +[Install] section. Therefore, running dh_systemd_enable does not make sense. + +For only generating blocks for specific service files, you need to pass them as +arguments, e.g. B and B. + +=head1 FILES + +=over 4 + +=item debian/I.service, debian/I@.service + +If this exists, it is installed into lib/systemd/system/I.service (or +lib/systemd/system/I@.service) in the package build directory. + +=item debian/I.tmpfile + +If this exists, it is installed into usr/lib/tmpfiles.d/I.conf in the +package build directory. (The tmpfiles.d mechanism is currently only used +by systemd.) + +=item debian/I.target, debian/I@.target + +If this exists, it is installed into lib/systemd/system/I.target (or +lib/systemd/system/I@.target) in the package build directory. + +=item debian/I.socket, debian/I@.socket + +If this exists, it is installed into lib/systemd/system/I.socket (or +lib/systemd/system/I@.socket) in the package build directory. + +=item debian/I.mount + +If this exists, it is installed into lib/systemd/system/I.mount +in the package build directory. + +=item debian/I.path, debian/I@.path + +If this exists, it is installed into lib/systemd/system/I.path (or +lib/systemd/system/I@.path) in the package build directory. + +=item debian/I.timer, debian/I@.timer + +If this exists, it is installed into lib/systemd/system/I.timer (or +lib/systemd/system/I@.timer) in the package build directory. + +=back + +=head1 OPTIONS + +=over 4 + +=item B<--no-enable> + +Disable the service(s) on purge, but do not enable them on install. + +B that this option does not affect whether the services are +started. That is controlled by L (using e.g. its +B<--no-start> option). + +=item B<--name=>I + +Install the service file as I instead of the default filename, +which is the I. When this parameter is used, +B looks for and installs files named +F instead of the usual F. + +=back + +=head1 NOTES + +Note that this command is not idempotent. L should be called +between invocations of this command (with the same arguments). Otherwise, it +may cause multiple instances of the same text to be added to maintainer +scripts. + +Note that B should be run before B. +The default sequence in B does the right thing, this note is only relevant +when you are calling B manually. + +=cut + +if (not compat(10)) { + error("dh_systemd_enable is no longer used in compat >= 11, please use dh_installsystemd instead"); +} + +init(options => { + "no-enable" => \$dh{NO_ENABLE}, +}); + +sub contains_install_section { + my ($unit_path) = @_; + open(my $fh, '<', $unit_path) or error("Cannot open($unit_path) to check for [Install]: $!"); + while (my $line = <$fh>) { + chomp($line); + return 1 if $line =~ /^\s*\[Install\]$/i; + } + close($fh); + return 0; +} + +sub install_unit { + my ($package, $script, $pkgsuffix, $path, $installsuffix) = @_; + $installsuffix = $installsuffix || $pkgsuffix; + my $unit = pkgfile($package, $pkgsuffix); + return if $unit eq ''; + install_dir($path); + install_file($unit, "${path}/${script}.${installsuffix}"); +} + +# PROMISE: DH NOOP WITHOUT tmp(lib/systemd/system) mount path service socket target tmpfile timer + +my %requested_files = map { basename($_) => 1 } @ARGV; +my %installed_files; + +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmpdir = tmpdir($package); + my @installed_units; + my @units; + + # XXX: This is duplicated in dh_installinit, which is unfortunate. + # We do need the service files before running dh_installinit though, + # every other solution makes things much worse for all the maintainers. + + # Figure out what filename to install it as. + my $script; + my $jobfile=$package; + if (defined $dh{NAME}) { + $jobfile=$script=$dh{NAME}; + } + elsif ($dh{D_FLAG}) { + # -d on the command line sets D_FLAG. We will + # remove a trailing 'd' from the package name and + # use that as the name. + $script=$package; + if ($script=~m/(.*)d$/) { + $jobfile=$script=$1; + } + else { + warning("\"$package\" has no final d' in its name, but -d was specified."); + } + } + elsif ($dh{INIT_SCRIPT}) { + $script=$dh{INIT_SCRIPT}; + } + else { + $script=$package; + } + + for my $service_type (qw(service target socket path timer)) { + install_unit($package, $script, $service_type, "$tmpdir/lib/systemd/system"); + install_unit("${package}@", "${script}@", $service_type, "$tmpdir/lib/systemd/system"); + } + + install_unit($package, $script, 'mount', "$tmpdir/lib/systemd/system"); + install_unit($package, $script, 'tmpfile', "$tmpdir/usr/lib/tmpfiles.d", 'conf'); + + find({ + wanted => sub { + my $name = $File::Find::name; + return unless -f $name; + # Skip symbolic links, their only legitimate use is for + # adding an alias, e.g. linking smartmontools.service + # -> smartd.service. + return if -l $name; + return unless $name =~ m,^$tmpdir/lib/systemd/system/[^/]+$,; + push @installed_units, $name; + }, + no_chdir => 1, + }, "${tmpdir}/lib/systemd/system") if -d "${tmpdir}/lib/systemd/system"; + + # Handle either only the unit files which were passed as arguments or + # all unit files that are installed in this package. + my @args = @ARGV > 0 ? @ARGV : @installed_units; + + # support excluding units via -X + foreach my $x (@{$dh{EXCLUDE}}) { + @args = grep !/(^|\/)$x$/, @args; + } + + for my $name (@args) { + my $base = basename($name); + # Try to make the path absolute, so that the user can call + # dh_installsystemd bacula-fd.service + if ($base eq $name) { + # NB: This works because @installed_units contains + # files from precisely one directory. + my ($full) = grep { basename($_) eq $base } @installed_units; + if (defined($full)) { + $name = $full; + } elsif (not exists($requested_files{$base})) { + warning(qq|Could not find "$name" in the /lib/systemd/system directory of $package. | . + qq|This could be a typo, or using Also= with a service file from another package. | . + qq|Please check carefully that this message is harmless.|); + } else { + # Ignore an explicitly requested file that is missing; happens when we are acting on + # multiple packages and only a subset of them have the unit file. + next; + } + } + + $installed_files{$base} = 1 if exists($requested_files{$base}); + + # Skip template service files like e.g. getty@.service. + # Enabling, disabling, starting or stopping those services + # without specifying the instance (e.g. getty@ttyS0.service) is + # not useful. + if ($name =~ /\@/) { + next; + } + + # Skip unit files that don’t have an [Install] section. + next unless contains_install_section($name); + + push @units, $name; + } + + next if @units == 0; + + # Wrap the basenames in '' to preserve \x2d when the shell parses the + # name. (#764730) + my $unitargs = join(' ', sort map { q{'} . basename($_) . q{'} } @units); + for my $unit (sort @units) { + # Wrap the basenames in '' to preserve \x2d when the shell parses the + # name. (#764730) + my $base = q{'} . basename($unit) . q{'}; + if ($dh{NO_ENABLE}) { + autoscript($package, 'postinst', 'postinst-systemd-dont-enable', { 'UNITFILE' => $base }); + } else { + autoscript($package, 'postinst', 'postinst-systemd-enable', { 'UNITFILE' => $base }); + } + } + autoscript($package, 'postrm', 'postrm-systemd', {'UNITFILES' => $unitargs }); +} + +if (%requested_files) { + my $any_missing = 0; + for my $name (sort(keys(%requested_files))) { + if (not exists($installed_files{$name})) { + warning(qq{Requested unit "$name" but it was not found in any package acted on.}); + $any_missing = 1; + } + } + error("Could not handle all of the requested services") if $any_missing; +} + +=head1 SEE ALSO + +L, L + +=head1 AUTHORS + +pkg-systemd-maintainers@lists.alioth.debian.org + +=cut diff -Nru debhelper-9.20160115ubuntu3/dh_systemd_start debhelper-11ubuntu1~16.04.york0/dh_systemd_start --- debhelper-9.20160115ubuntu3/dh_systemd_start 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_systemd_start 2017-11-28 12:40:27.000000000 +0000 @@ -0,0 +1,277 @@ +#!/usr/bin/perl -w + +=head1 NAME + +dh_systemd_start - start/stop/restart systemd unit files + +=cut + +use strict; +use warnings; +use Debian::Debhelper::Dh_Lib; +use File::Find; +use Cwd qw(getcwd abs_path); + +our $VERSION = DH_BUILTIN_VERSION; + +=head1 SYNOPSIS + +B [S>] [B<--restart-after-upgrade>] [B<--no-stop-on-upgrade>] [S ...>] + +=head1 DESCRIPTION + +B is a debhelper program that is responsible for +starting/stopping or restarting systemd unit files in case no corresponding +sysv init script is available. + +As with B, the unit file is stopped before +upgrades and started afterwards (unless B<--restart-after-upgrade> is +specified, in which case it will only be restarted after the upgrade). +This logic is not used when there is a corresponding SysV init script +because invoke-rc.d performs the stop/start/restart in that case. + +=head1 OPTIONS + +=over 4 + +=item B<--restart-after-upgrade> + +Do not stop the unit file until after the package upgrade has been completed. +This is the default behaviour in compat 10. + +In earlier compat levels the default was to stop the unit file in the +F, and start it again in the F. + +This can be useful for daemons that should not have a possibly long +downtime during upgrade. But you should make sure that the daemon will not +get confused by the package being upgraded while it's running before using +this option. + +=item B<--no-restart-after-upgrade> + +Undo a previous B<--restart-after-upgrade> (or the default of compat +10). If no other options are given, this will cause the service to be +stopped in the F script and started again in the F +script. + +=item B<-r>, B<--no-stop-on-upgrade>, B<--no-restart-on-upgrade> + +Do not stop service on upgrade. + +=item B<--no-start> + +Do not start the unit file after upgrades and after initial installation (the +latter is only relevant for services without a corresponding init script). + +=back + +=head1 NOTES + +Note that this command is not idempotent. L should be called +between invocations of this command (with the same arguments). Otherwise, it +may cause multiple instances of the same text to be added to maintainer +scripts. + +Note that B should be run after B so that it +can detect corresponding SysV init scripts. The default sequence in B does +the right thing, this note is only relevant when you are calling +B manually. + +=cut + +if (not compat(10)) { + error("dh_systemd_start is no longer used in compat >= 11, please use dh_installsystemd instead"); +} + +$dh{RESTART_AFTER_UPGRADE} = 1 if not compat(9); + +init(options => { + "r" => \$dh{R_FLAG}, + 'no-stop-on-upgrade' => \$dh{R_FLAG}, + "no-restart-on-upgrade" => \$dh{R_FLAG}, + "no-start" => \$dh{NO_START}, + "R|restart-after-upgrade!" => \$dh{RESTART_AFTER_UPGRADE}, + "no-also" => \$dh{NO_ALSO}, +}); + +# Extracts the Also= or Alias= line(s) from a unit file. +# In case this produces horribly wrong results, you can pass --no-also, but +# that should really not be necessary. Please report bugs to +# pkg-systemd-maintainers. +sub extract_key { + my ($unit_path, $key) = @_; + my @values; + + return if $dh{NO_ALSO}; + + open(my $fh, '<', $unit_path) or error("Cannot open($unit_path) for extracting the Also= line(s): $!"); + + while (my $line = <$fh>) { + chomp($line); + + # The keys parsed from the unit file below can only have + # unit names as values. Since unit names can't have + # whitespace in systemd, simply use split and strip any + # leading/trailing quotes. See systemd-escape(1) for + # examples of valid unit names. + if ($line =~ /^\s*$key=(.+)$/i) { + for my $value (split(/\s+/, $1)) { + $value =~ s/^(["'])(.*)\g1$/$2/; + push @values, $value; + } + } + } + close($fh); + return @values; +} + + +# PROMISE: DH NOOP WITHOUT tmp(lib/systemd/system) + +my %requested_files = map { basename($_) => 1 } @ARGV; +my %installed_files; + +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmpdir = tmpdir($package); + my @installed_units; + my @units; + my %aliases; + + my $oldcwd = getcwd(); + find({ + wanted => sub { + my $name = $File::Find::name; + return unless -f; + return unless $name =~ m,^\Q${tmpdir}\E/lib/systemd/system/[^/]+$,; + if (-l) { + my $target = abs_path(readlink()); + $target =~ s,^\Q${oldcwd}\E/,,g; + $aliases{$target} = [ $_ ]; + } else { + push @installed_units, $name; + } + }, + }, "${tmpdir}/lib/systemd/system") if -d "${tmpdir}/lib/systemd/system"; + chdir($oldcwd); + + # Handle either only the unit files which were passed as arguments or + # all unit files that are installed in this package. + my @args = @ARGV > 0 ? @ARGV : @installed_units; + + # support excluding units via -X + foreach my $x (@{$dh{EXCLUDE}}) { + @args = grep !/(^|\/)$x$/, @args; + } + + # This hash prevents us from looping forever in the following while loop. + # An actual real-world example of such a loop is systemd’s + # systemd-readahead-drop.service, which contains + # Also=systemd-readahead-collect.service, and that file in turn + # contains Also=systemd-readahead-drop.service, thus forming an endless + # loop. + my %seen; + + # We use while/shift because we push to the list in the body. + while (@args) { + my $name = shift @args; + my $base = basename($name); + + # Try to make the path absolute, so that the user can call + # dh_installsystemd bacula-fd.service + if ($base eq $name) { + # NB: This works because @installed_units contains + # files from precisely one directory. + my ($full) = grep { basename($_) eq $base } @installed_units; + if (defined($full)) { + $name = $full; + } elsif (not exists($requested_files{$base})) { + warning(qq|Could not find "$name" in the /lib/systemd/system directory of $package. | . + qq|This could be a typo, or using Also= with a service file from another package. | . + qq|Please check carefully that this message is harmless.|); + } else { + # Ignore an explicitly requested file that is missing; happens when we are acting on + # multiple packages and only a subset of them have the unit file. + next; + } + } + + $installed_files{$base} = 1 if exists($requested_files{$base}); + + # Skip template service files like e.g. getty@.service. + # Enabling, disabling, starting or stopping those services + # without specifying the instance (e.g. getty@ttyS0.service) is + # not useful. + if ($name =~ /\@/) { + next; + } + + # Handle all unit files specified via Also= explicitly. + # This is not necessary for enabling, but for disabling, as we + # cannot read the unit file when disabling (it was already + # deleted). + my @also = grep { !exists($seen{$_}) } extract_key($name, 'Also'); + $seen{$_} = 1 for @also; + @args = (@args, @also); + + push @{$aliases{$name}}, $_ for extract_key($name, 'Alias'); + my @sysv = grep { + my $base = $_; + $base =~ s/\.(?:mount|service|socket|target|path)$//g; + -f "$tmpdir/etc/init.d/$base" + } ($base, @{$aliases{$name}}); + if (@sysv == 0 && !grep { $_ eq $name } @units) { + push @units, $name; + } + } + + next if @units == 0; + + # Wrap the basenames in '' to preserve \x2d when the shell parses the + # name. (#764730) + my $unitargs = join(' ', sort map { q{'} . basename($_) . q{'} } @units); + # The $package and $sed parameters are always the same. + # This wrapper function makes the following logic easier to read. + my $sd_autoscript = sub { + my ($script, $filename) = @_; + autoscript($package, $script, $filename, { 'UNITFILES' => $unitargs }); + }; + + if ($dh{RESTART_AFTER_UPGRADE}) { + my $snippet = "postinst-systemd-restart" . ($dh{NO_START} ? "nostart" : ""); + $sd_autoscript->("postinst", $snippet); + } elsif (!$dh{NO_START}) { + # We need to stop/start before/after the upgrade. + $sd_autoscript->("postinst", "postinst-systemd-start"); + } + + $sd_autoscript->("postrm", "postrm-systemd-reload-only"); + + if ($dh{R_FLAG} || $dh{RESTART_AFTER_UPGRADE}) { + # stop service only on remove + $sd_autoscript->("prerm", "prerm-systemd-restart"); + } elsif (!$dh{NO_START}) { + # always stop service + $sd_autoscript->("prerm", "prerm-systemd"); + } +} + +if (%requested_files) { + my $any_missing = 0; + for my $name (sort(keys(%requested_files))) { + if (not exists($installed_files{$name})) { + warning(qq{Requested unit "$name" but it was not found in any package acted on.}); + $any_missing = 1; + } + } + error("Could not handle all of the requested services") if $any_missing; +} + +=head1 SEE ALSO + +L + +=head1 AUTHORS + +pkg-systemd-maintainers@lists.alioth.debian.org + +=cut diff -Nru debhelper-9.20160115ubuntu3/dh_testdir debhelper-11ubuntu1~16.04.york0/dh_testdir --- debhelper-9.20160115ubuntu3/dh_testdir 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_testdir 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [S ...>] @@ -33,6 +35,13 @@ =cut +# This command is completely useless when called from dh(1) as dh will +# have attempted to read d/control before it even constructs the +# command sequences. Accordingly, there is no doubt that the +# following is unconditionally true: +# +# PROMISE: DH NOOP + # Run before init because init will try to read debian/control and # we want a nicer error message. checkfile('debian/control'); @@ -62,9 +71,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_testroot debhelper-11ubuntu1~16.04.york0/dh_testroot --- debhelper-9.20160115ubuntu3/dh_testroot 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_testroot 2017-11-28 12:40:27.000000000 +0000 @@ -1,8 +1,10 @@ #!/usr/bin/perl +=encoding UTF-8 + =head1 NAME -dh_testroot - ensure that a package is built as root +dh_testroot - ensure that a package is built with necessary level of root permissions =head1 SYNOPSIS @@ -10,19 +12,63 @@ =head1 DESCRIPTION -B simply checks to see if you are root. If not, it exits with an -error. Debian packages must be built as root, though you can use -L +B is used to determine if the package has access to at +least the level of root access that it declared it needed via the +Rules-Requires-Root (R³) field. + +The following is how B behaves based on the effective +value of the R³ field: + +=over 4 + +=item "binary-targets" + +B asserts that it is run as root or under L. + +=item "no" + +B returns successfully. + +=item Any other value than the above + +B asserts that it is either run as root (or under +L) or the builder has provided the B +environment variable (e.g. via dpkg-buildpackage -r). + +=back + +For backwards compatibility, B will consider the absence +of the R³ field as if the R³ field was set to "binary-targets". =cut use strict; use warnings; use Debian::Debhelper::Dh_Lib; + +our $VERSION = DH_BUILTIN_VERSION; + inhibit_log(); -if ($< != 0) { +my $requirements = 'legacy-root'; + +if (-f 'debian/control') { + $requirements = Debian::Debhelper::Dh_Lib::root_requirements(); +} else { + warning('dh_testroot must be called from the source root'); +} + +# By declaration; nothing requires root and this command must be a no-op in that case. +exit 0 if $requirements eq 'none'; +# The builder /can/ choose to ignore the requirements and just call us as root. +# If so, we do not bother checking the requirements any further. +exit 0 if $< == 0; +if ($requirements eq 'legacy-root') { error("You must run this as root (or use fakeroot)."); +} else { + my $env = $ENV{'DPKG_GAIN_ROOT_CMD'}; + error("Package needs targetted root but builder has not provided a gain-root command via \${DPKG_GAIN_ROOT_CMD}") + if not $env; } =head1 SEE ALSO @@ -36,9 +82,3 @@ Joey Hess =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_ucf debhelper-11ubuntu1~16.04.york0/dh_ucf --- debhelper-9.20160115ubuntu3/dh_ucf 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_ucf 2017-11-28 12:40:27.000000000 +0000 @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-n>] @@ -39,7 +41,7 @@ =over 4 -=item B<-n>, B<--noscripts> +=item B<-n>, B<--no-scripts> Do not modify F/F scripts. Turns this command into a no-op. @@ -58,7 +60,6 @@ # PROMISE: DH NOOP WITHOUT ucf foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); my $file=pkgfile($package,"ucf"); my @ucf; @@ -95,9 +96,3 @@ Jeroen Schot =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_undocumented debhelper-11ubuntu1~16.04.york0/dh_undocumented --- debhelper-9.20160115ubuntu3/dh_undocumented 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_undocumented 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -#!/usr/bin/perl - -=head1 NAME - -dh_undocumented - undocumented.7 symlink program (deprecated no-op) - -=cut - -use strict; -use warnings; -use Debian::Debhelper::Dh_Lib; - -=head1 SYNOPSIS - -Do not run! - -=head1 DESCRIPTION - -This program used to make symlinks to the F man page for man -pages not present in a package. Debian policy now frowns on use of the -F man page, and so this program does nothing, and should not -be used. - -=cut - -init(); -warning("This program does nothing and should no longer be used."); - -=head1 SEE ALSO - -L - -This program is a part of debhelper. - -=head1 AUTHOR - -Joey Hess - -=cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_update_autotools_config debhelper-11ubuntu1~16.04.york0/dh_update_autotools_config --- debhelper-9.20160115ubuntu3/dh_update_autotools_config 2016-01-15 20:08:02.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_update_autotools_config 2017-11-28 12:40:27.000000000 +0000 @@ -2,7 +2,7 @@ =head1 NAME -dh_update_autotools_config - Update autotools config files +dh_update_autotools_config - Update autotools config files =cut @@ -10,6 +10,8 @@ use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] @@ -42,19 +44,28 @@ sub is_autotools_config_file { my ($file) = @_; - my ($saw_timestamp); + my ($is_autoconf_file); open(my $fd, '<', $file) or error("open $file for reading failed: $!"); while (my $line = <$fd>) { chomp($line); # This is the test lintian uses. if ($line =~ m{^timestamp=['"]\d{4}-\d{2}-\d{2}['"]\s*$}) { - $saw_timestamp = 1; + $is_autoconf_file = 1; + last; + } + $line =~ s/\s++$//; + if ($line eq q{# Attempt to guess a canonical system name.} + or $line =~ q{^# Configuration validation subroutine script}) { + # Very old scripts do not have that timestamp line, but + # they do have these headers (which even new files also + # have). + $is_autoconf_file = 1; last; } last if $. >= 10; } close($fd); - return $saw_timestamp; + return $is_autoconf_file; } @@ -69,9 +80,3 @@ Niels Thykier =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/dh_usrlocal debhelper-11ubuntu1~16.04.york0/dh_usrlocal --- debhelper-9.20160115ubuntu3/dh_usrlocal 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/dh_usrlocal 2017-11-28 12:40:27.000000000 +0000 @@ -1,5 +1,7 @@ #!/usr/bin/perl +=encoding UTF-8 + =head1 NAME dh_usrlocal - migrate usr/local directories to maintainer scripts @@ -12,6 +14,8 @@ use File::Find; use File::stat; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B [S>] [B<-n>] @@ -29,18 +33,24 @@ L for an explanation of debhelper maintainer script snippets. -If the directories found in the build tree have unusual owners, groups, or -permissions, then those values will be preserved in the directories made by -the F script. However, as a special exception, if a directory is owned -by root.root, it will be treated as if it is owned by root.staff and is mode -2775. This is useful, since that is the group and mode policy recommends for -directories in F. +When the I field is not (effectively) +I, the directories in F will have +ownership root:staff and the mode will be 02775. These values have +been chosen to comply with the recommendations of the Debian policy +for directories in F. + +When I has an effective value of +I, the owners, groups and permissions will be +preserved with one exception. If the directory is owned by root:root, +then ownership will be reset to root:staff and mode will be reset to +02775. This is useful, since that is the group and mode policy +recommends for directories in F. =head1 OPTIONS =over 4 -=item B<-n>, B<--noscripts> +=item B<-n>, B<--no-scripts> Do not modify F/F scripts. @@ -72,16 +82,22 @@ wanted => sub { my $fn = $File::Find::name; if (-d $fn) { - my $stat = stat $fn; - my $user = getpwuid $stat->uid; - my $group = getgrgid $stat->gid; - my $mode = sprintf "%04lo", ($stat->mode & 07777); - - if ($stat->uid == 0 && $stat->gid == 0) { - $group = 'staff'; - $mode = '2775'; + my $user = 'root'; + my $group = 'staff'; + my $mode = '02775'; + if (should_use_root()) { + my $stat = stat $fn; + $user = getpwuid $stat->uid; + $group = getgrgid $stat->gid; + $mode = sprintf "%04lo", ($stat->mode & 07777); + if ($stat->uid == 0 && $stat->gid == 0) { + $group = 'staff'; + $mode = '02775'; + } } + + $fn =~ s!^\Q$tmp\E!!; return if $fn eq '/usr/local'; @@ -89,13 +105,13 @@ unshift @dirs, "$fn $mode $user $group"; # ...whereas @justdirs is depth-first for removal. push @justdirs, $fn; - doit("rmdir $_"); + doit('rmdir', $_); } else { warning("$fn is not a directory"); } }}, "$tmp/usr/local"); - doit("rmdir $tmp/usr/local"); + doit('rmdir', "$tmp/usr/local"); my $bs = "\\"; # A single plain backslash my $ebs = $bs x 2; # Escape the backslash from the shell @@ -124,9 +140,3 @@ Andrew Stribblehill =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: diff -Nru debhelper-9.20160115ubuntu3/.dir-locals.el debhelper-11ubuntu1~16.04.york0/.dir-locals.el --- debhelper-9.20160115ubuntu3/.dir-locals.el 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/.dir-locals.el 2017-11-28 12:40:26.000000000 +0000 @@ -0,0 +1,7 @@ +((perl-mode + (tab-width . 4) + (indent-tabs-mode . t)) + (cperl-mode + (cperl-indent-level . 4) + (tab-width . 4) + (indent-tabs-mode . t))) diff -Nru debhelper-9.20160115ubuntu3/doc/PROGRAMMING debhelper-11ubuntu1~16.04.york0/doc/PROGRAMMING --- debhelper-9.20160115ubuntu3/doc/PROGRAMMING 2016-01-10 08:28:48.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/doc/PROGRAMMING 2017-11-28 12:40:27.000000000 +0000 @@ -20,7 +20,7 @@ An exception to above rule are dh_auto_* commands and dh itself. They will also print the commands interacting with the upstream build system and which -of the simple debhelper programms are called. (i.e. print what a traditional +of the simple debhelper programs are called. (i.e. print what a traditional non-dh(1) using debian/rules would print but nothing else). Debhelper programs should accept all options listed in the "SHARED @@ -62,11 +62,14 @@ Use Dh_Lib like this: -use Debian::Debhelper::Dh_Lib +use Debian::Debhelper::Dh_Lib; +our $VERSION = '1.0'; init(); -The init() function causes Dh_lib to parse the command line and do some other -initialization tasks. +The init() function causes Dh_lib to parse the command line and do +some other initialization tasks. If present, $main::VERSION will be +used to determine the version of the tool (e.g. embedded into +autoscript snippets). Argument processing: ------------------- @@ -152,13 +155,27 @@ Dh_Lib.pm also contains a number of functions you may find useful. -doit(@command) - Pass this function an array that is a - shell command. It will run the command (unless $dh{NO_ACT} is set), and +doit([$options, ]@command) + Pass this function an array that is a command with arguments. + It will run the command (unless $dh{NO_ACT} is set), and if $dh{VERBOSE} is set, it will also output the command to stdout. You should use this function for almost all commands your program performs that manipulate files in the package build directories. -print_and_doit(@command) + + The $options argument (if passed) must be a hashref (added in debhelper 10.7). + The following key-value pairs can be used: + * stdout => A file name. The child process will have its STDOUT redirected + to that file. [debhelper (>= 10.7)] + * chdir => A directory. The child process will do a chdir into that + directory before executing the command. [debhelper (>= 10.9)] + + This will *not* invoke a shell, so meta characters will not have any special + meaning. Use complex_doit for that. + NB: In compat 11 and below, there was a bug that would make doit fork a shell + in one special case. This is deprecated and will be removed in compat 12. + The detection code for this can be disabled by passing an empty hashref for + as $options. This will make doit unconditionally avoid forking a shell. +print_and_doit([$options, ]@command) Like doit but will print unless $dh{QUIET} is set. See "Standardization" above for when this is allowed to be called. complex_doit($command) @@ -207,7 +224,12 @@ skip running it. This is done by inserting a special comment, of the form: - # PROMISE: DH NOOP WITHOUT pkgfilea pkgfileb tmp(need/this) + # PROMISE: DH NOOP WITHOUT pkgfilea pkgfile-logged(pkgfileb) tmp(need/this) + + The "pkgfile-logged" hint notifies dh that the helper logs these files + via "log_intalled_files". This means dh will sometimes need to run it + even when it is a NO OP because it has to log what it would have + installed to avoid dh_missing complaining about missing files. pkgext($package) Pass this command the name of a binary package, and it will return @@ -219,16 +241,18 @@ is a native debian package. As a side effect, $dh{VERSION} is set to the version number of the package. -autoscript($package, $scriptname, $snippetname, $sedcommands || $sub) +autoscript($package, $scriptname, $snippetname, $substparam) Pass parameters: - binary package to be affected - script to add to - filename of snippet - - (optional) EITHER sed commands to run on the snippet. Ie, - s/#PACKAGE#/$PACKAGE/ Note: Passed to the shell inside double - quotes. - OR a perl sub to invoke with $_ set to each line of the snippet in - turn. + - (optional) A substitution parameter, which is one of 3 times: + * sed commands to run on the snippet. E.g. s/#PACKAGE#/$PACKAGE/ + Note: Passed to the shell inside double quotes. + * a perl sub to invoke with $_ set to each line of the snippet + in turn. + * a hashref, where each key will substitute "#${key}#" with the + value that $key points to. [debhelper (>= 10.7)] This command automatically adds shell script snippets to a debian maintainer script (like the postinst or prerm). Note that in v6 mode and up, the snippets are added in reverse @@ -300,7 +324,7 @@ CAVEAT: This *cannot* undo arbitrary "rm -fr"'ing. The dir, which is/was in $file, must be present when dh_clean is called. make_symlink($src, $dest, $tmp) - Creates a Policy compliant sytem link called $dest pointing to + Creates a Policy compliant system link called $dest pointing to $src. If $tmp is given, then $tmp will be prefixed to $dest when creating the actual symlink. install_dh_config_file($src, $dest[, $mode]) @@ -311,6 +335,7 @@ install_dir($dir) Create the directory denoted by the path $dir and all parent entries as well (as needed). + If the directory already exists, the function does not. install_file($src, $dest) Installs $src into $dest with mode 0644. The parent dir of $dest must exist (can be created with install_dir). @@ -323,6 +348,71 @@ Installs a library at the path $src into $dest. The parent dir of $dest must exist (can be created with install_dir). This is intended for installing libraries. +reset_perm_and_owner($mode, $path...) + Resets the ownership and mode (POSIX permissions) of $path + This is useful for files created directly by the script, but + it not necessary for files installed via the install_* + functions. + The file owner and group is set to "root:root". The change + is only done on the exact paths listed (i.e. it is *not* + recursive). + To avoid issue, please pass mode as a string (i.e. '0755' + rather than 0755). +open_gz($file) + Open $file, read from it as a gzip-compressed file and return + the file handle. + Depending on runtime features, it might be a pipe from an + external process (which will die with a "SIGPIPE" if you + do not consume all the input) +deprecated_functionality($warn_msg[, $rm_compat[, $rm_msg]]) + Emit $warn_msg as a deprecation warning, or error out if $rm_compat + is provided and equal to (or greater than) the active compat level. + The $rm_msg parameter can be used to provide a custom error message + in the latter case (if omitted, $warn_msg will be used in both cases). + The function will provide a separate diagnostic about which compat + level that will remove/removed the functionality if $rm_compat is + given. +log_installed_files($package, @paths) + Creates a logfile (in debian/.debhelper/generated) for the helper's + processing of $package, which installed the files listed in + @paths. This logfile will later be used by the dh_missing helper. + Paths should be relative to the package root (i.e. the directory + containing "debian/") and should not have superflouos segments + (e.g. avoid "foo/../bar" or "foo/./bar") + If a directory is listed, it and all paths recursively beneath is + also considered installed. +on_pkgs_in_parallel($code) - prototype: (&) + Short hand for on_items_in_parallel with $dh{DOPACKAGES} as + as list of packages. +on_items_in_parallel($item_list_ref, $code) + Splits all the items in $item_list_ref into a number of groups + based on the max parallel (as decided by DEB_BUILD_OPTIONS) + A subprocess is forked for each group (minimum 1 process will be + forked) and each subprocess will be given a group of items + to process. Each group is passed to the $code sub, which will + then process it and return normally on success. + Example: + my @all_packages = getpackages(); + on_items_in_parallel(\@all_packages, sub { + for my $package (@_) { + my $tmp=tmpdir($package); + my $pkgfile = pkgfile($package, 'foo'); + ...; + } + }); + my @work_list = compute_work_list(); + on_items_in_parallel(\@work_list, sub { + for my $item (@_) { + ...; + } + }); + + If there is an error, which should stop the build, please invoke + either "error()" or "error_exitcode". Alternatively, a trappable + error (e.g. "die($msg)") can also be used. + + Keep in mind that the sub will always be run in a subprocess, + so it cannot update global state. Sequence Addons: --------------- @@ -359,6 +449,63 @@ Remove $opt1, $opt2 etc. from the list of additional options which dh passes when running the specified $command. +Logging helpers and dh_missing: +------------------------------- + +Since debhelper 10.3, debhelper has had a helper called "dh_missing". It +takes over the "--list-missing" and "--fail-missing" options from dh_install +and as the advantage that it can "see" what other helpers have installed. + +Under the hood, this works by the helpers logging the source files +they (would) install to a hidden log file. When dh_missing is called, +it reads all these log files to determine which files have would been +installed and compare them to what is present. + +If you are writing a helper that need to integrate with dh_missing, +here is what you do: + +Dh_Lib-based helpers: +~~~~~~~~~~~~~~~~~~~~~ + + * Replace "@{$dh{DOPACKAGES}}" with "getpackages()" and use + "process_pkg($package)" to determine if the helper should actually + install anything. + * Call "log_installed_files" once per package (even once that are not to + be acted on) with a list of source files that would be installed. + - You can list entire directories even if there are files under + it that are ignored. + - Please call "log_installed_files" /even if/ the list is empty for that + packages. This enables dh_missing to see that the helper has been run + and nothing should be installed for that package. + * If your helper has a PROMISE, it must use "pkgfile-logged()" + for its config files. (See #867246) + - CAVEAT: This requires a dependency on "debhelper (>= 10.2.5)". Prior + to that version, debhelper will wrongly optimize your helper out. + * Consider using dh_installman or dh_installexamples as examples. + +Other helpers: +~~~~~~~~~~~~~~ + + * The helper must compile a list of files it would have installed for + each package (even packages that are not acted on). The file list + should be relative to the source package root (e.g. + "debian/tmp/usr/bin/bar"). + - This list can also contain directories. They will be flagged as + installed along with their content (recursively). + * The helper must append to the file (create it if missing): + debian/.debhelper/generated/${package}/installed-by-${HELPER_NAME} + - Example: debian/.debhelper/generated/lintian/installed-by-dh_install + - The file should be created even if it is empty. This enables dh_missing + to see that the helper has been run and nothing would be installed for + that package. + * Please append to the file if it exists as the helper may be called multiple + times (once with -a and once with -i). It is completely fine if this leaves + duplicate entries as dh_missing will deduplicate these. + * If your helper has a PROMISE, it must use "pkgfile-logged()" + for its config files. (See #867246) + - CAVEAT: This requires a dependency on "debhelper (>= 10.2.5)". Prior + to that version, debhelper will wrongly optimize your helper out. + Buildsystem Classes: ------------------- @@ -372,7 +519,10 @@ inside Debian::Debhelper::Buildsystem for details. Note that this interface is still subject to change. -Note that third-party buildsystems will not automatically be used by default, -but can be forced to be used via the --buildsystem parameter. +Note that third-party buildsystems will not automatically be used by +default. The package maintainer will either have to explicitly enable +it via the --buildsystem parameter OR the build system should be +registered in debhelper. The latter is currently needed to ensure a +stable and well-defined ordering of the build systems. -- Joey Hess diff -Nru debhelper-9.20160115ubuntu3/doc/SUPPORT-POLICY debhelper-11ubuntu1~16.04.york0/doc/SUPPORT-POLICY --- debhelper-9.20160115ubuntu3/doc/SUPPORT-POLICY 1970-01-01 00:00:00.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/doc/SUPPORT-POLICY 2017-11-28 12:40:27.000000000 +0000 @@ -0,0 +1,20 @@ +SUPPORT POLICY FOR DEBHELPER COMPAT LEVELS +========================================== + +The current policy for supporting compat levels is: + + * A compat level may be deprecated once the latest oldoldstable release + supports a /newer/ compat level. (E.g. compat 9 can be deprecated once + jessie becomes oldoldstable). + + * Alternatively, a compat level may be deprecated if a debhelper version + supporting a newer compat level is backported to oldoldstable-backports/ + oldoldstable-backports-sloppy and the oldest supported Ubuntu LTS release. + + * These rules are independent of whether Debian oldoldstable is still + supported. + + * Deprecated compat levels may be removed in unstable once it as been released + in Debian stable as deprecated (provided that the deprecation has been + announced at least one year prior to the freeze of said stable release). + diff -Nru debhelper-9.20160115ubuntu3/doc/TODO debhelper-11ubuntu1~16.04.york0/doc/TODO --- debhelper-9.20160115ubuntu3/doc/TODO 2015-04-16 18:24:21.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/doc/TODO 2017-07-29 18:08:38.000000000 +0000 @@ -1,28 +1,19 @@ v10: * escaping in config files (for whitespace)? -* dh_installinit --restart-after-upgrade as default? Deprecated: -* make a missing debian/compat an error. (started printing warning messages - in 20120115) -* DH_COMPAT 1, 2, 3, 4. Can be removed once all packages are seen to be using - a newer version. I won't hold my breath. (2 and 3 are getting close though.) -* dh_suidregister. Once nothing in the archive uses it. * dh_installmanpages. * dh_movefiles. I won't hold my breath. Have not added deprecation docs or message yet. -* dh_undocumented * dh_installinit --init-script (make it warn) * dh_clean -k -* dh_desktop, dh_scrollkeeper. Remove eventually.. * -s flag, not formally deprecated yet; remove eventually * -u flag; add a warning on use and remove eventually * delsubstvar() and the last parameter to addsubstvar that makes it remove a string are not used in debhelper itself, but have been left in the library in case other things use them. Deprecate and remove. -* dh --before , --after , --until , --remaining * debian/compress files * deprecate dh_gconf for dh_installgsettings (stuff should be migrating away from gconf, and then I can just remove it -- have not added warning diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/maintscript-helper debhelper-11ubuntu1~16.04.york0/lib/autoscripts/maintscript-helper --- debhelper-9.20160115ubuntu3/lib/autoscripts/maintscript-helper 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/maintscript-helper 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -dpkg-maintscript-helper #PARAMS# -- "$@" diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-emacsen debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-emacsen --- debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-emacsen 2015-05-15 16:20:39.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-emacsen 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -if [ "$1" = "configure" ] && [ -e /var/lib/emacsen-common/state/package/installed/emacsen-common -a -x /usr/lib/emacsen-common/emacs-package-install ] -then - /usr/lib/emacsen-common/emacs-package-install --postinst #PACKAGE# -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-icons debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-icons --- debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-icons 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-icons 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -if which update-icon-caches >/dev/null 2>&1 ; then - update-icon-caches #DIRLIST# -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-init debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-init --- debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-init 2016-01-19 18:54:31.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-init 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then - if [ -x "/etc/init.d/#SCRIPT#" ]; then - update-rc.d #SCRIPT# #INITPARMS# >/dev/null - fi - if [ -x "/etc/init.d/#SCRIPT#" ] || [ -e "/etc/init/#SCRIPT#.conf" ]; then - invoke-rc.d #SCRIPT# start || #ERROR_HANDLER# - fi -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-init-nostart debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-init-nostart --- debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-init-nostart 2015-11-06 21:12:04.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-init-nostart 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then - if [ -x "/etc/init.d/#SCRIPT#" ]; then - update-rc.d #SCRIPT# #INITPARMS# >/dev/null || #ERROR_HANDLER# - fi -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-init-restart debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-init-restart --- debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-init-restart 2016-01-19 18:54:31.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-init-restart 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then - if [ -x "/etc/init.d/#SCRIPT#" ]; then - update-rc.d #SCRIPT# #INITPARMS# >/dev/null - fi - if [ -x "/etc/init.d/#SCRIPT#" ] || [ -e "/etc/init/#SCRIPT#.conf" ]; then - if [ -n "$2" ]; then - _dh_action=restart - else - _dh_action=start - fi - invoke-rc.d #SCRIPT# $_dh_action || #ERROR_HANDLER# - fi -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-init-tmpfiles debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-init-tmpfiles --- debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-init-tmpfiles 2015-11-06 21:12:04.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-init-tmpfiles 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then - # In case this system is running systemd, we need to ensure that all - # necessary tmpfiles (if any) are created before starting. - if [ -d /run/systemd/system ] ; then - systemd-tmpfiles --create #TMPFILES# >/dev/null || true - fi -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-makeshlibs debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-makeshlibs --- debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-makeshlibs 2016-01-15 20:19:12.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-makeshlibs 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -if [ "$1" = "configure" ]; then - ldconfig -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-menu debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-menu --- debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-menu 2016-01-06 07:20:31.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-menu 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -if [ "$1" = "configure" ] && [ -x "`which update-menus 2>/dev/null`" ]; then - update-menus -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-menu-method debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-menu-method --- debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-menu-method 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-menu-method 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -inst=/etc/menu-methods/#PACKAGE# -if [ -f $inst ]; then - chmod a+x $inst - if [ -x "`which update-menus 2>/dev/null`" ]; then - update-menus - fi -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-modules debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-modules --- debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-modules 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-modules 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -if [ "$1" = "configure" ]; then - if [ -e /boot/System.map-#KVERS# ]; then - depmod -a -F /boot/System.map-#KVERS# #KVERS# || true - fi -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-moveconffile debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-moveconffile --- debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-moveconffile 2016-01-06 15:55:12.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-moveconffile 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -if [ "$1" = configure ]; then - if [ -e "#OLD#" ]; then - echo "Preserving user changes to #NEW# ..." - if [ -e "#NEW#" ]; then - mv -f "#NEW#" "#NEW#.dpkg-new" - fi - mv -f "#OLD#" "#NEW#" - fi -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-suid debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-suid --- debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-suid 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-suid 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -if [ "$1" = "configure" ]; then - if which suidregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; then - suidregister -s #PACKAGE# /#FILE# #OWNER# #GROUP# #PERMS# - elif [ -e /#FILE# ]; then - chown #OWNER#:#GROUP# /#FILE# - chmod #PERMS# /#FILE# - fi -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-ucf debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-ucf --- debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-ucf 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-ucf 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -if [ "$1" = "configure" ]; then - ucf "#UCFSRC#" "#UCFDEST#" - ucfr #PACKAGE# "#UCFDEST#" -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-usrlocal debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-usrlocal --- debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-usrlocal 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-usrlocal 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -if [ "$1" = configure ]; then -( - while read line; do - set -- $line - dir="$1"; mode="$2"; user="$3"; group="$4" - if [ ! -e "$dir" ]; then - if mkdir "$dir" 2>/dev/null; then - chown "$user":"$group" "$dir" - chmod "$mode" "$dir" - fi - fi - done -) << DATA -#DIRS# -DATA -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-wm debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-wm --- debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-wm 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-wm 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -if [ "$1" = "configure" ]; then - update-alternatives --install /usr/bin/x-window-manager \ - x-window-manager #WM# #PRIORITY# \ - --slave /usr/share/man/man1/x-window-manager.1.gz \ - x-window-manager.1.gz #WMMAN# -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-wm-noman debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-wm-noman --- debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-wm-noman 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-wm-noman 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -if [ "$1" = "configure" ]; then - update-alternatives --install /usr/bin/x-window-manager \ - x-window-manager #WM# #PRIORITY# -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-xfonts debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-xfonts --- debhelper-9.20160115ubuntu3/lib/autoscripts/postinst-xfonts 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postinst-xfonts 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -if which update-fonts-dir >/dev/null 2>&1; then - #CMDS# -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-debconf debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-debconf --- debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-debconf 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-debconf 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then - . /usr/share/debconf/confmodule - db_purge -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-icons debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-icons --- debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-icons 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-icons 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -if which update-icon-caches >/dev/null 2>&1 ; then - update-icon-caches #DIRLIST# -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-init debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-init --- debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-init 2015-11-26 17:02:38.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-init 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -if [ "$1" = "purge" ] ; then - update-rc.d #SCRIPT# remove >/dev/null -fi - - -# In case this system is running systemd, we make systemd reload the unit files -# to pick up changes. -if [ -d /run/systemd/system ] ; then - systemctl --system daemon-reload >/dev/null || true -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-makeshlibs debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-makeshlibs --- debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-makeshlibs 2016-01-15 20:19:12.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-makeshlibs 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -if [ "$1" = "remove" ]; then - ldconfig -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-menu debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-menu --- debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-menu 2016-01-06 07:20:31.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-menu 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus ; fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-menu-method debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-menu-method --- debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-menu-method 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-menu-method 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -inst=/etc/menu-methods/#PACKAGE# -if [ "$1" = "remove" ] && [ -f "$inst" ]; then chmod a-x $inst ; fi -if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus ; fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-modules debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-modules --- debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-modules 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-modules 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -if [ -e /boot/System.map-#KVERS# ]; then - depmod -a -F /boot/System.map-#KVERS# #KVERS# || true -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-sgmlcatalog debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-sgmlcatalog --- debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-sgmlcatalog 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-sgmlcatalog 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -if [ "$1" = "purge" ]; then - rm -f #CENTRALCAT#.old -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-suid debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-suid --- debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-suid 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-suid 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -if [ "$1" = remove ] && [ -e /etc/suid.conf ] && \ - which suidunregister >/dev/null 2>&1; then - suidunregister -s #PACKAGE# /#FILE# -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-ucf debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-ucf --- debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-ucf 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-ucf 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -if [ "$1" = "purge" ]; then - for ext in .ucf-new .ucf-old .ucf-dist ""; do - rm -f "#UCFDEST#$ext" - done - - if [ -x "`which ucf 2>/dev/null`" ]; then - ucf --purge "#UCFDEST#" - fi - if [ -x "`which ucfr 2>/dev/null`" ]; then - ucfr --purge #PACKAGE# "#UCFDEST#" - fi -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-xfonts debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-xfonts --- debhelper-9.20160115ubuntu3/lib/autoscripts/postrm-xfonts 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/postrm-xfonts 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -if [ -x "`which update-fonts-dir 2>/dev/null`" ]; then - #CMDS# -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/preinst-emacsen debhelper-11ubuntu1~16.04.york0/lib/autoscripts/preinst-emacsen --- debhelper-9.20160115ubuntu3/lib/autoscripts/preinst-emacsen 2015-05-15 16:20:39.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/preinst-emacsen 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -if ( [ "$1" = "install" ] || [ "$1" = "upgrade" ] ) \ - && [ -e /var/lib/emacsen-common/state/package/installed/emacsen-common -a -x /usr/lib/emacsen-common/emacs-package-install ] -then - /usr/lib/emacsen-common/emacs-package-install --preinst #PACKAGE# -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/preinst-moveconffile debhelper-11ubuntu1~16.04.york0/lib/autoscripts/preinst-moveconffile --- debhelper-9.20160115ubuntu3/lib/autoscripts/preinst-moveconffile 2016-01-06 15:55:12.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/preinst-moveconffile 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -if [ "$1" = install ] || [ "$1" = upgrade ]; then - if [ -e "#OLD#" ]; then - if [ "`md5sum \"#OLD#\" | sed -e \"s/ .*//\"`" = \ - "`dpkg-query -W -f='${Conffiles}' #PACKAGE# | sed -n -e \"\\\\' #OLD# '{s/ obsolete$//;s/.* //p}\"`" ] - then - rm -f "#OLD#" - fi - fi -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/preinst-sgmlcatalog debhelper-11ubuntu1~16.04.york0/lib/autoscripts/preinst-sgmlcatalog --- debhelper-9.20160115ubuntu3/lib/autoscripts/preinst-sgmlcatalog 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/preinst-sgmlcatalog 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -if test -f #CENTRALCAT# -a "(" "$1" = "upgrade" -o "$1" = "install" -a -n "$2" ")" && - ! dpkg-query -S #CENTRALCAT# >/dev/null 2>&1; then - # If the dpkg-query command returns non-zero, the central catalog is - # not owned by any package. This is due to an old behaviour of - # debhelper. Now that file becomes a conffile. In order to avoid a - # question during installation, we remove the old non-conffile. - mv #CENTRALCAT# #CENTRALCAT#.old -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/prerm-emacsen debhelper-11ubuntu1~16.04.york0/lib/autoscripts/prerm-emacsen --- debhelper-9.20160115ubuntu3/lib/autoscripts/prerm-emacsen 2015-05-15 16:20:39.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/prerm-emacsen 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -if [ -e /var/lib/emacsen-common/state/package/installed/emacsen-common -a -x /usr/lib/emacsen-common/emacs-package-remove ] ; then - /usr/lib/emacsen-common/emacs-package-remove --prerm #PACKAGE# -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/prerm-init debhelper-11ubuntu1~16.04.york0/lib/autoscripts/prerm-init --- debhelper-9.20160115ubuntu3/lib/autoscripts/prerm-init 2016-01-19 18:54:31.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/prerm-init 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -if [ -x "/etc/init.d/#SCRIPT#" ] || [ -e "/etc/init/#SCRIPT#.conf" ]; then - invoke-rc.d #SCRIPT# stop || #ERROR_HANDLER# -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/prerm-init-norestart debhelper-11ubuntu1~16.04.york0/lib/autoscripts/prerm-init-norestart --- debhelper-9.20160115ubuntu3/lib/autoscripts/prerm-init-norestart 2016-01-19 18:54:31.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/prerm-init-norestart 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -if ([ -x "/etc/init.d/#SCRIPT#" ] || [ -e "/etc/init/#SCRIPT#.conf" ]) && \ - [ "$1" = remove ]; then - invoke-rc.d #SCRIPT# stop || #ERROR_HANDLER# -fi diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/prerm-usrlocal debhelper-11ubuntu1~16.04.york0/lib/autoscripts/prerm-usrlocal --- debhelper-9.20160115ubuntu3/lib/autoscripts/prerm-usrlocal 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/prerm-usrlocal 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -( - while read dir; do - rmdir "$dir" 2>/dev/null || true - done -) << DATA -#JUSTDIRS# -DATA diff -Nru debhelper-9.20160115ubuntu3/lib/autoscripts/prerm-wm debhelper-11ubuntu1~16.04.york0/lib/autoscripts/prerm-wm --- debhelper-9.20160115ubuntu3/lib/autoscripts/prerm-wm 2014-11-16 15:43:09.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/autoscripts/prerm-wm 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -if [ "$1" = "remove" ]; then - update-alternatives --remove x-window-manager #WM# -fi diff -Nru debhelper-9.20160115ubuntu3/lib/debhelper.pod debhelper-11ubuntu1~16.04.york0/lib/debhelper.pod --- debhelper-9.20160115ubuntu3/lib/debhelper.pod 2016-01-11 19:07:51.000000000 +0000 +++ debhelper-11ubuntu1~16.04.york0/lib/debhelper.pod 1970-01-01 00:00:00.000000000 +0000 @@ -1,776 +0,0 @@ -=head1 NAME - -debhelper - the debhelper tool suite - -=head1 SYNOPSIS - -BI<*> [B<-v>] [B<-a>] [B<-i>] [B<-s>] [B<--no-act>] [B<-p>I] [B<-N>I] [B<-P>I] - -=head1 DESCRIPTION - -Debhelper is used to help you build a Debian package. The philosophy behind -debhelper is to provide a collection of small, simple, and easily -understood tools that are used in F to automate various common -aspects of building a package. This means less work for you, the packager. -It also, to some degree means that these tools can be changed if Debian -policy changes, and packages that use them will require only a rebuild to -comply with the new policy. - -A typical F file that uses debhelper will call several debhelper -commands in sequence, or use L to automate this process. Examples of -rules files that use debhelper are in F - -To create a new Debian package using debhelper, you can just copy one of -the sample rules files and edit it by hand. Or you can try the B -package, which contains a L command that partially -automates the process. For a more gentle introduction, the B Debian -package contains a tutorial about making your first package using debhelper. - -=head1 DEBHELPER COMMANDS - -Here is the list of debhelper commands you can use. See their man -pages for additional documentation. - -=over 4 - -#LIST# - -=back - -=head2 Deprecated Commands - -A few debhelper commands are deprecated and should not be used. - -=over 4 - -#LIST_DEPRECATED# - -=back - -=head2 Other Commands - -If a program's name starts with B, and the program is not on the above -lists, then it is not part of the debhelper package, but it should still -work like the other programs described on this page. - -=head1 DEBHELPER CONFIG FILES - -Many debhelper commands make use of files in F to control what they -do. Besides the common F and F, which are -in all packages, not just those using debhelper, some additional files can -be used to configure the behavior of specific debhelper commands. These -files are typically named debian/I.foo (where I of course, -is replaced with the package that is being acted on). - -For example, B uses files named F to list -the documentation files it will install. See the man pages of individual -commands for details about the names and formats of the files they use. -Generally, these files will list files to act on, one file per line. Some -programs in debhelper use pairs of files and destinations or slightly more -complicated formats. - -Note for the first (or only) binary package listed in -F, debhelper will use F when there's no -F file. - -In some rare cases, you may want to have different versions of these files -for different architectures or OSes. If files named debian/I.foo.I -or debian/I.foo.I exist, where I and I are the same as the -output of "B" / -"B", -then they will be used in preference to other, more general files. - -Mostly, these config files are used to specify lists of various types of -files. Documentation or example files to install, files to move, and so on. -When appropriate, in cases like these, you can use standard shell wildcard -characters (B and B<*> and B<[>I<..>B<]> character classes) in the files. -You can also put comments in these files; lines beginning with B<#> are -ignored. - -The syntax of these files is intentionally kept very simple to make them -easy to read, understand, and modify. If you prefer power and complexity, -you can make the file executable, and write a program that outputs -whatever content is appropriate for a given situation. When you do so, -the output is not further processed to expand wildcards or strip comments. - -=head1 SHARED DEBHELPER OPTIONS - -The following command line options are supported by all debhelper programs. - -=over 4 - -=item B<-v>, B<--verbose> - -Verbose mode: show all commands that modify the package build directory. - -=item B<--no-act> - -Do not really do anything. If used with -v, the result is that the command -will output what it would have done. - -=item B<-a>, B<--arch> - -Act on architecture dependent packages that should be built for the -build architecture. - -=item B<-i>, B<--indep> - -Act on all architecture independent packages. - -=item B<-p>I, B<--package=>I - -Act on the package named I. This option may be specified multiple -times to make debhelper operate on a given set of packages. - -=item B<-s>, B<--same-arch> - -This used to be a smarter version of the B<-a> flag, but the B<-a> flag is now -equally smart. - -=item B<-N>I, B<--no-package=>I - -Do not act on the specified package even if an B<-a>, B<-i>, or B<-p> option lists -the package as one that should be acted on. - -=item B<--remaining-packages> - -Do not act on the packages which have already been acted on by this debhelper -command earlier (i.e. if the command is present in the package debhelper log). -For example, if you need to call the command with special options only for a -couple of binary packages, pass this option to the last call of the command to -process the rest of packages with default settings. - -=item B<--ignore=>I - -Ignore the specified file. This can be used if F contains a debhelper -config file that a debhelper command should not act on. Note that -F, F, and F can't be ignored, but -then, there should never be a reason to ignore those files. - -For example, if upstream ships a F that you don't want -B to install, use B<--ignore=debian/init> - -=item B<-P>I, B<--tmpdir=>I - -Use I for package build directory. The default is debian/I - -=item B<--mainpackage=>I - -This little-used option changes the package which debhelper considers the -"main package", that is, the first one listed in F, and the -one for which F files can be used instead of the usual -F files. - -=item B<-O=>I