add basic support for incremental directories in printversion()

git-svn: trunk@2401
remotes/push_mirror/metadata
Tomasz Kojm 19 years ago
parent ae9e74c721
commit d12c1073d0
  1. 7
      clamav-devel/shared/misc.c

@ -49,6 +49,7 @@
#endif #endif
/* TODO: add support for incremental directories */
char *freshdbdir(void) char *freshdbdir(void)
{ {
struct cl_cvd *d1, *d2; struct cl_cvd *d1, *d2;
@ -90,20 +91,24 @@ char *freshdbdir(void)
return retdir; return retdir;
} }
/* TODO: add _proper_ support for incremental directories */
void print_version(void) void print_version(void)
{ {
char *dbdir; char *dbdir;
char *path; char *path;
struct cl_cvd *daily; struct cl_cvd *daily;
struct stat foo;
dbdir = freshdbdir(); dbdir = freshdbdir();
if(!(path = mmalloc(strlen(dbdir) + 11))) { if(!(path = mmalloc(strlen(dbdir) + 30))) {
free(dbdir); free(dbdir);
return; return;
} }
sprintf(path, "%s/daily.cvd", dbdir); sprintf(path, "%s/daily.cvd", dbdir);
if(stat(path, &foo) == -1)
sprintf(path, "%s/daily.inc/daily.info", dbdir);
free(dbdir); free(dbdir);
if((daily = cl_cvdhead(path))) { if((daily = cl_cvdhead(path))) {

Loading…
Cancel
Save