Bug#801398: [Patch] Replace Dpkg::IPC::spawn with IPC::Run::run

Sandro Mani manisandro at gmail.com
Fri Oct 9 15:22:16 UTC 2015


Package: devscripts
Version: 2.15.9

Some time back licensecheck grew a dependency on Dpkg::IPC [1], which on 
Fedora causes the "devscripts-minimal" package (which includes 
licensecheck) to pull in dpkg. I'd like to propose the patch below to 
reduce the dependency load:


diff -rupN devscripts-2.15.9/scripts/licensecheck.pl 
devscripts-2.15.9-new/scripts/licensecheck.pl
--- devscripts-2.15.9/scripts/licensecheck.pl    2015-10-06 
03:00:34.000000000 +0200
+++ devscripts-2.15.9-new/scripts/licensecheck.pl    2015-10-09 
12:51:12.425215534 +0200
@@ -157,7 +157,7 @@ use warnings;
  use warnings    qw< FATAL  utf8     >;
  use Encode qw/decode/;

-use Dpkg::IPC qw(spawn);
+use IPC::Run qw(run);
  use Getopt::Long qw(:config gnu_getopt);
  use File::Basename;

@@ -337,11 +337,7 @@ while (@files) {

      # Encode::Guess does not work well, use good old file command to 
get file encoding
      my $mime;
-    spawn(exec => ['file', '--brief', '--mime', '--dereference', '--', 
$file],
-          to_string => \$mime,
-          error_to_file => '/dev/null',
-          nocheck => 1,
-          wait_child => 1);
+    run [qw(file --brief --mime --dereference), $file], \undef, \$mime;
      my $charset ;
      if ($mime =~ m/; charset=((?!binary)(?!unknown)[\w-]+)/) {
      $charset = $1;



[1] 
https://github.com/Debian/devscripts/commit/c0687bcde23108dd42e146573c368b6905e6b8e8



More information about the devscripts-devel mailing list