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

Ray Strode halfline at gmail.com
Mon Nov 19 09:34:34 PST 2007


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']:

Although, maybe you don't want to edit the rebootpkgs list and instead
keep it hardcoded and readonly?

--Ray



More information about the PackageKit mailing list