<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Luke Macken wrote:
<blockquote cite="mid:20071119194229.GD17076@crow.myhome.westell.com"
type="cite">
<pre wrap="">On Mon, Nov 19, 2007 at 12:34:34PM -0500, Ray Strode wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
</pre>
<blockquote type="cite">
<pre wrap="">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 ?
</pre>
</blockquote>
<pre wrap="">@@ -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']:
</pre>
</blockquote>
<pre wrap=""><!---->
Not really necessary, as every UpdateNotice will always have this field.
But being extra paranoid is probably not a bad thing :)
</pre>
<blockquote type="cite">
<pre wrap="">Although, maybe you don't want to edit the rebootpkgs list and instead
keep it hardcoded and readonly?
</pre>
</blockquote>
<pre wrap=""><!---->
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
</pre>
</blockquote>
Look good, please comiit it<br>
<br>
Tim<br>
</body>
</html>