summary refs log tree commit diff
path: root/pkgs/common-updater
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2021-04-24 02:50:53 +0200
committerJan Tojnar <jtojnar@gmail.com>2021-04-24 02:50:53 +0200
commitd788c091b6348dd897c438a1ec2ad40822170e3c (patch)
tree30cfa5550bdef22bf6dff67d0747fe0df3bd650c /pkgs/common-updater
parentd9a0f79acf17d9259aabf2cb148bc83f76c54841 (diff)
downloadnixpkgs-d788c091b6348dd897c438a1ec2ad40822170e3c.tar
nixpkgs-d788c091b6348dd897c438a1ec2ad40822170e3c.tar.gz
nixpkgs-d788c091b6348dd897c438a1ec2ad40822170e3c.tar.bz2
nixpkgs-d788c091b6348dd897c438a1ec2ad40822170e3c.tar.lz
nixpkgs-d788c091b6348dd897c438a1ec2ad40822170e3c.tar.xz
nixpkgs-d788c091b6348dd897c438a1ec2ad40822170e3c.tar.zst
nixpkgs-d788c091b6348dd897c438a1ec2ad40822170e3c.zip
common-updater-scripts: remove lib dependency
So that the script can be used outside of nixpkgs.
Diffstat (limited to 'pkgs/common-updater')
-rwxr-xr-xpkgs/common-updater/scripts/update-source-version7
1 files changed, 3 insertions, 4 deletions
diff --git a/pkgs/common-updater/scripts/update-source-version b/pkgs/common-updater/scripts/update-source-version
index 90543a9cfc6..831f65e4d90 100755
--- a/pkgs/common-updater/scripts/update-source-version
+++ b/pkgs/common-updater/scripts/update-source-version
@@ -99,11 +99,10 @@ if [[ -z "$oldUrl" ]]; then
     die "Couldn't evaluate source url from '$attr.src'!"
 fi
 
-drvName=$(nix-instantiate $systemArg --eval -E "with import ./. {}; lib.getName $attr" | tr -d '"')
-oldVersion=$(nix-instantiate $systemArg --eval -E "with import ./. {}; $attr.${versionKey} or (lib.getVersion $attr)" | tr -d '"')
+oldVersion=$(nix-instantiate $systemArg --eval -E "with import ./. {}; $attr.${versionKey} or (builtins.parseDrvName $attr.name).version" | tr -d '"')
 
-if [[ -z "$drvName" || -z "$oldVersion" ]]; then
-    die "Couldn't evaluate name and version from '$attr.name'!"
+if [[ -z "$oldVersion" ]]; then
+    die "Couldn't find out the old version of '$attr'!"
 fi
 
 if [[ "$oldVersion" = "$newVersion" ]]; then