Skip to content

Commit

Permalink
chore: small updates and nit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdcordeiro committed May 2, 2024
1 parent b60e902 commit 673670e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/scripts/install-slices/install_slices.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def ignore_missing_packages(


def install_slice(
pkg: str, slice: str, arch: str, release: str, has_copyright: dict
pkg: str, slice: str, arch: str, release: str, installed_copyright: dict
) -> None:
"""
Install the slice by running "chisel cut".
Expand Down Expand Up @@ -295,7 +295,7 @@ def install_slice(
sys.exit(res.returncode)
# Check if the copyright file has been installed with this slice
copyright_file = pathlib.Path(f"{tmpfs}/usr/share/doc/{pkg}/copyright")
has_copyright[slice_name] = (
installed_copyright[slice_name] = (
copyright_file.is_file() or copyright_file.is_symlink()
)

Expand Down Expand Up @@ -373,7 +373,7 @@ def main() -> None:
# This should always be the case, whether enforced by a global "essential"
# or Chisel itself. Exception: the copyright file will not be installed
# if it doesn't exist in the deb itself.
has_copyright = {}
installed_copyright = {}
for slice in pkg.slices:
if cli_args.dry_run:
logging.info(
Expand All @@ -387,17 +387,18 @@ def main() -> None:
slice,
cli_args.arch,
cli_args.release,
has_copyright,
installed_copyright,
)

if not all(has_copyright.values()):
if not all(installed_copyright.values()):
# Does the copyright file exist in the deb?
if deb_has_copyright_file(pkg.package):
err = "{} has a copyright file but it wasn't installed with: {}".format(
pkg.package,
",".join(
list(
filter(lambda c: not has_copyright[c], has_copyright.keys())
filter(
lambda c: not installed_copyright[c],
installed_copyright.keys(),
)
),
)
Expand Down

0 comments on commit 673670e

Please sign in to comment.