···45454646finish() {
4747 set +o noglob
4848+4949+ if [[ $executable == "1" ]]; then
5050+ chmod +x $downloadedFile
5151+ fi
5252+4853 runHook postFetch
4954 stopNest
5055 exit 0
+5-2
pkgs/build-support/fetchurl/default.nix
···7373 # is communicated to postFetch via $downloadedFile.
7474 downloadToTemp ? false
75757676+, # If true, set executable bit on downloaded file
7777+ executable ? false
7878+7679, # If set, don't download the file, but write a list of all possible
7780 # URLs (resulting from resolving mirror:// URLs) to $out.
7881 showURLs ? false
···116119 outputHash = if outputHash != "" then outputHash else
117120 if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5;
118121119119- outputHashMode = if recursiveHash then "recursive" else "flat";
122122+ outputHashMode = if (recursiveHash || executable) then "recursive" else "flat";
120123121121- inherit curlOpts showURLs mirrorsFile impureEnvVars postFetch downloadToTemp;
124124+ inherit curlOpts showURLs mirrorsFile impureEnvVars postFetch downloadToTemp executable;
122125123126 # Doing the download on a remote machine just duplicates network
124127 # traffic, so don't do that.