From 952a2d8e011254243e5c3707ef857eab01625f93 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Mon, 3 Jun 2013 19:52:47 +0200 Subject: [PATCH] Add per volume spotlight option --- etc/netatalk/netatalk.c | 6 ++++-- include/atalk/volume.h | 1 + libatalk/util/netatalk_conf.c | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/etc/netatalk/netatalk.c b/etc/netatalk/netatalk.c index b0407d0d..3e3444f2 100644 --- a/etc/netatalk/netatalk.c +++ b/etc/netatalk/netatalk.c @@ -78,8 +78,10 @@ static int set_sl_volumes(void) EC_NULL_LOG( volumes = getvolumes() ); for (vol = volumes; vol; vol = vol->v_next) { - bstring volnamequot = bformat("'%s'", vol->v_path); - bstrListPush(vollist, volnamequot); + if (vol->v_flags & AFPVOL_SPOTLIGHT) { + bstring volnamequot = bformat("'%s'", vol->v_path); + bstrListPush(vollist, volnamequot); + } } volnamelist = bjoin(vollist, sep); diff --git a/include/atalk/volume.h b/include/atalk/volume.h index b185f994..0981ee98 100644 --- a/include/atalk/volume.h +++ b/include/atalk/volume.h @@ -117,6 +117,7 @@ struct vol { Keep in sync with libatalk/util/volinfo.c */ #define AFPVOL_NOV2TOEACONV (1 << 5) /* no adouble:v2 to adouble:ea conversion */ +#define AFPVOL_SPOTLIGHT (1 << 6) /* Index volume for Spotlight searches */ #define AFPVOL_RO (1 << 8) /* read-only volume */ #define AFPVOL_NOSTAT (1 << 16) /* advertise the volume even if we can't stat() it * maybe because it will be mounted later in preexec */ diff --git a/libatalk/util/netatalk_conf.c b/libatalk/util/netatalk_conf.c index 0259cb02..8b26ee89 100644 --- a/libatalk/util/netatalk_conf.c +++ b/libatalk/util/netatalk_conf.c @@ -772,6 +772,8 @@ 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)) + volume->v_flags |= AFPVOL_SPOTLIGHT; if (getoption_bool(obj->iniconfig, section, "preexec close", preset, 0)) volume->v_preexec_close = 1; -- 2.39.2