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
589 stars 41 forks source link

make it possible to stow to a "flattened" file hierarchy (containing symlinks) #101

Open g-raud opened 1 year ago

g-raud commented 1 year ago

Hello,

Thank you for maintaining this program that is both simple and very useful.

Using stow I can maintain binaries (and scripts) that I write or simply recompile in my ~/.local folder. The file hierarchy is flattened because I would like to avoid having a subfolder usr/ by creating a symlink named usr (or symlinks inside a usr/ directory):

$ ls -Fl |awk '{ print $9,$10,$11 }'

bin/   
lib/  
man -> share/man/
share/  
stow/  
usr -> ./

This is to be able not to have to modify third party install scripts that install under usr/ and at the same time not to have to point environment variables or configurations to both ~/.local/ and ~/.local/usr/. The same is true of the hierarchies / and /usr/ now in most Linux distirbutions. I don't use stow to install under these hierarchies but it could be a good thing that stow is able to do it.

When I atttempt to use stow I get the following "error":

$ cd ~/.local/stow
$ stow opt-amd64/
WARNING! stowing opt-amd64 would cause conflicts:
  * existing target is not owned by stow: usr
All operations aborted.

If there is a way already to use it in the case described here please let me know. Otherwise could you consider making it possible. Thanks.

g-raud commented 1 year ago
$ stow -V
stow (GNU Stow) version 2.3.1
g-raud commented 1 year ago

I would like to mention that by attempting to merge the root hierarchy ~/.local/ inside the ~/.local/usr/ instead of the reverse (which is what Debian makes with / and /usr/ see https://wiki.debian.org/UsrMerge), stow still fails:

$ cd ~/.local
$ tree -FL 1
.
├── bin -> usr/bin/
├── lib -> usr/lib/
├── man -> share/man/
├── share/
├── stow/
└── usr/

6 directories, 0 file
$ cd stow
$ stow local
WARNING! stowing local would cause conflicts:
  * existing target is not owned by stow: bin
  * existing target is not owned by stow: lib
All operations aborted.