[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#650132: hint: binary to source mapping has unhelpful side-effects

On Sat, 2011-11-26 at 20:38 +0000, Adam D. Barratt wrote:
> hint's automagic binary to source mapping has unintended and undesired
> side-effects in some circumstances.  The situation where issues have
> been noticed most is with "hint clean" and renamed source packages, but
> it will likely manifest in other cases.
> I haven't found an easy way of resolving this yet, so am filing this in
> the BTS so that the issue is documented and in case anyone else has any
> thoughts.

After another of my periodic pokes at this, the main problem is that I
can't see an easy way of fixing it without bending the encapsulation.

"clean" uses the HintFileParagraph class to represent the lines it has
read from the hint file, which in turn instantiates a number of Hint
objects. The Hint class's constructor then parses the package list,
including performing the binary to source mappings. By this point, the
knowledge of which subcommand of "hint" was used is well and truly

We could extend the Hint class to take keyword arguments so that the
package mapping could be disabled when required, but this would then
somehow need to be communicated via HintFileParagraph, which feels a
little dirty.

Admittedly, the HintFileParagraph is only used by the clean action, so
we could simply say that the class will not modify its input, and thus
have it pass a "don't do binary to source mappings" flag to the Hint

Thoughts welcome, before I either decide that the above is a silly idea,
or just do it. :-)



Reply to: