Просмотр исходного кода

dpkg: Sync and print the correct info database directory

On unpack sync the info database directory instead of the temporary
control information directory, and print the correct pathname on
error instead of the last file acted on that directory.
Guillem Jover лет назад: 15
Родитель
Сommit
ed250955ff
3 измененных файлов с 9 добавлено и 12 удалено
  1. 3 0
      debian/changelog
  2. 4 8
      src/processarc.c
  3. 2 4
      src/remove.c

+ 3 - 0
debian/changelog

@@ -36,6 +36,9 @@ dpkg (1.16.0) UNRELEASED; urgency=low
     Thanks to Robert Millan. Closes: #612203
   * On install for Ubuntu adjust the i386 GNU cpu name in cputable.
     Thanks to Colin Watson <cjwatson@ubuntu.com>. Closes: #611741
+  * Sync the info database directory on unpack instead of the temporary
+    control information directory, and print the correct pathname on error
+    instead of the last file acted on that directory.
 
   [ Raphaël Hertzog ]
   * Fail properly when debian/source/format is empty. Closes: #600854

+ 4 - 8
src/processarc.c

@@ -978,12 +978,10 @@ void process_archive(const char *filename) {
     debug(dbg_scripts,"process_archive tmp.ci script/file `%s' installed as `%s'",
           cidir, newinfofilename);
   }
-
-  /* Sync the info database directory. */
-  dir_sync(dsd, cidir);
-
   pop_cleanup(ehflag_normaltidy); /* closedir */
 
+  dir_sync_path(pkgadmindir());
+
   /*
    * Update the status database.
    *
@@ -1176,12 +1174,10 @@ void process_archive(const char *filename) {
         ohshite(_("unable to delete disappearing control info file `%.250s'"),fnvb.buf);
       debug(dbg_scripts, "process_archive info unlinked %s",fnvb.buf);
     }
-
-    /* Sync the info database directory. */
-    dir_sync(dsd, fnvb.buf);
-
     pop_cleanup(ehflag_normaltidy); /* closedir */
 
+    dir_sync_path(pkgadmindir());
+
     otherpkg->status= stat_notinstalled;
     otherpkg->want = want_unknown;
     otherpkg->eflag = eflag_ok;

+ 2 - 4
src/remove.c

@@ -303,12 +303,10 @@ removal_bulk_remove_files(struct pkginfo *pkg)
         ohshite(_("unable to delete control info file `%.250s'"),fnvb.buf);
       debug(dbg_scripts, "removal_bulk info unlinked %s",fnvb.buf);
     }
-
-    /* Sync the info database directory. */
-    dir_sync(dsd, fnvb.buf);
-
     pop_cleanup(ehflag_normaltidy); /* closedir */
 
+    dir_sync_path(pkgadmindir());
+
     pkg->status= stat_configfiles;
     pkg->installed.essential = false;
     modstatdb_note(pkg);