From 72365186d678d2f2b6948827d5c54bf419ab5793 Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Wed, 8 Jan 2003 22:24:19 +0000 Subject: 1) if we found a comps.rpm, the number of packages being installed should be bumped by one 2) if installing the comps.rpm fails for some reason, include the exception message in the log 3) don't run vgscan as part of the post-install unless there are some volume groups created (#81168) --- packages.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'packages.py') diff --git a/packages.py b/packages.py index 9f83b5e66..0c7232928 100644 --- a/packages.py +++ b/packages.py @@ -730,10 +730,15 @@ def doInstall(method, id, intf, instPath): pass syslog.start (instPath, syslogname) + if id.compspkg is not None: + num = i + 1 + else: + num = i + if upgrade: - instLog.write(_("Upgrading %s packages\n\n") % (i)) + instLog.write(_("Upgrading %s packages\n\n") % (num,)) else: - instLog.write(_("Installing %s packages\n\n") % (i)) + instLog.write(_("Installing %s packages\n\n") % (num,)) ts.scriptFd = instLog.fileno () # the transaction set dup()s the file descriptor and will close the @@ -1040,8 +1045,8 @@ def doPostInstall(method, id, intf, instPath): os.unlink(id.compspkg) del ts - except: - log("failed to install comps.rpm. oh well") + except Exception, e: + log("comps.rpm failed to install: %s" %(e,)) try: os.unlink(id.compspkg) except: @@ -1055,8 +1060,10 @@ def doPostInstall(method, id, intf, instPath): finally: pass - # XXX hack - we should really write a proper /etc/lvmtab - if os.access(instPath + "/sbin/vgscan", os.X_OK): + # XXX hack - we should really write a proper /etc/lvmtab. but for now + # just create the lvmtab if they have /sbin/vgscan and some VGs + if (os.access(instPath + "/sbin/vgscan", os.X_OK) and + len(os.listdir("/proc/lvm/VGs")) > 0): rc = iutil.execWithRedirect("/sbin/vgscan", ["vgscan", "-v"], stdout = "/dev/tty5", -- cgit