Hello,

What is the best way for run scripts to access @-variables?

I found out about the vardict file, whose path is passed to run scripts via 
the tup_vardict environment variable. However, neither its existence nor 
its format are documented. Is it meant to be used by run scripts?

Its format seems to be:

   1. First, a dump of the unsigned int holding the amount of @-variables. 
   In my platform, that's 4 bytes and little endian.
   2. Then, the index, as a series of unsigned ints (again 4 bytes each and 
   little endian on my platform). Each value represents the offset at which 
   the corresponding variable starts (after the index).
   3. Finally, a 0-ended line for each @-variable, with the equal sign 
   between the variable and its value.
   
Is my understanding right? If so, could the format be made more portable, 
instead of depending on the platform's type sizes and endianness? Could we 
perhaps switch to JSON instead? I would be happy to author the necessary 
changes.

Passing the value of the @-variable in the Tupfile would also work:

run ./script.sh @(FOOBAR)

However, the vardict approach would be cleaner.

Kind regards,

David

-- 
-- 
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/42fa44ec-e7bb-4777-91e5-cc4497be4f6eo%40googlegroups.com.

Reply via email to