delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/10/30/16:45:09

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <39FDD87C.E21FF508@vcsd.com>
Date: Mon, 30 Oct 2000 14:22:20 -0600
From: "Dennis W. Bulgrien" <dbulgrien AT vcsd DOT com>
Reply-To: dbulgrien AT vcsd DOT com
Organization: Vertex Control Systems Division
X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U)
X-Accept-Language: en,pdf
MIME-Version: 1.0
To: cygwin AT sources DOT redhat DOT com
Subject: Re: locatedb: No such file
References: <39FDA331 DOT F26536AC AT vcsd DOT com>

--------------E37795E0B51FB2D8CAE28563
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Thanks for all your sympathy.  Special thanks to Kim-- her following tips did the trick.

	mkdir /usr/var
	Create the database of file names.  The script does not come with cygwin.  Edit for your path, etc.
	You may need to do specify a "usual" database named locatedb.  Otherwise the script just creates a database named @LOCATE_DB@ and may not put it in the directory you want it in!   something like:
		sh bin/updatedb.sh --output=/usr/var/locatedb
	shazam.
-- 
Dennis W. Bulgrien, Engineer            Mailto:dbulgrien AT vcsd DOT com
VertexRSI, Controls and Structures      http://www.vcsd.com
1915 Harrison Road                      tel: 903 295 1480 x287
Longview, TX  75604-5438                fax: 903 295 1479

"Dennis W. Bulgrien" wrote:
> 
> Though I left cygwin prompt open all night, locate fails.  Is it supposed to work?
> 
> $ locate dsp.bat
> locate: /usr/var/locatedb: No such file or directory
> --
> Dennis W. Bulgrien, Engineer            Mailto:dbulgrien AT vcsd DOT com
> VertexRSI, Controls and Structures      http://www.vcsd.com
> 1915 Harrison Road                      tel: 903 295 1480 x287
> Longview, TX  75604-5438                fax: 903 295 1479
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
--------------E37795E0B51FB2D8CAE28563
Content-Type: application/x-sh;
 name="updatedb.sh"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="updatedb.sh"

#!/bin/sh
# updatedb -- build a locate pathname database
# Copyright (C) 1994 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
# the Free Software Foundation; either version 2, or (at your option)
# any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

# csh original by James Woods; sh conversion by David MacKenzie.

usage="\
Usage: updatedb [--localpaths='dir1 dir2...'] [--netpaths='dir1 dir2...']
       [--prunepaths='dir1 dir2...'] [--output=dbfile] [--netuser=user]
       [--old-format] [--version] [--help]"

old=no
for arg
do
  opt=`echo $arg|sed 's/^\([^=]*\).*/\1/'`
  val=`echo $arg|sed 's/^[^=]*=\(.*\)/\1/'`
  case "$opt" in
    --localpaths) SEARCHPATHS="$val" ;;
    --netpaths) NETPATHS="$val" ;;
    --prunepaths) PRUNEPATHS="$val" ;;
    --output) LOCATE_DB="$val" ;;
    --netuser) NETUSER="$val" ;;
    --old-format) old=yes ;;
    --version) echo "GNU updatedb version @version@"; exit 0 ;;
    --help) echo "$usage"; exit 0 ;;
    *) echo "updatedb: invalid option $opt
$usage" >&2
       exit 1 ;;
  esac
done

# You can set these in the environment, or use command-line options,
# to override their defaults:

# Non-network directories to put in the database.
: ${SEARCHPATHS="/"}

# Network (NFS, AFS, RFS, etc.) directories to put in the database.
: ${NETPATHS=}

# Directories to not put in the database, which would otherwise be.
: ${PRUNEPATHS="/tmp /usr/tmp /var/tmp /afs"}

# The same, in the form of a regex that find can use.
test -z "$PRUNEREGEX" &&
  PRUNEREGEX=`echo $PRUNEPATHS|sed -e 's,^,\\\(^,' -e 's, ,$\\\)\\\|\\\(^,g' -e 's,$,$\\\),'`

# The database file to build.
: ${LOCATE_DB=@LOCATE_DB@}

# Directory to hold intermediate files.
if test -d /var/tmp; then
  : ${TMPDIR=/var/tmp}
else
  : ${TMPDIR=/usr/tmp}
fi

# The user to search network directories as.
: ${NETUSER=daemon}

# The directory containing the subprograms.
: ${LIBEXECDIR=@libexecdir@}

# The directory containing find.
: ${BINDIR=@bindir@}

# The names of the utilities to run to build the database.
# KAB : ${find=@find@}
: ${find=d:/cygwin/bin/find.exe}
# KAB : ${frcode=@frcode@}
: ${frcode=d:/cygwin/usr/libexec/frcode.exe}
# KAB : ${bigram=@bigram@}
: ${bigram=c:/cygnus1.2/usr/libexec/bigram.exe}
# KAB : ${code=@code@}
: ${code=c:/cygnus1.2/usr/libexec/code.exe}

PATH=$LIBEXECDIR:$BINDIR:/usr/ucb:/bin:/usr/bin:$PATH export PATH

# Make and code the file list.
# Sort case insensitively for users' convenience.

if test $old = no; then

# FIXME figure out how to sort null-terminated strings, and use -print0.
{
if test -n "$SEARCHPATHS"; then
  $find $SEARCHPATHS \
  \( -fstype nfs -o -fstype NFS -o -type d -regex "$PRUNEREGEX" \) -prune -o -print
fi

if test -n "$NETPATHS"; then
  su $NETUSER -c \
  "$find $NETPATHS \\( -type d -regex \"$PRUNEREGEX\" -prune \\) -o -print"
fi
} | sort -f | $frcode > $LOCATE_DB.n

# To avoid breaking locate while this script is running, put the
# results in a temp file, then rename it atomically.
if test -s $LOCATE_DB.n; then
  rm -f $LOCATE_DB
  mv $LOCATE_DB.n $LOCATE_DB
  chmod 644 $LOCATE_DB
else
  echo "updatedb: new database would be empty" >&2
  rm -f $LOCATE_DB.n
fi

else # old

bigrams=$TMPDIR/f.bigrams$$
filelist=$TMPDIR/f.list$$
trap 'rm -f $bigrams $filelist; exit' 1 15

# Alphabetize subdirectories before file entries using tr.  James says:
# "to get everything in monotonic collating sequence, to avoid some
# breakage i'll have to think about."
{
if test -n "$SEARCHPATHS"; then
  $find $SEARCHPATHS \
  \( -fstype nfs -o -fstype NFS -o -type d -regex "$PRUNEREGEX" \) -prune -o -print
fi
if test -n "$NETPATHS"; then
  su $NETUSER -c \
  "$find $NETPATHS \\( -type d -regex \"$PRUNEREGEX\" -prune \\) -o -print"
fi
} | tr / '\001' | sort -f | tr '\001' / > $filelist

# Compute the (at most 128) most common bigrams in the file list.
$bigram < $filelist | sort | uniq -c | sort -nr |
  awk '{ if (NR <= 128) print $2 }' | tr -d '\012' > $bigrams

# Code the file list.
$code $bigrams < $filelist > $LOCATE_DB
chmod 644 $LOCATE_DB

rm -f $bigrams $filelist $errs

fi


--------------E37795E0B51FB2D8CAE28563
Content-Type: text/plain; charset=us-ascii

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
--------------E37795E0B51FB2D8CAE28563--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019