Merge branch 'master' of https://github.com/iksaif/euscan
Conflicts: euscanwww/djeuscan/models.py Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
commit
9cddc82808
@ -8,6 +8,7 @@ from gentoolkit.errors import GentoolkitFatalError
|
||||
from django.db.transaction import commit_on_success
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.core.management.color import color_style
|
||||
from django.core.exceptions import ValidationError
|
||||
|
||||
from djeuscan.models import Package, Herd, Maintainer
|
||||
|
||||
@ -89,10 +90,15 @@ class ScanMetadata(object):
|
||||
|
||||
for maintainer in new_maintainers:
|
||||
maintainer = maintainers[maintainer]
|
||||
maintainer = self.store_maintainer(
|
||||
maintainer.name, maintainer.email
|
||||
)
|
||||
obj.maintainers.add(maintainer)
|
||||
try:
|
||||
maintainer = self.store_maintainer(
|
||||
maintainer.name, maintainer.email
|
||||
)
|
||||
obj.maintainers.add(maintainer)
|
||||
except ValidationError:
|
||||
sys.stderr.write(
|
||||
self.style.ERROR("Bad maintainer: '%s' '%s'\n" % (maintainer.name, maintainer.email))
|
||||
)
|
||||
|
||||
obj.save()
|
||||
|
||||
|
@ -205,10 +205,10 @@ class ScanPortage(object):
|
||||
overlay=overlay,
|
||||
defaults={"alive": True, "packaged": True}
|
||||
)
|
||||
if not created:
|
||||
obj.alive = True
|
||||
obj.packaged = True
|
||||
obj.save()
|
||||
if not created: # Created objects have defaults values
|
||||
obj.alive = True
|
||||
obj.packaged = True
|
||||
obj.save()
|
||||
|
||||
if created:
|
||||
self.cache_store_version(obj)
|
||||
@ -240,7 +240,6 @@ class ScanPortage(object):
|
||||
overlay=obj.overlay
|
||||
)
|
||||
|
||||
|
||||
@commit_on_success
|
||||
def purge_versions(quiet=False, nolog=False):
|
||||
# For each dead versions
|
||||
|
@ -68,7 +68,7 @@ class ScanUpstream(object):
|
||||
def store_version(self, package, ver, url):
|
||||
obj, created = Version.objects.get_or_create(
|
||||
package=package, slot='', revision='r0', version=ver, overlay='',
|
||||
defaults={"alive": True, "urls": url, "packaged": True}
|
||||
defaults={"alive": True, "urls": url, "packaged": False}
|
||||
)
|
||||
if not created:
|
||||
obj.alive = True
|
||||
@ -99,6 +99,9 @@ class ScanUpstream(object):
|
||||
def parse_output(self, output):
|
||||
from portage.versions import _cp
|
||||
|
||||
if type(_cp) == dict:
|
||||
_cp = _cp["dots_allowed_in_PN"]
|
||||
|
||||
package_re = re.compile(
|
||||
r'^ \* (?P<cpv>' + _cp + ') \[(?P<overlay>.*?)\]$'
|
||||
)
|
||||
|
@ -115,7 +115,7 @@ class Version(models.Model):
|
||||
"""
|
||||
|
||||
package = models.ForeignKey(Package)
|
||||
slot = models.CharField(max_length=128, blank=True)
|
||||
slot = models.CharField(max_length=128, blank=True, default="")
|
||||
revision = models.CharField(max_length=128)
|
||||
version = models.CharField(max_length=128)
|
||||
packaged = models.BooleanField()
|
||||
@ -148,7 +148,7 @@ class VersionLog(models.Model):
|
||||
|
||||
package = models.ForeignKey(Package)
|
||||
datetime = models.DateTimeField(auto_now_add=True)
|
||||
slot = models.CharField(max_length=128, blank=True)
|
||||
slot = models.CharField(max_length=128, blank=True, default="")
|
||||
revision = models.CharField(max_length=128)
|
||||
version = models.CharField(max_length=128)
|
||||
packaged = models.BooleanField()
|
||||
|
@ -10,7 +10,6 @@ from portage.dbapi import porttree
|
||||
import gentoolkit.pprinter as pp
|
||||
from gentoolkit.query import Query
|
||||
from gentoolkit.package import Package
|
||||
from gentoolkit.eclean.search import (port_settings)
|
||||
|
||||
from euscan import CONFIG, BLACKLIST_PACKAGES
|
||||
from euscan import handlers, helpers, output
|
||||
@ -95,10 +94,15 @@ def scan_upstream_urls(cpv, urls, on_progress):
|
||||
# gentoolkit stores PORTDB, so even if we modify it to add an overlay
|
||||
# it will still use the old dbapi
|
||||
def reload_gentoolkit():
|
||||
from gentoolkit import dbapi
|
||||
import gentoolkit.package
|
||||
import gentoolkit.query
|
||||
|
||||
PORTDB = portage.db[portage.root]["porttree"].dbapi
|
||||
dbapi.PORTDB = PORTDB
|
||||
|
||||
if hasattr(dbapi, 'PORTDB'):
|
||||
dbapi.PORTDB = PORTDB
|
||||
if hasattr(gentoolkit.package, 'PORTDB'):
|
||||
gentoolkit.package.PORTDB = PORTDB
|
||||
if hasattr(gentoolkit.query, 'PORTDB'):
|
||||
@ -182,10 +186,10 @@ def scan_upstream(query, on_progress=None):
|
||||
|
||||
cpv = pkg.cpv
|
||||
metadata = {
|
||||
"EAPI": port_settings["EAPI"],
|
||||
"EAPI": portage.settings["EAPI"],
|
||||
"SRC_URI": pkg.environment("SRC_URI", False),
|
||||
}
|
||||
use = frozenset(port_settings["PORTAGE_USE"].split())
|
||||
use = frozenset(portage.settings["PORTAGE_USE"].split())
|
||||
try:
|
||||
alist = porttree._parse_uri_map(cpv, metadata, use=use)
|
||||
aalist = porttree._parse_uri_map(cpv, metadata)
|
||||
|
Loading…
Reference in New Issue
Block a user