From d072485d2895d01dbbab1d899418726e3349343f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 10 Jul 2003 13:41:28 +0000 Subject: * Get `nix-push' working again. It now uses Nix/Fix to create Nix archives (using the package in corepkgs/nar). * queryPathByHash -> expandHash, and it takes an argument specifying the target path (which may be empty). * Install the core Fix packages in $prefix/share/fix. TODO: bootstrap Nix and install Nix as a Fix package. --- src/fix.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/fix.cc') diff --git a/src/fix.cc b/src/fix.cc index 9e5b8b5d4..5c4297bfb 100644 --- a/src/fix.cc +++ b/src/fix.cc @@ -15,6 +15,8 @@ static Strings searchDirs; static string searchPath(string relPath) { + if (string(relPath, 0, 1) == "/") return relPath; + for (Strings::iterator i = searchDirs.begin(); i != searchDirs.end(); i++) { @@ -218,7 +220,10 @@ static Expr evalExpr(Expr e) static Expr evalFile(string relPath) { - Expr e = ATreadFromNamedFile(searchPath(relPath).c_str()); + string path = searchPath(relPath); + Expr e = ATreadFromNamedFile(path.c_str()); + if (!e) + throw Error(format("unable to read a term from `%1%'") % path); return evalExpr(e); } @@ -228,6 +233,7 @@ void run(Strings args) Strings files; searchDirs.push_back("."); + searchDirs.push_back(nixDataDir + "/fix"); for (Strings::iterator it = args.begin(); it != args.end(); ) -- cgit v1.2.3