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:
@ -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>.*?)\]$'
|
||||
)
|
||||
|
Reference in New Issue
Block a user