fosslight-util 2.1.16__tar.gz → 2.1.17__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.
Files changed (39) hide show
  1. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/PKG-INFO +1 -1
  2. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/setup.py +1 -1
  3. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/download.py +30 -12
  4. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util.egg-info/PKG-INFO +1 -1
  5. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/LICENSE +0 -0
  6. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/MANIFEST.in +0 -0
  7. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/README.md +0 -0
  8. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/requirements.txt +0 -0
  9. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/setup.cfg +0 -0
  10. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/__init__.py +0 -0
  11. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/_get_downloadable_url.py +0 -0
  12. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/compare_yaml.py +0 -0
  13. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/constant.py +0 -0
  14. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/correct.py +0 -0
  15. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/cover.py +0 -0
  16. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/exclude.py +0 -0
  17. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/help.py +0 -0
  18. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/oss_item.py +0 -0
  19. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/output_format.py +0 -0
  20. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/parsing_yaml.py +0 -0
  21. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/read_excel.py +0 -0
  22. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/resources/frequentLicenselist.json +0 -0
  23. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/resources/frequent_license_nick_list.json +0 -0
  24. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/resources/licenses.json +0 -0
  25. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/set_log.py +0 -0
  26. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/spdx_licenses.py +0 -0
  27. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/timer_thread.py +0 -0
  28. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/write_cyclonedx.py +0 -0
  29. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/write_excel.py +0 -0
  30. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/write_opossum.py +0 -0
  31. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/write_scancodejson.py +0 -0
  32. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/write_spdx.py +0 -0
  33. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/write_txt.py +0 -0
  34. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util/write_yaml.py +0 -0
  35. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util.egg-info/SOURCES.txt +0 -0
  36. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util.egg-info/dependency_links.txt +0 -0
  37. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util.egg-info/entry_points.txt +0 -0
  38. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util.egg-info/requires.txt +0 -0
  39. {fosslight_util-2.1.16 → fosslight_util-2.1.17}/src/fosslight_util.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fosslight_util
3
- Version: 2.1.16
3
+ Version: 2.1.17
4
4
  Summary: FOSSLight Util
5
5
  Home-page: https://github.com/fosslight/fosslight_util
6
6
  Author: LG Electronics
@@ -14,7 +14,7 @@ with open('requirements.txt', 'r', 'utf-8') as f:
14
14
  if __name__ == "__main__":
15
15
  setup(
16
16
  name='fosslight_util',
17
- version='2.1.16',
17
+ version='2.1.17',
18
18
  package_dir={"": "src"},
19
19
  packages=find_packages(where='src'),
20
20
  description='FOSSLight Util',
@@ -95,7 +95,8 @@ def parse_src_link(src_link):
95
95
 
96
96
  def cli_download_and_extract(link: str, target_dir: str, log_dir: str, checkout_to: str = "",
97
97
  compressed_only: bool = False, ssh_key: str = "",
98
- id: str = "", git_token: str = "") -> Tuple[bool, str, str, str]:
98
+ id: str = "", git_token: str = "",
99
+ called_cli: bool = True) -> Tuple[bool, str, str, str]:
99
100
  global logger
100
101
 
101
102
  success = True
@@ -127,7 +128,8 @@ def cli_download_and_extract(link: str, target_dir: str, log_dir: str, checkout_
127
128
  success_git, msg, oss_name, oss_version = download_git_clone(link, target_dir,
128
129
  checkout_to,
129
130
  tag, branch,
130
- ssh_key, id, git_token)
131
+ ssh_key, id, git_token,
132
+ called_cli)
131
133
  link = change_ssh_link_to_https(link)
132
134
  if (not is_rubygems) and (not success_git):
133
135
  if os.path.isfile(target_dir):
@@ -205,28 +207,44 @@ def get_github_token(git_url):
205
207
  return github_token
206
208
 
207
209
 
208
- def download_git_repository(refs_to_checkout, git_url, target_dir, tag):
210
+ def download_git_repository(refs_to_checkout, git_url, target_dir, tag, called_cli=True):
209
211
  success = False
210
212
  oss_version = ""
211
213
 
212
214
  logger.info(f"Download git url :{git_url}")
215
+ env = os.environ.copy()
216
+ if not called_cli:
217
+ env["GIT_TERMINAL_PROMPT"] = "0"
213
218
  if refs_to_checkout:
214
219
  try:
215
220
  # gitPython uses the branch argument the same whether you check out to a branch or a tag.
216
- Repo.clone_from(git_url, target_dir, branch=refs_to_checkout)
217
- success = True
218
- oss_version = refs_to_checkout
221
+ Repo.clone_from(git_url, target_dir, branch=refs_to_checkout, env=env)
222
+ if any(Path(target_dir).iterdir()):
223
+ success = True
224
+ oss_version = refs_to_checkout
225
+ logger.info(f"Files found in {target_dir} after clone.")
226
+ else:
227
+ logger.info(f"No files found in {target_dir} after clone.")
228
+ success = False
219
229
  except GitCommandError as error:
220
- logger.debug(f"Git checkout error:{error}")
230
+ logger.info(f"Git checkout error:{error}")
231
+ success = False
232
+ except Exception as e:
233
+ logger.info(f"Repo.clone_from error:{e}")
221
234
  success = False
222
235
 
223
236
  if not success:
224
- Repo.clone_from(git_url, target_dir)
225
- success = True
237
+ Repo.clone_from(git_url, target_dir, env=env)
238
+ if any(Path(target_dir).iterdir()):
239
+ success = True
240
+ else:
241
+ logger.info(f"No files found in {target_dir} after clone.")
242
+ success = False
226
243
  return success, oss_version
227
244
 
228
245
 
229
- def download_git_clone(git_url, target_dir, checkout_to="", tag="", branch="", ssh_key="", id="", git_token=""):
246
+ def download_git_clone(git_url, target_dir, checkout_to="", tag="", branch="",
247
+ ssh_key="", id="", git_token="", called_cli=True):
230
248
  oss_name = get_github_ossname(git_url)
231
249
  refs_to_checkout = decide_checkout(checkout_to, tag, branch)
232
250
  msg = ""
@@ -250,7 +268,7 @@ def download_git_clone(git_url, target_dir, checkout_to="", tag="", branch="", s
250
268
  logger.info(f"Download git with ssh_key:{git_url}")
251
269
  git_ssh_cmd = f'ssh -i {ssh_key}'
252
270
  with Git().custom_environment(GIT_SSH_COMMAND=git_ssh_cmd):
253
- success, oss_version = download_git_repository(refs_to_checkout, git_url, target_dir, tag)
271
+ success, oss_version = download_git_repository(refs_to_checkout, git_url, target_dir, tag, called_cli)
254
272
  else:
255
273
  if id and git_token:
256
274
  try:
@@ -262,7 +280,7 @@ def download_git_clone(git_url, target_dir, checkout_to="", tag="", branch="", s
262
280
  git_url = git_url.replace(protocol, f"{protocol}{encoded_id}:{encoded_git_token}@")
263
281
  except Exception as error:
264
282
  logger.info(f"Failed to insert id, token to git url:{error}")
265
- success, oss_version = download_git_repository(refs_to_checkout, git_url, target_dir, tag)
283
+ success, oss_version = download_git_repository(refs_to_checkout, git_url, target_dir, tag, called_cli)
266
284
 
267
285
  logger.info(f"git checkout: {oss_version}")
268
286
  refs_to_checkout = oss_version
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fosslight-util
3
- Version: 2.1.16
3
+ Version: 2.1.17
4
4
  Summary: FOSSLight Util
5
5
  Home-page: https://github.com/fosslight/fosslight_util
6
6
  Author: LG Electronics
File without changes