From: Ralph Boehme Date: Tue, 18 Jun 2013 13:38:21 +0000 (+0200) Subject: Smarter spotlight option X-Git-Url: https://arthur.barton.de/gitweb/?p=netatalk.git;a=commitdiff_plain;h=98ada4ea7939f7559444be02961c4edb612f44f8 Smarter spotlight option --- diff --git a/doc/manpages/man5/afp.conf.5.xml b/doc/manpages/man5/afp.conf.5.xml index de085ae2..3d01b55e 100644 --- a/doc/manpages/man5/afp.conf.5.xml +++ b/doc/manpages/man5/afp.conf.5.xml @@ -912,10 +912,9 @@ no) (G)/(V) - Whether to enable Spotlight searches. Enable this global option - and then also add "spotlight = yes" to any volume you want to be able - to search with Spotlight. Note: once the global option is enabled, any - volume that is not enabled won't be searchable at all. + Whether to enable Spotlight searches. Note: once the global + option is enabled, any volume that is not enabled won't be + searchable at all. diff --git a/doc/manual/configuration.xml b/doc/manual/configuration.xml index 0054a0c0..3116f7a0 100644 --- a/doc/manual/configuration.xml +++ b/doc/manual/configuration.xml @@ -138,34 +138,16 @@ basedir regex = /usr/home users are advised to install Tracker from OpenCSW as this is at least version 0.15 and thus supports SPARQL - To enable Spotlight put this in your afp.conf: + You can enable Spotlight and indexing either globally or on a per + volume basis using the . - [Global] -... -spotlight = yes -... - - This will enable Spotlight functionality. For Solaris with Tracker - from OpenCSW also add:dbus daemon = /opt/csw/bin/dbus-daemon - - - Tracker SPARQL + For Solaris with Tracker from OpenCSW also add: + dbus daemon = /opt/csw/bin/dbus-daemon - Next you must enbale Spotlight indexing on a per volume - basis: - - [foo] -path = /bar -spotlight = yes -... - - Only volumes with a setting of spotlight = yes will be - searchable with Spotlight. - - - All other volumes won't be searchable at all - - + + Once Spotlight is enable for a single volume, all other volumes + won't be searchable at all. + Tracker RDF diff --git a/include/atalk/globals.h b/include/atalk/globals.h index 1f6cd048..232f5392 100644 --- a/include/atalk/globals.h +++ b/include/atalk/globals.h @@ -57,7 +57,8 @@ #define OPTION_ACL2MODE (1 << 10) #define OPTION_SHARE_RESERV (1 << 11) /* whether to use Solaris fcntl F_SHARE locks */ #define OPTION_DBUS_AFPSTATS (1 << 12) /* whether to run dbus thread for afpstats */ -#define OPTION_SPOTLIGHT (1 << 13) /* whether to enable Spotlight support */ +#define OPTION_SPOTLIGHT (1 << 13) /* whether to initialize Spotlight support */ +#define OPTION_SPOTLIGHT_VOL (1 << 14) /* whether spotlight shall be enabled by default for volumes */ #define PASSWD_NONE 0 #define PASSWD_SET (1 << 0) diff --git a/libatalk/util/netatalk_conf.c b/libatalk/util/netatalk_conf.c index 8b26ee89..26406e66 100644 --- a/libatalk/util/netatalk_conf.c +++ b/libatalk/util/netatalk_conf.c @@ -772,8 +772,10 @@ static struct vol *creatvol(AFPObj *obj, volume->v_flags |= AFPVOL_NOV2TOEACONV; if (getoption_bool(obj->iniconfig, section, "follow symlinks", preset, 0)) volume->v_flags |= AFPVOL_FOLLOWSYM; - if (getoption_bool(obj->iniconfig, section, "spotlight", preset, 0)) + if (getoption_bool(obj->iniconfig, section, "spotlight", preset, obj->options.flags & OPTION_SPOTLIGHT_VOL)) { volume->v_flags |= AFPVOL_SPOTLIGHT; + obj->options.flags |= OPTION_SPOTLIGHT; + } if (getoption_bool(obj->iniconfig, section, "preexec close", preset, 0)) volume->v_preexec_close = 1; @@ -1732,7 +1734,7 @@ int afp_config_parse(AFPObj *AFPObj, char *processname) if (iniparser_getboolean(config, INISEC_GLOBAL, "afp read locks", 0)) options->flags |= OPTION_AFP_READ_LOCK; if (iniparser_getboolean(config, INISEC_GLOBAL, "spotlight", 0)) - options->flags |= OPTION_SPOTLIGHT; + options->flags |= OPTION_SPOTLIGHT_VOL; if (!iniparser_getboolean(config, INISEC_GLOBAL, "save password", 1)) options->passwdbits |= PASSWD_NOSAVE; if (iniparser_getboolean(config, INISEC_GLOBAL, "set password", 0))