|
|
@@ -583,6 +583,15 @@ tarobject(void *ctx, struct tar_entry *ti)
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
+ /* If the new object is a directory and the previous object does
|
|
|
+ * not exist assume it's also a directory and skip further checks.
|
|
|
+ * XXX: Ideally with more information about the installed files we
|
|
|
+ * could perform more clever checks. */
|
|
|
+ if (statr != 0 && ti->type == tar_filetype_dir) {
|
|
|
+ debug(dbg_eachfile, "tarobject ... assuming shared directory");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
/* Nope? Hmm, file conflict, perhaps. Check Replaces. */
|
|
|
switch (otherpkg->clientdata->replacingfilesandsaid) {
|
|
|
case 2:
|
|
|
@@ -636,6 +645,7 @@ tarobject(void *ctx, struct tar_entry *ti)
|
|
|
nifd->namenode->flags &= ~fnnf_new_inarchive;
|
|
|
keepexisting = true;
|
|
|
} else {
|
|
|
+ /* At this point we are replacing something without a Replaces. */
|
|
|
if (!statr && S_ISDIR(stab.st_mode)) {
|
|
|
forcibleerr(fc_overwritedir,
|
|
|
_("trying to overwrite directory '%.250s' "
|
|
|
@@ -644,16 +654,12 @@ tarobject(void *ctx, struct tar_entry *ti)
|
|
|
versiondescribe(&otherpkg->installed.version,
|
|
|
vdew_nonambig));
|
|
|
} else {
|
|
|
- /* At this point we are replacing something without a Replaces.
|
|
|
- * If the new object is a directory and the previous object does
|
|
|
- * not exist assume it's also a directory and don't complain. */
|
|
|
- if (!(statr && ti->type == tar_filetype_dir))
|
|
|
- forcibleerr(fc_overwrite,
|
|
|
- _("trying to overwrite '%.250s', "
|
|
|
- "which is also in package %.250s %.250s"),
|
|
|
- nifd->namenode->name, otherpkg->name,
|
|
|
- versiondescribe(&otherpkg->installed.version,
|
|
|
- vdew_nonambig));
|
|
|
+ forcibleerr(fc_overwrite,
|
|
|
+ _("trying to overwrite '%.250s', "
|
|
|
+ "which is also in package %.250s %.250s"),
|
|
|
+ nifd->namenode->name, otherpkg->name,
|
|
|
+ versiondescribe(&otherpkg->installed.version,
|
|
|
+ vdew_nonambig));
|
|
|
}
|
|
|
}
|
|
|
}
|