On Wed, 14 Feb 2007, Brad Smith wrote:

Hello all,

I'm attempting to make maintenance of Fedora Tracker easier by
replacing as much of the back-end as possible with yum code. Since
Tracker runs as non-root, it seemed that the easiest way to do this
would be to create a trackerRoot directory with its own config files,
cache directory, etc. I looked at the code for
YumBase.doGenericSetup() and basically followed that with one extra
argument to doConfigSetup() to get Yum to use the nonstandard
directory. The repo file being used is a standard fedora-core.repo and
doGenericSetup() works, and yet...

import yum
my=yum.YumBase()
my.doConfigSetup(root="/home/brad/Work/yum/trackerRoot")
Loading "installonlyn" plugin

my.conf.cache=0
my.doTsSetup()
my.doRpmDBSetup()
my.doRepoSetup()
Traceback (most recent call last):
File "<input>", line 1, in ?
File "yum/__init__.py", line 309, in doRepoSetup
  repo.setup(self.conf.cache, self.mediagrabber)
File "yum/yumRepo.py", line 585, in setup
  self.baseurlSetup()
File "yum/yumRepo.py", line 428, in baseurlSetup
  self.check()
File "yum/yumRepo.py", line 312, in check
  raise Errors.RepoError, \
RepoError: Cannot find a valid baseurl for repo: core

The procedure above duplicates what the source says doGenericSetup()
does, and yet it acts as though there's something wrong with the .repo
file when I do it, but not when doGenericSetup() does it. Obviously
I'm missing something here. Does anyone have an idea what?

The standard fedora-core.repo uses $releasever to determine the version, which is looked up from rpmdb based on fedora-release package version. Since you're pointing yum to alternate root I think it's looking for rpmdb within that root (eg /home/brad/Work/yum/trackerRoot/var/lib/rpm), not finding it and so the baseurl/mirrorlist for that repo can't be completed it fails.

        - Panu -
_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

Reply via email to