aspiers / stow

GNU Stow - mirror of savannah git repository occasionally with more bleeding-edge branches
http://www.gnu.org/s/stow/
GNU General Public License v3.0
650 stars 41 forks source link

Req: option for only overriding all normal files #23

Open gzm55 opened 7 years ago

gzm55 commented 7 years ago

Hi,

When stowing packages, I need to only override all normal files but split all dirs. If use option --override='.*', it will make all folded dirs to be overrided as a whole link, not splitted. So how to do this or need a new option?

aspiers commented 6 years ago

Hi, really sorry for the incredibly slow response! I'm having trouble understanding your question, because --override already only applies to files not directories. I'm wondering if you want the --no-folding option; did you look at that?

But if that doesn't do what you want, please could you give a minimal test case explaining how the current behaviour differs from what you would want / expect? Thanks!

gzm55 commented 6 years ago

Hi @aspiers , thank you for your response. Here is a minimal test case, we have a simple file tree for stow:

james@jamespc-15:~/work/test-stow/issue-13/stow$ tree ..
..
└── stow
    ├── A
    │   ├── a.txt
    │   └── dir
    │       ├── b.txt
    │       └── c.txt
    └── B
        ├── a.txt
        └── dir
            ├── c.txt
            └── d.txt

Package A and B both maintain a version of a.txt and dir/c.txt, and I want A be a fallback of B. Then I run the following codes:

$ stow --version
stow (GNU Stow) version 2.2.2
$ stow A
$ stow B  --override='.*'

The current behavior is:

$ tree -I stow ..
..
├── a.txt -> stow/B/a.txt
└── dir -> stow/B/dir

And the expect is:

$ tree -I stow ..
..
├── a.txt -> stow/B/a.txt
└── dir
    ├── b.txt -> ../stow/A/dir/b.txt
    ├── c.txt -> ../stow/B/dir/c.txt
    └── d.txt -> ../stow/B/dir/d.txt
gzm55 commented 6 years ago

I have looked at the '--no-folding' option, but it really unfold too much. IMO, the smart way is 'unfold-if-override-a-dir'.