ScriptCollection 4.2.102__py3-none-any.whl → 4.2.104__py3-none-any.whl

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.
@@ -39,7 +39,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
39
39
  from .ProgramRunnerPopen import ProgramRunnerPopen
40
40
  from .SCLog import SCLog, LogLevel
41
41
 
42
- version = "4.2.102"
42
+ version = "4.2.104"
43
43
  __version__ = version
44
44
 
45
45
  class VSCodeWorkspaceShellTask:
@@ -60,8 +60,16 @@ class TFCPS_CodeUnitSpecific_Docker_Functions(TFCPS_CodeUnitSpecific_Base):
60
60
  sbom_folder = os.path.join(artifacts_folder, "BOM")
61
61
  codeunitversion = self.tfcps_Tools_General.get_version_of_codeunit(self.get_codeunit_file())
62
62
  GeneralUtilities.ensure_directory_exists(sbom_folder)
63
- self._protected_sc.run_program_argsasarray("docker", ["run","--rm","-v","/var/run/docker.sock:/var/run/docker.sock","-v","./BOM:/BOM",self.tfcps_Tools_General.oci_image_manager.get_registry_address_for_image_with_default_tag(self.get_repository_folder(),"Syft",True),f"{codeunitname_lower}:{codeunitversion}","-o",f"cyclonedx-xml=./BOM/{codeunitname}.{codeunitversion}.sbom.xml"], artifacts_folder, print_errors_as_information=True)
64
- self._protected_sc.format_xml_file(sbom_folder+f"/{codeunitname}.{codeunitversion}.sbom.xml")
63
+ sbom_file = os.path.join(sbom_folder, f"{codeunitname}.{codeunitversion}.sbom.xml")
64
+ # Let syft write the SBOM to stdout and capture it instead of retrieving it via a
65
+ # bind-mount: in CI the docker daemon does not share this job's filesystem (mounted
66
+ # socket / DinD), so a "-v ./BOM:/BOM" mount would write the file onto the daemon host
67
+ # rather than into this job's BOM folder. stdout flows back through the docker client,
68
+ # so it works regardless of where the daemon runs. format_xml_file re-parses and
69
+ # rewrites the document, so the resulting file is byte-stable.
70
+ syft_result = self._protected_sc.run_program_argsasarray("docker", ["run","--rm","-v","/var/run/docker.sock:/var/run/docker.sock",self.tfcps_Tools_General.oci_image_manager.get_registry_address_for_image_with_default_tag(self.get_repository_folder(),"Syft",True),f"{codeunitname_lower}:{codeunitversion}","-o","cyclonedx-xml"], artifacts_folder, print_errors_as_information=True)
71
+ GeneralUtilities.write_text_to_file(sbom_file, syft_result[1])
72
+ self._protected_sc.format_xml_file(sbom_file)
65
73
 
66
74
  @GeneralUtilities.check_arguments
67
75
  def linting(self) -> None:
@@ -78,7 +78,11 @@ class TFCPS_Tools_General:
78
78
  file_exists = os.path.isfile(file)
79
79
  if not file_exists:
80
80
  self.__sc.log.log(f"Download Asset \"{githubuser}/{githubprojectname}: {local_resource_name}\" from GitHub to global cache...", LogLevel.Information)
81
- GeneralUtilities.ensure_folder_exists_and_is_empty(resource_folder)
81
+ # Only ensure the folder exists; do NOT empty it. Several assets (e.g. the
82
+ # linux/windows x64/arm64 variants of cyclonedx-cli) share one resource folder
83
+ # and are downloaded one after another, so emptying here would delete the
84
+ # siblings downloaded by previous calls and leave only the last one.
85
+ GeneralUtilities.ensure_directory_exists(resource_folder)
82
86
  headers = { 'User-Agent': 'Mozilla/5.0'}
83
87
  self.__add_github_api_key_if_available(headers)
84
88
  url = f"https://api.github.com/repos/{githubuser}/{githubprojectname}/releases/latest"
@@ -105,6 +109,10 @@ class TFCPS_Tools_General:
105
109
  sys.stdout.write(f"\rDownload: {percent:.2f}%")
106
110
  sys.stdout.flush()
107
111
  self.__sc.log.log(f"Downloaded \"{url}\".", LogLevel.Diagnostic)
112
+ if not GeneralUtilities.current_system_is_windows():
113
+ # Downloaded binaries (e.g. cyclonedx-linux-x64) are written without the
114
+ # executable bit; make them runnable so they can be executed directly.
115
+ os.chmod(file, 0o755)
108
116
  GeneralUtilities.assert_file_exists(file)
109
117
  return file
110
118
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scriptcollection
3
- Version: 4.2.102
3
+ Version: 4.2.104
4
4
  Summary: The ScriptCollection is the place for reusable scripts.
5
5
  Author-email: Marius Göcke <marius.goecke@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/anionDev/ScriptCollection
@@ -15,7 +15,7 @@ ScriptCollection/ProgramRunnerMock.py,sha256=uTu-aFle1W_oKjeQEmuPsFPQpvo0kRf2FrR
15
15
  ScriptCollection/ProgramRunnerPopen.py,sha256=BPY7-ZMIlqT7JOKz8qlB5c0laF2Js-ijzqk09GxZC48,3821
16
16
  ScriptCollection/ProgramRunnerSudo.py,sha256=_khC3xuTdrPoLluBJZWfldltmmuKltABJPcbjZSFW-4,4835
17
17
  ScriptCollection/SCLog.py,sha256=8TRy1LeYMsPOIuWUcnUNNbO5pd-cNBS-3cn-kdzP8FU,4768
18
- ScriptCollection/ScriptCollectionCore.py,sha256=Pj6fVUZZLSJg3yFzQ5loZ-AONVMPthDyb6K8o2FrvNg,188793
18
+ ScriptCollection/ScriptCollectionCore.py,sha256=OjaX-610PHu_SdLs1unvSKRCgr7YkJeYb5e1px8y2i8,188793
19
19
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  ScriptCollection/OCIImages/AbstractImageHandler.py,sha256=o129UYDtLymCRjMZBP9Puaj19ueMHoNt6UTLspfnaRc,1758
21
21
  ScriptCollection/OCIImages/OCIImageManager.py,sha256=2muW4hJ_a7EfavY3WVnafqZ0HC87RcZsoTuNvA3c0To,11175
@@ -38,9 +38,9 @@ ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=Tpzgiz6m3-cYCkObZOG5Uu7oM-EMoWFzz
38
38
  ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=Vwj7IWmvwIICXiv7I-c6MkxbqlRWCEwzaKW6dgEUjCM,7480
39
39
  ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=xVPer8EGH5vhTT3_mpTMJJxWLB3aLxIcyTxKHODMbYg,22201
40
40
  ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=f0Uq1cA_4LvmL72cal0crrbKF6PcxL13D9wBKuQ1YBw,2328
41
- ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=3XDCYZb8i3jRXW41Nket25CzOXHwv2xuXaTwtpbGVEU,101354
41
+ ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=h2goAG1BYSdtJq_9olyOm_nyt1UNxZxUXss-2MddRB0,101968
42
42
  ScriptCollection/TFCPS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
- ScriptCollection/TFCPS/Docker/TFCPS_CodeUnitSpecific_Docker.py,sha256=zR4F8FKzA2CZRcSfXy3DSWlJRRZQcMcFezaTy96TgxE,12168
43
+ ScriptCollection/TFCPS/Docker/TFCPS_CodeUnitSpecific_Docker.py,sha256=TU9An7feBsSMardrtr0byYijQfYWxA_LB27yVNsOqy8,12762
44
44
  ScriptCollection/TFCPS/Docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
45
  ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationBase.py,sha256=bT6Gd5pQpZCw4OQz6HWkPCSn5z__eUUEisABLDSxd0o,200
46
46
  ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationGenerate.py,sha256=QyjOfMY22JWCvKjMelHiDWbJiWqotOfebpJpgDUaoO4,237
@@ -291,8 +291,8 @@ build/lib/build/lib/build/lib/build/lib/ScriptCollection/TFCPS/Python/TFCPS_Code
291
291
  build/lib/build/lib/build/lib/build/lib/ScriptCollection/TFCPS/Python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
292
292
  build/lib/build/lib/build/lib/build/lib/ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=WhOsMpJxNGqnQGA3nJ99ruyqymxBeJxCcpK98zJduTo,1680
293
293
  build/lib/build/lib/build/lib/build/lib/ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
294
- scriptcollection-4.2.102.dist-info/METADATA,sha256=116Cx6_J8GVQqR2INdDeq8h1ufqwnxYnN2G5A52TLas,7697
295
- scriptcollection-4.2.102.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
296
- scriptcollection-4.2.102.dist-info/entry_points.txt,sha256=wzcO3R2IXAbYjDCev4cF8q1Yn-2ZCNJhiud_NzzJ9RM,4901
297
- scriptcollection-4.2.102.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
298
- scriptcollection-4.2.102.dist-info/RECORD,,
294
+ scriptcollection-4.2.104.dist-info/METADATA,sha256=k7vUxTicHpbYJ9UonUXyaJy7cf_a_bZ7oW8ndQUVAM0,7697
295
+ scriptcollection-4.2.104.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
296
+ scriptcollection-4.2.104.dist-info/entry_points.txt,sha256=wzcO3R2IXAbYjDCev4cF8q1Yn-2ZCNJhiud_NzzJ9RM,4901
297
+ scriptcollection-4.2.104.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
298
+ scriptcollection-4.2.104.dist-info/RECORD,,