From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 13 12:16:45 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 539D016A404 for ; Fri, 13 Apr 2007 12:16:45 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: from mail4out.barnet.com.au (mail4.barnet.com.au [202.83.178.125]) by mx1.freebsd.org (Postfix) with ESMTP id DA05D13C448 for ; Fri, 13 Apr 2007 12:16:44 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: by mail4out.barnet.com.au (Postfix, from userid 1001) id E8D2A37CBB7; Fri, 13 Apr 2007 22:16:43 +1000 (EST) X-Viruscan-Id: <461F74AB000118C0D42F81@BarNet> Received: from mail4auth.barnet.com.au (mail4.barnet.com.au [202.83.178.125]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mail4.barnet.com.au (Postfix) with ESMTP id A42DB423595; Fri, 13 Apr 2007 22:16:43 +1000 (EST) Received: from k7.mavetju (k7.mavetju.org [10.251.1.18]) by mail4auth.barnet.com.au (Postfix) with ESMTP id 25EE737BB9D; Fri, 13 Apr 2007 22:16:43 +1000 (EST) Received: by k7.mavetju (Postfix, from userid 1001) id A90DBF0; Fri, 13 Apr 2007 22:16:42 +1000 (EST) Date: Fri, 13 Apr 2007 22:16:42 +1000 From: Edwin Groothuis To: Evren Yurtesen , freebsd-hackers@freebsd.org Message-ID: <20070413121642.GB1028@k7.mavetju> Mail-Followup-To: Edwin Groothuis , Evren Yurtesen , freebsd-hackers@freebsd.org References: <461F1CCB.7070504@ispro.net> <20070413113537.GA1028@k7.mavetju> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070413113537.GA1028@k7.mavetju> User-Agent: Mutt/1.4.2.2i Cc: Subject: Re: any plans to enhance 'locate'? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2007 12:16:45 -0000 On Fri, Apr 13, 2007 at 09:35:37PM +1000, Edwin Groothuis wrote: > On Fri, Apr 13, 2007 at 09:01:47AM +0300, Evren Yurtesen wrote: > > Is there a reason why there is no port for slocate or the FreeBSD > > locate to not to be enhanced this way? > > > > There seems to be a port for this for Mac OS X: > > http://slocate.darwinports.com/dports/sysutils/slocate/ > > Port it to FreeBSD, and submit it for in the ports collection :-) In case you're brave, the basic work is done. All you need to do is something which does do the mkdir and pw group add slocate at the installation. Don't forget portlint :-) # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # slocate/ # slocate/Makefile # slocate/distinfo # slocate/files # slocate/files/patch-main.c # echo c - slocate/ mkdir -p slocate/ > /dev/null 2>&1 echo x - slocate/Makefile sed 's/^X//' >slocate/Makefile << 'END-of-slocate/Makefile' XPORTNAME= slocate XPORTVERSION= 2.7 XCATEGORIES= sysutils security XMASTER_SITES= http://www.mirrors.wiretapped.net/security/host-security/slocate/src/ X XCOMMENT= slocate XMAINTAINER= you X XUSE_GMAKE= yes XUSE_AUTOTOOLS= automake:14 XHAS_CONFIGURE= yes X XPLIST_FILES= bin/slocate X X# X# mkdir /var/db/slocate X# pw group add slocate X# slocate -u X# X X.include END-of-slocate/Makefile echo x - slocate/distinfo sed 's/^X//' >slocate/distinfo << 'END-of-slocate/distinfo' XMD5 (slocate-2.7.tar.gz) = 4872830642ea2ed5f9aff932720583c9 XSHA256 (slocate-2.7.tar.gz) = ddff733fcc5f240d40361c5acbce0011b2204efc506efb0da63c8d0e38947dcf XSIZE (slocate-2.7.tar.gz) = 87240 END-of-slocate/distinfo echo c - slocate/files mkdir -p slocate/files > /dev/null 2>&1 echo x - slocate/files/patch-main.c sed 's/^X//' >slocate/files/patch-main.c << 'END-of-slocate/files/patch-main.c' X--- main.c.orig Fri Apr 13 22:01:37 2007 X+++ main.c Fri Apr 13 22:07:18 2007 X@@ -540,53 +540,6 @@ X } X X X-#ifdef __FreeBSD__ X-/* Get File System type in the form of a string. "*fstype*" */ X- X-char * X- get_fs_type(int fs_type) X-{ X- if (fs_type == MOUNT_UFS) X- return("*UFS*"); X- else if (fs_type == MOUNT_NFS) X- return("*NFS*"); X- else if (fs_type == MOUNT_MFS) X- return("*MFS*"); X- else if (fs_type == MOUNT_MSDOS) X- return("*MSDOS*"); X- else if (fs_type == MOUNT_LFS) X- return("*LFS*"); X- else if (fs_type == MOUNT_LOFS) X- return("*LOFS*"); X- else if (fs_type == MOUNT_FDESC) X- return("*FDESC*"); X- else if (fs_type == MOUNT_PORTAL) X- return("*PORTAL*"); X- else if (fs_type == MOUNT_NULL) X- return("*NULL*"); X- else if (fs_type == MOUNT_UMAP) X- return("*UMAP*"); X- else if (fs_type == MOUNT_KERNFS) X- return("*KERNFS*"); X- else if (fs_type == MOUNT_PROCFS) X- return("*PROCFS*"); X- else if (fs_type == MOUNT_AFS) X- return("*AFS*"); X- else if (fs_type == MOUNT_CD9660) X- return("*CD9660*"); X- else if (fs_type == MOUNT_UNION) X- return("*UNION*"); X- else if (fs_type == MOUNT_DEVFS) X- return("*DEVFS*"); X- else if (fs_type == MOUNT_EXT2FS) X- return("*EXT2FS*"); X- else if (fs_type == MOUNT_TFS) X- return("*TFS*"); X- else X- return("*NONE*"); X-} X-#endif X- X /* Parse File System Type Exclusion */ X int X parse_fs_exclude(char *estr) X@@ -637,7 +590,7 @@ X num_mounts = getfsstat(fs_stat,bufsize,MNT_WAIT); X X for (i = 0; i < num_mounts; i+=1) { X- if (strstr(estr,get_fs_type(fs_stat[i].f_type))) { X+ if (strstr(estr,fs_stat[i].f_fstypename)) { X if (!exclude_str) { X exclude_str = malloc(strlen(fs_stat[i].f_mntonname)+1); X if (!exclude_str) END-of-slocate/files/patch-main.c exit Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://www.mavetju.org/weblog/