[packagekit] [RFE] Reboot on upgrade ???

Tim Lauridsen tim.lauridsen at googlemail.com
Mon Nov 19 11:45:57 PST 2007


Luke Macken wrote:
> On Mon, Nov 19, 2007 at 12:34:34PM -0500, Ray Strode wrote:
>   
>> Hi,
>>
>>     
>>> Attached is a patch that turns the updateMetadata into a property(), and
>>> updates the rebootpkgs on the fly with any packages that are flagged
>>> with reboot_suggested in the updateinfo.  Aside from running the
>>> backend test suite, I have not performed any further testing with it.
>>> Tim, what are your thoughts on it ?
>>>       
>> @@ -836,8 +836,12 @@ class PackageKitYumBackend(PackageKitBaseBackend):
>>              self.error(ERROR_PACKAGE_ALREADY_INSTALLED,"No available updates")
>>
>>      def _check_for_reboot(self):
>> +        md = self.updateMetadata
>>          for txmbr in self.yumbase.tsInfo:
>>              pkg = txmbr.po
>> +            notice = md.get_notice((pkg.name, pkg.version, pkg.release))
>> +            if notice and notice['reboot_suggested']:
>> +                self.rebootpkgs.append(pkg.name)
>>              # check if package is in reboot list and is installed/updated etc
>>              print pkg.name,txmbr.output_state
>>              if pkg.name in self.rebootpkgs and txmbr.ts_state in
>> TS_INSTALL_STATES:
>>
>> Skimming the patch,
>>
>> +            if notice and notice['reboot_suggested']:
>>
>> should probably be
>>
>> +            if notice and notice.has_key('reboot_suggested') and
>> notice['reboot_suggested']:
>>     
>
> Not really necessary, as every UpdateNotice will always have this field.
> But being extra paranoid is probably not a bad thing :)
>
>   
>> Although, maybe you don't want to edit the rebootpkgs list and instead
>> keep it hardcoded and readonly?
>>     
>
> Works for me.  Attached is a reworked patch that leaves the rebootpkgs
> tuple alone, makes sure the notice has the reboot_suggested field, and
> utilizes it in the "pkg.name in self.rebootpkgs" conditional.
>
> luke
>   
Look good, please comiit it

Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/packagekit/attachments/20071119/8040765e/attachment-0003.htm>


More information about the PackageKit mailing list