Les choses sérieuses commencent
This commit is contained in:
parent
7a9fe18463
commit
c63f62721b
41 changed files with 1270 additions and 0 deletions
0
erminig/handlers/__init__.py
Normal file
0
erminig/handlers/__init__.py
Normal file
23
erminig/handlers/versions.py
Normal file
23
erminig/handlers/versions.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
from erminig.models import versions
|
||||
from erminig.controllers.govel.pakva import Pakva
|
||||
|
||||
|
||||
def handle_new_version(db, upstream_id, name, version, url):
|
||||
"""
|
||||
Gère l'arrivée d'une nouvelle version :
|
||||
- Insère en base si absente
|
||||
- Crée ou met à jour le fichier Pakva correspondant
|
||||
"""
|
||||
inserted = versions.insert_version_if_new(db, upstream_id, version, url)
|
||||
if not inserted:
|
||||
return False
|
||||
|
||||
pakva = Pakva(name, version, url)
|
||||
if pakva.path.exists():
|
||||
pakva.update_version(version, url, reset_revision=True)
|
||||
print(f"[PAKVA] Mis à jour pour {name}")
|
||||
else:
|
||||
pakva.save()
|
||||
print(f"[PAKVA] Créé pour {name}")
|
||||
|
||||
return True
|
||||
Loading…
Add table
Add a link
Reference in a new issue