Allowing Stow (version 2) to stow absolute links

Troy Will <[email protected]> Thu, 26 Nov 2009 15:51:59 -0800
Newsgroups gmane.comp.gnu.stow.devel
Message-ID <[email protected]>
I am proposing that we remove the check for absolute links done in
Stow version 2. Stow version 1.3 stows and unstows absolute links just
fine, and I've tested that Stow version 2 will also stow and unstow
absolute links if the few lines of code that does the checking for
absolute links is removed:
=A0=A0 =A0# don't try to stow absolute symlinks (they cant be unstowed)
=A0=A0 =A0if (-l $source) {
=A0=A0 =A0 =A0 =A0my $second_source =3D read_a_link($source);
=A0=A0 =A0 =A0 =A0if ($second_source =3D~ m{\A/} ) {
=A0=A0 =A0 =A0 =A0 =A0 =A0conflict("source is an absolute symlink $source =
=3D> $second_source");
=A0=A0 =A0 =A0 =A0 =A0 =A0if ($Option{'verbose'} > 2) {
=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0warn "absolute symlinks cannot be unstowe=
d";
=A0=A0 =A0 =A0 =A0 =A0 =A0}
=A0=A0 =A0 =A0 =A0 =A0 =A0return;
=A0=A0 =A0 =A0 =A0}
=A0=A0 =A0}

Kahlil, were you thinking that because stow only makes relative links
that it would bomb when trying to unstow a package that contains
absolute links? If you put it into words, Stow could create a relative
link to and absolute link. When Stow would unstow a package with an
absolute link, it removes the relative link to the absolute link. As
far as I can see, it doesn't make any difference if the file in the
package is a regular file, relative link, or absolute link. Stow is
only going to make and delete relative links ( and directories.) What
are your thoughts?

 I want to take this code out and restore the Stow v1.3.3
functionality. But I won't do that until I hear from you first.

--Troy