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

Assigning priority weight on values to add to path-like variables #185

Open
xdelaruelle opened this issue Aug 19, 2018 · 0 comments
Open

Comments

@xdelaruelle
Copy link
Member

xdelaruelle commented Aug 19, 2018

Coming from the need to make a value persist at first or last position of a path-like variable.

Priority weight is a solution often used when a given "stuff" can be obtained from multiple providers. Priority weight helps to select the primary provider. This solution is used for instance when dealing with package repositories to configure the repository that has the precedence over everything else when installing a system.

Applied to an environment variable domain, priority weight could help to determine what variable value to retain among multiple possibilities.

When using prepend-path and append-path commands, a --priority argument could be added to assign a priority weight to the value set.

  • Values with no specific priority weight set owns a default priority weight (default weight value to be defined)
  • For two values with same priority weight, lastly set will take the high ground
  • Priority weights help to determine the prepend value order and the append value order (with top priority prepend value holding first position and top priority append value holding last position)
setenv PATH /bin
prepend-path --priority 100 PATH /path/to/foo
prepend-path PATH /path/to/bar

In this example resulting PATH equals /path/to/foo:/path/to/bar:/bin.

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

1 participant