diff options
author | Simon McVittie <smcv@debian.org> | 2015-06-09 11:40:14 +0100 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2015-06-09 22:30:44 +0100 |
commit | 014b9eb1b7ae54eefe6fb7307c8f18242aea30a6 (patch) | |
tree | ff54a55578b4cc46eb1ea42bdd9945e98a084655 /IkiWiki | |
parent | 361076e55d329c0297b2ddf450003ee7ce210925 (diff) | |
download | ikiwiki-014b9eb1b7ae54eefe6fb7307c8f18242aea30a6.tar ikiwiki-014b9eb1b7ae54eefe6fb7307c8f18242aea30a6.tar.gz |
polygen: if deterministic build is requested, use a well-known random seed
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/polygen.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/polygen.pm b/IkiWiki/Plugin/polygen.pm index 78e3611e1..8ce62b754 100644 --- a/IkiWiki/Plugin/polygen.pm +++ b/IkiWiki/Plugin/polygen.pm @@ -28,6 +28,7 @@ sub preprocess (@) { my %params=@_; my $grammar = ($params{grammar} or 'polygen'); my $symbol = ($params{symbol} or undef); + my $options = ($config{deterministic} ? '-seed 42' : ''); # Sanitize parameters $grammar =~ IkiWiki::basename($grammar); @@ -51,10 +52,10 @@ sub preprocess (@) { my $res; if (defined $symbol) { - $res = `polygen -S $symbol $grmfile 2>/dev/null`; + $res = `polygen -S $symbol $options $grmfile 2>/dev/null`; } else { - $res = `polygen $grmfile 2>/dev/null`; + $res = `polygen $options $grmfile 2>/dev/null`; } if ($?) { |