bodhi/controllers.py | 7 +++++--
bodhi/metadata.py | 1 +
bodhi/tests/test_metadata.py | 1 +
bodhi/tools/0day.py | 34 ++++++++++++++++++++++++++++++++++
4 files changed, 41 insertions(+), 2 deletions(-)
New commits:
commit 85ed47759f4cbc8cd1a770198e24ef584d43d3ce
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Aug 27 18:58:29 2009 -0400
Add the RPM Epoch to our updateinfo.xml (#519405)
diff --git a/bodhi/metadata.py b/bodhi/metadata.py
index 384eb29..8ce565e 100644
--- a/bodhi/metadata.py
+++ b/bodhi/metadata.py
@@ -245,6 +245,7 @@ class ExtendedMetadata:
'name' : rpm['name'],
'version' : rpm['version'],
'release' : rpm['release'],
+ 'epoch' : rpm['epoch'],
'arch' : rpm['arch'],
'src' : urlpath
})
diff --git a/bodhi/tests/test_metadata.py b/bodhi/tests/test_metadata.py
index 5424500..ca7905d 100644
--- a/bodhi/tests/test_metadata.py
+++ b/bodhi/tests/test_metadata.py
@@ -72,6 +72,7 @@ class TestExtendedMetadata(testutil.DBTest):
assert notice['description'] == update.notes
assert notice['issued'] != None
assert notice['update_id'] == update.updateid
+ assert notice['epoch'] == None
cve = notice['references'][0]
assert cve['type'] == 'cve'
assert cve['href'] == update.cves[0].get_url()
commit 3fb1e69619dc9a1ddf35039bc535a176dda682f0
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Aug 27 18:57:55 2009 -0400
Get our test_delete unit test working again.
This ensures that all deleted updates get untagged, and that we
do not delete any builds that are in more than one update.
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 03c5bbd..eb3698c 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -408,12 +408,15 @@ class Root(controllers.RootController):
if request_format() == 'json': return dict()
raise redirect(update.get_url())
if not update.pushed:
- mail.send_admin('deleted', update)
msg = "Deleted %s" % update.title
map(lambda x: x.destroySelf(), update.comments)
- map(lambda x: x.destroySelf(), update.builds)
+ for build in update.builds:
+ if len(build.updates) == 1:
+ build.destroySelf()
+ update.untag()
update.destroySelf()
flash_log(msg)
+ mail.send_admin('deleted', update)
else:
flash_log("Cannot delete a pushed update")
except SQLObjectNotFound:
commit a07a48db9018e44cdd219099bdf562796be26f5c
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Aug 20 21:39:00 2009 -0400
Add a script to calculate some F11 0day update metrics
diff --git a/bodhi/tools/0day.py b/bodhi/tools/0day.py
new file mode 100644
index 0000000..98eccf7
--- /dev/null
+++ b/bodhi/tools/0day.py
@@ -0,0 +1,34 @@
+#!/usr/bin/python -tt
+# A script to calculate F11 0day update metrics
+
+import time
+from datetime import datetime
+from pprint import pprint
+from turbogears.database import PackageHub
+from bodhi.util import load_config
+from bodhi.model import PackageUpdate, Release
+
+def main():
+ load_config()
+ print "Calculating F11 0day update metrics..."
+ updates = {'bugfix': [], 'security': [], 'enhancement': [],
'newpackage': []}
+ date = datetime(*time.strptime('06-09-2009', '%m-%d-%Y')[:-2])
+ f11 = Release.byName('F11')
+ for update in PackageUpdate.select(PackageUpdate.q.releaseID==f11.id):
+ for comment in update.comments:
+ if comment.author == 'bodhi' and comment.timestamp < date and \
+ comment.text.startswith('This update has been pushed to stable'):
+ updates[update.type].append(update.title)
+ break
+
+ pprint(updates)
+ print '=' * 80
+ print 'F11 0day stats'
+ print ' * %d security' % len(updates['security'])
+ print ' * %d bugfixes' % len(updates['bugfix'])
+ print ' * %d enhancements' % len(updates['enhancement'])
+ print ' * %d newpackage' % len(updates['newpackage'])
+
+if __name__ == '__main__':
+ main()
+
Show replies by date