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

Re: Running tests at build time?



Russ Allbery wrote:

> Raphael Geissert writes:
> 
>> Yes, I've been thinking about that too. So far, the easiest solution I've
>> been thinking about is by using makefiles. Something along these lines:
> 
> [snip makefile example]
> 
>> Then the refresh-* scripts would only need to read their data from
>> $DATA_DIR.  `make update` would update the files once, `make update
>> FORCE=foo` would force it check if there are newer mirror files.
> 
>> If a refresh-* script needs more info all they need to do is call `make
>> fetch/path/to/file/in/mirror` and then read it from $DATA_DIR
> 
> Yeah, that would work, but don't you think we'll end up with some
> duplicate parsing code as well?  For example, I suspect that we'll have
> several refresh scripts that need to generate a sorted list of all
> packages containing files matching some regex.

Well, yeah. I was thinking mostly on the data downloading part of the
problem.

> 
> I don't really mind writing shell script, but since the rest of Lintian is
> written in Perl, I was wondering if we should build a Perl infrastructure
> to do this, use LWP::Simple to do the file downloads instead of wget, and
> start building some methods to share common code.  Currently, we have a
> few written in Perl and a few written in shell.

I prefer to write scripts like refresh-debhelper-data that involve a lot of
file manipulation in shell. The other scripts in shell could easily be
rewritten in perl (most already do most of their job by calling perl).

My only concern with LWP::Simple is the data fetching and caching part.

> I wrote 
> refresh-ftp-master-tags in Perl since I didn't feel like doing the parsing
> in shell.

(and you could have used a yaml parser while at it ;)

> 
> Converting the existing scripts to Perl might be kind of annoying, though.
> 

If we agree to use Perl as the main programming language of the refresh
scripts then I could dedicate a few minutes to rewrite most of them.

Cheers,
-- 
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net



Reply to: