stow-devel
[Top][All Lists]
Advanced

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

Re: [Stow-devel] [PATCH] Add --stowdir and --delete options to chkstow


From: Adam Spiers
Subject: Re: [Stow-devel] [PATCH] Add --stowdir and --delete options to chkstow
Date: Sun, 28 Feb 2016 13:35:33 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Feb 11, 2016 at 06:40:10PM +0100, address@hidden wrote:
> Hello,
> 
> I use GNU stow to manage my dotfiles and I love it.

Great!  Me too :-)

As an aside, did you see this which I linked from
the homepage?

  http://lists.gnu.org/archive/html/info-stow/2011-12/msg00000.html

> The only thing I missed was
> a way to remove leftover symlinks whenever I removed a file in my dotfiles
> repository.

You can achieve this simply by restowing a package: stow --restow

> When I looked at the source to find out how easy it might be to implement 
> what I
> needed, I stumbled upon chkstow (Which I had not heard of before – A quick
> search tells me it’s not even mentioned in the man page) which was almost
> exactly what I looked for.
> 
> However, it prints every single symlink that points to non-existing files, 
> even
> though I only care about those files that point to non-existing files in my 
> stow
> directory (ie. my dotfiles repository).  Since the target is my home 
> directory,
> there’s lots of garbage, abandoned projects, etc. lying around which contain
> stale symlinks.
> 
> To accomplish my goals (which I hope are shared by others, hence I’m writing
> this mail), I added the following command line options:
> 
> * --stowdir: Sets the stow directory, so chkstow can determine whether a path 
> is
>   inside it, in order to ignore symlinks that point to outside of it.  By
>   default, this value is set to "/", to stay backwards compatible – this way 
> no
>   symlink will be ignored except if you supply this option.
> 
> * --delete: Makes chkstow delete all the “bogus symlinks” it discovers.
> 
> Both changes are attached as seperate patches to this email.  Feel free to 
> tell
> me what I did wrong, since this is the first snippet of perl code I wrote in 
> my
> whole life.

That sounds very promising, thanks!  Any chance you could submit as a
pull request to https://github.com/aspiers/stow ?

Cheers,
Adam



reply via email to

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