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

--override not working #98

Closed memeplex closed 1 year ago

memeplex commented 1 year ago

I had stowed some stuff from ~/Documents/Sistema/, now I moved that directory under ~/Documents/Areas/Sistema and want to restow everything from there, AFAIU using the override flag should be enough to overwrite my previous symlinks, but stow refuses to do so:

stow --override='Library.*'  -d ~/Documents/Areas/Sistema/ -t ~ Stow/
=>
  * existing target is not owned by stow: Library/Spelling/en
  * existing target is not owned by stow: Library/Spelling/en_US.aff
  * existing target is not owned by stow: Library/Spelling/en_US.dic
  * existing target is not owned by stow: Library/Spelling/es
  * existing target is not owned by stow: Library/Spelling/es_AR.aff
  * existing target is not owned by stow: Library/Spelling/es_AR.dic

where all those files are previously stowed symlinks.

ls -l ~/Library/Spelling/
=>
lrwxr-xr-x 1 carlos staff   48 Aug 13 13:49 en -> ../../Documents/Sistema/Stow/Library/Spelling/en
lrwxr-xr-x 1 carlos staff   55 Aug 13 13:49 en_US.aff -> ../../Documents/Sistema/Stow/Library/Spelling/en_US.aff
lrwxr-xr-x 1 carlos staff   55 Aug 13 13:49 en_US.dic -> ../../Documents/Sistema/Stow/Library/Spelling/en_US.dic
lrwxr-xr-x 1 carlos staff   48 Aug 13 13:49 es -> ../../Documents/Sistema/Stow/Library/Spelling/es
lrwxr-xr-x 1 carlos staff   55 Aug 13 13:49 es_AR.aff -> ../../Documents/Sistema/Stow/Library/Spelling/es_AR.aff
lrwxr-xr-x 1 carlos staff   55 Aug 13 13:49 es_AR.dic -> ../../Documents/Sistema/Stow/Library/Spelling/es_AR.dic

The manpage says:

Force stowing files beginning with this Perl regex if the file is already stowed to another package.

then if the override flag is not for a case like mine I can't figure out what it is for.

memeplex commented 1 year ago

Ok, I believe the behavior is explained because stow doesn't own anything pointing to ~/Documents/Sistema/ when the stow directory is ~/Documents/Areas/Sistema/. This makes some operations, like moving a stow directory or decentralizing the directories for stow packages, a bit complicated.