revisor/misc.py     |   11 ++++++-----
 revisor/pkgorder.py |   24 ++++++++++++++++--------
 2 files changed, 22 insertions(+), 13 deletions(-)

New commits:
commit 14658a6bed213fe3882abafab6416e120813ff66
Author: Jeroen van Meeuwen (Fedora Unity) <kana...@fedoraunity.org>
Date:   Sun Jul 19 03:56:44 2009 +0200

    Do not print package filenames if the file does not exist in the tree
    Select conditionals rather then apply conditionals

diff --git a/revisor/pkgorder.py b/revisor/pkgorder.py
index dbb35a1..9e1c83e 100644
--- a/revisor/pkgorder.py
+++ b/revisor/pkgorder.py
@@ -104,15 +104,19 @@ class PackageOrderer(yum.YumBase):
                     except yum.Errors.PackageSackError, e:
                         pass
 
+                # Add the conditionals because frankly we don't know if they 
are going to be selected
+                # during the installation process. In package ordering though, 
whether they end up on
+                # the corrent disc is more important
                 for condreq, cond in grp.conditional_packages.iteritems():
-                    self.log.debug(_("Adding conditional: %s / %s") % 
(condreq, cond), level=9)
-                    pkgs = self.pkgSack.searchNevra(name=condreq)
-                    if len(pkgs) > 1:
-                        pkgs = self.bestPackagesFromList(pkgs)
-                    if self.tsInfo.conditionals.has_key(cond):
-                        self.tsInfo.conditionals[cond].extend(pkgs)
-                    else:
-                        self.tsInfo.conditionals[cond] = pkgs
+                    self.log.debug(_("Testing condition: %s / %s") % (condreq, 
cond), level=9)
+                    try:
+                        pkgs = self.pkgSack.returnNewestByName(condreq)
+                        for po in pkgs:
+                            self.install(po)
+                            self.log.debug(_("Adding %s-%s:%s-%s.%s to 
transaction") % (po.name, po.epoch, po.version, po.release, po.arch), level=9)
+                    except yum.Errors.PackageSackError, e:
+                        pass
+
 
         if self.cfg.pkgorder_style == "yum":
             self.resolveDeps()
@@ -177,6 +181,10 @@ enabled=1
 
     def printMatchingPkgs(self, filename):
         if self.processed.has_key(filename): return
+
+        # If the file does not exist then what are we doing here?
+        if not 
os.path.exists(os.path.join(self.toppath,self.cfg.product_path,filename)): 
return
+
         f = open(self.cfg.pkgorder_file,"a")
         f.write(filename + "\n")
         f.close()


commit 3b7f7f40c97bf3b50e2c1504e02819c16c87af1c
Author: Jeroen van Meeuwen (Fedora Unity) <kana...@fedoraunity.org>
Date:   Sun Jul 19 03:45:15 2009 +0200

    Log about linking in packages even if it succeeds.
    Set the debug level to 9 for these other debug messages

diff --git a/revisor/misc.py b/revisor/misc.py
index a811c64..04232c0 100644
--- a/revisor/misc.py
+++ b/revisor/misc.py
@@ -578,29 +578,30 @@ def link_pkgs(pos, destdir, copy_local=False, pbar=None, 
log=None):
 
     for po in pos:
         try:
+            if log: log.debug(_("Linking %s => %s") % (po.localPkg(), destdir 
+ "/" + os.path.basename(po.localPkg())), level=9)
             os.link(po.localPkg(), destdir + "/" + 
os.path.basename(po.localPkg()))
         except OSError, e:
-            if log: log.debug(_("Package hard link failed: %s: %s") % (e, 
destdir + "/" + os.path.basename(po.localPkg())))
+            if log: log.debug(_("Package hard link failed: %s: %s") % (e, 
destdir + "/" + os.path.basename(po.localPkg())), level=9)
             if e.errno == 17:
                 continue
             elif e.errno == 18:
                 if copy_local:
-                    if log: log.debug(_("Copying: %s to %s") % (po.localPkg(), 
destdir + "/" + os.path.basename(po.localPkg())))
+                    if log: log.debug(_("Copying: %s to %s") % (po.localPkg(), 
destdir + "/" + os.path.basename(po.localPkg())), level=9)
                     shutil.copy2(po.localPkg(), destdir + "/" + 
os.path.basename(po.localPkg()))
                 else:
-                    if log: log.debug(_("Symlinking: %s to %s") % 
(po.localPkg(), destdir + "/" + os.path.basename(po.localPkg())))
+                    if log: log.debug(_("Symlinking: %s to %s") % 
(po.localPkg(), destdir + "/" + os.path.basename(po.localPkg())), level=9)
                     try:
                         os.symlink(po.localPkg(), destdir + "/" + 
os.path.basename(po.localPkg()))
                         if log: log.debug(_("Package symlink succeeded"))
                     except OSError, e:
-                        if log: log.debug(_("Package link failed, trying copy: 
%s: %s") % (e, os.path.basename(po.localPkg())))
+                        if log: log.debug(_("Package link failed, trying copy: 
%s: %s") % (e, os.path.basename(po.localPkg())), level=9)
                         try:
                             shutil.copy2(po.localPkg(), destdir + "/" + 
os.path.basename(po.localPkg()))
                         except:
                             pass
             else:
                 try:
-                    if log: log.debug(_("Package link failed, trying copy: %s: 
%s") % (e, os.path.basename(po.localPkg())))
+                    if log: log.debug(_("Package link failed, trying copy: %s: 
%s") % (e, os.path.basename(po.localPkg())), level=9)
                     shutil.copy2(po.localPkg(), destdir + "/" + 
os.path.basename(po.localPkg()))
                 except:
                     pass


_______________________________________________
revisor-devel mailing list
revisor-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/revisor-devel

Reply via email to