Просмотр исходного кода

Dpkg::Source::Package: Check subprocess exit codes

Make sure to error out if one of the subprocesses exits with an error.

Spotted-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Guillem Jover лет назад: 13
Родитель
Сommit
7bae2d7d93
3 измененных файлов с 5 добавлено и 0 удалено
  1. 2 0
      debian/changelog
  2. 1 0
      scripts/Dpkg/Source/Package/V2.pm
  3. 2 0
      scripts/Dpkg/Source/Package/V3/Bzr.pm

+ 2 - 0
debian/changelog

@@ -65,6 +65,8 @@ dpkg (1.17.2) UNRELEASED; urgency=low
     instead of 1. This significantly reduces dpkg memory usage.
   * Honor new DEB_SIGN_KEYID environment variable in dpkg-buildpackage.
     Suggested by Harald Dunkel <harri@afaics.de>. Closes: #615813, #719418
+  * Always check subprocess exit codes in Dpkg::Source::Package modules.
+    Reported by Ian Jackson <ijackson@chiark.greenend.org.uk>.
 
   [ Updated programs translations ]
   * German (Sven Joachim).

+ 1 - 0
scripts/Dpkg/Source/Package/V2.pm

@@ -659,6 +659,7 @@ sub do_commit {
     mkpath(File::Spec->catdir($dir, 'debian', 'patches'));
     my $patch = $self->register_patch($dir, $tmpdiff, $patch_name);
     system('sensible-editor', $patch);
+    subprocerr('sensible-editor') if $?;
     unlink($tmpdiff) || syserr(_g('cannot remove %s'), $tmpdiff);
     pop @Dpkg::Exit::handlers;
     info(_g('local changes have been recorded in a new patch: %s'), $patch);

+ 2 - 0
scripts/Dpkg/Source/Package/V3/Bzr.pm

@@ -145,6 +145,7 @@ sub do_build {
 
     # Remove the working tree.
     system('bzr', 'remove-tree', $tardir);
+    subprocerr("bzr remove-tree $tardir") if $?;
 
     # Some branch metadata files are unhelpful.
     unlink("$tardir/.bzr/branch/branch-name",
@@ -202,6 +203,7 @@ sub do_extract {
 
     # Reconstitute the working tree.
     system('bzr', 'checkout');
+    subprocerr('bzr checkout') if $?;
 
     chdir($old_cwd) ||
             syserr(_g("unable to chdir to `%s'"), $old_cwd);