shadershark: simplify update script (#342342)
This commit is contained in:
commit
7f6123b2ac
@ -9,6 +9,8 @@
|
|||||||
, imagemagick
|
, imagemagick
|
||||||
, makeWrapper
|
, makeWrapper
|
||||||
, installShellFiles
|
, installShellFiles
|
||||||
|
, genericUpdater
|
||||||
|
, writeShellScript
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
@ -50,7 +52,13 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.updateScript = [ ./update.sh finalAttrs.src.url ];
|
passthru.updateScript = genericUpdater {
|
||||||
|
inherit (finalAttrs) pname version;
|
||||||
|
versionLister = writeShellScript "shadershark-tags" ''
|
||||||
|
repo_url=${finalAttrs.src.url}
|
||||||
|
curl "$repo_url/tags" | grep '/rev/v' | sed 's;.*/rev/v\([^"]*\)[^$]*;\1; #'
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
mainProgram = "shader-shark";
|
mainProgram = "shader-shark";
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env nix-shell
|
|
||||||
#! nix-shell -i bash -p curl common-updater-scripts
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
repo_url="$1"; shift
|
|
||||||
|
|
||||||
data="$(curl "$repo_url/tags")"
|
|
||||||
|
|
||||||
rev="$(echo "$data" | grep '/rev/v' | sed 's;.*/rev/v\([^"]*\)[^$]*;\1;' | head -n 1)"
|
|
||||||
echo "new rev: $rev"
|
|
||||||
|
|
||||||
update-source-version shadershark "$rev" \
|
|
||||||
--print-changes
|
|
Loading…
Reference in New Issue
Block a user