Re: [dak/master] process-new: display existing overrides
On 04/21/2013 16:57, Luca Falavigna wrote:
> Display overrides belonging to other sources to avoid accepting
> packages which "steal" binary packages (Closes: #697729).
> @@ -118,6 +119,21 @@ class Priority_Completer:
>
> ################################################################################
>
> +def claimed_overrides(upload, missing, session):
> + source = [upload.source.source]
This shouldn't be a list.
source = upload.source.source
> + binaries = set([x.package for x in upload.binaries])
> + suites = ('unstable','experimental')
We shouldn't hardcode suite names. The interesting suites are those that
share overrides with the suite this upload targets.
Maybe something like
override_suite = upload.target_suite.overridesuite \
or upload.target_suite.suite_name
suites = session.query(Suite.suite_name).filter(
(Suite.suite_name == override_suite)
|| (Suite.overridesuite == override_suite)).all()
should do the right thing here? (untested)
> + for m in missing:
> + if m['type'] != 'dsc':
> + binaries.remove(m['package'])
> + return session.query(DBBinary).filter(DBBinary.package.in_(binaries)). \
> + join(DBBinary.source). \
> + filter(not_(DBSource.source.in_(source))). \
DBSource.source != source
[...]
> @@ -137,6 +153,11 @@ def print_new (upload, missing, indexed, session, file=sys.stdout):
> if not m['valid']:
> line = line + ' [!]'
> print >>file, line
> + claimed = claimed_overrides(upload, missing, session)
> + if claimed.count():
> + print '\nCLAIMED OVERRIDES'
Hmm, maybe "BINARIES TAKEN OVER"? It's a source taking over another
source's binaries after all. "claimed overrides" is a bit unclear.
Ansgar
Reply to: