File: reproducible-output.patch

package info (click to toggle)
libmodule-build-withxspp-perl 0.14-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 144 kB
  • ctags: 38
  • sloc: perl: 376; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 1,473 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Description: Make output reproducible.
 The call to Cwd::abs_path introduces the build directory into
 target. The patch changes this to use the path relative to the build directory.
 (For background and details cf. the Debian bug below.)
Origin: vendor
Bug-Debian: https://bugs.debian.org/835447
Author: Chris Lamb <lamby@debian.org>
Reviewed-by: gregor herrmann <gregoa@debian.org>
Last-Update: 2016-08-26
Forwarded: https://rt.cpan.org/Ticket/Display.html?id=117252
Bug: https://rt.cpan.org/Ticket/Display.html?id=117252

--- a/lib/Module/Build/WithXSpp.pm
+++ b/lib/Module/Build/WithXSpp.pm
@@ -2,6 +2,7 @@
 use strict;
 use warnings;
 
+use File::Spec;
 use Module::Build;
 use ExtUtils::CppGuess ();
 
@@ -228,11 +229,11 @@
 HERE
 
   my $typemap_args = '';
-  $typemap_args .= '-t "' . _naive_shell_escape(Cwd::abs_path($_)) . '" ' foreach keys %$xspt_files;
+  $typemap_args .= '-t "' . _naive_shell_escape(File::Spec->abs2rel($_, $self->build_dir)) . '" ' foreach keys %$xspt_files;
 
   foreach my $xsp_file (keys %$xsp_files) {
-    my $full_path_file = _naive_shell_escape( Cwd::abs_path($xsp_file) );
-    my $cmd = qq{INCLUDE_COMMAND: \$^X -MExtUtils::XSpp::Cmd -e xspp -- $typemap_args "$full_path_file"\n\n};
+    my $relative_path_file = _naive_shell_escape( File::Spec->abs2rel($xsp_file, $self->build_dir) );
+    my $cmd = qq{INCLUDE_COMMAND: \$^X -MExtUtils::XSpp::Cmd -e xspp -- $typemap_args "$relative_path_file"\n\n};
     $xs_code .= $cmd;
   }