fetchbzr, fetchdarcs, fetchhg: use rev attr

This makes it match the behaviour of fetchgit and fetchsvn, so it's
easier to write scripts that support all of them.
This commit is contained in:
Benno Fünfstück 2014-06-28 20:33:28 +02:00
parent 9b7dbcc83e
commit e10001042d
23 changed files with 43 additions and 43 deletions

View File

@ -21,7 +21,7 @@ composableDerivation {
# latest release # latest release
args.fetchhg { args.fetchhg {
url = "https://vim.googlecode.com/hg/"; url = "https://vim.googlecode.com/hg/";
tag = "v7-4-316"; rev = "v7-4-316";
sha256 = "0scxx33p1ky0wihk04xqpd6rygp1crm0hx446zbjwbsjj6xxn7sx"; sha256 = "0scxx33p1ky0wihk04xqpd6rygp1crm0hx446zbjwbsjj6xxn7sx";
}; };

View File

@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
src = fetchhg { src = fetchhg {
url = "https://vim.googlecode.com/hg/"; url = "https://vim.googlecode.com/hg/";
tag = "v7-4-316"; rev = "v7-4-316";
sha256 = "0scxx33p1ky0wihk04xqpd6rygp1crm0hx446zbjwbsjj6xxn7sx"; sha256 = "0scxx33p1ky0wihk04xqpd6rygp1crm0hx446zbjwbsjj6xxn7sx";
}; };

View File

@ -6,7 +6,7 @@ stdenv.mkDerivation rec {
src = fetchhg { src = fetchhg {
url = "http://code.google.com/p/photivo/"; url = "http://code.google.com/p/photivo/";
tag = "d687864489da"; rev = "d687864489da";
sha256 = "0f6y18k7db2ci6xn664zcwm1g1k04sdv7gg1yd5jk41bndjb7z8h"; sha256 = "0f6y18k7db2ci6xn664zcwm1g1k04sdv7gg1yd5jk41bndjb7z8h";
}; };

View File

@ -40,7 +40,7 @@ pythonPackages.buildPythonPackage rec {
src = fetchhg { src = fetchhg {
url = "https://code.google.com/p/ocropus.ocropy"; url = "https://code.google.com/p/ocropus.ocropy";
tag = "a6e0fbd820ce"; rev = "a6e0fbd820ce";
sha256 = "1s0v0gd6psfjp6lghwl2dj49h18mgf2n2z8hqzw8430nzhglnlvr"; sha256 = "1s0v0gd6psfjp6lghwl2dj49h18mgf2n2z8hqzw8430nzhglnlvr";
}; };

View File

@ -5,13 +5,13 @@ stdenv.mkDerivation rec {
src = fetchbzr { src = fetchbzr {
url = "https://code.launchpad.net/~kicad-stable-committers/kicad/stable"; url = "https://code.launchpad.net/~kicad-stable-committers/kicad/stable";
revision = 4024; rev = 4024;
sha256 = "1sv1l2zpbn6439ccz50p05hvqg6j551aqra551wck9h3929ghly5"; sha256 = "1sv1l2zpbn6439ccz50p05hvqg6j551aqra551wck9h3929ghly5";
}; };
srcLibrary = fetchbzr { srcLibrary = fetchbzr {
url = "http://bazaar.launchpad.net/~kicad-lib-committers/kicad/library"; url = "http://bazaar.launchpad.net/~kicad-lib-committers/kicad/library";
revision = 293; rev = 293;
sha256 = "1wn9a4nhqyjzzfkq6xm7ag8n5n10xy7gkq6i7yry7wxini7pzv1i"; sha256 = "1wn9a4nhqyjzzfkq6xm7ag8n5n10xy7gkq6i7yry7wxini7pzv1i";
}; };

View File

@ -6,7 +6,7 @@ stdenv.mkDerivation rec {
src = fetchhg { src = fetchhg {
url = "https://bitbucket.org/alanmi/abc"; url = "https://bitbucket.org/alanmi/abc";
tag = "03e221443d71e49e56cbc37f1907ee3b0ff3e7c9"; rev = "03e221443d71e49e56cbc37f1907ee3b0ff3e7c9";
sha256 = "0ahrqg718y7xpv939f6x8w1kqh7wsja4pw8hca7j67j0qjdgb4lm"; sha256 = "0ahrqg718y7xpv939f6x8w1kqh7wsja4pw8hca7j67j0qjdgb4lm";
}; };

View File

@ -9,7 +9,7 @@ stdenv.mkDerivation {
src = fetchdarcs { src = fetchdarcs {
url = "http://lama.univ-savoie.fr/~raffalli/GlSurf"; url = "http://lama.univ-savoie.fr/~raffalli/GlSurf";
tag = "3.3"; rev = "3.3";
sha256 = ""; md5=""; sha256 = ""; md5="";
}; };

View File

@ -5,7 +5,7 @@ stdenv.mkDerivation rec {
src = fetchhg { src = fetchhg {
url = http://hg.suckless.org/tabbed; url = http://hg.suckless.org/tabbed;
tag = "d7542a6f6dc5"; rev = "d7542a6f6dc5";
sha256 = "1963jsazfmh5k7923c1mfwppz1xbh48z16j0sa64fiscq22as2gj"; sha256 = "1963jsazfmh5k7923c1mfwppz1xbh48z16j0sa64fiscq22as2gj";
}; };

View File

@ -1,9 +1,9 @@
source "$stdenv/setup" source "$stdenv/setup"
header "exporting \`$url' (revision $revision) into \`$out'" header "exporting \`$url' (revision $rev) into \`$out'"
# Perform a lightweight checkout so that we don't end up importing # Perform a lightweight checkout so that we don't end up importing
# all the repository's history. # all the repository's history.
bzr -Ossl.cert_reqs=none export -r "$revision" --format=dir "$out" "$url" bzr -Ossl.cert_reqs=none export -r "$rev" --format=dir "$out" "$url"
stopNest stopNest

View File

@ -1,5 +1,5 @@
{ stdenv, bazaar }: { stdenv, bazaar }:
{ url, revision, sha256 }: { url, rev, sha256 }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "bzr-export"; name = "bzr-export";
@ -11,5 +11,5 @@ stdenv.mkDerivation {
outputHashMode = "recursive"; outputHashMode = "recursive";
outputHash = sha256; outputHash = sha256;
inherit url revision; inherit url rev;
} }

View File

@ -2,9 +2,9 @@ source $stdenv/setup
tagtext="" tagtext=""
tagflags="" tagflags=""
if test -n "$tag"; then if test -n "$rev"; then
tagtext="(tag $tag) " tagtext="(tag $rev) "
tagflags="--tag=$tag" tagflags="--tag=$rev"
elif test -n "$context"; then elif test -n "$context"; then
tagtext="(context) " tagtext="(context) "
tagflags="--context=$context" tagflags="--context=$context"

View File

@ -1,4 +1,4 @@
{stdenv, darcs, nix}: {url, tag ? null, context ? null, md5 ? "", sha256 ? ""}: {stdenv, darcs, nix}: {url, rev ? null, context ? null, md5 ? "", sha256 ? ""}:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "fetchdarcs"; name = "fetchdarcs";
@ -9,5 +9,5 @@ stdenv.mkDerivation {
outputHashMode = "recursive"; outputHashMode = "recursive";
outputHash = if sha256 == "" then md5 else sha256; outputHash = if sha256 == "" then md5 else sha256;
inherit url tag context; inherit url rev context;
} }

View File

@ -1,9 +1,9 @@
source $stdenv/setup source $stdenv/setup
header "getting $url${tag:+ ($tag)} into $out" header "getting $url${rev:+ ($rev)} into $out"
hg clone --insecure "$url" hg-clone hg clone --insecure "$url" hg-clone
hg archive -q -y ${tag:+-r "$tag"} --cwd hg-clone $out hg archive -q -y ${rev:+-r "$rev"} --cwd hg-clone $out
rm -f $out/.hg_archival.txt rm -f $out/.hg_archival.txt
stopNest stopNest

View File

@ -1,4 +1,4 @@
{stdenv, mercurial, nix}: {name ? null, url, tag ? null, md5 ? null, sha256 ? null}: {stdenv, mercurial, nix}: {name ? null, url, rev ? null, md5 ? null, sha256 ? null}:
# TODO: statically check if mercurial as the https support if the url starts woth https. # TODO: statically check if mercurial as the https support if the url starts woth https.
stdenv.mkDerivation { stdenv.mkDerivation {
@ -13,6 +13,6 @@ stdenv.mkDerivation {
outputHashMode = "recursive"; outputHashMode = "recursive";
outputHash = if md5 != null then md5 else sha256; outputHash = if md5 != null then md5 else sha256;
inherit url tag; inherit url rev;
preferLocalBuild = true; preferLocalBuild = true;
} }

View File

@ -37,7 +37,7 @@ let lispPackages = rec {
src = pkgs.fetchdarcs { src = pkgs.fetchdarcs {
url = "http://common-lisp.net/project/iterate/darcs/iterate"; url = "http://common-lisp.net/project/iterate/darcs/iterate";
sha256 = "0m3q0s7h5s8varwx584m2akgdslj14df7kg4w1bj1fbgzsag5m1w"; sha256 = "0m3q0s7h5s8varwx584m2akgdslj14df7kg4w1bj1fbgzsag5m1w";
tag=version; rev = version;
}; };
overrides = x: { overrides = x: {
configurePhase="buildPhase(){ true; }"; configurePhase="buildPhase(){ true; }";

View File

@ -15,7 +15,7 @@ let
root = "code.google.com/p/go.crypto"; root = "code.google.com/p/go.crypto";
src = fetchhg { src = fetchhg {
url = "http://code.google.com/p/go.crypto"; url = "http://code.google.com/p/go.crypto";
tag = "199"; rev = "199";
sha256 = "0ibrpc6kknzl6a2g2fkxn03mvrd635lcnvf4a9rk1dfrpjbpcixh"; sha256 = "0ibrpc6kknzl6a2g2fkxn03mvrd635lcnvf4a9rk1dfrpjbpcixh";
}; };
} }
@ -23,7 +23,7 @@ let
root = "code.google.com/p/goauth2"; root = "code.google.com/p/goauth2";
src = fetchhg { src = fetchhg {
url = "http://code.google.com/p/goauth2"; url = "http://code.google.com/p/goauth2";
tag = "67"; rev = "67";
sha256 = "053vajj8hd9869by7z9qfgzn84h6avpcjvyxcyw5jml8dsln4bah"; sha256 = "053vajj8hd9869by7z9qfgzn84h6avpcjvyxcyw5jml8dsln4bah";
}; };
} }
@ -31,7 +31,7 @@ let
root = "code.google.com/p/google-api-go-client"; root = "code.google.com/p/google-api-go-client";
src = fetchhg { src = fetchhg {
url = "http://code.google.com/p/google-api-go-client"; url = "http://code.google.com/p/google-api-go-client";
tag = "111"; rev = "111";
sha256 = "1ib8i1c2mb86lkrr5w7bgwb70gkqmp860wa3h1j8080gxdx3yy16"; sha256 = "1ib8i1c2mb86lkrr5w7bgwb70gkqmp860wa3h1j8080gxdx3yy16";
}; };
} }
@ -39,7 +39,7 @@ let
root = "code.google.com/p/gosshold"; root = "code.google.com/p/gosshold";
src = fetchhg { src = fetchhg {
url = "http://code.google.com/p/gosshold"; url = "http://code.google.com/p/gosshold";
tag = "2"; rev = "2";
sha256 = "1ljl8pcxxfz5rv89b2ajd31gxxzifl57kzpksvdhyjdxh98gkvg8"; sha256 = "1ljl8pcxxfz5rv89b2ajd31gxxzifl57kzpksvdhyjdxh98gkvg8";
}; };
} }
@ -65,7 +65,7 @@ let
root = "launchpad.net/tomb"; root = "launchpad.net/tomb";
src = fetchbzr { src = fetchbzr {
url = "https://launchpad.net/tomb"; url = "https://launchpad.net/tomb";
revision = "17"; rev = "17";
sha256 = "1cjw0sr9hald1darq6n8akfpkzcgrk3mcq59hga3ibf2lrg35ha0"; sha256 = "1cjw0sr9hald1darq6n8akfpkzcgrk3mcq59hga3ibf2lrg35ha0";
}; };
} }
@ -82,7 +82,7 @@ let
root = "code.google.com/p/goprotobuf"; root = "code.google.com/p/goprotobuf";
src = fetchhg { src = fetchhg {
url = "http://code.google.com/p/goprotobuf"; url = "http://code.google.com/p/goprotobuf";
tag = "246"; rev = "246";
sha256 = "0k4wcv1dnkwcp0gdrajj6kr25f1lg4lgpbi0h5v9l9n7sdwzplf4"; sha256 = "0k4wcv1dnkwcp0gdrajj6kr25f1lg4lgpbi0h5v9l9n7sdwzplf4";
}; };
} }
@ -135,7 +135,7 @@ let
root = "launchpad.net/gocheck"; root = "launchpad.net/gocheck";
src = fetchbzr { src = fetchbzr {
url = "https://launchpad.net/gocheck"; url = "https://launchpad.net/gocheck";
revision = "87"; rev = "87";
sha256 = "1y9fa2mv61if51gpik9isls48idsdz87zkm1p3my7swjdix7fcl0"; sha256 = "1y9fa2mv61if51gpik9isls48idsdz87zkm1p3my7swjdix7fcl0";
}; };
} }
@ -278,7 +278,7 @@ let
root = "launchpad.net/mgo"; root = "launchpad.net/mgo";
src = fetchbzr { src = fetchbzr {
url = "https://launchpad.net/mgo"; url = "https://launchpad.net/mgo";
revision = "2"; rev = "2";
sha256 = "0h1dxzyx5c4r4gfnmjxv92hlhjxrgx9p4g53p4fhmz6x2fdglb0x"; sha256 = "0h1dxzyx5c4r4gfnmjxv92hlhjxrgx9p4g53p4fhmz6x2fdglb0x";
}; };
} }

View File

@ -6,7 +6,7 @@ stdenv.mkDerivation rec {
src = fetchhg { src = fetchhg {
url = "https://code.google.com/r/splintermind-attributes/"; url = "https://code.google.com/r/splintermind-attributes/";
tag = rev; inherit rev;
sha256 = "0a9m967q6p2q3plrl6qysg1xrdmg65jzil6awjh2wr3g10x2x15z"; sha256 = "0a9m967q6p2q3plrl6qysg1xrdmg65jzil6awjh2wr3g10x2x15z";
}; };

View File

@ -6,7 +6,7 @@ stdenv.mkDerivation rec {
src = fetchhg { src = fetchhg {
url = "https://opentyrian.googlecode.com/hg/"; url = "https://opentyrian.googlecode.com/hg/";
tag = "13ef8ce47362"; rev = "13ef8ce47362";
md5 = "95c8f9e7ff3d4207f1c692c7cec6c9b0"; md5 = "95c8f9e7ff3d4207f1c692c7cec6c9b0";
}; };

View File

@ -6,7 +6,7 @@ let
root = "code.google.com/p/snappy-go"; root = "code.google.com/p/snappy-go";
src = fetchhg { src = fetchhg {
url = "http://code.google.com/p/snappy-go"; url = "http://code.google.com/p/snappy-go";
tag = "14"; rev = "14";
sha256 = "0ywa52kcii8g2a9lbqcx8ghdf6y56lqq96sl5nl9p6h74rdvmjr7"; sha256 = "0ywa52kcii8g2a9lbqcx8ghdf6y56lqq96sl5nl9p6h74rdvmjr7";
}; };
} }

View File

@ -6,7 +6,7 @@ let
root = "code.google.com/p/go.net"; root = "code.google.com/p/go.net";
src = fetchhg { src = fetchhg {
url = "http://code.google.com/p/go.net"; url = "http://code.google.com/p/go.net";
tag = "134"; rev = "134";
sha256 = "1jycpgrfwgkfac60zjbx6babcz7sgyn9xgy6cr3l811j6k8r2pbv"; sha256 = "1jycpgrfwgkfac60zjbx6babcz7sgyn9xgy6cr3l811j6k8r2pbv";
}; };
} }
@ -14,7 +14,7 @@ let
root = "code.google.com/p/go.text"; root = "code.google.com/p/go.text";
src = fetchhg { src = fetchhg {
url = "http://code.google.com/p/go.text"; url = "http://code.google.com/p/go.text";
tag = "85"; rev = "85";
sha256 = "1x8h6vq9g5gbi7iiwla6dkaaqqf7wmkdm4szj7wvzlsijf2x8dwr"; sha256 = "1x8h6vq9g5gbi7iiwla6dkaaqqf7wmkdm4szj7wvzlsijf2x8dwr";
}; };
} }
@ -157,7 +157,7 @@ let
root = "launchpad.net/gocheck"; root = "launchpad.net/gocheck";
src = fetchbzr { src = fetchbzr {
url = "https://launchpad.net/gocheck"; url = "https://launchpad.net/gocheck";
revision = "87"; rev = "87";
sha256 = "1y9fa2mv61if51gpik9isls48idsdz87zkm1p3my7swjdix7fcl0"; sha256 = "1y9fa2mv61if51gpik9isls48idsdz87zkm1p3my7swjdix7fcl0";
}; };
} }
@ -165,7 +165,7 @@ let
root = "launchpad.net/mgo"; root = "launchpad.net/mgo";
src = fetchbzr { src = fetchbzr {
url = "https://launchpad.net/mgo"; url = "https://launchpad.net/mgo";
revision = "2"; rev = "2";
sha256 = "0h1dxzyx5c4r4gfnmjxv92hlhjxrgx9p4g53p4fhmz6x2fdglb0x"; sha256 = "0h1dxzyx5c4r4gfnmjxv92hlhjxrgx9p4g53p4fhmz6x2fdglb0x";
}; };
} }

View File

@ -30,16 +30,16 @@ let
url = "https://launchpad.net/goyaml"; url = "https://launchpad.net/goyaml";
sha256 = "03is37cgw62cha316xrs5h7q97im46ry5qldkfvbhimjq3ww0swj"; sha256 = "03is37cgw62cha316xrs5h7q97im46ry5qldkfvbhimjq3ww0swj";
# Branch: "branch:lp:goyaml" # Branch: "branch:lp:goyaml"
revision = 47; rev = 47;
}; };
log4go = fetchhg { log4go = fetchhg {
url = "https://code.google.com/p/log4go/"; url = "https://code.google.com/p/log4go/";
tag = "c3294304d93f"; rev = "c3294304d93f";
sha256 = "0q906sxrmwir295virfibqvdzlaj340qh2r4ysx1ccjrjazc0q5p"; sha256 = "0q906sxrmwir295virfibqvdzlaj340qh2r4ysx1ccjrjazc0q5p";
}; };
osext = fetchhg { osext = fetchhg {
url = "https://bitbucket.org/kardianos/osext"; url = "https://bitbucket.org/kardianos/osext";
tag = "364fb57"; rev = "364fb57";
sha256 = "1w9x2zj716agfd5x5497ajb9nz3ljar74768vjidsyly143vzjws"; sha256 = "1w9x2zj716agfd5x5497ajb9nz3ljar74768vjidsyly143vzjws";
}; };
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {

View File

@ -5,7 +5,7 @@ stdenv.mkDerivation {
src = fetchhg { src = fetchhg {
url = http://oss.stamfest.net/hg/meo; url = http://oss.stamfest.net/hg/meo;
tag = "b48e5f16cff8"; rev = "b48e5f16cff8";
sha256 = "0ifg7y28s89i9gwda6fyj1jbrykbcvq8bf1m6rxmdcv5afi3arbq"; sha256 = "0ifg7y28s89i9gwda6fyj1jbrykbcvq8bf1m6rxmdcv5afi3arbq";
}; };

View File

@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
# This source has license BSD # This source has license BSD
srcGoSqlite = fetchhg { srcGoSqlite = fetchhg {
url = "https://code.google.com/p/gosqlite/"; url = "https://code.google.com/p/gosqlite/";
tag = "5baefb109e18"; rev = "5baefb109e18";
sha256 = "0mqfnx06jj15cs8pq9msny2z18x99hgk6mchnaxpg343nzdiz4zk"; sha256 = "0mqfnx06jj15cs8pq9msny2z18x99hgk6mchnaxpg343nzdiz4zk";
}; };