From one subdirectory to another subdirectory?

42 views
Skip to first unread message

xancorreu

unread,
Apr 25, 2012, 10:47:30 AM4/25/12
to tup-...@googlegroups.com
Hi,

How can I do in tup use two subdirectories? For example, copy a file in
a subdirectory to another subdir:

cp ./a/file.txt ./b/file2.txt

?

I see http://gittup.org/tup/ex_multiple_directories.html but I don't
imagine it.

Thanks,
Xan.

Mike Shal

unread,
Apr 25, 2012, 9:50:43 PM4/25/12
to tup-...@googlegroups.com
Hi Xan,

Tup runs a little differently from other build-systems - one of the
restrictions is that a Tupfile can only write to files in the current
directory. In this case since you want to write to a file in directory
b/, create b/Tupfile like so:

: ../a/file.txt |> cp %f %o |> file2.txt

My directory structure looks like this:

srcdir/
.tup (I ran 'tup init' in srcdir/)
a/
file.txt
b/
Tupfile
file2.txt (created after 'tup upd')

The reason tup is restricted like this is to simplify parsing so that
tup can just jump to any directory and parse the Tupfile there. This
lets tup skip parsing Tupfiles when they haven't changed, which is
noticeable for large projects.

-Mike

xancorreu

unread,
Apr 26, 2012, 8:01:08 AM4/26/12
to tup-...@googlegroups.com
Al 26/04/12 03:50, En/na Mike Shal ha escrit:
Mmm... thanks for the answer. tup can read to anything but only can
write to current Tupfile directory.

Thanks a lot,
Xan
Reply all
Reply to author
Forward
0 new messages