-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add option for version_key #214
Conversation
87c08c0
to
ead246a
Compare
ead246a
to
d75b334
Compare
I just leant that the case I was thinking of (in the test case) was using import from derivation. |
@@ -56,6 +58,12 @@ def parse_args(args: list[str]) -> Options: | |||
help="Regex to extract version with, i.e. 'jq-(.*)'", | |||
default="(.*)", | |||
) | |||
parser.add_argument( | |||
"-vk", | |||
"--version-key", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think version-attr fits better with how nix language names things:
"--version-key", | |
"--version-attr", |
parser.add_argument( | ||
"-vk", | ||
"--version-key", | ||
help="Key of attribute that holds the version", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
help="Key of attribute that holds the version", | |
help="Name of attribute that holds the version", |
@@ -56,6 +58,12 @@ def parse_args(args: list[str]) -> Options: | |||
help="Regex to extract version with, i.e. 'jq-(.*)'", | |||
default="(.*)", | |||
) | |||
parser.add_argument( | |||
"-vk", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure we need a short-hand for that:
"-vk", |
I see this more being used in scripts where the long-form is more descriptive.
Yeah. Maybe we can revisit this when we have a better idea how this would be useful... |
Hi, I was having some problems with packaging with different versioning, so I copied this idea from
common-updater-scripts
from nixpkgs.Some packages can have a different version from the source repo but could be derived from source. Currently I see no way to update these packages like this with
nix-update
.This PR adds an option
version_key
for this case.By expose a variable that holds the github repo version,
nix-update *name* --version-key *version attr name*
could update the package.BTW, I added an option to the argparser so it shows the default values of options on
--help
.Thanks!