--- mlocate-0.26.orig/.gitignore +++ mlocate-0.26/.gitignore @@ -0,0 +1,8 @@ +/obj-* +/*-stamp + +/debian/tmp +/debian/files +/debian/mlocate +/debian/*.substvars +/debian/*.debhelper.log --- mlocate-0.26.orig/.hgignore +++ mlocate-0.26/.hgignore @@ -0,0 +1,29 @@ +.*~$ +^admin.* +^autom4te\.cache.* +^gnulib/lib.* +# Only gnulib-cache.m4 should be left +^gnulib/m4/([^g]|g[^n]).* +^gnulib/m4/gnulib-(common\.m4|comp\.m4|tool\.m4) +^m4.* +^po/.*\.gmo$ +^po/Makefile\.in\.in +^po/Makevars\.template$ +^po/Rules-quot$ +^po/boldquot\.sed$ +^po/en@boldquot\.header$ +^po/en@quot\.header$ +^po/insert-header\.sin$ +^po/quot\.sed$ +^po/remove-potcdate\.sin$ +^ABOUT-NLS$ +^INSTALL$ +^Makefile\.in$ +^aclocal\.m4$ +^configure$ +^src/config\.h\.in$ +^tests/package\.m4$ +^tests/testsuite$ + +^build.* +^p/.* --- mlocate-0.26.orig/.hgtags +++ mlocate-0.26/.hgtags @@ -0,0 +1,36 @@ +63925cac65c8369da83bc1800034d697e401ca23 mlocate-0.01 +c294530af1ad241859e876a63733b58677d676be mlocate-0.02 +534230c9812571afd5e77ab3f5e5752ef2d97968 mlocate-0.03 +423139f2e382f2de942306dd995e2af486a793ad mlocate-0.04 +257bc38d539f7ba478c2517b60c44719c114a375 mlocate-0.05 +4cec935b1875ff48155c18c6f513ea3acec1aa84 mlocate-0.06 +c3a9e26144edfbecb08b08a09b90666bc0a55c0b mlocate-0.07 +cedac157654197859adfc2e1f15f60cf84b6a448 mlocate-0.08 +fb60f3534a857174632fb216ee0bae2eec5e7455 mlocate-0.09 +8c67446f30995a77d78bab20d584b918a16f2131 mlocate-0.10 +eb61e089fe65c8d40458e4f10163eec4fdc5af4e mlocate-0.10 +136c3ccc2fea8f0de40ecd8089d6bf3000a9fa82 mlocate-0.10 +e4e10ab72b685a2c14342e58f9b057f42c492546 mlocate-0.11 +bfd1c84009d8b7e77d260571f3dd6b4eb97dd916 mlocate-0.12 +3e9eee936e415f9fe168c1a95a562cdbaf8300ed mlocate-0.13 +8227845e08e2363f2ac80bdf88529930e723f7c3 mlocate-0.14 +d927553478dd11dcd41d2fac9feca3299515f428 mlocate-0.15 +c7015d3a3f16157a90607b0c576a5dcca61e4e37 mlocate-0.16 +8295f7b370cfdd95bdc90189b2a553d00c9ff9e3 mlocate-0.17 +9f8dadd6334084bc1af5dd9464e4556949ed50a7 mlocate-0.18 +8d43a8017ffd49a28c3388a9b27c00cba4d31fc9 mlocate-0.19 +f67f0d465428344893480e239a195efc39c19708 mlocate-0.20 +78092195a35daa025a16b1dfb411cb7b8070fccf mlocate-0.21 +e11e759fc3cac46b806c65d756c539a56453eba5 mlocate-0.21.1 +ed71d6d51b3aa8ae63835d721be1df6c8ff274b3 mlocate-0.22 +767382db50bf4b79ba9c0dccae64e3b2c1317c9c mocate-0.22.1 +767382db50bf4b79ba9c0dccae64e3b2c1317c9c mocate-0.22.1 +0000000000000000000000000000000000000000 mocate-0.22.1 +102e3256fe175a6cac5b503745c117a668388587 mlocate-0.22.1 +203f86be20b5e99d0697b273824fce5acd80a409 mlocate-0.22.2 +776e0fd83884228ef07f76b991db8d122f3cb139 mlocate-0.22.3 +356095beac47bdc0d86b08cee6849a81a26dd984 mlocate-0.22.4 +e6dea0b7f04efd843297a16cd9003a7f0da86cfa mlocate-0.23 +cca990af506fa38aff011cf2baae45c573a20e2b mlocate-0.23.1 +71587f6c6b793c7d4a7d85788dad705da24460f7 mlocate-0.24 +69f1424b5ccbc84e1a396ce10aedd862c9388e17 mlocate-0.25 --- mlocate-0.26.orig/.tx/config +++ mlocate-0.26/.tx/config @@ -0,0 +1,8 @@ +[main] +host = https://www.transifex.net + +[mlocate.default] +file_filter = po/.po +source_file = po/mlocate.pot +source_lang = en + --- mlocate-0.26.orig/HACKING +++ mlocate-0.26/HACKING @@ -0,0 +1,8 @@ +To set up a build environment from this repository, run: + mkdir $gldir; cd $gldir + git clone git://git.savannah.gnu.org/gnulib.git + git checkout 5861339993f3014cfad1b94fc7fe366fc2573598 + cd $mlocate_dir + $gldir/gnulib/gnulib-tool --import + hg revert --all + autoreconf -is --- mlocate-0.26.orig/debian/TODO +++ mlocate-0.26/debian/TODO @@ -0,0 +1 @@ +nice value from /etc/default/mlocate? --- mlocate-0.26.orig/debian/changelog +++ mlocate-0.26/debian/changelog @@ -0,0 +1,283 @@ +mlocate (0.26-2ubuntu3.1) bionic; urgency=medium + + * debian/control.in: + - Build-Depends on quilt + + -- Sebastien Bacher Thu, 01 Mar 2018 17:07:16 +0100 + +mlocate (0.26-2ubuntu3) bionic; urgency=medium + + * Actually apply the patches included in the previous package + revision (LP: #1752492, really fixes LP: #1752148) + * debian/control: updated homepage + * debian/watch: updated releases link + * debian/patches/0001-Point-the-project-URL-and-bug-reporting-address-at-h.patch: + - added upstream patch with updated bug-reporting link + * debian/rules: + - use quilt to handle the patches + + -- Marco Trevisan (Treviño) Wed, 28 Feb 2018 23:47:05 -0500 + +mlocate (0.26-2ubuntu2) bionic; urgency=medium + + * Imported patches from upstream: + - debian/patches/0001-Call-AM_PROG_AR.patch + - debian/patches/0002-Fix-typos-in-roff-directives.patch + - debian/patches/0003-Update-gettext-version-to-silence-autotools-warnings.patch + - debian/patches/0004-Fix-a-typo-in-temporary-umask-value.patch + - debian/patches/0005-Rename-db.h-include-guard-to-be-more-specific.patch + * Added patches to improve matching of string (pending upstream review) + Fixes LP: #1752148: + - debian/patches/0006-locate-add-transliterate-support-using-iconv-to-matc.patch + - debian/patches/0007-locate-add-ignore-spaces-option-to-ignore-word-separ.patch + + -- Marco Trevisan (Treviño) Tue, 27 Feb 2018 19:25:40 +0100 + +mlocate (0.26-2ubuntu1) artful; urgency=low + + * Merge from Debian unstable. Remaining changes: + - Add ecryptfs and fusesmb to PRUNEFS. + - Add /home/.ecryptfs and /var/lib/schroot to PRUNEPATHS. + * Dropped changes, included in Debian: + - add devtmpfs to PRUNEFS. + + -- Steve Langasek Thu, 27 Apr 2017 22:09:57 -0700 + +mlocate (0.26-2) unstable; urgency=medium + + * Add support for nocache(1) to cron.daily. Closes: #711323 + * Update Homepage URL in control. Closes: #791762 + * Add /var/lib/os-prober to PRUNEPATHS. Closes: #810670 + * Add /var/lib/ceph to PRUNEPATHS and ceph as fuse.ceph to PRUNEFS. + Closes: #786433 + * Add fuse.rozofs to PRUNEFS. Closes: #720465 + * Update name of mfs to fuse.mfs in PRUNEFS. Closes: #810902 + * Add devtmpfs to PRUNEFS. Closes: #762172 + * Add ${misc:Depends} to Depends in control file. + * Switch to dh for the build system and bump compat to 10. + - Drop debian/mlocate.dirs + - Drop most of debian/mlocate.install + - Clean up debian/rules + - Add debian/mlocate.docs + * Drop gitpkg scaffolding. + * Add dh-autoreconf to build-depends. Closes: #700094 + * Make updatedb man page a slave to update.mlocate manpage, to make + lintian happier. + * Update Standards-Version. No further changes necessary for this. + + -- Tollef Fog Heen Sun, 13 Nov 2016 13:24:24 +0100 + +mlocate (0.26-1ubuntu3) artful; urgency=medium + + * No-change rebuild to pick up -fPIE compiler default in static + libraries + + -- Steve Langasek Fri, 21 Apr 2017 20:52:02 +0000 + +mlocate (0.26-1ubuntu2) vivid; urgency=medium + + * debian/updatedb.conf: + - add /var/lib/schroot to PRUNEPATHS list to avoid indexing local + schroot like build systems. + + -- Didier Roche Tue, 18 Nov 2014 08:50:42 +0100 + +mlocate (0.26-1ubuntu1) saucy; urgency=low + + * Resynchronise with Debian (locking fix closes LP: #731632). Remaining + changes: + - Add ecryptfs, fusesmb, and devtmpfs to PRUNEFS. + - Add /home/.ecryptfs to PRUNEPATHS. + + -- Colin Watson Thu, 20 Jun 2013 15:03:51 +0100 + +mlocate (0.26-1) unstable; urgency=low + + * New upstream release. Closes: #669368 + - Stops using PATH_MAX. Closes: #610209 + * The filesystem type for Lustre is lustre, not lustre_lite. Update + updatedb.conf accordingly. Closes: #660781 + * Fix up locking in cron.daily. Closes: #611096 + * rm -rf /var/lib/mlocate on purge, don't just take out single files. + Closes: #542616 + + -- Tollef Fog Heen Thu, 13 Jun 2013 08:34:09 +0200 + +mlocate (0.25-0ubuntu2) raring; urgency=low + + * Update config.guess and config.sub from autotools-dev 20120608.1. + + -- Colin Watson Fri, 08 Feb 2013 16:46:51 +0000 + +mlocate (0.25-0ubuntu1) quantal; urgency=low + + * New upstream release. + + -- Logan Rosen Fri, 27 Jul 2012 01:15:56 -0400 + +mlocate (0.23.1-1ubuntu2) oneiric; urgency=low + + * Add /home/.ecryptfs to PRUNEPATHS (LP: #827841). + + -- Colin Watson Wed, 17 Aug 2011 14:07:51 +0100 + +mlocate (0.23.1-1ubuntu1) natty; urgency=low + + * Resynchronise with Debian. Remaining changes: + - Add ecryptfs, fusesmb, and devtmpfs to PRUNEFS. + + -- Colin Watson Tue, 12 Oct 2010 16:34:36 +0100 + +mlocate (0.23.1-1) unstable; urgency=low + + * New upstream release + - Updated translations + - Don't prune no-op bind mounts (mounting a directory over itself) + * Remove Thomas Jollans from Uploaders. Closes: #573428 + * Add curlftpfs to default exclude list. Closes: #585746 + * Stop removing the mlocate group on purge. Closes: #561469 + + -- Tollef Fog Heen Sat, 25 Sep 2010 08:15:12 +0200 + +mlocate (0.22.2-1ubuntu1) lucid; urgency=low + + * Add ecryptfs to PRUNEFS (LP: #372631). + * Add fusesmb to PRUNEFS (LP: #222504). + * Add devtmpfs to PRUNEFS; tmpfs was already there, so this should cover + /dev (LP: #355404). + + -- Colin Watson Wed, 24 Mar 2010 10:12:15 +0000 + +mlocate (0.22.2-1) unstable; urgency=low + + * New upstream version + - Updated translations + - Fix format docs + - Ignore --require-visibility in locate if the database is not owned + by group mlocate or it is readable by others (#7). + - Refuse to open unprivileged databases in directories only accessible + by group mlocate. + + -- Tollef Fog Heen Tue, 03 Nov 2009 22:43:19 +0100 + +mlocate (0.21.1-3) unstable; urgency=low + + [ Adeodato Simó ] + * Remove the "mlocate" group on purge. No other files than the mlocate.db + database should belong to said group, and since it also gets removed on + purge, it should be safe to remove the group as well. (Closes: #520017) + + [ Tollef Fog Heen ] + * Adopt package. (Closes: #548351) + * Add fuse.glusterfs to PRUNEFS. (Closes: #535170) + * Add fuse.sshfs to PRUNEFS. (Closes: #526262) + * Stop giving out an error when not running updatedb because we are on + battery. (Closes: #519188) + * Remove XS-X-Collab-Maint from debian/control, it seems it didn't take + off + + -- Tollef Fog Heen Sat, 03 Oct 2009 08:59:31 +0200 + +mlocate (0.21.1-2) unstable; urgency=low + + * Do not let the cron job run if we detect we're running on battery. + Patch from Ubuntu by Colin Watson. (Closes: #504350) + + * Update Standards-Version to 3.8.0 (no changes needed). + + -- Adeodato Simó Mon, 02 Mar 2009 19:18:48 +0100 + +mlocate (0.21.1-1) unstable; urgency=low + + * New upstream release (translations and documentations updates only). + + -- Adeodato Simó Tue, 28 Oct 2008 11:14:28 +0100 + +mlocate (0.21-1) unstable; urgency=low + + * New upstream release. + + + fixes PRUNE_BIND_MOUNTS to work with bind mounts under bind mounts. + (Closes: #458753) + + + implements PRUNENAMES in updatedb.conf, a mechanism to prune directories + based on their (base)name. (Closes: #473891) + + * Add a commented out PRUNENAMES example to the updatedb.conf shipped with + the package. + + -- Adeodato Simó Tue, 01 Jul 2008 16:16:12 +0200 + +mlocate (0.20-2) unstable; urgency=low + + * Add rpc_pipefs to the PRUNEFS list (change comes from Ubuntu, accidentally + discovered via the PTS link). + + -- Adeodato Simó Sun, 08 Jun 2008 16:59:48 +0200 + +mlocate (0.20-1) unstable; urgency=low + + * New upstream release. + + Fixes more typos in man pages. (Closes: #468435) + + * Use a lock file in the cron.daily script. (Closes: #472116) + + * Check that ionice(1) works before using it for updatedb. ionice reportedly + does not work in some vservers. (Closes: #477157) + + * Fix watch file to work with the new homepage under Trac. + + -- Adeodato Simó Sun, 08 Jun 2008 14:02:44 +0200 + +mlocate (0.19-1) unstable; urgency=low + + * New upstream release. + + Fixes various typos in man pages. (Closes: #465199, #465200) + + * Temporarily disable the test suite, since it fails when run with $CWD + matching "*d/b*" (which happens on buildds). + + * Add paragraph to the description mentioning how installing mlocate changes + /usr/bin/locate via alternatives, and that it won't work until the daily + script is run at least once. Thanks Stefano Zacchiroli for the suggestion. + (Closes: #456150, #456151) + + * Call dpkg-statoverride --remove in postrm. (Closes: #468231) + + * Fix typo in description. (Closes: #453019) + + * Move packaging to a git repository under collab-maint. Add a + X-Collab-Maint header. + + * Update Standards-Version to 3.7.3 (no changes needed). + + -- Adeodato Simó Sun, 16 Mar 2008 11:56:51 +0100 + +mlocate (0.18-2) unstable; urgency=low + + * Upload to unstable. + + * Only run the test suite when there is no /etc/updatedb.conf file, or + its syntax is compatible with mlocate's updatedb -- otherwise all tests + involving updatedb fail due to bad syntax. Upstream agrees there should + be a --config-file option. (Closes: #451997) + + * Lower conflicts against findutils to (<= 4.2.31-1). + + -- Adeodato Simó Sun, 25 Nov 2007 16:08:47 +0100 + +mlocate (0.18-1) experimental; urgency=low + + * Initial release. (Closes: #435787) + + * Handle /usr/bin/locate, /usr/bin/updatedb and locate.1 with alternatives + (manpage for mlocate's updatedb is in section 8, so no need to). + + * Create a "mlocate" group, and make the locate binary setgid on postinst + (with dpkg-statoverride). + + * Run the cron.daily script under the "idle" ionice(1) priority. + Via #448398. + + -- Adeodato Simó Sun, 18 Nov 2007 18:28:34 +0100 + --- mlocate-0.26.orig/debian/compat +++ mlocate-0.26/debian/compat @@ -0,0 +1 @@ +10 --- mlocate-0.26.orig/debian/control +++ mlocate-0.26/debian/control @@ -0,0 +1,48 @@ +Source: mlocate +Section: utils +Priority: standard +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Tollef Fog Heen +Build-Depends: debhelper (>= 10), + dh-autoreconf, + quilt +Standards-Version: 3.9.8 +Homepage: https://pagure.io/mlocate +Vcs-Git: git://git.debian.org/git/collab-maint/mlocate.git +Vcs-Browser: http://git.debian.org/?p=collab-maint/mlocate.git + +Package: mlocate +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser +Conflicts: findutils (<= 4.2.31-1), slocate (<= 3.1-1.1) +Description: quickly find files on the filesystem based on their name + mlocate is a new implementation of locate, a tool to find files + anywhere in the filesystem based on their name, using a fixed pattern + or a regular expression. Unlike other tools like find(1), locate uses + a previously created database to perform the search, allowing queries + to execute much faster. This database is updated periodically from + cron. + . + Several implementations of locate exist: the original implementation + from GNU's findutils, slocate, and mlocate. The advantages of mlocate + are: + . + * it indexes all the filesystem, but results of a search will only + include files that the user running locate has access to. It does + this by updating the database as root, but making it unreadable for + normal users, who can only access it via the locate binary. slocate + does this as well, but not the original locate. + . + * instead of re-reading all the contents of all directories each time + the database is updated, mlocate keeps timestamp information in its + database and can know if the contents of a directory changed without + reading them again. This makes updates much faster and less demanding + on the hard drive. This feature is only found in mlocate. + . + Installing mlocate will change the /usr/bin/locate binary to point to + mlocate via the alternatives mechanism. After installation, you may + wish to run /etc/cron.daily/mlocate by hand to create the database, + otherwise mlocate won't work until that script is run from cron itself + (since mlocate does not use the same database file as standard locate). + Also, you may wish to remove the "locate" package in order not to have + two different database files updated regularly on your system. --- mlocate-0.26.orig/debian/copyright +++ mlocate-0.26/debian/copyright @@ -0,0 +1,29 @@ +Debianized by Adeodato Simó 2007-11-10 + +The sources of mlocate can be downloaded from: + + http://people.redhat.com/mitr/mlocate + +And the project homepage is: + + http://carolina.mff.cuni.cz/~trmac/blog/mlocate + +Upstream author: + + Miloslav Trmac + +Copyright and license terms: + + - The sources of mlocate are: + + | Copyright (C) 2005, 2006, 2007 Red Hat, Inc. + + And licensed under the terms of the GPL license, version 2. On + Debian systems, the full text of the GPLv2 License is available + in /usr/share/common-licenses/GPL-2. + + - The packaging scripts in the debian/ subdirectory are: + + | Copyright (c) 2007 Adeodato Simó + + And licensed under the same terms of mlocate itself. --- mlocate-0.26.orig/debian/mlocate.cron.daily +++ mlocate-0.26/debian/mlocate.cron.daily @@ -0,0 +1,27 @@ +#! /bin/bash + +set -e + +[ -x /usr/bin/updatedb.mlocate ] || exit 0 + +if which on_ac_power >/dev/null 2>&1; then + ON_BATTERY=0 + on_ac_power >/dev/null 2>&1 || ON_BATTERY=$? + if [ "$ON_BATTERY" -eq 1 ]; then + exit 0 + fi +fi + +# See ionice(1) +if [ -x /usr/bin/ionice ] && + /usr/bin/ionice -c3 true 2>/dev/null; then + IONICE="/usr/bin/ionice -c3" +fi + +# See nocache(1) +NOCACHE= +if [ -x /usr/bin/nocache ]; then + NOCACHE="/usr/bin/nocache" +fi + +flock --nonblock /run/mlocate.daily.lock $NOCACHE $IONICE /usr/bin/updatedb.mlocate --- mlocate-0.26.orig/debian/mlocate.docs +++ mlocate-0.26/debian/mlocate.docs @@ -0,0 +1,3 @@ +AUTHORS +README +NEWS --- mlocate-0.26.orig/debian/mlocate.install +++ mlocate-0.26/debian/mlocate.install @@ -0,0 +1 @@ +debian/updatedb.conf /etc --- mlocate-0.26.orig/debian/mlocate.postinst +++ mlocate-0.26/debian/mlocate.postinst @@ -0,0 +1,25 @@ +#! /bin/sh + +set -e + +GROUP="mlocate" + +if [ "$1" = "configure" ]; then + update-alternatives --install /usr/bin/locate locate /usr/bin/mlocate 80 \ + --slave /usr/share/man/man1/locate.1.gz locate.1.gz /usr/share/man/man1/mlocate.1.gz \ + --slave /usr/bin/updatedb updatedb /usr/bin/updatedb.mlocate \ + --slave /usr/share/man/man8/updatedb.8.gz updatedb.8.gz /usr/share/man/man8/updatedb.mlocate.8.gz + + if ! sg "$GROUP" true 2>/dev/null; then + addgroup --system "$GROUP" + fi + + if ! dpkg-statoverride --list /usr/bin/mlocate >/dev/null 2>&1; then + dpkg-statoverride --update --add root "$GROUP" 2755 /usr/bin/mlocate + fi +fi + +# Obsolete file, this can be dropped post-jessie. +rm -f /var/lib/mlocate/daily.lock + +#DEBHELPER# --- mlocate-0.26.orig/debian/mlocate.postrm +++ mlocate-0.26/debian/mlocate.postrm @@ -0,0 +1,10 @@ +#! /bin/sh + +set -e + +if [ "$1" = "purge" ]; then + rm -rf "/var/lib/mlocate" + dpkg-statoverride --remove /usr/bin/mlocate || test $? -eq 2 +fi + +#DEBHELPER# --- mlocate-0.26.orig/debian/mlocate.prerm +++ mlocate-0.26/debian/mlocate.prerm @@ -0,0 +1,9 @@ +#! /bin/sh + +set -e + +if [ "$1" != "upgrade" ]; then + update-alternatives --remove locate /usr/bin/mlocate +fi + +#DEBHELPER# --- mlocate-0.26.orig/debian/patches/0001-Call-AM_PROG_AR.patch +++ mlocate-0.26/debian/patches/0001-Call-AM_PROG_AR.patch @@ -0,0 +1,33 @@ +From: =?utf-8?q?Miloslav_Trma=C4=8D?= +Date: Wed, 24 Apr 2013 22:25:37 +0200 +Subject: Call AM_PROG_AR + +--- + ChangeLog | 4 ++++ + configure.ac | 1 + + 2 files changed, 5 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 2be635e..497a24f 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2013-04-24 Miloslav Trmač ++ ++ * configure.ac: Call AM_PROG_AR as automake wants us to. ++ + 2012-09-22 Miloslav Trmač + + * configure.ac: Relase 0.26. +diff --git a/configure.ac b/configure.ac +index f11bac6..04de37e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -28,6 +28,7 @@ AM_INIT_AUTOMAKE([no-dist-gzip dist-xz no-define subdir-objects -Wall]) + AC_PROG_CC + gl_EARLY + AM_PROG_CC_C_O ++AM_PROG_AR + AC_PROG_RANLIB + # This interface seems to be undocumented, but bison uses it ;-) + AM_MISSING_PROG([AUTOM4TE], [autom4te]) --- mlocate-0.26.orig/debian/patches/0001-Point-the-project-URL-and-bug-reporting-address-at-h.patch +++ mlocate-0.26/debian/patches/0001-Point-the-project-URL-and-bug-reporting-address-at-h.patch @@ -0,0 +1,87 @@ +From c98bf6595703456558a6f9c163c746cdaa9e591f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= +Date: Tue, 21 Feb 2017 00:00:34 +0100 +Subject: [PATCH] Point the project URL and bug reporting address at + https://pagure.io/mlocate + +--- + README | 6 +++--- + configure.ac | 4 ++-- + po/Makevars | 2 +- + tests/config.at | 2 +- + tests/locate.at | 2 +- + 5 files changed, 8 insertions(+), 8 deletions(-) + +Index: mlocate-0.26/README +=================================================================== +--- mlocate-0.26.orig/README ++++ mlocate-0.26/README +@@ -9,7 +9,7 @@ The locate(1) utility is intended to be + also attempts to be compatible to GNU locate, when it does not conflict with + slocate compatibility. + +-New releases will be available at https://fedorahosted.org/mlocate/ . ++New releases will be available at https://pagure.io/mlocate . + + Installation + ============ +@@ -29,5 +29,5 @@ Bugs + ==== + Please consider reporting the bug to your distribution's bug tracking system. + +-Otherwise, report bugs at https://fedorahosted.org/mlocate/ . Bug reports +-with patches are especially welcome. ++Otherwise, report bugs at https://pagure.io/mlocate . Pull requests are ++especially welcome. +Index: mlocate-0.26/configure.ac +=================================================================== +--- mlocate-0.26.orig/configure.ac ++++ mlocate-0.26/configure.ac +@@ -1,6 +1,6 @@ + # Process this file with autoconf to produce a configure script. +-AC_INIT([mlocate], [0.26], [mitr@redhat.com], , +- [https://fedorahosted.org/mlocate/]) ++AC_INIT([mlocate], [0.26], [https://pagure.io/mlocate], , ++ [https://pagure.io/mlocate]) + AC_COPYRIGHT( + [Copyright (C) 2005, 2006, 2007, 2009, 2010, 2012 Red Hat, Inc. All rights + reserved. +Index: mlocate-0.26/po/Makevars +=================================================================== +--- mlocate-0.26.orig/po/Makevars ++++ mlocate-0.26/po/Makevars +@@ -34,7 +34,7 @@ COPYRIGHT_HOLDER = Red Hat, Inc + # It can be your email address, or a mailing list address where translators + # can write to without being subscribed, or the URL of a web page through + # which the translators can contact you. +-MSGID_BUGS_ADDRESS = https://fedorahosted.org/mlocate/ ++MSGID_BUGS_ADDRESS = https://pagure.io/mlocate + + # This is the list of locale categories, beyond LC_MESSAGES, for which the + # message catalogs shall be used. It is usually empty. +Index: mlocate-0.26/tests/config.at +=================================================================== +--- mlocate-0.26.orig/tests/config.at ++++ mlocate-0.26/tests/config.at +@@ -75,7 +75,7 @@ Update a mlocate database. + The configuration defaults to values read from + `PATH'. + +-Report bugs to mitr@redhat.com. ++Report bugs to https://pagure.io/mlocate. + ]]) + AT_CHECK([[updatedb -h | sed "s/\`[^']*'/\`PATH'/g"]], , [expout]) + AT_CHECK([[updatedb --help | sed "s/\`[^']*'/\`PATH'/g"]], , [expout]) +Index: mlocate-0.26/tests/locate.at +=================================================================== +--- mlocate-0.26.orig/tests/locate.at ++++ mlocate-0.26/tests/locate.at +@@ -247,7 +247,7 @@ Search for entries in a mlocate database + -V, --version print version information + -w, --wholename match whole path name (default) + +-Report bugs to mitr@redhat.com. ++Report bugs to https://pagure.io/mlocate. + ]]) + + AT_CHECK([[locate -h | sed 's,^\([ ]*\)/.*)$,\1PATH),']], , [expout]) --- mlocate-0.26.orig/debian/patches/0002-Fix-typos-in-roff-directives.patch +++ mlocate-0.26/debian/patches/0002-Fix-typos-in-roff-directives.patch @@ -0,0 +1,51 @@ +From: =?utf-8?q?Miloslav_Trma=C4=8D?= +Date: Tue, 18 Jun 2013 23:24:23 +0200 +Subject: Fix typos in roff directives + +Patch by Eric S. Raymond . +--- + ChangeLog | 6 ++++++ + doc/mlocate.db.5 | 2 +- + doc/updatedb.conf.5.in | 2 +- + 3 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 497a24f..e210a27 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,9 @@ ++2013-06-18 Miloslav Trmač ++ ++ * doc/mlocate.db.5 ++ * doc/updatedb.conf.5.in: Fix typos in roff directives. Patch by ++ Eric S. Raymond . ++ + 2013-04-24 Miloslav Trmač + + * configure.ac: Call AM_PROG_AR as automake wants us to. +diff --git a/doc/mlocate.db.5 b/doc/mlocate.db.5 +index 60814d6..a1b95e5 100644 +--- a/doc/mlocate.db.5 ++++ b/doc/mlocate.db.5 +@@ -53,7 +53,7 @@ function. + Currently defined variables are: + .TP + \fBprune_bind_mounts\fR +-A single entry, the value of \fbPRUNE_BIND_MOUNTS\fR; one of the strings ++A single entry, the value of \fBPRUNE_BIND_MOUNTS\fR; one of the strings + .B 0 + or \fB1\fR. + +diff --git a/doc/updatedb.conf.5.in b/doc/updatedb.conf.5.in +index 9b433a2..a8b5942 100644 +--- a/doc/updatedb.conf.5.in ++++ b/doc/updatedb.conf.5.in +@@ -87,7 +87,7 @@ in which the directory would be reported by + By default, no paths are skipped. + + .TP +-\fBPRUNE_BIND_MOUNTS\FR ++\fBPRUNE_BIND_MOUNTS\fR + One of the strings \fB0\fR, \fBno\fR, \fB1\fR or \fByes\fR. + If + .B PRUNE_BIND_MOUNTS --- mlocate-0.26.orig/debian/patches/0003-Update-gettext-version-to-silence-autotools-warnings.patch +++ mlocate-0.26/debian/patches/0003-Update-gettext-version-to-silence-autotools-warnings.patch @@ -0,0 +1,35 @@ +From: =?utf-8?q?Miloslav_Trma=C4=8D?= +Date: Mon, 8 Jul 2013 22:34:48 +0200 +Subject: Update gettext version to silence autotools warnings + +--- + ChangeLog | 5 +++++ + configure.ac | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index e210a27..f570540 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2013-07-08 Miloslav Trmač ++ ++ * configure.ac: Update gettext version, which silences some autotools ++ warnings. ++ + 2013-06-18 Miloslav Trmač + + * doc/mlocate.db.5 +diff --git a/configure.ac b/configure.ac +index 04de37e..af1be52 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -37,7 +37,7 @@ gl_INIT + + # Checks for libraries. + AM_GNU_GETTEXT([external], [need-ngettext]) +-AM_GNU_GETTEXT_VERSION([0.17]) ++AM_GNU_GETTEXT_VERSION([0.18.2]) + + # Checks for header files. + --- mlocate-0.26.orig/debian/patches/0004-Fix-a-typo-in-temporary-umask-value.patch +++ mlocate-0.26/debian/patches/0004-Fix-a-typo-in-temporary-umask-value.patch @@ -0,0 +1,36 @@ +From: =?utf-8?q?Miloslav_Trma=C4=8D?= +Date: Thu, 5 Dec 2013 00:18:24 +0100 +Subject: Fix a typo in temporary umask value + +Reported in https://fedorahosted.org/mlocate/ticket/27 . +--- + ChangeLog | 5 +++++ + src/updatedb.c | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index f570540..9bd074b 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2013-12-05 Miloslav Trmač ++ ++ * src/updatedb.c (new_db_setup_permissions): Fix a typo in the temporary ++ umask value. ++ + 2013-07-08 Miloslav Trmač + + * configure.ac: Update gettext version, which silences some autotools +diff --git a/src/updatedb.c b/src/updatedb.c +index 7cfa22d..1a177be 100644 +--- a/src/updatedb.c ++++ b/src/updatedb.c +@@ -957,7 +957,7 @@ new_db_setup_permissions (void) + { + mode_t mask; + +- mask = umask (S_IRWXU | S_IRWXG | S_IRWXG); ++ mask = umask (S_IRWXU | S_IRWXG | S_IRWXO); + umask (mask); + mode = ((S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) + & ~mask); --- mlocate-0.26.orig/debian/patches/0005-Rename-db.h-include-guard-to-be-more-specific.patch +++ mlocate-0.26/debian/patches/0005-Rename-db.h-include-guard-to-be-more-specific.patch @@ -0,0 +1,39 @@ +From: =?utf-8?q?Miloslav_Trma=C4=8D?= +Date: Mon, 14 Nov 2016 18:06:11 +0100 +Subject: Rename db.h include guard to be more specific + +https://fedorahosted.org/mlocate/ticket/37 +--- + ChangeLog | 6 ++++++ + src/db.h | 4 ++-- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 9bd074b..ca4b2bb 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,9 @@ ++2016-11-14 Miloslav Trmač ++ ++ * src/db.h (DB_H__): Rename to... ++ (MLOCATE_DB_H__): ... to minimize risk of conflicts when the header file ++ is installed to /usr/include. ++ + 2013-12-05 Miloslav Trmač + + * src/updatedb.c (new_db_setup_permissions): Fix a typo in the temporary +diff --git a/src/db.h b/src/db.h +index d3a3eff..39f609d 100644 +--- a/src/db.h ++++ b/src/db.h +@@ -13,8 +13,8 @@ PARTICULAR PURPOSE. + + Author: Miloslav Trmac */ + +-#ifndef DB_H__ +-#define DB_H__ ++#ifndef MLOCATE_DB_H__ ++#define MLOCATE_DB_H__ + + #include + --- mlocate-0.26.orig/debian/patches/0006-locate-add-transliterate-support-using-iconv-to-matc.patch +++ mlocate-0.26/debian/patches/0006-locate-add-transliterate-support-using-iconv-to-matc.patch @@ -0,0 +1,466 @@ +From ecbf0283545f9955018a4e986c811983971ddd7c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= +Date: Fri, 23 Feb 2018 23:37:48 +0100 +Subject: [PATCH] locate: add --transliterate support using iconv to match + accented +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Forwarded: https://pagure.io/mlocate/pull-request/41 +Bug: https://pagure.io/mlocate/issue/40 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/mlocate/+bug/1752148 + +When enabled all search parameters and paths are transliterated +and used for matching. + +There's no need to check transliterated strings all the times if the +targets don't need transliteration. + +To avoid false positives and not to break regex (in advanced mode +when a '?' is present, we had to escape it otherwise). + +We can be sure that the transliterated string will be +long at least like the input source plus an extra computed +on the number of chars that might be converted, as there' s +no transliteration that takes so much space. + +In case we don't have enough space for the transliterated string +we can just reallocate some space for it, so far this is just +needed when chars such as `㎯' are found as they use 4 bytes, but +the transliteration is 7 bytes. As we can't make assumptions +about what will be the maximum transliteration length, we can +just repeatedly reallocate if needed. + +As per C-translit.h many chars could generate combinations +where regex meta chars are used. +For example: ⓪, ﬩,{ → ㎯, ﹙∗ +In such case, we need to escape the regex properly. +--- + AUTHORS | 1 + + configure.ac | 9 ++ + doc/locate.1.in | 7 +- + src/locate.c | 263 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- + 4 files changed, 278 insertions(+), 2 deletions(-) + +Index: mlocate-0.26/AUTHORS +=================================================================== +--- mlocate-0.26.orig/AUTHORS ++++ mlocate-0.26/AUTHORS +@@ -1 +1,2 @@ + Miloslav Trmac ++Marco Trevisan +Index: mlocate-0.26/configure.ac +=================================================================== +--- mlocate-0.26.orig/configure.ac ++++ mlocate-0.26/configure.ac +@@ -39,6 +39,15 @@ gl_INIT + AM_GNU_GETTEXT([external], [need-ngettext]) + AM_GNU_GETTEXT_VERSION([0.18.2]) + ++AC_ARG_ENABLE(iconv, ++ AC_HELP_STRING([--disable-iconv], ++ [disable iconv support]),, ++ enable_iconv=yes) ++ ++if test x$enable_iconv = xyes; then ++ AM_ICONV ++fi ++ + # Checks for header files. + + # Checks for types. +Index: mlocate-0.26/doc/locate.1.in +=================================================================== +--- mlocate-0.26.orig/doc/locate.1.in ++++ mlocate-0.26/doc/locate.1.in +@@ -126,6 +126,10 @@ and exit successfully. + Ignore case distinctions when matching patterns. + + .TP ++\fB\-t\fR, \fB\-\-transliterate\fR ++Ignore accents using iconv transliteration when matching patterns. ++ ++.TP + \fB\-l\fR, \fB\-\-limit\fR, \fB\-n\fR \fILIMIT\fR + Exit successfully after finding + .I LIMIT +@@ -267,4 +271,5 @@ but it is added to other databases in th + Miloslav Trmac + + .SH SEE ALSO +-.BR updatedb (8) ++.BR updatedb (8), ++.BR iconv (1), +Index: mlocate-0.26/src/locate.c +=================================================================== +--- mlocate-0.26.orig/src/locate.c ++++ mlocate-0.26/src/locate.c +@@ -22,6 +22,10 @@ Author: Miloslav Trmac + #include + #include + #include ++#if HAVE_ICONV ++#include ++#include ++#endif + #include + #include + #include +@@ -47,6 +51,9 @@ Author: Miloslav Trmac + #include "db.h" + #include "lib.h" + ++#define BASIC_REGEX_META_CHARS ".^$*[]\\-" ++#define EXTENDED_REGEX_META_CHARS BASIC_REGEX_META_CHARS "{}|+?()" ++ + /* Check file existence before reporting them */ + static bool conf_check_existence; /* = false; */ + +@@ -60,6 +67,9 @@ static struct string_list conf_dbpath; / + /* Ignore case when matching patterns */ + static bool conf_ignore_case; /* = false; */ + ++/* Ignore accents when matching patterns */ ++static bool conf_transliterate; /* = false; */ ++ + /* Return only files that match all patterns */ + static bool conf_match_all_patterns; /* = false; */ + +@@ -108,6 +118,11 @@ static bool conf_quiet; /* = false; */ + /* Output only statistics */ + static bool conf_statistics; /* = false; */ + ++#if HAVE_ICONV ++/* Iconv context for transliterate conversion */ ++static iconv_t iconv_context; /* = NULL; */ ++#endif ++ + /* String utilities */ + + /* Convert SRC to upper-case wide string in OBSTACK; +@@ -163,6 +178,190 @@ uppercase_string (struct obstack *obstac + return res; + } + ++#if HAVE_ICONV ++static bool ++char_needs_escape (const char c) ++{ ++ if (conf_match_regexp_basic != false && ++ strchr (BASIC_REGEX_META_CHARS, c) != NULL) ++ return true; ++ ++ if (conf_match_regexp_basic != true && ++ strchr (EXTENDED_REGEX_META_CHARS, c) != NULL) ++ return true; ++ ++ return false; ++} ++ ++static char * ++escape_regex (const char *str, size_t len, size_t *escaped_len) ++{ ++ size_t i, j; ++ size_t newlen; ++ bool foundmeta; ++ char *outbuf; ++ ++ if (escaped_len) ++ *escaped_len = 0; ++ ++ if (conf_match_regexp != true) ++ return NULL; ++ ++ foundmeta = false; ++ newlen = 0; ++ ++ for (i = 0; str[i] && i < len; ++i) ++ { ++ if (char_needs_escape (str[i])) ++ { ++ foundmeta = true; ++ ++newlen; ++ } ++ ++newlen; ++ } ++ ++ if (foundmeta != true || newlen == 0) ++ return NULL; ++ ++ outbuf = xmalloc (newlen + 1); ++ outbuf[newlen] = '\0'; ++ ++ for (i = 0, j = 0; i < len && j < newlen; ++i) ++ { ++ if (char_needs_escape (str[i])) ++ outbuf[j++] = '\\'; ++ outbuf[j++] = str[i]; ++ } ++ ++ if (escaped_len) ++ *escaped_len = newlen; ++ ++ return outbuf; ++} ++ ++/* Use iconv to transliterate the string into ASCII chars, when possible. ++ If a transliteration does not exist, we just use the actual symbol ++ not to loose precision. */ ++static char * ++transliterate_string (const char *str) ++{ ++ size_t strrlen; ++ size_t inlen; ++ size_t outleft; ++ size_t transliteratedlen; ++ size_t nonasciibytes; ++ size_t i; ++ bool changed; ++ char *inbuf; ++ char *outbuf; ++ char *outptr; ++ ++ changed = false; ++ nonasciibytes = 0; ++ strrlen = 0; ++ ++ for (i = 0; str[i]; i++) ++ { ++ if (str[i] & 0x80) ++ ++nonasciibytes; ++ ++ ++strrlen; ++ } ++ ++ if (nonasciibytes < 1) ++ return NULL; ++ ++ inbuf = (char *) str; ++ inlen = 1; ++ transliteratedlen = 0; ++ outleft = strrlen + nonasciibytes; ++ outbuf = xmalloc (outleft); ++ outptr = outbuf; ++ ++ while (inbuf + inlen <= str + strrlen) ++ { ++ size_t convertedlen; ++ size_t conversions; ++ size_t symbollen; ++ size_t outidx; ++ ++ symbollen = inlen; ++ conversions = iconv (iconv_context, &inbuf, &inlen, &outptr, &outleft); ++ outidx = outptr - outbuf; ++ convertedlen = outidx - transliteratedlen; ++ ++ if (conversions == (size_t) -1) ++ { ++ if (errno == EILSEQ || errno == EINVAL) ++ { ++ inlen += 1; ++ continue; ++ } ++ else if (errno == E2BIG) ++ { ++ outleft += 5; ++ outbuf = xrealloc (outbuf, outidx + outleft); ++ outptr = outbuf + outidx; ++ continue; ++ } ++ error (0, errno, _("Impossible to transliterate string %s"), str); ++ changed = false; ++ break; ++ } ++ else if (conversions == 1 && convertedlen == 1 && outptr[-1] == '?') ++ { ++ /* Transliteration is not possible for this symbol, so we just ++ reuse it as it is. */ ++ memcpy (outptr - 1, inbuf - symbollen, symbollen); ++ convertedlen = symbollen; ++ outptr += symbollen - 1; ++ outleft -= symbollen - 1; ++ } ++ else if (conversions > 0) ++ { ++ if (conf_match_regexp != false && convertedlen > 0) ++ { ++ char *converted; ++ char *escaped; ++ size_t escaped_len; ++ ++ converted = outptr - convertedlen; ++ escaped = escape_regex (converted, convertedlen, &escaped_len); ++ ++ if (escaped) ++ { ++ if (escaped_len > outleft) ++ { ++ outleft += (escaped_len - outleft); ++ outbuf = xrealloc (outbuf, outidx + outleft); ++ outptr = outbuf + outidx; ++ converted = outptr - convertedlen; ++ } ++ memcpy (converted, escaped, escaped_len); ++ free (escaped); ++ ++ outptr += (escaped_len - convertedlen); ++ outleft -= (escaped_len - convertedlen); ++ convertedlen = escaped_len; ++ } ++ } ++ changed = true; ++ } ++ transliteratedlen += convertedlen; ++ inlen = 1; ++ } ++ ++ if (changed != true) ++ { ++ free (outbuf); ++ return NULL; ++ } ++ ++ outbuf[transliteratedlen] = '\0'; ++ return outbuf; ++} ++#endif ++ + /* Write STRING to stdout, replace unprintable characters with '?' */ + static void + write_quoted (const char *string) +@@ -432,7 +631,28 @@ handle_path (const char *path, int *visi + else + matching = path; + if (!string_matches_pattern (matching)) ++#if !HAVE_ICONV + goto done; ++#else ++ { ++ bool matched; ++ ++ matched = false; ++ if (conf_transliterate != false) ++ { ++ char *transliterated; ++ ++ transliterated = transliterate_string (matching); ++ if (transliterated) ++ { ++ matched = string_matches_pattern (transliterated); ++ free (transliterated); ++ } ++ } ++ if (!matched) ++ goto done; ++ } ++#endif + /* Visible? */ + if (*visible == -1) + *visible = check_directory_perms (path) == 0; +@@ -632,6 +852,11 @@ help (void) + " -h, --help print this help\n" + " -i, --ignore-case ignore case distinctions when matching " + "patterns\n" ++#if HAVE_ICONV ++ " -t, --transliterate ignore accents using iconv " ++ "transliteration when\n" ++ " matching patterns\n" ++#endif + " -l, --limit, -n LIMIT limit output (or counting) to LIMIT " + "entries\n" + " -m, --mmap ignored, for backward compatibility\n" +@@ -669,6 +894,7 @@ parse_options (int argc, char *argv[]) + { "follow", no_argument, NULL, 'L' }, + { "help", no_argument, NULL, 'h' }, + { "ignore-case", no_argument, NULL, 'i' }, ++ { "transliterate", no_argument, NULL, 't' }, + { "limit", required_argument, NULL, 'l' }, + { "mmap", no_argument, NULL, 'm' }, + { "quiet", no_argument, NULL, 'q' }, +@@ -691,7 +917,7 @@ parse_options (int argc, char *argv[]) + { + int opt, idx; + +- opt = getopt_long (argc, argv, "0AHPLSVbcd:ehil:mn:qr:sw", options, &idx); ++ opt = getopt_long (argc, argv, "0AHPLSVbcd:ehitl:mn:qr:sw", options, &idx); + switch (opt) + { + case -1: +@@ -772,6 +998,10 @@ parse_options (int argc, char *argv[]) + conf_ignore_case = true; + break; + ++ case 't': ++ conf_transliterate = true; ++ break; ++ + case 'l': case 'n': + { + char *end; +@@ -822,6 +1052,19 @@ parse_options (int argc, char *argv[]) + error (EXIT_FAILURE, 0, + _("non-option arguments are not allowed with --%s"), + conf_statistics != false ? "statistics" : "regexp"); ++ if (conf_transliterate != false) ++ { ++#if HAVE_ICONV ++ iconv_context = iconv_open ("ASCII//TRANSLIT", nl_langinfo (CODESET)); ++ if (iconv_context == (iconv_t) -1) ++ error (EXIT_FAILURE, errno, _("can not do transliteration between " \ ++ "these locales: `%s' and `ASCII'"), ++ nl_langinfo (CODESET)); ++#else ++ error (EXIT_FAILURE, errno, _("transliteration support is not supported" \ ++ "by this build of %s"), program_name); ++#endif ++ } + } + + /* Parse arguments in ARGC, ARGV. Exit on error. */ +@@ -834,6 +1077,21 @@ parse_arguments (int argc, char *argv[]) + string_list_append (&conf_patterns, argv[i]); + if (conf_statistics == false && conf_patterns.len == 0) + error (EXIT_FAILURE, 0, _("no pattern to search for specified")); ++#if HAVE_ICONV ++ if (conf_transliterate != false) ++ { ++ size_t patterns_len = conf_patterns.len; ++ char *transliterated; ++ ++ for (i = 0; i < patterns_len; i++) ++ { ++ transliterated = transliterate_string (conf_patterns.entries[i]); ++ ++ if (transliterated) ++ string_list_append (&conf_patterns, transliterated); ++ } ++ } ++#endif + conf_patterns.entries = xnrealloc (conf_patterns.entries, conf_patterns.len, + sizeof (*conf_patterns.entries)); + if (conf_match_regexp != false) +@@ -1042,6 +1300,10 @@ main (int argc, char *argv[]) + handle_dbpath_entry (conf_dbpath.entries[i]); + } + done: ++#if HAVE_ICONV ++ if (conf_transliterate != false && iconv_context) ++ iconv_close (iconv_context); ++#endif + if (conf_output_count != false) + printf ("%ju\n", matches_found); + if (conf_statistics != false || matches_found != 0) +Index: mlocate-0.26/tests/locate.at +=================================================================== +--- mlocate-0.26.orig/tests/locate.at ++++ mlocate-0.26/tests/locate.at +@@ -233,6 +233,8 @@ Search for entries in a mlocate database + existence (default) + -h, --help print this help + -i, --ignore-case ignore case distinctions when matching patterns ++ -t, --transliterate ignore accents using iconv transliteration when ++ matching patterns + -l, --limit, -n LIMIT limit output (or counting) to LIMIT entries + -m, --mmap ignored, for backward compatibility + -P, --nofollow, -H don't follow trailing symbolic links when checking file --- mlocate-0.26.orig/debian/patches/0007-locate-add-ignore-spaces-option-to-ignore-word-separ.patch +++ mlocate-0.26/debian/patches/0007-locate-add-ignore-spaces-option-to-ignore-word-separ.patch @@ -0,0 +1,247 @@ +From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= +Date: Fri, 23 Feb 2018 18:28:51 +0100 +Subject: locate: add --ignore-spaces option to ignore word separators +Forwarded: https://pagure.io/mlocate/pull-request/42 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/mlocate/+bug/1752148 + +It allows to locate in files ignoring in-words separators, +such as punctuation and spaces, so searching "foo-bar" is +like searching for "foo bar", "foo_bar" or "foo?bar". + +This is not compatible with regex. +--- + doc/locate.1.in | 4 ++ + src/locate.c | 122 +++++++++++++++++++++++++++++++++++++++++++++----------- + 2 files changed, 103 insertions(+), 23 deletions(-) + +Index: mlocate-0.26/doc/locate.1.in +=================================================================== +--- mlocate-0.26.orig/doc/locate.1.in ++++ mlocate-0.26/doc/locate.1.in +@@ -126,6 +126,10 @@ and exit successfully. + Ignore case distinctions when matching patterns. + + .TP ++\fB\-p\fR, \fB\-\-ignore\-spaces\fR ++Ignore punctuation and spaces when matching patterns. ++ ++.TP + \fB\-t\fR, \fB\-\-transliterate\fR + Ignore accents using iconv transliteration when matching patterns. + +Index: mlocate-0.26/src/locate.c +=================================================================== +--- mlocate-0.26.orig/src/locate.c ++++ mlocate-0.26/src/locate.c +@@ -70,6 +70,9 @@ static bool conf_ignore_case; /* = false + /* Ignore accents when matching patterns */ + static bool conf_transliterate; /* = false; */ + ++/* Ignore puncts and spaces when matching patterns */ ++static bool conf_ingore_separators; /* = false; */ ++ + /* Return only files that match all patterns */ + static bool conf_match_all_patterns; /* = false; */ + +@@ -362,6 +365,58 @@ transliterate_string (const char *str) + } + #endif + ++/* Remove repeated punct or spaces from string and replaces ++ them using a space*/ ++static char * ++compress_string_separators (const char *str, bool is_pattern) ++{ ++ size_t strippedlen; ++ size_t i; ++ char *outbuf; ++ bool first; ++ bool changed; ++ ++ changed = false; ++ first = false; ++ strippedlen = 0; ++ outbuf = xmalloc (strlen (str) + 1); ++ ++ for (i = 0; str[i]; i++) ++ { ++ char cnt; ++ ++ cnt = str[i]; ++ if (isspace (cnt) || (ispunct (cnt) && cnt != '@' && ++ (!is_pattern || strchr ("*?[\\]", cnt) == NULL))) ++ { ++ if (first != false) ++ { ++ changed = true; ++ continue; ++ } ++ if (cnt != ' ') ++ { ++ cnt = ' '; ++ changed = true; ++ } ++ first = true; ++ } ++ else ++ first = false; ++ ++ outbuf[strippedlen++] = cnt; ++ } ++ ++ if (!changed) ++ { ++ free (outbuf); ++ return NULL; ++ } ++ ++ outbuf[strippedlen] = '\0'; ++ return outbuf; ++} ++ + /* Write STRING to stdout, replace unprintable characters with '?' */ + static void + write_quoted (const char *string) +@@ -631,28 +686,32 @@ handle_path (const char *path, int *visi + else + matching = path; + if (!string_matches_pattern (matching)) +-#if !HAVE_ICONV +- goto done; +-#else + { ++ char *altered_matching; + bool matched; + ++ altered_matching = NULL; + matched = false; ++ if (conf_ingore_separators != false) ++ altered_matching = compress_string_separators (matching, false); ++#if HAVE_ICONV + if (conf_transliterate != false) + { +- char *transliterated; +- +- transliterated = transliterate_string (matching); +- if (transliterated) +- { +- matched = string_matches_pattern (transliterated); +- free (transliterated); +- } ++ char *old_altered = altered_matching; ++ if (altered_matching) ++ matching = altered_matching; ++ altered_matching = transliterate_string (matching); ++ free (old_altered); ++ } ++#endif ++ if (altered_matching != NULL) ++ { ++ matched = string_matches_pattern (altered_matching); ++ free (altered_matching); + } + if (!matched) + goto done; + } +-#endif + /* Visible? */ + if (*visible == -1) + *visible = check_directory_perms (path) == 0; +@@ -852,6 +911,8 @@ help (void) + " -h, --help print this help\n" + " -i, --ignore-case ignore case distinctions when matching " + "patterns\n" ++ " -p, --ignore-spaces ignore punctuation and spaces when " ++ "matching patterns\n" + #if HAVE_ICONV + " -t, --transliterate ignore accents using iconv " + "transliteration when\n" +@@ -894,6 +955,7 @@ parse_options (int argc, char *argv[]) + { "follow", no_argument, NULL, 'L' }, + { "help", no_argument, NULL, 'h' }, + { "ignore-case", no_argument, NULL, 'i' }, ++ { "ignore-spaces", no_argument, NULL, 'p' }, + { "transliterate", no_argument, NULL, 't' }, + { "limit", required_argument, NULL, 'l' }, + { "mmap", no_argument, NULL, 'm' }, +@@ -917,7 +979,7 @@ parse_options (int argc, char *argv[]) + { + int opt, idx; + +- opt = getopt_long (argc, argv, "0AHPLSVbcd:ehitl:mn:qr:sw", options, &idx); ++ opt = getopt_long (argc, argv, "0AHPLSVbcd:ehitpl:mn:qr:sw", options, &idx); + switch (opt) + { + case -1: +@@ -1002,6 +1064,10 @@ parse_options (int argc, char *argv[]) + conf_transliterate = true; + break; + ++ case 'p': ++ conf_ingore_separators = true; ++ break; ++ + case 'l': case 'n': + { + char *end; +@@ -1052,6 +1118,9 @@ parse_options (int argc, char *argv[]) + error (EXIT_FAILURE, 0, + _("non-option arguments are not allowed with --%s"), + conf_statistics != false ? "statistics" : "regexp"); ++ if (conf_ingore_separators != false && conf_match_regexp != false) ++ error (EXIT_FAILURE, 0, ++ _("ignore-spaces is not supported when using regexp")); + if (conf_transliterate != false) + { + #if HAVE_ICONV +@@ -1077,21 +1146,30 @@ parse_arguments (int argc, char *argv[]) + string_list_append (&conf_patterns, argv[i]); + if (conf_statistics == false && conf_patterns.len == 0) + error (EXIT_FAILURE, 0, _("no pattern to search for specified")); +-#if HAVE_ICONV +- if (conf_transliterate != false) ++ if (conf_transliterate != false || conf_ingore_separators != false) + { ++ char *altered_pattern; + size_t patterns_len = conf_patterns.len; +- char *transliterated; + + for (i = 0; i < patterns_len; i++) + { +- transliterated = transliterate_string (conf_patterns.entries[i]); +- +- if (transliterated) +- string_list_append (&conf_patterns, transliterated); ++ if (conf_ingore_separators != false) ++ { ++ altered_pattern = ++ compress_string_separators (conf_patterns.entries[i], true); ++ if (altered_pattern) ++ conf_patterns.entries[i] = altered_pattern; ++ } ++#if HAVE_ICONV ++ if (conf_transliterate != false) ++ { ++ altered_pattern = transliterate_string (conf_patterns.entries[i]); ++ if (altered_pattern) ++ string_list_append (&conf_patterns, altered_pattern); ++ } ++#endif + } + } +-#endif + conf_patterns.entries = xnrealloc (conf_patterns.entries, conf_patterns.len, + sizeof (*conf_patterns.entries)); + if (conf_match_regexp != false) +Index: mlocate-0.26/tests/locate.at +=================================================================== +--- mlocate-0.26.orig/tests/locate.at ++++ mlocate-0.26/tests/locate.at +@@ -233,6 +233,7 @@ Search for entries in a mlocate database + existence (default) + -h, --help print this help + -i, --ignore-case ignore case distinctions when matching patterns ++ -p, --ignore-spaces ignore punctuation and spaces when matching patterns + -t, --transliterate ignore accents using iconv transliteration when + matching patterns + -l, --limit, -n LIMIT limit output (or counting) to LIMIT entries --- mlocate-0.26.orig/debian/patches/series +++ mlocate-0.26/debian/patches/series @@ -0,0 +1,8 @@ +0001-Call-AM_PROG_AR.patch +0002-Fix-typos-in-roff-directives.patch +0003-Update-gettext-version-to-silence-autotools-warnings.patch +0004-Fix-a-typo-in-temporary-umask-value.patch +0005-Rename-db.h-include-guard-to-be-more-specific.patch +0001-Point-the-project-URL-and-bug-reporting-address-at-h.patch +0006-locate-add-transliterate-support-using-iconv-to-matc.patch +0007-locate-add-ignore-spaces-option-to-ignore-word-separ.patch --- mlocate-0.26.orig/debian/rules +++ mlocate-0.26/debian/rules @@ -0,0 +1,14 @@ +#! /usr/bin/make -f + +%: + dh $@ --builddirectory=build --with quilt + +override_dh_auto_configure: + dh_auto_configure -- --localstatedir=/var/lib + +override_dh_install: + dh_install --fail-missing + mv debian/mlocate/usr/bin/locate debian/mlocate/usr/bin/mlocate + mv debian/mlocate/usr/bin/updatedb debian/mlocate/usr/bin/updatedb.mlocate + mv debian/mlocate/usr/share/man/man1/locate.1 debian/mlocate/usr/share/man/man1/mlocate.1 + mv debian/mlocate/usr/share/man/man8/updatedb.8 debian/mlocate/usr/share/man/man8/updatedb.mlocate.8 --- mlocate-0.26.orig/debian/updatedb.conf +++ mlocate-0.26/debian/updatedb.conf @@ -0,0 +1,4 @@ +PRUNE_BIND_MOUNTS="yes" +# PRUNENAMES=".git .bzr .hg .svn" +PRUNEPATHS="/tmp /var/spool /media /var/lib/os-prober /var/lib/ceph /home/.ecryptfs /var/lib/schroot" +PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs devtmpfs fuse.mfs shfs sysfs cifs lustre tmpfs usbfs udf fuse.glusterfs fuse.sshfs curlftpfs ceph fuse.ceph fuse.rozofs ecryptfs fusesmb" --- mlocate-0.26.orig/debian/watch +++ mlocate-0.26/debian/watch @@ -0,0 +1,3 @@ +version=3 +opts=downloadurlmangle=s/bz2$/bz2?format=raw/ \ +https://releases.pagure.org/mlocate/mlocate-(.+).tar.bz2 --- mlocate-0.26.orig/gnulib/m4/gnulib-cache.m4 +++ mlocate-0.26/gnulib/m4/gnulib-cache.m4 @@ -0,0 +1,32 @@ +# Copyright (C) 2004-2007 Free Software Foundation, Inc. +# +# This file is free software, distributed under the terms of the GNU +# General Public License. As a special exception to the GNU General +# Public License, this file may be distributed as part of a program +# that contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# Generated by gnulib-tool. +# +# This file represents the specification of how gnulib-tool is used. +# It acts as a cache: It is written and read by gnulib-tool. +# In projects using CVS, this file is meant to be stored in CVS, +# like the configure.ac and various Makefile.am files. + + +# Specification in the form of a command-line invocation: +# gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --aux-dir=admin --no-libtool --macro-prefix=gl canonicalize-lgpl config-h d-type error fnmatch-gnu fwriteerror getopt gettext-h mbsstr mempcpy obstack progname safe-read stat-time strchrnul timespec verify xalloc + +# Specification in the form of a few gnulib-tool.m4 macro invocations: +gl_LOCAL_DIR([]) +gl_MODULES([canonicalize-lgpl config-h d-type error fnmatch-gnu fwriteerror getopt gettext-h mbsstr mempcpy obstack progname safe-read stat-time strchrnul timespec verify xalloc]) +gl_AVOID([]) +gl_SOURCE_BASE([gnulib/lib]) +gl_M4_BASE([gnulib/m4]) +gl_PO_BASE([]) +gl_DOC_BASE([doc]) +gl_TESTS_BASE([tests]) +gl_LIB([libgnu]) +gl_MAKEFILE_NAME([]) +gl_MACRO_PREFIX([gl]) +gl_PO_DOMAIN([])