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

Only last duplicate link item processed when using host-specific option #18

Closed
arcticicestudio opened this issue Jan 28, 2017 · 0 comments
Labels
Milestone

Comments

@arcticicestudio
Copy link
Owner

arcticicestudio commented Jan 28, 2017

When defining duplicate link items for different hosts only the last one is processed.
Example:

[
  {
    "link": {
      "~/.makepkg.conf": null,
      "~/.pacman.conf": {
        "hosts": ["igloo"],
        "path": "pacman.conf.igloo"
      },
      "~/.pacman.conf": {
        "hosts": ["archbook"],
        "path": "pacman.conf.archbook"
      }
    }
  }
]

Only the pacman.conf for the archbook host will be processed although if the host doesn't match the current hostname!
If the order of the link items is changed the pacman.conf for the igloo host will also be ignored.

@arcticicestudio arcticicestudio self-assigned this Jan 28, 2017
arcticicestudio added a commit that referenced this issue Jan 28, 2017
The "hosts" option is now defined as dictionary to allow multiple
host-specific definitions without adding (mutliple) duplicate link items
to the snowblock configuration file.

The loop checks if the configured hosts matching the name of the current
host, logs if a entry has been skipped and sets the correct path if the
a marching host has been found.

The bug occured because the builtin Python dictionary only allows unique
keys which has been broken by defining multiple link items with the same
destination path. The new "hosts" option structure allows to define any
amount of hosts with their associated path.
arcticicestudio added a commit that referenced this issue Jan 28, 2017
…duplicate-link-item-processed-when-using-host-specific-option

#18 Only last duplicate link item processed when using host specific option
@arcticicestudio arcticicestudio added this to the 0.2.0 milestone Jul 15, 2017
@arcticicestudio arcticicestudio removed their assignment Sep 23, 2017
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

1 participant