Преглед изворни кода

dpkg: On file conflicts print the version of the conflicted package

Makes it easier to report bugs, without needed to additionally check
the installed version of the conflicted package.

Closes: #540019
Guillem Jover пре 17 година
родитељ
комит
e3ef990f83
2 измењених фајлова са 13 додато и 5 уклоњено
  1. 2 0
      debian/changelog
  2. 11 5
      src/archives.c

+ 2 - 0
debian/changelog

@@ -26,6 +26,8 @@ dpkg (1.15.4) UNRELEASED; urgency=low
   * Add uClibc Linux support to ostable and triplettable. Closes: #455501
   * Add uClinux support to ostable and triplettable.
     Thanks to Simon Richter <sjr@debian.org>.
+  * When aborting due to file conflicts print the version of the conflicted
+    package. Closes: #540019
 
   [ Raphael Hertzog ]
   * Replace install-info by a wrapper around GNU's install-info. The wrapper

+ 11 - 5
src/archives.c

@@ -594,9 +594,12 @@ int tarobject(struct TarInfo *ti) {
 	  keepexisting = 1;
         } else {
           if (!statr && S_ISDIR(stab.st_mode)) {
-            forcibleerr(fc_overwritedir, _("trying to overwrite directory `%.250s' "
-                        "in package %.250s with nondirectory"),
-                        nifd->namenode->name,otherpkg->name);
+            forcibleerr(fc_overwritedir,
+                        _("trying to overwrite directory '%.250s' "
+                          "in package %.250s %.250s with nondirectory"),
+                        nifd->namenode->name, otherpkg->name,
+                        versiondescribe(&otherpkg->installed.version,
+                                        vdew_always));
           } else {
             /* WTA: At this point we are replacing something without a Replaces.
 	     * if the new object is a directory and the previous object does not
@@ -604,8 +607,11 @@ int tarobject(struct TarInfo *ti) {
 	     */
             if (! (statr && ti->Type==Directory))
               forcibleerr(fc_overwrite,
-                        _("trying to overwrite `%.250s', which is also in package %.250s"),
-                        nifd->namenode->name,otherpkg->name);
+                          _("trying to overwrite '%.250s', "
+                            "which is also in package %.250s %.250s"),
+                          nifd->namenode->name, otherpkg->name,
+                          versiondescribe(&otherpkg->installed.version,
+                                          vdew_always));
           }
         }
       }