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

Re: [PATCH 1/7] Split some useful functions from help.c to (new) util.c



sean finney wrote:

> Basically, it's a pain to try and use anythign from help.c because of
> the numerous intertwined static/global/extern variables involved.
> for example if you wanted to link against it in a unit test i think
> there were a couple dozen local static variables and possibly other
> functions you'd have to define, even if you weren't going to use them,
> because they are otherwise defined in the dpkg binary's main code and
> you'd get linker errors without them.
>
> I think this was largely because the code in help.c is fairly "legacy"
> and was written long before someone came up with the idea of libdpkg,
> unit testing, etc.
>
> So I think the "util.c" name was suggested by Guillem as a "help.c-like"
> filename, where something could be put until it was decided to either move
> it into libdpkg or move more help.c code over to it.

Ah, thanks for this explanation.  Makes sense.  (I think I'll rewrite
the change description to reuse the above with "I think" changed to
certainties. ;-))


Reply to: