support for scripts in $HOME/.openocd

Add $HOME/.openocd as the first default script search directory, allowing
the user to override the standard scripts.

Update the user guide with information on where OpenOCD expects to find
configuration files and scripts. Also fixed some minor formatting issues.

Add entry to NEWS as well.

Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
This commit is contained in:
Andreas Fritiofson
2009-11-24 00:32:54 +01:00
committed by Øyvind Harboe
parent 0d06a06f8b
commit 0583cb0a0d
3 changed files with 31 additions and 9 deletions

View File

@@ -101,7 +101,22 @@ static void add_default_dirs(void)
* listed last in the built-in search order, so the user can
* override these scripts with site-specific customizations.
*/
/// @todo Implement @c add_script_search_dir("${HOME}/.openocd").
const char *home = getenv("HOME");
if (home)
{
char *path;
path = alloc_printf("%s/.openocd", home);
if (path)
{
add_script_search_dir(path);
free(path);
}
}
add_script_search_dir(PKGDATADIR "/site");
add_script_search_dir(PKGDATADIR "/scripts");
#endif