diff options
author | Yury G. Kudryashov <urkud.urkud@gmail.com> | 2011-08-23 17:45:40 +0000 |
---|---|---|
committer | Yury G. Kudryashov <urkud.urkud@gmail.com> | 2011-08-23 17:45:40 +0000 |
commit | 1e981a7deb2b469c5a093f6e42539534f333b5be (patch) | |
tree | 192ae59de4bd65b42a53485033a5fb4f5939deed /pkgs/build-support/fetchmtn | |
parent | 08605870dadde46141bebd35737c8a83f070afcd (diff) | |
download | nixpkgs-1e981a7deb2b469c5a093f6e42539534f333b5be.tar nixpkgs-1e981a7deb2b469c5a093f6e42539534f333b5be.tar.gz nixpkgs-1e981a7deb2b469c5a093f6e42539534f333b5be.tar.bz2 nixpkgs-1e981a7deb2b469c5a093f6e42539534f333b5be.tar.lz nixpkgs-1e981a7deb2b469c5a093f6e42539534f333b5be.tar.xz nixpkgs-1e981a7deb2b469c5a093f6e42539534f333b5be.tar.zst nixpkgs-1e981a7deb2b469c5a093f6e42539534f333b5be.zip |
fetchmtn: move logic to default args
svn path=/nixpkgs/trunk/; revision=28786
Diffstat (limited to 'pkgs/build-support/fetchmtn')
-rw-r--r-- | pkgs/build-support/fetchmtn/default.nix | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/pkgs/build-support/fetchmtn/default.nix b/pkgs/build-support/fetchmtn/default.nix index 7fda2821905..80d9091e01d 100644 --- a/pkgs/build-support/fetchmtn/default.nix +++ b/pkgs/build-support/fetchmtn/default.nix @@ -1,25 +1,23 @@ # You can specify some extra mirrors and a cache DB via options -{stdenv, monotone, defaultDBMirrors ? [], cacheDB ? ""}: +{stdenv, monotone, defaultDBMirrors ? [], cacheDB ? "./mtn-checkout.db"}: # dbs is a list of strings # each is an url for sync # selector is mtn selector, like h:org.example.branch # -{name ? "", dbs ? [], selector ? "", branch, md5 ? "", sha1 ? "", sha256 ? ""}: +{name ? "mtn-checkout", dbs ? [], sha256 +, selector ? "h:" + branch, branch}: stdenv.mkDerivation { - name = if name != "" then name else "mtn-checkout"; builder = ./builder.sh; - buildInputs = [monotone]; + buildNativeInputs = [monotone]; - outputHashAlgo = if sha256 == "" then (if sha1 == "" then "md5" else "sha1") else "sha256"; + outputHashAlgo = "sha256"; outputHashMode = "recursive"; - outputHash = if sha256 == "" then (if sha1 == "" then md5 else sha1) else sha256; + outputHash = sha256; dbs = defaultDBMirrors ++ dbs; - cacheDB = if cacheDB != "" then cacheDB else "./mtn-checkout.db"; - selector = if selector != "" then selector else "h:" + branch; - inherit branch; + inherit branch cacheDB name selector; impureEnvVars = [ # We borrow these environment variables from the caller to allow |