about summary refs log tree commit diff
path: root/corepkgs
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-07-21T21·34+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-07-21T21·34+0000
commitc7bdb76fe461e2335caeea01c16b39a2784fa506 (patch)
tree9202fd4f800c63ce16298bce068b654d77ed126c /corepkgs
parentd5ee6f8700c7225a4ce34f6d92aae0d57bee3355 (diff)
* Syntax fixes.
* When pushing, put the hash in the file name so that the 
  client can verify (proof-carrying file names?).

Diffstat (limited to 'corepkgs')
-rw-r--r--corepkgs/nar/nar.fix4
-rw-r--r--corepkgs/nar/nar.sh.in7
2 files changed, 8 insertions, 3 deletions
diff --git a/corepkgs/nar/nar.fix b/corepkgs/nar/nar.fix
index 3db6a48a08..429e7b5497 100644
--- a/corepkgs/nar/nar.fix
+++ b/corepkgs/nar/nar.fix
@@ -1,6 +1,6 @@
-Function(["path", "name"],
+Function(["path"],
   Package(
-    [ ("name", Var("name"))
+    [ ("name", "nar")
     , ("build", Relative("nar/nar.sh"))
     , ("path", Var("path"))
     ]
diff --git a/corepkgs/nar/nar.sh.in b/corepkgs/nar/nar.sh.in
index bffbbaf5e1..d216685537 100644
--- a/corepkgs/nar/nar.sh.in
+++ b/corepkgs/nar/nar.sh.in
@@ -1,5 +1,10 @@
 #! /bin/sh
 
 echo "packing $path into $out..."
-@bindir@/nix --dump --file "$path" | bzip2 > $out || exit 1
+mkdir $out || exit 1
+tmp=$out/tmp
+@bindir@/nix --dump --path "$path" | bzip2 > $out/tmp || exit 1
 
+md5=$(md5sum -b $tmp | cut -c1-32)
+if test $? != 0; then exit 1; fi
+mv $out/tmp $out/$md5-`basename $path`.nar.bz2 || exit 1