-
-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the D %-flag for the dirname. #345
base: master
Are you sure you want to change the base?
Conversation
%D (dirname) is the counterpart of %b (basename) It is useful for recreating the source directory structure inside the build directory.
Thanks for adding this! I'm curious what use-case you have that needs this flag? Also, do you mind signing the CLA since this adds new functionality? |
Hi
For the CLA, I have read https://github.com/gittup/tup/blob/master/CONTRIBUTING.md but that page is not convincing me to sign anything.
Regards, |
Hello, Regards, |
I'm also needing this for the same reason. I am transpiling a directory tree of files to another destination directory and want to keep the directory structure intact. The two solutions I see are
where Also bump since it seems like this perhaps got lost @gittup |
It looks like this isn't going to be added? I also need this :'( @gittup is there any chance this feature be implemented? |
Hi @danielytics, can you clarify what your use-case is? The initial suggestion of using it to re-create the source hierarchy inside a build directory would already be automatically handled by variants. Can you give an example Tupfile of what you're wanting to do? |
I guess I'm just trying to simplify the Tupfile for the case when the sources are spread between subdirectories (which I often do to keep large sources easier to manage) and I'm trying to figure out how to keep my Tupfile small and simple. Ideally, it would support both recursive directory globbing as well as this feature to really work though... But maybe I'm missing something and there's a simpler way? Right now, I have a Tupfile that looks something like this:
It works, but its not ideal as I have to manually enumerate all subdirectories and then either prefix the object files, or again enumerate the subdirectories in the inputs for the link step. EDIT: Ok, I'm still learning
|
Ah, apologies @gittup for the noise. I think I can accomplish more or less what I want, using %d to name the outputs and groups as inputs so I don't need to list directories more than once. I guess I didn't understand tup's capabilities well enough, but after rereading the docs a few times, I think I've got it. |
%D (dirname) is the counterpart of %b (basename)
It is useful for recreating the source directory structure inside the
build directory.