I have attached a git patch for this bug.

The general reason for the error was that dpkg was not dealing with the
diversions for the symlinks in the way it should have been doing. 

Thanks,

Chris
From ca4eda6282947af1df21b9367bfbfa48221d811f Mon Sep 17 00:00:00 2001
From: Christopher Baines <cbain...@gmail.com>
Date: Fri, 15 Apr 2011 15:27:38 +0100
Subject: [PATCH] Fix for bug #245322
  - Christopher Baines

---
 src/archives.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/archives.c b/src/archives.c
index 9468bcb..1a8f1cc 100644
--- a/src/archives.c
+++ b/src/archives.c
@@ -750,11 +750,18 @@ tarobject(void *ctx, struct tar_entry *ti)
     debug(dbg_eachfiledetail, "tarobject blockdev");
     break;
   case tar_filetype_hardlink:
+    linknode = findnamenode(ti->linkname, 0);
     varbuf_reset(&hardlinkfn);
     varbuf_add_str(&hardlinkfn, instdir);
     varbuf_add_char(&hardlinkfn, '/');
-    varbuf_add_str(&hardlinkfn, ti->linkname);
-    linknode = findnamenode(ti->linkname, 0);
+    /* Check for any diversions on the file this file links to. */
+    if (linknode->divert) {
+      /* The file is diverted, so find the new name */
+      varbuf_add_str(&hardlinkfn, linknode->divert->useinstead->name);
+    } else {
+      /* The file is not diverted, so use the standard link name. */
+      varbuf_add_str(&hardlinkfn, ti->linkname);
+    }
     if (linknode->flags & fnnf_deferred_rename)
       varbuf_add_str(&hardlinkfn, DPKGNEWEXT);
     varbuf_end_str(&hardlinkfn);
-- 
1.7.4.1

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to