Add anaconda support for group removal syntax (#558516).
Hi,
I cannot find anything obviously wrong with this, but
then again it is sort of Chinese to me, so you may want to have
someone who knows this code better take a look (if we have
such a person).
Regards,
Hans
On 01/27/2010 03:51 PM, Chris Lumens wrote:
This requires adding a new method to yuminstall.py that will iterate over
all the packages in a group and remove them from the transaction, regardless
of whether they are part of any installed group or not. This is subtly
different from our existing group removal function that only handles groups
selected via the UI.
---
anaconda.spec | 2 +-
backend.py | 4 ++++
kickstart.py | 3 ++-
yuminstall.py | 17 +++++++++++++++++
4 files changed, 24 insertions(+), 2 deletions(-)
# look through ksfile and if it contains any lines:
#
diff --git a/yuminstall.py b/yuminstall.py
index 67cffe7..14c3334 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -1800,6 +1800,9 @@ class YumBackend(AnacondaBackend):
return 0
def deselectGroup(self, group, *args):
+ # This method is meant to deselect groups that have been previously
+ # selected in the UI. It does not handle groups removed via kickstart.
+ # yum does not work that way (in 5.5).
try:
self.ayum.deselectGroup(group)
except yum.Errors.GroupsError, e:
@@ -1844,6 +1847,20 @@ class YumBackend(AnacondaBackend):
log.debug("no such package %s to remove" %(pkg,))
return 0
+ def removeGroupsPackages(self, grp):
+ # This method removes all the groups of a package that has been
+ # excluded via kickstart. This is subtly different from removing
+ # a group previously selected in the UI.
+ groups = self.ayum.comps.return_groups(grp)
+ for grp in groups:
+ for pkgname in grp.packages:
+ for txmbr in self.ayum.tsInfo:
+ if txmbr.po.name == pkgname and txmbr.po.state in TS_INSTALL_STATES:
+ self.ayum.tsInfo.remove(txmbr.po.pkgtup)
+
+ for pkg in self.ayum.tsInfo.conditionals.get(txmbr.name, []):
+ self.ayum.tsInfo.remove(pkg.pkgtup)
+
def upgradeFindPackages(self):
# check the installed system to see if the packages just
# are not newer in this release.
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
01-27-2010, 02:07 PM
Chris Lumens
Add anaconda support for group removal syntax (#558516).
> I cannot find anything obviously wrong with this, but
> then again it is sort of Chinese to me, so you may want to have
> someone who knows this code better take a look (if we have
> such a person).
If it helps, James Antill came up with the code and I tested it with the
proper kickstart file.
- Chris
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
01-27-2010, 02:22 PM
Hans de Goede
Add anaconda support for group removal syntax (#558516).
Hi,
On 01/27/2010 04:07 PM, Chris Lumens wrote:
I cannot find anything obviously wrong with this, but
then again it is sort of Chinese to me, so you may want to have
someone who knows this code better take a look (if we have
such a person).
If it helps, James Antill came up with the code and I tested it with the
proper kickstart file.
Well that is good enough for me, ack.
Regards,
Hans
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list