From 6450f5699fa824934b92ca7ba1d345c36e9c009a Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 8 Jul 2012 10:25:58 -0400 Subject: Move fetchurl files out of their subdirectory --- corepkgs/fetchurl.nix | 23 +++++++++++++++++++++++ corepkgs/fetchurl.sh | 5 +++++ corepkgs/fetchurl/builder.sh.in | 5 ----- corepkgs/fetchurl/default.nix | 23 ----------------------- 4 files changed, 28 insertions(+), 28 deletions(-) create mode 100644 corepkgs/fetchurl.nix create mode 100644 corepkgs/fetchurl.sh delete mode 100644 corepkgs/fetchurl/builder.sh.in delete mode 100644 corepkgs/fetchurl/default.nix (limited to 'corepkgs') diff --git a/corepkgs/fetchurl.nix b/corepkgs/fetchurl.nix new file mode 100644 index 000000000000..37f01b55eeb0 --- /dev/null +++ b/corepkgs/fetchurl.nix @@ -0,0 +1,23 @@ +# Argh, this thing is duplicated (more-or-less) in Nixpkgs. Need to +# find a way to combine them. + +{system, url, outputHash ? "", outputHashAlgo ? "", md5 ? "", sha1 ? "", sha256 ? ""}: + +assert (outputHash != "" && outputHashAlgo != "") + || md5 != "" || sha1 != "" || sha256 != ""; + +derivation { + name = baseNameOf (toString url); + builder = ./builder.sh; + + # Compatibility with Nix <= 0.7. + id = md5; + + # New-style output content requirements. + outputHashAlgo = if outputHashAlgo != "" then outputHashAlgo else + if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5"; + outputHash = if outputHash != "" then outputHash else + if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5; + + inherit system url; +} diff --git a/corepkgs/fetchurl.sh b/corepkgs/fetchurl.sh new file mode 100644 index 000000000000..02abb18b4b77 --- /dev/null +++ b/corepkgs/fetchurl.sh @@ -0,0 +1,5 @@ +#! @shell@ -e + +echo "downloading $url into $out" + +@curl@ --fail --location --max-redirs 20 "$url" > "$out" diff --git a/corepkgs/fetchurl/builder.sh.in b/corepkgs/fetchurl/builder.sh.in deleted file mode 100644 index 02abb18b4b77..000000000000 --- a/corepkgs/fetchurl/builder.sh.in +++ /dev/null @@ -1,5 +0,0 @@ -#! @shell@ -e - -echo "downloading $url into $out" - -@curl@ --fail --location --max-redirs 20 "$url" > "$out" diff --git a/corepkgs/fetchurl/default.nix b/corepkgs/fetchurl/default.nix deleted file mode 100644 index 37f01b55eeb0..000000000000 --- a/corepkgs/fetchurl/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -# Argh, this thing is duplicated (more-or-less) in Nixpkgs. Need to -# find a way to combine them. - -{system, url, outputHash ? "", outputHashAlgo ? "", md5 ? "", sha1 ? "", sha256 ? ""}: - -assert (outputHash != "" && outputHashAlgo != "") - || md5 != "" || sha1 != "" || sha256 != ""; - -derivation { - name = baseNameOf (toString url); - builder = ./builder.sh; - - # Compatibility with Nix <= 0.7. - id = md5; - - # New-style output content requirements. - outputHashAlgo = if outputHashAlgo != "" then outputHashAlgo else - if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5"; - outputHash = if outputHash != "" then outputHash else - if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5; - - inherit system url; -} -- cgit 1.4.1