[Reproducible-commits] [dpkg] 15/63: u-a: Move check for new slave inside alternative_evolve_slave()

Jérémy Bobbio lunar at moszumanska.debian.org
Fri Mar 4 17:44:42 UTC 2016


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

lunar pushed a commit to branch pu/buildinfo
in repository dpkg.

commit f52a476c69716bd7f94a6c0c1bc83e6f4795c016
Author: Guillem Jover <guillem at debian.org>
Date:   Mon Feb 22 19:17:38 2016 +0100

    u-a: Move check for new slave inside alternative_evolve_slave()
    
    Let's move all the logic concerning checking if the slave link needs to
    be updated local to the function that was doing so.
---
 utils/update-alternatives.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/utils/update-alternatives.c b/utils/update-alternatives.c
index 76f4671..77f93b3 100644
--- a/utils/update-alternatives.c
+++ b/utils/update-alternatives.c
@@ -2153,6 +2153,11 @@ alternative_evolve_slave(struct alternative *a, const char *cur_choice,
 	char *new_file = NULL;
 	const char *old, *new;
 
+	if (!alternative_has_slave(a, sl->name)) {
+		sl->updated = true;
+		return;
+	}
+
 	old = alternative_get_slave(a, sl->name)->link;
 	new = sl->link;
 
@@ -2208,11 +2213,7 @@ alternative_evolve(struct alternative *a, struct alternative *b,
 	/* Check if new slaves have been added, or existing
 	 * ones renamed. */
 	for (sl = b->slaves; sl; sl = sl->next) {
-		if (alternative_has_slave(a, sl->name))
-			alternative_evolve_slave(a, cur_choice, sl, fs);
-		else
-			sl->updated = true;
-
+		alternative_evolve_slave(a, cur_choice, sl, fs);
 		alternative_copy_slave(a, sl);
 	}
 }

-- 
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