summary refs log tree commit diff
path: root/src/nix-instantiate
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-03-20 16:52:30 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-03-20 16:52:30 +0000
commitb3594e9eaf2b80c7c585035c5538ee59c608688f (patch)
tree483522b60db1ed955fa9ae4c3273aa2455e17f1e /src/nix-instantiate
parent8999f923ea1a459b3e4d404745b001323647711a (diff)
downloadguix-b3594e9eaf2b80c7c585035c5538ee59c608688f.tar.gz
* A script to instantiate package descriptors from templates.
Diffstat (limited to 'src/nix-instantiate')
-rwxr-xr-xsrc/nix-instantiate23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/nix-instantiate b/src/nix-instantiate
new file mode 100755
index 0000000000..242bcfaf93
--- /dev/null
+++ b/src/nix-instantiate
@@ -0,0 +1,23 @@
+#! /usr/bin/perl -w
+
+my $descr = $ARGV[0];
+
+open DESCR, "< $descr";
+
+while (<DESCR>) {
+    chomp;
+
+    if (/^(\w+)\s*=\s*([\w\d\.\/-]+)\s*(\#.*)?$/) {
+	my $name = $1;
+	my $file = $2;
+	my $out = `md5sum $file`;
+	$out =~ /^([0-9a-f]+)\s/;
+	my $hash = $1;
+        print "$name = $hash\n";
+    } else {
+	print "$_\n";
+    }
+
+}
+
+close DESCR;