euscanwww: fixing merge
Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
parent
94b814481b
commit
f43ab3ae3d
@ -87,23 +87,12 @@ class ScanPortage(object):
|
|||||||
parser = iterparse(output, ["start", "end"])
|
parser = iterparse(output, ["start", "end"])
|
||||||
parser.next() # read root tag just for testing output
|
parser.next() # read root tag just for testing output
|
||||||
except ParseError:
|
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.logger.error(
|
||||||
self.style.ERROR(
|
self.style.ERROR(
|
||||||
"Unknown package '%s'" % query
|
"Unknown package '%s'" % query
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return
|
else:
|
||||||
|
|
||||||
cat, pkg, homepage, desc = ("", "", "", "")
|
cat, pkg, homepage, desc = ("", "", "", "")
|
||||||
versions = []
|
versions = []
|
||||||
packages_alive = set()
|
packages_alive = set()
|
||||||
@ -129,7 +118,8 @@ class ScanPortage(object):
|
|||||||
if elem.tag == "package":
|
if elem.tag == "package":
|
||||||
# package tag has been closed, saving everything!
|
# package tag has been closed, saving everything!
|
||||||
with commit_on_success():
|
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))
|
packages_alive.add('%s/%s' % (cat, pkg))
|
||||||
for cpv, slot, overlay in versions:
|
for cpv, slot, overlay in versions:
|
||||||
self.store_version(package, cpv, slot, overlay)
|
self.store_version(package, cpv, slot, overlay)
|
||||||
@ -271,7 +261,6 @@ class ScanPortage(object):
|
|||||||
Version.objects.filter(packaged=True, alive=False).delete()
|
Version.objects.filter(packaged=True, alive=False).delete()
|
||||||
|
|
||||||
|
|
||||||
@commit_on_success
|
|
||||||
def scan_portage(packages=None, no_log=False, purge_packages=False,
|
def scan_portage(packages=None, no_log=False, purge_packages=False,
|
||||||
purge_versions=False, prefetch=False, logger=None):
|
purge_versions=False, prefetch=False, logger=None):
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user