parent
60d4ac8280
commit
9f78dd4a1c
|
@ -5,16 +5,19 @@
|
||||||
# (e.g. due to minor changes in the compression algorithm, or changes
|
# (e.g. due to minor changes in the compression algorithm, or changes
|
||||||
# in timestamps).
|
# in timestamps).
|
||||||
|
|
||||||
{ fetchurl, unzip }:
|
{ lib, fetchurl, unzip }:
|
||||||
|
|
||||||
{ # Optionally move the contents of the unpacked tree up one level.
|
{ # Optionally move the contents of the unpacked tree up one level.
|
||||||
stripRoot ? true
|
stripRoot ? true
|
||||||
, url
|
, url ? ""
|
||||||
|
, urls ? []
|
||||||
, extraPostFetch ? ""
|
, extraPostFetch ? ""
|
||||||
, name ? "source"
|
, name ? "source"
|
||||||
, ... } @ args:
|
, ... } @ args:
|
||||||
|
|
||||||
(fetchurl ({
|
(fetchurl (let
|
||||||
|
basename = baseNameOf (if url != "" then url else builtins.head urls);
|
||||||
|
in {
|
||||||
inherit name;
|
inherit name;
|
||||||
|
|
||||||
recursiveHash = true;
|
recursiveHash = true;
|
||||||
|
@ -27,7 +30,7 @@
|
||||||
mkdir "$unpackDir"
|
mkdir "$unpackDir"
|
||||||
cd "$unpackDir"
|
cd "$unpackDir"
|
||||||
|
|
||||||
renamed="$TMPDIR/${baseNameOf url}"
|
renamed="$TMPDIR/${basename}"
|
||||||
mv "$downloadedFile" "$renamed"
|
mv "$downloadedFile" "$renamed"
|
||||||
unpackFile "$renamed"
|
unpackFile "$renamed"
|
||||||
''
|
''
|
||||||
|
|
Loading…
Reference in New Issue