From 722137f9eacae1027a62c70c825b2543bdc8261c Mon Sep 17 00:00:00 2001 From: lucasew Date: Mon, 16 Sep 2024 13:17:47 -0300 Subject: [PATCH] shadershark: simplify update script Signed-off-by: lucasew --- pkgs/by-name/sh/shadershark/package.nix | 10 +++++++++- pkgs/by-name/sh/shadershark/update.sh | 14 -------------- 2 files changed, 9 insertions(+), 15 deletions(-) delete mode 100755 pkgs/by-name/sh/shadershark/update.sh diff --git a/pkgs/by-name/sh/shadershark/package.nix b/pkgs/by-name/sh/shadershark/package.nix index e27036575be7..8585dd8c015a 100644 --- a/pkgs/by-name/sh/shadershark/package.nix +++ b/pkgs/by-name/sh/shadershark/package.nix @@ -9,6 +9,8 @@ , imagemagick , makeWrapper , installShellFiles +, genericUpdater +, writeShellScript }: stdenv.mkDerivation (finalAttrs: { @@ -50,7 +52,13 @@ stdenv.mkDerivation (finalAttrs: { 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; { mainProgram = "shader-shark"; diff --git a/pkgs/by-name/sh/shadershark/update.sh b/pkgs/by-name/sh/shadershark/update.sh deleted file mode 100755 index 0bd125caac95..000000000000 --- a/pkgs/by-name/sh/shadershark/update.sh +++ /dev/null @@ -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