Bug#574380: edos-distcheck: Wrong output for | alternative?
tags 574380 + patch
thanks
On Fri, Mar 19, 2010 at 09:58:44AM +0100, Stefano Zacchiroli wrote:
> > Dropping a build-dependency on a build-essential package is of course
> > only correct when
> > - and if it occurs as element of a conjunction, not as element of a
> > disjunction: true and x is equivalent to x, but true or x is not
> > equivalent to x.
> This point if of course correct, I'll fix add-sources.py to properly
> cover that (in a few days though, I'll be traveling between today and
> tomorrow).
Here I am, please find attached a patch for this.
Essentially, the flaw was that before the build-essential check was
mixed with checking whether a given build-dep was "for us"
(i.e. declared on the current architecture) or not. I've now split the
two tests: if a given disjunctive build-dep now contains a "trivial
dependency", it is dropped all together. A dependency is trivial
according to the above criteria (it is on a build-essential package and
it is not versioned).
Note that currently the check on the version of the build-dep is merely
syntactical for the recurrent problem that we don't know which versions
of the build-essential packages are installed. This might "save" from
erasure more build-essential-dep than needed (and surely more than
before, when the version was not taken into account).
Please comment now on this if you consider it non appropriate.
> The third possibility is for now to just fix properly the "OR
> optimization" as I said above. It looks like it will fix _this_ specific
> case, but can of course fail in other/weirded cases.
I've tested this on the example given by Kurt and the OR-ed dep is now
correctly preserved. As I'm offline, I can't do more tests right now,
any taker? :-)
Cheers.
PS the attached patch is _not_ cumulative with the previously posted one
for the unicode issue
--
Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7
zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/
Dietro un grande uomo c'è ..| . |. Et ne m'en veux pas si je te tutoie
sempre uno zaino ...........| ..: |.... Je dis tu à tous ceux que j'aime
--- add-sources.py.orig 2010-03-24 20:51:27.000000000 +0100
+++ add-sources.py 2010-03-24 20:50:58.000000000 +0100
@@ -47,9 +47,7 @@
def dep_for_me(dep):
for_me = None
- if buildessentials.count(dep['name']) > 0:
- for_me = False
- elif dep['arch'] is None:
+ if dep['arch'] is None:
for_me = True
elif dep['arch']:
(polarity, _) = dep['arch'][0]
@@ -73,12 +71,23 @@
rels.extend(relations[name])
return rels
+ def is_trivial_dep(or_deps):
+ """checks whether a given disjunction is trivially satisfiable,
+ e.g. because it contains an unversioned build-essential dependency
+ """
+ for dep in or_deps:
+ if dep['name'] in buildessentials \
+ and not (dep.has_key('version') and dep['version']):
+ return True # unversioned build-dep on a build-essential
+ return False
+
src_rels = get_rels(fields, relations)
bin_rels = []
for or_deps in src_rels:
- my_or_deps = map(strip_arch, filter(dep_for_me, or_deps))
- if my_or_deps:
- bin_rels.append(my_or_deps)
+ if not is_trivial_dep(or_deps):
+ my_or_deps = map(strip_arch, filter(dep_for_me, or_deps))
+ if my_or_deps:
+ bin_rels.append(my_or_deps)
return bin_rels
Reply to: