Commit b9511e21 authored by Jakub Ružička's avatar Jakub Ružička
Browse files

deb: improve archive handling

Use actual root directory contained in the source archive as opposed to
assumptions (NVR).
parent 3dc924a4
Pipeline #81247 passed with stage
in 16 minutes and 13 seconds
......@@ -93,12 +93,11 @@ def build_srcpkg(
archive_path = archive_paths[0]
nv, _ = parse.split_archive_ext(
source_path = build_path / nv"building deb source package: %s", nv)"unpacking archive: %s", archive_path)
unpack_path = unpack_archive(archive_path, build_path)
if unpack_path != source_path or not source_path.exists():
source_path = unpack_archive(archive_path, build_path)
log.verbose("source package root dir: %s", source_path)
if not source_path or not source_path.exists():
msg = "archive unpack didn't result in expected dir: %s" % source_path
raise ex.UnexpectedCommandOutput(msg=msg)
# render template
......@@ -23,6 +23,6 @@ def unpack_archive(archive_path, out_path):
root_files = list(out_path.glob("*"))
n_root_files = len(root_files)
if n_root_files != 1:
fmt = "Expected a single root dir but insteat got %d files in root"
fmt = "Expected a single root dir but instead got %d files in root"
raise ex.InvalidArchiveFormat(fmt=fmt % n_root_files)
return root_files[0]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment