[Dbconfig-common-devel] dbconfig-common dbconfig-generate-include,1.5,1.6 dbconfig-generate-include.1,1.1,1.2
seanius@haydn.debian.org
seanius@haydn.debian.org
Update of /cvsroot/dbconfig-common/dbconfig-common
In directory haydn:/org/alioth.debian.org/chroot/home/users/seanius/tmp/cvs-serv7256
Modified Files:
dbconfig-generate-include dbconfig-generate-include.1
Log Message:
dbconfig-generate-include now respects the -O and -P (was -M) flags.
Index: dbconfig-generate-include
===================================================================
RCS file: /cvsroot/dbconfig-common/dbconfig-common/dbconfig-generate-include,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- dbconfig-generate-include 14 Mar 2005 06:26:38 -0000 1.5
+++ dbconfig-generate-include 24 Apr 2005 04:42:21 -0000 1.6
@@ -8,7 +8,7 @@
dbserver_varname="dbserver"
dbtype_varname="dbtype"
-VERSION="1.5"
+VERSION="1.6"
version(){
prog=`basename $0`
@@ -35,7 +35,7 @@
-u|--dbuser include the dbuser in the output
-t|--dbtype include the dbtype in the output
-O|--owner set the owner:group of the output file
- -M|--mask set the permissions on the output file
+ -P|--perms set the permissions on the output file
-U|--ucf register the outputfile with ucf
-h|--help display this helpful message
-v|--version output the version and exit
@@ -50,7 +50,7 @@
EOF
}
-TEMP=`getopt -o af:hd::p::u::s::t::O:M:Uv --long help,dbuser::,dbpass::,dbport::,dbserver::,dbtype::,output:,format:,owner:,mask:,ucf,version -n $0 -- "$@"`
+TEMP=`getopt -o af:hd::p::u::s::t::O:P:Uv --long help,dbuser::,dbpass::,dbport::,dbserver::,dbtype::,output:,format:,owner:,perms:,ucf,version -n $0 -- "$@"`
if [ $? != 0 ] ; then usage >&2 ; exit 1 ; fi
@@ -60,11 +60,6 @@
case "$1" in
-a|--all)
use_all="yes"
- use_dbuser="yes"
- use_dbpass="yes"
- use_dbname="yes"
- use_dbserver="yes"
- use_dbtype="yes"
shift
;;
-d|--dbname)
@@ -110,7 +105,7 @@
owner="$2"
shift 2
;;
- -M|--mask)
+ -P|--perms)
perms="$2"
shift 2
;;
@@ -137,7 +132,14 @@
esac
done
-
+# if they asked for all vars, or didn't ask for anything (which defaults to all)
+if [ "$use_all" ] || [ ! "$use_dbuser" -a ! "$use_dbpass" -a ! "$use_dbname" -a ! "$use_dbserver" -a ! "$use_dbtype" ]; then
+ use_dbuser="yes"
+ use_dbpass="yes"
+ use_dbname="yes"
+ use_dbserver="yes"
+ use_dbtype="yes"
+fi
inputfile=$1
outputfile=$2
@@ -277,4 +279,6 @@
else
mv "$tmpout" "$outputfile"
fi
+ [ "$owner" ] && chown $owner $outputfile
+ [ "$perms" ] && chmod $perms $outputfile
fi
Index: dbconfig-generate-include.1
===================================================================
RCS file: /cvsroot/dbconfig-common/dbconfig-common/dbconfig-generate-include.1,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- dbconfig-generate-include.1 14 Mar 2005 06:26:38 -0000 1.1
+++ dbconfig-generate-include.1 24 Apr 2005 04:42:21 -0000 1.2
@@ -3,7 +3,7 @@
dbconfig-generate-include \- generate custom format db include files
.SH SYNOPSIS
-.B dbconfig\-generate\-include [-hv] [-f format] [\-a] [\-d [varname]] [\-u [varname]] [\-p [varname]] [\-t [varname]] [\-O owner[:group]] [\-M perms] [\-U] infile [outfile]
+.B dbconfig\-generate\-include [-hv] [-f format] [\-a] [\-d [varname]] [\-u [varname]] [\-p [varname]] [\-t [varname]] [\-O owner[:group]] [\-P perms] [\-U] infile [outfile]
.br
.Xc
@@ -44,7 +44,7 @@
\fB\-O\fR|\-\-owner
set the owner:group of the output file
.TP
-\fB\-M\fR|\-\-mask
+\fB\-P\fR|\-\-perms
set the permissions on the output file
.TP
\fB\-U\fR|\-\-ucf