8000 Need Help: Can´t make the stow ignore list work · Issue #119 · aspiers/stow · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Need Help: Can´t make the stow ignore list work #119

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

Open
0inp opened this issue Sep 30, 2024 · 4 comments
Open

Need Help: Can´t make the stow ignore list work #119

0inp opened this issue Sep 30, 2024 · 4 comments

Comments

@0inp
Copy link
0inp commented Sep 30, 2024

Hi !

I can´t make the `.stow-local-ignore´ work.
I have a ´.dotfiles´ directory in my home directory. Let´s say that in that dotfiles directory I have a ´resources´ directory with some shell script. I just want to not stow that resources directory.
I tried a bunch of different regex for that directory or for the files in that directory, I just can´t make it work.
From my dotfiles directory, I am just using the ´stow */´ command.

So, what line should I add in my stow-local-ignore file ?

thanks for your help

Other question, is it possible to make the ignore lists respective to platforms/envs?
let´s say I have all my dotfiles for macos and ubuntu, I just want to ignore for example the ubuntu directories/files when I am on MacOS or vice-versa.

Again, thanks for your help

@aspiers
Copy link
Owner
aspiers commented Sep 30, 2024

You can just add resources to .stow-local-ignore. No need for any regex.

Other question, is it possible to make the ignore lists respective to platforms/envs?
let´s say I have all my dotfiles for macos and ubuntu, I just want to ignore for example the ubuntu directories/files when I am on MacOS or vice-versa.

No, there's no way to do this natively. You would have to automate the generation of .stow-local-ignore based on which OS you're on. A simple script or Makefile could do this easily.

@0inp
Copy link
Author
0inp commented Oct 1, 2024

No, there's no way to do this natively. You would have to automate the generation of .stow-local-ignore based on which OS you're on. A simple script or Makefile could do this easily.

Thanks a lot, I´ll do that, it seems a good solution.

On the other hand, I really can´t make the ignore list work, sorry !
I think this have something to do with the structure of my dotfiles.
lets say that I have my ~/.dotfiles directory directly in my home directory.
Inside my .dotfiles directory, I have a resources directory with a macos_settings.sh shell script file (ie ~/.dotfiles/resources/macos_settings.sh).
I have a .stow-local-ignore file with a line with just the word "resources".
Let´s say that I have a clean home folder without the macos_settings.sh file (I removed it from previous stow operation)
Nevertheless, when I do the command stow */ to stow all my dotfiles, I still have the ~/macos_settings.sh file appearing in my home directory.

@aspiers
Copy link
Owner
aspiers commented Oct 2, 2024

Where have you placed the .stow-local-ignore file? Also try running stow with -v5 or similar and checking the debug output for lines containing Using ignore file:.

Otherwise I can only help if you provide an exact sequence of commands to minimally reproduce the issue. I strongly recommend reading How to Report Bugs Effectively as it will help you to help software maintainers to help you :-)

@sriramr98
Copy link

Hey @aspiers

I have a script.sh in my $HOME/.dotenv folder and a .stow-local-ignore which mentions the script.sh
When I run stow --verbose=5 ., I can see the following

stow dir is /Users/sriram.ramasamy/dotfiles
stow dir path relative to target /Users/sriram.ramasamy is dotfiles
Planning stow of: . ...
cwd now /Users/sriram.ramasamy
                    | Joining: dotfiles .
                    | Final join: dotfiles
Planning stow of package ....
                    | Joining: . .stow
                    | Final join: .stow
                    | Joining: . .nonstow
                    | Final join: .nonstow
    . not protected; shouldn't skip
Stowing contents of dotfiles / . / . (cwd=/Users/sriram.ramasamy)
    target subdir is .
                    | Joining: dotfiles . .
                    | Final join: dotfiles
                | Checking whether . is a current/planned node
                | link_task_action(.): no task
                | dir_task_action(.): no task
                    | Joining:  .
                    | Final join: .
                | parent_link_scheduled_for_removal(.): prefix .
                | parent_link_scheduled_for_removal(.): returning false
            | is_a_node(.): really exists
                    | Joining: . .config
                    | Final join: .config
                    | Joining: . .config
                    | Final join: .config
                    | Joining: dotfiles .
                    | Final join: dotfiles
                    | Joining: dotfiles .stow-local-ignore
                    | Final join: dotfiles/.stow-local-ignore
                    | Joining: /Users/sriram.ramasamy .stow-global-ignore
                    | Final join: /Users/sriram.ramasamy/.stow-global-ignore
    Using ignore file: dotfiles/.stow-local-ignore
        Ignore list regexp for paths:    /(?^:(^|/)(^/\.stow\-local\-ignore$)(/|$))/
        Ignore list regexp for segments: /(?^:^(.gitignore|.git|script.sh)$)/
    Not ignoring .config
Stowing entry dotfiles / . / .config
                    | Joining: dotfiles . .config
                    | Final join: dotfiles/.config
    level of .config is 0
                    | Joining:  dotfiles/.config
                    | Final join: dotfiles/.config
    link destination dotfiles/.config
        is_a_link(.config)
                | link_task_action(.config): no task
        is_a_link(.config): returning 0
                | Checking whether .config is a current/planned node
                | link_task_action(.config): no task
                | dir_task_action(.config): no task
                    | Joining:  .config
                    | Final join: .config
                | parent_link_scheduled_for_removal(.config): prefix .config
                | parent_link_scheduled_for_removal(.config): returning false
            | is_a_node(.config): really exists
    Evaluate existing node: .config
    is_a_dir(.config)
                | dir_task_action(.config): no task
                    | Joining:  .config
                    | Final join: .config
                | parent_link_scheduled_for_removal(.config): prefix .config
                | parent_link_scheduled_for_removal(.config): returning false
    is_a_dir(.config): real dir
                    | Joining: .config .stow
                    | Final join: .config/.stow
                    | Joining: .config .nonstow
                    | Final join: .config/.nonstow
    .config not protected; shouldn't skip
Stowing contents of dotfiles / . / .config (cwd=/Users/sriram.ramasamy)
    target subdir is .config
                    | Joining: dotfiles . .config
                    | Final join: dotfiles/.config
                | Checking whether .config is a current/planned node
                | link_task_action(.config): no task
                | dir_task_action(.config): no task
                    | Joining:  .config
                    | Final join: .config
                | parent_link_scheduled_for_removal(.config): prefix .config
                | parent_link_scheduled_for_removal(.config): returning false
            | is_a_node(.config): really exists
                    | Joining: .config ghostty
                    | Final join: .config/ghostty
                    | Joining: .config ghostty
                    | Final join: .config/ghostty
                    | Joining: dotfiles .
                    | Final join: dotfiles
                    | Joining: dotfiles .stow-local-ignore
                    | Final join: dotfiles/.stow-local-ignore
                    | Joining: /Users/sriram.ramasamy .stow-global-ignore
                    | Final join: /Users/sriram.ramasamy/.stow-global-ignore
    Using ignore file: dotfiles/.stow-local-ignore
        Using memoized regexps from dotfiles/.stow-local-ignore
        Ignore list regexp for paths:    /(?^:(^|/)(^/\.stow\-local\-ignore$)(/|$))/
        Ignore list regexp for segments: /(?^:^(.gitignore|.git|script.sh)$)/
    Not ignoring .config/ghostty
Stowing entry dotfiles / . / .config/ghostty
                    | Joining: dotfiles . .config/ghostty
                    | Final join: dotfiles/.config/ghostty
    level of .config/ghostty is 1
                    | Joining: ../ dotfiles/.config/ghostty
                    | Final join: ../dotfiles/.config/ghostty
    link destination ../dotfiles/.config/ghostty
        is_a_link(.config/ghostty)
                | link_task_action(.config/ghostty): no task
        is_a_link(.config/ghostty): returning 0
                | Checking whether .config/ghostty is a current/planned node
                | link_task_action(.config/ghostty): no task
                | dir_task_action(.config/ghostty): no task
                    | Joining:  .config
                    | Final join: .config
                | parent_link_scheduled_for_removal(.config/ghostty): prefix .config
                    | Joining: .config ghostty
                    | Final join: .config/ghostty
                | parent_link_scheduled_for_removal(.config/ghostty): prefix .config/ghostty
                | parent_link_scheduled_for_removal(.config/ghostty): returning false
            | is_a_node(.config/ghostty): returning false
LINK: .config/ghostty => ../dotfiles/.config/ghostty
                    | Joining: . .git
                    | Final join: .git
                    | Joining: . .git
                    | Final join: .git
                    | Joining: dotfiles .
                    | Final join: dotfiles
                    | Joining: dotfiles .stow-local-ignore
                    | Final join: dotfiles/.stow-local-ignore
                    | Joining: /Users/sriram.ramasamy .stow-global-ignore
                    | Final join: /Users/sriram.ramasamy/.stow-global-ignore
    Using ignore file: dotfiles/.stow-local-ignore
        Using memoized regexps from dotfiles/.stow-local-ignore
        Ignore list regexp for paths:    /(?^:(^|/)(^/\.stow\-local\-ignore$)(/|$))/
        Ignore list regexp for segments: /(?^:^(.gitignore|.git|script.sh)$)/
    Ignoring path segment .git
                    | Joining: . .stow-local-ignore
                    | Final join: .stow-local-ignore
                    | Joining: . .stow-local-ignore
                    | Final join: .stow-local-ignore
                    | Joining: dotfiles .
                    | Final join: dotfiles
                    | Joining: dotfiles .stow-local-ignore
                    | Final join: dotfiles/.stow-local-ignore
                    | Joining: /Users/sriram.ramasamy .stow-global-ignore
                    | Final join: /Users/sriram.ramasamy/.stow-global-ignore
    Using ignore file: dotfiles/.stow-local-ignore
        Using memoized regexps from dotfiles/.stow-local-ignore
        Ignore list regexp for paths:    /(?^:(^|/)(^/\.stow\-local\-ignore$)(/|$))/
        Ignore list regexp for segments: /(?^:^(.gitignore|.git|script.sh)$)/
    Ignoring path /.stow-local-ignore
                    | Joining: . .zshrc
                    | Final join: .zshrc
                    | Joining: . .zshrc
                    | Final join: .zshrc
                    | Joining: dotfiles .
                    | Final join: dotfiles
                    | Joining: dotfiles .stow-local-ignore
                    | Final join: dotfiles/.stow-local-ignore
                    | Joining: /Users/sriram.ramasamy .stow-global-ignore
                    | Final join: /Users/sriram.ramasamy/.stow-global-ignore
    Using ignore file: dotfiles/.stow-local-ignore
        Using memoized regexps from dotfiles/.stow-local-ignore
        Ignore list regexp for paths:    /(?^:(^|/)(^/\.stow\-local\-ignore$)(/|$))/
        Ignore list regexp for segments: /(?^:^(.gitignore|.git|script.sh)$)/
    Not ignoring .zshrc
Stowing entry dotfiles / . / .zshrc
                    | Joining: dotfiles . .zshrc
                    | Final join: dotfiles/.zshrc
    level of .zshrc is 0
                    | Joining:  dotfiles/.zshrc
                    | Final join: dotfiles/.zshrc
    link destination dotfiles/.zshrc
        is_a_link(.zshrc)
                | link_task_action(.zshrc): no task
        is_a_link(.zshrc): returning 0
                | Checking whether .zshrc is a current/planned node
                | link_task_action(.zshrc): no task
                | dir_task_action(.zshrc): no task
                    | Joining:  .zshrc
                    | Final join: .zshrc
                | parent_link_scheduled_for_removal(.zshrc): prefix .zshrc
                | parent_link_scheduled_for_removal(.zshrc): returning false
            | is_a_node(.zshrc): returning false
LINK: .zshrc => dotfiles/.zshrc
                    | Joining: . setup.sh
                    | Final join: setup.sh
                    | Joining: . setup.sh
                    | Final join: setup.sh
                    | Joining: dotfiles .
                    | Final join: dotfiles
                    | Joining: dotfiles .stow-local-ignore
                    | Final join: dotfiles/.stow-local-ignore
                    | Joining: /Users/sriram.ramasamy .stow-global-ignore
                    | Final join: /Users/sriram.ramasamy/.stow-global-ignore
    Using ignore file: dotfiles/.stow-local-ignore
        Using memoized regexps from dotfiles/.stow-local-ignore
        Ignore list regexp for paths:    /(?^:(^|/)(^/\.stow\-local\-ignore$)(/|$))/
        Ignore lis
623C
t regexp for segments: /(?^:^(.gitignore|.git|script.sh)$)/
    Not ignoring setup.sh
Stowing entry dotfiles / . / setup.sh
                    | Joining: dotfiles . setup.sh
                    | Final join: dotfiles/setup.sh
    level of setup.sh is 0
                    | Joining:  dotfiles/setup.sh
                    | Final join: dotfiles/setup.sh
    link destination dotfiles/setup.sh
        is_a_link(setup.sh)
                | link_task_action(setup.sh): no task
        is_a_link(setup.sh): returning 0
                | Checking whether setup.sh is a current/planned node
                | link_task_action(setup.sh): no task
                | dir_task_action(setup.sh): no task
                    | Joining:  setup.sh
                    | Final join: setup.sh
                | parent_link_scheduled_for_removal(setup.sh): prefix setup.sh
                | parent_link_scheduled_for_removal(setup.sh): returning false
            | is_a_node(setup.sh): returning false
LINK: setup.sh => dotfiles/setup.sh
Planning stow of package .... done
cwd restored to /Users/sriram.ramasamy/dotfiles
Processing tasks...
cwd now /Users/sriram.ramasamy
cwd restored to /Users/sriram.ramasamy/dotfiles
Processing tasks... done

Although it detects that script.sh is part of the ignore file, it still creates the symlink for this file.
I'm running this on a MacBook Pro M4 Max setup incase this helps.

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

No branches or pull requests

3 participants
0