[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] Cluster Project branch, master, updated. gfs-kernel_0_1_22-121-gf278c0e



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=f278c0e58794894a504eb792d3ca436eab961e65

The branch, master has been updated
       via  f278c0e58794894a504eb792d3ca436eab961e65 (commit)
       via  0bdc0eddcc10a7bd81d5afa45de88420bd0deeae (commit)
       via  6a66b93f612ea0671702b7bedc95101643595509 (commit)
       via  41164823f8f6b6a6e0b4bad820bc7bc11e456879 (commit)
       via  f1ab76af7ab8a67278600cb5196e4dcfe47a8360 (commit)
       via  9db1bf64daef6ab7341b7f187d668e5536a374f2 (commit)
       via  a482403b1b85055e0cafad3d87302804ac33d9b9 (commit)
       via  528d4c6d0093581da0663bb6990e837372d20016 (commit)
       via  ba078f25df29f3de660df8e2721f1c2daedfd92b (commit)
       via  da29fbd9cbb2b56ac5f0fdbda0c7072e66016eee (commit)
      from  ce24486a968d36e3c7852ba02a38384929ca809a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f278c0e58794894a504eb792d3ca436eab961e65
Author: Fabio M. Di Nitto <fabbione fabbione net>
Date:   Tue Apr 1 22:53:09 2008 +0200

    [FENCE] Make sure to version and copyright all built files
    
    Like all fence agents, those info can be useful. Store them
    in the modules even if only the libs print them out.
    
    Signed-off-by: Fabio M. Di Nitto <fabbione fabbione net>

commit 0bdc0eddcc10a7bd81d5afa45de88420bd0deeae
Author: Fabio M. Di Nitto <fabbione fabbione net>
Date:   Tue Apr 1 22:50:28 2008 +0200

    [FENCE] Fix fencelib to pring version and copyright
    
    Signed-off-by: Fabio M. Di Nitto <fabbione fabbione net>

commit 6a66b93f612ea0671702b7bedc95101643595509
Author: Fabio M. Di Nitto <fabbione fabbione net>
Date:   Tue Apr 1 22:24:15 2008 +0200

    [BUILD] Enable build and install of experimental fence agents
    
    Signed-off-by: Fabio M. Di Nitto <fabbione fabbione net>

commit 41164823f8f6b6a6e0b4bad820bc7bc11e456879
Author: Fabio M. Di Nitto <fabbione fabbione net>
Date:   Tue Apr 1 22:18:12 2008 +0200

    [BUILD] Royal cleanup of the fence agents build system
    
    Collapse fenceperl and fencepy into fencebuild.
    
    fencebuild now use a much simpler and slightly more clever
    shell script scripts/fenceparse instead of scripts/define2var
    that was no longer used anywhere in the tree.
    
    update all the fence/agents/ Makefile to use fencebuild.mk.
    
    make fencebuild understand more than one target at a time.
    
    Signed-off-by: Fabio M. Di Nitto <fabbione fabbione net>

commit f1ab76af7ab8a67278600cb5196e4dcfe47a8360
Author: Fabio M. Di Nitto <fabbione fabbione net>
Date:   Tue Apr 1 22:09:53 2008 +0200

    [FENCE] Remove obsoleted fence_apc perl implementation
    
    Signed-off-by: Fabio M. Di Nitto <fabbione fabbione net>

commit 9db1bf64daef6ab7341b7f187d668e5536a374f2
Author: Fabio M. Di Nitto <fabbione fabbione net>
Date:   Tue Apr 1 22:09:17 2008 +0200

    [FENCE] Move apc_snmp README where it belongs
    
    Signed-off-by: Fabio M. Di Nitto <fabbione fabbione net>

commit a482403b1b85055e0cafad3d87302804ac33d9b9
Author: Fabio M. Di Nitto <fabbione fabbione net>
Date:   Tue Apr 1 22:07:55 2008 +0200

    [FENCE] Move apc_snmp README where it belongs
    
    Signed-off-by: Fabio M. Di Nitto <fabbione fabbione net>

commit 528d4c6d0093581da0663bb6990e837372d20016
Author: Fabio M. Di Nitto <fabbione fabbione net>
Date:   Tue Apr 1 11:46:29 2008 +0200

    [BUILD] add enable_experimental_fence_agents configure option
    
    Signed-off-by: Fabio M. Di Nitto <fabbione fabbione net>

commit ba078f25df29f3de660df8e2721f1c2daedfd92b
Author: Fabio M. Di Nitto <fabbione fabbione net>
Date:   Tue Apr 1 10:34:23 2008 +0200

    [BUILD] Add fencelibdir support
    
    The new fence agents share a common python library.
    
    Make it's location configurable at build time (default to /usr/lib/fence).
    
    Update all targets required to handle it.
    
    Update the agents accordingly.
    
    NOTE: you will need to re-run configure to propagate the new configuration
    option. The new agents are not used/build/installed yet. This will happen
    shortly.
    
    NOTE to packagers: the new library depends on pexpect.
    
    Signed-off-by: Fabio M. Di Nitto <fabbione fabbione net>

commit da29fbd9cbb2b56ac5f0fdbda0c7072e66016eee
Author: Fabio M. Di Nitto <fabbione fabbione net>
Date:   Tue Apr 1 06:59:30 2008 +0200

    [BUILD] Fix fenceperl and fencepy make snippets to allow multiple targets
    
    Signed-off-by: Fabio M. Di Nitto <fabbione fabbione net>

-----------------------------------------------------------------------

Summary of changes:
 Makefile                                       |    2 +-
 configure                                      |   15 +
 fence/agents/Makefile                          |    2 +-
 fence/agents/apc/Makefile                      |    9 +-
 fence/agents/apc/apc.py                        |    8 +-
 fence/agents/apc/fence_apc.pl                  |  469 ------------------------
 fence/agents/apc_snmp/Makefile                 |    2 +-
 fence/agents/{apc => apc_snmp}/README          |    0 
 fence/agents/baytech/Makefile                  |    2 +-
 fence/agents/bladecenter/Makefile              |    9 +-
 fence/agents/bladecenter/bladecenter.py        |    8 +-
 fence/agents/brocade/Makefile                  |    2 +-
 fence/agents/bullpap/Makefile                  |    2 +-
 fence/agents/cpint/Makefile                    |    2 +-
 fence/agents/drac/Makefile                     |    9 +-
 fence/agents/drac/drac5.py                     |    8 +-
 fence/agents/egenera/Makefile                  |    2 +-
 fence/agents/ibmblade/Makefile                 |    2 +-
 fence/agents/ilo/Makefile                      |    9 +-
 fence/agents/ilo/ilo.py                        |    8 +-
 fence/agents/{apc => lib}/Makefile             |   19 +-
 fence/agents/lib/{fencing.py => fencing.py.py} |   10 +-
 fence/agents/mcdata/Makefile                   |    2 +-
 fence/agents/rsa/Makefile                      |    2 +-
 fence/agents/rsb/Makefile                      |    2 +-
 fence/agents/sanbox2/Makefile                  |    2 +-
 fence/agents/scsi/Makefile                     |   32 +--
 fence/agents/vixel/Makefile                    |    2 +-
 fence/agents/vmware/Makefile                   |    2 +-
 fence/agents/wti/Makefile                      |    9 +-
 fence/agents/wti/wti.py                        |    8 +-
 fence/agents/xcat/Makefile                     |    2 +-
 fence/agents/zvm/Makefile                      |    2 +-
 make/clean.mk                                  |    2 +-
 make/defines.mk.input                          |    5 +-
 make/fencebuild.mk                             |   24 ++
 make/fenceperl.mk                              |   18 -
 make/fencepy.mk                                |   21 -
 make/install.mk                                |    4 +
 make/uninstall.mk                              |    3 +
 scripts/define2var                             |   71 ----
 scripts/fenceparse                             |   47 +++
 42 files changed, 209 insertions(+), 650 deletions(-)
 delete mode 100755 fence/agents/apc/fence_apc.pl
 rename fence/agents/{apc => apc_snmp}/README (100%)
 copy fence/agents/{apc => lib}/Makefile (70%)
 rename fence/agents/lib/{fencing.py => fencing.py.py} (97%)
 create mode 100644 make/fencebuild.mk
 delete mode 100644 make/fenceperl.mk
 delete mode 100644 make/fencepy.mk
 delete mode 100755 scripts/define2var
 create mode 100755 scripts/fenceparse

diff --git a/Makefile b/Makefile
index 7346272..63c03c3 100644
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ all: scripts ${SUBDIRS}
 
 # Fix scripts permissions
 scripts:
-	chmod 755 ${SRCDIR}/scripts/*.pl ${SRCDIR}/scripts/define2var
+	chmod 755 ${SRCDIR}/scripts/*.pl ${SRCDIR}/scripts/fenceparse
 
 ${SUBDIRS}:
 	[ -n "${without_$ }" ] || ${MAKE} -C $@ all
diff --git a/configure b/configure
index 7f97c1f..4be68df 100755
--- a/configure
+++ b/configure
@@ -81,6 +81,8 @@ my %options = (
 	confdir => \$confdir,
 	conffile => \$conffile,
 	fence_agents => \$fence_agents,
+	fencelibdir => \$fencelibdir,
+	enable_experimental_fence_agents => \$enable_experimental_fence_agents,
 	enable_xen => \$enable_xen,
 	somajor => \$somajor,
 	sominor => \$sominor,
@@ -151,6 +153,8 @@ my $err = &GetOptions (\%options,
 		    'sominor=s',
 		    'release_version=s',
 		    'fence_agents=s',
+		    'fencelibdir=s',
+		    'enable_experimental_fence_agents',
 		    'enable_xen',
 		    'without_ccs',
 		    'without_cman',
@@ -224,6 +228,8 @@ if ($help || !$err) {
   print "--xenlibdir=\tthe base directory for xen libraries.  (Default: {libdir})\n";
   print "--fence_agents=\tlist of fence agents to configure.  (Default: all)\n";
   print "\t\tUse --fence_agents=help for a list\n";
+  print "--fencelibdir=\tspecify directory where to install common fence python lib.  (Default: /usr/lib/fence)\n";
+  print "--enable_experimental_fence_agents\tEnable build and install of experimental fence agents.  (Default: no)\n";
   print "--enable_xen\tEnable building of Xen-specific pieces\n";
   print "--without_ccs\tDisable ccs building  (Default: enabled)\n";
   print "--without_cman\tDisable cman building  (Default: enabled)\n";
@@ -506,6 +512,12 @@ if (!$conffile) {
 if (!$fence_agents) {
   $fence_agents="all";
 }
+if (!$fencelibdir) {
+  $fencelibdir="/usr/lib/fence";
+}
+if (!$enable_experimental_fence_agents) {
+  $enable_experimental_fence_agents="";
+}
 if (!$enable_xen) {
   $enable_xen="";
 }
@@ -554,6 +566,7 @@ open (IFILE, "@args |");
 while (<IFILE>) {
   chomp;
   s|fence\/agents\/| |g;
+  s|lib ||g;
   $all_fence = $_;
 }
 close IFILE;
@@ -622,6 +635,8 @@ while (<IFILE>) {
   $_ =~ s/\ CONFDIR\@/$confdir/;
   $_ =~ s/\ CONFFILE\@/$conffile/;
   $_ =~ s/\ FENCE_AGENTS\@/$fence_agents/;
+  $_ =~ s/\ FENCELIBDIR\@/$fencelibdir/;
+  $_ =~ s/\ ENABLE_EXPERIMENTAL_FENCE_AGENTS\@/$enable_experimental_fence_agents/;
   $_ =~ s/\ ENABLE_XEN\@/$enable_xen/;
   $_ =~ s/\ DISABLE_CCS\@/$without_ccs/;
   $_ =~ s/\ DISABLE_CMAN\@/$without_cman/;
diff --git a/fence/agents/Makefile b/fence/agents/Makefile
index a349cea..c90dcb3 100644
--- a/fence/agents/Makefile
+++ b/fence/agents/Makefile
@@ -13,7 +13,7 @@
 
 include ../../make/defines.mk
 
-SUBDIRS = ${fence_agents}
+SUBDIRS = ${fence_agents} lib
 
 all: ${SUBDIRS}
 
diff --git a/fence/agents/apc/Makefile b/fence/agents/apc/Makefile
index 7292eb8..6d25dfe 100644
--- a/fence/agents/apc/Makefile
+++ b/fence/agents/apc/Makefile
@@ -11,7 +11,12 @@
 ###############################################################################
 ###############################################################################
 
+include ../../../make/defines.mk
+
 TARGET= fence_apc
 
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fencepy.mk
+ifdef enable_experimental_fence_agents
+TARGET += apc
+endif
+
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/apc/apc.py b/fence/agents/apc/apc.py
index bcea997..e26c2ca 100755
--- a/fence/agents/apc/apc.py
+++ b/fence/agents/apc/apc.py
@@ -13,9 +13,15 @@
 #####
 
 import sys, re, pexpect
-sys.path.append("../lib/")
+sys.path.append("@FENCELIBDIR@")
 from fencing import *
 
+#BEGIN_VERSION_GENERATION
+RELEASE_VERSION="New APC Agent - test release on steroids"
+REDHAT_COPYRIGHT=""
+BUILD_DATE="March, 2008"
+#END_VERSION_GENERATION
+
 def get_power_status(conn, options):
 	result = ""
 	try:
diff --git a/fence/agents/apc/fence_apc.pl b/fence/agents/apc/fence_apc.pl
deleted file mode 100755
index 7ab2060..0000000
--- a/fence/agents/apc/fence_apc.pl
+++ /dev/null
@@ -1,469 +0,0 @@
-#!/usr/bin/perl
-
-###############################################################################
-###############################################################################
-##
-##  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
-##  Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
-##  
-##  This copyrighted material is made available to anyone wishing to use,
-##  modify, copy, or redistribute it subject to the terms and conditions
-##  of the GNU General Public License v.2.
-##
-###############################################################################
-###############################################################################
-
-use Getopt::Std;
-use Net::Telnet ();
-
-# Get the program name from $0 and strip directory names
-$_=$0;
-s/.*\///;
-my $pname = $_;
-
-# Change these if the text returned by your equipment is different.
-# Test by running script with options -t -v and checking /tmp/apclog
-
-my $immediate = 'immediate'; # # Or 'delayed' - action string prefix on menu
-my $masterswitch = 'masterswitch plus '; # 'Device Manager' option to choose
-my $login_prompt = '/: /';
-my $cmd_prompt = '/> $/';
-
-my $max_open_tries = 3;      # How many telnet attempts to make.  Because the 
-                             # APC can fail repeated login attempts, this number
-                             # should be more than 1
-my $open_wait = 5;           # Seconds to wait between each telnet attempt
-my $telnet_timeout = 2;      # Seconds to wait for matching telent response
-my $debuglog = '/tmp/apclog';# Location of debugging log when in verbose mode
-$opt_o = 'reboot';           # Default fence action.  
-
-my $logged_in = 0;
-
-my $t = new Net::Telnet;
-
-
-
-# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and 
-# "#END_VERSION_GENERATION"  It is generated by the Makefile
-
-#BEGIN_VERSION_GENERATION
-$RELEASE_VERSION="";
-$REDHAT_COPYRIGHT="";
-$BUILD_DATE="";
-#END_VERSION_GENERATION
-
-sub usage 
-{
-	print "Usage:\n";
-	print "\n";
-	print "$pname [options]\n";
-	print "\n";
-	print "Options:\n";
-	print "  -a <ip>          IP address or hostname of MasterSwitch\n";
-	print "  -h               usage\n";
-	print "  -l <name>        Login name\n";
-	print "  -n <num>         Outlet number to change: [<switch>:]<outlet> \n";
-	print "  -o <string>      Action: Reboot (default), Off or On\n";
-	print "  -p <string>      Login password\n";
-	print "  -q               quiet mode\n";
-	print "  -T               Test mode (cancels action)\n";
-	print "  -V               version\n";
-	print "  -v               Log to file /tmp/apclog\n";
-	
-	exit 0;
-}
-
-sub fail
-{
-	($msg)= _;
-	print $msg."\n" unless defined $opt_q;
-
-	if (defined $t)
-	{
-		# make sure we don't get stuck in a loop due to errors
-		$t->errmode('return');  
-
-		logout() if $logged_in;
-		$t->close();
-	}
-	exit 1;
-}
-
-sub fail_usage
-{
-	($msg)= _;
-	print STDERR $msg."\n" if $msg;
-	print STDERR "Please use '-h' for usage.\n";
-	exit 1;
-}
-
-sub version
-{
-	print "$pname $RELEASE_VERSION $BUILD_DATE\n";
-	print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
-	exit 0;
-}
-
-
-sub login
-{
-	for (my $i=0; $i<$max_open_tries; $i++)
-	{
-		$t->open($opt_a);
-		($_) = $t->waitfor($login_prompt);
-  
-		# Expect 'User Name : ' 
-		if (! /name/i) {
-			$t->close();
-			sleep($open_wait);
-			next;        
-		}
-
-		$t->print($opt_l);
-		($_) = $t->waitfor($login_prompt);
-
-		# Expect 'Password  : ' 
-		if (! /password/i ) {
-			$t->close();
-			sleep($open_wait);
-			next;         
-		}
-  
-		# Send password
-		$t->print($opt_p);  
-
-		(my $dummy, $_) = $t->waitfor('/(>|(?i:user name|password)\s*:) /');
-		if (/> /)
-		{
-			$logged_in = 1;
-
-			# send newline to flush prompt
-			$t->print("");  
-
-			return;
-		}
-		else
-		{
-			fail "invalid username or password";
-		}
-	}
-	fail "failed: telnet failed: ". $t->errmsg."\n" 
-}
-
-# print_escape_char() -- utility subroutine for sending the 'Esc' character
-sub print_escape_char
-{
-	# The APC menu uses "<esc>" to go 'up' menues.  We must set
-	# the output_record_separator to "" so that "\n" is not printed
-	# after the "<esc>" character
-
-	$ors=$t->output_record_separator;
-	$t->output_record_separator("");
-	$t->print("\x1b"); # send escape
-	$t->output_record_separator("$ors");
-}
-
-
-# Determine if the switch is a working state.  Also check to make sure that 
-# the switch has been specified in the case that there are slave switches
-# present.  This assumes that we are at the main menu.
-sub identify_switch
-{
-
-	($_) = $t->waitfor($cmd_prompt);
-	print_escape_char();
-
-	# determine what type of switch we are dealling with
-	($_) = $t->waitfor($cmd_prompt);
-	if ( /Switched Rack PDU: Communication Established/i)
-	{
-		# No further test needed
-	}
-	elsif ( /MS plus 1 : Serial Communication Established/i )
-	{
-		if ( defined $switchnum )
-		{
-			$masterswitch = $masterswitch . $switchnum;
-		}
-		elsif ( /MS plus [^1] : Serial Communication Established/i )
-		{
-			fail "multiple switches detected.  'switch' must be defined.";
-		}
-		else
-		{
-			$switchnum = 1;
-		}
-	}
-	else
-	{
-		fail "APC is in undetermined state"
-	}	
-
-	# send a newline to cause APC to reprint the menu
-	$t->print("");
-}
-
-
-# Navigate through menus to the appropriate outlet control menu of the apc
-# MasterSwitch and 79xx series switches.  Uses multi-line (mostly) 
-# case-insensitive matches to recognise menus and works out what option number 
-# to select from each menu.
-sub navigate
-{
-	# Limit the ammount of menu depths to 20.  We should never be this deep
-	for(my $i=20; $i ; $i--)
-	{
-		# Get the new text from the menu
-		(($_) = $t->waitfor($cmd_prompt)) or next;
-
-		# Identify next option 
-		if ( 
-			# "Control Console", "1- Device Manager"
-			/--\s*control console.*(\d+)\s*-\s*device manager/is  ||
-
-			# 
-			# APC MasterSwitch Menus
-			#
-			# "Device Manager", "1- MasterSwitch plus 1"
-			/--\s*device manager.*(\d+)\s*-\s*$masterswitch/is ||
-
-			# "Device Manager", "1- Cluster Node 0   ON"
-			/--\s*(?:device manager|$masterswitch).*(\d+)\s*-\s+Outlet\s+$switchnum:$opt_n\D[^\n]*\s(?-i:ON|OFF)\*?\s/ism ||
-
-			# "MasterSwitch plus 1", "1- Outlet 1:1  Outlet #1  ON"
-			/--\s*$masterswitch.*(\d+)\s*-\s*Outlet\s+$switchnum:$opt_n\s[^\n]*\s(?-i:ON|OFF)\*?\s/ism ||
-	
-			# Administrator outlet control menu
-			/--\s*Outlet $switchnum:$opt_n\D.*(\d+)\s*-\s*outlet control\s*$switchnum:?$opt_n\D/ism || 
-
-
-			#
-			# APC 79XX Menus
-			#
-			# "3- Outlet Control/Configuration"
-			/--\s*device manager.*(\d+)\s*-\s*Outlet Control/is ||
-
-			# "Device Manager", "1- Cluster Node 0   ON"
-			/--\s*Outlet Control.*\s+?(\d+)\s*-\s+[^\n\r]*\s*Outlet\s+$opt_n\D[^\n]*\s(?-i:ON|OFF)\*?\s/ism ||
-
-			# Administrator Outlet Control menu
-			/--[^\n\r]*Outlet\s+$opt_n\D.*(\d+)\s*-\s*control\s*outlet\s+$opt_n\D/ism ||
-			/--[^\n\r]*Outlet\s+$opt_n\D.*(\d+)\s*-\s*control\s*outlet/ism
-		) {
-			$t->print($1);
-			next;
-		}
-
-		if (/.*Press ([^\n\r]+) to continue.*$/) {
-			$t->print("");
-			next;
-		}
-
-		# "Outlet Control X:N", "4- Immediate Reboot"
-		if ( /(\d+)\s*-\s*$immediate $opt_o/i || 
-                     /--\s*Control Outlet\D.*(\d+)\s*-\s*Immediate\s*$opt_o/is ) {
-			$t->print($1);
-			last;
-		}
-
-		fail "failed: unrecognised menu response\n";
-	}
-}
-
-
-sub logout 
-{
-	# send a newline to make sure that we refresh the menus 
-	# ($t->waitfor() can hang otherwise)
-	$t->print("");
-
-	# Limit the ammount of menu depths to 20.  We should never be this deep
-	for(my $i=20; $i ; $i--)
-	{
-
-		# Get the new text from the menu
-		($_) = $t->waitfor($cmd_prompt);
-
-		if ( 
-			# "Control Console", "4- Logout"	 
-			/--\s*control console.*(\d+)\s*-\s*Logout/is
-		) {
-			$t->print($1);
-			last;
-		}
-		else 
-		{
-			print_escape_char();
-			next;
-		}
-	}
-}
-
-
-sub action
-{
-	# "Enter 'YES' to continue or <ENTER> to cancel : "
-	($_) = $t->waitfor('/: /');
-	if (! /$immediate $opt_o.*outlet $opt_n\s.*YES.*to continue/si ) {
-		fail "failed: unrecognised $opt_o response\n";
-	}
-
-	# Test mode?
-	$t->print($opt_T?'NO':'YES');
-
-	# "Success", "Press <ENTER> to continue..." 
-	($_) = $t->waitfor('/continue/');
-	$t->print('');
-
-	if (defined $opt_T) {
-		logout(); 
-		print "success: test outlet $opt_n $opt_o\n" unless defined $opt_q; 
-		$t->close();
-
-		# Allow the APC some time to clean connection
-		# before next login.
-		sleep 1;
-
-		exit 0;
-	} elsif ( /Success/i ) {
-		logout();
-		print "success: outlet $opt_n $opt_o\n" unless defined $opt_q; 
-		$t->close();
-
-		# Allow the APC some time to clean connection
-		# before next login.
-		sleep 1;
-
-		exit 0;
-	} 
-
-	fail "failed: unrecognised action response\n";
-}
-
-
-sub get_options_stdin
-{
-	my $opt;
-	my $line = 0;
-	while( defined($in = <>) )
-	{
-		$_ = $in;
-		chomp;
-
-		# strip leading and trailing whitespace
-		s/^\s*//;
-		s/\s*$//;
-
-		# skip comments
-		next if /^#/;
-	
-		$line+=1;
-		$opt=$_;
-		next unless $opt;
-
-		($name,$val)=split /\s*=\s*/, $opt;
-
-		if ( $name eq "" )
-		{
-			print STDERR "parse error: illegal name in option $line\n";
-			exit 2;
-		} 
-		# DO NOTHING -- this field is used by fenced 
-		elsif ($name eq "agent" ) 
-		{
-		} 
-		elsif ($name eq "ipaddr" ) 
-		{
-			$opt_a = $val;
-		} 
-		elsif ($name eq "login" ) 
-		{
-			$opt_l = $val;
-		} 
-		elsif ($name eq "option" ) 
-		{
-			$opt_o = $val;
-		} 
-		elsif ($name eq "passwd" ) 
-		{
-			$opt_p = $val;
-		} 
-		elsif ($name eq "port" ) 
-		{
-			$opt_n = $val;
-		} 
-		elsif ($name eq "switch" ) 
-		{
-			$switchnum = $val;
-		} 
-		elsif ($name eq "test" ) 
-		{
-			$opt_T = $val;
-		} 
-		elsif ($name eq "verbose" ) 
-		{
-			$opt_v = $val;
-		} 
-	}
-}
-		
-
-sub telnet_error
-{
-	if ($t->errmsg ne "pattern match timed-out") {
-		fail "failed: telnet returned: ".$t->errmsg."\n";
-	} else {
-		$t->print("");
-	}
-}
-
-
-### MAIN #######################################################
-
-if (@ARGV > 0) {
-	getopts("a:hl:n:o:p:qTvV") || fail_usage ;
-	
-	usage if defined $opt_h;
-	version if defined $opt_V;
-
-	fail_usage "Unkown parameter." if (@ARGV > 0);
-
-	fail_usage "No '-a' flag specified." unless defined $opt_a;
-	fail_usage "No '-n' flag specified." unless defined $opt_n;
-	fail_usage "No '-l' flag specified." unless defined $opt_l;
-	fail_usage "No '-p' flag specified." unless defined $opt_p;
-	fail_usage "Unrecognised action '$opt_o' for '-o' flag"
-	unless $opt_o =~ /^(Off|On|Reboot)$/i;
-
-	if ( $opt_n =~ /(\d+):(\d+)/ ) {
-		$switchnum=($1);
-		$opt_n = ($2);
-	}
-} else {
-	get_options_stdin();
-
-	fail "failed: no IP address" unless defined $opt_a;
-	fail "failed: no plug number" unless defined $opt_n;
-	fail "failed: no login name" unless defined $opt_l;
-	fail "failed: no password" unless defined $opt_p;
-	fail "failed: unrecognised action: $opt_o"
-	unless $opt_o =~ /^(Off|On|Reboot)$/i;
-} 
-
-$t->timeout($telnet_timeout);
-$t->input_log($debuglog) if $opt_v;
-$t->errmode('return');  
-
-&login;
-
-&identify_switch;
-
-# Abort on failure beyond here
-$t->errmode(\&telnet_error);  
-
-&navigate;
-&action;
-
-exit 0;
-
-
diff --git a/fence/agents/apc_snmp/Makefile b/fence/agents/apc_snmp/Makefile
index 136bf11..8471db4 100644
--- a/fence/agents/apc_snmp/Makefile
+++ b/fence/agents/apc_snmp/Makefile
@@ -15,4 +15,4 @@ TARGET= fence_apc_snmp
 MIBRESOURCE= powernet369.mib
 
 include ../../../make/defines.mk
-include $(OBJDIR)/make/fencepy.mk
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/apc/README b/fence/agents/apc_snmp/README
similarity index 100%
rename from fence/agents/apc/README
rename to fence/agents/apc_snmp/README
diff --git a/fence/agents/baytech/Makefile b/fence/agents/baytech/Makefile
index 97c2a89..00cf95c 100644
--- a/fence/agents/baytech/Makefile
+++ b/fence/agents/baytech/Makefile
@@ -14,4 +14,4 @@
 TARGET= fence_baytech
 
 include ../../../make/defines.mk
-include $(OBJDIR)/make/fenceperl.mk
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/bladecenter/Makefile b/fence/agents/bladecenter/Makefile
index 4c4390c..98c54a0 100644
--- a/fence/agents/bladecenter/Makefile
+++ b/fence/agents/bladecenter/Makefile
@@ -11,7 +11,12 @@
 ###############################################################################
 ###############################################################################
 
+include ../../../make/defines.mk
+
 TARGET= fence_bladecenter
 
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fenceperl.mk
+ifdef enable_experimental_fence_agents
+TARGET += bladecenter
+endif
+
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/bladecenter/bladecenter.py b/fence/agents/bladecenter/bladecenter.py
index cbc7daa..675b921 100755
--- a/fence/agents/bladecenter/bladecenter.py
+++ b/fence/agents/bladecenter/bladecenter.py
@@ -14,9 +14,15 @@
 #####
 
 import sys, re, pexpect
-sys.path.append("../lib/")
+sys.path.append("@FENCELIBDIR@")
 from fencing import *
 
+#BEGIN_VERSION_GENERATION
+RELEASE_VERSION="New Bladecenter Agent - test release on steroids"
+REDHAT_COPYRIGHT=""
+BUILD_DATE="March, 2008"
+#END_VERSION_GENERATION
+
 def get_power_status(conn, options):
 	try:
 		node_cmd = "system:blade\[" + options["-n"] + "\]>"
diff --git a/fence/agents/brocade/Makefile b/fence/agents/brocade/Makefile
index bc008e4..5b58409 100644
--- a/fence/agents/brocade/Makefile
+++ b/fence/agents/brocade/Makefile
@@ -14,4 +14,4 @@
 TARGET= fence_brocade
 
 include ../../../make/defines.mk
-include $(OBJDIR)/make/fenceperl.mk
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/bullpap/Makefile b/fence/agents/bullpap/Makefile
index d4d0145..e303558 100644
--- a/fence/agents/bullpap/Makefile
+++ b/fence/agents/bullpap/Makefile
@@ -14,4 +14,4 @@
 TARGET= fence_bullpap
 
 include ../../../make/defines.mk
-include $(OBJDIR)/make/fenceperl.mk
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/cpint/Makefile b/fence/agents/cpint/Makefile
index dd001cd..e6fb49e 100644
--- a/fence/agents/cpint/Makefile
+++ b/fence/agents/cpint/Makefile
@@ -14,4 +14,4 @@
 TARGET= fence_cpint
 
 include ../../../make/defines.mk
-include $(OBJDIR)/make/fenceperl.mk
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/drac/Makefile b/fence/agents/drac/Makefile
index 390e210..f862d4b 100644
--- a/fence/agents/drac/Makefile
+++ b/fence/agents/drac/Makefile
@@ -11,7 +11,12 @@
 ###############################################################################
 ###############################################################################
 
+include ../../../make/defines.mk
+
 TARGET= fence_drac
 
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fenceperl.mk
+ifdef enable_experimental_fence_agents
+TARGET += drac5
+endif
+
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/drac/drac5.py b/fence/agents/drac/drac5.py
index 63012fc..a94c5f6 100755
--- a/fence/agents/drac/drac5.py
+++ b/fence/agents/drac/drac5.py
@@ -14,9 +14,15 @@
 #####
 
 import sys, re, pexpect
-sys.path.append("../lib/")
+sys.path.append("@FENCELIBDIR@")
 from fencing import *
 
+#BEGIN_VERSION_GENERATION
+RELEASE_VERSION="New Drac5 Agent - test release on steroids"
+REDHAT_COPYRIGHT=""
+BUILD_DATE="March, 2008"
+#END_VERSION_GENERATION
+
 def get_power_status(conn, options):
 	try:
 		conn.sendline("racadm serveraction powerstatus")
diff --git a/fence/agents/egenera/Makefile b/fence/agents/egenera/Makefile
index 7e15c87..c980b45 100644
--- a/fence/agents/egenera/Makefile
+++ b/fence/agents/egenera/Makefile
@@ -14,4 +14,4 @@
 TARGET= fence_egenera
 
 include ../../../make/defines.mk
-include $(OBJDIR)/make/fenceperl.mk
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/ibmblade/Makefile b/fence/agents/ibmblade/Makefile
index dfa1d5a..50053a1 100644
--- a/fence/agents/ibmblade/Makefile
+++ b/fence/agents/ibmblade/Makefile
@@ -14,4 +14,4 @@
 TARGET= fence_ibmblade
 
 include ../../../make/defines.mk
-include $(OBJDIR)/make/fenceperl.mk
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/ilo/Makefile b/fence/agents/ilo/Makefile
index eb51656..c0a0290 100644
--- a/fence/agents/ilo/Makefile
+++ b/fence/agents/ilo/Makefile
@@ -11,7 +11,12 @@
 ###############################################################################
 ###############################################################################
 
+include ../../../make/defines.mk
+
 TARGET= fence_ilo
 
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fenceperl.mk
+ifdef enable_experimental_fence_agents
+TARGET += ilo
+endif
+
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/ilo/ilo.py b/fence/agents/ilo/ilo.py
index 1f3e330..0db971b 100755
--- a/fence/agents/ilo/ilo.py
+++ b/fence/agents/ilo/ilo.py
@@ -13,9 +13,15 @@
 #####
 
 import sys, re, pexpect
-sys.path.append("../lib/")
+sys.path.append("@FENCELIBDIR@")
 from fencing import *
 
+#BEGIN_VERSION_GENERATION
+RELEASE_VERSION="New ILO Agent - test release on steroids"
+REDHAT_COPYRIGHT=""
+BUILD_DATE="March, 2008"
+#END_VERSION_GENERATION
+
 def get_power_status(conn, options):
 	try:
 		conn.send("POWER\r\n")
diff --git a/fence/agents/apc/Makefile b/fence/agents/lib/Makefile
similarity index 70%
copy from fence/agents/apc/Makefile
copy to fence/agents/lib/Makefile
index 7292eb8..4ef2edc 100644
--- a/fence/agents/apc/Makefile
+++ b/fence/agents/lib/Makefile
@@ -1,8 +1,8 @@
-###############################################################################
+##############################################################################
 ###############################################################################
 ##
-##  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
-##  Copyright (C) 2004 Red Hat, Inc.  All rights reserved.
+##  Copyright (C) 2008 Fabio M. Di Nitto <fabbione fabbione net
+##  All rights reserved.
 ##  
 ##  This copyrighted material is made available to anyone wishing to use,
 ##  modify, copy, or redistribute it subject to the terms and conditions
@@ -11,7 +11,14 @@
 ###############################################################################
 ###############################################################################
 
-TARGET= fence_apc
-
 include ../../../make/defines.mk
-include $(OBJDIR)/make/fencepy.mk
+
+ifdef enable_experimental_fence_agents
+
+TARGET= fencing.py
+
+FENCELIB= $(TARGET)
+
+include $(OBJDIR)/make/fencebuild.mk
+
+endif
diff --git a/fence/agents/lib/fencing.py b/fence/agents/lib/fencing.py.py
similarity index 97%
rename from fence/agents/lib/fencing.py
rename to fence/agents/lib/fencing.py.py
index 39d1285..2a9393c 100644
--- a/fence/agents/lib/fencing.py
+++ b/fence/agents/lib/fencing.py.py
@@ -8,6 +8,13 @@ import sys, getopt, time, os
 import pexpect, re
 import telnetlib
 
+## do not add code here.
+#BEGIN_VERSION_GENERATION
+RELEASE_VERSION="New fence lib agent - test release on steroids"
+REDHAT_COPYRIGHT=""
+BUILD_DATE="March, 2008"
+#END_VERSION_GENERATION
+
 POWER_TIMEOUT = 20
 SHELL_TIMEOUT = 3
 LOGIN_TIMEOUT = 5
@@ -226,7 +233,8 @@ def check_input(device_opt, opt):
 		sys.exit(0)
 
 	if options.has_key("-V"):
-		print "Version: 0.3 - 2008/03/19"
+		print RELEASE_VERSION, BUILD_DATE
+		print REDHAT_COPYRIGHT
 		sys.exit(0)
 
 	if options.has_key("-v"):
diff --git a/fence/agents/mcdata/Makefile b/fence/agents/mcdata/Makefile
index 453c176..91ca8d4 100644
--- a/fence/agents/mcdata/Makefile
+++ b/fence/agents/mcdata/Makefile
@@ -14,4 +14,4 @@
 TARGET= fence_mcdata
 
 include ../../../make/defines.mk
-include $(OBJDIR)/make/fenceperl.mk
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/rsa/Makefile b/fence/agents/rsa/Makefile
index 509a991..1d29063 100644
--- a/fence/agents/rsa/Makefile
+++ b/fence/agents/rsa/Makefile
@@ -14,4 +14,4 @@
 TARGET= fence_rsa
 
 include ../../../make/defines.mk
-include $(OBJDIR)/make/fencepy.mk
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/rsb/Makefile b/fence/agents/rsb/Makefile
index 3f9ddfe..e4db9d8 100644
--- a/fence/agents/rsb/Makefile
+++ b/fence/agents/rsb/Makefile
@@ -14,4 +14,4 @@
 TARGET= fence_rsb
 
 include ../../../make/defines.mk
-include $(OBJDIR)/make/fencepy.mk
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/sanbox2/Makefile b/fence/agents/sanbox2/Makefile
index 2c7340b..04696c8 100644
--- a/fence/agents/sanbox2/Makefile
+++ b/fence/agents/sanbox2/Makefile
@@ -14,4 +14,4 @@
 TARGET= fence_sanbox2
 
 include ../../../make/defines.mk
-include $(OBJDIR)/make/fenceperl.mk
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/scsi/Makefile b/fence/agents/scsi/Makefile
index f44886e..40491dd 100644
--- a/fence/agents/scsi/Makefile
+++ b/fence/agents/scsi/Makefile
@@ -10,35 +10,9 @@
 ###############################################################################
 ###############################################################################
 
-TARGET= fence_scsi
-
-SBINDIRT=$(TARGET) $(TARGET)_test
-INITDT= scsi_reserve
-
-all: $(TARGET) $(TARGET)_test
-
 include ../../../make/defines.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
 
+TARGET= fence_scsi fence_scsi_test
+INITDT= scsi_reserve
 
-$(TARGET):
-	: > $(TARGET)
-	awk "{print}(\$$1 ~ /#BEGIN_VERSION_GENERATION/){exit 0}" $(S)/$(TARGET).pl >> $(TARGET)
-	echo "\$$RELEASE_VERSION=\"${RELEASE_VERSION}\";" >> $(TARGET)
-	${DEF2VAR} ${SRCDIR}/config/copyright.cf perl REDHAT_COPYRIGHT >> $(TARGET)
-	echo "\$$BUILD_DATE=\"(built `date`)\";" >> $(TARGET)
-	awk -v p=0 "(\$$1 ~ /#END_VERSION_GENERATION/){p = 1} {if(p==1)print}" $(S)/$(TARGET).pl >> $(TARGET)
-	chmod +x $(TARGET)
-
-$(TARGET)_test: 
-	: > $(TARGET)_test
-	awk "{print}(\$$1 ~ /#BEGIN_VERSION_GENERATION/){exit 0}" $(S)/$(TARGET)_test.pl >> $(TARGET)_test
-	echo "\$$RELEASE_VERSION=\"${RELEASE_VERSION}\";" >> $(TARGET)_test
-	${DEF2VAR} ${SRCDIR}/config/copyright.cf perl REDHAT_COPYRIGHT >> $(TARGET)_test
-	echo "\$$BUILD_DATE=\"(built `date`)\";" >> $(TARGET)_test
-	awk -v p=0 "(\$$1 ~ /#END_VERSION_GENERATION/){p = 1} {if(p==1)print}" $(S)/$(TARGET)_test.pl >> $(TARGET)_test
-	chmod +x $(TARGET)_test
-
-clean: generalclean
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/vixel/Makefile b/fence/agents/vixel/Makefile
index 2bbc0fc..828f3ea 100644
--- a/fence/agents/vixel/Makefile
+++ b/fence/agents/vixel/Makefile
@@ -14,4 +14,4 @@
 TARGET= fence_vixel
 
 include ../../../make/defines.mk
-include $(OBJDIR)/make/fenceperl.mk
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/vmware/Makefile b/fence/agents/vmware/Makefile
index cdf42bb..6c2b911 100644
--- a/fence/agents/vmware/Makefile
+++ b/fence/agents/vmware/Makefile
@@ -14,4 +14,4 @@
 TARGET= fence_vmware
 
 include ../../../make/defines.mk
-include $(OBJDIR)/make/fenceperl.mk
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/wti/Makefile b/fence/agents/wti/Makefile
index 21716cc..3a59521 100644
--- a/fence/agents/wti/Makefile
+++ b/fence/agents/wti/Makefile
@@ -11,7 +11,12 @@
 ###############################################################################
 ###############################################################################
 
+include ../../../make/defines.mk
+
 TARGET= fence_wti
 
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fenceperl.mk
+ifdef enable_experimental_fence_agents
+TARGET += wti
+endif
+
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/wti/wti.py b/fence/agents/wti/wti.py
index 926d347..c118af3 100755
--- a/fence/agents/wti/wti.py
+++ b/fence/agents/wti/wti.py
@@ -13,9 +13,15 @@
 #####
 
 import sys, re, pexpect
-sys.path.append("../lib/")
+sys.path.append("@FENCELIBDIR@")
 from fencing import *
 
+#BEGIN_VERSION_GENERATION
+RELEASE_VERSION="New WTI Agent - test release on steroids"
+REDHAT_COPYRIGHT=""
+BUILD_DATE="March, 2008"
+#END_VERSION_GENERATION
+
 def get_power_status(conn, options):
 	try:
 		conn.send("/S"+"\r\n")
diff --git a/fence/agents/xcat/Makefile b/fence/agents/xcat/Makefile
index d45e0bd..6c1db95 100644
--- a/fence/agents/xcat/Makefile
+++ b/fence/agents/xcat/Makefile
@@ -14,4 +14,4 @@
 TARGET= fence_xcat
 
 include ../../../make/defines.mk
-include $(OBJDIR)/make/fenceperl.mk
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/zvm/Makefile b/fence/agents/zvm/Makefile
index 64cc46b..2094a2b 100644
--- a/fence/agents/zvm/Makefile
+++ b/fence/agents/zvm/Makefile
@@ -14,4 +14,4 @@
 TARGET= fence_zvm
 
 include ../../../make/defines.mk
-include $(OBJDIR)/make/fenceperl.mk
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/make/clean.mk b/make/clean.mk
index 68a0980..a8b9af6 100644
--- a/make/clean.mk
+++ b/make/clean.mk
@@ -1,5 +1,5 @@
 generalclean:
-	rm -rf *~* *.o *.a *.so *.so.* a.out *.po *.s *.d
+	rm -rf *~* *.o *.a *.so *.so.* a.out *.po *.s *.d *.pyc
 	rm -rf core core.* .depend cscope.* *.orig *.rej
 	rm -rf linux .*.o.cmd .*.ko.cmd *.mod.c .tmp_versions Module.symvers .*.o.d
 	rm -rf ${TARGET} ${TARGETS} ${TARGET}_test
diff --git a/make/defines.mk.input b/make/defines.mk.input
index 1e6f8df..1ea77f4 100644
--- a/make/defines.mk.input
+++ b/make/defines.mk.input
@@ -66,6 +66,8 @@ xenlibdir ?= @XENLIBDIR@
 virtincdir ?= @VIRTINCDIR@
 virtlibdir ?= @VIRTLIBDIR@
 fence_agents ?= @FENCE_AGENTS@
+fencelibdir ?= @FENCELIBDIR@
+enable_experimental_fence_agents ?= @ENABLE_EXPERIMENTAL_FENCE_AGENTS@
 enable_xen ?= @ENABLE_XEN@
 without_gnbd-kernel/src ?= @DISABLE_GNBD@
 without_gfs-kernel/src/gfs ?= @DISABLE_GFS@
@@ -87,5 +89,4 @@ CONFDIR= CONFDIR@
 CONFFILE= CONFFILE@
 
 UNINSTALL = @SRCDIR@/scripts/uninstall.pl
-DEF2VAR = @SRCDIR@/scripts/define2var
-
+FENCEPARSE = @SRCDIR@/scripts/fenceparse
diff --git a/make/fencebuild.mk b/make/fencebuild.mk
new file mode 100644
index 0000000..c0671e0
--- /dev/null
+++ b/make/fencebuild.mk
@@ -0,0 +1,24 @@
+ifndef FENCELIB
+SBINDIRT=$(TARGET)
+endif
+
+all: $(TARGET)
+
+include $(OBJDIR)/make/clean.mk
+include $(OBJDIR)/make/install.mk
+include $(OBJDIR)/make/uninstall.mk
+
+$(TARGET):
+	${FENCEPARSE} \
+		${SRCDIR}/config/copyright.cf REDHAT_COPYRIGHT \
+		${RELEASE_VERSION} \
+		$(S) $@ | \
+	sed \
+		-e 's# FENCELIBDIR@#${fencelibdir}#g' \
+		-e 's# MIBDIR@#${mibdir}#g' \
+		-e 's# SNMPBIN@#${snmpbin}#g' \
+	> $@
+
+	chmod +x $@
+
+clean: generalclean
diff --git a/make/fenceperl.mk b/make/fenceperl.mk
deleted file mode 100644
index 9c60726..0000000
--- a/make/fenceperl.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-SBINDIRT=$(TARGET)
-
-all: $(TARGET)
-
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-$(TARGET): 
-	: > $(TARGET)
-	awk "{print}(\$$1 ~ /#BEGIN_VERSION_GENERATION/){exit 0}" $(S)/$(TARGET).pl >> $(TARGET)
-	echo "\$$RELEASE_VERSION=\"${RELEASE_VERSION}\";" >> $(TARGET)
-	${DEF2VAR} ${SRCDIR}/config/copyright.cf perl REDHAT_COPYRIGHT >> $(TARGET)
-	echo "\$$BUILD_DATE=\"(built `date`)\";" >> $(TARGET)
-	awk -v p=0 "(\$$1 ~ /#END_VERSION_GENERATION/){p = 1} {if(p==1)print}" $(S)/$(TARGET).pl >> $(TARGET)
-	chmod +x $(TARGET)
-
-clean: generalclean
diff --git a/make/fencepy.mk b/make/fencepy.mk
deleted file mode 100644
index 7f58241..0000000
--- a/make/fencepy.mk
+++ /dev/null
@@ -1,21 +0,0 @@
-SBINDIRT=$(TARGET)
-
-all: $(TARGET)
-
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-$(TARGET):
-	: > $(TARGET)
-	awk "{print}(\$$1 ~ /#BEGIN_VERSION_GENERATION/){exit 0}" $(S)/$(TARGET).py >> $(TARGET)
-	echo "RELEASE_VERSION=\"${RELEASE_VERSION}\";" >> $(TARGET)
-	${DEF2VAR} ${SRCDIR}/config/copyright.cf sh REDHAT_COPYRIGHT >> $(TARGET)
-	echo "BUILD_DATE=\"(built `date`)\";" >> $(TARGET)
-	awk -v p=0 "(\$$1 ~ /#END_VERSION_GENERATION/){p = 1} {if(p==1)print}" $(S)/$(TARGET).py >> $(TARGET)
-	chmod +x $(TARGET)
-ifdef MIBRESOURCE
-	sed -i -e 's# MIBDIR@#${mibdir}#g' -e 's# SNMPBIN@#${snmpbin}#g' $(TARGET)
-endif
-
-clean: generalclean
diff --git a/make/install.mk b/make/install.mk
index 6c43538..6260e50 100644
--- a/make/install.mk
+++ b/make/install.mk
@@ -51,3 +51,7 @@ ifdef MIBRESOURCE
 	install -d ${mibdir}
 	install -m644 $(S)/${MIBRESOURCE} ${mibdir}
 endif
+ifdef FENCELIB
+	install -d ${DESTDIR}/${fencelibdir}
+	install -m644 $(S)/${FENCELIB} ${DESTDIR}/${fencelibdir}
+endif
diff --git a/make/uninstall.mk b/make/uninstall.mk
index 544ec68..e6211c6 100644
--- a/make/uninstall.mk
+++ b/make/uninstall.mk
@@ -32,3 +32,6 @@ endif
 ifdef MIBRESOURCE
 	${UNINSTALL} ${MIBRESOURCE} ${mibdir}
 endif
+ifdef FENCELIB
+	${UNINSTALL} ${FENCELIB}* ${DESTDIR}/${fencelibdir}
+endif
diff --git a/scripts/define2var b/scripts/define2var
deleted file mode 100755
index 6f0ef5b..0000000
--- a/scripts/define2var
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/usr/bin/perl
-
-###############################################################################
-###############################################################################
-##
-##  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
-##  Copyright (C) 2004 Red Hat, Inc.  All rights reserved.
-##  
-##  This copyrighted material is made available to anyone wishing to use,
-##  modify, copy, or redistribute it subject to the terms and conditions
-##  of the GNU General Public License v.2.
-##
-###############################################################################
-###############################################################################
-
-##
-## This script will pull out #define's and convert them into variables that
-## can be used for shell or perl scripts.
-##
-## It takes 2 or 3 parameters.  The first parameter is the filename to search
-## in.  The second paramter is the desired output format.  Supported types
-## ar sh and perl.  An optional third parameter may be given.  If specified,
-## only that partiucular #define will be extracted, otherwise, all #defines
-## are extracted.   This script is not capable of handling condiitional rules.
-## 
-
-$usage = "usage: define2var <filename> <perl|sh> [define]";
-
-if (@ARGV != 2 && @ARGV != 3)
-{
-	die "$usage\n";	
-}
-
-my ($filename, $type, $define ) = @ARGV;
-my $pfx,$sfx;
-
-if ($type eq "sh") 
-{ 
-	($pfx,$sfx) = ("",""); i
-} 
-elsif ($type eq "perl" ) 
-{ 
-	($pfx,$sfx) = ("\$",";"); 
-}
-else 
-{ 
-	die "Unknown type: $type\n"; 
-}
-
-open FILE, "< $filename" or die "error opening $filename: $!\n";
-
-while (<FILE>)
-{
-	chomp;
-	if ($_ =~ /^#define\s+(\S+)\s+(.*)/)
-	{
-		if(! $define ) 
-		{
-			print "$pfx$1=$2$sfx\n";
-		}
-		elsif ($define eq $1 )
-		{
-			print "$pfx$1=$2$sfx\n";
-			exit 0;
-		}
-	}
-}
-
-die "\"$define\" not found\n" if ($define);
-
-exit 0;
diff --git a/scripts/fenceparse b/scripts/fenceparse
new file mode 100755
index 0000000..de2ec7a
--- /dev/null
+++ b/scripts/fenceparse
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+###############################################################################
+###############################################################################
+##
+##  Copyright (C) 2008 Fabio M. Di Nitto <fabbione fabbione net>
+##  
+##  This copyrighted material is made available to anyone wishing to use,
+##  modify, copy, or redistribute it subject to the terms and conditions
+##  of the GNU General Public License v.2.
+##
+###############################################################################
+###############################################################################
+
+set -e
+
+definefile="$1"
+define="$2"
+release="$3"
+srcdir="$4"
+infile="$5"
+
+definedata="$(cat $definefile | grep "^\#define $define" | sed -e 's/.*'$define' //')"
+
+realinfile="$(ls $srcdir/$infile.*)"
+
+interpreter="$(cat $realinfile | head -n 1 | awk -F "/" '{print $NF}')"
+interpreter="$(echo $interpreter)"
+
+case "$interpreter" in
+	perl)
+		start="\$"
+		end=";"
+	;;
+	*)
+		start=""
+		end=""
+	;;
+esac
+
+awk "{print}(\$1 ~ /#BEGIN_VERSION_GENERATION/){exit 0}" $realinfile
+echo ${start}RELEASE_VERSION=\"${release}\"${end}
+echo ${start}REDHAT_COPYRIGHT=${definedata}${end}
+echo ${start}BUILD_DATE=\"\(built $(date)\)\"${end}
+awk -v p=0 "(\$1 ~ /#END_VERSION_GENERATION/){p = 1} {if(p==1)print}" $realinfile
+
+exit 0


hooks/post-receive
--
Cluster Project


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]