From b3594e9eaf2b80c7c585035c5538ee59c608688f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 20 Mar 2003 16:52:30 +0000 Subject: * A script to instantiate package descriptors from templates. --- src/nix-instantiate | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 src/nix-instantiate (limited to 'src/nix-instantiate') diff --git a/src/nix-instantiate b/src/nix-instantiate new file mode 100755 index 000000000000..242bcfaf9332 --- /dev/null +++ b/src/nix-instantiate @@ -0,0 +1,23 @@ +#! /usr/bin/perl -w + +my $descr = $ARGV[0]; + +open DESCR, "< $descr"; + +while () { + 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; -- cgit 1.4.1