Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 5894ae21 authored by rswindell's avatar rswindell

Added optional root directory element to lib_t definition.

- used to specify a physical parent directory for all logical directories in a
file library (convenient for CD-ROMs and other large directory configurations).
parent 807da4fe
......@@ -182,6 +182,11 @@ void prep_cfg(scfg_t* cfg)
strcpy(cfg->sub[i]->origline,cfg->origline);
}
for(i=0;i<cfg->total_libs;i++) {
if(cfg->lib[i]->root[0])
prep_dir(cfg->ctrl_dir, cfg->lib[i]->root);
}
for(i=0;i<cfg->total_dirs;i++) {
#ifdef __unix__
strlwr(cfg->dir[i]->code); /* temporary Unix-compatibility hack */
......@@ -193,7 +198,10 @@ void prep_cfg(scfg_t* cfg)
if(!cfg->dir[i]->path[0]) /* no file storage path specified */
sprintf(cfg->dir[i]->path,"%sdirs/%s/",cfg->data_dir,cfg->dir[i]->code);
prep_dir(cfg->ctrl_dir, cfg->dir[i]->path);
else if(cfg->lib[cfg->dir[i]->lib]->root[0])
prep_dir(cfg->lib[cfg->dir[i]->lib]->root, cfg->dir[i]->path);
else
prep_dir(cfg->ctrl_dir, cfg->dir[i]->path);
prep_path(cfg->dir[i]->upload_sem);
}
......
......@@ -302,8 +302,10 @@ BOOL read_file_cfg(scfg_t* cfg, char* error)
get_str(cfg->lib[i]->arstr,instream);
cfg->lib[i]->ar=arstr(NULL,cfg->lib[i]->arstr,cfg);
for(j=0;j<48;j++)
get_int(n,instream);
get_str(cfg->lib[i]->root,instream);
for(j=0;j<16;j++)
get_int(n,instream); /* 0xffff */
}
cfg->total_libs=i;
......
......@@ -779,9 +779,7 @@ BOOL DLLCALL write_file_cfg(scfg_t* cfg, int backup_level)
put_str(cfg->lib[i]->lname,stream);
put_str(cfg->lib[i]->sname,stream);
put_str(cfg->lib[i]->arstr,stream);
n=0;
for(j=0;j<32;j++)
put_int(n,stream);
put_str(cfg->lib[i]->root,stream);
n=(short)0xffff;
for(j=0;j<16;j++)
put_int(n,stream); }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment