]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
polygen: if deterministic build is requested, use a well-known random seed
authorSimon McVittie <smcv@debian.org>
Tue, 9 Jun 2015 10:40:14 +0000 (11:40 +0100)
committerSimon McVittie <smcv@debian.org>
Tue, 9 Jun 2015 21:30:44 +0000 (22:30 +0100)
IkiWiki/Plugin/polygen.pm
debian/changelog

index 78e3611e1c1aa9a592ff6f156d3b796a01b9a5bd..8ce62b754fa6161c51d94b30e4957c6d9b1d38c9 100644 (file)
@@ -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 ($?) {
index 41a47e57fec75751205795284939102a2310453d..f7219d0f5427722811a39d2cd453209cf294f83b 100644 (file)
@@ -35,7 +35,7 @@ ikiwiki (3.20150330) UNRELEASED; urgency=medium
     if the link text is identical
   * Add a $config{deterministic} option and use it for the docwiki
   * haiku: if deterministic build is requested, return a hard-coded haiku
-  * If deterministic build is requested, return a hard-coded haiku
+  * polygen: if deterministic build is requested, use a well-known random seed
 
  -- Joey Hess <id@joeyh.name>  Tue, 28 Apr 2015 12:24:08 -0400