[Pkg-debile-commits] [debile-master] 02/02: more fixes for debile-master
Sylvestre Ledru
sylvestre at alioth.debian.org
Thu Sep 12 16:59:41 UTC 2013
This is an automated email from the git hooks/post-receive script.
sylvestre pushed a commit to branch master
in repository debile-master.
commit 92aa6b0e24b45a2d72142ceece8c8f52c8908acb
Author: Sylvestre Ledru <sylvestre.ledru at scilab-enterprises.com>
Date: Thu Sep 12 18:59:30 2013 +0200
more fixes for debile-master
---
debilemaster/cli/init.py | 1 -
debilemaster/incoming.py | 106 +++++++++++++++++++++++-----------------------
debilemaster/utils.py | 1 +
3 files changed, 54 insertions(+), 54 deletions(-)
diff --git a/debilemaster/cli/init.py b/debilemaster/cli/init.py
index d513442..f7bb422 100644
--- a/debilemaster/cli/init.py
+++ b/debilemaster/cli/init.py
@@ -42,7 +42,6 @@ def main():
incoming = config.get('paths', 'incoming_path')
jobs = config.get('paths', 'jobs_path')
-
if args.flags.contains('--drop'):
print "Dropping the database schema"
metadata.drop_all(bind=engine)
diff --git a/debilemaster/incoming.py b/debilemaster/incoming.py
index f067cd5..7a95627 100644
--- a/debilemaster/incoming.py
+++ b/debilemaster/incoming.py
@@ -19,9 +19,9 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
-from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound
+from sqlalchemy.orm.exc import NoResultFound
from debilemaster.orm import User, Source, Machine, Binary, Job, Group
-from debilemaster.archive import move_to_pool_source, move_to_pool_binary, UserRepository
+from debilemaster.archive import UserRepository
from debilemaster.changes import parse_changes_file, ChangesFileException
from debilemaster.utils import cd, fglob, listize
@@ -31,7 +31,6 @@ from debilemaster.server import Session
import os
import logging
-import datetime as dt
def process():
@@ -57,6 +56,7 @@ def process():
for changes in fglob("*changes", pcf):
accept_binary(changes, u)
+
def accept_source(changes, user):
session = Session()
try:
@@ -101,12 +101,12 @@ def accept_source(changes, user):
g = group[0]
# Check if previous runs happened before on this version
- previous_runs = [ e[0] for e in session.query(Source.run)\
- .join(Source.user)\
- .filter(Source.name == changes['source'])\
- .filter(Source.version == changes['version'])\
- .filter(User.id == owner.id)\
- .all()]
+ previous_runs = [e[0] for e in session.query(Source.run)
+ .join(Source.user)
+ .filter(Source.name == changes['source'])
+ .filter(Source.version == changes['version'])
+ .filter(User.id == owner.id)
+ .all()]
if previous_runs:
run_nb = max(previous_runs) + 1
print "Source acceptance : previous uploads of this package were made, this is run %s" % str(run_nb)
@@ -117,15 +117,15 @@ def accept_source(changes, user):
run_nb = 1
remove_before = False
- s = Source( name=changes['source'],
- version=changes['version'],
- suite=changes['Distribution'],
- arch="", # doubt here, useful ? remove build jobs according to this ?
- user=owner,
- maintainer=changes['maintainer'],
- group=g,
- dsc=dsc,
- run=run_nb)
+ s = Source(name=changes['source'],
+ version=changes['version'],
+ suite=changes['Distribution'],
+ arch="", # doubt here, useful ? remove build jobs according to this ?
+ user=owner,
+ maintainer=changes['maintainer'],
+ group=g,
+ dsc=dsc,
+ run=run_nb)
session.add(s)
try:
@@ -144,12 +144,13 @@ def accept_source(changes, user):
# **obj), who['email'], "ACCEPTED!")
logging.info("Accepted source package : %s / %s (%s/%s)",
- s.name,
- s.version,
- s.suite,
- s.arch)
+ s.name,
+ s.version,
+ s.suite,
+ s.arch)
add_jobs(s)
+
def accept_binary(changes, user):
session = Session()
try:
@@ -167,7 +168,6 @@ def accept_binary(changes, user):
if not changes.is_binary_only_upload():
return reject(changes, "not-only-sourceful")
-
arch = changes['Architecture']
if " " in arch:
arches = set(arch.split(" "))
@@ -215,16 +215,16 @@ def accept_binary(changes, user):
for bfile in binaries:
print "Binary acceptance : processing %s" % bfile
# From the deb filemname, get the package name
- bfilename=os.path.basename(bfile)
+ bfilename = os.path.basename(bfile)
bname = bfilename.split('_')[0]
- b = Binary( source=s,
- name=bname,
- version=changes['version'],
- deb=bfilename,
- arch=arch,
- suite=suite,
- run=int(s.run),
- compiler_type=j.subtype)
+ b = Binary(source=s,
+ name=bname,
+ version=changes['version'],
+ deb=bfilename,
+ arch=arch,
+ suite=suite,
+ run=int(s.run),
+ compiler_type=j.subtype)
session.add(b)
session.commit()
@@ -238,13 +238,14 @@ def accept_binary(changes, user):
#path = move_to_pool_binary(b, bfilename, root=arch)
logging.info("Accepted binary package : %s / %s (%s/%s) from compiler %s",
- b.name,
- b.version,
- b.suite,
- b.arch,
- b.compiler_type)
+ b.name,
+ b.version,
+ b.suite,
+ b.arch,
+ b.compiler_type)
os.unlink(changes.get_filename())
+
# This method looks at debile's configuration to see what jobs we need to run on
# either a source/binary package.
def add_jobs(package):
@@ -264,13 +265,13 @@ def add_jobs(package):
session.add(j)
logging.info("Adding job type %s,%s (id %s) for package %s (%s/%s/%s)",
- package.type,
- j.type,
- j.id,
- package.name,
- package.version,
- package.suite,
- package.arch)
+ package.type,
+ j.type,
+ j.id,
+ package.name,
+ package.version,
+ package.suite,
+ package.arch)
# If this a source package, add some build jobs
if package.type == 'source' and config.getboolean('jobs', 'build-enabled'):
@@ -283,19 +284,18 @@ def add_jobs(package):
package=package)
logging.info("Adding job type %s/%s/%s (id %s) for package %s (%s/%s/%s)",
- package.type,
- j.type,
- j.subtype,
- j.id,
- package.name,
- package.version,
- package.suite,
- package.arch)
+ package.type,
+ j.type,
+ j.subtype,
+ j.id,
+ package.name,
+ package.version,
+ package.suite,
+ package.arch)
session.add(j)
session.commit()
-
def reject(changes, reason):
print("reject", reason)
# email luser with reason template
diff --git a/debilemaster/utils.py b/debilemaster/utils.py
index 9919f8a..5934bf9 100644
--- a/debilemaster/utils.py
+++ b/debilemaster/utils.py
@@ -58,6 +58,7 @@ def run_command(command, stdin=None):
(output, stderr) = pipe.communicate(**kwargs)
return (output, stderr, pipe.returncode)
+
def listize(entry):
items = [x.strip() for x in entry.split(",")]
return [None if x == "null" else x for x in items]
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-debile/debile-master.git
More information about the Pkg-debile-commits
mailing list