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

Ubuntu dpkg 1.14.5ubuntu9



This e-mail has been sent due to an upload to Ubuntu that contains Ubuntu
changes.  It contains the difference between the new version and the
previous version of the same source package in Ubuntu.
Format: 1.7
Date: Tue, 21 Aug 2007 14:12:54 +0100
Source: dpkg
Binary: dpkg dselect dpkg-dev
Architecture: source
Version: 1.14.5ubuntu9
Distribution: gutsy
Urgency: low
Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Changed-By: Ian Jackson <iwj@ubuntu.com>
Description: 
 dpkg       - package maintenance system for Debian
 dpkg-dev   - package building tools for Debian
 dselect    - user tool to manage Debian packages
Launchpad-Bugs-Fixed: 133172
Changes: 
 dpkg (1.14.5ubuntu9) gutsy; urgency=low
 .
   * Triggers: Transitional interest recording works properly regardless
     of the status of the interested package.  (LP: #133172.)
     To fix systems which have had the broken version work we have to
     rename triggers/Deferred to triggers/Unincorp.  The error
     messages, comments, etc. will be improved later.
   * Triggers: Make it possible for postinst of a package to trigger
     itself.  (Thanks to Colin Watson for relevant discussions.)
Files: 
 af7a58b73fa34fbc6083a656a152ab5a 955 admin required dpkg_1.14.5ubuntu9.dsc
 1c152f08eb3f5fae33c958437cd01dad 5836093 admin required dpkg_1.14.5ubuntu9.tar.gz
Original-Maintainer: Dpkg Developers <team@dpkg.org>
diff -pruN 1.14.5ubuntu8/debian/changelog 1.14.5ubuntu9/debian/changelog
--- 1.14.5ubuntu8/debian/changelog	2007-08-16 17:59:48.000000000 +0100
+++ 1.14.5ubuntu9/debian/changelog	2007-08-21 15:41:24.000000000 +0100
@@ -1,3 +1,15 @@
+dpkg (1.14.5ubuntu9) gutsy; urgency=low
+
+  * Triggers: Transitional interest recording works properly regardless
+    of the status of the interested package.  (LP: #133172.)
+    To fix systems which have had the broken version work we have to
+    rename triggers/Deferred to triggers/Unincorp.  The error
+    messages, comments, etc. will be improved later.
+  * Triggers: Make it possible for postinst of a package to trigger
+    itself.  (Thanks to Colin Watson for relevant discussions.)
+
+ -- Ian Jackson <iwj@ubuntu.com>  Tue, 21 Aug 2007 14:12:54 +0100
+
 dpkg (1.14.5ubuntu8) gutsy; urgency=low
 
   * Really rerun automake and autoconf this time!
diff -pruN 1.14.5ubuntu8/debian/dpkg.postinst 1.14.5ubuntu9/debian/dpkg.postinst
--- 1.14.5ubuntu8/debian/dpkg.postinst	2007-07-04 15:26:32.000000000 +0100
+++ 1.14.5ubuntu9/debian/dpkg.postinst	2007-08-21 15:21:14.000000000 +0100
@@ -165,6 +165,14 @@ case "$1" in
 
 	move_info_directory
 	remove_info_symlink
+
+	if test -f /var/lib/dpkg/triggers/Unincorp; then
+	    # Upgrade from broken trigger interest recorder
+	    #  (bugs.launchpad.net/133172).  We remove this
+	    #  old stale file:
+	    rm -f /var/lib/dpkg/triggers/Deferred
+	fi
+
 	;;
 
     abort-upgrade|abort-deconfigure|abort-remove)
diff -pruN 1.14.5ubuntu8/lib/dpkg.h 1.14.5ubuntu9/lib/dpkg.h
--- 1.14.5ubuntu8/lib/dpkg.h	2007-08-16 00:44:00.000000000 +0100
+++ 1.14.5ubuntu9/lib/dpkg.h	2007-08-21 15:23:30.000000000 +0100
@@ -94,7 +94,7 @@
 #define PARTSDIR          "parts/"
 #define TRIGGERSDIR       "triggers/"
 #define TRIGGERSFILEFILE  "File"
-#define TRIGGERSDEFERREDFILE "Deferred"
+#define TRIGGERSDEFERREDFILE "Unincorp"
 #define TRIGGERSLOCKFILE  "Lock"
 #define CONTROLDIRTMP     "tmp.ci/"
 #define IMPORTANTTMP      "tmp.i"
diff -pruN 1.14.5ubuntu8/lib/trigdeferred.l 1.14.5ubuntu9/lib/trigdeferred.l
--- 1.14.5ubuntu8/lib/trigdeferred.l	2007-08-16 16:52:53.000000000 +0100
+++ 1.14.5ubuntu9/lib/trigdeferred.l	2007-08-21 15:22:28.000000000 +0100
@@ -106,7 +106,7 @@ int trigdef_update_start(enum trigdef_up
     push_cleanup(0,0, 0,0, 0); /* dummy for pop_cleanups */
   }
 
-  constructfn(&fn,admindir,"Deferred");
+  constructfn(&fn,admindir,TRIGGERSDEFERREDFILE);
   r= stat(fn.buf,&stab);
   if (r) {
     if (errno!=ENOENT) ohshite(_("unable to stat triggers deferred file"
@@ -130,7 +130,7 @@ int trigdef_update_start(enum trigdef_up
   }
 
   if (uf & tduf_write) {
-    constructfn(&newfn,admindir,"Deferred.new");
+    constructfn(&newfn,admindir,TRIGGERSDEFERREDFILE ".new");
     if (trig_new_deferred) fclose(trig_new_deferred);
     trig_new_deferred= fopen(newfn.buf, "w");
     if (!trig_new_deferred)
diff -pruN 1.14.5ubuntu8/src/cleanup.c 1.14.5ubuntu9/src/cleanup.c
--- 1.14.5ubuntu8/src/cleanup.c	2007-08-16 00:44:00.000000000 +0100
+++ 1.14.5ubuntu9/src/cleanup.c	2007-08-21 14:51:28.000000000 +0100
@@ -107,13 +107,14 @@ static void cu_postinstdone(struct pkgin
   pkg->trigpend_head= 0;
   pkg->status= pkg->trigaw.head ? stat_triggersawaited : stat_installed;
   modstatdb_note(pkg);
+  post_postinst_tasks();
 }
 
 void cu_prermupgrade(int argc, void **argv) {
   struct pkginfo *pkg= (struct pkginfo*)argv[0];
 
   if (cleanup_pkg_failed++) return;
-  maintainer_script_installed(pkg,POSTINSTFILE,"post-installation",
+  maintainer_script_postinst(pkg,
                               "abort-upgrade",
                               versiondescribe(&pkg->available.version,
                                               vdew_nonambig),
@@ -137,7 +138,7 @@ void cu_prermdeconfigure(int argc, void 
   struct pkginfo *conflictor= (struct pkginfo*)argv[1]; /* may be 0 */
   struct pkginfo *infavour= (struct pkginfo*)argv[2];
 
-  maintainer_script_installed(deconf,POSTINSTFILE,"post-installation",
+  maintainer_script_postinst(deconf,
                               "abort-deconfigure", "in-favour", infavour->name,
                               versiondescribe(&infavour->available.version,
                                               vdew_nonambig),
@@ -154,7 +155,7 @@ void cu_prerminfavour(int argc, void **a
   struct pkginfo *infavour= (struct pkginfo*)argv[1];
 
   if (cleanup_conflictor_failed++) return;
-  maintainer_script_installed(conflictor,POSTINSTFILE,"post-installation",
+  maintainer_script_postinst(conflictor,
                               "abort-remove", "in-favour", infavour->name,
                               versiondescribe(&infavour->available.version,
                                               vdew_nonambig),
@@ -228,7 +229,7 @@ void cu_prermremove(int argc, void **arg
   struct pkginfo *pkg= (struct pkginfo*)argv[0];
 
   if (cleanup_pkg_failed++) return;
-  maintainer_script_installed(pkg,POSTINSTFILE,"post-installation",
+  maintainer_script_postinst(pkg,
                               "abort-remove", (char*)0);
   pkg->eflag &= ~eflagf_reinstreq;
   cu_postinstdone(pkg);
diff -pruN 1.14.5ubuntu8/src/configure.c 1.14.5ubuntu9/src/configure.c
--- 1.14.5ubuntu8/src/configure.c	2007-08-16 00:44:00.000000000 +0100
+++ 1.14.5ubuntu9/src/configure.c	2007-08-21 14:51:28.000000000 +0100
@@ -311,7 +311,7 @@ void deferred_configure(struct pkginfo *
 
   modstatdb_note(pkg);
 
-  if (maintainer_script_installed(pkg, POSTINSTFILE, "post-installation",
+  if (maintainer_script_postinst(pkg,
         "configure",
         informativeversion(&pkg->configversion)
         ? versiondescribe(&pkg->configversion,
@@ -323,6 +323,7 @@ void deferred_configure(struct pkginfo *
   pkg->status= pkg->trigaw.head ? stat_triggersawaited : stat_installed;
   pkg->eflag= eflagv_ok;
   modstatdb_note(pkg);
+  post_postinst_tasks();
 }
 
 
diff -pruN 1.14.5ubuntu8/src/help.c 1.14.5ubuntu9/src/help.c
--- 1.14.5ubuntu8/src/help.c	2007-08-16 00:44:00.000000000 +0100
+++ 1.14.5ubuntu9/src/help.c	2007-08-21 15:05:22.000000000 +0100
@@ -229,6 +229,9 @@ static void script_catchsignals(void) {
   onerr_abort--;
 }
 
+void post_postinst_tasks(void) {
+  trig_incorporate(msdbrw_write,admindir);
+}
 static void post_script_tasks(void) {
   ensure_diversions();
   trig_incorporate(msdbrw_write,admindir);
@@ -270,19 +273,17 @@ static int do_script(const char *pkg, co
   return r;
 }
 
-int maintainer_script_installed(struct pkginfo *pkg, const char *scriptname,
-                                const char *description, ...) {
-  /* all ...'s are const char*'s */
+static int maintainer_script_installed_corev(struct pkginfo *pkg,
+					     const char *scriptname,
+					     const char *description,
+					     va_list ap) {
   const char *scriptpath;
   char *const *arglist;
   struct stat stab;
-  va_list ap;
   char buf[100];
 
   scriptpath= pkgadminfile(pkg,scriptname);
-  va_start(ap,description);
   arglist= vbuildarglist(scriptname,ap);
-  va_end(ap);
   sprintf(buf,"%s script",description);
 
   if (stat(scriptpath,&stab)) {
@@ -293,9 +294,31 @@ int maintainer_script_installed(struct p
     ohshite(_("unable to stat installed %s script `%.250s'"),description,scriptpath);
   }
   do_script(pkg->name, scriptname, scriptpath, &stab, arglist, _("unable to execute %s"), buf, 0);
-  post_script_tasks();
   return 1;
 }
+
+int maintainer_script_installed(struct pkginfo *pkg, const char *scriptname,
+                                const char *description, ...) {
+  /* all ...'s are const char*'s */
+  int r;
+  va_list ap;
+  va_start(ap,description);
+  r= maintainer_script_installed_corev(pkg, scriptname, description, ap);
+  va_end(ap);
+  if (r) post_script_tasks();
+  return r;
+}
+  
+int maintainer_script_postinst(struct pkginfo *pkg, ...) {
+  int r;
+  va_list ap;
+  va_start(ap,pkg);
+  r= maintainer_script_installed_corev(pkg, POSTINSTFILE, "post-installation",
+				       ap);
+  va_end(ap);
+  if (r) ensure_diversions();
+  return r;
+}
   
 int maintainer_script_new(const char *pkgname,
 			  const char *scriptname, const char *description,
diff -pruN 1.14.5ubuntu8/src/main.h 1.14.5ubuntu9/src/main.h
--- 1.14.5ubuntu8/src/main.h	2007-08-16 00:44:00.000000000 +0100
+++ 1.14.5ubuntu9/src/main.h	2007-08-21 14:51:28.000000000 +0100
@@ -217,6 +217,14 @@ int maintainer_script_alternative(struct
                                   const char *scriptname, const char *description,
                                   const char *cidir, char *cidirrest,
                                   const char *ifok, const char *iffallback);
+
+int maintainer_script_postinst(struct pkginfo *pkg, ...);
+void post_postinst_tasks(void);
+  /* Callers wanting to run the postinst use these two as they want to
+   * postpone trigger incorporation until after updating the package
+   * status.  The effect is that a package can trigger itself.
+   */
+
 void clear_istobes(void);
 int isdirectoryinuse(struct filenamenode *namenode, struct pkginfo *pkg);
 int hasdirectoryconffiles(struct filenamenode *namenode, struct pkginfo *pkg);
diff -pruN 1.14.5ubuntu8/src/trigproc.c 1.14.5ubuntu9/src/trigproc.c
--- 1.14.5ubuntu8/src/trigproc.c	2007-08-16 00:44:00.000000000 +0100
+++ 1.14.5ubuntu9/src/trigproc.c	2007-08-21 15:31:18.000000000 +0100
@@ -247,7 +247,7 @@ void trigproc(struct pkginfo *pkg) {
     modstatdb_note(pkg);
 
     sincenothing= 0;
-    maintainer_script_installed(pkg, POSTINSTFILE, "post-installation",
+    maintainer_script_postinst(pkg,
 				"triggered", namesarg.buf+1, (char*)0);
 
     /* this is to cope if the package triggers itself: */
@@ -257,6 +257,8 @@ void trigproc(struct pkginfo *pkg) {
       stat_installed;
     
     modstatdb_note(pkg);
+    post_postinst_tasks();
+
   } else {
     trig_clear_awaiters(pkg); /* in other branch is done by modstatdb_note */
   }
@@ -266,7 +268,8 @@ void trigproc(struct pkginfo *pkg) {
 
 static void transitional_interest_callback_ro(const char *trig, void *user) {
   struct pkginfo *pend= user;
-  trig_note_pend(pend,nfstrsave(trig));
+  if (pend->status >= stat_triggersawaited)
+    trig_note_pend(pend,nfstrsave(trig));
 }
   
 static void transitional_interest_callback(const char *trig, void *user) {
@@ -286,7 +289,7 @@ static void trig_transitional_activate(e
   it= iterpkgstart();
 
   while ((pkg= iterpkgnext(it))) {
-    if (pkg->status <= stat_triggerspending)
+    if (pkg->status <= stat_halfinstalled)
       continue;
     pkg->trigpend_head= 0;
     trig_parse_ci(pkgadminfile(pkg,TRIGGERSCIFILE),

Reply to: