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

Re: Running tests at build time?



Russ Allbery wrote:

> Raphael Geissert writes:
> 
>> At least the update scripts from private/ should be automatically run
>> periodically to detect changes and have up-to-date data.
> 
> That I want to have a target for that we just routinely run as part of
> making a distribution.  I was holding off on that because right now
> there's a bunch of code duplication, and I kind of wanted to write a
> general framework for doing those sorts of updates and then consolidate
> the scripts to use that infrastructure.  Something where there are a set
> of update scripts that all use the same infrastructure and a driver script
> to run all of them or something.
> 

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:

CONTENTS := dists/sid/Contents-i386.gz
DATA_FILES := data/files/fonts
MIRROR := http://ftp.us.debian.org/debian
DIR := debian/cache
FORCE :=

$(DIR)/%: $(FORCE)
    wget -N $(MIRROR)/$*

fetch/%: $(DIR)/%

data/files/fonts: $(DIR)/$(CONTENTS)
        DATA_DIR=$(DIR) private/refresh-fonts-data

update: $(DATA_FILES)

.PHONY: $(FORCE)

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

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



Reply to: