stow-devel
[Top][All Lists]
Advanced

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

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


From: shakmar
Subject: [Stow-devel] [PATCH] Add --stowdir and --delete options to chkstow
Date: Thu, 11 Feb 2016 18:40:10 +0100
User-agent: Mutt/1.5.24 (2015-08-30)

Hello,

I use GNU stow to manage my dotfiles and I love it.  The only thing I missed was
a way to remove leftover symlinks whenever I removed a file in my dotfiles
repository.

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.

Thanks :)

Attachment: 0001-Add-stowdir-option-to-chkstow.patch
Description: Text document

Attachment: 0002-Add-delete-option-to-chkstow.patch
Description: Text document


reply via email to

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