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

Ubuntu dpkg 1.14.5ubuntu13



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, 18 Sep 2007 14:13:07 +0100
Source: dpkg
Binary: dpkg dselect dpkg-dev
Architecture: source
Version: 1.14.5ubuntu13
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
Changes: 
 dpkg (1.14.5ubuntu13) gutsy; urgency=low
 .
   * Changes to --status-fd and logging, motivated by the need to
     fix apt's progress reporting in the presence of triggers:
     - Call log_action for trigger processing and configuration.
     - Produce "processing:" output on --status-fd for start of
       processing operations (from log_action).
     - Consolidate clone-and-hack --status-fd output writing into
       routine statusfd_send[v].
     - Improve documentation of --status-fd output.
     - Add log message at start of archivefiles() and packages()
       (which will assist debugging).
     - For upgrade, call log_message after printing to stderr,
       as is done elsewhere.
     In the longer term --status-fd output ought probably to be made
     identical to the log output which is richer and more sanely
     formatted.
 .
 dpkg (1.14.5ubuntu12) gutsy; urgency=low
 .
   * Rerun autoconf so that version (as in DPKG_RUNNING_VERSION)
     is 1.14.5ubuntu12.  This is needed for proper detection
     of trigger capability by eg the ldconfig wrapper.
 .
 dpkg (1.14.5ubuntu11) gutsy; urgency=low
 .
   * Breaks: enable Breaks processing in depisok
     (Patch from Debian, buried in git 864201).
 .
 dpkg (1.14.5ubuntu10) gutsy; urgency=low
 .
   Triggers improvements:
   * Fix bug where diversions and triggers incorporated only on normal
     error unwind from do_script (rather than on abnormal unwind).  The
     effect of the bug was to temporarily disregard diversion changes made
     by failing maintscripts and to erroneously suppress reflexive trigger
     activations.
   * Trigger cycle detection works properly: does not record details of
     irrelevant packages, and prints error messages correctly and without
     referencing uninitialised tcn->next.
   * Provide DPKG_RUNNING_VERSION environment variable so that maintscripts
     can know what features are going to work - in this case, whether
     reflexive trigger activation will be honoured.
   * New debugging flags and corresponding debug statements.
Files: 
 3e914fbca789dc6558791daf340e0fb3 957 admin required dpkg_1.14.5ubuntu13.dsc
 55e1482670a6e3abe7c763fd68c80114 5838897 admin required dpkg_1.14.5ubuntu13.tar.gz
Original-Maintainer: Dpkg Developers <team@dpkg.org>
diff -pruN 1.14.5ubuntu9/configure 1.14.5ubuntu13/configure
--- 1.14.5ubuntu9/configure	2007-08-16 17:59:57.000000000 +0100
+++ 1.14.5ubuntu13/configure	2007-09-06 16:55:11.000000000 +0100
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for dpkg 1.14.5.
+# Generated by GNU Autoconf 2.61 for dpkg 1.14.5ubuntu12.
 #
 # Report bugs to <debian-dpkg@lists.debian.org>.
 #
@@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='dpkg'
 PACKAGE_TARNAME='dpkg'
-PACKAGE_VERSION='1.14.5'
-PACKAGE_STRING='dpkg 1.14.5'
+PACKAGE_VERSION='1.14.5ubuntu12'
+PACKAGE_STRING='dpkg 1.14.5ubuntu12'
 PACKAGE_BUGREPORT='debian-dpkg@lists.debian.org'
 
 ac_unique_file="lib/dpkg.h"
@@ -1290,7 +1290,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures dpkg 1.14.5 to adapt to many kinds of systems.
+\`configure' configures dpkg 1.14.5ubuntu12 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1361,7 +1361,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of dpkg 1.14.5:";;
+     short | recursive ) echo "Configuration of dpkg 1.14.5ubuntu12:";;
    esac
   cat <<\_ACEOF
 
@@ -1485,7 +1485,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-dpkg configure 1.14.5
+dpkg configure 1.14.5ubuntu12
 generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1499,7 +1499,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by dpkg $as_me 1.14.5, which was
+It was created by dpkg $as_me 1.14.5ubuntu12, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
@@ -2361,7 +2361,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='dpkg'
- VERSION='1.14.5'
+ VERSION='1.14.5ubuntu12'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -18383,7 +18383,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by dpkg $as_me 1.14.5, which was
+This file was extended by dpkg $as_me 1.14.5ubuntu12, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -18436,7 +18436,7 @@ Report bugs to <bug-autoconf@gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-dpkg config.status 1.14.5
+dpkg config.status 1.14.5ubuntu12
 configured by $0, generated by GNU Autoconf 2.61,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
diff -pruN 1.14.5ubuntu9/configure.ac 1.14.5ubuntu13/configure.ac
--- 1.14.5ubuntu9/configure.ac	2007-08-16 00:43:59.000000000 +0100
+++ 1.14.5ubuntu13/configure.ac	2007-09-06 16:54:56.000000000 +0100
@@ -1,7 +1,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.59)
-AC_INIT([dpkg], [1.14.5], [debian-dpkg@lists.debian.org])
+AC_INIT([dpkg], [1.14.5ubuntu12], [debian-dpkg@lists.debian.org])
 AC_CONFIG_SRCDIR([lib/dpkg.h])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_AUX_DIR([config])
diff -pruN 1.14.5ubuntu9/debian/changelog 1.14.5ubuntu13/debian/changelog
--- 1.14.5ubuntu9/debian/changelog	2007-08-21 15:41:24.000000000 +0100
+++ 1.14.5ubuntu13/debian/changelog	2007-09-18 14:13:14.000000000 +0100
@@ -1,3 +1,56 @@
+dpkg (1.14.5ubuntu13) gutsy; urgency=low
+
+  * Changes to --status-fd and logging, motivated by the need to
+    fix apt's progress reporting in the presence of triggers:
+    - Call log_action for trigger processing and configuration.
+    - Produce "processing:" output on --status-fd for start of
+      processing operations (from log_action).
+    - Consolidate clone-and-hack --status-fd output writing into
+      routine statusfd_send[v].
+    - Improve documentation of --status-fd output.
+    - Add log message at start of archivefiles() and packages()
+      (which will assist debugging).
+    - For upgrade, call log_message after printing to stderr,
+      as is done elsewhere.
+    In the longer term --status-fd output ought probably to be made
+    identical to the log output which is richer and more sanely
+    formatted.
+  
+ -- Ian Jackson <iwj@ubuntu.com>  Tue, 18 Sep 2007 14:13:07 +0100
+
+dpkg (1.14.5ubuntu12) gutsy; urgency=low
+
+  * Rerun autoconf so that version (as in DPKG_RUNNING_VERSION)
+    is 1.14.5ubuntu12.  This is needed for proper detection
+    of trigger capability by eg the ldconfig wrapper.
+
+ -- Ian Jackson <iwj@ubuntu.com>  Thu, 06 Sep 2007 16:54:44 +0100
+
+dpkg (1.14.5ubuntu11) gutsy; urgency=low
+
+  * Breaks: enable Breaks processing in depisok
+    (Patch from Debian, buried in git 864201).
+
+ -- Ian Jackson <iwj@ubuntu.com>  Wed, 29 Aug 2007 15:10:50 +0100
+
+dpkg (1.14.5ubuntu10) gutsy; urgency=low
+  
+  Triggers improvements:
+  * Fix bug where diversions and triggers incorporated only on normal
+    error unwind from do_script (rather than on abnormal unwind).  The
+    effect of the bug was to temporarily disregard diversion changes made
+    by failing maintscripts and to erroneously suppress reflexive trigger
+    activations.
+  * Trigger cycle detection works properly: does not record details of
+    irrelevant packages, and prints error messages correctly and without
+    referencing uninitialised tcn->next.
+  * Provide DPKG_RUNNING_VERSION environment variable so that maintscripts
+    can know what features are going to work - in this case, whether
+    reflexive trigger activation will be honoured.
+  * New debugging flags and corresponding debug statements.
+  
+ -- Ian Jackson <iwj@ubuntu.com>  Fri, 24 Aug 2007 16:38:01 +0100
+
 dpkg (1.14.5ubuntu9) gutsy; urgency=low
 
   * Triggers: Transitional interest recording works properly regardless
diff -pruN 1.14.5ubuntu9/lib/dbmodify.c 1.14.5ubuntu13/lib/dbmodify.c
--- 1.14.5ubuntu9/lib/dbmodify.c	2007-08-16 00:44:00.000000000 +0100
+++ 1.14.5ubuntu13/lib/dbmodify.c	2007-09-18 12:10:32.000000000 +0100
@@ -268,23 +268,9 @@ void modstatdb_note(struct pkginfo *pkg)
     pkg->trigaw.head= pkg->trigaw.tail= 0;
   }
 
-  if (status_pipes) {
-    static struct varbuf *status= NULL;
-    struct pipef *pipef= status_pipes;
-    int r;
-    if (status == NULL) {
-      status = nfmalloc(sizeof(struct varbuf));
-      varbufinit(status);
-    } else
-      varbufreset(status);
-    r= varbufprintf(status, "status: %s: %s\n", pkg->name, statusinfos[pkg->status].name);
-    while (pipef) {
-      write(pipef->fd, status->buf, r);
-      pipef= pipef->next;
-    }
-  }
   log_message("status %s %s %s", statusinfos[pkg->status].name, pkg->name,
 	      versiondescribe(&pkg->installed.version, vdew_nonambig));
+  statusfd_send("status: %s: %s", pkg->name, statusinfos[pkg->status].name);
 
   varbufreset(&uvb);
   varbufrecord(&uvb, pkg, &pkg->installed);
diff -pruN 1.14.5ubuntu9/lib/dpkg.h 1.14.5ubuntu13/lib/dpkg.h
--- 1.14.5ubuntu9/lib/dpkg.h	2007-08-21 15:23:30.000000000 +0100
+++ 1.14.5ubuntu13/lib/dpkg.h	2007-09-18 12:13:17.000000000 +0100
@@ -104,6 +104,7 @@
 #define MAXUPDATES         250
 
 #define MAINTSCRIPTPKGENVVAR "DPKG_MAINTSCRIPT_PACKAGE"
+#define MAINTSCRIPTDPKGENVVAR "DPKG_RUNNING_VERSION"
 
 #define LOCALLIBDIR         "/usr/local/lib/dpkg"
 #define METHODSDIR          "methods"
@@ -227,6 +228,9 @@ void badusage(const char *fmt, ...) NONR
 void werr(const char *what) NONRETURNING;
 void warningf(const char *fmt, ...);
 
+void statusfd_sendv(const char *fmt, va_list al);
+void statusfd_send(const char *fmt, ...);
+
 void cu_closepipe(int argc, void **argv);
 void cu_closefile(int argc, void **argv);
 void cu_closefd(int argc, void **argv);
diff -pruN 1.14.5ubuntu9/lib/ehandle.c 1.14.5ubuntu13/lib/ehandle.c
--- 1.14.5ubuntu9/lib/ehandle.c	2007-08-16 00:44:00.000000000 +0100
+++ 1.14.5ubuntu13/lib/ehandle.c	2007-09-18 12:13:49.000000000 +0100
@@ -290,6 +290,35 @@ void do_internerr(const char *string, in
   abort();
 }
 
+void statusfd_sendv(const char *fmt, va_list al) {
+  static struct varbuf vb;
+  struct pipef *pipef;
+  const char *p;
+  int r, l;
+  
+  if (!status_pipes) return;
+  varbufreset(&vb);
+  varbufvprintf(&vb,fmt,al);
+  varbufaddc(&vb,'\n');
+
+  for (pipef=status_pipes; pipef; pipef=pipef->next) {
+    for (p=vb.buf, l=vb.used;
+	 l;
+	 p+=r, l-=r) {
+      r= write(pipef->fd, vb.buf, vb.used);
+      if (r<0) ohshite("unable to write to status fd %d",pipef->fd);
+      assert(r && r<=l);
+    }
+  }
+}
+
+void statusfd_send(const char *fmt, ...) {
+  va_list al;
+  va_start(al,fmt);
+  statusfd_sendv(fmt,al);
+  va_end(al);
+}
+
 void cu_closepipe(int argc, void **argv) {
   int *p1= (int*)argv[0];
   if (p1[0]>=0) close(p1[0]);
diff -pruN 1.14.5ubuntu9/man/dpkg.1 1.14.5ubuntu13/man/dpkg.1
--- 1.14.5ubuntu9/man/dpkg.1	2007-07-04 15:26:33.000000000 +0100
+++ 1.14.5ubuntu13/man/dpkg.1	2007-09-18 11:59:43.000000000 +0100
@@ -474,12 +474,30 @@ be marked selected for deinstallation.
 Don't install the package if the same version of the package is already
 installed.
 .TP
-\fB\-\-status\-fd \fP\fI<n>\fP
-Send package status info to file descriptor \fI<n>\fP. This can be given
-multiple times. Status updates are of the form `status: <pkg>: <pkg state>'.
-Errors are reported as `status: <pkg>: error: extend-error-message'.
-Configuration file conflicts are reported as 
-`status: conffile-prompt: conffile : 'current-conffile' 'new-conffile' useredited distedited'.
+\fB\-\-status\-fd \fR\fIn\fR
+Send machine-readable package status and progress information to file
+descriptor \fIn\fP.  This option can be specified multiple times.  The
+information is generally one record per line, in one of the following
+forms:
+.RS
+.TP
+.BI "status: " package ": " status
+Package status changed; \fIstatus\fR is as in the status file.
+.TP
+.BI "status: " package " : error : " extended-error-message
+An error occurred.  Unfortunately at the time of writing
+\fIextended-error-message\fR can contain newlines, although in locales
+where the translators have not made mistakes every newline is followed
+by at least one space.
+.TP
+.BI "status: " file " : conffile-prompt : '" real-old "' '" real-new "' " useredited " " distedited
+User is being asked a configuration file question.
+.TP
+.BI "processing: \fIstage\fR \fIpkg\fR
+Sent just before a processing stage starts.  \fIstage\fR is one of
+.BR upgrade ", " install " (both sent before unpacking),"
+.BR configure ", " trigproc  ", " remove  ", " purge .
+.RE
 .TP
 \fB\-\-log=\fP\fIfilename\fP
 Log status change updates and actions to \fIfilename\fP, instead of
diff -pruN 1.14.5ubuntu9/src/archives.c 1.14.5ubuntu13/src/archives.c
--- 1.14.5ubuntu9/src/archives.c	2007-08-16 00:44:00.000000000 +0100
+++ 1.14.5ubuntu13/src/archives.c	2007-09-18 12:17:35.000000000 +0100
@@ -1080,6 +1080,7 @@ void archivefiles(const char *const *arg
                :                               msdbrw_needsuperuser);
 
   checkpath();
+  log_message("startup archives %s",cipaction->olong);
   
   if (f_recursive) {
     
diff -pruN 1.14.5ubuntu9/src/configure.c 1.14.5ubuntu13/src/configure.c
--- 1.14.5ubuntu9/src/configure.c	2007-08-21 14:51:28.000000000 +0100
+++ 1.14.5ubuntu13/src/configure.c	2007-09-18 12:10:00.000000000 +0100
@@ -143,6 +143,7 @@ void deferred_configure(struct pkginfo *
 
   printf(_("Setting up %s (%s) ...\n"),pkg->name,
          versiondescribe(&pkg->installed.version, vdew_nonambig));
+  log_action("configure",pkg);
 
   trig_activate_packageprocessing(pkg);
 
@@ -550,25 +551,9 @@ static enum conffopt promptconfaction(co
   if (!(what&cfof_prompt))
     return what;
 
-  /* if there is a status pipe, send conffile-prompt there */
-  if (status_pipes) {
-     static struct varbuf *status= NULL;
-     struct pipef *pipef= status_pipes;
-     int r;
-     if (status == NULL) {
-        status = nfmalloc(sizeof(struct varbuf));
-        varbufinit(status);
-     } else
-        varbufreset(status);
-     
-     r= varbufprintf(status, "status: %s : %s : '%s' '%s' %i %i \n", 
-         cfgfile, "conffile-prompt", 
-         realold, realnew, useredited, distedited);
-     while (pipef) {
-        write(pipef->fd, status->buf, r);
-        pipef= pipef->next;
-     }
-  }
+  statusfd_send("status: %s : %s : '%s' '%s' %i %i ",
+		cfgfile, "conffile-prompt", 
+		realold, realnew, useredited, distedited);
 
   do {
     /* Flush the terminal's input in case the user
diff -pruN 1.14.5ubuntu9/src/depcon.c 1.14.5ubuntu13/src/depcon.c
--- 1.14.5ubuntu9/src/depcon.c	2007-08-16 00:44:00.000000000 +0100
+++ 1.14.5ubuntu13/src/depcon.c	2007-08-29 15:09:59.000000000 +0100
@@ -243,16 +243,6 @@ int depisok(struct dependency *dep, stru
     internerr("unknown istobe depending");
   }
 
-  if (dep->type == dep_breaks)
-    /* We don't implement this and we can only be in this state
-     * if either a Breaks-ignorant or a Breaks-supporting dpkg
-     * installed the package.  In both cases it's probably too
-     * late to do anything useful about it now in this version
-     * so we just ignore it and hope.
-     * FIXME: implement Breaks
-     */
-    return 1;
-
   /* Describe the dependency, in case we have to moan about it. */
   varbufreset(whynot);
   varbufaddc(whynot, ' ');
diff -pruN 1.14.5ubuntu9/src/errors.c 1.14.5ubuntu13/src/errors.c
--- 1.14.5ubuntu9/src/errors.c	2007-08-16 00:44:00.000000000 +0100
+++ 1.14.5ubuntu13/src/errors.c	2007-09-18 12:08:44.000000000 +0100
@@ -58,23 +58,7 @@ void print_error_perpackage(const char *
   fprintf(stderr, _("%s: error processing %s (--%s):\n %s\n"),
           DPKG, arg, cipaction->olong, emsg);
 
-  if (status_pipes) {
-     static struct varbuf *status= NULL;
-     struct pipef *pipef= status_pipes;
-     int r;
-     if (status == NULL) {
-	status = nfmalloc(sizeof(struct varbuf));
-	varbufinit(status);
-     } else
-	varbufreset(status);
-
-     r= varbufprintf(status, "status: %s : %s : %s\n", arg, "error",emsg);
-     while (pipef) {
-	write(pipef->fd, status->buf, r);
-	pipef= pipef->next;
-     }
-  }
-
+  statusfd_send("status: %s : %s : %s",arg,"error",emsg);
 
   nr= malloc(sizeof(struct error_report));
   if (!nr) {
diff -pruN 1.14.5ubuntu9/src/help.c 1.14.5ubuntu13/src/help.c
--- 1.14.5ubuntu9/src/help.c	2007-08-21 15:05:22.000000000 +0100
+++ 1.14.5ubuntu13/src/help.c	2007-09-18 12:11:30.000000000 +0100
@@ -230,9 +230,12 @@ static void script_catchsignals(void) {
 }
 
 void post_postinst_tasks(void) {
+  debug(dbg_triggersdetail,"post_postinst_tasks - trig_incorporate");
   trig_incorporate(msdbrw_write,admindir);
 }
 static void post_script_tasks(void) {
+  debug(dbg_triggersdetail,"post_script_tasks -"
+	" ensure_diversions; trig_incorporate");
   ensure_diversions();
   trig_incorporate(msdbrw_write,admindir);
 }
@@ -249,7 +252,7 @@ static int do_script(const char *pkg, co
   int c1, r;
   setexecute(scriptpath,stab);
 
-  push_cleanup(cu_post_script_tasks,~ehflag_bombout, 0,0, 0);
+  push_cleanup(cu_post_script_tasks,ehflag_bombout, 0,0, 0);
 
   c1= m_fork();
   if (!c1) {
@@ -260,8 +263,9 @@ static int do_script(const char *pkg, co
       narglist[r]= arglist[r];
     scriptexec= preexecscript(scriptpath,(char * const *)narglist);
     narglist[0]= scriptexec;
-    if (setenv(MAINTSCRIPTPKGENVVAR,pkg,1))
-      ohshite(_("unable to setenv %s for maint script"),MAINTSCRIPTPKGENVVAR);
+    if (setenv(MAINTSCRIPTPKGENVVAR,pkg,1) ||
+	setenv(MAINTSCRIPTDPKGENVVAR,PACKAGE_VERSION,1))
+      ohshite(_("unable to setenv for maint script"));
     execv(scriptexec,(char * const *)narglist);
     ohshite(desc,name);
   }
@@ -550,4 +554,5 @@ void log_action(const char *action, stru
   log_message("%s %s %s %s", action, pkg->name,
 	      versiondescribe(&pkg->installed.version, vdew_nonambig),
 	      versiondescribe(&pkg->available.version, vdew_nonambig));
+  statusfd_send("processing: %s %s",action,pkg->name);
 }
diff -pruN 1.14.5ubuntu9/src/main.c 1.14.5ubuntu13/src/main.c
--- 1.14.5ubuntu9/src/main.c	2007-08-16 00:44:00.000000000 +0100
+++ 1.14.5ubuntu13/src/main.c	2007-08-24 12:27:47.000000000 +0100
@@ -221,6 +221,9 @@ static void setdebug(const struct cmdinf
 "    200   conffdetail       Lots of output for each configuration file\n"
 "     40   depcon            Dependencies and conflicts\n"
 "    400   depcondetail      Lots of dependencies/conflicts output\n"
+"  10000   triggers          Trigger activation and processing\n"
+"  20000   triggersdetail    Lots of output regarding triggers\n"
+"  40000   triggersstupid    Silly amounts of output regarding triggers\n"
 "   1000   veryverbose       Lots of drivel about eg the dpkg/info directory\n"
 "   2000   stupidlyverbose   Insane amounts of drivel\n"
 "\n"
diff -pruN 1.14.5ubuntu9/src/main.h 1.14.5ubuntu13/src/main.h
--- 1.14.5ubuntu9/src/main.h	2007-08-21 14:51:28.000000000 +0100
+++ 1.14.5ubuntu13/src/main.h	2007-08-24 12:28:27.000000000 +0100
@@ -230,16 +230,19 @@ int isdirectoryinuse(struct filenamenode
 int hasdirectoryconffiles(struct filenamenode *namenode, struct pkginfo *pkg);
 
 enum debugflags {
-  dbg_general=           00001,
-  dbg_scripts=           00002,
-  dbg_eachfile=          00010,
-  dbg_eachfiledetail=    00100,
-  dbg_conff=             00020,
-  dbg_conffdetail=       00200,
-  dbg_depcon=            00040,
-  dbg_depcondetail=      00400,
-  dbg_veryverbose=       01000,
-  dbg_stupidlyverbose=   02000,
+  dbg_general=           000001,
+  dbg_scripts=           000002,
+  dbg_eachfile=          000010,
+  dbg_eachfiledetail=    000100,
+  dbg_conff=             000020,
+  dbg_conffdetail=       000200,
+  dbg_depcon=            000040,
+  dbg_depcondetail=      000400,
+  dbg_veryverbose=       001000,
+  dbg_stupidlyverbose=   002000,
+  dbg_triggers=          010000,
+  dbg_triggersdetail=    020000,
+  dbg_triggersstupid=    040000,
 };
   
 void debug(int which, const char *fmt, ...) PRINTFFORMAT(2,3);
diff -pruN 1.14.5ubuntu9/src/packages.c 1.14.5ubuntu13/src/packages.c
--- 1.14.5ubuntu9/src/packages.c	2007-08-16 16:21:41.000000000 +0100
+++ 1.14.5ubuntu13/src/packages.c	2007-09-18 12:17:35.000000000 +0100
@@ -90,6 +90,7 @@ void packages(const char *const *argv) {
                : fc_nonroot ? msdbrw_write
                :              msdbrw_needsuperuser);
   checkpath();
+  log_message("startup packages %s",cipaction->olong);
 
   if (f_pending) {
 
diff -pruN 1.14.5ubuntu9/src/processarc.c 1.14.5ubuntu13/src/processarc.c
--- 1.14.5ubuntu9/src/processarc.c	2007-08-16 00:44:00.000000000 +0100
+++ 1.14.5ubuntu13/src/processarc.c	2007-09-18 11:35:37.000000000 +0100
@@ -285,11 +285,11 @@ void process_archive(const char *filenam
   trig_file_interests_ensure();
   
   if (pkg->status != stat_notinstalled && pkg->status != stat_configfiles) {
-    log_action("upgrade", pkg);
     printf(_("Preparing to replace %s %s (using %s) ...\n"),
            pkg->name,
            versiondescribe(&pkg->installed.version,vdew_nonambig),
            pfilename);
+    log_action("upgrade", pkg);
   } else {
     printf(_("Unpacking %s (from %s) ...\n"),pkg->name,pfilename);
     log_action("install", pkg);
diff -pruN 1.14.5ubuntu9/src/trigproc.c 1.14.5ubuntu13/src/trigproc.c
--- 1.14.5ubuntu9/src/trigproc.c	2007-08-21 15:31:18.000000000 +0100
+++ 1.14.5ubuntu13/src/trigproc.c	2007-09-18 11:36:03.000000000 +0100
@@ -88,12 +88,14 @@ static void trigproc_enqueue_deferred(st
   ensure_package_clientdata(pend);
   if (pend->clientdata->trigprocdeferred) return;
   pend->clientdata->trigprocdeferred= add_to_some_queue(pend,&deferred,0);
+  debug(dbg_triggers,"trigproc_enqueue_deferred pend=%s", pend->name);
 }
 
 void trigproc_run_deferred(void) {
   struct pkginqueue *node;
   struct pkginfo *pkg;
 
+  debug(dbg_triggers,"trigproc_run_deferred");
   while ((node= remove_from_some_queue(&deferred,0))) {
     pkg= node->pkg;
     free(node);
@@ -104,6 +106,9 @@ void trigproc_run_deferred(void) {
 }
 
 void trig_activate_packageprocessing(struct pkginfo *pkg) {
+  debug(dbg_triggersdetail,"trigproc_activate_packageprocessing pkg=%s",
+	pkg->name);
+
   trig_parse_ci(pkgadminfile(pkg,TRIGGERSCIFILE),
 		0, trig_cicb_statuschange_activate,
 		pkg);
@@ -140,19 +145,27 @@ static struct pkginfo *check_trigger_cyc
   struct pkginfo *pkg, *giveup;
   const char *sep;
 
+  debug(dbg_triggers,"check_triggers_cycle pnow=%s", processing_now->name);
+
   tcn= nfmalloc(sizeof(*tcn));
   tcn->pkgs= 0;
   tcn->then_processed= processing_now;
   
   it= iterpkgstart();
   while ((pkg= iterpkgnext(it))) {
+    if (!pkg->trigpend_head) continue;
     tcpp= nfmalloc(sizeof(*tcpp));
     tcpp->pkg= pkg;
     tcpp->then_trigs= pkg->trigpend_head;
     tcpp->next= tcn->pkgs;  tcn->pkgs= tcpp;
   }
-  if (!hare) { tcn->next= 0; hare= tortoise= tcn; return 0; }
+  if (!hare) {
+    debug(dbg_triggersdetail,"check_triggers_cycle pnow=%s first",
+	  processing_now->name);
+    tcn->next= 0; hare= tortoise= tcn; return 0;
+  }
 
+  tcn->next= 0;
   hare->next= tcn;
   hare= tcn;
   if (tortoise_advance) tortoise= tortoise->next;
@@ -166,16 +179,28 @@ static struct pkginfo *check_trigger_cyc
   for (tortoise_pkg=tortoise->pkgs;
        tortoise_pkg;
        tortoise_pkg=tortoise_pkg->next) {
+    debug(dbg_triggersdetail,"check_triggers_cycle pnow=%s tortoise=%s",
+	  processing_now->name, tortoise_pkg->pkg->name);
     for (tortoise_trig=tortoise_pkg->then_trigs;
 	 tortoise_trig;
 	 tortoise_trig=tortoise_trig->next) {
+      debug(dbg_triggersdetail,"check_triggers_cycle pnow=%s tortoise=%s"
+	    " tortoisetrig=%s", processing_now->name,
+	    tortoise_pkg->pkg->name, tortoise_trig->name);
       /* hare is now so we can just look up in the actual data */
       for (hare_trig=tortoise_pkg->pkg->trigpend_head;
 	   hare_trig;
-	   hare_trig=hare_trig->next)
+	   hare_trig=hare_trig->next) {
+	debug(dbg_triggersstupid,"check_triggers_cycle pnow=%s tortoise=%s"
+	      " tortoisetrig=%s haretrig=%s",
+	      processing_now->name, tortoise_pkg->pkg->name,
+	      tortoise_trig->name, hare_trig->name);
 	if (!strcmp(hare_trig->name,tortoise_trig->name))
 	  goto found_in_hare;
+      }
       /* not found in hare, yay! */
+      debug(dbg_triggersdetail,"check_triggers_cycle pnow=%s tortoise=%s OK",
+	    processing_now->name, tortoise_pkg->pkg->name);
       return 0;
     found_in_hare:;
     }
@@ -208,6 +233,8 @@ static struct pkginfo *check_trigger_cyc
 
   /* we give up on the _earliest_ package involved */
   giveup= tortoise->pkgs->pkg;
+  debug(dbg_triggers,"check_triggers_cycle pnow=%s giveup=%p",
+	processing_now->name, giveup->name);
   assert(giveup->status == stat_triggersawaited ||
 	 giveup->status == stat_triggerspending);
   giveup->status= stat_halfconfigured;
@@ -223,6 +250,8 @@ void trigproc(struct pkginfo *pkg) {
   struct trigpend *tp;
   struct pkginfo *gaveup;
   
+  debug(dbg_triggers,"trigproc %s",pkg->name);
+
   if (pkg->clientdata->trigprocdeferred)
     pkg->clientdata->trigprocdeferred->pkg= 0;
   pkg->clientdata->trigprocdeferred= 0;
@@ -235,6 +264,7 @@ void trigproc(struct pkginfo *pkg) {
     if (gaveup == pkg) return;
 
     printf(_("Processing triggers for %s ...\n"),pkg->name);
+    log_action("trigproc", pkg);
 
     varbufreset(&namesarg);
     for (tp=pkg->trigpend_head; tp; tp=tp->next) {
@@ -268,6 +298,8 @@ void trigproc(struct pkginfo *pkg) {
 
 static void transitional_interest_callback_ro(const char *trig, void *user) {
   struct pkginfo *pend= user;
+  debug(dbg_triggersdetail,"trig_transitional_interest_callback"
+	" trig=%s pend=%s", trig, pend->name);
   if (pend->status >= stat_triggersawaited)
     trig_note_pend(pend,nfstrsave(trig));
 }
@@ -291,6 +323,8 @@ static void trig_transitional_activate(e
   while ((pkg= iterpkgnext(it))) {
     if (pkg->status <= stat_halfinstalled)
       continue;
+    debug(dbg_triggersdetail,"trig_transitional_activate %s %s",
+	  pkg->name, statusinfos[pkg->status].name);
     pkg->trigpend_head= 0;
     trig_parse_ci(pkgadminfile(pkg,TRIGGERSCIFILE),
 		  cstatus >= msdbrw_write

Reply to: