public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: agk@sourceware.org
To: lvm2-cvs@sourceware.org
Subject: LVM2 ./WHATS_NEW scripts/lvmconf.sh
Date: Wed, 20 Sep 2006 17:36:00 -0000	[thread overview]
Message-ID: <20060920173648.30713.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-09-20 17:36:47

Modified files:
	.              : WHATS_NEW 
	scripts        : lvmconf.sh 

Log message:
	Separate --enable-cluster from locking lib options in lvmconf.sh.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.442&r2=1.443
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/lvmconf.sh.diff?cvsroot=lvm2&r1=1.3&r2=1.4

--- LVM2/WHATS_NEW	2006/09/19 20:20:40	1.442
+++ LVM2/WHATS_NEW	2006/09/20 17:36:47	1.443
@@ -1,5 +1,6 @@
 Version 2.02.11 - 
 =====================================
+  Separate --enable-cluster from locking lib options in lvmconf.sh.
   Add a missing comma in lvcreate man page.
 
 Version 2.02.10 - 19th September 2006
--- LVM2/scripts/lvmconf.sh	2005/08/16 20:38:33	1.3
+++ LVM2/scripts/lvmconf.sh	2006/09/20 17:36:47	1.4
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
 #
 # This file is part of the lvm2-cluster package.
 #
@@ -21,8 +21,9 @@
     echo "usage: $0 <command>"
     echo ""
     echo "Commands:"
-    echo "Enable clvm:  --enable-cluster --lockinglibdir <dir> [--lockinglib <lib>]"
+    echo "Enable clvm:  --enable-cluster [--lockinglibdir <dir>] [--lockinglib <lib>]"
     echo "Disable clvm: --disable-cluster"
+    echo "Set locking library: --lockinglibdir <dir> [--lockinglib <lib>]"
     echo ""
     echo "Global options:"
     echo "Config file location: --file <configfile>"
@@ -86,14 +87,13 @@
             exit 10
     fi
 
-    if [ -z "$LOCKING_TYPE" ]; then
+    if [ -z "$LOCKING_TYPE" ] && [ -z "$LOCKINGLIBDIR" ]; then
         usage
         exit 1
     fi
 
-    if [ "$LOCKING_TYPE" == "2" ]; then
+    if [ -n "$LOCKINGLIBDIR" ]; then
 
-        [ -z "$LOCKINGLIBDIR" ] && usage && exit 1    
         [ -z "$LOCKINGLIB" ] && LOCKINGLIB="liblvm2clusterlock.so"
             
         if [ "${LOCKINGLIBDIR:0:1}" != "/" ]
@@ -109,6 +109,10 @@
         fi
         
     fi
+
+    if [ "$LOCKING_TYPE" = "1" ] && [ -n "$LOCKINGLIBDIR" -o -n "$LOCKINGLIB" ]; then
+	echo "Superfluous locking lib parameter, ignoring"
+    fi
 }
 
 umask 0077
@@ -153,11 +157,19 @@
     fi
 fi
 
+if [ "$LOCKING_TYPE" = "2" ] && [ -z "$LOCKINGLIBDIR" ] && [ "$have_dir" = "1" ]; then
+	echo "no library_dir specified in $CONFIGFILE"
+	exit 16
+fi
+
 # So if we don't have "global {" we need to create one and 
 # populate it
 
 if [ "$have_global" = "1" ]
 then
+    if [ -z "$LOCKING_TYPE" ]; then
+	LOCKING_TYPE=1
+    fi
     if [ "$LOCKING_TYPE" = "2" ]; then
         cat $CONFIGFILE - <<EOF > $TMPFILE
 global {
@@ -180,14 +192,16 @@
     # locking entries as appropriate
     #
 
-    if [ "$have_type" = "0" ] 
-    then
-	SEDCMD=" s/^[[:blank:]]*locking_type[[:blank:]]*=.*/\ \ \ \ locking_type = $LOCKING_TYPE/g"
-    else
-	SEDCMD=" /global[[:blank:]]*{/a\ \ \ \ locking_type = $LOCKING_TYPE"
+    if [ -n "$LOCKING_TYPE" ]; then
+	if [ "$have_type" = "0" ] 
+	then
+	    SEDCMD=" s/^[[:blank:]]*locking_type[[:blank:]]*=.*/\ \ \ \ locking_type = $LOCKING_TYPE/g"
+	else
+	    SEDCMD=" /global[[:blank:]]*{/a\ \ \ \ locking_type = $LOCKING_TYPE"
+	fi
     fi
     
-    if [ "$LOCKING_TYPE" = "2" ]; then
+    if [ -n "$LOCKINGLIBDIR" ]; then
         if [ "$have_dir" = "0" ] 
             then
             SEDCMD="${SEDCMD}\ns'^[[:blank:]]*library_dir[[:blank:]]*=.*'\ \ \ \ library_dir = \"$LOCKINGLIBDIR\"'g"
@@ -201,7 +215,9 @@
         else
             SEDCMD="${SEDCMD}\n/global[[:blank:]]*{/a\ \ \ \ locking_library = \"$LOCKINGLIB\""
         fi
-    else
+    fi
+
+    if [ "$LOCKING_TYPE" = "1" ]; then
         # if we're not using cluster locking, remove the library dir and locking library name
         if [ "$have_dir" = "0" ] 
             then


                 reply	other threads:[~2006-09-20 17:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060920173648.30713.qmail@sourceware.org \
    --to=agk@sourceware.org \
    --cc=lvm2-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).