self._excluded_pkgs = None
self._required_groups = None
- yum_conf = self._mktemp(prefix = "yum.conf-")
-
pkg_manager = self.get_pkg_manager()
- pkg_manager.setup(yum_conf, self._instroot)
+ pkg_manager.setup()
for repo in kickstart.get_repos(self.ks, repo_urls):
(name, baseurl, mirrorlist, inc, exc,
self._pkgs_license = pkg_manager.getPkgsLicense()
pkg_manager.close()
- os.unlink(yum_conf)
# do some clean up to avoid lvm info leakage. this sucks.
for subdir in ("cache", "backup", "archive"):
# with this program; if not, write to the Free Software Foundation, Inc., 59
# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-import os, sys, re
+import os, sys, re, tempfile
import rpmUtils
import yum
def close(self):
try:
+ os.unlink(self.confpath)
os.unlink(self.conf.installroot + "/yum.conf")
except:
pass
for f in glob.glob(installroot + "/var/lib/rpm/__db*"):
os.unlink(f)
- def setup(self, confpath, installroot):
- self._writeConf(confpath, installroot)
- self._cleanupRpmdbLocks(installroot)
- self.doConfigSetup(fn = confpath, root = installroot)
+ def setup(self):
+ # create yum.conf
+ (fn, self.confpath) = tempfile.mkstemp(dir=self.cachedir,
+ prefix='yum.conf-')
+ os.close(fn)
+ self._writeConf(self.confpath, self.instroot)
+ self._cleanupRpmdbLocks(self.instroot)
+ # do setup
+ self.doConfigSetup(fn = self.confpath, root = self.instroot)
self.conf.cache = 0
self.doTsSetup()
self.doRpmDBSetup()
for f in glob.glob(installroot + "/var/lib/rpm/__db*"):
os.unlink(f)
- def setup(self, confpath=None, instroot=None):
- if not self.instroot:
- self.instroot = instroot
+ def setup(self):
self._cleanupRpmdbLocks(self.instroot)
def whatObsolete(self, pkg):