* A script to instantiate package descriptors from templates.
This commit is contained in:
parent
8999f923ea
commit
b3594e9eaf
1 changed files with 23 additions and 0 deletions
23
src/nix-instantiate
Executable file
23
src/nix-instantiate
Executable file
|
@ -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;
|
Loading…
Reference in a new issue