[Reproducible-commits] [dpkg] 07/54: dpkg-divert: Return from a command function instead of directly exiting

Mattia Rizzolo mattia at debian.org
Fri Jan 15 18:53:58 UTC 2016


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

mattia pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit 97a8d2695cad465a6c9d0f4469644a8ba6f778d0
Author: Guillem Jover <guillem at debian.org>
Date:   Wed Oct 21 16:52:56 2015 +0200

    dpkg-divert: Return from a command function instead of directly exiting
    
    This makes it possible to perform any necessary normal cleanup before
    exiting, and unifies the usage with all other command functions.
---
 debian/changelog | 2 ++
 src/divertcmd.c  | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index b1e5403..b335c7c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,8 @@ dpkg (1.18.4) UNRELEASED; urgency=low
   * Fix memory leaks in «dpkg --verify» and dpkg infodb format upgrade logic.
   * Merge all update-alternatives action handling into a single if-else-if
     block, to unify the code an allow a future switch into a shared library.
+  * Perform any necessary cleanups on normal exit from dpkg-divert --add and
+    --remove commands.
   * Build system:
     - Set PERL5LIB globally for the test suite to the local modules directory,
       to avoid using the system modules. Regression introduced in dpkg 1.17.8.
diff --git a/src/divertcmd.c b/src/divertcmd.c
index b2ca8ce..7431884 100644
--- a/src/divertcmd.c
+++ b/src/divertcmd.c
@@ -464,7 +464,7 @@ diversion_add(const char *const *argv)
 			if (opt_verbose > 0)
 				printf(_("Leaving '%s'\n"),
 				       diversion_describe(fnn_from->divert));
-			exit(0);
+			return 0;
 		}
 
 		ohshit(_("'%s' clashes with '%s'"),
@@ -595,7 +595,7 @@ diversion_remove(const char *const *argv)
 		if (opt_verbose > 0)
 			printf(_("Ignoring request to remove shared diversion '%s'.\n"),
 			       diversion_describe(contest));
-		exit(0);
+		return 0;
 	}
 
 	if (opt_verbose > 0)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list