diff -Nru plocate-1.1.17/conf.cpp plocate-1.1.18/conf.cpp --- plocate-1.1.17/conf.cpp 2022-11-21 17:26:34.000000000 +0000 +++ plocate-1.1.18/conf.cpp 2023-01-28 20:45:19.000000000 +0000 @@ -68,6 +68,10 @@ /* Configuration representation for the database configuration block */ string conf_block; +/* Absolute (not necessarily canonical) path to the config file */ +string conf_configfile_str; +const char *conf_configfile; + int conf_block_size = 32; bool use_debug = false; diff -Nru plocate-1.1.17/debian/changelog plocate-1.1.18/debian/changelog --- plocate-1.1.17/debian/changelog 2023-02-01 03:13:36.000000000 +0000 +++ plocate-1.1.18/debian/changelog 2023-02-17 00:03:47.000000000 +0000 @@ -1,8 +1,27 @@ -plocate (1.1.17-2ubuntu1~bpo22.04) jammy; urgency=medium +plocate (1.1.18-1ubuntu1~bpo22.04) jammy; urgency=medium * No-change backport to jammy. - -- Unit 193 Tue, 31 Jan 2023 22:13:36 -0500 + -- Unit 193 Thu, 16 Feb 2023 19:03:47 -0500 + +plocate (1.1.18-1ubuntu1) lunar; urgency=low + + * Merge from Debian unstable. Remaining changes: + - Adjust handling of db generation on package install to match the + previous mlocate behavior, which ensured db generation even in + chroots, printed a message before, and ensured db generation finished + before the postinst returned. + - Adjust dh_systemd handling to match the above. + - d/p/locate-add-ignore-spaces-option-to-ignore-word-separ.patch: port + support for the --ignore-spaces option from mlocate. + + -- Steve Langasek Mon, 06 Feb 2023 16:09:29 -0800 + +plocate (1.1.18-1) unstable; urgency=medium + + * New upstream release. + + -- Steinar H. Gunderson Sat, 28 Jan 2023 21:46:26 +0100 plocate (1.1.17-2ubuntu1) lunar; urgency=low diff -Nru plocate-1.1.17/meson.build plocate-1.1.18/meson.build --- plocate-1.1.17/meson.build 2022-11-21 17:26:34.000000000 +0000 +++ plocate-1.1.18/meson.build 2023-01-28 20:45:19.000000000 +0000 @@ -1,4 +1,4 @@ -project('plocate', 'cpp', default_options: ['buildtype=debugoptimized','cpp_std=c++17'], version: '1.1.17') +project('plocate', 'cpp', default_options: ['buildtype=debugoptimized','cpp_std=c++17'], version: '1.1.18') add_project_arguments('-DGROUPNAME="' + get_option('locategroup') + '"', language: 'cpp') add_project_arguments('-DUPDATEDB_CONF="/etc/updatedb.conf"', language: 'cpp') diff -Nru plocate-1.1.17/NEWS plocate-1.1.18/NEWS --- plocate-1.1.17/NEWS 2022-11-21 17:26:34.000000000 +0000 +++ plocate-1.1.18/NEWS 2023-01-28 20:45:19.000000000 +0000 @@ -1,4 +1,11 @@ -plocate 1.1.7, November 21st, 2022 +plocate 1.1.18, January 28th, 2023 + + - Support the --require-visibility flag in plocate-build. + + - Various bugfixes. + + +plocate 1.1.17, November 21st, 2022 - Return 1 if no matches were found. Patch by Clément Pit-Claudel. diff -Nru plocate-1.1.17/plocate-build.8 plocate-1.1.18/plocate-build.8 --- plocate-1.1.17/plocate-build.8 2022-11-21 17:26:34.000000000 +0000 +++ plocate-1.1.18/plocate-build.8 2023-01-28 20:45:19.000000000 +0000 @@ -50,6 +50,13 @@ instead of an mlocate database. .TP +\fB\-l\fR, \fB\-\-require\-visibility\fR \fIFLAG\fR +Set the \*(lqrequire file visibility before reporting it\*(rq flag in the +generated database to \fIFLAG\fR. The default is yes, even for an mlocate +database with the flag originally set to no (although the latter may +change in the future). + +.TP .B \-\-help Print out usage information, then exit successfully. diff -Nru plocate-1.1.17/plocate-build.cpp plocate-1.1.18/plocate-build.cpp --- plocate-1.1.17/plocate-build.cpp 2022-11-21 17:26:34.000000000 +0000 +++ plocate-1.1.18/plocate-build.cpp 2023-01-28 20:45:19.000000000 +0000 @@ -147,7 +147,7 @@ } } -void do_build(const char *infile, const char *outfile, int block_size, bool plaintext) +void do_build(const char *infile, const char *outfile, int block_size, bool plaintext, bool check_visibility) { FILE *infp = fopen(infile, "rb"); if (infp == nullptr) { @@ -167,7 +167,7 @@ } string dictionary = builder.train(1024); - DatabaseBuilder db(outfile, /*owner=*/-1, block_size, dictionary, /*check_visibility=*/true); + DatabaseBuilder db(outfile, /*owner=*/-1, block_size, dictionary, check_visibility); DatabaseReceiver *corpus = db.start_corpus(/*store_dir_times=*/false); if (plaintext) { read_plaintext(infp, corpus); @@ -190,6 +190,7 @@ "\n" " -b, --block-size SIZE number of filenames to store in each block (default 32)\n" " -p, --plaintext input is a plaintext file, not an mlocate database\n" + " -l, --require-visibility FLAG check visibility before reporting files\n" " --help print this help\n" " --version print version information\n"); } @@ -203,11 +204,25 @@ printf("There is NO WARRANTY, to the extent permitted by law.\n"); } +bool parse_bool(const string &str, bool *result) +{ + if (str == "0" || str == "no") { + *result = false; + return true; + } + if (str == "1" || str == "yes") { + *result = true; + return true; + } + return false; +} + int main(int argc, char **argv) { static const struct option long_options[] = { { "block-size", required_argument, 0, 'b' }, { "plaintext", no_argument, 0, 'p' }, + { "require-visibility", required_argument, 0, 'l' }, { "help", no_argument, 0, 'h' }, { "version", no_argument, 0, 'V' }, { "debug", no_argument, 0, 'D' }, // Not documented. @@ -216,11 +231,12 @@ int block_size = 32; bool plaintext = false; + bool check_visibility = true; setlocale(LC_ALL, ""); for (;;) { int option_index = 0; - int c = getopt_long(argc, argv, "b:hpVD", long_options, &option_index); + int c = getopt_long(argc, argv, "b:hpl:VD", long_options, &option_index); if (c == -1) { break; } @@ -231,6 +247,13 @@ case 'p': plaintext = true; break; + case 'l': + if (!parse_bool(optarg, &check_visibility) != 0) { + fprintf(stderr, "plocate-build: invalid value `%s' for --%s", + optarg, "require-visibility"); + exit(EXIT_FAILURE); + } + break; case 'h': usage(); exit(0); @@ -250,6 +273,6 @@ exit(1); } - do_build(argv[optind], argv[optind + 1], block_size, plaintext); + do_build(argv[optind], argv[optind + 1], block_size, plaintext, check_visibility); exit(EXIT_SUCCESS); } diff -Nru plocate-1.1.17/README plocate-1.1.18/README --- plocate-1.1.17/README 2022-11-21 17:26:34.000000000 +0000 +++ plocate-1.1.18/README 2023-01-28 20:45:19.000000000 +0000 @@ -12,7 +12,7 @@ but strongly recommended for best performance, especially if you do not have an SSD. Installation is run as: - meson obj + meson setup obj cd obj ninja sudo addgroup --system plocate diff -Nru plocate-1.1.17/updatedb.cpp plocate-1.1.18/updatedb.cpp --- plocate-1.1.17/updatedb.cpp 2022-11-21 17:26:34.000000000 +0000 +++ plocate-1.1.18/updatedb.cpp 2023-01-28 20:45:19.000000000 +0000 @@ -707,8 +707,8 @@ if (getrlimit(RLIMIT_NOFILE, &rlim) == -1) { fprintf(stderr, "Hint: Try `ulimit -n 131072' or similar.\n"); } else { - fprintf(stderr, "Hint: Try `ulimit -n %lu' or similar (current limit is %lu).\n", - rlim.rlim_cur * 2, rlim.rlim_cur); + fprintf(stderr, "Hint: Try `ulimit -n %" PRIu64 " or similar (current limit is %" PRIu64 ").\n", + static_cast(rlim.rlim_cur * 2), static_cast(rlim.rlim_cur)); } exit(1); }