forked from pool/graphviz
43 lines
1.6 KiB
Diff
43 lines
1.6 KiB
Diff
From: Andreas Gruenbacher <agruen@suse.de>
|
|
Subject: Add a -C option to specify an alternative config file
|
|
|
|
Add this patch without applying it for now; we need additional
|
|
changes before the config file can be created in the build
|
|
system without being root.
|
|
|
|
Index: graphviz-2.6/lib/common/args.c
|
|
===================================================================
|
|
--- graphviz-2.6.orig/lib/common/args.c
|
|
+++ graphviz-2.6/lib/common/args.c
|
|
@@ -122,6 +122,16 @@ config_extra_args(GVC_t *gvc, int argc,
|
|
if (arg && *arg == '-') {
|
|
switch (arg[1]) {
|
|
case 'c' : Config = TRUE; break;
|
|
+ case 'C' :
|
|
+ if (!arg[2]) {
|
|
+ fprintf (stderr, "No argument for -C flag\n");
|
|
+ dotneato_usage (1);
|
|
+ }
|
|
+ if (gvc->config_path)
|
|
+ free(gvc->config_path);
|
|
+ gvc->config_path = gmalloc(strlen(arg+1) + 1);
|
|
+ strcpy(gvc->config_path, arg+1);
|
|
+ break;
|
|
default :
|
|
cnt++;
|
|
if (*p != arg) *p = arg;
|
|
Index: graphviz-2.6/lib/common/input.c
|
|
===================================================================
|
|
--- graphviz-2.6.orig/lib/common/input.c
|
|
+++ graphviz-2.6/lib/common/input.c
|
|
@@ -64,7 +64,8 @@ static char *memtestItems = "\n\
|
|
static char *configFlags = "(additional options for config) [-c]\n";
|
|
static char *configItems = "\n\
|
|
-c - Configure plugins (Writes $prefix/lib/graphviz/config \n\
|
|
- with available plugin information. Needs write priviledge.)\n";
|
|
+ with available plugin information. Needs write priviledge.)\n\
|
|
+ -C file - Use an alternative config file.\n";
|
|
|
|
void dotneato_usage(int exval)
|
|
{
|