[Yum-devel] [PATCH 3/4] Add tsInfo.deselect() so we can remove it from anaconda

Tim Lauridsen tim.lauridsen at googlemail.com
Wed Apr 21 16:07:49 UTC 2010


On Mon, Apr 19, 2010 at 10:00 PM, James Antill <james at and.org> wrote:

> ---
>  yum/transactioninfo.py |   32 ++++++++++++++++++++++++++++++++
>  1 files changed, 32 insertions(+), 0 deletions(-)
>
> diff --git a/yum/transactioninfo.py b/yum/transactioninfo.py
> index dfa34b3..41af838 100644
> --- a/yum/transactioninfo.py
> +++ b/yum/transactioninfo.py
> @@ -193,6 +193,38 @@ class TransactionData:
>
>         return result
>
> +    def deselect(self, pattern):
> +        """ Remove these packages from the transaction. This is more user
> +            orientated than .remove(). Used from kickstart/install -blah.
> """
> +
> +        #  We don't have a returnPackages() here, so just try the "simple"
> +        # specifications. Pretty much 100% hit rate on kickstart.
> +        txmbrs = self.matchNaevr(pattern)
> +        if not txmbrs:
> +            na = pattern.rsplit('.', 2)
> +            txmbrs = self.matchNaevr(na[0], na[1])
> +
> +        if not txmbrs:
> +            if self.pkgSack is not None:
> +                pkgs = []
> +            else:
> +                pkgs = self.pkgSack.returnPackages(pattern)
> +            if not pkgs:
> +                pkgs = self.rpmdb.returnPackages(pattern)
> +
> +            for pkg in pkgs:
> +                txmbrs.extend(self.getMembers(pkg.pkgtup))
> +                #  Now we need to do conditional group packages, so they
> don't
> +                # get added later on. This is hacky :(
> +                for req, cpkgs in self.conditionals.iteritems():
> +                    if pkg in cpkgs:
> +                        cpkgs.remove(pkg)
> +                        self.conditionals[req] = cpkgs
> +
> +        for txmbr in txmbrs:
> +            self.remove(txmbr.pkgtup)
> +        return txmbrs
> +
>     def _isLocalPackage(self, txmember):
>         # Is this the right criteria?
>         # FIXME: This is kinda weird, we really want all local pkgs to be
> in a
> --
> 1.6.6.1
>
> _______________________________________________
> Yum-devel mailing list
> Yum-devel at lists.baseurl.org
> http://lists.baseurl.org/mailman/listinfo/yum-devel
>

ACK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20100421/aca5a4c0/attachment.htm>


More information about the Yum-devel mailing list