euscanwww: fixing merge

Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
volpino 2012-06-30 18:36:45 +02:00
parent 94b814481b
commit f43ab3ae3d

View File

@ -87,23 +87,12 @@ class ScanPortage(object):
parser = iterparse(output, ["start", "end"])
parser.next() # read root tag just for testing output
except ParseError:
if not query:
return
if self.purge_packages:
self.logger.info('- [p] %s' % (query))
if '/' in query:
cat, pkg = portage.catsplit(query)
Package.objects.filter(category=cat, name=pkg).delete()
else:
Package.objects.filter(name=query).delete()
else:
self.logger.error(
self.style.ERROR(
"Unknown package '%s'" % query
)
)
return
else:
cat, pkg, homepage, desc = ("", "", "", "")
versions = []
packages_alive = set()
@ -129,7 +118,8 @@ class ScanPortage(object):
if elem.tag == "package":
# package tag has been closed, saving everything!
with commit_on_success():
package = self.store_package(cat, pkg, homepage, desc)
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)
@ -271,7 +261,6 @@ 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):