[Scons-users] always up to date when target is a directory
Carnë Draug
carandraug+dev at gmail.com
Tue Feb 19 21:11:41 EST 2013
On 15 February 2013 15:19, Dirk Bächle <tshortik at gmx.de> wrote:
> On 15.02.2013 02:45, Carnė Draug wrote:
>>
>> The following SCons code says that everything is always up to date,
>> even after I change the source:
>>
>> data = env.Command(target = "results/sequences/",
>> source = "scripts/extract_sequences.pl"),
>> action = "$SOURCE")
>>
>> It would appear that the problem is the target being a directory. It
>> must be a directory since the source will generate an entire directory
>> structure which may different each time it runs. I have tried with and
>> without a backslash at the end of the path, and also using target =
>> Dir("results/sequences/"), both without success. It always says it's
>> up to date, even after I have changed the source file. Am I missing
>> anything?
>
> in SCons, directories are up-to-date if they exist. This doesn't depend on
> whether they further contain any files or subfolders. If there is a file
> that always gets created in the target directory, you could specify that one
> as your primary output instead.
> Else, you'll probably have to go the long way and define a specialised
> Emitter that scans your input file 'extract_sequences.pl' and returns the
> full list of target files from it.
The files generated by 'extract_sequences.pl' are a bunch of files
downloaded from an online database, their filenames dependent on their
IDs and they will change with each run. I can't know their names in
advance by scanning the source file. The target is the directory since
it may even be possible (but unlikely) that no file gets downloaded.
I'm just having the program saving a log file and using it as target
but could I do if that was not an option?
Thanks,
Carnë
More information about the Scons-users
mailing list