(cd $(DESTDIR)$(pdfdir); for i in $(linkedpdf); do rm -f $$i; $(LN_S) dot.pdf $$i; done;)
# create "neato", "fdp" etc as soflinks to "dot"
-# run dot once, if possible, to create plugin config
+# run "dot -c", if possible, to create plugin config
install-exec-hook:
(cd $(DESTDIR)$(bindir); for i in $(linkedprogram); do rm -f $$i; $(LN_S) dot $$i; done;)
- if test "x$(DESTDIR)" = "x"; then (cd $(bindir); ./dot -V 2>/dev/null;); fi
+ if test "x$(DESTDIR)" = "x"; then (cd $(bindir); ./dot -c;); fi
uninstall-hook:
(cd $(DESTDIR)$(man1dir); for i in $(linkedman); do rm -f $$i; done;)
%defattr(-,root,root,-)
%doc __doc/*
-# run "dot -V" to generate plugin config in %{_libdir}/%{name}/config
+# run "dot -c" to generate plugin config in %{_libdir}/%{name}/config
%post
-%{_bindir}/dot -V 2>/dev/null
+%{_bindir}/dot -c
%post tcl
-%{_bindir}/dot -V 2>/dev/null
+%{_bindir}/dot -c
%post devel
-%{_bindir}/dot -V 2>/dev/null
+%{_bindir}/dot -c
%changelog
* Wed Jul 20 2005 John Ellson <ellson@research.att.com>
return cnt;
}
+static int
+config_extra_args(GVC_t *gvc, int argc, char** argv)
+{
+ char** p = argv+1;
+ int i;
+ char* arg;
+ int cnt = 1;
+
+ for (i = 1; i < argc; i++) {
+ arg = argv[i];
+ if (arg && *arg == '-') {
+ switch (arg[1]) {
+ case 'c' : Config = TRUE; break;
+ default :
+ cnt++;
+ if (*p != arg) *p = arg;
+ p++;
+ break;
+ }
+ }
+ else {
+ cnt++;
+ if (*p != arg) *p = arg;
+ p++;
+ }
+ }
+ *p = 0;
+ return cnt;
+}
+
/* setDouble:
* If arg is an double, value is stored in v
* and functions returns 0; otherwise, returns 1.
argc = neato_extra_args(gvc, argc, argv);
argc = fdp_extra_args(gvc, argc, argv);
argc = memtest_extra_args(gvc, argc, argv);
+ argc = config_extra_args(gvc, argc, argv);
dotneato_initialize(gvc, argc, argv);
return 0;
}
EXTERN int Obj;
#endif
- EXTERN boolean Verbose, Reduce, MemTest;
+ EXTERN boolean Verbose, Reduce, MemTest, Config;
EXTERN char *HTTPServerEnVar;
EXTERN char *Output_file_name;
EXTERN int graphviz_errors;
static char *memtestItems = "\n\
-m - Memory test (Observe no growth with top. Kill when done.)\n";
+static char *configFlags = "(additional options for config) [-c]\n";
+static char *configItems = "\n\
+ -m - Configure plugins (Writes $prefix/lib/graphviz/config \n\
+ with available plugin information. Needs write priviledge.)\n";
+
void dotneato_usage(int exval)
{
FILE *outs;
fputs(neatoFlags, outs);
fputs(fdpFlags, outs);
fputs(memtestFlags, outs);
+ fputs(configFlags, outs);
fputs(genericItems, outs);
fputs(neatoItems, outs);
fputs(fdpItems, outs);
fputs(memtestItems, outs);
+ fputs(configItems, outs);
if (exval >= 0)
exit(exval);
Gvfilepath = getenv("GV_FILE_PATH");
/* configure for available plugins and codegens */
- gvconfig(gvc);
+ gvconfig(gvc, Config);
+ if (Config)
+ exit (0);
CmdName = basename(argv[0]);
i = gvlayout_select(gvc, CmdName);
aginit();
agnodeattr(NULL, "label", NODENAME_ESC);
gvc = gvNEWcontext(Info, username());
- gvconfig(gvc); /* configure for available plugins and codegens */
+ gvconfig(gvc, FALSE); /* configure for available plugins and codegens */
return gvc;
}
/*
gvconfig - parse a config file and install the identified plugins
*/
-void gvconfig(GVC_t * gvc)
+void gvconfig(GVC_t * gvc, boolean rescan)
{
#ifdef DISABLE_LTDL
gvplugin_library_t **libraryp;
strcpy(config_path, GVLIBDIR);
strcat(config_path, "/");
strcat(config_path, config_file_name);
- rc = stat(config_path, &config_st);
- if (rc == -1 || libdir_st.st_mtime > config_st.st_mtime) {
+ if (rescan) {
config_rescan(gvc, config_path);
}
else {
/* load in the cached plugin library data */
- rc = 0;
- if (config_st.st_size > MAX_SZ_CONFIG) {
+ rc = stat(config_path, &config_st);
+ if (rc == -1) {
+ agerr(AGERR,"Unable to stat %s.\n", config_path);
+ }
+ else if (config_st.st_size > MAX_SZ_CONFIG) {
agerr(AGERR,"%s is bigger than I can handle.\n", config_path);
}
else {
if (f)
fclose(f);
}
- if (!rc) {
- agerr(AGERR,"rescanning for plugins\n");
- config_rescan(gvc, config_path);
- }
}
if (config_path)
free(config_path);
/* configuration */
- extern void gvconfig(GVC_t * gvc);
+ extern void gvconfig(GVC_t * gvc, boolean rescan);
extern char *gvhostname(void);
/* plugins */
gvc = gvNEWcontext(Info, username());
/* configure for available plugins and codegens */
- gvconfig(gvc);
+ gvconfig(gvc, FALSE);
}
Agraph_t *digraph(char *name)
gvc = gvNEWcontext(Info, username());
/* configure for available plugins and codegens */
- gvconfig(gvc);
+ gvconfig(gvc, FALSE);
/* additional codegens */
for (p = cg; p->name; ++p)
gvplugin_install(gvc, API_render, p->name, 0, "cg", NULL,