Skip to content

Commit

Permalink
fix default url and copyright encoding issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nmvrs committed Oct 15, 2024
1 parent d15e4d3 commit 2906e11
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,7 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

/.vscode/
/.vscode/
*.spdx.json
*_license_info.json
*_EULA.txt
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get_requirements():


PACKAGE_NAME = "vcpkg-sbom"
VERSION = "0.0.4"
VERSION = "0.0.5"
AUTHOR = "Moverse P.C."
EMAIL = "[email protected]"
LICENSE = "MIT"
Expand Down
11 changes: 9 additions & 2 deletions vcpkg_sbom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import typing

import rich
import rich.panel
import rich.progress
import spdx_tools.spdx.document_utils
import spdx_tools.spdx.model as spdx
Expand Down Expand Up @@ -137,13 +138,14 @@ def _add_licenses(
os.linesep,
"*" * 80,
os.linesep,
"\t" * 5,
pkg_name,
os.linesep,
"*" * 80,
os.linesep,
]
)
with open(license_path, "r") as f:
with open(license_path, "r", errors="ignore") as f:
writer.write(f.read())
pbar.update(task, advance=1)

Expand Down Expand Up @@ -176,7 +178,7 @@ def _parse_args():
"-n",
"--namespace",
type=str,
default="spdx.org/spdxdocs",
default="https://spdx.org/spdxdocs/",
help="The software's namespace to use for the `spdx` file.",
)
parser.add_argument(
Expand Down Expand Up @@ -211,6 +213,11 @@ def _parse_args():
def run():
args = _parse_args()
vcpkg_triplet_path = pathlib.Path(args.vcpkg_root) / pathlib.Path(args.triplet)
if not os.path.exists(vcpkg_triplet_path):
rich.print(
f"Manifest path [[cyan italic]{vcpkg_triplet_path}[/cyan italic]] [red][bold]does not[/bold] exist[/red], exiting."
)
exit(-1)

spdx_json_paths = set()
for spdx_json_path in vcpkg_triplet_path.glob("**/share/**/*.spdx.json"):
Expand Down

0 comments on commit 2906e11

Please sign in to comment.