2018-11-13 17:53:31 +00:00
<!DOCTYPE html>
2021-04-23 20:42:41 +00:00
< html class = "writer-html5" lang = "en" >
2018-11-13 17:53:31 +00:00
< head >
2021-04-23 20:42:41 +00:00
< meta charset = "utf-8" / >
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" / >
2021-10-11 22:40:42 +00:00
< title > pylorax.dnfbase — Lorax 36.0 documentation< / title >
< link rel = "stylesheet" href = "../../_static/pygments.css" type = "text/css" / >
< link rel = "stylesheet" href = "../../_static/css/theme.css" type = "text/css" / >
2018-11-13 17:53:31 +00:00
2021-10-11 22:40:42 +00:00
< script data-url_root = "../../" id = "documentation_options" src = "../../_static/documentation_options.js" > < / script >
2020-09-08 18:59:15 +00:00
< script src = "../../_static/jquery.js" > < / script >
< script src = "../../_static/underscore.js" > < / script >
< script src = "../../_static/doctools.js" > < / script >
2021-10-11 22:40:42 +00:00
< script src = "../../_static/js/theme.js" > < / script >
2018-11-13 17:53:31 +00:00
< link rel = "index" title = "Index" href = "../../genindex.html" / >
< link rel = "search" title = "Search" href = "../../search.html" / >
< / head >
2021-10-11 22:40:42 +00:00
< body class = "wy-body-for-nav" >
2018-11-13 17:53:31 +00:00
< div class = "wy-grid-for-nav" >
< nav data-toggle = "wy-nav-shift" class = "wy-nav-side" >
< div class = "wy-side-scroll" >
2019-03-27 23:44:14 +00:00
< div class = "wy-side-nav-search" >
2018-11-13 17:53:31 +00:00
< a href = "../../index.html" class = "icon icon-home" > Lorax
< / a >
< div class = "version" >
2021-10-11 22:40:42 +00:00
36.0
2018-11-13 17:53:31 +00:00
< / div >
< div role = "search" >
< form id = "rtd-search-form" class = "wy-form" action = "../../search.html" method = "get" >
< input type = "text" name = "q" placeholder = "Search docs" / >
< input type = "hidden" name = "check_keywords" value = "yes" / >
< input type = "hidden" name = "area" value = "default" / >
< / form >
< / div >
2021-10-11 22:40:42 +00:00
< / div > < div class = "wy-menu wy-menu-vertical" data-spy = "affix" role = "navigation" aria-label = "Navigation menu" >
2018-11-13 17:53:31 +00:00
< ul >
< li class = "toctree-l1" > < a class = "reference internal" href = "../../intro.html" > Introduction to Lorax< / a > < / li >
< li class = "toctree-l1" > < a class = "reference internal" href = "../../intro.html#before-lorax" > Before Lorax< / a > < / li >
< li class = "toctree-l1" > < a class = "reference internal" href = "../../lorax.html" > Lorax< / a > < / li >
< li class = "toctree-l1" > < a class = "reference internal" href = "../../livemedia-creator.html" > livemedia-creator< / a > < / li >
2019-11-05 22:36:46 +00:00
< li class = "toctree-l1" > < a class = "reference internal" href = "../../mkksiso.html" > mkksiso< / a > < / li >
2018-11-13 17:53:31 +00:00
< li class = "toctree-l1" > < a class = "reference internal" href = "../../product-images.html" > Product and Updates Images< / a > < / li >
< li class = "toctree-l1" > < a class = "reference internal" href = "../../modules.html" > src< / a > < / li >
< / ul >
< / div >
< / div >
< / nav >
2021-10-11 22:40:42 +00:00
< section data-toggle = "wy-nav-shift" class = "wy-nav-content-wrap" > < nav class = "wy-nav-top" aria-label = "Mobile navigation menu" >
2018-11-13 17:53:31 +00:00
< i data-toggle = "wy-nav-top" class = "fa fa-bars" > < / i >
< a href = "../../index.html" > Lorax< / a >
< / nav >
< div class = "wy-nav-content" >
< div class = "rst-content" >
2021-10-11 22:40:42 +00:00
< div role = "navigation" aria-label = "Page navigation" >
2018-11-13 17:53:31 +00:00
< ul class = "wy-breadcrumbs" >
2021-04-23 20:42:41 +00:00
< li > < a href = "../../index.html" class = "icon icon-home" > < / a > » < / li >
2018-11-13 17:53:31 +00:00
< li > < a href = "../index.html" > Module code< / a > » < / li >
< li > < a href = "../pylorax.html" > pylorax< / a > » < / li >
< li > pylorax.dnfbase< / li >
< li class = "wy-breadcrumbs-aside" >
< / li >
< / ul >
< hr / >
< / div >
< div role = "main" class = "document" itemscope = "itemscope" itemtype = "http://schema.org/Article" >
< div itemprop = "articleBody" >
2021-10-11 22:40:42 +00:00
2018-11-13 17:53:31 +00:00
< h1 > Source code for pylorax.dnfbase< / h1 > < div class = "highlight" > < pre >
< span > < / span > < span class = "c1" > # Copyright (C) 2018 Red Hat, Inc.< / span >
< span class = "c1" > #< / span >
< span class = "c1" > # This program is free software; you can redistribute it and/or modify< / span >
< span class = "c1" > # it under the terms of the GNU General Public License as published by< / span >
< span class = "c1" > # the Free Software Foundation; either version 2 of the License, or< / span >
< span class = "c1" > # (at your option) any later version.< / span >
< span class = "c1" > #< / span >
< span class = "c1" > # This program is distributed in the hope that it will be useful,< / span >
< span class = "c1" > # but WITHOUT ANY WARRANTY; without even the implied warranty of< / span >
< span class = "c1" > # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the< / span >
< span class = "c1" > # GNU General Public License for more details.< / span >
< span class = "c1" > #< / span >
< span class = "c1" > # You should have received a copy of the GNU General Public License< / span >
< span class = "c1" > # along with this program. If not, see < http://www.gnu.org/licenses/> .< / span >
< span class = "c1" > #< / span >
< span class = "kn" > import< / span > < span class = "nn" > logging< / span >
< span class = "n" > log< / span > < span class = "o" > =< / span > < span class = "n" > logging< / span > < span class = "o" > .< / span > < span class = "n" > getLogger< / span > < span class = "p" > (< / span > < span class = "s2" > " pylorax" < / span > < span class = "p" > )< / span >
< span class = "kn" > import< / span > < span class = "nn" > dnf< / span >
< span class = "kn" > import< / span > < span class = "nn" > os< / span >
< span class = "kn" > import< / span > < span class = "nn" > shutil< / span >
2020-09-08 18:59:15 +00:00
< span class = "kn" > from< / span > < span class = "nn" > pylorax< / span > < span class = "kn" > import< / span > < span class = "n" > DEFAULT_PLATFORM_ID< / span >
< span class = "kn" > from< / span > < span class = "nn" > pylorax.sysutils< / span > < span class = "kn" > import< / span > < span class = "n" > flatconfig< / span >
2018-11-13 17:53:31 +00:00
< div class = "viewcode-block" id = "get_dnf_base_object" > < a class = "viewcode-back" href = "../../pylorax.html#pylorax.dnfbase.get_dnf_base_object" > [docs]< / a > < span class = "k" > def< / span > < span class = "nf" > get_dnf_base_object< / span > < span class = "p" > (< / span > < span class = "n" > installroot< / span > < span class = "p" > ,< / span > < span class = "n" > sources< / span > < span class = "p" > ,< / span > < span class = "n" > mirrorlists< / span > < span class = "o" > =< / span > < span class = "kc" > None< / span > < span class = "p" > ,< / span > < span class = "n" > repos< / span > < span class = "o" > =< / span > < span class = "kc" > None< / span > < span class = "p" > ,< / span >
< span class = "n" > enablerepos< / span > < span class = "o" > =< / span > < span class = "kc" > None< / span > < span class = "p" > ,< / span > < span class = "n" > disablerepos< / span > < span class = "o" > =< / span > < span class = "kc" > None< / span > < span class = "p" > ,< / span >
2021-03-04 00:36:38 +00:00
< span class = "n" > tempdir< / span > < span class = "o" > =< / span > < span class = "s2" > " /var/tmp" < / span > < span class = "p" > ,< / span > < span class = "n" > proxy< / span > < span class = "o" > =< / span > < span class = "kc" > None< / span > < span class = "p" > ,< / span > < span class = "n" > releasever< / span > < span class = "o" > =< / span > < span class = "s2" > " 34" < / span > < span class = "p" > ,< / span >
2018-11-13 17:53:31 +00:00
< span class = "n" > cachedir< / span > < span class = "o" > =< / span > < span class = "kc" > None< / span > < span class = "p" > ,< / span > < span class = "n" > logdir< / span > < span class = "o" > =< / span > < span class = "kc" > None< / span > < span class = "p" > ,< / span > < span class = "n" > sslverify< / span > < span class = "o" > =< / span > < span class = "kc" > True< / span > < span class = "p" > ,< / span > < span class = "n" > dnfplugins< / span > < span class = "o" > =< / span > < span class = "kc" > None< / span > < span class = "p" > ):< / span >
< span class = "sd" > " " " Create a dnf Base object and setup the repositories and installroot< / span >
< span class = "sd" > :param string installroot: Full path to the installroot< / span >
< span class = "sd" > :param list sources: List of source repo urls to use for the installation< / span >
< span class = "sd" > :param list enablerepos: List of repo names to enable< / span >
< span class = "sd" > :param list disablerepos: List of repo names to disable< / span >
< span class = "sd" > :param list mirrorlist: List of mirrors to use< / span >
< span class = "sd" > :param string tempdir: Path of temporary directory< / span >
< span class = "sd" > :param string proxy: http proxy to use when fetching packages< / span >
< span class = "sd" > :param string releasever: Release version to pass to dnf< / span >
< span class = "sd" > :param string cachedir: Directory to use for caching packages< / span >
< span class = "sd" > :param bool noverifyssl: Set to True to ignore the CA of ssl certs. eg. use self-signed ssl for https repos.< / span >
< span class = "sd" > If tempdir is not set /var/tmp is used.< / span >
< span class = "sd" > If cachedir is None a dnf.cache directory is created inside tmpdir< / span >
< span class = "sd" > " " " < / span >
< span class = "k" > def< / span > < span class = "nf" > sanitize_repo< / span > < span class = "p" > (< / span > < span class = "n" > repo< / span > < span class = "p" > ):< / span >
< span class = "sd" > " " " Convert bare paths to file:/// URIs, and silently reject protocols unhandled by yum" " " < / span >
< span class = "k" > if< / span > < span class = "n" > repo< / span > < span class = "o" > .< / span > < span class = "n" > startswith< / span > < span class = "p" > (< / span > < span class = "s2" > " /" < / span > < span class = "p" > ):< / span >
< span class = "k" > return< / span > < span class = "s2" > " file://< / span > < span class = "si" > {0}< / span > < span class = "s2" > " < / span > < span class = "o" > .< / span > < span class = "n" > format< / span > < span class = "p" > (< / span > < span class = "n" > repo< / span > < span class = "p" > )< / span >
< span class = "k" > elif< / span > < span class = "nb" > any< / span > < span class = "p" > (< / span > < span class = "n" > repo< / span > < span class = "o" > .< / span > < span class = "n" > startswith< / span > < span class = "p" > (< / span > < span class = "n" > p< / span > < span class = "p" > )< / span > < span class = "k" > for< / span > < span class = "n" > p< / span > < span class = "ow" > in< / span > < span class = "p" > (< / span > < span class = "s1" > ' http://' < / span > < span class = "p" > ,< / span > < span class = "s1" > ' https://' < / span > < span class = "p" > ,< / span > < span class = "s1" > ' ftp://' < / span > < span class = "p" > ,< / span > < span class = "s1" > ' file://' < / span > < span class = "p" > )):< / span >
< span class = "k" > return< / span > < span class = "n" > repo< / span >
< span class = "k" > else< / span > < span class = "p" > :< / span >
< span class = "k" > return< / span > < span class = "kc" > None< / span >
< span class = "n" > mirrorlists< / span > < span class = "o" > =< / span > < span class = "n" > mirrorlists< / span > < span class = "ow" > or< / span > < span class = "p" > []< / span >
< span class = "c1" > # sanitize the repositories< / span >
< span class = "n" > sources< / span > < span class = "o" > =< / span > < span class = "nb" > list< / span > < span class = "p" > (< / span > < span class = "n" > sanitize_repo< / span > < span class = "p" > (< / span > < span class = "n" > r< / span > < span class = "p" > )< / span > < span class = "k" > for< / span > < span class = "n" > r< / span > < span class = "ow" > in< / span > < span class = "n" > sources< / span > < span class = "p" > )< / span >
< span class = "n" > mirrorlists< / span > < span class = "o" > =< / span > < span class = "nb" > list< / span > < span class = "p" > (< / span > < span class = "n" > sanitize_repo< / span > < span class = "p" > (< / span > < span class = "n" > r< / span > < span class = "p" > )< / span > < span class = "k" > for< / span > < span class = "n" > r< / span > < span class = "ow" > in< / span > < span class = "n" > mirrorlists< / span > < span class = "p" > )< / span >
< span class = "c1" > # remove invalid repositories< / span >
< span class = "n" > sources< / span > < span class = "o" > =< / span > < span class = "nb" > list< / span > < span class = "p" > (< / span > < span class = "n" > r< / span > < span class = "k" > for< / span > < span class = "n" > r< / span > < span class = "ow" > in< / span > < span class = "n" > sources< / span > < span class = "k" > if< / span > < span class = "n" > r< / span > < span class = "p" > )< / span >
< span class = "n" > mirrorlists< / span > < span class = "o" > =< / span > < span class = "nb" > list< / span > < span class = "p" > (< / span > < span class = "n" > r< / span > < span class = "k" > for< / span > < span class = "n" > r< / span > < span class = "ow" > in< / span > < span class = "n" > mirrorlists< / span > < span class = "k" > if< / span > < span class = "n" > r< / span > < span class = "p" > )< / span >
< span class = "k" > if< / span > < span class = "ow" > not< / span > < span class = "n" > cachedir< / span > < span class = "p" > :< / span >
< span class = "n" > cachedir< / span > < span class = "o" > =< / span > < span class = "n" > os< / span > < span class = "o" > .< / span > < span class = "n" > path< / span > < span class = "o" > .< / span > < span class = "n" > join< / span > < span class = "p" > (< / span > < span class = "n" > tempdir< / span > < span class = "p" > ,< / span > < span class = "s2" > " dnf.cache" < / span > < span class = "p" > )< / span >
< span class = "k" > if< / span > < span class = "ow" > not< / span > < span class = "n" > os< / span > < span class = "o" > .< / span > < span class = "n" > path< / span > < span class = "o" > .< / span > < span class = "n" > isdir< / span > < span class = "p" > (< / span > < span class = "n" > cachedir< / span > < span class = "p" > ):< / span >
< span class = "n" > os< / span > < span class = "o" > .< / span > < span class = "n" > mkdir< / span > < span class = "p" > (< / span > < span class = "n" > cachedir< / span > < span class = "p" > )< / span >
< span class = "k" > if< / span > < span class = "ow" > not< / span > < span class = "n" > logdir< / span > < span class = "p" > :< / span >
< span class = "n" > logdir< / span > < span class = "o" > =< / span > < span class = "n" > os< / span > < span class = "o" > .< / span > < span class = "n" > path< / span > < span class = "o" > .< / span > < span class = "n" > join< / span > < span class = "p" > (< / span > < span class = "n" > tempdir< / span > < span class = "p" > ,< / span > < span class = "s2" > " dnf.logs" < / span > < span class = "p" > )< / span >
< span class = "k" > if< / span > < span class = "ow" > not< / span > < span class = "n" > os< / span > < span class = "o" > .< / span > < span class = "n" > path< / span > < span class = "o" > .< / span > < span class = "n" > isdir< / span > < span class = "p" > (< / span > < span class = "n" > logdir< / span > < span class = "p" > ):< / span >
< span class = "n" > os< / span > < span class = "o" > .< / span > < span class = "n" > mkdir< / span > < span class = "p" > (< / span > < span class = "n" > logdir< / span > < span class = "p" > )< / span >
< span class = "n" > dnfbase< / span > < span class = "o" > =< / span > < span class = "n" > dnf< / span > < span class = "o" > .< / span > < span class = "n" > Base< / span > < span class = "p" > ()< / span >
< span class = "c1" > # Enable DNF pluings< / span >
< span class = "c1" > # NOTE: These come from the HOST system' s environment< / span >
< span class = "k" > if< / span > < span class = "n" > dnfplugins< / span > < span class = "p" > :< / span >
< span class = "k" > if< / span > < span class = "n" > dnfplugins< / span > < span class = "p" > [< / span > < span class = "mi" > 0< / span > < span class = "p" > ]< / span > < span class = "o" > ==< / span > < span class = "s2" > " *" < / span > < span class = "p" > :< / span >
< span class = "c1" > # Enable them all< / span >
< span class = "n" > dnfbase< / span > < span class = "o" > .< / span > < span class = "n" > init_plugins< / span > < span class = "p" > ()< / span >
< span class = "k" > else< / span > < span class = "p" > :< / span >
< span class = "c1" > # Only enable the listed plugins< / span >
< span class = "n" > dnfbase< / span > < span class = "o" > .< / span > < span class = "n" > init_plugins< / span > < span class = "p" > (< / span > < span class = "n" > disabled_glob< / span > < span class = "o" > =< / span > < span class = "p" > [< / span > < span class = "s2" > " *" < / span > < span class = "p" > ],< / span > < span class = "n" > enable_plugins< / span > < span class = "o" > =< / span > < span class = "n" > dnfplugins< / span > < span class = "p" > )< / span >
< span class = "n" > conf< / span > < span class = "o" > =< / span > < span class = "n" > dnfbase< / span > < span class = "o" > .< / span > < span class = "n" > conf< / span >
< span class = "n" > conf< / span > < span class = "o" > .< / span > < span class = "n" > logdir< / span > < span class = "o" > =< / span > < span class = "n" > logdir< / span >
< span class = "n" > conf< / span > < span class = "o" > .< / span > < span class = "n" > cachedir< / span > < span class = "o" > =< / span > < span class = "n" > cachedir< / span >
< span class = "n" > conf< / span > < span class = "o" > .< / span > < span class = "n" > install_weak_deps< / span > < span class = "o" > =< / span > < span class = "kc" > False< / span >
< span class = "n" > conf< / span > < span class = "o" > .< / span > < span class = "n" > releasever< / span > < span class = "o" > =< / span > < span class = "n" > releasever< / span >
< span class = "n" > conf< / span > < span class = "o" > .< / span > < span class = "n" > installroot< / span > < span class = "o" > =< / span > < span class = "n" > installroot< / span >
< span class = "n" > conf< / span > < span class = "o" > .< / span > < span class = "n" > prepend_installroot< / span > < span class = "p" > (< / span > < span class = "s1" > ' persistdir' < / span > < span class = "p" > )< / span >
< span class = "c1" > # this is a weird ' AppendOption' thing that, when you set it,< / span >
< span class = "c1" > # actually appends. Doing this adds ' nodocs' to the existing list< / span >
< span class = "c1" > # of values, over in libdnf, it does not replace the existing values.< / span >
< span class = "n" > conf< / span > < span class = "o" > .< / span > < span class = "n" > tsflags< / span > < span class = "o" > =< / span > < span class = "p" > [< / span > < span class = "s1" > ' nodocs' < / span > < span class = "p" > ]< / span >
2020-02-12 21:24:33 +00:00
< span class = "c1" > # Log details about the solver< / span >
< span class = "n" > conf< / span > < span class = "o" > .< / span > < span class = "n" > debug_solver< / span > < span class = "o" > =< / span > < span class = "kc" > True< / span >
2018-11-13 17:53:31 +00:00
< span class = "k" > if< / span > < span class = "n" > proxy< / span > < span class = "p" > :< / span >
< span class = "n" > conf< / span > < span class = "o" > .< / span > < span class = "n" > proxy< / span > < span class = "o" > =< / span > < span class = "n" > proxy< / span >
< span class = "k" > if< / span > < span class = "n" > sslverify< / span > < span class = "o" > ==< / span > < span class = "kc" > False< / span > < span class = "p" > :< / span >
< span class = "n" > conf< / span > < span class = "o" > .< / span > < span class = "n" > sslverify< / span > < span class = "o" > =< / span > < span class = "kc" > False< / span >
< span class = "c1" > # DNF 3.2 needs to have module_platform_id set, otherwise depsolve won' t work correctly< / span >
< span class = "k" > if< / span > < span class = "ow" > not< / span > < span class = "n" > os< / span > < span class = "o" > .< / span > < span class = "n" > path< / span > < span class = "o" > .< / span > < span class = "n" > exists< / span > < span class = "p" > (< / span > < span class = "s2" > " /etc/os-release" < / span > < span class = "p" > ):< / span >
< span class = "n" > log< / span > < span class = "o" > .< / span > < span class = "n" > warning< / span > < span class = "p" > (< / span > < span class = "s2" > " /etc/os-release is missing, cannot determine platform id, falling back to < / span > < span class = "si" > %s< / span > < span class = "s2" > " < / span > < span class = "p" > ,< / span > < span class = "n" > DEFAULT_PLATFORM_ID< / span > < span class = "p" > )< / span >
< span class = "n" > platform_id< / span > < span class = "o" > =< / span > < span class = "n" > DEFAULT_PLATFORM_ID< / span >
< span class = "k" > else< / span > < span class = "p" > :< / span >
< span class = "n" > os_release< / span > < span class = "o" > =< / span > < span class = "n" > flatconfig< / span > < span class = "p" > (< / span > < span class = "s2" > " /etc/os-release" < / span > < span class = "p" > )< / span >
< span class = "n" > platform_id< / span > < span class = "o" > =< / span > < span class = "n" > os_release< / span > < span class = "o" > .< / span > < span class = "n" > get< / span > < span class = "p" > (< / span > < span class = "s2" > " PLATFORM_ID" < / span > < span class = "p" > ,< / span > < span class = "n" > DEFAULT_PLATFORM_ID< / span > < span class = "p" > )< / span >
< span class = "n" > log< / span > < span class = "o" > .< / span > < span class = "n" > info< / span > < span class = "p" > (< / span > < span class = "s2" > " Using < / span > < span class = "si" > %s< / span > < span class = "s2" > for module_platform_id" < / span > < span class = "p" > ,< / span > < span class = "n" > platform_id< / span > < span class = "p" > )< / span >
< span class = "n" > conf< / span > < span class = "o" > .< / span > < span class = "n" > module_platform_id< / span > < span class = "o" > =< / span > < span class = "n" > platform_id< / span >
< span class = "c1" > # Add .repo files< / span >
< span class = "k" > if< / span > < span class = "n" > repos< / span > < span class = "p" > :< / span >
< span class = "n" > reposdir< / span > < span class = "o" > =< / span > < span class = "n" > os< / span > < span class = "o" > .< / span > < span class = "n" > path< / span > < span class = "o" > .< / span > < span class = "n" > join< / span > < span class = "p" > (< / span > < span class = "n" > tempdir< / span > < span class = "p" > ,< / span > < span class = "s2" > " dnf.repos" < / span > < span class = "p" > )< / span >
< span class = "k" > if< / span > < span class = "ow" > not< / span > < span class = "n" > os< / span > < span class = "o" > .< / span > < span class = "n" > path< / span > < span class = "o" > .< / span > < span class = "n" > isdir< / span > < span class = "p" > (< / span > < span class = "n" > reposdir< / span > < span class = "p" > ):< / span >
< span class = "n" > os< / span > < span class = "o" > .< / span > < span class = "n" > mkdir< / span > < span class = "p" > (< / span > < span class = "n" > reposdir< / span > < span class = "p" > )< / span >
< span class = "k" > for< / span > < span class = "n" > r< / span > < span class = "ow" > in< / span > < span class = "n" > repos< / span > < span class = "p" > :< / span >
< span class = "n" > shutil< / span > < span class = "o" > .< / span > < span class = "n" > copy2< / span > < span class = "p" > (< / span > < span class = "n" > r< / span > < span class = "p" > ,< / span > < span class = "n" > reposdir< / span > < span class = "p" > )< / span >
< span class = "n" > conf< / span > < span class = "o" > .< / span > < span class = "n" > reposdir< / span > < span class = "o" > =< / span > < span class = "p" > [< / span > < span class = "n" > reposdir< / span > < span class = "p" > ]< / span >
< span class = "n" > dnfbase< / span > < span class = "o" > .< / span > < span class = "n" > read_all_repos< / span > < span class = "p" > ()< / span >
< span class = "c1" > # add the sources< / span >
< span class = "k" > for< / span > < span class = "n" > i< / span > < span class = "p" > ,< / span > < span class = "n" > r< / span > < span class = "ow" > in< / span > < span class = "nb" > enumerate< / span > < span class = "p" > (< / span > < span class = "n" > sources< / span > < span class = "p" > ):< / span >
< span class = "k" > if< / span > < span class = "s2" > " SRPM" < / span > < span class = "ow" > in< / span > < span class = "n" > r< / span > < span class = "ow" > or< / span > < span class = "s2" > " srpm" < / span > < span class = "ow" > in< / span > < span class = "n" > r< / span > < span class = "p" > :< / span >
< span class = "n" > log< / span > < span class = "o" > .< / span > < span class = "n" > info< / span > < span class = "p" > (< / span > < span class = "s2" > " Skipping source repo: < / span > < span class = "si" > %s< / span > < span class = "s2" > " < / span > < span class = "p" > ,< / span > < span class = "n" > r< / span > < span class = "p" > )< / span >
< span class = "k" > continue< / span >
< span class = "n" > repo_name< / span > < span class = "o" > =< / span > < span class = "s2" > " lorax-repo-< / span > < span class = "si" > %d< / span > < span class = "s2" > " < / span > < span class = "o" > %< / span > < span class = "n" > i< / span >
< span class = "n" > repo< / span > < span class = "o" > =< / span > < span class = "n" > dnf< / span > < span class = "o" > .< / span > < span class = "n" > repo< / span > < span class = "o" > .< / span > < span class = "n" > Repo< / span > < span class = "p" > (< / span > < span class = "n" > repo_name< / span > < span class = "p" > ,< / span > < span class = "n" > conf< / span > < span class = "p" > )< / span >
< span class = "n" > repo< / span > < span class = "o" > .< / span > < span class = "n" > baseurl< / span > < span class = "o" > =< / span > < span class = "p" > [< / span > < span class = "n" > r< / span > < span class = "p" > ]< / span >
< span class = "k" > if< / span > < span class = "n" > proxy< / span > < span class = "p" > :< / span >
< span class = "n" > repo< / span > < span class = "o" > .< / span > < span class = "n" > proxy< / span > < span class = "o" > =< / span > < span class = "n" > proxy< / span >
< span class = "n" > repo< / span > < span class = "o" > .< / span > < span class = "n" > enable< / span > < span class = "p" > ()< / span >
< span class = "n" > dnfbase< / span > < span class = "o" > .< / span > < span class = "n" > repos< / span > < span class = "o" > .< / span > < span class = "n" > add< / span > < span class = "p" > (< / span > < span class = "n" > repo< / span > < span class = "p" > )< / span >
< span class = "n" > log< / span > < span class = "o" > .< / span > < span class = "n" > info< / span > < span class = "p" > (< / span > < span class = "s2" > " Added ' < / span > < span class = "si" > %s< / span > < span class = "s2" > ' : < / span > < span class = "si" > %s< / span > < span class = "s2" > " < / span > < span class = "p" > ,< / span > < span class = "n" > repo_name< / span > < span class = "p" > ,< / span > < span class = "n" > r< / span > < span class = "p" > )< / span >
< span class = "n" > log< / span > < span class = "o" > .< / span > < span class = "n" > info< / span > < span class = "p" > (< / span > < span class = "s2" > " Fetching metadata..." < / span > < span class = "p" > )< / span >
< span class = "k" > try< / span > < span class = "p" > :< / span >
< span class = "n" > repo< / span > < span class = "o" > .< / span > < span class = "n" > load< / span > < span class = "p" > ()< / span >
< span class = "k" > except< / span > < span class = "n" > dnf< / span > < span class = "o" > .< / span > < span class = "n" > exceptions< / span > < span class = "o" > .< / span > < span class = "n" > RepoError< / span > < span class = "k" > as< / span > < span class = "n" > e< / span > < span class = "p" > :< / span >
< span class = "n" > log< / span > < span class = "o" > .< / span > < span class = "n" > error< / span > < span class = "p" > (< / span > < span class = "s2" > " Error fetching metadata for < / span > < span class = "si" > %s< / span > < span class = "s2" > : < / span > < span class = "si" > %s< / span > < span class = "s2" > " < / span > < span class = "p" > ,< / span > < span class = "n" > repo_name< / span > < span class = "p" > ,< / span > < span class = "n" > e< / span > < span class = "p" > )< / span >
< span class = "k" > return< / span > < span class = "kc" > None< / span >
< span class = "c1" > # add the mirrorlists< / span >
< span class = "k" > for< / span > < span class = "n" > i< / span > < span class = "p" > ,< / span > < span class = "n" > r< / span > < span class = "ow" > in< / span > < span class = "nb" > enumerate< / span > < span class = "p" > (< / span > < span class = "n" > mirrorlists< / span > < span class = "p" > ):< / span >
< span class = "k" > if< / span > < span class = "s2" > " SRPM" < / span > < span class = "ow" > in< / span > < span class = "n" > r< / span > < span class = "ow" > or< / span > < span class = "s2" > " srpm" < / span > < span class = "ow" > in< / span > < span class = "n" > r< / span > < span class = "p" > :< / span >
< span class = "n" > log< / span > < span class = "o" > .< / span > < span class = "n" > info< / span > < span class = "p" > (< / span > < span class = "s2" > " Skipping source repo: < / span > < span class = "si" > %s< / span > < span class = "s2" > " < / span > < span class = "p" > ,< / span > < span class = "n" > r< / span > < span class = "p" > )< / span >
< span class = "k" > continue< / span >
< span class = "n" > repo_name< / span > < span class = "o" > =< / span > < span class = "s2" > " lorax-mirrorlist-< / span > < span class = "si" > %d< / span > < span class = "s2" > " < / span > < span class = "o" > %< / span > < span class = "n" > i< / span >
< span class = "n" > repo< / span > < span class = "o" > =< / span > < span class = "n" > dnf< / span > < span class = "o" > .< / span > < span class = "n" > repo< / span > < span class = "o" > .< / span > < span class = "n" > Repo< / span > < span class = "p" > (< / span > < span class = "n" > repo_name< / span > < span class = "p" > ,< / span > < span class = "n" > conf< / span > < span class = "p" > )< / span >
< span class = "n" > repo< / span > < span class = "o" > .< / span > < span class = "n" > mirrorlist< / span > < span class = "o" > =< / span > < span class = "n" > r< / span >
< span class = "k" > if< / span > < span class = "n" > proxy< / span > < span class = "p" > :< / span >
< span class = "n" > repo< / span > < span class = "o" > .< / span > < span class = "n" > proxy< / span > < span class = "o" > =< / span > < span class = "n" > proxy< / span >
< span class = "n" > repo< / span > < span class = "o" > .< / span > < span class = "n" > enable< / span > < span class = "p" > ()< / span >
< span class = "n" > dnfbase< / span > < span class = "o" > .< / span > < span class = "n" > repos< / span > < span class = "o" > .< / span > < span class = "n" > add< / span > < span class = "p" > (< / span > < span class = "n" > repo< / span > < span class = "p" > )< / span >
< span class = "n" > log< / span > < span class = "o" > .< / span > < span class = "n" > info< / span > < span class = "p" > (< / span > < span class = "s2" > " Added ' < / span > < span class = "si" > %s< / span > < span class = "s2" > ' : < / span > < span class = "si" > %s< / span > < span class = "s2" > " < / span > < span class = "p" > ,< / span > < span class = "n" > repo_name< / span > < span class = "p" > ,< / span > < span class = "n" > r< / span > < span class = "p" > )< / span >
< span class = "n" > log< / span > < span class = "o" > .< / span > < span class = "n" > info< / span > < span class = "p" > (< / span > < span class = "s2" > " Fetching metadata..." < / span > < span class = "p" > )< / span >
< span class = "k" > try< / span > < span class = "p" > :< / span >
< span class = "n" > repo< / span > < span class = "o" > .< / span > < span class = "n" > load< / span > < span class = "p" > ()< / span >
< span class = "k" > except< / span > < span class = "n" > dnf< / span > < span class = "o" > .< / span > < span class = "n" > exceptions< / span > < span class = "o" > .< / span > < span class = "n" > RepoError< / span > < span class = "k" > as< / span > < span class = "n" > e< / span > < span class = "p" > :< / span >
< span class = "n" > log< / span > < span class = "o" > .< / span > < span class = "n" > error< / span > < span class = "p" > (< / span > < span class = "s2" > " Error fetching metadata for < / span > < span class = "si" > %s< / span > < span class = "s2" > : < / span > < span class = "si" > %s< / span > < span class = "s2" > " < / span > < span class = "p" > ,< / span > < span class = "n" > repo_name< / span > < span class = "p" > ,< / span > < span class = "n" > e< / span > < span class = "p" > )< / span >
< span class = "k" > return< / span > < span class = "kc" > None< / span >
< span class = "c1" > # Enable repos listed on the cmdline< / span >
< span class = "k" > for< / span > < span class = "n" > r< / span > < span class = "ow" > in< / span > < span class = "n" > enablerepos< / span > < span class = "p" > :< / span >
< span class = "n" > repolist< / span > < span class = "o" > =< / span > < span class = "n" > dnfbase< / span > < span class = "o" > .< / span > < span class = "n" > repos< / span > < span class = "o" > .< / span > < span class = "n" > get_matching< / span > < span class = "p" > (< / span > < span class = "n" > r< / span > < span class = "p" > )< / span >
< span class = "k" > if< / span > < span class = "ow" > not< / span > < span class = "n" > repolist< / span > < span class = "p" > :< / span >
< span class = "n" > log< / span > < span class = "o" > .< / span > < span class = "n" > warning< / span > < span class = "p" > (< / span > < span class = "s2" > " < / span > < span class = "si" > %s< / span > < span class = "s2" > is an unknown repo, not enabling it" < / span > < span class = "p" > ,< / span > < span class = "n" > r< / span > < span class = "p" > )< / span >
< span class = "k" > else< / span > < span class = "p" > :< / span >
< span class = "n" > repolist< / span > < span class = "o" > .< / span > < span class = "n" > enable< / span > < span class = "p" > ()< / span >
< span class = "n" > log< / span > < span class = "o" > .< / span > < span class = "n" > info< / span > < span class = "p" > (< / span > < span class = "s2" > " Enabled repo < / span > < span class = "si" > %s< / span > < span class = "s2" > " < / span > < span class = "p" > ,< / span > < span class = "n" > r< / span > < span class = "p" > )< / span >
< span class = "c1" > # Disable repos listed on the cmdline< / span >
< span class = "k" > for< / span > < span class = "n" > r< / span > < span class = "ow" > in< / span > < span class = "n" > disablerepos< / span > < span class = "p" > :< / span >
< span class = "n" > repolist< / span > < span class = "o" > =< / span > < span class = "n" > dnfbase< / span > < span class = "o" > .< / span > < span class = "n" > repos< / span > < span class = "o" > .< / span > < span class = "n" > get_matching< / span > < span class = "p" > (< / span > < span class = "n" > r< / span > < span class = "p" > )< / span >
< span class = "k" > if< / span > < span class = "ow" > not< / span > < span class = "n" > repolist< / span > < span class = "p" > :< / span >
< span class = "n" > log< / span > < span class = "o" > .< / span > < span class = "n" > warning< / span > < span class = "p" > (< / span > < span class = "s2" > " < / span > < span class = "si" > %s< / span > < span class = "s2" > is an unknown repo, not disabling it" < / span > < span class = "p" > ,< / span > < span class = "n" > r< / span > < span class = "p" > )< / span >
< span class = "k" > else< / span > < span class = "p" > :< / span >
< span class = "n" > repolist< / span > < span class = "o" > .< / span > < span class = "n" > disable< / span > < span class = "p" > ()< / span >
< span class = "n" > log< / span > < span class = "o" > .< / span > < span class = "n" > info< / span > < span class = "p" > (< / span > < span class = "s2" > " Disabled repo < / span > < span class = "si" > %s< / span > < span class = "s2" > " < / span > < span class = "p" > ,< / span > < span class = "n" > r< / span > < span class = "p" > )< / span >
< span class = "n" > dnfbase< / span > < span class = "o" > .< / span > < span class = "n" > fill_sack< / span > < span class = "p" > (< / span > < span class = "n" > load_system_repo< / span > < span class = "o" > =< / span > < span class = "kc" > False< / span > < span class = "p" > )< / span >
< span class = "n" > dnfbase< / span > < span class = "o" > .< / span > < span class = "n" > read_comps< / span > < span class = "p" > ()< / span >
< span class = "k" > return< / span > < span class = "n" > dnfbase< / span > < / div >
< / pre > < / div >
< / div >
< / div >
< footer >
< hr / >
< div role = "contentinfo" >
2021-10-11 22:40:42 +00:00
< p > © Copyright 2018, Red Hat, Inc..< / p >
2018-11-13 17:53:31 +00:00
< / div >
2021-10-11 22:40:42 +00:00
Built with < a href = "https://www.sphinx-doc.org/" > Sphinx< / a > using a
2021-04-23 20:42:41 +00:00
< a href = "https://github.com/readthedocs/sphinx_rtd_theme" > theme< / a >
2021-10-11 22:40:42 +00:00
provided by < a href = "https://readthedocs.org" > Read the Docs< / a > .
2018-11-13 17:53:31 +00:00
< / footer >
< / div >
< / div >
< / section >
< / div >
2021-10-11 22:40:42 +00:00
< script >
2018-11-13 17:53:31 +00:00
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
2021-10-11 22:40:42 +00:00
< / script >
2018-11-13 17:53:31 +00:00
< / body >
< / html >