[SM-Commit] PERFORCE change 80614 by Jason Flatt for review

Perforce Review Daemon p4review at smee.org
Tue Jun 13 17:15:01 EDT 2006


Change 80614 by jason_flatt at jason-jason on 2006/06/13 22:14:05

	Add code to work w/a MySQL installation that has a password set for
	root, and add FINAL (did not make it in a previous submission).

Affected files ...

... //sgl/grimoires/devel/collab/drupal/CONFIGURE#7 edit
... //sgl/grimoires/devel/collab/drupal/FINAL#1 add
... //sgl/grimoires/devel/collab/drupal/HISTORY#15 edit
... //sgl/grimoires/devel/collab/drupal/INSTALL#7 edit

Differences ...

==== //sgl/grimoires/devel/collab/drupal/CONFIGURE#7 (xtext) ====

@@ -18,12 +18,13 @@
 
 if  [  "${DRUPAL_INSTALLED}"  ==  "n"  ]
 then
-  persistent_add  DRUPAL_CREATEDB  DRUPAL_CONFIGURE                                                              &&
+  persistent_add  DRUPAL_CREATEDB  DRUPAL_CONFIGURE  MYSQL_PASSWORD                                              &&
 
   message  "${MESSAGE_COLOR}The MySQL daemon needs to be running to create the database${DEFAULT_COLOR}"         &&
   if  query  "Create the Drupal database?"  n
   then
-    DRUPAL_CREATEDB="y"
+    DRUPAL_CREATEDB="y"                                                                                          &&
+    query_string  MYSQL_PASSWORD  "What is the MySQL password for root (needed to create the database)? If there is no password, just press enter. "  ""
   else
     DRUPAL_CREATEDB="n"
   fi                                                                                                             &&

==== //sgl/grimoires/devel/collab/drupal/HISTORY#15 (text) ====

@@ -1,9 +1,12 @@
 2006-06-13 Jason Flatt <jflatt at sourcemage.org>
 	* CONFIGURE: Added check for existing install that was in PREPARE.
+	  Added a query for MySQL's root password. 
 	* FINAL: Added check for Drupal version before displaying message.
+	  Added persistent_remove to not keep the MySQL password lying around.
 	* INSTALL: Modified the parts that create the database and modify the
 	  settings.php file to take into account the two Drupal versions and
 	  the two possible database choices.
+	  Added the password to the MySQL database activities.
 	* PREPARE: Changed the order for version install so that the more
 	  current version is the default.
 	  Removed warning and automatic exit so spell will complete it's cast

==== //sgl/grimoires/devel/collab/drupal/INSTALL#7 (xtext) ====

@@ -4,12 +4,12 @@
   if  [  "${DRUPAL_CREATEDB}"  ==  "y"  ];  then
     case  "${DRUPAL_DATABASE_ENGINE}"  in
       mysql)
-        message  "${MESSAGE_COLOR}Creating MySQL database...${DEFAULT_COLOR}"
-        mysqladmin  create  ${DRUPAL_DATABASE_NAME}                                                            &&
+        message  "${MESSAGE_COLOR}Creating and updating MySQL database...${DEFAULT_COLOR}"
+        mysqladmin  --password=${MYSQL_PASSWORD}  create  ${DRUPAL_DATABASE_NAME}                              &&
         echo  "GRANT ALL PRIVILEGES ON ${DRUPAL_DATABASE_NAME}.*                                               \
               TO ${DRUPAL_DATABASE_USER}@${DRUPAL_DATABASE_HOST} IDENTIFIED BY '${DRUPAL_DATABASE_PASSWORD}';  \
               flush privileges;                                                                                \
-              \q "  |  mysql  ${DRUPAL_DATABASE_NAME}                                                          &&
+              \q "  |  mysql  --password=${MYSQL_PASSWORD}  --database=${DRUPAL_DATABASE_NAME}                 &&
         #
         # Return true as this will fail if the database already exists
         #
@@ -17,12 +17,12 @@
           if  [  "`mysql -V | cut -d" " -f6 | cut -d"." -f1`"  >   "4"  ]   ||
               [  "`mysql -V | cut -d" " -f6 | cut -d"." -f1`"  ==  "4"  ]   &&
               [  "`mysql -V | cut -d" " -f6 | cut -d"." -f2`"  >   "0"  ];  then
-            mysql  ${DRUPAL_DATABASE_NAME}  <  database/database.4.1.mysql  ||  true
+            mysql  --password=${MYSQL_PASSWORD}  ${DRUPAL_DATABASE_NAME}  <  database/database.4.1.mysql  ||  true
           else
-            mysql  ${DRUPAL_DATABASE_NAME}  <  database/database.4.0.mysql  ||  true
+            mysql  --password=${MYSQL_PASSWORD}  ${DRUPAL_DATABASE_NAME}  <  database/database.4.0.mysql  ||  true
           fi
         else
-          mysql  ${DRUPAL_DATABASE_NAME}  <  database/database.mysql  ||  true
+          mysql  --password=${MYSQL_PASSWORD}  ${DRUPAL_DATABASE_NAME}  <  database/database.mysql  ||  true
         fi
         ;;
 



More information about the SM-Commit mailing list