1 | *************** |
---|
2 | *** 266,272 **** |
---|
3 | push_leftover(&leftover,namenode); |
---|
4 | continue; |
---|
5 | } |
---|
6 | - if (errno != ENOTDIR) ohshite(_("cannot remove `%.250s'"),fnvb.buf); |
---|
7 | debug(dbg_eachfiledetail, "removal_bulk unlinking `%s'", fnvb.buf); |
---|
8 | { |
---|
9 | /* |
---|
10 | --- 266,283 ---- |
---|
11 | push_leftover(&leftover,namenode); |
---|
12 | continue; |
---|
13 | } |
---|
14 | + if (errno != ENOTDIR) { |
---|
15 | + /* XXX Hack: |
---|
16 | + * dpkg includes /. in the packing list. |
---|
17 | + * rmdir("/.") will return EINVAL. dpkg will |
---|
18 | + * only attempt to remove /. when uninstalling |
---|
19 | + * the last package on the system, which is why |
---|
20 | + * Debian has never run into this issue. */ |
---|
21 | + if (errno == EINVAL && strcmp(fnvb.buf, "/.") == 0) |
---|
22 | + continue; |
---|
23 | + else |
---|
24 | + ohshite(_("cannot remove `%.250s'"),fnvb.buf); |
---|
25 | + } |
---|
26 | debug(dbg_eachfiledetail, "removal_bulk unlinking `%s'", fnvb.buf); |
---|
27 | { |
---|
28 | /* |
---|