[devscripts] 01/01: mk-build-deps: Rollback package install if apt can't complete it.
James McCoy
jamessan at debian.org
Thu Apr 3 01:42:29 UTC 2014
This is an automated email from the git hooks/post-receive script.
jamessan pushed a commit to branch master
in repository devscripts.
commit b8d42bb9d0a1ede56a71b5135b6ec55fb8326961
Author: James McCoy <vega.james at gmail.com>
Date: Wed Apr 2 21:40:24 2014 -0400
mk-build-deps: Rollback package install if apt can't complete it.
Closes: #743462
Signed-off-by: James McCoy <vega.james at gmail.com>
---
debian/changelog | 2 ++
scripts/mk-build-deps.pl | 7 ++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index 5ba06b3..0c06d09 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,8 @@ devscripts (2.14.2) UNRELEASED; urgency=medium
[ James McCoy ]
* debcommit: Add hg and bzr support to DEBCOMMIT_SIGN_COMMITS.
+ * mk-build-deps: Uninstall the build-dep packages if apt isn't able to
+ complete their install. (Closes: #743462)
[ Andreas Tille ]
* uscan: Allow a different compression scheme when repacking upstream
diff --git a/scripts/mk-build-deps.pl b/scripts/mk-build-deps.pl
index 8879783..c8ac00c 100755
--- a/scripts/mk-build-deps.pl
+++ b/scripts/mk-build-deps.pl
@@ -354,7 +354,12 @@ if ($opt_install) {
system @root, 'dpkg', '--unpack', @deb_files;
die("dpkg call failed\n") if ( ($?>>8) != 0 );
system @root, shellwords($install_tool), '-f', 'install';
- die("install call failed\n") if ( ($?>>8) != 0 );
+ if ( ($?>>8) != 0 ) {
+ # Restore system to previous state, since apt wasn't able to resolve a
+ # proper way to get the build-dep packages installed
+ system @root, 'dpkg', '--remove', @deb_files;
+ die("install call failed\n");
+ }
if ($opt_remove) {
foreach my $file (@deb_files) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git
More information about the devscripts-devel
mailing list