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

Fix only last duplicate link item processed when using host specific option #19

Conversation

arcticicestudio
Copy link
Owner

This PR fixes the hosts option of the link core plugin issued in #18.

Changes

The internal type has been changed from a Python builtin list to a dict to allow to define multiple hosts with an associated path.

Bug description

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.

New format example configuration

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

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 arcticicestudio self-assigned this Jan 28, 2017
@arcticicestudio arcticicestudio merged commit b921c48 into develop Jan 28, 2017
@arcticicestudio arcticicestudio deleted the bugfix/ghi-#18-only-last-duplicate-link-item-processed-when-using-host-specific-option branch January 28, 2017 14:12
@arcticicestudio arcticicestudio added this to the 0.2.0 milestone Jul 15, 2017
@arcticicestudio arcticicestudio added this to Done in 0.2.0 Jul 15, 2017
@arcticicestudio arcticicestudio removed their assignment Sep 23, 2017
@arcticicestudio arcticicestudio changed the title #18 Only last duplicate link item processed when using host specific option Fix only last duplicate link item processed when using host specific option Nov 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
0.2.0
Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant