From 0101944621e18096c3f1404654bb43a55861910f Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Sun, 19 Nov 2017 03:33:31 +0200 Subject: update-source-version: Check for sources not dependent on ${version} --- pkgs/common-updater/scripts/update-source-version | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pkgs/common-updater') diff --git a/pkgs/common-updater/scripts/update-source-version b/pkgs/common-updater/scripts/update-source-version index c5f7db28162..4c4cb56fb32 100755 --- a/pkgs/common-updater/scripts/update-source-version +++ b/pkgs/common-updater/scripts/update-source-version @@ -82,6 +82,11 @@ if [ -z "$newHash" ]; then die "Couldn't figure out new hash of '$attr.src'!" fi +if [ "$oldVersion" != "$newVersion" ] && [ "$oldHash" = "$newHash" ]; then + mv "$nixFile.bak" "$nixFile" + die "Both the old and new source hashes of '$attr.src' were equivalent. Please fix the package's source URL to be dependent on '\${version}'!" +fi + sed -i "$nixFile" -re "s|\"$tempHash\"|\"$newHash\"|" if cmp -s "$nixFile" "$nixFile.bak"; then die "Failed to replace temporary source hash of '$attr' to the final source hash!" -- cgit 1.4.1