summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Nasrat <pnasrat@redhat.com>2005-08-24 17:48:43 +0000
committerPaul Nasrat <pnasrat@redhat.com>2005-08-24 17:48:43 +0000
commit7e0de54d4874f4cc1f2cf8631c6eb7c02bb21257 (patch)
tree9ee1e1f9a9f41d3bca9d31d096963605857bcec6
parent169a2e0a3ddfd6c2cf99ff64e54a150114ff0de5 (diff)
downloadanaconda-7e0de54d4874f4cc1f2cf8631c6eb7c02bb21257.tar.gz
anaconda-7e0de54d4874f4cc1f2cf8631c6eb7c02bb21257.tar.xz
anaconda-7e0de54d4874f4cc1f2cf8631c6eb7c02bb21257.zip
Remove dependency checking
-rw-r--r--dispatch.py2
-rw-r--r--hdrlist.py74
-rw-r--r--packages.py2
-rw-r--r--upgrade.py29
4 files changed, 3 insertions, 104 deletions
diff --git a/dispatch.py b/dispatch.py
index a5d69f0de..cb20ba23d 100644
--- a/dispatch.py
+++ b/dispatch.py
@@ -36,7 +36,7 @@ from partitioning import partitioningComplete
from floppy import makeBootdisk
from bootloader import writeBootloader, bootloaderSetupChoices
from flags import flags
-from upgrade import upgradeFindPackages, upgradeMountFilesystems
+from upgrade import upgradeMountFilesystems
from upgrade import upgradeSwapSuggestion, upgradeMigrateFind
from upgrade import findRootParts
from network import networkDeviceCheck
diff --git a/hdrlist.py b/hdrlist.py
index a75307153..1c977b747 100644
--- a/hdrlist.py
+++ b/hdrlist.py
@@ -159,80 +159,6 @@ def betterPackageForProvides(h1, h2):
return h1
cached = {}
-# returns the best nevra in hdrlist to match dep
-# FIXME: doesn't care about EVR right now -- the tree is assumed to be
-# sane and dep is just the name
-def depMatch(dep, hdrlist):
- # ignore rpmlib
- if dep.startswith("rpmlib("):
- return None
- # try to see if it just exists first
- elif hdrlist.has_key(dep):
- return nevra(hdrlist[dep])
- elif cached.has_key(dep):
- return cached[dep]
- # next, see if its a file dep
- elif dep[0] == "/":
- hdr = None
- for h in hdrlist.pkgs.values():
- l = []
- for f in h.hdr.fiFromHeader():
- l.append(f[0])
- if (dep in l):
- hdr = betterPackageForProvides(h, hdr)
- if hdr is not None:
- # cache all binaries from this package. helps with, eg, coreutils
- for f in hdr.hdr.fiFromHeader():
- if f[0].find("bin") != -1: cached[f[0]] = nevra(hdr)
- cached[dep] = nevra(hdr)
- return nevra(hdr)
-
- # else:
- # need to do this even on file deps too because they could be virtual
- # provides such as /usr/sbin/sendmail or /usr/bin/lpr.
- if 1:
- hdr = None
- for h in hdrlist.pkgs.values():
- if (dep in h[rpm.RPMTAG_PROVIDENAME]):
- hdr = betterPackageForProvides(h, hdr)
- if hdr is not None:
- cached[dep] = nevra(hdr)
- return nevra(hdr)
- return None
-
-
-class DependencyChecker:
- def __init__(self, grpset, how = "i"):
- self.grpset = grpset
- self.added = []
- self.unknown = []
- self.how = how
-
- # FIXME: this is the simple stupid version. it doesn't actually handle
- # paying attention to EVR or conflicts
- def callback(self, ts, sense, name, evr, flags):
- # XXX just so we don't break if I'm wrong about what this passes
- if sense in (rpm.RPMDEP_SENSE_REQUIRES, rpm.RPMTAG_REQUIRES):
- pkgnevra = depMatch(name, self.grpset.hdrlist)
- if pkgnevra and self.grpset.hdrlist.has_key(pkgnevra):
- hdr = self.grpset.hdrlist[pkgnevra]
- else:
- hdr = None
-
- if hdr is not None and not hdr.isSelected():
- if evr:
- nevr = "%s-%s" %(name, evr)
- else:
- nevr = name
- log.info("using %s to satisfy %s" %(nevra(hdr), nevr))
- ts.addInstall(hdr.hdr, hdr.hdr, self.how)
- hdr.select(isDep = 1)
- self.added.append(nevra(hdr.hdr))
-
- return -1
-
- return 1
-
class Package:
def __init__(self, hdr):
diff --git a/packages.py b/packages.py
index ffa1981ca..ab357f1ef 100644
--- a/packages.py
+++ b/packages.py
@@ -32,7 +32,7 @@ from flags import flags
from product import *
from constants import *
from syslogd import syslog
-from hdrlist import PKGTYPE_MANDATORY, PKGTYPE_DEFAULT, DependencyChecker
+from hdrlist import PKGTYPE_MANDATORY, PKGTYPE_DEFAULT
from installmethod import FileCopyException
from rhpl.translate import _
diff --git a/upgrade.py b/upgrade.py
index 786d7713e..6db512f30 100644
--- a/upgrade.py
+++ b/upgrade.py
@@ -757,34 +757,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir):
id.upgradeDeps = "%s%s\n" %(id.upgradeDeps, text)
id.upgradeRemove.append(mi.instance())
- # new package dependency fixup
- depcheck = hdrlist.DependencyChecker(id.grpset, how = "u")
- for p in id.grpset.hdrlist.pkgs.values():
- if p.isSelected():
- ts.addInstall(p.hdr, p.hdr, "u")
-
- # now we need to do a depcheck. but adding a package could require
- # rerunning the dep check due to things getting replaced (cf, #157754)
- # we want to make sure we don't loop forever, though, so let's just
- # put an arbitrary limit
- runs = 5
- while runs > 0:
- rerun = 0
- deps = ts.check(depcheck.callback)
- for ((name, version, release),
- (reqname, reqversion),
- flg, suggest, sense) in deps:
- if depcheck.callback(ts, sense, reqname, reqversion, flg) == -1:
- rerun = 1
- runs -= 1
- if rerun == 0:
- break
-
- for pkgnevra in depcheck.added:
- text = ("Upgrade Dependency: Needs %s, "
- "automatically added." % (pkgnevra,))
- # log.info(text)
- id.upgradeDeps = "%s%s\n" % (id.upgradeDeps, text)
+ #XXX: backend dep checking
win.pop()