From: Ali Azarbayejani (ali_at_[hidden])
Date: 2003-05-30 09:49:11
> Ali Azarbayejani wrote:
>> Vladimir Prus wrote:
>> The rule (called automatically based upon the files in subdirectory
>> "patches") looks like this
>> patch foo/b.orig : foo/b patches/foo/b ;
>> patch foo/d.orig : foo/d patches/foo/d ;
>> It's natural to name the targets "foo/b.orig", "foo/b" and
>> "patches/foo/b". You can't really name them all "b", can you?
> You can't. The question is what functionality end user wants. If he wants to
> apply patches to some archive, then he does not care about "foo/b.orig" and
> "foo/d.orig". In other words, he has no intention of building those things
> individually -- which means they should not be main targets.
> I might misunderstood your use case, in which case I'd like some
In the current system, how can you possibly declare a patched file
without making it a main target? I want the user to be able to declare
extract foo : foo.tar.gz ;
patch foo/b : patches/foo/b : <dependency>foo ;
(N.B. I used slightly different declaration syntax than the above ones,
but the idea is the same).
Note that "patch" is a difficult tool because it operates in-place on
the patched object, i.e. the patched object is both a source and a
target of the operation. The usual solution for this kind of tool is to
create a proxy output that gets touched after the operation. In this
case, the natural thing to do is have the "patch" command create the
backup file "foo/b.orig" and touch it after the operation and this file
becomes the output target....btw, this also is useful visually to see
whether a file has been patched or not. This is why I originally
presented the declaration with foo/b.orig as the explicit target. A
user would more naturally use a declaration like the latter one above.
But in either case, the implementation would be the same. How are these
to be implemented without main targets?
And if you want another project now to use these extracted and/or
patched files as sources, don't they have to be main targets for that
reason as well?
> I'm still to be persuaded that targets should have slashed..
I'm still to be persuaded that you can implement the above example
without multiple main targets that have the same base name. If you
can't, then it would be a hard argument to invent some way of
distinguishing them other then their pathnames, which are already
guaranteed to be unique.
Let me know your prognosis of the above, or if you still need more
clarification of the example.
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk