History log of /freebsd-current/usr.bin/locate/locate/updatedb.sh
Revision Date Author Comments
# 9b30b96c 22-Apr-2024 Olivier Certner <olce@FreeBSD.org>

Remove remnants of portsnap(8)

This was prompted by noticing that '/var/db/portsnap' still exists on
newly-installed machines.

With this change, all mentions of portsnap(8) in the tree are gone,
except for the historical note in the AUTHORS section of manpage
phttpget(8).

locate(1) will thus start indexing again '/var/db/portsnap' on machines
where this directory still exists, which may be a good way to push
administrators to delete it.

Reviewed by: cperciva
Approved by: emaste (mentor)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45023


# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# 1de7b4b8 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.


# af1aec74 12-Nov-2015 Dag-Erling Smørgrav <des@FreeBSD.org>

There is no more point in indexing /var/db/freebsd-update than there is in
indexing /var/db/portsnap, which was already in PRUNEPATHS.

MFC after: 1 week


# ab10162f 31-Oct-2010 Garrett Wollman <wollman@FreeBSD.org>

Style cleanup: make this look more like a 21st-century shell script
and not something out of the early 1980s. Make sure all error
messages go to stderr, not stdout. Since there's error-handling code
to handle empty SEARCHPATHS and FILESYSTEMS, use the initialization
form that allows this error to be diagnosed. (hat tip: jilles@)


# bf59c7ba 31-Oct-2010 Garrett Wollman <wollman@FreeBSD.org>

jilles@ pointed out that using ${PRUNEDIRS:=".zfs"} in updatedb.sh
made it impossible to override PRUNEDIRS to make it empty. Use the
non-colon form to only set PRUNEDIRS if it is completely unset. (For
parallelism, the other configuration defaults here could be done the
same way, but that could be more obviously accomplished by disabling
updatedb in periodic.conf, so leave them alone for now.)


# 6f8b6f94 30-Oct-2010 Garrett Wollman <wollman@FreeBSD.org>

Make it possible to exclude directories by name no matter where they
are in the filesystem from the locate database. By default, exclude
".zfs" directories, as users who who have set snapdir=visible and are
taking frequent snapshots most likely do not want the snapshots
included in the locate database.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# afb6c26e 17-Oct-2007 Stefan Eßer <se@FreeBSD.org>

The previous version included too many file system types in the scan,
since "local" includes also synthetic file systems (e.g. /dev, /proc)
and loopback mounts.

This version uses lsvfs to identify file system types that are local
and additionally not synthetik, loopback mounts, or read-only. This
has been suggested by Craig Rodrigues half a year ago. The patch that
has been committed is based on his suggestion, but slightly modified.

The comments in locate.rc have been updated to reflect the change and
o include zfs and xfs in the example file system parameter that can
be used to override the default outlined above.

PR: 114101
Submitted by: rodrigc at crodrigues dot org (Craig Rodrigues)
MFC: 2 weeks


# 8862db8d 15-Oct-2007 Stefan Eßer <se@FreeBSD.org>

Make the updatedb script installed as /usr/libexec/locate.updatedb
inspect all local file systems, not only ufs and ext2fs. A number
of local file systems has been added over time, and at least zfs
has the potential to become a popular choice. Without this change
a ZFS root file system causes the script to ignore all file-systems
and leads to an empty locate db. (An alternative is to add all the
relevant file systems individually, which means that at least zfs,
xfs, ntfs, ntfs-3g, msdosfs should be added, probably more).


# b2f9e512 11-Nov-2005 Greg Lehey <grog@FreeBSD.org>

Look through ext2fs file systems as well as ufs.

This should almost certainly be extended to other local file systems
as well (ntfs springs to mind), but I don't have the ability to test
it.


# f46417c5 22-Aug-2005 Colin Percival <cperciva@FreeBSD.org>

Most users probably aren't interested in locating 13000+ files named
[0-9a-f]{64}, so exclude portsnap's compressed snapshots from locate's
indexing.

Suggested by: silby
MFC after: 3 days


# 0f798c48 19-Jun-2002 Eivind Eklund <eivind@FreeBSD.org>

Make locate.updatedb tell about the security risk when it is run as root.


# c144d68c 12-Jan-2000 Kris Kennaway <kris@FreeBSD.org>

Use mktemp(1) for tempfiles (concatdb.sh), and increase the number of X's.


# c3aac50f 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 4bc71cea 14-May-1999 Wolfram Schneider <wosch@FreeBSD.org>

Delete debug line.

PR: bin/9793
Submitted by: Andy Farkas <andyf@speednet.com.au>


# 2d3de6c9 14-May-1999 Wolfram Schneider <wosch@FreeBSD.org>

Don't overwrite the variable LOCATE_CONFIG
This is useful for people who want index their home directory:

$ env LOCATE_CONFIG=$HOME/.locate.rc /usr/libexec/locate.updatedb

Submitted by: Dmitry Morozovsky <marck@rinet.ru>


# 7c105f54 28-Feb-1999 Andrey A. Chernov <ache@FreeBSD.org>

fix PRUNEPATHS assignment


# 215a9c27 29-Nov-1998 Wolfram Schneider <wosch@FreeBSD.org>

Set TMPDIR to /tmp
Use the new find option -s for sorted output.
Remove the temp directory in trap.


# a2f21880 18-Jun-1998 Wolfram Schneider <wosch@FreeBSD.org>

Create a save TMPDIR using `mktemp -d'.


# 8b91ab6a 08-Mar-1998 Wolfram Schneider <wosch@FreeBSD.org>

Change default temporary directory (TMPDIR) from /tmp to /var/tmp.

Mosts users seems to have a larger /var/tmp partition
than /tmp - IMHO silly but who cares?


# a294b5d8 08-Mar-1998 Wolfram Schneider <wosch@FreeBSD.org>

Improve shell variable substitution.


# 0a204352 13-Dec-1997 Sean Eric Fagan <sef@FreeBSD.org>

Allow TMPDIR to be set and actually *used*; if it not set, it defaults
to /tmp.


# c115df18 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Revert $FreeBSD$ to $Id$


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 374e1376 12-Oct-1996 Wolfram Schneider <wosch@FreeBSD.org>

export variable TMPDIR (which maybe set, but not exported in /etc/locate.rc)


# 5a80fb27 27-Aug-1996 Wolfram Schneider <wosch@FreeBSD.org>

sync copyright with /usr/share/examples/etc/bsd-style-copyright


# 37002181 13-Aug-1996 Wolfram Schneider <wosch@FreeBSD.org>

bigram
Bigram does not remove newline at end of filename. This
break particulary the bigram algorithm and /var/db/locate.database
grow up 15 %.

Bigram does not check for characters outside 32-127.

The bigram output is silly and need ~1/2 CPU time of
database rebuilding.

old:
locate.bigram < $filelist | sort | uniq -c | sort -nr
^^^^^^^^^^^^^^
this can easy made bigram

new:
bigram < $filelist | sort -nr

code
Code does not check for char 31.
Use a lookup array instead a function. 3 x faster.

updatedb
rewritten
sync with bigram changes

read config file /etc/locate.rc if exists
submitted by: guido@gvr.win.tue.nl (Guido van Rooij)

concatdb - concatenate locate databases
mklocatedb - build locate database


# 26cc34f1 05-Mar-1996 David Greenman <dg@FreeBSD.org>

Use '-fstype ufs' rather than '-fstype local' on the find command to avoid
special non-filesystems like procfs from being included.


# b534b75d 08-Nov-1995 Nate Williams <nate@FreeBSD.org>

Re-wrote the locate.updatedb script in /bin/sh for speed and portability.

Obtained from: Partially my work in 1.