-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should we add support stow directory is symbolic link. #11
Comments
I've already seen this, but currently too busy to investigate, sorry. Hopefully I'll have some free time soon. |
Hi, I resolved this issue this way: Before stow -vS htop
WARNING! stowing htop would cause conflicts:
* existing target is not owned by stow: .config
All operations aborted. I figure out that the problem was that the target dir (~/.config in my case) was a symlink. So you need to specify the realpath in your script. After #get real target dir without symlinks
r=$(realpath $HOME/.config) && target=${r%/*} || echo "Error!!"
stow -vS htop -t $target
LINK: .config/htop/htoprc => ../../../../../home/charly/dotfiles/htop/.config/htop/htoprc Cheers |
Suggestions on how to fix stow to handle this natively are welcome. I haven't had time to think about it. |
@aspiers After finding stow code base, I see The change also break previous package which was stowed. |
I'll fix it if I knew perl. :) Anyway I ended up getting rid off that "wrong" symbolic link making a "right" bind mount. |
It would be great to have this feature. Stowing a file which is an absolute symbolic link should be less complex, right? I'm wondering as in the raised issue on StackOverflow, it is about a directory which is an absolute symbolic link. Right now, it is impossible to stow files which are absolute symbolic links. It happens here: https://github.com/aspiers/stow/blob/master/lib/Stow.pm.in |
Please can somebody give details of a real world example where this feature would be desirable? I understand the request, I just don't understand why there'd be a burning need for it. @dmarcoux Pretty much all the logic happens in |
Personally, I would like to stow some symlinks which are symlinks to For the logic in |
Ah, Yes I totally understand your lack of interest in Perl. IMHO it's basically a dead language - it was amazingly innovative in the 1990s and early 2000s, and it allowed me to do many things well and have a good career, but more recently Ruby and Python have far surpassed it. If someone sent a pull request rewriting Stow in Ruby or Python I would welcome it with open arms ... but I doubt that will happen, and unfortunately I don't have time to do it myself currently :-/ |
Exactly, As for rewriting Stow to something like Ruby or Python, this would be great. Would you consider only Ruby and Python as a language to rewrite Stow? Perhaps, Go would be a good choice. It is great for CLI applications. I wonder if someone like me without any Perl experience could rewrite Stow in something else... It cannot be that complex. |
Why more than one? Multiple versions of the client software?
I'm slightly confused by this. Presumably That said, I think @Gnouc is right that this is a separate issue.
Personally, yes, because I don't currently have enough spare time to learn another language well. (I wish I did!)
Sorry, I can't agree with that. Go seems far too low-level for this, and in fact for CLI applications in general, unless they require significant performance and/or parallelism. I think it would simply make the codebase needlessly verbose. Stow only deals with the filesystem, and is not multi-threaded or performance-critical.
Sure, why not?
It really isn't :-) And the existing test suite is comprehensive enough to help ensure a rewrite would go smoothly. |
I only have one For the language choice, I'm totally fine with Ruby. It's the language I know the most too. Your points are completely valid. Go is indeed maybe a bit too low-level for this. It is nice to distribute the binary only though. |
On 13 June 2016 at 11:20, Dany Marcoux [email protected] wrote:
So what is the advantage of putting this symlink within the Stow package |
My Stow package directory is basically my dotfiles, so I could easily stow the |
Ohhh, OK - now I get it! Thanks :-) This is one of the ways I use Stow too, so I entirely understand. To clarify, are you saying that stowing a link to |
It doesn't work. Here's the output of
In my $HOME directory, I don't have any of these files which I'm trying to symlink with Stow. I would expect the command |
Thanks, that info helps a lot. I agree this should work (although the target should link back to the source which then links to |
Here's my use case for this feature. So this is my current situation:
If I try to stow the package
whereas I would like that stow would just symlynk
Note that if
The workaround at the moment is going within the package
which works, but it is obviously less convenient. |
OK I've read through this issue more carefully now, and @cuonglm is right that we're confusing two totally separate issues: @cuonglm commented on June 13, 2016 9:29 AM:
The original issue reported (excellently described on Unix & Linux Stack Exchange) is that it's not possible for the Stow directory (i.e. the parent of the Stow package directories, see Terminology) to be a symlink. The example given has the Stow directory as a relative symlink. I guess some people might want it to be an absolute symlink instead, but I don't know because so far noone's provided a real world use case where this would actually be useful. In contrast, @dmarcoux is asking for Stow to support stowing of package trees which contain absolute symlinks, i.e. where the end result would be a (relative) symlink in the target directory pointing to an absolute symlink in the package tree which points to something like @CristianCantoro your use case is different again to either of the above! IIUC, you want Stow to be less cautious and stow symlinks to normal files inside target directories which are symlinks not owned by Stow. In this case, your target directory is @carlosnewmusic Sorry I don't understand. Is this definitely related to the original report above regarding the Stow directory being a symlink? If not, please file a separate issue, thanks. But either way I definitely need more details. |
As per request, I will describe an example use case where resolving the canonical path is inconvenient. Symbolic links are sometimes used for compatibility. Debian even talks about this in official policy. Often the target is a single file, but sometimes it is a directory. I happen to have a few hundred on my system in
The default behavior of
would break when the next release of Debian upgraded it to
but a symlink to
would work in both versions. Since
would result in symbolic links like, e.g. this:
not like this:
(The motivation for using
Output is:
Hypothetically,
For other examples of compatibility symlinks that change with each version, here are two more I know of on my laptop:
To address the symlink-points-to-symlink case:
produces:
and then:
produces:
whereas
would produce this:
So in the hypothetical
While I don't consider the lack of this feature a great deficiency of |
I think so, what data do you need? |
@nbeaver Many thanks for the extra info. I don't have time to process this right now, but I'll try to get to it soon. |
@carlosnewmusic commented on July 1, 2019 10:11 AM:
@carlosnewmusic I need to understand the concrete use case where you need the stow directory to be a symlink. Please give details of the exact paths of:
and also:
Thanks! |
@aspiers i use https://github.com/graysky2/profile-sync-daemon and my .mozilla/firefox/profile folder i symlink to /run/user/1000/bausch-firefox-tor-main |
My use case is that I have a single git repository with dotfiles for a whole bunch of machines. I want to be able to check out that directory to a computer and then have I can of course achieve this by wrapping |
Should we support the issue raised at Unix & Linux Stack Exchange: "symlink - Can GNU Stow use a stow directory that is a symbolic link?" ?
It seems that former Stow developers had this in mind, base on the comment in canon_path
EDIT: Clarification from @aspiers:
The text was updated successfully, but these errors were encountered: