summaryrefslogtreecommitdiffstats
path: root/pyanaconda/yuminstall.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2010-10-20 13:59:16 -0400
committerChris Lumens <clumens@redhat.com>2010-10-29 15:40:14 -0400
commitd20b5e6aef2fe929bfc84296f49c20a7dd5e3496 (patch)
tree30ed32ac2cc7cd068ef01f8e1610f2af17cadec0 /pyanaconda/yuminstall.py
parent0d97912780b64a85f6928d3c26429e01e91ac5e7 (diff)
downloadanaconda-d20b5e6aef2fe929bfc84296f49c20a7dd5e3496.tar.gz
anaconda-d20b5e6aef2fe929bfc84296f49c20a7dd5e3496.tar.xz
anaconda-d20b5e6aef2fe929bfc84296f49c20a7dd5e3496.zip
Remove support for split media transactions from yuminstall.py.
Diffstat (limited to 'pyanaconda/yuminstall.py')
-rw-r--r--pyanaconda/yuminstall.py101
1 files changed, 31 insertions, 70 deletions
diff --git a/pyanaconda/yuminstall.py b/pyanaconda/yuminstall.py
index f5573c7c1..437fd1625 100644
--- a/pyanaconda/yuminstall.py
+++ b/pyanaconda/yuminstall.py
@@ -49,7 +49,6 @@ from yum.misc import to_unicode
from yum.yumRepo import YumRepository
from backend import AnacondaBackend
from product import isBeta, productName, productVersion, productStamp
-from sortedtransaction import SplitMediaTransactionData
from constants import *
from image import *
from compssort import *
@@ -304,13 +303,9 @@ class AnacondaYumRepo(YumRepository):
anacondaBaseURLs = property(_getAnacondaBaseURLs, _setAnacondaBaseURLs,
doc="Extends AnacondaYum.baseurl to store non-yum urls:")
-class YumSorter(yum.YumBase):
- def _transactionDataFactory(self):
- return SplitMediaTransactionData()
-
-class AnacondaYum(YumSorter):
+class AnacondaYum(yum.YumBase):
def __init__(self, anaconda):
- YumSorter.__init__(self)
+ yum.YumBase.__init__(self)
self.anaconda = anaconda
self._timestamp = None
@@ -765,9 +760,9 @@ class AnacondaYum(YumSorter):
self.preconf.root = root
self.preconf.releasever = self._getReleasever()
self.preconf.enabled_plugins = ["whiteout", "blacklist"]
- YumSorter._getConfig(self)
+ yum.YumBase._getConfig(self)
else:
- YumSorter._getConfig(self, fn=fn, root=root,
+ yum.YumBase._getConfig(self, fn=fn, root=root,
enabled_plugins=["whiteout", "blacklist"])
self.configBaseRepo(root=root)
@@ -874,7 +869,7 @@ class AnacondaYum(YumSorter):
while True:
# retrying version of download header
try:
- YumSorter.downloadHeader(self, po)
+ yum.YumBase.downloadHeader(self, po)
break
except yum.Errors.NoMoreMirrorsRepoError:
self._handleFailure(po)
@@ -962,68 +957,42 @@ class AnacondaYum(YumSorter):
self.ts.ts.setColor(3)
def run(self, instLog, cb, intf):
- def mediasort(a, b):
- # sort so that first CD comes first, etc. -99 is a magic number
- # to tell us that the cd should be last
- if a == -99:
- return 1
- elif b == -99:
- return -1
- if a < b:
- return -1
- elif a > b:
- return 1
- return 0
-
self.initActionTs()
if self.anaconda.upgrade:
self.ts.ts.setProbFilter(~rpm.RPMPROB_FILTER_DISKSPACE)
self.setColor()
- # If we don't have any required media assume single disc
- if self.tsInfo.reqmedia == {}:
- self.tsInfo.reqmedia[0] = None
- mkeys = self.tsInfo.reqmedia.keys()
- mkeys.sort(mediasort)
-
- for i in mkeys:
- self.tsInfo.curmedia = i
- if i > 0:
- pkgtup = self.tsInfo.reqmedia[i][0]
-
- try:
- self.dsCallback = DownloadHeaderProgress(intf, self)
- self.populateTs(keepold=0)
- self.dsCallback.pop()
- self.dsCallback = None
- except RepoError, e:
- msg = _("There was an error running your transaction for "
- "the following reason: %s\n") % str(e)
+ try:
+ self.dsCallback = DownloadHeaderProgress(intf, self)
+ self.populateTs(keepold=0)
+ self.dsCallback.pop()
+ self.dsCallback = None
+ except RepoError, e:
+ msg = _("There was an error running your transaction for "
+ "the following reason: %s\n") % str(e)
- if self.anaconda.upgrade:
- rc = intf.messageWindow(_("Error"), msg, type="custom",
- custom_icon="error",
- custom_buttons=[_("_Exit installer")])
- sys.exit(1)
- else:
- rc = intf.messageWindow(_("Error"), msg,
- type="custom", custom_icon="error",
- custom_buttons=[_("_Back"), _("_Exit installer")])
+ if self.anaconda.upgrade:
+ rc = intf.messageWindow(_("Error"), msg, type="custom",
+ custom_icon="error",
+ custom_buttons=[_("_Exit installer")])
+ sys.exit(1)
+ else:
+ rc = intf.messageWindow(_("Error"), msg,
+ type="custom", custom_icon="error",
+ custom_buttons=[_("_Back"), _("_Exit installer")])
- if rc == 1:
- sys.exit(1)
- else:
- self.tsInfo.curmedia = None
- return DISPATCH_BACK
+ if rc == 1:
+ sys.exit(1)
+ else:
+ return DISPATCH_BACK
- self.ts.check()
- self.ts.order()
+ self.ts.check()
+ self.ts.order()
- if self._run(instLog, cb, intf) == DISPATCH_BACK:
- self.tsInfo.curmedia = None
- return DISPATCH_BACK
+ if self._run(instLog, cb, intf) == DISPATCH_BACK:
+ return DISPATCH_BACK
- self.ts.close()
+ self.ts.close()
def _run(self, instLog, cb, intf):
# set log fd. FIXME: this is ugly. see changelog entry from 2005-09-13
@@ -1961,17 +1930,9 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
allPkgNames = map(lambda pkg: pkg.name, self.ayum.pkgSack.returnPackages())
allPkgNames.sort()
- # On CD/DVD installs, we have one transaction per CD and will end up
- # checking allPkgNames against a very short list of packages. So we
- # have to reset to media #0, which is an all packages transaction.
- old = self.ayum.tsInfo.curmedia
- self.ayum.tsInfo.curmedia = 0
-
self.ayum.tsInfo.makelists()
txmbrNames = map (lambda x: x.name, self.ayum.tsInfo.getMembers())
- self.ayum.tsInfo.curmedia = old
-
if len(self.ayum.tsInfo.instgroups) == 0 and len(txmbrNames) == 0:
return