launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #28990
[Merge] ~jugmac00/lpcraft:rename-apt-replace-repositories into lpcraft:main
Jürgen Gmach has proposed merging ~jugmac00/lpcraft:rename-apt-replace-repositories into lpcraft:main with ~jugmac00/lpcraft:provide-additional-repositories-via-cli as a prerequisite.
Commit message:
Deprecate ``--apt-replace-repositories``
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~jugmac00/lpcraft/+git/lpcraft/+merge/428115
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~jugmac00/lpcraft:rename-apt-replace-repositories into lpcraft:main.
diff --git a/NEWS.rst b/NEWS.rst
index cc1afac..f450fb1 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -18,6 +18,9 @@ Version history
but no ``properties`` key under that.
=======
- Enable providing additional repositories via CLI.
+
+- Deprecate ``--apt-replace-repositories``, introduce
+ ``--replace-package-repositories``.
>>>>>>> NEWS.rst
0.0.24 (2022-08-05)
diff --git a/docs/cli-interface.rst b/docs/cli-interface.rst
index 38a98f1..3edffa0 100644
--- a/docs/cli-interface.rst
+++ b/docs/cli-interface.rst
@@ -19,11 +19,6 @@ This command runs all jobs listed via pipelines from a configuration file.
lpcraft run optional arguments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ``--apt-replace-repositories SOURCE_LINE``, e.g.
- ``lpcraft run --apt-replace-repositories "deb http://archive.ubuntu.com/ubuntu/ focal main restricted"``
-
- This option is repeatable.
-
- ``--package-repository`` (provide an additional repository), e.g.
``lpcraft run --package-repository "deb http://archive.ubuntu.com/ubuntu/ focal main restricted"``
This option is repeatable.
@@ -33,6 +28,12 @@ lpcraft run optional arguments
This option is repeatable.
+- ``--replace-package-repositories SOURCE_LINE``, e.g.
+ ``lpcraft run --replace-package-repositories "deb http://archive.ubuntu.com/ubuntu/ focal main restricted"``
+
+ This option is repeatable.
+
+
- ``--secrets``, e.g.
``lpcraft run --secrets="<path-to-configuration-file>"``
@@ -62,11 +63,6 @@ where ``test`` is the job name and ``0`` is the index of the job/matrix.
lpcraft run-one optional arguments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ``--apt-replace-repositories SOURCE_LINE``, e.g.
- ``lpcraft run-one --apt-replace-repositories "deb http://archive.ubuntu.com/ubuntu/ focal main restricted" test 0``
-
- This option is repeatable.
-
- ``--package-repository`` (provide an additional repository), e.g.
``lpcraft run-one --package-repository "deb http://archive.ubuntu.com/ubuntu/ focal main restricted" test 0``
This option is repeatable.
@@ -76,6 +72,11 @@ lpcraft run-one optional arguments
This option is repeatable.
+- ``--replace-package-repositories SOURCE_LINE``, e.g.
+ ``lpcraft run-one --replace-package-repositories "deb http://archive.ubuntu.com/ubuntu/ focal main restricted" test 0``
+
+ This option is repeatable.
+
- ``--secrets``, e.g.
``lpcraft run-one --secrets="<path-to-configuration-file>" test 0``
diff --git a/lpcraft/commands/run.py b/lpcraft/commands/run.py
index 1da9f8c..9e4da33 100644
--- a/lpcraft/commands/run.py
+++ b/lpcraft/commands/run.py
@@ -588,6 +588,13 @@ class RunCommand(BaseCommand):
parser.add_argument(
"--apt-replace-repositories",
action="append",
+ default=[],
+ help="(deprecated) Overwrite /etc/apt/sources.list.",
+ )
+ parser.add_argument(
+ "--replace-package-repositories",
+ action="append",
+ default=[],
help="Overwrite /etc/apt/sources.list.",
)
parser.add_argument(
@@ -618,6 +625,11 @@ class RunCommand(BaseCommand):
def run(self, args: Namespace) -> int:
"""Run the command."""
+ if getattr(args, "apt_replace_repositories"):
+ emit.message(
+ "Warning: `--apt-replace-repositories` is deprecated - "
+ "Please use `--replace-package-repositories instead"
+ )
config = Config.load(args.config)
provider = get_provider()
@@ -657,6 +669,7 @@ class RunCommand(BaseCommand):
args.output_directory,
apt_replacement_repositories=(
args.apt_replace_repositories
+ + args.replace_package_repositories
),
package_repositories=package_repositories, # noqa: E501
env_from_cli=args.set_env,
@@ -731,6 +744,13 @@ class RunOneCommand(BaseCommand):
parser.add_argument(
"--apt-replace-repositories",
action="append",
+ default=[],
+ help="(deprecated) Overwrite /etc/apt/sources.list.",
+ )
+ parser.add_argument(
+ "--replace-package-repositories",
+ action="append",
+ default=[],
help="Overwrite /etc/apt/sources.list.",
)
parser.add_argument(
@@ -761,6 +781,11 @@ class RunOneCommand(BaseCommand):
def run(self, args: Namespace) -> int:
"""Run the command."""
+ if getattr(args, "apt_replace_repositories"):
+ emit.message(
+ "Warning: `--apt-replace-repositories` is deprecated - "
+ "Please use `--replace-package-repositories instead"
+ )
config = Config.load(args.config)
jobs = config.jobs.get(args.job, [])
@@ -792,7 +817,10 @@ class RunOneCommand(BaseCommand):
args.index,
provider,
args.output_directory,
- apt_replacement_repositories=args.apt_replace_repositories,
+ apt_replacement_repositories=(
+ args.apt_replace_repositories
+ + args.replace_package_repositories
+ ),
package_repositories=package_repositories,
env_from_cli=args.set_env,
plugin_settings=args.plugin_setting,
References