Chris Browne cbbrowne at lists.slony.info
Thu Jul 5 13:52:08 PDT 2007
Update of /home/cvsd/slony1/slony1-engine/tools
In directory main.slony.info:/tmp/cvs-serv10795/tools

Modified Files:
	mkmediawiki.pl 
Log Message:
Add in [[Category:foo]] support for automagic indexing to mkmediawiki.pl script


Index: mkmediawiki.pl
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tools/mkmediawiki.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** mkmediawiki.pl	24 Jan 2007 15:43:01 -0000	1.1
--- mkmediawiki.pl	5 Jul 2007 20:52:06 -0000	1.2
***************
*** 29,33 ****
    "m|mailprog=s" => \$mailprog,
    "f|finalquery=s" => \$finalquery,
!   "r|recipient=s" => \$recipient);
  
  if (defined($help)) {
--- 29,34 ----
    "m|mailprog=s" => \$mailprog,
    "f|finalquery=s" => \$finalquery,
!   "r|recipient=s" => \$recipient,
!   "g|categories=s" => \$categories);
  
  if (defined($help)) {
***************
*** 161,164 ****
--- 162,166 ----
  }
  &mktblfooter();
+ &gencategories();
  
  sub gennodeline {
***************
*** 203,207 ****
      print $inerr, "\n";
    }
!   die "$0  --host --database --user --cluster --port=integer --password --recipient --mailprog\nnote also that libpq environment variables PGDATABASE, PGPORT, ... may also be passed in";
  }
  
--- 205,209 ----
      print $inerr, "\n";
    }
!   die "$0  --host --database --user --cluster --port=integer --password --recipient --mailprog --categories\nnote also that libpq environment variables PGDATABASE, PGPORT, ... may also be passed in";
  }
  
***************
*** 222,226 ****
  
  sub mktblfooter {
! print "|};\n\n";
  }
  
--- 224,228 ----
  
  sub mktblfooter {
! print "|}\n\n";
  }
  
***************
*** 260,261 ****
--- 262,273 ----
  ];
  }
+ 
+ # End off by splitting the --categories option into a comma-delimited
+ # list of categories and dropping them into place
+ sub gencategories {
+   if ($categories ne "") {
+     foreach my $cat (split(',', $categories)) {
+       print "[Category:${cat}]\n";
+     }
+   }
+ }



More information about the Slony1-commit mailing list