help-stow
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-stow] links to directories are stowed to directories (not links)


From: balducci
Subject: [Help-stow] links to directories are stowed to directories (not links)
Date: Thu, 25 Sep 2014 18:19:35 +0200

hello everybody,

  adam spiers wrote:

> Hi there,
> 
> Sorry for the slow reply, I've been very busy.  BTW please send future
> queries to address@hidden so that others can benefit from (and
> potentially help with) the discussion.

following adam's suggestion I'm moving this thread here.

> 
> On Mon, Aug 11, 2014 at 12:52:34PM +0200, address@hidden wrote:
> > I am probably missing some blatant point here; if so, my apologies
> >
> > After quite a bit that I am using stow, I have realized that links to
> > directories are actually stowed to "real" directories (ie not links).
> >
> > I might not be explaining myself correctly, so I use an example
> >
> > Consider the following:
> >
> > This is a fragment of a file system under stow (showing directories only):
> >
> >                     .
> >                     |-- bin
> >                     |-- include
> >                     |-- lib
> >                     |   |-- itk-current -> itk4.0.0
> >                     |   `-- itk4.0.0
> >                     `-- share
> >                         `-- man
> >                             `-- mann
> >
> > note: itk-current is actually a link to the itk4.0.0 directory
> >
> > I stow this to the /usr/local target and I obtain:
> >                     .
> >                     |-- bin
> >                     |-- include
> >                     |-- lib
> >                     |   |-- itk-current
> >                     |   `-- itk4.0.0
> >                     `-- share
> >                         `-- man
> >                             `-- mann
> >
> >
> > ie, itk-current has been stowed to  a "true" directory, exactly
> > duplicating the contents of itk4.0.0
> 
> I cannot reproduce this.  This is what I see after stowing:
> 
>     .
>     |-- stow
>     |   `-- pkg
>     |       `-- lib
>     |           |-- itk4.0.0
>     |           |   `-- libitk4.0.0.so
>     |           `-- itk-current -> itk4.0.0
>     `-- target
>         `-- lib
>             |-- itk4.0.0 -> ../../stow/pkg/lib/itk4.0.0
>             |-- itk-current -> ../../stow/pkg/lib/itk-current
>             `-- libfoo.1.2.3.so
> 
> Please can you state which version of Stow are you using, and provide
> a log of a complete shell session showing how to reproduce it?
> 

Using: (GNU Stow) version 2.2.0

Actually, I seem to have made things a bit clearer (to me, before
everybody else).

I find the above mentioned problem only when running with the
--no-folding option (which I run with in my install scripts).

Here is a scriptlett which explains what my problem is.

---8<------8<------8<---
cd /tmp
rm -rf ./base.d
mkdir base.d
cd base.d
mkdir -p ./stow/pkg/lib/itk4.0.0 ./target/lib
touch ./stow/pkg/lib/itk4.0.0/libitk4.0.0.so
ln -sf libitk4.0.0.so ./stow/pkg/lib/itk4.0.0/foo
touch ./target/lib/libfoo-1.2.3.so
ln -sfn itk4.0.0 ./stow/pkg/lib/itk-current
tree
# this is what I get at this point
# .
# |-- stow
# |   `-- pkg
# |       `-- lib
# |           |-- itk-current -> itk4.0.0
# |           `-- itk4.0.0
# |               `-- libitk4.0.0.so
# `-- target
#     `-- lib
#         `-- libfoo-1.2.3.so
stow --dir=/tmp/base.d/stow --target=/tmp/base.d/target pkg
tree
# this is the result for me:
# .
# |-- stow
# |   `-- pkg
# |       `-- lib
# |           |-- itk-current -> itk4.0.0
# |           `-- itk4.0.0
# |               `-- libitk4.0.0.so
# `-- target
#     `-- lib
#         |-- itk-current -> ../../stow/pkg/lib/itk-current
#         |-- itk4.0.0 -> ../../stow/pkg/lib/itk4.0.0
#         `-- libfoo-1.2.3.so
#
# which is fine
#
# Now I do the same with --no-folding
rm -rf ./target
mkdir -p ./target/lib
touch ./target/lib/libfoo-1.2.3.so
stow --no-folding --dir=/tmp/base.d/stow --target=/tmp/base.d/target pkg
tree
# This is the result for me:
# .
# |-- stow
# |   `-- pkg
# |       `-- lib
# |           |-- itk-current -> itk4.0.0
# |           `-- itk4.0.0
# |               `-- libitk4.0.0.so
# `-- target
#     `-- lib
#         |-- itk-current
#         |   `-- libitk4.0.0.so -> 
../../../stow/pkg/lib/itk-current/libitk4.0.0.so
#         |-- itk4.0.0
#         |   `-- libitk4.0.0.so -> 
../../../stow/pkg/lib/itk4.0.0/libitk4.0.0.so
#         `-- libfoo-1.2.3.so
ie itk-current in the target tree is a directory, not a link to a
directory.

---8<------8<------8<---



I would have expected this:

.
|-- stow
|   `-- pkg
|       `-- lib
|           |-- itk-current -> itk4.0.0
|           `-- itk4.0.0
|               `-- libitk4.0.0.so
`-- target
    `-- lib
        |-- itk-current -> itk4.0.0
        |-- itk4.0.0
        |   `-- libitk4.0.0.so -> ../../../stow/pkg/lib/itk4.0.0/libitk4.0.0.so
        `-- libfoo-1.2.3.so

I am obviously misunderstanding the --no-folding option.

In other words: I understand that --no-folding "unpacks" a directory
even if stow could plop a single link for it, but I wouldn't expect this
behavior on something which is not actually a directory, but instead a
link to a directory; to me, it's kind of an unnecessary dereferencing.

If itk-current is a link to something (be it a directory or any other
object) which is *beneath* the pkg tree, what's wrong with stowing it
as such?

Of course, I realize that stow gives anyway the correct result: the
contents of itk-current in both the stow directory and the target tree
appear the same, as they must be.

I apologize for the lengthy post and for the possible naive problem it
addresses

ciao
gabriele



reply via email to

[Prev in Thread] Current Thread [Next in Thread]