Beagle configuration system “preview”

Finished the basic implementation of the configuration system. As previously mentioned, this is based on GConf.

It’s far from complete: you have to choose your settings before beagled is running, or restart beagled after changing the configuration for the new settings to take effect. You can’t do much in the way of configuration right now, but you can add more filesystem roots to be indexed.

It includes a new command line tool, beagle-config. For a demo, read the full post.

I’ve posted it to bug 172283 (direct patch link here). There’s some implementation details included at the top of the patch.

Read on for an example of beagle-config… It’s quite fancy as the configuration app itself is quite simple (and will be simplified further) – it pulls everything (the list of configuration “sections”, the operations you can perform, their descriptions, the invokation output) from Beagle.Util.Conf.

# beagle-config
beagle-config: Command-line interface to the Beagle config file.
Web page:
Copyright (C) 2005 Novell, Inc.

Usage: beagle-config [OPTIONS]
or: beagle-config

or: beagle-config

--beagled-reload-config Ask the beagle daemon to reload
the configuration file.
--list-sections List all available configuration sections.
--help Print this usage message.

If a section is specified with no options, then a list of the available commands for that section is shown.

# beagle-config --list-sections
Available configuration sections:
- indexing

# beagle-config indexing
Available options for section 'indexing':
- ListIgnorePatterns (List filename patterns to be ignored)
- ListRoots (List the indexing roots)
- AddRoot (Add a root path to be indexed)

# beagle-config indexing ListRoots
Current roots:
- Your home directory

# beagle-config indexing AddRoot /var/tmp/beagle
Root added.

# beagle-config indexing ListRoots
Current roots:
- Your home directory
- /var/tmp/beagle

Leave a Reply

You must be logged in to post a comment.