X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=plocate-build.cpp;h=cb765ed742a738bb91507b5fefa910a85b26ac59;hb=c9a2810021399c2b6b8219d94040d790f558adf5;hp=02b18d0e42e00dc577ad9d7160d2f53d05433bfb;hpb=a73ad8311c5b272888c17829f390e1c35a5d624d;p=plocate diff --git a/plocate-build.cpp b/plocate-build.cpp index 02b18d0..cb765ed 100644 --- a/plocate-build.cpp +++ b/plocate-build.cpp @@ -83,10 +83,10 @@ void handle_directory(FILE *fp, DatabaseReceiver *receiver) int type = getc(fp); if (type == DBE_NORMAL) { string filename = read_cstr(fp); - receiver->add_file(dir_path + "/" + filename); + receiver->add_file(dir_path + "/" + filename, unknown_dir_time); } else if (type == DBE_DIRECTORY) { string dirname = read_cstr(fp); - receiver->add_file(dir_path + "/" + dirname); + receiver->add_file(dir_path + "/" + dirname, unknown_dir_time); } else { return; // Probably end. } @@ -116,7 +116,7 @@ void read_plaintext(FILE *fp, DatabaseReceiver *receiver) } if (!s.empty() && s.back() == '\n') s.pop_back(); - receiver->add_file(move(s)); + receiver->add_file(move(s), unknown_dir_time); } } @@ -166,8 +166,8 @@ void do_build(const char *infile, const char *outfile, int block_size, bool plai } string dictionary = builder.train(1024); - DatabaseBuilder db(outfile, block_size, dictionary); - Corpus *corpus = db.start_corpus(); + DatabaseBuilder db(outfile, /*owner=*/-1, block_size, dictionary, /*check_visibility=*/true); + Corpus *corpus = db.start_corpus(/*store_dir_times=*/false); if (plaintext) { read_plaintext(infp, corpus); } else { @@ -195,7 +195,7 @@ void usage() void version() { - printf("plocate-build %s\n", PLOCATE_VERSION); + printf("plocate-build %s\n", PACKAGE_VERSION); printf("Copyright 2020 Steinar H. Gunderson\n"); printf("License GPLv2+: GNU GPL version 2 or later .\n"); printf("This is free software: you are free to change and redistribute it.\n");