|
From: Benjamin C. <bc...@us...> - 2001-09-15 16:22:55
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv15962
Modified Files:
configure configure_db
Log Message:
All together now
Index: configure
===================================================================
RCS file: /cvsroot/phpbt/phpbt/configure,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- configure 2001/09/15 15:49:42 1.10
+++ configure 2001/09/15 16:22:51 1.11
@@ -236,6 +236,7 @@
change_features
;;
Save)
+ # Change the constants in config.php, saving a backup
mv config.php config.php.bak
echo "/ENCRYPTPASS/s/[[:digit:]]/$ENCRYPTPASS/" > $tempfile
echo "/USE_JPGRAPH/s/[[:digit:]]/$USE_JPGRAPH/" >> $tempfile
@@ -253,8 +254,16 @@
echo "/DB_PASSWORD/s|, '.*'|, '$DB_PASS'|" >> $tempfile
echo "/TBL_PREFIX/s|, '.*'|, '$DB_TBL_PREFIX'|" >> $tempfile
sed -f $tempfile config.php.bak > config.php
+
+ # Change and run the configure_db script
+ cat configure_db | sed "
+ /TBL_PREFIX/s/'.*'/'$DB_TBL_PREFIX'/
+ /DB_TYPE/s/'.*'/'$DB_TYPE'/
+ " > configure_db
+ ./configure_db
+
$DIALOG --backtitle "phpBT Configuration" \
- --infobox "Your changes have been saved" 5 36
+ --msgbox "Your changes have been saved, and your database creation file is createdb.sql" 0 0
exit
;;
esac
Index: configure_db
===================================================================
RCS file: /cvsroot/phpbt/phpbt/configure_db,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- configure_db 2001/09/11 07:43:24 1.3
+++ configure_db 2001/09/15 16:22:51 1.4
@@ -4,7 +4,8 @@
# prefix for tablenames
#TBL_PREFIX="phpbt_"
-TBL_PREFIX=""
+TBL_PREFIX=''
+DB_TYPE='mysql'
#------------------------------------------------------------------------------
#parameters:
@@ -14,8 +15,9 @@
generate_sql() {
cat $1 | sed "
s/TBL_ATTACHMENT/${TBL_PREFIX}attachment/g
- s/TBL_BUG/${TBL_PREFIX}bug/g
+ s/TBL_BUG_GROUP/${TBL_PREFIX}bug_group/g
s/TBL_BUG_HISTORY/${TBL_PREFIX}bug_history/g
+ s/TBL_BUG/${TBL_PREFIX}bug/g
s/TBL_COMMENT/${TBL_PREFIX}comment/g
s/TBL_COMPONENT/${TBL_PREFIX}component/g
s/TBL_PROJECT/${TBL_PREFIX}project/g
@@ -31,7 +33,6 @@
s/TBL_USER_GROUP/${TBL_PREFIX}user_group/g
s/TBL_USER_PERM/${TBL_PREFIX}user_perm/g
s/TBL_GROUP_PERM/${TBL_PREFIX}group_perm/g
- s/TBL_BUG_GROUP/${TBL_PREFIX}bug_group/g
s/TBL_PROJECT_GROUP/${TBL_PREFIX}project_group/g
s/^#\ TEMPLATE:.*$/#/
s/^--\ TEMPLATE:.*$/--/
@@ -40,5 +41,4 @@
#------------------------------------------------------------------------------
-#generate_sql schemas/postgres.sql.in createdb.sql
-generate_sql schemas/mysql.sql.in createdb.sql
+generate_sql schemas/$DB_TYPE.in createdb.sql
|