Skip to content
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

rcup ignoring empty folders even if not empty in first entry of DOTFILES_DIRS #186

Open
schmijos opened this issue Aug 10, 2016 · 2 comments
Labels

Comments

@schmijos
Copy link

schmijos commented Aug 10, 2016

I'm using Thoughtbot's dotfiles and my own dotfiles-local.

How can I force rcup to overwrite a config file with a symlink pointing to dotfiles-local?

In my specific example I want to replace the installer generated gnupg configuration with my own one.

I've a .gnupg folder in my home directory looking like this:

ls ~/.gnupg
gpg-agent.conf pubring.gpg    random_seed    trustdb.gpg
gpg.conf       pubring.gpg~   secring.gpg

and I've a gnupg folder in my dotfiles-local looking like this:

ls ~/dotfiles-local/gnupg
gpg-agent.conf gpg.conf

When it comes to lsrc everthing seems like expected:

lsrc
...
/Users/josua/.gnupg/gpg-agent.conf:/Users/josua/dotfiles-local/gnupg/gpg-agent.conf
/Users/josua/.gnupg/gpg.conf:/Users/josua/dotfiles-local/gnupg/gpg.conf
...

But if I execute rcup, it doesn't ask to overwrite the file .gnupg/gpg-agent.conf with a symlink to dotfiles-local/gnupg/gpg-agent.conf like I would expect. All other symlinks are created. For some which are present in dotfiles and where I have a .local in dotfiles-local I'm asked if they should be overwritten. But nothing happens for files which are already somewhere in the filesystem (not being symlinks) outside of dotfiles and dotfiles-local.

Is that intended behaviour?

Update:

I found out, that it works if I put the gnupg config files under dotfiles/gnupg/ and under dotfiles-local/gnupg/.

Could this be an issue of https://github.com/thoughtbot/dotfiles instead of rcm?

Update 2:

It seems there was some confusion about that already: thoughtbot/dotfiles@8c77a89

Update 3:

It seems to be an issue of rcm.

Apparently rcm ignores empty folders. So it's not enough to specify DOTFILES_DIRS="$HOME/dotfiles-local $HOME/dotfiles" in dotfiles/rcrc. In my case dotfiles was authoritative for deciding if a folder was empty even if dotfiles-local should have had precedence.

As a workaround or maybe even better practise I just copied the dotfiles/rcrc to dotfiles-local/rcrc and also rcup dotfiles-local instead of dotfiles.

I wouldn't have noticed the problem if I had a dotfiles-local/rcrc in the first place.

@schmijos schmijos changed the title rcup doesn't ask to overwrite file with symlink rcup doesn't ask to overwrite file with symlink to dotfiles-local Aug 11, 2016
@schmijos schmijos changed the title rcup doesn't ask to overwrite file with symlink to dotfiles-local rcup not asking to overwrite file with symlink to dotfiles-local Aug 11, 2016
@schmijos schmijos changed the title rcup not asking to overwrite file with symlink to dotfiles-local rcup ignoring empty folders even if not empty in first entry of DOTFILES_DIRS Aug 11, 2016
@mike-burns mike-burns added the bug label Dec 26, 2016
@mike-burns
Copy link
Contributor

Interesting. So, a minimal test case is:

dotfiles-A/directory
dotfiles-B/directory/file
rcup -d dotfiles-A -d dotfiles-B

This will cause .directory/file not to be symlinked?

@mat-m
Copy link
Contributor

mat-m commented Dec 8, 2019

I cannot confirm with 1.3.3. All looks fine :

rcm imperator:~ [147]% mkdir dotfiles-global/emptyone
rcm imperator:~ [148]% mkdir .dotfiles/emptyone
rcm imperator:~ [149]% echo 'Content' > .dotfiles/emptyone/notsoempty
rcm imperator:~ [150]% lsrc -d dotfiles-global -d .dotfiles
/home/rcm/.date:/home/rcm/.dotfiles/date
/home/rcm/.emptyone/notsoempty:/home/rcm/.dotfiles/emptyone/notsoempty
/home/rcm/.realdotdir1/dotdate:/home/rcm/.dotfiles/realdotdir1/dotdate
/home/rcm/.tmp/rcmoutfile:/home/rcm/.dotfiles/tmp/rcmoutfile
rcm imperator:~ [151]% rcup -d dotfiles-global -d .dotfiles
rcm imperator:~ [152]% lsrc -d dotfiles-global -d .dotfiles
/home/rcm/.date:/home/rcm/.dotfiles/date
/home/rcm/.emptyone/notsoempty:/home/rcm/.dotfiles/emptyone/notsoempty
/home/rcm/.realdotdir1/dotdate:/home/rcm/.dotfiles/realdotdir1/dotdate
/home/rcm/.tmp/rcmoutfile:/home/rcm/.dotfiles/tmp/rcmoutfile
rcm imperator:~ [153]% ll /home/rcm/.dotfiles/emptyone/notsoempty    
-rw-rw-r-- 1 rcm rcm 8 Dec  8 01:39 /home/rcm/.dotfiles/emptyone/notsoempty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants