- The `sanitize_path_options` functions remove all trailing
and leading spaces. So any valid directory like ` 123`,
`123 ` can not be used
- Also if there are two directories ` 123` and `123`, and if
user pick the ` 123` as option to `-d` or `-t`, then stow pick
directory `123` as the argument instead of ` 123` as user want.
```
STOW_DIR=. stow -n -v3 -t \ 123 456
stow dir is /tmp/test
stow dir path relative to target 123 is ..
cwd now 123
cwd restored to /tmp/test
cwd now 123
Planning stow of package 456...
Stowing contents of ../456 (cwd=/tmp/test/123)
Planning stow of package 456... done
cwd restored to /tmp/test
WARNING: in simulation mode so not modifying filesystem.
```
- This commit remove the check in `sanitize_path_options` function,
and now stow can work with those directories. There have been a check
for valid directory, so we are safe.
Previously STOW_DIR=0 would cause the cwd to be used as the STOW_DIR.
Make that instead raise an error. Do similar validation on the target
directory.
Closes#7 - https://github.com/aspiers/stow/pull/7
In shell, a variable is often considered unset even if it is
set to the empty string. In other words,
STOW_DIR= stow [args]
is an idiomatic alternative to writing:
unset STOW_DIR
stow [args]
and it also has the advantage of temporarily "unsetting" STOW_DIR
for a single command.
Therefore we should treat STOW_DIR being set to the empty string
as equivalent to it not being set at all.
Thanks to Cuong Manh Le for highlighting this issue!
Fixes#6 - https://github.com/aspiers/stow/issues/6Closes#5 - https://github.com/aspiers/stow/pull/5
This is now necessary in order to prevent pause.perl.org from
complaining:
Status: Decreasing version number
=================================
module : Stow::Util
version: undef
in file: lib/Stow/Util.pm
status : Not indexed because lib/Stow/Util.pm in
A/AS/ASPIERS/Stow-v2.2.0.tar.gz has a higher version number
(0)
The dependency of the distributed file stow.8 on the non-distributed
file Makefile was causing this error:
ERROR: files left in build directory after distclean:
./doc/stow.8
The automake FAQ explains why this happens:
https://www.gnu.org/software/automake/manual/html_node/Errors-with-distclean.html
so change stow.8 to depend on Makefile.am which is distributed.
With Perl 5.20, installing a package with stow gives a warning like
this:
Possible precedence issue with control flow operator at
/gar/packages/stow-2.2.0/lib/perl5/site_perl/5.20.0/Stow.pm line 1736.
http://lists.gnu.org/archive/html/bug-stow/2014-06/msg00000.html
Suggested-by: Adam Sampson <ats@offog.org>
Fix the case discovered by Hiroyuki Iwatsuki where stowing fails if
the stow / target directories are non-canonical paths. For example,
on FreeBSD /home is a symlink pointing to 'usr/home', so running with
the stow directory as /home/user/local/stow and the target directory
as /home/user/local previously resulted in the stow directory path
being calculated as ../../../usr/home/user/local/stow relative to
the target.
http://article.gmane.org/gmane.comp.gnu.stow.bugs/8820