rpms/yum/devel yum-2.5.3-conditionalgroups.patch,1.1,1.2

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Mar 2 21:35:10 UTC 2006


Author: pnasrat

Update of /cvs/dist/rpms/yum/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv22334

Modified Files:
	yum-2.5.3-conditionalgroups.patch 
Log Message:
Cover pkg selected then group

yum-2.5.3-conditionalgroups.patch:
 docs/yum.conf.5        |    4 ++++
 output.py              |    5 +++++
 yum/__init__.py        |   35 +++++++++++++++++++++++++++++++++++
 yum/config.py          |    1 +
 yum/transactioninfo.py |   23 +++++++++++++++++++----
 5 files changed, 64 insertions(+), 4 deletions(-)

Index: yum-2.5.3-conditionalgroups.patch
===================================================================
RCS file: /cvs/dist/rpms/yum/devel/yum-2.5.3-conditionalgroups.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- yum-2.5.3-conditionalgroups.patch	2 Mar 2006 17:40:29 -0000	1.1
+++ yum-2.5.3-conditionalgroups.patch	2 Mar 2006 21:35:06 -0000	1.2
@@ -1,5 +1,5 @@
 --- yum-2.5.3/yum/transactioninfo.py.cond	2006-02-10 00:08:59.000000000 -0500
-+++ yum-2.5.3/yum/transactioninfo.py	2006-03-02 11:25:13.000000000 -0500
++++ yum-2.5.3/yum/transactioninfo.py	2006-03-02 15:51:43.000000000 -0500
 @@ -295,7 +295,22 @@
          self.add(txmbr)
          return txmbr
@@ -48,7 +48,7 @@
  
      def sort(self):
 --- yum-2.5.3/yum/config.py.cond	2006-02-13 15:40:21.000000000 -0500
-+++ yum-2.5.3/yum/config.py	2006-03-02 11:25:13.000000000 -0500
++++ yum-2.5.3/yum/config.py	2006-03-02 15:51:43.000000000 -0500
 @@ -508,6 +508,7 @@
      enabled = BoolOption(True)
      plugins = BoolOption(False)
@@ -58,7 +58,7 @@
      timeout = FloatOption(30.0)
  
 --- yum-2.5.3/yum/__init__.py.cond	2006-02-22 17:07:19.000000000 -0500
-+++ yum-2.5.3/yum/__init__.py	2006-03-02 11:25:13.000000000 -0500
++++ yum-2.5.3/yum/__init__.py	2006-03-02 16:31:44.000000000 -0500
 @@ -70,6 +70,8 @@
  
      def _transactionDataFactory(self):
@@ -68,18 +68,19 @@
          return transactioninfo.TransactionData()
  
      def log(self, value, msg):
-@@ -1373,6 +1375,22 @@
+@@ -1373,6 +1375,23 @@
                  for txmbr in txmbrs:
                      txmbr.groups.append(thisgroup.groupid)
          
 +        if self.conf.enable_group_conditionals:
 +            for condreq, cond in thisgroup.conditional_packages.iteritems():
-+                if self.rpmdb.installed(name = cond):
++                if self._isPackageInstalled(cond):
 +                    txmbrs = self.install(name = condreq)
 +                    txmbrs_used.extend(txmbrs)
 +                    for txmbr in txmbrs:
 +                        txmbr.groups.append(thisgroup.groupid)
 +                    continue
++                # Otherwise we hook into tsInfo.add
 +                pkgs = self.pkgSack.searchNevra(name=condreq)
 +                if pkgs:
 +                    pkgs = self.bestPackagesFromList(pkgs)
@@ -91,8 +92,28 @@
          return txmbrs_used
  
      def deselectGroup(self, grpid):
+@@ -1869,3 +1888,19 @@
+         
+         return returndict
+ 
++    def _isPackageInstalled(self, pkgname):
++        # FIXME: Taken from anaconda/pirut 
++        # clean up and make public
++        installed = False
++        if self.rpmdb.installed(name = pkgname):
++            installed = True
++
++        lst = self.tsInfo.matchNaevr(name = pkgname)
++        for txmbr in lst:
++            if txmbr.output_state in TS_INSTALL_STATES:
++                return True
++        if installed and len(lst) > 0:
++            # if we get here, then it was installed, but it's in the tsInfo
++            # for an erase or obsoleted --> not going to be installed at end
++            return False
++        return installed
 --- yum-2.5.3/docs/yum.conf.5.cond	2006-02-10 00:19:10.000000000 -0500
-+++ yum-2.5.3/docs/yum.conf.5	2006-03-02 11:25:13.000000000 -0500
++++ yum-2.5.3/docs/yum.conf.5	2006-03-02 15:51:43.000000000 -0500
 @@ -110,6 +110,10 @@
  repository will be used. If \fBoverwrite_groups\fR is `0' then the groups
  from all matching repositories will be merged together as one large group.
@@ -105,7 +126,7 @@
  Specifies an alternative installroot, relative to which all packages will be
  installed. 
 --- yum-2.5.3/output.py.cond	2005-12-08 03:01:37.000000000 -0500
-+++ yum-2.5.3/output.py	2006-03-02 11:25:23.000000000 -0500
++++ yum-2.5.3/output.py	2006-03-02 15:51:43.000000000 -0500
 @@ -142,6 +142,11 @@
              for item in group.optional_packages.keys():
                  print '   %s' % item




More information about the fedora-cvs-commits mailing list