git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #48325 from transumption/201810/warn-on-fetchurl-rev-archives

fetchurl: warn on rev archives, resolves #32999

commitb26153450c744bf901fd2fe2e07ac24e5aff0ef4 authorGraham Christensen <graham@grahamc.com> dateWed 24 Apr 2019, 12:09 (8 years ago) parent6a5f81e6fad2ae
1 file changed+10−1
pkgs/build-support/fetchurl/builder.sh+10−1
pkgs/build-support/fetchurl/builder.sh+10−1
@@ -118,7 +118,6 @@ if test -n "$showURLs"; then
118118 exit 0
119119fi
120120
121−
122121if test -n "$preferHashedMirrors"; then
123122 tryHashedMirrors
124123fi
@@ -128,6 +127,16 @@ set -o noglob
128127
129128success=
130129for url in $urls; do
130+ if [ -z "$postFetch" ]; then
131+ case "$url" in
132+ https://github.com/*/archive/*)
133+ echo "warning: archives from GitHub revisions should use fetchFromGitHub"
134+ ;;
135+ https://gitlab.com/*/-/archive/*)
136+ echo "warning: archives from GitLab revisions should use fetchFromGitLab"
137+ ;;
138+ esac
139+ fi
131140 tryDownload "$url"
132141 if test -n "$success"; then finish; fi
133142done