[debhelper-devel] [debhelper] 02/02: dh_makeshlibs: Fix --no-act

Niels Thykier nthykier at moszumanska.debian.org
Mon Jan 22 07:21:50 UTC 2018


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

nthykier pushed a commit to branch master
in repository debhelper.

commit 7b0fadbc6cc9f938116b2da5ed0e440edaeb49e4
Author: Niels Thykier <niels at thykier.net>
Date:   Mon Jan 22 07:19:23 2018 +0000

    dh_makeshlibs: Fix --no-act
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 debian/changelog |  2 ++
 dh_makeshlibs    | 10 ++++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index d64f460..1a628fa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
 debhelper (11.1.4) UNRELEASED; urgency=medium
 
   * qmake.pm/qmake4.pm: Avoid global state in the build systems.
+  * dh_makeshlibs: Fix --no-act, which could still cause writes
+    to the shlibs file.  Thanks to Sven Joachim for reporting it.
 
  -- Niels Thykier <niels at thykier.net>  Sun, 21 Jan 2018 08:18:20 +0000
 
diff --git a/dh_makeshlibs b/dh_makeshlibs
index 682ca87..55761ea 100755
--- a/dh_makeshlibs
+++ b/dh_makeshlibs
@@ -242,10 +242,12 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 			verbose_print('echo ' . escape_shell($_) . ' >> ' . escape_shell("$tmp/DEBIAN/shlibs"))
 				for @deb_lines, @udeb_lines;
 		}
-		open(my $shlibs_fd, '>', "$tmp/DEBIAN/shlibs") or error("open($tmp/DEBIAN/shlibs): $!");
-		# Write the shlibs file with the udeb: lines last.
-		print {$shlibs_fd} "$_\n" for @deb_lines, @udeb_lines;
-		close($shlibs_fd) or error("close($tmp/DEBIAN/shlibs");
+		if (not $dh{NO_ACT}) {
+			open(my $shlibs_fd, '>', "$tmp/DEBIAN/shlibs") or error("open($tmp/DEBIAN/shlibs): $!");
+			# Write the shlibs file with the udeb: lines last.
+			print {$shlibs_fd} "$_\n" for @deb_lines, @udeb_lines;
+			close($shlibs_fd) or error("close($tmp/DEBIAN/shlibs");
+		}
 	}
 
 	if (-e "$tmp/DEBIAN/shlibs") {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git




More information about the debhelper-devel mailing list