common-updater-scripts: remove lib dependency

So that the script can be used outside of nixpkgs.
This commit is contained in:
Jan Tojnar 2021-04-24 02:50:53 +02:00
parent d9a0f79acf
commit d788c091b6
No known key found for this signature in database
GPG key ID: 7FAB2A15F7A607A4

View file

@ -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