(To debian-dpkg: there is a big discussion about an alleged dpkg bug with symlink handling in /usr/doc.)
I'd like everyone to know that I'm looking at this thread again with some interest. There is a bug with handling certain kinds of entries which might be relevant to symlink handling. It's fixed in my current CVS tree, but I don't know if the NMU series has it. The patch for this bug is below. It's NOT the same as the patch that seems to have been applied in the NMU series, and the patch in the NMU series is wrong. I'm not sure yet what the test cases people are presenting are. dpkg is not supposed ever to remove a nonempty directory and replace it with a symlink to a different directory. If someone can reproduce it doing this I'd be very interested. Ian. Joseph Carter writes ("Re: /usr/share/doc vs. /usr/doc transition, debate reopened"): ... > But you see, the file was removed from NEWDIR too! Totally gone. > Deleted. if it were not deleted, olddir would not have been deleted > (non-empty)... The dpkg bug STILL applies and I can demonstrate that too > if you like. Index: archives.c =================================================================== RCS file: /usr/src/CVS/dpkg/main/archives.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- archives.c 1999/03/13 14:13:11 1.4 +++ archives.c 1999/07/22 00:53:21 1.5 @@ -351,15 +351,17 @@ printf("Replacing files in old package %s ...\n",otherpkg->name); otherpkg->clientdata->replacingfilesandsaid= 1; } else { - if (S_ISDIR(stab.st_mode)) { - forcibleerr(fc_overwritedir, "trying to overwrite directory `%.250s' " - "in package %.250s with nondirectory", - nifd->namenode->name,otherpkg->name); - } else { - forcibleerr(fc_overwrite, - "trying to overwrite `%.250s', which is also in package %.250s", - nifd->namenode->name,otherpkg->name); - } + if (statr) { + /* Whatever it was has disappeared. */ + } else if (S_ISDIR(stab.st_mode)) { + forcibleerr(fc_overwritedir, "trying to overwrite directory `%.250s' " + "in package %.250s with nondirectory", + nifd->namenode->name,otherpkg->name); + } else { + forcibleerr(fc_overwrite, + "trying to overwrite `%.250s', which is also in package %.250s", + nifd->namenode->name,otherpkg->name); + } } } }