This commit is contained in:
simon987 2020-07-18 19:23:43 -04:00
parent d0325fd9b9
commit c061613302
7 changed files with 23 additions and 6 deletions

View File

@ -41,6 +41,9 @@ void scan_args_destroy(scan_args_t *args) {
if (args->name != NULL) { if (args->name != NULL) {
free(args->name); free(args->name);
} }
if (args->incremental != NULL) {
free(args->incremental);
}
if (args->path != NULL) { if (args->path != NULL) {
free(args->path); free(args->path);
} }
@ -79,7 +82,7 @@ int scan_args_validate(scan_args_t *args, int argc, const char **argv) {
} }
if (args->incremental != NULL) { if (args->incremental != NULL) {
abs_path = abspath(args->incremental); args->incremental = abspath(args->incremental);
if (abs_path == NULL) { if (abs_path == NULL) {
sist_log("main.c", SIST_WARNING, "Could not open original index! Disabled incremental scan feature."); sist_log("main.c", SIST_WARNING, "Could not open original index! Disabled incremental scan feature.");
args->incremental = NULL; args->incremental = NULL;

View File

@ -143,3 +143,8 @@ GHashTable *store_read_all(store_t *store) {
return table; return table;
} }
void store_copy(store_t *store, const char *destination) {
mkdir(destination, S_IWUSR | S_IRUSR | S_IXUSR);
mdb_env_copy(store->env, destination);
}

View File

@ -27,4 +27,6 @@ char *store_read(store_t *store, char *key, size_t key_len, size_t *ret_vallen);
GHashTable *store_read_all(store_t *store); GHashTable *store_read_all(store_t *store);
void store_copy(store_t *store, const char *destination);
#endif #endif

View File

@ -21,7 +21,7 @@
#define EPILOG "Made by simon987 <me@simon987.net>. Released under GPL-3.0" #define EPILOG "Made by simon987 <me@simon987.net>. Released under GPL-3.0"
static const char *const Version = "2.7.2"; static const char *const Version = "2.7.3";
static const char *const usage[] = { static const char *const usage[] = {
"sist2 scan [OPTION]... PATH", "sist2 scan [OPTION]... PATH",
"sist2 index [OPTION]... INDEX", "sist2 index [OPTION]... INDEX",
@ -244,6 +244,13 @@ void sist2_scan(scan_args_t *args) {
} }
closedir(dir); closedir(dir);
store_destroy(source); store_destroy(source);
snprintf(store_path, PATH_MAX, "%stags", args->incremental);
snprintf(dst_path, PATH_MAX, "%stags", ScanCtx.index.path);
mkdir(store_path, S_IWUSR | S_IRUSR | S_IXUSR);
store_t *source_tags = store_create(store_path, STORE_SIZE_TAG);
store_copy(source_tags, dst_path);
store_destroy(source_tags);
} }
store_destroy(ScanCtx.index.store); store_destroy(ScanCtx.index.store);

View File

@ -11,7 +11,7 @@
<nav class="navbar navbar-expand-lg"> <nav class="navbar navbar-expand-lg">
<a class="navbar-brand" href="/">sist2</a> <a class="navbar-brand" href="/">sist2</a>
<span class="badge badge-pill version">2.7.2</span> <span class="badge badge-pill version">2.7.3</span>
<span class="tagline">Lightning-fast file system indexer and search tool </span> <span class="tagline">Lightning-fast file system indexer and search tool </span>
<a class="btn ml-auto" href="/stats">Stats</a> <a class="btn ml-auto" href="/stats">Stats</a>
<button class="btn" type="button" data-toggle="modal" data-target="#settings" onclick="loadSettings()">Settings <button class="btn" type="button" data-toggle="modal" data-target="#settings" onclick="loadSettings()">Settings

View File

@ -10,7 +10,7 @@
<nav class="navbar navbar-expand-lg"> <nav class="navbar navbar-expand-lg">
<a class="navbar-brand" href="/">sist2</a> <a class="navbar-brand" href="/">sist2</a>
<span class="badge badge-pill version">2.7.2</span> <span class="badge badge-pill version">2.7.3</span>
<span class="tagline">Lightning-fast file system indexer and search tool </span> <span class="tagline">Lightning-fast file system indexer and search tool </span>
<a style="margin-left: auto" class="btn" href="/">Back</a> <a style="margin-left: auto" class="btn" href="/">Back</a>
<button class="btn" type="button" data-toggle="modal" data-target="#settings" <button class="btn" type="button" data-toggle="modal" data-target="#settings"

File diff suppressed because one or more lines are too long