[debhelper-devel] [debhelper] 01/01: meson.pm: Keep cross file until dh_clean time

Niels Thykier nthykier at moszumanska.debian.org
Tue Oct 24 05:50:13 UTC 2017


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

nthykier pushed a commit to branch master
in repository debhelper.

commit fecce6a68ad2b8ca21d29dcb2974e208ac6a7f28
Author: Niels Thykier <niels at thykier.net>
Date:   Tue Oct 24 05:48:54 2017 +0000

    meson.pm: Keep cross file until dh_clean time
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 debian/changelog                          | 9 +++++++++
 lib/Debian/Debhelper/Buildsystem/meson.pm | 4 +---
 lib/Debian/Debhelper/Dh_Lib.pm            | 3 +++
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 804d571..c17641a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+debhelper (10.10.4) UNRELEASED; 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)
+
+ -- Niels Thykier <niels at thykier.net>  Tue, 24 Oct 2017 05:45:09 +0000
+
 debhelper (10.10.3) unstable; urgency=medium
 
   * dh_strip: Skip the entire directory when an exclude rule
diff --git a/lib/Debian/Debhelper/Buildsystem/meson.pm b/lib/Debian/Debhelper/Buildsystem/meson.pm
index e3b6dd4..252b4e5 100644
--- a/lib/Debian/Debhelper/Buildsystem/meson.pm
+++ b/lib/Debian/Debhelper/Buildsystem/meson.pm
@@ -7,7 +7,6 @@ package Debian::Debhelper::Buildsystem::meson;
 
 use strict;
 use warnings;
-use File::Temp qw(tempfile);
 use Debian::Debhelper::Dh_Lib qw(dpkg_architecture_value is_cross_compiling doit warning error);
 use parent qw(Debian::Debhelper::Buildsystem::ninja);
 
@@ -57,8 +56,7 @@ sub configure {
 				warning("Missing debcrossgen (${debcrossgen}) cannot generate a meson cross file and non was provided");
 				error("Cannot cross-compile: Please use meson (>= 0.42.1) or provide a cross file via DH_MESON_CROSS_FILE");
 			}
-			my ($fh, $filename) = tempfile("meson-cross-file.XXXX", SUFFIX => ".conf", TMPDIR => 1, UNLINK => 1);
-			close($fh);
+			my $filename = generated_file('_source', 'meason-cross-file.conf');
 			doit({ stdout => '/dev/null' }, $debcrossgen, "-o${filename}");
 			$cross_file = $filename;
 		}
diff --git a/lib/Debian/Debhelper/Dh_Lib.pm b/lib/Debian/Debhelper/Dh_Lib.pm
index 97f2eae..2ee29c1 100644
--- a/lib/Debian/Debhelper/Dh_Lib.pm
+++ b/lib/Debian/Debhelper/Dh_Lib.pm
@@ -1029,6 +1029,9 @@ sub autoscript_sed {
 }
 
 # Generated files are cleaned by dh_clean AND dh_prep
+# - Package can be set to "_source" to generate a file relevant
+#   for the source package (the meson build does this atm.).
+#   Files for "_source" are only cleaned by dh_clean.
 sub generated_file {
 	my ($package, $filename, $mkdirs) = @_;
 	my $dir = "debian/.debhelper/generated/${package}";

-- 
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