Skip to content

Commit 0bbb9ec

Browse files
committed
archive_autodetect() match archive files before dir refs #66 #69 #73
Fix archive_autodetect() match patterns to detect archive files with higher priority than a directory. The upcoming git workflow will typically have the upstream repository as a git submodule, seen as a directory. If the packager has configured source services to generate an archive file in a supported format, or committed an archive file from an upstream release, it should be detected first and used. The packager can specify the archive explicitly via source service parameter if they need to override (skip) archive_autodetect() logic.
1 parent 2b0bd82 commit 0bbb9ec

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

go_modules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ def archive_autodetect():
135135
spec = specs[0]
136136
c_exts = ("gz", "xz", "zst", "lz", "bz2")
137137
for pattern in (
138-
[spec.stem]
139-
+ [f"{spec.stem}*.tar.{c_ext}" for c_ext in c_exts]
138+
[f"{spec.stem}*.tar.{c_ext}" for c_ext in c_exts]
140139
+ [f"{spec.stem}*.obscpio"]
141140
+ [f"_service:*:{spec.stem}*tar.{c_ext}" for c_ext in c_exts]
142141
+ [f"_service:*:{spec.stem}*obscpio"]
142+
+ [spec.stem]
143143
):
144144
log.debug(f"Trying to find archive name with pattern {pattern}")
145145
matches = sorted(spec.parent.glob(pattern), reverse=True)

0 commit comments

Comments
 (0)