/[smeserver]/cdrom.image/updates/packages.py
ViewVC logotype

Diff of /cdrom.image/updates/packages.py

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.8 by gordonr, Mon Oct 10 04:14:41 2005 UTC Revision 1.9 by slords, Wed Apr 5 01:20:27 2006 UTC
# Line 643  def doPreInstall(method, id, intf, instP Line 643  def doPreInstall(method, id, intf, instP
643    
644      if not upgrade:      if not upgrade:
645          foundkernel = 0          foundkernel = 0
646          if isys.smpAvailable() or isys.htavailable():          nthreads = isys.acpicpus()
647              if select(id.grpset.hdrlist, 'kernel-smp'):  
648            if nthreads == 0:
649                # this should probably be table driven or something...
650                ncpus = isys.smpAvailable() or 1
651                nthreads = isys.htavailable() or 1
652                ncores = isys.coresavailable()
653    
654                if ncpus == 1: # machines that have one socket
655                    nthreads = nthreads;
656                else: # machines with more than one socket
657                    nthreads = (nthreads / ncores) * ncpus
658    
659            largesmp_min = -1
660            if iutil.getArch() == "x86_64":
661                largesmp_min = 8
662            elif iutil.getArch() == "ppc" and iutil.getPPCMachine() != "iSeries":
663                largesmp_min = 64
664            elif iutil.getArch() == "ia64":
665                largesmp_min = 64
666    
667            if largesmp_min > 0 and nthreads > largesmp_min and \
668                    select(id.grpset.hdrlist, "kernel-largesmp"):
669                foundKernel = 1
670                if selected(id.grpset.hdrlist, "gcc"):
671                    select(id.grpset.hdrlist, "kernel-largesmp-devel")
672            elif nthreads > 1:
673                if select(id.grpset.hdrlist, "kernel-smp"):
674                  foundkernel = 1                  foundkernel = 1
675                  if selected(id.grpset.hdrlist, "gcc"):                  if selected(id.grpset.hdrlist, "gcc"):
676                      select(id.grpset.hdrlist, "kernel-smp-devel")                      select(id.grpset.hdrlist, "kernel-smp-devel")
# Line 660  def doPreInstall(method, id, intf, instP Line 686  def doPreInstall(method, id, intf, instP
686          if foundkernel == 0:          if foundkernel == 0:
687              # we *always* need to have some sort of kernel installed              # we *always* need to have some sort of kernel installed
688              select(id.grpset.hdrlist, 'kernel')              select(id.grpset.hdrlist, 'kernel')
689              if selected(id.grpset.hdrlist, "gcc"):              
690                  select(id.grpset.hdrlist, "kernel-devel")          if (selected(id.grpset.hdrlist, "gcc") and
691                selected(id.grpset.hdrlist, "kernel")):
692                select(id.grpset.hdrlist, "kernel-devel")
693    
694          # if NIS is configured, install ypbind and dependencies:          # if NIS is configured, install ypbind and dependencies:
695          if id.auth.useNIS:          if id.auth.useNIS:
# Line 863  def doInstall(method, id, intf, instPath Line 891  def doInstall(method, id, intf, instPath
891          for pkg in id.upgradeRemove:          for pkg in id.upgradeRemove:
892              ts.addErase(pkg)              ts.addErase(pkg)
893    
894            # set the rpm log file to /dev/null so that we don't segfault
895            f = open("/dev/null", "w+")
896            rpm.setLogFile(f)
897            ts.scriptFd = f.fileno()
898    
899          # if we hit problems, it's not like there's anything we can          # if we hit problems, it's not like there's anything we can
900          # do about it          # do about it
901          ts.run(install_callback, 0)          ts.run(install_callback, 0)
# Line 893  def doInstall(method, id, intf, instPath Line 926  def doInstall(method, id, intf, instPath
926    
927      progress.pop()      progress.pop()
928    
929        # set the rpm log file to /dev/null to start with so we don't segfault
930        f = open("/dev/null", "w+")
931        rpm.setLogFile(f)
932        ts.scriptFd = f.fileno()
933    
934      depcheck = DependencyChecker(id.grpset)      depcheck = DependencyChecker(id.grpset)
935      if not id.grpset.hdrlist.preordered():      if not id.grpset.hdrlist.preordered():
936          log ("WARNING: not all packages in hdlist had order tag")          log ("WARNING: not all packages in hdlist had order tag")
937          # have to call ts.check before ts.order() to set up the alIndex          # have to call ts.check before ts.order() to set up the alIndex
938          ts.check(depcheck.callback)          ts.check(depcheck.callback)
939            log ("did ts.check, doing ts.order")
940          ts.order()          ts.order()
941            log ("ts.order is done")
942      else:      else:
943          ts.check(depcheck.callback)          ts.check(depcheck.callback)
944    
# Line 937  def doInstall(method, id, intf, instPath Line 977  def doInstall(method, id, intf, instPath
977          instLog.write(_("Installing %s packages\n\n") % (num,))          instLog.write(_("Installing %s packages\n\n") % (num,))
978    
979      ts.scriptFd = instLog.fileno ()      ts.scriptFd = instLog.fileno ()
980        log ("setting rpm logfile")
981      rpm.setLogFile(instLog)      rpm.setLogFile(instLog)
982      # the transaction set dup()s the file descriptor and will close the      # the transaction set dup()s the file descriptor and will close the
983      # dup'd when we go out of scope      # dup'd when we go out of scope
# Line 946  def doInstall(method, id, intf, instPath Line 987  def doInstall(method, id, intf, instPath
987      else:      else:
988          modeText = _("Installing %s\n")          modeText = _("Installing %s\n")
989    
990        log ("getting rpm error class")
991      errors = rpmErrorClass(instLog)      errors = rpmErrorClass(instLog)
992      pkgTimer = timer.Timer(start = 0)      pkgTimer = timer.Timer(start = 0)
993    
# Line 969  def doInstall(method, id, intf, instPath Line 1011  def doInstall(method, id, intf, instPath
1011      cb.initWindow = intf.waitWindow(_("Install Starting"),      cb.initWindow = intf.waitWindow(_("Install Starting"),
1012                                      _("Starting install process, this may take several minutes..."))                                      _("Starting install process, this may take several minutes..."))
1013    
1014        log ("setting problem filter")
1015      ts.setProbFilter(~rpm.RPMPROB_FILTER_DISKSPACE)      ts.setProbFilter(~rpm.RPMPROB_FILTER_DISKSPACE)
1016      problems = ts.run(cb.cb, 0)      problems = ts.run(cb.cb, 0)
1017    
# Line 1289  def doPostInstall(method, id, intf, inst Line 1332  def doPostInstall(method, id, intf, inst
1332      for line in lines:      for line in lines:
1333          instLog.write(line)          instLog.write(line)
1334            
1335    
1336      # XXX hack - we should really write a proper lvm "config".  but for now      # XXX hack - we should really write a proper lvm "config".  but for now
1337      # just vgscan if they have /sbin/lvm and some appearance of volumes      # just vgscan if they have /sbin/lvm and some appearance of volumes
1338      if (os.access(instPath + "/sbin/lvm", os.X_OK) and      if (os.access(instPath + "/sbin/lvm", os.X_OK) and


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed