Procházet zdrojové kódy

Do not lose conffiles while replacing them on the same install run

Only do the ensure_pathname_nonexisting calls when we are not going to
return due to an already existing directory or a file not to be
overwritten.

Those calls are making sure that .dpkg-tmp and .dpkg-new pathnames do
not exist, and will remove them if they do, which messes with the way
conffiles are handled by keeping those and acting on them later on.

Closes: #80416, #513857
Guillem Jover před 17 roky
rodič
revize
21710d2577
3 změnil soubory, kde provedl 19 přidání a 6 odebrání
  1. 6 0
      ChangeLog
  2. 7 0
      debian/changelog
  3. 6 6
      src/archives.c

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2009-02-02  Guillem Jover  <guillem@debian.org>
+
+	* src/archives.c (tarobject): Do not call ensure_pathname_nonexisting
+	for .dpkg-tmp and .dpkg-new if we are going to return due to already
+	existing directory or a file to be skept.
+
 2008-02-02  Raphael Hertzog  <hertzog@debian.org>
 2008-02-02  Raphael Hertzog  <hertzog@debian.org>
 
 
 	* dpkg-deb/build.c: Ensure that data.tar and control.tar
 	* dpkg-deb/build.c: Ensure that data.tar and control.tar

+ 7 - 0
debian/changelog

@@ -3,6 +3,13 @@ dpkg (1.14.25) UNRELEASED; urgency=low
   [ Guillem Jover ]
   [ Guillem Jover ]
   * Fix typo in package description ('privides' -> 'provides').
   * Fix typo in package description ('privides' -> 'provides').
     Thanks to Pascal De Vuyst <pascal.devuyst@gmail.com>. Closes: #510755
     Thanks to Pascal De Vuyst <pascal.devuyst@gmail.com>. Closes: #510755
+  * Do not lose conffiles while replacing them from another package on the
+    same install run. Closes: #513857
+    As a side effect this fixes the following symptoms:
+    - Do not do unneeded conffile prompts when it wasn't locally changed.
+    - Do not ensure (and thus do not output debug information) that the
+     .dpkg-new and .dpkg-tmp directories for an existing directory do not
+      exist. Closes: #80416
 
 
   [ Raphael Hertzog ]
   [ Raphael Hertzog ]
   * dpkg-deb now always produces GNU tarballs inside .deb and ignores
   * dpkg-deb now always produces GNU tarballs inside .deb and ignores

+ 6 - 6
src/archives.c

@@ -577,12 +577,6 @@ int tarobject(struct TarInfo *ti) {
     }
     }
   }
   }
        
        
-  /* Now, at this stage we want to make sure neither of .dpkg-new and .dpkg-tmp
-   * are hanging around.
-   */
-  ensure_pathname_nonexisting(fnamenewvb.buf);
-  ensure_pathname_nonexisting(fnametmpvb.buf);
-
   if (existingdirectory) return 0;
   if (existingdirectory) return 0;
   if (keepexisting) {
   if (keepexisting) {
     obstack_free(&tar_obs, nifd);
     obstack_free(&tar_obs, nifd);
@@ -602,6 +596,12 @@ int tarobject(struct TarInfo *ti) {
     return 0;
     return 0;
   }
   }
 
 
+  /* Now, at this stage we want to make sure neither of .dpkg-new and .dpkg-tmp
+   * are hanging around.
+   */
+  ensure_pathname_nonexisting(fnamenewvb.buf);
+  ensure_pathname_nonexisting(fnametmpvb.buf);
+
   /* Now we start to do things that we need to be able to undo
   /* Now we start to do things that we need to be able to undo
    * if something goes wrong.  Watch out for the CLEANUP comments to
    * if something goes wrong.  Watch out for the CLEANUP comments to
    * keep an eye on what's installed on the disk at each point.
    * keep an eye on what's installed on the disk at each point.