FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 09-01-2008, 02:25 PM
"Xavier Toth"
 
Default yum: make transaction results available to plugins

Put the result of the transaction in the TranactionData object so that
it is available to plugins.

--- yum-3.2.19/yum/transactioninfo.py 2008-08-12 08:54:00.000000000 -0500
+++ yum-3.2.19.new/yum/transactioninfo.py 2008-08-31 10:00:22.000000000 -0500
@@ -63,7 +63,8 @@
self.depremoved = []
self.depinstalled = []
self.depupdated = []
-
+ self.transaction_result = None
+
def __len__(self):
return len(self.pkgdict)

@@ -459,6 +460,12 @@
result.update(self.getNewRequires(name, flag, version))
return result

+ def getTransactionResult(self):
+ return self.transaction_result
+
+ def setTransactionResult(self, result):
+ self.transaction_result = result
+
class ConditionalTransactionData(TransactionData):
"""A transaction data implementing conditional package addition"""
def __init__(self):
--- yum-3.2.19/yum/__init__.py 2008-08-26 14:37:17.000000000 -0500
+++ yum-3.2.19.new/yum/__init__.py 2008-08-31 09:59:40.000000000 -0500
@@ -799,6 +799,8 @@
else:
raise Errors.YumBaseError, errors

+ self.tsInfo.setTransactionResult(resultobject)
+
if not self.conf.keepcache:
self.cleanUsedHeadersPackages()

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 09-01-2008, 03:00 PM
Seth Vidal
 
Default yum: make transaction results available to plugins

On Mon, 2008-09-01 at 09:25 -0500, Xavier Toth wrote:
> Put the result of the transaction in the TranactionData object so that
> it is available to plugins.
>


What is this for? What's the use case?

-sv


> --- yum-3.2.19/yum/transactioninfo.py 2008-08-12 08:54:00.000000000 -0500
> +++ yum-3.2.19.new/yum/transactioninfo.py 2008-08-31 10:00:22.000000000 -0500
> @@ -63,7 +63,8 @@
> self.depremoved = []
> self.depinstalled = []
> self.depupdated = []
> -
> + self.transaction_result = None
> +
> def __len__(self):
> return len(self.pkgdict)
>
> @@ -459,6 +460,12 @@
> result.update(self.getNewRequires(name, flag, version))
> return result
>
> + def getTransactionResult(self):
> + return self.transaction_result
> +
> + def setTransactionResult(self, result):
> + self.transaction_result = result
> +
> class ConditionalTransactionData(TransactionData):
> """A transaction data implementing conditional package addition"""
> def __init__(self):
> --- yum-3.2.19/yum/__init__.py 2008-08-26 14:37:17.000000000 -0500
> +++ yum-3.2.19.new/yum/__init__.py 2008-08-31 09:59:40.000000000 -0500
> @@ -799,6 +799,8 @@
> else:
> raise Errors.YumBaseError, errors
>
> + self.tsInfo.setTransactionResult(resultobject)
> +
> if not self.conf.keepcache:
> self.cleanUsedHeadersPackages()


--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 09-01-2008, 04:02 PM
"Xavier Toth"
 
Default yum: make transaction results available to plugins

I have a number of rpms that install SELinux policy modules during the
post install and I want yum to exit if there is any problem. I've
written a plugin with a posttrans method that examines the result and
exits if there was any problem. If there is another way to do this I'd
be happy to hear about it.

On Mon, Sep 1, 2008 at 10:00 AM, Seth Vidal <skvidal@fedoraproject.org> wrote:
> On Mon, 2008-09-01 at 09:25 -0500, Xavier Toth wrote:
>> Put the result of the transaction in the TranactionData object so that
>> it is available to plugins.
>>
>
>
> What is this for? What's the use case?
>
> -sv
>
>
>> --- yum-3.2.19/yum/transactioninfo.py 2008-08-12 08:54:00.000000000 -0500
>> +++ yum-3.2.19.new/yum/transactioninfo.py 2008-08-31 10:00:22.000000000 -0500
>> @@ -63,7 +63,8 @@
>> self.depremoved = []
>> self.depinstalled = []
>> self.depupdated = []
>> -
>> + self.transaction_result = None
>> +
>> def __len__(self):
>> return len(self.pkgdict)
>>
>> @@ -459,6 +460,12 @@
>> result.update(self.getNewRequires(name, flag, version))
>> return result
>>
>> + def getTransactionResult(self):
>> + return self.transaction_result
>> +
>> + def setTransactionResult(self, result):
>> + self.transaction_result = result
>> +
>> class ConditionalTransactionData(TransactionData):
>> """A transaction data implementing conditional package addition"""
>> def __init__(self):
>> --- yum-3.2.19/yum/__init__.py 2008-08-26 14:37:17.000000000 -0500
>> +++ yum-3.2.19.new/yum/__init__.py 2008-08-31 09:59:40.000000000 -0500
>> @@ -799,6 +799,8 @@
>> else:
>> raise Errors.YumBaseError, errors
>>
>> + self.tsInfo.setTransactionResult(resultobject)
>> +
>> if not self.conf.keepcache:
>> self.cleanUsedHeadersPackages()
>
>
> --
> fedora-devel-list mailing list
> fedora-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-devel-list
>

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 09-01-2008, 06:20 PM
Tim Lauridsen
 
Default yum: make transaction results available to plugins

Xavier Toth wrote:

I have a number of rpms that install SELinux policy modules during the
post install and I want yum to exit if there is any problem. I've
written a plugin with a posttrans method that examines the result and
exits if there was any problem. If there is another way to do this I'd
be happy to hear about it.



def postresolve_hook(conduit):
txmbrs = conduit.getTsInfo().getMembers()
# Do your actions on txmbrs


This shoud give you the result of the transaction after depsolve.

Tim

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 09-02-2008, 01:42 PM
"Xavier Toth"
 
Default yum: make transaction results available to plugins

On Mon, Sep 1, 2008 at 1:20 PM, Tim Lauridsen
<tim.lauridsen@googlemail.com> wrote:
> Xavier Toth wrote:
>>
>> I have a number of rpms that install SELinux policy modules during the
>> post install and I want yum to exit if there is any problem. I've
>> written a plugin with a posttrans method that examines the result and
>> exits if there was any problem. If there is another way to do this I'd
>> be happy to hear about it.
>>
>
> def postresolve_hook(conduit):
> txmbrs = conduit.getTsInfo().getMembers()
> # Do your actions on txmbrs
>
>
> This shoud give you the result of the transaction after depsolve.
>
> Tim
>
> --
> fedora-devel-list mailing list
> fedora-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-devel-list
>

The post install script has not been run at this point so this does
not address the issue I have.

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 09-02-2008, 06:46 PM
Callum Lerwick
 
Default yum: make transaction results available to plugins

On Mon, 2008-09-01 at 09:25 -0500, Xavier Toth wrote:
> @@ -459,6 +460,12 @@
> result.update(self.getNewRequires(name, flag, version))
> return result
>
> + def getTransactionResult(self):
> + return self.transaction_result
> +
> + def setTransactionResult(self, result):
> + self.transaction_result = result
> +
> class ConditionalTransactionData(TransactionData):
> """A transaction data implementing conditional package addition"""
> def __init__(self):

Getters and setters? In Python?

http://dirtsimple.org/2004/12/python-is-not-java.html
--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 09-02-2008, 07:20 PM
"Xavier Toth"
 
Default yum: make transaction results available to plugins

2008/9/2 Callum Lerwick <seg@haxxed.com>:
> On Mon, 2008-09-01 at 09:25 -0500, Xavier Toth wrote:
>> @@ -459,6 +460,12 @@
>> result.update(self.getNewRequires(name, flag, version))
>> return result
>>
>> + def getTransactionResult(self):
>> + return self.transaction_result
>> +
>> + def setTransactionResult(self, result):
>> + self.transaction_result = result
>> +
>> class ConditionalTransactionData(TransactionData):
>> """A transaction data implementing conditional package addition"""
>> def __init__(self):
>
> Getters and setters? In Python?
>
> http://dirtsimple.org/2004/12/python-is-not-java.html
>
> --
> fedora-devel-list mailing list
> fedora-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-devel-list
>

If the maintainer doesn't like the patch code they are welcome to
change it all they want as long as there is a way to get the result of
the transaction in a plugin that's all I care about.

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 

Thread Tools




All times are GMT. The time now is 08:10 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org