From b4b856cf69d43a8018061453ec881757c81ba389 Mon Sep 17 00:00:00 2001
From: Vratislav Podzimek <vpodzime@redhat.com>
Date: Wed, 25 May 2016 18:29:52 +0200
Subject: [PATCH 09/13] Do not try to create a single file multiple times
When extracting the archive, we may apparently get into a situation when we try
to extract a file or directory, that's already extracted/existing. Just skip
such a file/directory instead of causing a failure of the extraction process.
Related: rhbz#1263315
---
org_fedora_oscap/common.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/org_fedora_oscap/common.py b/org_fedora_oscap/common.py
index 684f8ab..6f95b2d 100644
--- a/org_fedora_oscap/common.py
+++ b/org_fedora_oscap/common.py
@@ -410,6 +410,8 @@ def _extract_rpm(rpm_path, root="/", ensure_has_files=None):
utils.ensure_dir_exists(out_dir)
out_fpath = os.path.normpath(root + entry.name.lstrip("."))
+ if os.path.exists(out_fpath):
+ continue
with open(out_fpath, "wb") as out_file:
buf = entry.read(IO_BUF_SIZE)
while buf:
--
2.5.5