From 345f6712e3027555608b67853d13666fc313eca1 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 13 Jan 2020 13:43:55 +0000 Subject: linux-libre.updateScript: don't update if unchanged The revision applies to the whole SVN tree, not just the scripts directory, so the revision will increment sometimes with no change in content. --- pkgs/os-specific/linux/kernel/update-libre.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pkgs/os-specific') diff --git a/pkgs/os-specific/linux/kernel/update-libre.sh b/pkgs/os-specific/linux/kernel/update-libre.sh index e056577477c..1b4cd8aef60 100755 --- a/pkgs/os-specific/linux/kernel/update-libre.sh +++ b/pkgs/os-specific/linux/kernel/update-libre.sh @@ -6,6 +6,7 @@ nixpkgs="$(git rev-parse --show-toplevel)" path="$nixpkgs/pkgs/os-specific/linux/kernel/linux-libre.nix" old_rev="$(grep -o 'rev = ".*"' "$path" | awk -F'"' '{print $2}')" +old_sha256="$(grep -o 'sha256 = ".*"' "$path" | awk -F'"' '{print $2}')" svn_url=https://www.fsfla.org/svn/fsfla/software/linux-libre/releases/branches/ rev="$(curl -s "$svn_url" | grep -Em 1 -o 'Revision [0-9]+' | awk '{print $2}')" @@ -17,6 +18,11 @@ fi sha256="$(QUIET=1 nix-prefetch-svn "$svn_url" "$rev" | tail -1)" +if [ "$old_sha256" = "$sha256" ]; then + echo "No updates for linux-libre" + exit 0 +fi + sed -i -e "s/rev = \".*\"/rev = \"$rev\"/" \ -e "s/sha256 = \".*\"/sha256 = \"$sha256\"/" "$path" -- cgit 1.4.1