euscanwww: fixed commit_on_success

Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
volpino 2012-06-30 19:21:43 +02:00
parent 09f0f75a42
commit 71f71c5b58

View File

@ -117,12 +117,11 @@ class ScanPortage(object):
elif event == "end": # on tag closing
if elem.tag == "package":
# package tag has been closed, saving everything!
with commit_on_success():
package = self.store_package(cat, pkg, homepage,
desc)
packages_alive.add('%s/%s' % (cat, pkg))
for cpv, slot, overlay in versions:
self.store_version(package, cpv, slot, overlay)
package = self.store_package(cat, pkg, homepage,
desc)
packages_alive.add('%s/%s' % (cat, pkg))
for cpv, slot, overlay in versions:
self.store_version(package, cpv, slot, overlay)
# clean old data
pkg, homepage, desc = ("", "", "")
@ -261,6 +260,7 @@ class ScanPortage(object):
Version.objects.filter(packaged=True, alive=False).delete()
@commit_on_success
def scan_portage(packages=None, no_log=False, purge_packages=False,
purge_versions=False, prefetch=False, logger=None):