update bleeding edge repo management

it now figures out the dist name from the url and the revision is added to the url
This way a new version doesn't override the old one and you can keep multiple dist tar.gz files

svn path=/nixpkgs/trunk/; revision=13065
This commit is contained in:
Marc Weber 2008-10-14 14:01:00 +00:00
parent 3f0a8494c9
commit 892db3bb8c
2 changed files with 20 additions and 7 deletions

View File

@ -1,6 +1,6 @@
args:
with args;
let inherit (builtins) pathExists; in
let inherit (builtins) pathExists hasAttr getAttr head; in
rec {
/*
tries to get source in this order
@ -13,13 +13,14 @@ args:
managedRepoDir = getConfig [ "bleedingEdgeRepos" "managedRepoDir" ] (builtins.getEnv "HOME" + "/managed_repos");
sourceByName = name :
let localTarGZ = managedRepoDir+"/dist/${name}.tar.gz";
let fetchinfo = if (hasAttr name fetchInfos)
then (getAttr name fetchInfos) { inherit fetchurl; }
else throw "no bleeding edge source attribute found in bleeding-edge-fetch-infos.nix with name ${name}\n"
"run NO_FETCH=1 nix-repository-manager <path to nixpkgs> --update <reponame> to add it automatically";
localTarGZ = managedRepoDir+"/dist/${ lib.dropPath (head fetchinfo.urls) }"; # hack, dropPath should be implemented as primop
fetchInfos = import ../../../misc/bleeding-edge-fetch-infos.nix; in
if (getConfig ["bleedingEdgeRepos" "useLocalRepos"] false ) && pathExists localTarGZ
then localTarGZ
else if __hasAttr name fetchInfos
then (__getAttr name fetchInfos) { inherit fetchurl; }
else throw "warning, no bleeding edge source attribute found in bleeding-edge-fetch-infos.nix with name ${name}";
if (getConfig ["bleedingEdgeRepos" "useLocalRepos"] false )
then localTarGZ else fetchinfo;
repos =
let kde4support = builtins.listToAttrs (map (n: lib.nv ("kdesupport_"+n) { type = "svn"; url = "svn://anonsvn.kde.org/home/kde/trunk/kdesupport/${n}"; groups="kdesupport"; })
@ -64,6 +65,8 @@ args:
kdepimlibs = { type="svn"; url="svn://anonsvn.kde.org/home/kde/trunk/KDE/kdepimlibs"; groups = "kde"; };
kdebase = { type="svn"; url="svn://anonsvn.kde.org/home/kde/trunk/KDE/kdebase"; groups = "kde"; };
cinelerra = { type="git"; url="git://git.cinelerra.org/j6t/cinelerra.git"; };
# git repositories
hypertable = { type="git"; url="git://scm.hypertable.org/pub/repos/hypertable.git"; groups=""; };
} // kde4support // getConfig [ "bleedingEdgeRepos" "repos" ] {};

View File

@ -507,6 +507,16 @@ rec {
defineShList = name : list : "\n${name}=(${concatStringsSep " " (map escapeShellArg list)})\n";
# this as well :-) arg: http://foo/bar/bz.ext returns bz.ext
dropPath = s :
if s == "" then "" else
let takeTillSlash = left : c : s :
if left == 0 then s
else if (__substring left 1 s == "/") then
(__substring (__add left 1) (__sub c 1) s)
else takeTillSlash (__sub left 1) (__add c 1) s; in
takeTillSlash (__sub (__stringLength s) 1) 1 s;
# calls a function (f attr value ) for each record item. returns a list
mapRecordFlatten = f : r : map (attr: f attr (builtins.getAttr attr r) ) (attrNames r);