########################################################################
# #
# This software is part of the ast package #
# Copyright (c) 1989-2011 AT&T Intellectual Property #
# and is licensed under the #
# Eclipse Public License, Version 1.0 #
# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
# #
# Information and Software Systems Research #
# AT&T Research #
# Florham Park NJ #
# #
# Glenn Fowler <gsf@research.att.com> #
# #
########################################################################
dirs_default="/"
drop_default="/afs|/backup|/dev|/proc|/tmp|/usr/tmp|/var/tmp"
keep_default="/home|/usr/local|/usr/common"
USAGE=$'
[-?
@(#)$Id: updatedb (AT&T Labs Research) 2003-11-14 $
]
[+NAME?updatedb - generate locate pathname database]
[+DESCRIPTION?\bupdatedb\b generates the locate pathname database that is used
by \blocate\b(1), \bfind\b(1), and \btw\b(1). Sufficient privilege
is required to change the system locate database.]
[+?This implemenation is a script that generates a \btw\b(1) command that
does all the work.]
[a:auto-home?Include the \bnis\b(1) \aauto.home\a auto mounter home directories
and may swamp the mount table.]
[d:directory|localpaths?Local directories to include in the database. If the
first \adir\a is \b+\b then the default list is appended.]:
[i:ignore-errors?Omit inaccessible files and directory error messages.]
[k:keep?Directories to retain in the database; used to override
\b--nocrossdevice\b. If any of the paths are symbolic links then they
are followed. If the first \adir\a is \b+\b then the default list
[l:local?Do not descend into non-local filesystem directories.]
[r:netpaths?Network directories to include in the database. Currently
equivalent to \b--localpaths\b.]:["dir1 dir2 ..."]
[p:prunepaths|drop?Directories to exclude from the database. If the first \adir\a
is \b+\b then the default list is appended.]:
[P:public?Omit files that are not publicly readable and directories that
are not publicly searchable.]
[u:user|netuser?The user id used to search directories.]:[user]
[m:dir-format?Generate a database similar to \b--gnu-format\b, except that
directories are marked for efficient implementations of \bfind\b(1)
and \btw\b(1). This is the default database format.]
[g:gnu-format?Generate a machine independent gnu \blocate\b(1) compatible
database.]
[O:old-format?Generate a database compatible with the obsolete
\bfastfind\b(1). This format has a machine dependent encoding.]
[D:depth?Limit the directory traversal depth to \alevel\a.]#[level]
[X!:crossdevice?Retain subdirectories that cross device boundaries.]
[n:show?Show the underlying the \btw\b(1) command but do not execute.]
[+CAVEATS?If you run \bupdatedb\b as root then protected directory
contents may be visible to everyone via the database. Use the
\b--public\b option to limit the database to publically visible
files and directories.]
[+SEE ALSO?\blocate\b(1), \bfastfind\b(1), \bfind\b(1), \bnis\b(1), \btw\b(1)]
'
;;
*) ARGV0=""
USAGE="aiglnOPXd:['dir1 dir2 ...']k:['dir1 dir2 ...']o:[dbfile]p:['dir1 dir2 ...']r:['dir1 dir2 ...']u:[user]D:[level]"
;;
esac
{
OPTIND=0
exit 2
}
cross=1
dirs=
drop=
format="-"
keep=
options="-P"
output="-"
show=
su=
;;
"+"|"+ "*) ;;
*) dirs_default= ;;
esac
+) ;;
esac
done
;;
;;
;;
"+"|"+ "*) ;;
*) keep_default= ;;
esac
+) ;;
esac
;;
esac
done
;;
;;
m) format="-"
;;
;;
n) show="print --"
;;
"+"|"+ "*) ;;
*) drop_default= ;;
esac
+) ;;
esac
;;
esac
done
;;
;;
;;
;;
P) public=1
;;
X) cross=
;;
*) usage
;;
esac
done
shift $OPTIND-1
case $# in
0) ;;
*) usage ;;
esac
done
esac
done
esac
done
skip=
alt="
"
sep="
"
esac
skip="${skip}${alt}!(mode & 'o+r') ||${alt}type == DIR &&${alt}!(mode & 'o+x')"
;;
esac
esac
;;
esac
esac
skip="${skip}${alt}fstype != '/'.fstype"
esac
;;
esac
esac
;;
esac
expr=
?*) expr="if (${skip}${alt})${alt} status = SKIP;" ;;
esac
?*) expr="${expr}${sep}else " ;;
esac
expr="${expr}if (${alt}type == LNK &&${alt}level < 3 &&${alt}path == '($keep)?(/*)'${alt})${alt} status = FOLLOW;"
;;
esac
*) expr="-e \"${sep}${expr}\"${sep}" ;;
esac
;;
esac