[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Review of pu/multiarch/master



Hi,

On Mon, 28 Nov 2011, Guillem Jover wrote:
> Thanks, I've done a quick scan, merged some, and fixed others in some
> other way. I've been since the 23rd on a trip, but will be back
> tomorrow, when I'll handle the rest of the issues you found, the
> remaning interface changes, and will send a status mail.

I saw you merged fixes for almost everything but your fix for the trigger
part is not complete enough. I pushed again a new patch in
pu/multiarch/for-guillem (it's also attached).

The fact that the pkgbin pointer is stored in the filetriggers list is a
bit unsatisfactory as it might become stale when the package is installed
(i.e. it should in theory be updated to point to the installed pkgbin
instead of the available one). Though in practice the cases where the
pkgbin for available will be updated to something else in the same dpkg
run are close to zero.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Pre-order a copy of the Debian Administrator's Handbook and help
liberate it: http://debian-handbook.info/liberation/
commit 75a5fdf21da8b911c19896a4153441688eae5180
Author: Raphaël Hertzog <hertzog@debian.org>
Date:   Fri Dec 2 12:41:13 2011 +0100

    fixup! Update triggers support to understand multi-arch
    
    Passing pkgbin is not enough, one must also make use of it...

diff --git a/lib/dpkg/triglib.c b/lib/dpkg/triglib.c
index 0b5da83..c57d03b 100644
--- a/lib/dpkg/triglib.c
+++ b/lib/dpkg/triglib.c
@@ -339,7 +339,7 @@ trk_explicit_interest_change(const char *trig,  struct pkginfo *pkg,
 		if (slash)
 			*slash = '\0';
 		pkg_spec_parse(&pkgspec, name);
-		match = pkg_spec_match_pkg(&pkgspec, pkg, &pkg->installed);
+		match = pkg_spec_match_pkg(&pkgspec, pkg, pkgbin);
 		pkg_spec_destroy(&pkgspec);
 		free(name);
 
@@ -350,7 +350,7 @@ trk_explicit_interest_change(const char *trig,  struct pkginfo *pkg,
 
 	}
 	if (signum > 0) {
-		fprintf(file->fp, "%s%s\n", pkg_name(pkg, pno_nonambig),
+		fprintf(file->fp, "%s%s\n", pkgbin_name(pkg, pkgbin, pno_nonambig),
 		        (opts == trig_noawait) ? "/noawait" : "");
 		empty = false;
 	}
@@ -422,6 +422,7 @@ trk_file_interest_change(const char *trig, struct pkginfo *pkg,
 
 	tfi = nfmalloc(sizeof(*tfi));
 	tfi->pkg = pkg;
+	tfi->pkgbin = pkgbin;
 	tfi->fnn = fnn;
 	tfi->options = opts;
 	tfi->samefile_next = *trigh.namenode_interested(fnn);
@@ -435,7 +436,7 @@ found:
 	if (signum > 1)
 		ohshit(_("duplicate file trigger interest for filename `%.250s' "
 		         "and package `%.250s'"), trig,
-		       pkg_name(pkg, pno_nonambig));
+		       pkgbin_name(pkg, pkgbin, pno_nonambig));
 	if (signum > 0)
 		return;
 
@@ -463,7 +464,7 @@ trig_file_interests_update(void)
 
 	for (tfi = filetriggers.head; tfi; tfi = tfi->inoverall.next)
 		fprintf(file->fp, "%s %s%s\n", trigh.namenode_name(tfi->fnn),
-		        pkg_name(tfi->pkg, pno_nonambig),
+		        pkgbin_name(tfi->pkg, tfi->pkgbin, pno_nonambig),
 		        (tfi->options == trig_noawait) ? "/noawait" : "");
 
 	atomic_file_sync(file);
diff --git a/lib/dpkg/triglib.h b/lib/dpkg/triglib.h
index d816a37..a1c25ff 100644
--- a/lib/dpkg/triglib.h
+++ b/lib/dpkg/triglib.h
@@ -45,6 +45,7 @@ enum trig_options {
 
 struct trigfileint {
 	struct pkginfo *pkg;
+	struct pkgbin *pkgbin;
 	struct filenamenode *fnn;
 	enum trig_options options;
 	struct trigfileint *samefile_next;

Reply to: