History log of /freebsd-current/usr.bin/locate/locate/mklocatedb.sh
Revision Date Author Comments
# 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


# e7d6783f 30-Jan-2022 Wolfram Schneider <wosch@FreeBSD.org>

enable to set locate command


# 21cc4bee 29-Jan-2022 Wolfram Schneider <wosch@FreeBSD.org>

sync improvements from concatdb.sh

- stop on first error
- improve awk script: print the last two characters for bigram - not the second word
- remove unnecessary checks
- use mktemp
- refactor


# 5cf00496 26-Jan-2022 Wolfram Schneider <wosch@FreeBSD.org>

limit sort(1) memory usage to 20% of available main memory

By default BSD sort(1) uses 90% (or at least 50%?) of the available
main memory. That is good for performance for a single job, but not
for a shared OS. For a long running script the performance is less
important than the stability of the server. Also, if a server
with 64GB RAM starts swapping, the performance goes south and
hurts other running applications.

Note: this change does not affect the weekly cron job to
rebuild the locate database. The FreeBSD locate.updatedb
use the -presort option (find -s)


# 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.


# 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.


# c4232cea 21-Jul-2002 Tim J. Robbins <tjr@FreeBSD.org>

Correct syntax error, remove the unescaped newline between "||" and the
command it is intended to test. pdksh and bash caught this syntax error,
sh(1) did not behave as intended.

PR: 40386


# 5386688c 22-Jun-2002 David E. O'Brien <obrien@FreeBSD.org>

Only got one of the Perl usages.


# 2c4d8a87 22-Jun-2002 David E. O'Brien <obrien@FreeBSD.org>

Replace a perl usage with an AWK one.

Submitted by: Bob Willcox <bob@immure.com>


# 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$


# fce53ea9 28-Nov-1998 Wolfram Schneider <wosch@FreeBSD.org>

Set TMPDIR to /tmp
Remove the temp directory in trap.
Replace the buggy awk script with a correct perl script.

Don't make a copy of the input data anymore if the input is already
sorted (option -presort). This scheme avoid large temporary files in
/tmp.


# 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.


# 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