]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
config: remove RepositoryDirectories= option
authorJoerg Behrmann <behrmann@physik.fu-berlin.de>
Thu, 8 Jun 2023 09:38:42 +0000 (11:38 +0200)
committerJoerg Behrmann <behrmann@physik.fu-berlin.de>
Thu, 8 Jun 2023 13:12:19 +0000 (15:12 +0200)
NEWS.md
mkosi.md
mkosi/__init__.py
mkosi/config.py
mkosi/distributions/arch.py
mkosi/distributions/debian.py
mkosi/distributions/fedora.py

diff --git a/NEWS.md b/NEWS.md
index 9b2e0964664836b39a48c7107b526b574138b03b..64d9e6643514eff8c74bf5f627c2df436c50e05b 100644 (file)
--- a/NEWS.md
+++ b/NEWS.md
@@ -26,8 +26,7 @@
     kernel images is trivial and fast these days.
 - Support for --qemu-boot was dropped
 - Support for --use-host-repositories was dropped, use --repository-directory instead
-- `RepositoryDirectory` was renamed to `RepositoryDirectories` and now takes a comma-separated
-  list of directories to look for extra repository files.
+- `RepositoryDirectory` was removed, use `PackageManagerTrees=` or `SkeletonTrees=` instead.
 - `--repositories` is now only usable on Debian/RPM based distros and can only be used to enable additional
   repositories. Specifically, it cannot be used on Arch Linux anymore to add new repositories.
 - The `_epel` distributions were removed. Use `--repositories=epel` instead to enable
index 15f0270f6065dd617e6c328c1f24705651ff23ad..b1bdb5724f89a00f1b87a7f24b2947218f894fe0 100644 (file)
--- a/mkosi.md
+++ b/mkosi.md
@@ -375,15 +375,6 @@ they should be specified with a boolean argument: either "1", "yes", or "true" t
   Linux, additional repositories must be passed in the form `<name>::<url>`
   (e.g. `myrepo::https://myrepo.net`).
 
-`RepositoryDirectories`, `--repo-dir=`
-
-: This option can (for now) only be used with RPM-based distributions,
-  Debian-based distributions and Arch Linux. It takes a comma separated list of
-  directories containing extra repository definitions that will be used when
-  installing packages. The files are passed directly to the corresponding
-  package manager and should be written in the format expected by the package
-  manager of the image's distro.
-
 `Architecture=`, `--architecture=`
 
 : The architecture to build the image for. A number of architectures can be specified, but which ones are
@@ -1301,10 +1292,6 @@ local directory:
   build result of a preceding run might be copied into a build image
   as part of the source tree (see above).
 
-* The **`mkosi.reposdir/`** directory, if it exists, is automatically
-  used as the repository directory for extra repository files. See
-  the `RepositoryDirectories` option for more information.
-
 * The **`mkosi.credentials/`** directory is used as a
   source of extra credentials similar to the `Credentials=` option. For
   each file in the directory, the filename will be used as the credential
index 68ae82f1234f96ea4b7e7a35409b7d8f9dd81240..230385177414b51ca628976c2cc1dbd316cf5fe5 100644 (file)
@@ -815,7 +815,6 @@ def install_unified_kernel(state: MkosiState, roothash: Optional[str]) -> None:
                 *(["--mirror", state.config.mirror] if state.config.mirror else []),
                 "--repository-key-check", yes_no(state.config.repository_key_check),
                 "--repositories", ",".join(state.config.repositories),
-                "--repo-dir", ",".join(str(p) for p in state.config.repo_dirs),
                 *(["--compress-output", str(state.config.compress_output)] if state.config.compress_output else []),
                 "--with-network", yes_no(state.config.with_network),
                 "--cache-only", yes_no(state.config.cache_only),
index 39d8d3a7eaf8bfd723f8e9e0087cd7d7ac715d27..2a7f6e24fa63d11089fb0803c055a69d0c0c1438 100644 (file)
@@ -572,7 +572,6 @@ class MkosiConfig:
     local_mirror: Optional[str]
     repository_key_check: bool
     repositories: list[str]
-    repo_dirs: list[Path]
     repart_dirs: list[Path]
     overlay: bool
     architecture: Architecture
@@ -777,13 +776,6 @@ class MkosiConfigParser:
             section="Distribution",
             parse=config_make_list_parser(delimiter=","),
         ),
-        MkosiConfigSetting(
-            dest="repo_dirs",
-            name="RepositoryDirectories",
-            section="Distribution",
-            parse=config_make_list_parser(delimiter=",", parse=make_path_parser()),
-            paths=("mkosi.reposdir",),
-        ),
         MkosiConfigSetting(
             dest="output_format",
             name="Format",
@@ -1470,13 +1462,6 @@ class MkosiConfigParser:
             help="Repositories to use",
             action=action,
         )
-        group.add_argument(
-            "--repo-dir",
-            metavar="PATH",
-            help="Specify a directory containing extra distribution specific repository files",
-            dest="repo_dirs",
-            action=action,
-        )
 
         group = parser.add_argument_group("Output options")
         group.add_argument(
@@ -2240,13 +2225,6 @@ def load_config(args: argparse.Namespace) -> MkosiConfig:
             die("UEFI SecureBoot enabled, but couldn't find certificate.",
                 hint="Consider placing it in mkosi.crt")
 
-    if args.repo_dirs and not (
-        is_dnf_distribution(args.distribution)
-        or is_apt_distribution(args.distribution)
-        or args.distribution == Distribution.arch
-    ):
-        die("--repo-dir is only supported on DNF/Debian based distributions and Arch")
-
     if args.qemu_kvm == ConfigFeature.enabled and not qemu_check_kvm_support():
         die("Sorry, the host machine does not support KVM acceleration.")
 
index 409f0594dff0b703ed2eed5489ec0d702677006d..b719f2574685f198b34be80ab0035adbfe8d5217 100644 (file)
@@ -84,8 +84,6 @@ class ArchInstaller(DistributionInstaller):
                     )
                 )
 
-            for d in state.config.repo_dirs:
-                f.write(f"Include = {d}/*\n")
 
         return invoke_pacman(state, packages, apivfs=apivfs)
 
index e5e4ec5f2bb79770a82acf0f85fb0e6aa3d3ef2c..15c8c6bdd47dc496cb8055498433fe6bc8217574 100644 (file)
@@ -212,13 +212,6 @@ def setup_apt(state: MkosiState, repos: Sequence[str]) -> None:
         for repo in repos:
             f.write(f"{repo}\n")
 
-    for repo_dir in state.config.repo_dirs:
-        for src in repo_dir.iterdir():
-            if not src.is_file():
-                continue
-            if src.suffix in (".list", ".sources"):
-                shutil.copyfile(src, state.workspace.joinpath("pkgmngr/etc/apt/sources.list.d", src.name))
-
 
 def invoke_apt(
     state: MkosiState,
@@ -246,10 +239,3 @@ def install_apt_sources(state: MkosiState, repos: Sequence[str]) -> None:
         with sources.open("w") as f:
             for repo in repos:
                 f.write(f"{repo}\n")
-
-    # Already contains a merged tree of repo_dirs after setup_apt
-    for src in state.workspace.joinpath("pkgmngr/etc/apt/sources.list.d").iterdir():
-        dst = state.root.joinpath("etc/apt/sources.list.d", src.name)
-        if dst.exists():
-            continue
-        shutil.copyfile(src, dst)
index 40506656ba20a6aed7645d90bf9303283ec9b014..84a421be9131021b119a87dcdaa6cc169a1db115 100644 (file)
@@ -174,7 +174,6 @@ def invoke_dnf(
         "--setopt=keepcache=1",
         "--setopt=install_weak_deps=0",
         f"--setopt=cachedir={state.cache_dir}",
-        f"--setopt=reposdir={' '.join(str(p) for p in state.config.repo_dirs)}",
         f"--setopt=varsdir={state.pkgmngr / 'etc/dnf/vars'}",
         f"--setopt=logdir={state.pkgmngr / 'var/log'}",
         f"--setopt=persistdir={state.pkgmngr / 'var/lib/dnf'}",