beagle r4767 - in trunk/beagle: conf-data conf-data/crawl-rules tools



Author: dbera
Date: Sun Jun  1 14:37:19 2008
New Revision: 4767
URL: http://svn.gnome.org/viewvc/beagle?rev=4767&view=rev

Log:
Add a crawl-executables for indexing the file names, extensions of /usr/bin, /usr/local/bin etc., keep it disabled by default.
Allow users to list the system indexes by /etc/beagle-crawl-system --list.
Allow users to update only a particular index by /etc/beagle-crawl-system crawl-monodoc


Added:
   trunk/beagle/conf-data/crawl-rules/crawl-executables
Modified:
   trunk/beagle/conf-data/Makefile.am
   trunk/beagle/tools/beagle-crawl-system.in

Modified: trunk/beagle/conf-data/Makefile.am
==============================================================================
--- trunk/beagle/conf-data/Makefile.am	(original)
+++ trunk/beagle/conf-data/Makefile.am	Sun Jun  1 14:37:19 2008
@@ -1,6 +1,7 @@
 CRAWL_RULES = \
 	$(srcdir)/crawl-rules/crawl-applications	\
 	$(srcdir)/crawl-rules/crawl-documentation	\
+	$(srcdir)/crawl-rules/crawl-executables		\
 	$(srcdir)/crawl-rules/crawl-manpages		\
 	$(srcdir)/crawl-rules/crawl-monodoc		\
 	$(srcdir)/crawl-rules/crawl-windows

Added: trunk/beagle/conf-data/crawl-rules/crawl-executables
==============================================================================
--- (empty file)
+++ trunk/beagle/conf-data/crawl-rules/crawl-executables	Sun Jun  1 14:37:19 2008
@@ -0,0 +1,20 @@
+CRAWL_ENABLED="no"
+
+# Use the same index as the applications index
+CRAWL_INDEX_NAME="applications"
+
+CRAWL_PATHS="/bin /sbin /usr/bin /usr/sbin /usr/local/bin/ /usr/local/sbin"
+
+# Only index files in the gives directories
+CRAWL_RECURSIVE="no"
+
+# Don't index content
+CRAWL_DISABLE_FILTERING="yes"
+
+CRAWL_DISABLE_DIRECTORIES="yes"
+
+CRAWL_DISABLE_ON_BATTERY="yes"
+
+CRAWL_CACHE_TEXT="no"
+
+CRAWL_REMOVE_DELETED_FILES="yes"

Modified: trunk/beagle/tools/beagle-crawl-system.in
==============================================================================
--- trunk/beagle/tools/beagle-crawl-system.in	(original)
+++ trunk/beagle/tools/beagle-crawl-system.in	Sun Jun  1 14:37:19 2008
@@ -37,6 +37,11 @@
     exit 1
 fi
 
+if [ "$1" = "--list" ]; then
+    grep -H CRAWL_ENABLED @sysconfdir@/beagle/crawl-rules/crawl-*
+    exit 0
+fi
+
 CRAWL_USER=beagleindex
 
 export TMPDIR=/tmp
@@ -45,13 +50,13 @@
 MONO_SHARED_DIR=`mktemp -d -p $TMPDIR .beagleindexwapi.XXXXXXXXXX`|| ( echo "$0: Can't create wapi directory!" ; exit 1 )
 chown $CRAWL_USER $MONO_SHARED_DIR
 
+if [ "$DEBUG" = "1" ]; then
+    echo "$0: Processing files in @sysconfdir@/beagle/crawl-rules/..."
+fi
+
 for crawl_file in @sysconfdir@/beagle/crawl-rules/crawl-*; do
     unset CRAWL_ENABLED CRAWL_DISABLE_FILTERING CRAWL_DISABLE_DIRECTORIES CRAWL_DISABLE_ON_BATTERY CRAWL_RECURSIVE CRAWL_CACHE_TEXT CRAWL_ALLOW_PATTERNS CRAWL_DENY_PATTERNS CRAWL_PATHS CRAWL_INDEX_NAME CRAWL_REMOVE_DELETED_FILES
 
-    if [ "$DEBUG" = "1" ]; then
-	echo "$0: Processing files in @sysconfdir@/beagle/crawl-rules/..."
-    fi
-
     if [ -f $crawl_file ] ; then
 	if [ "$DEBUG" = "1" ]; then
 	    echo "$0: Processing $crawl_file..."
@@ -59,6 +64,11 @@
 
 	. $crawl_file
 
+	if [ "$1" != "" ]; then
+	    CRAWL_FILE_NAME=`basename $crawl_file`
+	    [ "$1" = "$CRAWL_FILE_NAME" ] && CRAWL_ENABLED="yes" || CRAWL_ENABLED="no"
+	fi
+
 	if [ -n "$CRAWL_ENABLED" -a "$CRAWL_ENABLED" = "yes" ] ; then
 
 	    OPTIONS="`test -n "$CRAWL_DISABLE_FILTERING" -a "$CRAWL_DISABLE_FILTERING" = "yes" && \



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]