Browse code

ask for fl when building main.cvd

git-svn: trunk@2617

Tomasz Kojm authored on 2007/01/13 09:31:14
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sat Jan 13 01:28:09 CET 2007 (tk)
2
+---------------------------------
3
+  * sigtool: ask for fl when building main.cvd
4
+
1 5
 Sat Jan 13 01:01:40 CET 2007 (tk)
2 6
 ---------------------------------
3 7
   * clamdscan: add new option --multiscan, -m
... ...
@@ -487,7 +487,7 @@ static int build(struct optstruct *opt)
487 487
 {
488 488
 	int ret, inc = 1, dn;
489 489
 	size_t bytes;
490
-	unsigned int sigs = 0, oldsigs = 0, lines = 0, version, real_header;
490
+	unsigned int sigs = 0, oldsigs = 0, lines = 0, version, real_header, fl;
491 491
 	struct stat foo;
492 492
 	char buffer[FILEBUFF], *tarfile, *gzfile, header[513], smbuff[32],
493 493
 	     builder[32], *pt, *dbname, olddb[512], patch[32], broken[32];
... ...
@@ -542,10 +542,9 @@ static int build(struct optstruct *opt)
542 542
 		countlines("main.fp") + countlines("daily.fp");
543 543
 
544 544
 	if(lines != sigs) {
545
-	    mprintf("!build: Signatures in database: %d, loaded by libclamav: %d\n", lines, sigs);
546
-	    mprintf("!build: Please check the current directory and remove unnecessary databases\n");
547
-	    mprintf("!build: or install the latest ClamAV version.\n");
548
-	    return -1;
545
+	    mprintf("^build: Signatures in database: %d, loaded by libclamav: %d\n", lines, sigs);
546
+	    mprintf("^build: Please check the current directory and remove unnecessary databases\n");
547
+	    mprintf("^build: or install the latest ClamAV version.\n");
549 548
 	}
550 549
     }
551 550
 
... ...
@@ -602,7 +601,14 @@ static int build(struct optstruct *opt)
602 602
     strcat(header, smbuff);
603 603
 
604 604
     /* functionality level */
605
-    sprintf(smbuff, "%d:", cl_retflevel());
605
+    if(!strcmp(dbname, "main")) {
606
+	fflush(stdin);
607
+	mprintf("Functionality level: ");
608
+	scanf("%u", &fl);
609
+    } else {
610
+	fl = cl_retflevel();
611
+    }
612
+    sprintf(smbuff, "%u:", fl);
606 613
     strcat(header, smbuff);
607 614
 
608 615
     real_header = strlen(header);