serv_upgrade.c: cosmetic changes
authorArt Cancro <ajc@citadel.org>
Sun, 1 Nov 1998 23:48:12 +0000 (23:48 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 1 Nov 1998 23:48:12 +0000 (23:48 +0000)
citadel/ChangeLog
citadel/database.c
citadel/serv_upgrade.c

index 282b119b5c8c32e924bec6896fedfc7c586a8b1a..7dc1e8edc9305ab24035c9815ab9ffcae2770069 100644 (file)
@@ -1,3 +1,6 @@
+Sun Nov  1 18:47:42 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+       * serv_upgrade.c: cosmetic changes
+
 1998-11-01 Nathan Bryant <bryant@cs.usm.maine.edu>
        * serv_upgrade.c: warning fixes
 
index b7127fca5dcacfabc1ed84f4d0fa2bf9b8552fb3..8b0943c3dc7b674c592c402e0010537420988a42 100644 (file)
@@ -135,7 +135,7 @@ void close_databases(void) {
        /* Hmm... we should decide when would be a good time to defrag.
         * Server shutdowns might be an opportune time.
         */
-       defrag_databases();
+       /* defrag_databases(); */
 
        for (a=0; a<MAXCDB; ++a) {
                lprintf(7, "Closing database %d\n", a);
index 8750bbc1105e1b3111f5735a0c3effecccc2c4a8..2af8accd86fa889c0694b08035441b162f87f529 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * This module imports an "unpacked" system.  The unpacked data may come from
+ * an older version of Citadel, or a different hardware architecture, or
+ * whatever.  You should only run an import when your installed system is
+ * brand new and _empty_ !!
+ */
+
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -31,16 +38,15 @@ FILE *imfp;
 #define MODULE_AUTHOR  "Art Cancro"
 #define MODULE_EMAIL   "ajc@uncnsrd.mt-kisco.ny.us"
 #define MAJOR_VERSION  0
-#define MINOR_VERSION  2
+#define MINOR_VERSION  3
 
 static struct DLModule_Info info = {
-  MODULE_NAME,
-  MODULE_AUTHOR,
-  MODULE_EMAIL,
-  MAJOR_VERSION,
-  MINOR_VERSION
-};
-
+       MODULE_NAME,
+       MODULE_AUTHOR,
+       MODULE_EMAIL,
+       MAJOR_VERSION,
+       MINOR_VERSION
+       };
 
 
 
@@ -143,7 +149,7 @@ void imp_rooms(void) {
 
                                if (!strcasecmp(tag, "qrname")) {
                                        strcpy(qr.QRname, tval);
-                                       lprintf(9, "<%s>", qr.QRname);
+                                       lprintf(9, "<%s> ", qr.QRname);
                                        }
                                if (!strcasecmp(tag, "qrpasswd"))
                                        strcpy(qr.QRpasswd, tval);
@@ -162,7 +168,6 @@ void imp_rooms(void) {
                                if (!strcasecmp(tag, "qrfloor"))
                                        qr.QRfloor = atoi(tval);
                                if (!strcasecmp(tag, "message")) {
-                                       lprintf(9, ".");
                                        fpgetfield(imfp, tval);
                                        msgnum = atol(tval);
                                        fpgetfield(imfp, tval);
@@ -176,7 +181,7 @@ void imp_rooms(void) {
 
                                }
 
-                       lprintf(9, "\n");
+                       lprintf(9, "(%d messages)\n", num_msgs);
                        if ((roomnum!=1)&&(qr.QRflags&QR_INUSE)) {
                                putroom(&qr, qr.QRname);
                                }
@@ -204,14 +209,13 @@ void imp_rooms(void) {
 
 
 
-
-
 void import_a_user(void) {
        char key[256], value[256];
        char vkey[256], vvalue[256];
        struct usersupp us;
        struct quickroom qr;
        struct visit vbuf;
+       int visits = 0;
 
        bzero(&us, sizeof(struct usersupp));    
        while(fpgetfield(imfp, key), strcasecmp(key, "enduser")) {
@@ -237,7 +241,7 @@ void import_a_user(void) {
                        us.posted = atoi(value);
                if (!strcasecmp(key, "fullname")) {
                        strcpy(us.fullname, value);
-                       lprintf(9, "User <%s>", us.fullname);
+                       lprintf(9, "User <%s> ", us.fullname);
                        }
                if (!strcasecmp(key, "axlevel"))
                        us.axlevel = atoi(value);
@@ -245,8 +249,10 @@ void import_a_user(void) {
                        us.USscreenwidth = atoi(value);
                if (!strcasecmp(key, "usscreenheight"))
                        us.USscreenheight = atoi(value);
-               if (!strcasecmp(key, "usernum"))
+               if (!strcasecmp(key, "usernum")) {
                        us.usernum = atol(value);
+                       lprintf(9, "<#%ld> ", us.usernum);
+                       }
                if (!strcasecmp(key, "lastcall"))
                        us.lastcall = atol(value);
                if (!strcasecmp(key, "usname"))
@@ -264,7 +270,7 @@ void import_a_user(void) {
                if (!strcasecmp(key, "usemail"))
                        strcpy(us.USemail, value);
                if (!strcasecmp(key, "visit")) {
-                       lprintf(9,"v");
+                       ++visits;
                        bzero(&vbuf, sizeof(struct visit));
                        bzero(&qr, sizeof(struct quickroom));
                        while(fpgetfield(imfp, vkey),
@@ -287,7 +293,7 @@ void import_a_user(void) {
        
        putuser(&us, us.fullname);
 
-       lprintf(9, "\n");
+       lprintf(9, "(%d rooms)\n", visits);
        }
 
 
@@ -301,7 +307,6 @@ void imp_usersupp(void) {
                else {
                        strcpy(value, "");
                        }
-               lprintf(9, " %s = %s\n", key, value);
 
                if (!strcasecmp(key, "user")) {
                        import_a_user();
@@ -310,9 +315,6 @@ void imp_usersupp(void) {
        }
 
 
-
-
-
 void imp_globals(void) {
        char key[256], value[256];
 
@@ -460,13 +462,17 @@ void do_import(char *argbuf) {
                }
 
        import_databases();
-       cprintf("%d ok\n", OK);
+       lprintf(9, "Defragmenting databases (this may take a while)...\n");
+       defrag_databases();
+       lprintf(1, "Import is finished.  Shutting down Citadel...\n");
+       cprintf("%d Import finished.  Shutting down Citadel...\n", OK);
+       master_cleanup();
        }
 
 
 struct DLModule_Info *Dynamic_Module_Init(void) {
        CtdlRegisterProtoHook(do_import,
                                "IMPO",
-                               "Import an unpacked Cit5");
+                               "Import an unpacked system");
        return &info;
        }