CVS User Account cvsuser
Thu Sep 9 18:04:24 PDT 2004
Log Message:
-----------
1.  Added -*- perl -*- to perl scripts so Emacs recognizes them all

2.  Fixes to create_set.pl:

    - TABLE_ID starts at 1 if not specified
    - You're encouraged to set it otherwise in case you are defining
      a subsequent set that needs to start at another number
    - Code had been adding a namespace to the table _before_ finding
      the key; should grab the key first...

3.  slon.env now points to environment variables SLONYNODES and
    SLONYSET for further configuration

4.  subscribe_set.pl was handling the "can the node forward" option
    backwards.

Modified Files:
--------------
    slony1-engine/tools/altperl:
        build_env.pl (r1.3 -> r1.4)
        create_set.pl (r1.5 -> r1.6)
        drop_node.pl (r1.3 -> r1.4)
        failover.pl (r1.3 -> r1.4)
        init_cluster.pl (r1.3 -> r1.4)
        merge_sets.pl (r1.3 -> r1.4)
        move_set.pl (r1.2 -> r1.3)
        restart_node.pl (r1.2 -> r1.3)
        restart_nodes.pl (r1.1 -> r1.2)
        slon-tools.pm (r1.8 -> r1.9)
        slon.env (r1.4 -> r1.5)
        slon_kill.pl (r1.3 -> r1.4)
        slon_pushsql.pl (r1.2 -> r1.3)
        slon_start.pl (r1.4 -> r1.5)
        slon_watchdog.pl (r1.2 -> r1.3)
        subscribe_set.pl (r1.2 -> r1.3)
        uninstall_nodes.pl (r1.1 -> r1.2)
        update_nodes.pl (r1.1 -> r1.2)

-------------- next part --------------
Index: merge_sets.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/merge_sets.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -Ltools/altperl/merge_sets.pl -Ltools/altperl/merge_sets.pl -u -w -r1.3 -r1.4
--- tools/altperl/merge_sets.pl
+++ tools/altperl/merge_sets.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!perl # -*- perl -*-
 # $Id$
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
Index: create_set.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/create_set.pl,v
retrieving revision 1.5
retrieving revision 1.6
diff -Ltools/altperl/create_set.pl -Ltools/altperl/create_set.pl -u -w -r1.5 -r1.6
--- tools/altperl/create_set.pl
+++ tools/altperl/create_set.pl
@@ -31,7 +31,6 @@
 close OUTFILE;
 run_slonik_script($OUTPUTFILE);
 
-
 open (OUTFILE, ">$OUTPUTFILE");
 print OUTFILE genheader();
 
@@ -55,7 +54,9 @@
 
 ";
 
+if ($TABLE_ID < 1) {
 $TABLE_ID=1;
+}
 foreach my $table (@SERIALTABLES) {
   $table = ensure_namespace($table);
   print OUTFILE "
@@ -75,8 +76,8 @@
 }
 
 foreach my $table (keys %KEYEDTABLES) {
+  my $key = $KEYEDTABLES{$table};
   $table = ensure_namespace($table);
-  $key = $KEYEDTABLES{$table};
   print OUTFILE "
                 set add table (set id = $set, origin = 1, id = $TABLE_ID, full qualified name = '$table', key='$key', comment = 'Table $table with candidate primary key $key');
                 echo 'Add candidate primary keyed table $table';
@@ -119,3 +120,4 @@
   }
   return $object;
 }
+
Index: subscribe_set.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/subscribe_set.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -Ltools/altperl/subscribe_set.pl -Ltools/altperl/subscribe_set.pl -u -w -r1.2 -r1.3
--- tools/altperl/subscribe_set.pl
+++ tools/altperl/subscribe_set.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!perl # -*- perl -*-
 # $Id$
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
@@ -31,7 +31,7 @@
   if ($PARENT[$node]) {
     $parent = $PARENT[$node];
   }
-  if ($NOFORWARD[$node] eq "no") {
+  if ($NOFORWARD[$node] eq "yes") {
     $forward = "no";
   } else {
     $forward = "yes";
Index: init_cluster.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/init_cluster.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -Ltools/altperl/init_cluster.pl -Ltools/altperl/init_cluster.pl -u -w -r1.3 -r1.4
--- tools/altperl/init_cluster.pl
+++ tools/altperl/init_cluster.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!perl # -*- perl -*-
 # $Id$
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
@@ -14,7 +14,7 @@
 
 my ($dbname, $dbhost)=($DBNAME[1], $HOST[1]);
 print SLONIK "
-   init cluster (id = 1, comment = 'Node $dbname\@$dbhost');
+   init cluster (id = 1, comment = 'Node $node - $dbname\@$dbhost');
 ";
 close SLONIK;
 run_slonik_script($FILE);
@@ -82,7 +82,7 @@
 
 print SLONIK qq[
         echo 'Replication nodes prepared';
-        echo 'Please start the replication daemon on both systems';
+        echo 'Please start a slon replication daemon for each node';
 ];
 
 close SLONIK;
Index: slon.env
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/slon.env,v
retrieving revision 1.4
retrieving revision 1.5
diff -Ltools/altperl/slon.env -Ltools/altperl/slon.env -u -w -r1.4 -r1.5
--- tools/altperl/slon.env
+++ tools/altperl/slon.env
@@ -1,9 +1,10 @@
+#!perl # -*- perl -*-
 # $Id$
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
 
-if ($ENV{"SLONYENV"}) {
-  require $ENV{"SLONYENV"};
+if ($ENV{"SLONYNODES"}) {
+  require $ENV{"SLONYNODES"};
 } else {
   # Define environment locally...
   $SETNAME=flex2test;
@@ -30,7 +31,14 @@
   #  	 password=>'postgres', node=>6, parent=>3);
   # add_node(host => 'marge', dbname=>'flexnodee', port=>5532,user=>'postgres',
   #  	 password=>'postgres', node=>7, parent=>6, noforward=>'no');
+}
+
+if ($ENV{"SLONYSET"}) {
+  require $ENV{"SLONYSET"};
+} else {
 
+  # Table Numbering - controlled here...
+  $TABLE_ID=1;
   # These are the tables that already have primary keys, that therefore do
   # not need for Slony-I to add sequences/indices
   @PKEYEDTABLES=(
Index: slon_start.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/slon_start.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -Ltools/altperl/slon_start.pl -Ltools/altperl/slon_start.pl -u -w -r1.4 -r1.5
--- tools/altperl/slon_start.pl
+++ tools/altperl/slon_start.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!perl # -*- perl -*-
 # $Id$
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
Index: failover.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/failover.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -Ltools/altperl/failover.pl -Ltools/altperl/failover.pl -u -w -r1.3 -r1.4
--- tools/altperl/failover.pl
+++ tools/altperl/failover.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!perl # -*- perl -*-
 # $Id$
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
Index: restart_node.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/restart_node.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -Ltools/altperl/restart_node.pl -Ltools/altperl/restart_node.pl -u -w -r1.2 -r1.3
--- tools/altperl/restart_node.pl
+++ tools/altperl/restart_node.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!perl # -*- perl -*-
 # $Id$
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
Index: drop_node.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/drop_node.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -Ltools/altperl/drop_node.pl -Ltools/altperl/drop_node.pl -u -w -r1.3 -r1.4
--- tools/altperl/drop_node.pl
+++ tools/altperl/drop_node.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!perl # -*- perl -*-
 # $Id$
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
Index: slon-tools.pm
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/slon-tools.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -Ltools/altperl/slon-tools.pm -Ltools/altperl/slon-tools.pm -u -w -r1.8 -r1.9
--- tools/altperl/slon-tools.pm
+++ tools/altperl/slon-tools.pm
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!perl     # -*- perl -*-
 # $Id$
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
@@ -133,4 +133,7 @@
   print "Invoke slon: $cmd\n";
   system $cmd;
 }
+
+
+
 return 1;
Index: restart_nodes.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/restart_nodes.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -Ltools/altperl/restart_nodes.pl -Ltools/altperl/restart_nodes.pl -u -w -r1.1 -r1.2
--- tools/altperl/restart_nodes.pl
+++ tools/altperl/restart_nodes.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!perl # -*- perl -*-
 # $Id$
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
Index: slon_watchdog.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/slon_watchdog.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -Ltools/altperl/slon_watchdog.pl -Ltools/altperl/slon_watchdog.pl -u -w -r1.2 -r1.3
--- tools/altperl/slon_watchdog.pl
+++ tools/altperl/slon_watchdog.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!perl # -*- perl -*-
 # $Id$
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
Index: uninstall_nodes.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/uninstall_nodes.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -Ltools/altperl/uninstall_nodes.pl -Ltools/altperl/uninstall_nodes.pl -u -w -r1.1 -r1.2
--- tools/altperl/uninstall_nodes.pl
+++ tools/altperl/uninstall_nodes.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!perl # -*- perl -*-
 # $Id$
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
Index: move_set.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/move_set.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -Ltools/altperl/move_set.pl -Ltools/altperl/move_set.pl -u -w -r1.2 -r1.3
--- tools/altperl/move_set.pl
+++ tools/altperl/move_set.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!perl # -*- perl -*-
 # $Id$
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
Index: build_env.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/build_env.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -Ltools/altperl/build_env.pl -Ltools/altperl/build_env.pl -u -w -r1.3 -r1.4
--- tools/altperl/build_env.pl
+++ tools/altperl/build_env.pl
@@ -1,4 +1,4 @@
-#!perl
+#!perl    # -*- perl -*-
 # $Id$
 # Contributed by:
 # Joe Kalash
Index: slon_pushsql.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/slon_pushsql.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -Ltools/altperl/slon_pushsql.pl -Ltools/altperl/slon_pushsql.pl -u -w -r1.2 -r1.3
--- tools/altperl/slon_pushsql.pl
+++ tools/altperl/slon_pushsql.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!perl # -*- perl -*-
 # $Id$
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
Index: slon_kill.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/slon_kill.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -Ltools/altperl/slon_kill.pl -Ltools/altperl/slon_kill.pl -u -w -r1.3 -r1.4
--- tools/altperl/slon_kill.pl
+++ tools/altperl/slon_kill.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!perl # -*- perl -*-
 # $Id$
 # Kill all slon instances for the current setname
 # Author: Christopher Browne
Index: update_nodes.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/update_nodes.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -Ltools/altperl/update_nodes.pl -Ltools/altperl/update_nodes.pl -u -w -r1.1 -r1.2
--- tools/altperl/update_nodes.pl
+++ tools/altperl/update_nodes.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!perl # -*- perl -*-
 # $Id$
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada


More information about the Slony1-commit mailing list