Update of /cvsroot/perfparse/_perfparse/db_tools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10918/db_tools
Modified Files:
convert.c
Log Message:
work not finished
Index: convert.c
===================================================================
RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** convert.c 1 Mar 2007 23:52:02 -0000 1.12
--- convert.c 4 Mar 2007 00:08:07 -0000 1.13
***************
*** 115,118 ****
--- 115,124 ----
{
char yesno;
+
+ char *sODBhost,*sODBuser,*sODBpass,*sODBdatabase,*sODBsocket;
+ int iODBport;
+ char *sNDBhost,*sNDBuser,*sNDBpass,*sNDBdatabase,*sNDBsocket;
+ int iNDBport;
+
printf(_("The database schema for perfparse changed dramatically. "));
printf(_("Changing the tables\nwould be too error-prone, so we decided to copy the data into a new database.\n"));
***************
*** 141,151 ****
printf(_("Database TCP Port:\t%d\n"),config_get_value_as_integer(CONFIG_ITEM_ID_DB_PORT));
printf(_("Database Unix Socket:\t%s\n"),config_get_value_as_string(CONFIG_ITEM_ID_DB_SOCKET));
! printf(_("\n\nAre these values for the old or new database? (o/n)"));
while((yesno=getchar())) {
! if(yesno == 'o' || yesno == 'n' )
break;
}
/*
--- 147,193 ----
printf(_("Database TCP Port:\t%d\n"),config_get_value_as_integer(CONFIG_ITEM_ID_DB_PORT));
printf(_("Database Unix Socket:\t%s\n"),config_get_value_as_string(CONFIG_ITEM_ID_DB_SOCKET));
! printf(_("\n\nAre these values for the old or the new database? (o/n) or none of both (x)?"));
while((yesno=getchar())) {
! if(yesno == 'o' || yesno == 'n' || yesno == 'x')
break;
}
+ // old database connection
+ if(yesno == 'o') { // copy connection information
+ sODBhost=config_get_value_as_string(CONFIG_ITEM_ID_DB_HOST);
+ sODBuser=config_get_value_as_string(CONFIG_ITEM_ID_DB_USER);
+ sODBpass=config_get_value_as_string(CONFIG_ITEM_ID_DB_PWD);
+ sODBdatabase=config_get_value_as_string(CONFIG_ITEM_ID_DB_DATABASE);
+ iODBport=config_get_value_as_integer(CONFIG_ITEM_ID_DB_PORT);
+ sODBsocket=config_get_value_as_string(CONFIG_ITEM_ID_DB_SOCKET);
+ } else { //ask user
+ printf(_("Please enter the connection data for the old database below:\n"));
+
+ sODBhost=malloc(65);
+ printf(_("Database Host: "));
+ fscanf(stdin,"%s64",sODBhost);
+
+ sODBuser=malloc(65);
+ printf(_("Database User: "));
+ fscanf(stdin,"%s64",sODBuser);
+
+ sODBpass=malloc(65);
+ printf(_("Database Password: "));
+ fscanf(stdin,"%s64",sODBpass);
+
+ sODBdatabase=malloc(65);
+ printf(_("Database Name: "));
+ fscanf(stdin,"%s64",sODBdatabase);
+
+ printf(_("Database Port: "));
+ fscanf(stdin,"%d",&iODBport);
+
+ sODBsocket=malloc(65);
+ printf(_("Database Socket: "));
+ fscanf(stdin,"%s64",sODBsocket);
+ }
+
+
/*
***************
*** 286,294 ****
// checkTables ();
- /*
- * Set to current:
- */
- version = DB_VERSION;
- setVersion (version);
/*
--- 328,331 ----
|