Tup uses the backslash character in paths as an escape character, primarily
to support filenames with spaces. Eg: an output of "foo bar" can be written
as foo\ bar in the output section. To put an actual backslash in the path,
you'd have to use \\, so the example should work with ..\\<submodgroup>

Note that tup should work fine on Windows when the subprocess uses files
with backslash as the path separator. So both of the following should work:

: |> cmd /c copy input foo\bar |> foo/bar
: |> cmd /c copy input foo\bar2 |> foo\\bar2

I'm not sure about the difference between single and double-quotes, and I'm
unable to reproduce it. Is that still causing a problem for you?

-Mike

On Tue, Jan 9, 2024 at 7:20 AM Peter Jaspers <[email protected]>
wrote:

> I found my mistake: I used backward slash instead of forward slash:
> ..\<submodgroup> must be ../<submodgroup>
> And for who wonders what " Het systeem kan het opgegeven bestand niet
> vinden" means: it is Dutch for "The system can not find the given file".
>
>
> Op maandag 8 januari 2024 om 15:43:23 UTC+1 schreef Peter Jaspers:
>
>> I tried to reproduce the %<group> example in the %-flags section of the
>> tup manual
>> on my Windows computer. This failed: the content of the resulting
>> submodules_group.txt
>> file was not as expected (it was empty, see below).
>>
>> Directories and files:
>> test_tup\
>>     .tup\
>>     project\
>>         Tupfile
>>     submodules\
>>         sm1\
>>             foo.cpp
>>             Tupfile
>>         sm2\
>>             bar.cpp
>>             Tupfile
>>
>> Tupfiles:
>> #test_tup\submodules\sm1\Tupfile
>> : foo.cpp |> cmd /c copy %f %o |> %B.obj ..\<submodgroup>
>>
>> #test_tup\submodules\sm2\Tupfile
>> : bar.cpp |> cmd /c copy %f %o |> %B.obj ..\<submodgroup>
>>
>> # test_tup\project\Tupfile
>> : ../submodules/<submodgroup> |> echo "%f" > %o |> submodules_f.txt
>> : ../submodules/<submodgroup> |> echo '%<submodgroup>' > %o |>
>> submodules_group.txt
>>
>> Running tup produces all 4 expected output files.
>> submodules_f.txt contains the expected "../submodules/<submodgroup>".
>> submodules_group.txt however only contains 2 quotes ('') instead of the
>> expected
>> ../submodules/sm1/foo.o ../submodules/sm2/bar.o
>>
>> Note:using echo '%f' > %o  instead of  echo "%f" > %o made the build
>> fail:
>> [ tup ] [0.041s] Executing Commands...
>> * 0) project: echo '../submodules/<submodgroup>' > submodules_f.txt
>> Het systeem kan het opgegeven bestand niet vinden.
>>
>> Replacing echo '%<submodgroup>'  by echo "%<submodgroup>" results in
>> submodules_group.txt to contain ""
>>
>> What am I doing wrong?
>>
>> --
> --
> tup-users mailing list
> email: [email protected]
> unsubscribe: [email protected]
> options: http://groups.google.com/group/tup-users?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "tup-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tup-users/b9b4e941-47ff-4307-84e2-0e5b99986becn%40googlegroups.com
> <https://groups.google.com/d/msgid/tup-users/b9b4e941-47ff-4307-84e2-0e5b99986becn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
-- 
tup-users mailing list
email: [email protected]
unsubscribe: [email protected]
options: http://groups.google.com/group/tup-users?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"tup-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tup-users/CA%2B6x0LWQxaCi07iW1HbfJR13%3Drx_uOmEHRM%3DScWU2LBBqNUjHA%40mail.gmail.com.

Reply via email to