Skip to content

Commit

Permalink
fix: deprecate enable-manifest and manifest-image-information
Browse files Browse the repository at this point in the history
`--enable-manifest` and `--manifest-image-information` no longer
supported in core24.
  • Loading branch information
syu-w committed Feb 27, 2024
1 parent 8a9a5c2 commit fde93fd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions snapcraft/commands/lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ def fill_parser(self, parser: "argparse.ArgumentParser") -> None:
"--enable-manifest",
action="store_true",
default=utils.strtobool(os.getenv("SNAPCRAFT_BUILD_INFO", "n")),
help="Generate snap manifest",
help="Generate snap manifest (Deprecated)",
)
parser.add_argument(
"--manifest-image-information",
type=str,
metavar="image-info",
default=os.getenv("SNAPCRAFT_IMAGE_INFO"),
help="Set snap manifest image-info",
help="Set snap manifest image-info (Deprecated)",
)
parser.add_argument(
"--bind-ssh",
Expand Down
2 changes: 1 addition & 1 deletion snapcraft/commands/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def _load_lint_filters(self, project: Optional[models.Project]) -> models.Lint:
)
emit.verbose(
"To include 'snapcraft.yaml' in a snap file, use the parameter "
"'--enable-manifest' when building the snap."
"'--enable-manifest' when building the snap. (Deprecated)"
)

return lint_config
12 changes: 12 additions & 0 deletions snapcraft/parts/lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,10 @@ def _generate_metadata(
emit.progress("Generated snap metadata", permanent=True)

if parsed_args.enable_manifest:
emit.progress(
"'--enable-manifest' is deprecated, and will be removed in core24.",
permanent=True,
)
_generate_manifest(
project,
lifecycle=lifecycle,
Expand Down Expand Up @@ -414,9 +418,17 @@ def _run_in_provider( # noqa PLR0915

if getattr(parsed_args, "enable_manifest", False):
cmd.append("--enable-manifest")
emit.progress(
"'--enable-manifest' is deprecated, and will be removed in core24.",
permanent=True,
)
image_information = getattr(parsed_args, "manifest_image_information", None)
if image_information:
cmd.extend(["--manifest-image-information", image_information])
emit.progress(
"'--manifest-image-information' is deprecated, and will be removed in core24.",
permanent=True,
)

cmd.append("--build-for")
cmd.append(project.get_build_for())
Expand Down

0 comments on commit fde93fd

Please sign in to comment.