Update to latest gnulib, fixing several bugs.

* import-gnulib.config (gnulib_version): Change to today.
* locate/locate.c (includes): Adjust to getline changes.
(main): Adjust to xstrtol changes.
* lib/listfile.c (includes): Simplify, depend on idcache, alloca.
* locate/bigram.c (includes): Adjust to getline changes.
* locate/code.c (includes): Likewise.
* locate/frcode.c (includes): Likewise.
* po/POTFILES.in: Update list of gnulib files with translatable
strings.
* config.rpath: Delete; file is generated from gnulib.
This commit is contained in:
Eric Blake 2007-08-23 14:14:34 +00:00
parent 20bd3e235e
commit 6118707079
9 changed files with 154 additions and 826 deletions

View File

@ -1,9 +1,23 @@
2007-08-23 Eric Blake <ebb9@byu.net>
Update to latest gnulib, fixing several bugs.
* import-gnulib.config (gnulib_version): Change to today.
* locate/locate.c (includes): Adjust to getline changes.
(main): Adjust to xstrtol changes.
* lib/listfile.c (includes): Simplify, depend on idcache, alloca.
* locate/bigram.c (includes): Adjust to getline changes.
* locate/code.c (includes): Likewise.
* locate/frcode.c (includes): Likewise.
* po/POTFILES.in: Update list of gnulib files with translatable
strings.
* config.rpath: Delete; file is generated from gnulib.
2007-08-20 James Youngman <jay@gnu.org>
* doc/find.texi (Directories): Clarify that built commands which
have not been executed yet will be executed before find quits,
even with -quit. Also clarify the difference between -prune and
-quit.
-quit.
2007-08-18 Eric Blake <ebb9@byu.net>

View File

@ -1,660 +0,0 @@
#! /bin/sh
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
# Copyright 1996-2006 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# The first argument passed to this file is the canonical host specification,
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
# should be set by the caller.
#
# The set of defined variables is at the end of this script.
# Known limitations:
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
# than 256 bytes, otherwise the compiler driver will dump core. The only
# known workaround is to choose shorter directory names for the build
# directory and/or the installation directory.
# All known linkers require a `.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
shrext=.so
host="$1"
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
# Code taken from libtool.m4's _LT_CC_BASENAME.
for cc_temp in $CC""; do
case $cc_temp in
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
\-*) ;;
*) break;;
esac
done
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
wl=
if test "$GCC" = yes; then
wl='-Wl,'
else
case "$host_os" in
aix*)
wl='-Wl,'
;;
darwin*)
case $cc_basename in
xlc*)
wl='-Wl,'
;;
esac
;;
mingw* | pw32* | os2*)
;;
hpux9* | hpux10* | hpux11*)
wl='-Wl,'
;;
irix5* | irix6* | nonstopux*)
wl='-Wl,'
;;
newsos6)
;;
linux*)
case $cc_basename in
icc* | ecc*)
wl='-Wl,'
;;
pgcc | pgf77 | pgf90)
wl='-Wl,'
;;
ccc*)
wl='-Wl,'
;;
como)
wl='-lopt='
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*)
wl='-Wl,'
;;
esac
;;
esac
;;
osf3* | osf4* | osf5*)
wl='-Wl,'
;;
sco3.2v5*)
;;
solaris*)
wl='-Wl,'
;;
sunos4*)
wl='-Qoption ld '
;;
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
wl='-Wl,'
;;
sysv4*MP*)
;;
unicos*)
wl='-Wl,'
;;
uts4*)
;;
esac
fi
# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no
case "$host_os" in
cygwin* | mingw* | pw32*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
if test "$GCC" != yes; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes
;;
openbsd*)
with_gnu_ld=no
;;
esac
ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
# Set some defaults for GNU ld with shared library support. These
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
# Unlike libtool, we use -rpath here, not --rpath, since the documented
# option of GNU ld is called -rpath, not --rpath.
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
case "$host_os" in
aix3* | aix4* | aix5*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
fi
;;
amigaos*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
# that the semantics of dynamic libraries on AmigaOS, at least up
# to version 4, is to share data among multiple programs linked
# with the same dynamic library. Since this doesn't match the
# behavior of shared libraries on other platforms, we cannot use
# them.
ld_shlibs=no
;;
beos*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
cygwin* | mingw* | pw32*)
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
interix3*)
hardcode_direct=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
linux*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
netbsd*)
;;
solaris*)
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
case `$LD -v 2>&1` in
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
ld_shlibs=no
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
else
ld_shlibs=no
fi
;;
esac
;;
sunos4*)
hardcode_direct=yes
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
esac
if test "$ld_shlibs" = no; then
hardcode_libdir_flag_spec=
fi
else
case "$host_os" in
aix3*)
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
if test "$GCC" = yes; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct=unsupported
fi
;;
aix4* | aix5*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
else
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
case $host_os in aix4.[23]|aix4.[23].*|aix5*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
break
fi
done
;;
esac
fi
hardcode_direct=yes
hardcode_libdir_separator=':'
if test "$GCC" = yes; then
case $host_os in aix4.[012]|aix4.[012].*)
collect2name=`${CC} -print-prog-name=collect2`
if test -f "$collect2name" && \
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
hardcode_direct=yes
else
# We have old collect2
hardcode_direct=unsupported
hardcode_minus_L=yes
hardcode_libdir_flag_spec='-L$libdir'
hardcode_libdir_separator=
fi
;;
esac
fi
# Begin _LT_AC_SYS_LIBPATH_AIX.
echo 'int main () { return 0; }' > conftest.c
${CC} ${LDFLAGS} conftest.c -o conftest
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
if test -z "$aix_libpath"; then
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
fi
if test -z "$aix_libpath"; then
aix_libpath="/usr/lib:/lib"
fi
rm -f conftest.c conftest
# End _LT_AC_SYS_LIBPATH_AIX.
if test "$aix_use_runtimelinking" = yes; then
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
else
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
fi
fi
;;
amigaos*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
# see comment about different semantics on the GNU ld section
ld_shlibs=no
;;
bsdi[45]*)
;;
cygwin* | mingw* | pw32*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec=' '
libext=lib
;;
darwin* | rhapsody*)
hardcode_direct=no
if test "$GCC" = yes ; then
:
else
case $cc_basename in
xlc*)
;;
*)
ld_shlibs=no
;;
esac
fi
;;
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
freebsd1*)
ld_shlibs=no
;;
freebsd2.2*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
freebsd2*)
hardcode_direct=yes
hardcode_minus_L=yes
;;
freebsd* | kfreebsd*-gnu | dragonfly*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
hpux9*)
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
hpux10*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
fi
;;
hpux11*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
case $host_cpu in
hppa*64*|ia64*)
hardcode_direct=no
;;
*)
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
esac
fi
;;
irix5* | irix6* | nonstopux*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
netbsd*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
newsos6)
hardcode_direct=yes
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
openbsd*)
hardcode_direct=yes
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
else
case "$host_os" in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
hardcode_libdir_flag_spec='-R$libdir'
;;
*)
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
esac
fi
;;
os2*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
osf3*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
osf4* | osf5*)
if test "$GCC" = yes; then
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
# Both cc and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
fi
hardcode_libdir_separator=:
;;
solaris*)
hardcode_libdir_flag_spec='-R$libdir'
;;
sunos4*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=yes
hardcode_minus_L=yes
;;
sysv4)
case $host_vendor in
sni)
hardcode_direct=yes # is this really true???
;;
siemens)
hardcode_direct=no
;;
motorola)
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
;;
esac
;;
sysv4.3*)
;;
sysv4*MP*)
if test -d /usr/nec; then
ld_shlibs=yes
fi
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
;;
sysv5* | sco3.2v5* | sco5v6*)
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
hardcode_libdir_separator=':'
;;
uts4*)
hardcode_libdir_flag_spec='-L$libdir'
;;
*)
ld_shlibs=no
;;
esac
fi
# Check dynamic linker characteristics
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
# only about the one the linker finds when passed -lNAME. This is the last
# element of library_names_spec in libtool.m4, or possibly two of them if the
# linker has special search rules.
library_names_spec= # the last element of library_names_spec in libtool.m4
libname_spec='lib$name'
case "$host_os" in
aix3*)
library_names_spec='$libname.a'
;;
aix4* | aix5*)
library_names_spec='$libname$shrext'
;;
amigaos*)
library_names_spec='$libname.a'
;;
beos*)
library_names_spec='$libname$shrext'
;;
bsdi[45]*)
library_names_spec='$libname$shrext'
;;
cygwin* | mingw* | pw32*)
shrext=.dll
library_names_spec='$libname.dll.a $libname.lib'
;;
darwin* | rhapsody*)
shrext=.dylib
library_names_spec='$libname$shrext'
;;
dgux*)
library_names_spec='$libname$shrext'
;;
freebsd1*)
;;
kfreebsd*-gnu)
library_names_spec='$libname$shrext'
;;
freebsd* | dragonfly*)
case "$host_os" in
freebsd[123]*)
library_names_spec='$libname$shrext$versuffix' ;;
*)
library_names_spec='$libname$shrext' ;;
esac
;;
gnu*)
library_names_spec='$libname$shrext'
;;
hpux9* | hpux10* | hpux11*)
case $host_cpu in
ia64*)
shrext=.so
;;
hppa*64*)
shrext=.sl
;;
*)
shrext=.sl
;;
esac
library_names_spec='$libname$shrext'
;;
interix3*)
library_names_spec='$libname$shrext'
;;
irix5* | irix6* | nonstopux*)
library_names_spec='$libname$shrext'
case "$host_os" in
irix5* | nonstopux*)
libsuff= shlibsuff=
;;
*)
case $LD in
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
*) libsuff= shlibsuff= ;;
esac
;;
esac
;;
linux*oldld* | linux*aout* | linux*coff*)
;;
linux*)
library_names_spec='$libname$shrext'
;;
knetbsd*-gnu)
library_names_spec='$libname$shrext'
;;
netbsd*)
library_names_spec='$libname$shrext'
;;
newsos6)
library_names_spec='$libname$shrext'
;;
nto-qnx*)
library_names_spec='$libname$shrext'
;;
openbsd*)
library_names_spec='$libname$shrext$versuffix'
;;
os2*)
libname_spec='$name'
shrext=.dll
library_names_spec='$libname.a'
;;
osf3* | osf4* | osf5*)
library_names_spec='$libname$shrext'
;;
solaris*)
library_names_spec='$libname$shrext'
;;
sunos4*)
library_names_spec='$libname$shrext$versuffix'
;;
sysv4 | sysv4.3*)
library_names_spec='$libname$shrext'
;;
sysv4*MP*)
library_names_spec='$libname$shrext'
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
library_names_spec='$libname$shrext'
;;
uts4*)
library_names_spec='$libname$shrext'
;;
esac
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
# How to pass a linker flag through the compiler.
wl="$escaped_wl"
# Static library suffix (normally "a").
libext="$libext"
# Shared library suffix (normally "so").
shlibext="$shlibext"
# Format of library name prefix.
libname_spec="$escaped_libname_spec"
# Library names that the linker finds when passed -lNAME.
library_names_spec="$escaped_library_names_spec"
# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
# Whether we need a single -rpath flag with a separated argument.
hardcode_libdir_separator="$hardcode_libdir_separator"
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
# resulting binary.
hardcode_direct="$hardcode_direct"
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
# resulting binary.
hardcode_minus_L="$hardcode_minus_L"
EOF

View File

@ -1,19 +1,6 @@
# findutils import-gnulib.config -*- sh -*-
# What version of gnulib to use?
# To late: gnulib_version="2005-07-30"
# ?Too early gnulib_version="2005-07-10"
gnulib_version="2007-02-24"
# 4.2.29: At or after 2005-07-11 12:21:55 +0100 (lib/getcwd.h)
# 4.2.29: At or after 2005-07-11 12:21:55 +0100 (lib/time_r.h)
# 4.2.29: At or after 2005-07-15 22:01:41 +0100 (lib/quotearg.c)
# 4.2.29: At or after 2005-07-26 22:55:31 +0100 (m4/getopt.m4)
# 4.2.29: Before 2005-09-19 18:28:14 +0100 (lib/quotearg.c)
# 4.2.29: Before 2006-03-12 07:58:12 +0000 (lib/time_r.h)
gnulib_version="2007-08-23"
destdir="gnulib"

View File

@ -22,25 +22,7 @@
# include <config.h>
#endif
#ifndef __GNUC__
# if HAVE_ALLOCA_H
# include <alloca.h>
# else
# ifdef _AIX
# pragma alloca
# else
# ifdef _WIN32
# include <malloc.h>
# include <io.h>
# else
# ifndef alloca
char *alloca ();
# endif
# endif
# endif
# endif
#endif
#include <alloca.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
@ -53,6 +35,7 @@ char *alloca ();
#include "pathmax.h"
#include "error.h"
#include "filemode.h"
#include "idcache.h"
#include "listfile.h"
@ -63,8 +46,8 @@ char *alloca ();
#endif
/* The presence of unistd.h is assumed by gnulib these days, so we
* might as well assume it too.
/* The presence of unistd.h is assumed by gnulib these days, so we
* might as well assume it too.
*/
#include <unistd.h> /* for readlink() */
@ -181,9 +164,6 @@ struct group *getgrgid ();
char * get_link_name (char *name, char *relname);
static void print_name_with_quoting (register char *p, FILE *stream);
extern char * getgroup (gid_t gid);
extern char * getuser (uid_t uid);
/* NAME is the name to print.
RELNAME is the path to access it from the current directory.
@ -251,7 +231,7 @@ list_file (char *name,
#endif
else
fprintf (stream, "%8s ",
human_readable ((uintmax_t) statp->st_size, hbuf,
human_readable ((uintmax_t) statp->st_size, hbuf,
human_ceiling,
1,
output_block_size < 0 ? output_block_size : 1));

View File

@ -1,5 +1,5 @@
/* bigram -- list bigrams for locate
Copyright (C) 1994, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
Copyright (C) 1994, 2000, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -45,7 +45,6 @@
#endif
#include <sys/types.h>
#include <getline.h>
#include <xalloc.h>
#include "closeout.h"
@ -75,7 +74,7 @@ main (int argc, char **argv)
program_name = argv[0];
(void) argc;
atexit (close_stdout);
pathsize = oldpathsize = 1026; /* Increased as necessary by getline. */
path = xmalloc (pathsize);
oldpath = xmalloc (oldpathsize);

View File

@ -1,5 +1,6 @@
/* code -- bigram- and front-encode filenames for locate
Copyright (C) 1994, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
Copyright (C) 1994, 2000, 2003, 2004, 2005, 2007 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -34,13 +35,13 @@
followed by a (partially bigram-encoded) ASCII remainder.
The output lines have no terminating byte; the start of the next line
is indicated by its first byte having a value <= 30.
The encoding of the output bytes is:
0-28 likeliest differential counts + offset (14) to make nonnegative
30 escape code for out-of-range count to follow in next halfword
128-255 bigram codes (the 128 most common, as determined by `updatedb')
32-127 single character (printable) ASCII remainder
128-255 bigram codes (the 128 most common, as determined by `updatedb')
32-127 single character (printable) ASCII remainder
Written by James A. Woods <jwoods@adobe.com>.
Modified by David MacKenzie <djm@gnu.org>. */
@ -75,7 +76,6 @@
#endif
#include "locatedb.h"
#include <getline.h>
#include "closeout.h"
#include "gnulib-version.h"
@ -155,7 +155,7 @@ main (int argc, char **argv)
usage(stderr);
return 2;
}
if (0 == strcmp(argv[1], "--help"))
{
usage(stdout);
@ -167,7 +167,7 @@ main (int argc, char **argv)
printf (_("Built using GNU gnulib version %s\n"), gnulib_version);
return 0;
}
fp = fopen (argv[1], "r");
if (fp == NULL)
{

View File

@ -1,5 +1,5 @@
/* frcode -- front-compress a sorted list
Copyright (C) 1994, 2003, 2006 Free Software Foundation, Inc.
Copyright (C) 1994, 2003, 2006, 2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -93,7 +93,7 @@
/* We used to use (String) instead of just String, but apparentl;y ISO C
* doesn't allow this (at least, that's what HP said when someone reported
* this as a compiler bug). This is HP case number 1205608192. See
* also http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11250 (which references
* also http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11250 (which references
* ANSI 3.5.7p14-15). The Intel icc compiler also rejects constructs
* like: static const char buf[] = ("string");
*/
@ -102,7 +102,6 @@
#include "locatedb.h"
#include <getline.h>
#include <getopt.h>
#include "closeout.h"
@ -116,13 +115,13 @@ char *program_name;
static void
put_short (int c, FILE *fp)
{
/* XXX: The value may be negative, but I think ISO C doesn't
/* XXX: The value may be negative, but I think ISO C doesn't
* guarantee the assumptions we're making here will hold.
*/
assert(c <= SHRT_MAX);
assert(c >= SHRT_MIN);
putc (c >> 8, fp);
putc (c, fp);
putc (c, fp);
}
/* Return the length of the longest common prefix of strings S1 and S2. */
@ -134,7 +133,7 @@ prefix_length (char *s1, char *s2)
int limit = INT_MAX;
for (start = s1; *s1 == *s2 && *s1 != '\0'; s1++, s2++)
{
/* Don't emit a prefix length that will not fit into
/* Don't emit a prefix length that will not fit into
* our return type.
*/
if (0 == --limit)
@ -228,7 +227,7 @@ main (int argc, char **argv)
diffcount = count - oldcount;
if ( (diffcount > SHRT_MAX) || (diffcount < SHRT_MIN) )
{
/* We do this to prevent overflow of the value we
/* We do this to prevent overflow of the value we
* write with put_short()
*/
count = 0;

View File

@ -1,6 +1,6 @@
/* locate -- search databases for filenames that match patterns
Copyright (C) 1994, 1996, 1998, 1999, 2000, 2003,
2004, 2005 Free Software Foundation, Inc.
2004, 2005, 2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -30,8 +30,8 @@
0-28 likeliest differential counts + offset (14) to make nonnegative
30 escape code for out-of-range count to follow in next halfword
128-255 bigram codes (the 128 most common, as determined by `updatedb')
32-127 single character (printable) ASCII remainder
128-255 bigram codes (the 128 most common, as determined by `updatedb')
32-127 single character (printable) ASCII remainder
Earlier versions of GNU locate used to use a novel two-tiered
string search technique, which was described in Usenix ;login:, Vol
@ -123,7 +123,6 @@ extern int errno;
#endif
#include "locatedb.h"
#include <getline.h>
#include "xalloc.h"
#include "error.h"
#include "human.h"
@ -882,7 +881,7 @@ locate (int argc,
int regex,
int regex_options)
{
char *pathpart; /* A pattern to consider. */
char *pathpart; /* A pattern to consider. */
int argn; /* Index to current pattern in argv. */
int need_fold; /* Set when folding and any pattern is non-glob. */
int nread; /* number of bytes read from an entry. */
@ -1197,7 +1196,6 @@ main (int argc, char **argv)
{
char *dbpath;
unsigned long int found = 0uL;
int optc;
int ignore_case = 0;
int print = 0;
int just_count = 0;
@ -1230,108 +1228,115 @@ main (int argc, char **argv)
check_existence = ACCEPT_EITHER;
while ((optc = getopt_long (argc, argv, "Abcd:eEil:prsm0SwHPL", longopts, (int *) 0)) != -1)
switch (optc)
{
case '0':
separator = 0;
print_quoted_filename = false; /* print filename 'raw'. */
for (;;)
{
int opti = -1;
int optc = getopt_long (argc, argv, "Abcd:eEil:prsm0SwHPL", longopts,
&opti);
if (optc == -1)
break;
case 'A':
op_and = 1;
break;
case 'b':
basename_only = 1;
break;
case 'c':
just_count = 1;
break;
case 'd':
dbpath = optarg;
break;
case 'e':
check_existence = ACCEPT_EXISTING;
break;
case 'E':
check_existence = ACCEPT_NON_EXISTING;
break;
case 'i':
ignore_case = 1;
break;
case 'h':
usage (stdout);
return 0;
case 'p':
print = 1;
break;
case 'v':
printf (_("GNU locate version %s\n"), version_string);
printf (_("Built using GNU gnulib version %s\n"), gnulib_version);
return 0;
case 'w':
basename_only = 0;
break;
case 'r':
regex = 1;
break;
case REGEXTYPE_OPTION:
regex_options = get_regex_type(optarg);
break;
case 'S':
stats = 1;
break;
case 'L':
follow_symlinks = 1;
break;
/* In find, -P and -H differ in the way they handle paths
* given on the command line. This is not relevant for
* locate, but the -H option is supported because it is
* probably more intuitive to do so.
*/
case 'P':
case 'H':
follow_symlinks = 0;
break;
case 'l':
switch (optc)
{
char *end = optarg;
strtol_error err = xstrtoumax(optarg, &end, 10, &limits.limit, NULL);
if (LONGINT_OK != err)
{
STRTOL_FATAL_ERROR(optarg, _("argument to --limit"), err);
}
use_limit = 1;
case '0':
separator = 0;
print_quoted_filename = false; /* print filename 'raw'. */
break;
case 'A':
op_and = 1;
break;
case 'b':
basename_only = 1;
break;
case 'c':
just_count = 1;
break;
case 'd':
dbpath = optarg;
break;
case 'e':
check_existence = ACCEPT_EXISTING;
break;
case 'E':
check_existence = ACCEPT_NON_EXISTING;
break;
case 'i':
ignore_case = 1;
break;
case 'h':
usage (stdout);
return 0;
case 'p':
print = 1;
break;
case 'v':
printf (_("GNU locate version %s\n"), version_string);
printf (_("Built using GNU gnulib version %s\n"), gnulib_version);
return 0;
case 'w':
basename_only = 0;
break;
case 'r':
regex = 1;
break;
case REGEXTYPE_OPTION:
regex_options = get_regex_type (optarg);
break;
case 'S':
stats = 1;
break;
case 'L':
follow_symlinks = 1;
break;
/* In find, -P and -H differ in the way they handle paths
* given on the command line. This is not relevant for
* locate, but the -H option is supported because it is
* probably more intuitive to do so.
*/
case 'P':
case 'H':
follow_symlinks = 0;
break;
case 'l':
{
char *end = optarg;
strtol_error err = xstrtoumax (optarg, &end, 10, &limits.limit,
NULL);
if (LONGINT_OK != err)
xstrtol_fatal (err, opti, optc, longopts, optarg);
use_limit = 1;
}
break;
case 's': /* use stdio */
case 'm': /* use mmap */
/* These options are implemented simply for
* compatibility with FreeBSD
*/
break;
default:
usage (stderr);
return 1;
}
break;
case 's': /* use stdio */
case 'm': /* use mmap */
/* These options are implemented simply for
* compatibility with FreeBSD
*/
break;
default:
usage (stderr);
return 1;
}
}
if (!just_count && !stats)
print = 1;
@ -1339,7 +1344,7 @@ main (int argc, char **argv)
if (stats)
{
if (optind == argc)
use_limit = 0;
use_limit = 0;
}
else
{

View File

@ -3,6 +3,7 @@
# Common library files
gnulib/lib/argmatch.c
gnulib/lib/closeout.c
gnulib/lib/error.c
gnulib/lib/getopt.c
gnulib/lib/human.c
@ -10,17 +11,20 @@ gnulib/lib/quotearg.c
gnulib/lib/regex.c
gnulib/lib/rpmatch.c
gnulib/lib/strftime.c
gnulib/lib/strtol.c
gnulib/lib/xmalloc.c
gnulib/lib/xalloc-die.c
gnulib/lib/xstrtol-error.c
#Package source files
find/util.c
find/find.c
find/fstype.c
find/parser.c
find/pred.c
find/tree.c
find/util.c
lib/buildcmd.c
lib/regextype.c
locate/code.c
locate/frcode.c
locate/locate.c
xargs/xargs.c