Received: (at submit) by bugs.debian.org; 30 Dec 1998 13:10:01 +0000 Received: (qmail 10385 invoked from network); 30 Dec 1998 13:09:58 -0000 Received: from finlandia.infodrom.north.de (root@134.106.121.3) by master.debian.org with SMTP; 30 Dec 1998 13:09:58 -0000 Received: at Infodrom Oldenburg (/\##/\ Smail-3.2.0.102 1998-Aug-2 #2) by finlandia.Infodrom.North.DE via sendmail from stdin id for submit@bugs.debian.org; Wed, 30 Dec 1998 14:09:38 +0100 (CET) Message-Id: Date: Wed, 30 Dec 1998 14:09:38 +0100 (CET) From: joey@finlandia.Infodrom.North.DE (Martin Schulze) To: submit@bugs.debian.org X-Header: dpkg-bug-report 4.1-33.1 Subject: Support for FTP servers Bcc: Reply-To: joey@infodrom.north.de (Martin Schulze) Package: findutils Version: 4.1-33 Severity: wishlist Hi, I'm running a large FTP server with its /pub directory mounted on /pub for convenience. I like to be able to search through the ftp-server without bothering the regular locatedb - I don't want to search on the ftp-server when looking for local filles. I also like to be able to produce URLs to certain files since people keep bothering me with questions like "where can I find this and that". Thus I've modified the filerc package and added support for this: a) Exclude /home/ftp/pub from the regular updatedb run b) Add a second run if /home/ftp/pub exists and remove /home/ftp from the generated path. The file locatedb.pub will be created. c) Add the program ploc which is a simple frontend to locate and queries the locatedb.pub file. It can produce URLs if requested via -f. I would be glad if you would include a similar mechanism in the package. Here are my changes: diff -u -Nur --exclude CVS orig/findutils-4.1/debian/changelog findutils-4.1/debian/changelog --- orig/findutils-4.1/debian/changelog Wed Dec 30 13:41:56 1998 +++ findutils-4.1/debian/changelog Wed Dec 30 13:45:16 1998 @@ -1,3 +1,12 @@ +findutils (4.1-33.1) unstable; urgency=low + + * Non-maintainer release + * Fixed typo in changelog + * Added 2nd run for updatedb in cronjob + * Added ploc program + + -- Martin Schulze Wed, 30 Dec 1998 13:45:15 +0100 + findutils (4.1-33) frozen unstable; urgency=low * re to remove predependency problem with a specific version libc6. @@ -9,7 +18,7 @@ * added documentation for the environment variables PRUNEPATHS, PRUNEFS, and NETPATHS for updatedb in find.texi and updatedb.1. Added documentation for --prunefs in updatedb. (fixes bug #29755). - * link ChangeLog.gz to changelog.gz, to following policy manual. + * link ChangeLog.gz to changelog.gz, to follow policy manual. -- Kevin Dalley Fri, 4 Dec 1998 23:17:57 -0800 diff -u -Nur --exclude CVS orig/findutils-4.1/debian/cron.find findutils-4.1/debian/cron.find --- orig/findutils-4.1/debian/cron.find Wed Dec 30 13:41:56 1998 +++ findutils-4.1/debian/cron.find Wed Dec 30 13:56:27 1998 @@ -10,3 +10,12 @@ fi cd / && updatedb --localuser=nobody 2>/dev/null + +ftpdir=/home/ftp +if [ -d $ftpdir/pub ] +then + out=/var/lib/locate/locatedb.pub + unset PRUNEFS + unset PRUNEPATHS + cd / && updatedb --localuser=nobody --localpaths=$ftpdir --ftpdir=$ftpdir --output=$out 2>/dev/null +fi diff -u -Nur --exclude CVS orig/findutils-4.1/debian/ploc findutils-4.1/debian/ploc --- orig/findutils-4.1/debian/ploc Thu Jan 1 01:00:00 1970 +++ findutils-4.1/debian/ploc Wed Dec 30 14:01:04 1998 @@ -0,0 +1,34 @@ +#! /bin/bash + +server=`hostname -f` +server=ftp.${server#*.} + +usage() +{ + echo "ploc - Public locate of files" + echo + echo "ploc [-f [ftphost]] [-h|--help] search-string" + echo " -f adds $server in front" + echo +} + +if [ $# -gt 0 ]; then + if [ "$1" = "-h" -o "$1" = "--help" ]; then + usage + exit + fi + + if [ "$1" = "-f" ]; then + shift + if [ $# -gt 1 ]; then + server=$1 + shift + fi + locate --database=/var/lib/locate/locatedb.pub $* \ + | sed "s,^,ftp://$server,g" + else + locate --database=/var/lib/locate/locatedb.pub $* + fi +else + usage +fi diff -u -Nur --exclude CVS orig/findutils-4.1/debian/rules findutils-4.1/debian/rules --- orig/findutils-4.1/debian/rules Wed Dec 30 13:41:56 1998 +++ findutils-4.1/debian/rules Wed Dec 30 13:40:31 1998 @@ -63,6 +63,7 @@ gzip -9v debian/tmp/usr/info/* gzip -9v debian/tmp/usr/man/man[15]/* install -m 0644 debian/copyright debian/tmp/usr/doc/$(package)/. + install -m 0755 debian/ploc debian/tmp/usr/bin/. install -m 0644 debian/changelog \ debian/tmp/usr/doc/$(package)/changelog.Debian gzip -9v debian/tmp/usr/doc/$(package)/changelog.Debian diff -u -Nur --exclude CVS orig/findutils-4.1/debian/updatedb.conf findutils-4.1/debian/updatedb.conf --- orig/findutils-4.1/debian/updatedb.conf Wed Dec 30 13:41:56 1998 +++ findutils-4.1/debian/updatedb.conf Wed Dec 30 13:50:17 1998 @@ -4,8 +4,9 @@ PRUNEFS="NFS nfs afs proc smbfs autofs auto iso9660" export PRUNEFS # paths which are pruned from updatedb database -PRUNEPATHS="/tmp /usr/tmp /var/tmp /afs /amd /alex" +PRUNEPATHS="/tmp /usr/tmp /var/tmp /afs /amd /alex /home/ftp/pub" export PRUNEPATHS # netpaths which are added NETPATHS="" export NETPATHS + diff -u -Nur --exclude CVS orig/findutils-4.1/locate/updatedb.sh findutils-4.1/locate/updatedb.sh --- orig/findutils-4.1/locate/updatedb.sh Wed Dec 30 13:41:57 1998 +++ findutils-4.1/locate/updatedb.sh Wed Dec 30 13:16:57 1998 @@ -30,6 +30,7 @@ opt=`echo $arg|sed 's/^\([^=]*\).*/\1/'` val=`echo $arg|sed 's/^[^=]*=\(.*\)/\1/'` case "$opt" in + --ftpdir) FTPDIR="$val" SEDCMD="sed -e s,$val,,g" ;; --localpaths) SEARCHPATHS="$val" ;; --netpaths) NETPATHS="$val" ;; --prunepaths) PRUNEPATHS="$val" ;; @@ -49,6 +50,9 @@ # You can set these in the environment, or use command-line options, # to override their defaults: +# Maybe remove paths outside of aFTP chroot directory +: ${SEDCMD="cat"} + # Non-network directories to put in the database. : ${SEARCHPATHS="/"} @@ -131,7 +135,7 @@ $find $NETPATHS \( -type d -regex "$PRUNEREGEX" -prune \) -o -print fi fi -} | sort -f | $frcode > $LOCATE_DB.n +} | $SEDCMD | 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. Regards, Joey -- If you come from outside of Finland, you live in wrong country. -- motd of irc.funet.fi Please always Cc to me when replying to me on the lists.