backend/satellite_tools/repo_plugins/yum_src.py | 16 ++++++++++++---- backend/satellite_tools/spacewalk-repo-sync.sgml | 6 ++++++ 2 files changed, 18 insertions(+), 4 deletions(-)
New commits: commit d698c2e547dbb51b85c765b025d7331cf085e7a0 Author: Michael Mraka michael.mraka@redhat.com Date: Tue Dec 6 13:46:36 2011 +0100
676369 - set pkgdir directly not via private API
diff --git a/backend/satellite_tools/repo_plugins/yum_src.py b/backend/satellite_tools/repo_plugins/yum_src.py index d437565..2a153fd 100644 --- a/backend/satellite_tools/repo_plugins/yum_src.py +++ b/backend/satellite_tools/repo_plugins/yum_src.py @@ -109,7 +109,7 @@ class ContentSource: repo.mirrorlist = url repo.baseurl = [url] repo.basecachedir = self.cache_dir - repo._dirSetAttr('pkgdir', os.path.join(CFG.MOUNT_POINT, CFG.PREPENDED_DIR, '1')) + repo.pkgdir = os.path.join(CFG.MOUNT_POINT, CFG.PREPENDED_DIR, '1') if hasattr(repo, 'base_persistdir'): repo.base_persistdir = self.cache_dir if self.proxy_url is not None:
commit 85799c76c24077c3466e965059174f04959e1507 Author: Michael Mraka michael.mraka@redhat.com Date: Tue Dec 6 13:55:53 2011 +0100
621166 - reuse YumBase instance from __init__
diff --git a/backend/satellite_tools/repo_plugins/yum_src.py b/backend/satellite_tools/repo_plugins/yum_src.py index 74e0227..d437565 100644 --- a/backend/satellite_tools/repo_plugins/yum_src.py +++ b/backend/satellite_tools/repo_plugins/yum_src.py @@ -192,9 +192,8 @@ class ContentSource: return selected
def _get_package_dependencies(self, sack, packages): - yumbase = yum.YumBase() - yumbase.pkgSack = sack - resolved_deps = yumbase.findDeps(packages) + self.yumbase.pkgSack = sack + resolved_deps = self.yumbase.findDeps(packages) for (pkg,deps) in resolved_deps.items(): for (dep,dep_packages) in deps.items(): packages.extend(dep_packages)
commit 725b6b34ee153add2c7ed3db1871362d8342e91d Author: Michael Mraka michael.mraka@redhat.com Date: Tue Dec 6 12:07:33 2011 +0100
621166 - notice config file in man page
diff --git a/backend/satellite_tools/spacewalk-repo-sync.sgml b/backend/satellite_tools/spacewalk-repo-sync.sgml index b19b975..e30f263 100644 --- a/backend/satellite_tools/spacewalk-repo-sync.sgml +++ b/backend/satellite_tools/spacewalk-repo-sync.sgml @@ -59,6 +59,12 @@ Syncs the content from yum repos into Spacewalk or Satellite channels. If the url is not supplied, the tool will look to see what repositories are associated with the specified channel and use those. </para> +<para> + Additional configuration options for yum_src plugin can be placed in + <filename>/etc/rhn/spacewalk-repo-sync/yum.conf</filename>. Don't forget to put + [main] section there. +</para> + </refsect1>
<refsect1><title>Options</title>
commit 0292816165b447b718edcb7ad3632baffaba8ddb Author: Michael Mraka michael.mraka@redhat.com Date: Tue Dec 6 11:52:24 2011 +0100
621166 - let's enable yum_src tuning (via config file)
anyway yum options for spacewalk-repo-sync should not interfere with machine's yum i.e. /etc/yum.conf; thus separate config file
diff --git a/backend/satellite_tools/repo_plugins/yum_src.py b/backend/satellite_tools/repo_plugins/yum_src.py index 67b9189..74e0227 100644 --- a/backend/satellite_tools/repo_plugins/yum_src.py +++ b/backend/satellite_tools/repo_plugins/yum_src.py @@ -18,6 +18,7 @@ import shutil import sys import gzip import os.path +from yum.config import ConfigParser from yum.update_md import UpdateMetadata, UpdateNoticeException, UpdateNotice from yum.yumRepo import YumRepository try: @@ -31,6 +32,8 @@ except ImportError: from spacewalk.satellite_tools.reposync import ContentPackage from spacewalk.common.rhnConfig import CFG, initCFG
+YUMSRC_CONF='/etc/rhn/spacewalk-repo-sync/yum.conf' + class YumWarnings: def write(self, s): pass @@ -79,6 +82,11 @@ class ContentSource: repo = None cache_dir = '/var/cache/rhn/reposync/' def __init__(self, url, name): + self.yumbase = yum.YumBase() + self.yumbase.preconf.fn=YUMSRC_CONF + if not os.path.exists(YUMSRC_CONF): + self.yumbase.preconf.fn='/dev/null' + self.configparser = ConfigParser() self._clean_cache(self.cache_dir + name)
# read the proxy configuration in /etc/rhn/rhn.conf @@ -94,6 +102,7 @@ class ContentSource: else: self.proxy_url = None repo = yum.yumRepo.YumRepository(name) + repo.populate(self.configparser, name, self.yumbase.conf) self.repo = repo repo.cache = 0 repo.metadata_expire = 0
spacewalk-commits@lists.fedorahosted.org