fosslight-util 2.1.26__tar.gz → 2.1.27__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/PKG-INFO +1 -1
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/setup.py +1 -1
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/download.py +55 -10
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util.egg-info/PKG-INFO +1 -1
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/LICENSE +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/MANIFEST.in +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/README.md +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/requirements.txt +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/setup.cfg +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/__init__.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/_get_downloadable_url.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/compare_yaml.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/constant.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/correct.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/cover.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/exclude.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/help.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/oss_item.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/output_format.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/parsing_yaml.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/read_excel.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/resources/frequentLicenselist.json +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/resources/frequent_license_nick_list.json +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/resources/licenses.json +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/set_log.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/spdx_licenses.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/timer_thread.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/write_cyclonedx.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/write_excel.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/write_opossum.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/write_scancodejson.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/write_spdx.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/write_txt.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util/write_yaml.py +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util.egg-info/SOURCES.txt +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util.egg-info/dependency_links.txt +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util.egg-info/entry_points.txt +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util.egg-info/requires.txt +0 -0
- {fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util.egg-info/top_level.txt +0 -0
|
@@ -195,15 +195,60 @@ def get_ref_to_checkout(checkout_to, ref_list):
|
|
|
195
195
|
return ref_to_checkout
|
|
196
196
|
|
|
197
197
|
|
|
198
|
-
def
|
|
199
|
-
if
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
198
|
+
def get_remote_refs(git_url: str):
|
|
199
|
+
if not git_url:
|
|
200
|
+
return {"tags": [], "branches": []}
|
|
201
|
+
tags = []
|
|
202
|
+
branches = []
|
|
203
|
+
try:
|
|
204
|
+
cp = subprocess.run(["git", "ls-remote", "--tags", "--heads", git_url], capture_output=True, text=True, timeout=30)
|
|
205
|
+
if cp.returncode == 0:
|
|
206
|
+
for line in cp.stdout.splitlines():
|
|
207
|
+
parts = line.split('\t')
|
|
208
|
+
if len(parts) != 2:
|
|
209
|
+
continue
|
|
210
|
+
ref = parts[1]
|
|
211
|
+
if ref.startswith('refs/tags/'):
|
|
212
|
+
tags.append(ref[len('refs/tags/'):])
|
|
213
|
+
elif ref.startswith('refs/heads/'):
|
|
214
|
+
branches.append(ref[len('refs/heads/'):])
|
|
215
|
+
except Exception as e:
|
|
216
|
+
logger.debug(f"get_remote_refs - failed: {e}")
|
|
217
|
+
return {"tags": tags, "branches": branches}
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
def decide_checkout(checkout_to="", tag="", branch="", git_url=""):
|
|
221
|
+
base = checkout_to or tag or branch
|
|
222
|
+
if not base:
|
|
223
|
+
return ""
|
|
224
|
+
|
|
225
|
+
ref_dict = get_remote_refs(git_url)
|
|
226
|
+
tag_set = set(ref_dict.get("tags", []))
|
|
227
|
+
branch_set = set(ref_dict.get("branches", []))
|
|
228
|
+
|
|
229
|
+
ver_re = re.compile(r'^(?:v\.? ?)?' + re.escape(base) + r'$', re.IGNORECASE)
|
|
230
|
+
|
|
231
|
+
# tag: exact -> prefix variant -> endswith
|
|
232
|
+
if base in tag_set:
|
|
233
|
+
return base
|
|
234
|
+
tag_candidates = [c for c in tag_set if ver_re.match(c)]
|
|
235
|
+
if tag_candidates:
|
|
236
|
+
return min(tag_candidates, key=lambda x: (len(x), x.lower()))
|
|
237
|
+
tag_ends = [n for n in tag_set if n.endswith(base)]
|
|
238
|
+
if tag_ends:
|
|
239
|
+
return min(tag_ends, key=len)
|
|
240
|
+
|
|
241
|
+
# branch: exact -> prefix variant -> endswith
|
|
242
|
+
if base in branch_set:
|
|
243
|
+
return base
|
|
244
|
+
branch_candidates = [c for c in branch_set if ver_re.match(c)]
|
|
245
|
+
if branch_candidates:
|
|
246
|
+
return min(branch_candidates, key=lambda x: (len(x), x.lower()))
|
|
247
|
+
branch_ends = [n for n in branch_set if n.endswith(base)]
|
|
248
|
+
if branch_ends:
|
|
249
|
+
return min(branch_ends, key=len)
|
|
250
|
+
|
|
251
|
+
return base
|
|
207
252
|
|
|
208
253
|
|
|
209
254
|
def get_github_ossname(link):
|
|
@@ -263,7 +308,7 @@ def download_git_repository(refs_to_checkout, git_url, target_dir, tag, called_c
|
|
|
263
308
|
def download_git_clone(git_url, target_dir, checkout_to="", tag="", branch="",
|
|
264
309
|
ssh_key="", id="", git_token="", called_cli=True):
|
|
265
310
|
oss_name = get_github_ossname(git_url)
|
|
266
|
-
refs_to_checkout = decide_checkout(checkout_to, tag, branch)
|
|
311
|
+
refs_to_checkout = decide_checkout(checkout_to, tag, branch, git_url)
|
|
267
312
|
msg = ""
|
|
268
313
|
success = True
|
|
269
314
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{fosslight_util-2.1.26 → fosslight_util-2.1.27}/src/fosslight_util.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|