From 13608077ae2b158684bb2480b1fe0ae42788354d Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Fri, 17 Apr 2020 10:11:14 -0700 Subject: [PATCH] Add --no-system-repos to lorax-composer Running lorax-composer --no-system-repos will prevent it from copying the yum repositories from /etc/yum.repos.d/ into the lorax-composer repo directory. It will *only* use repositories setup using the sources api or written to /var/lib/lorax/composer/repos.d/ If lorax-composer has previously been run without this switch the system repos will need to be removed from the composer/repos.d/ directory. It would also be a good idea to remove the cached metadata in /var/tmp/composer/ Resolves: rhbz#1785388 --- src/sbin/lorax-composer | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sbin/lorax-composer b/src/sbin/lorax-composer index b007b1bd..34c5548b 100755 --- a/src/sbin/lorax-composer +++ b/src/sbin/lorax-composer @@ -79,6 +79,8 @@ def get_parser(): help="Top level temporary directory") parser.add_argument("--proxy", default=None, metavar="PROXY", help="Set proxy for DNF, overrides configuration file setting.") + parser.add_argument("--no-system-repos", action="store_true", default=False, + help="Do not copy over system repos from /etc/yum.repos.d/ at startup") parser.add_argument("BLUEPRINTS", metavar="BLUEPRINTS", help="Path to the blueprints") @@ -243,6 +245,10 @@ if __name__ == '__main__': if opts.proxy: server.config["COMPOSER_CFG"].set("yum", "proxy", opts.proxy) + # Override using system repos + if opts.no_system_repos: + server.config["COMPOSER_CFG"].set("repos", "use_system_repos", "0") + # Make sure the queue paths are setup correctly, exit on errors errors = make_queue_dirs(server.config["COMPOSER_CFG"], gid) if errors: