Renamed config(1) to configctl(1) for consistency (and to avoid a conflict on NetBSD)

This commit is contained in:
Pierre Pronchery 2014-05-29 20:18:04 +02:00
parent f004921fe1
commit f5540546c8
8 changed files with 49 additions and 49 deletions

View File

@ -31,8 +31,8 @@ dist:
$(PACKAGE)-$(VERSION)/data/pkgconfig.sh \
$(PACKAGE)-$(VERSION)/data/project.conf \
$(PACKAGE)-$(VERSION)/doc/Makefile \
$(PACKAGE)-$(VERSION)/doc/config.css.xml \
$(PACKAGE)-$(VERSION)/doc/config.xml \
$(PACKAGE)-$(VERSION)/doc/configctl.css.xml \
$(PACKAGE)-$(VERSION)/doc/configctl.xml \
$(PACKAGE)-$(VERSION)/doc/docbook.sh \
$(PACKAGE)-$(VERSION)/doc/gtkdoc.sh \
$(PACKAGE)-$(VERSION)/doc/manual.css.xml \
@ -102,7 +102,7 @@ dist:
$(PACKAGE)-$(VERSION)/tests/Makefile \
$(PACKAGE)-$(VERSION)/tests/tests.sh \
$(PACKAGE)-$(VERSION)/tests/project.conf \
$(PACKAGE)-$(VERSION)/tools/config.c \
$(PACKAGE)-$(VERSION)/tools/configctl.c \
$(PACKAGE)-$(VERSION)/tools/COPYING \
$(PACKAGE)-$(VERSION)/tools/Makefile \
$(PACKAGE)-$(VERSION)/tools/project.conf \

View File

@ -1,5 +1,5 @@
SUBDIRS = gtkdoc
TARGETS = config.1 config.html gtkdoc/libSystem.types gtkdoc/tmpl.stamp gtkdoc/sgml.stamp gtkdoc/html.stamp
TARGETS = configctl.1 configctl.html gtkdoc/libSystem.types gtkdoc/tmpl.stamp gtkdoc/sgml.stamp gtkdoc/html.stamp
PREFIX = /usr/local
DESTDIR =
RM = rm -f
@ -13,11 +13,11 @@ all: subdirs $(TARGETS)
subdirs:
@for i in $(SUBDIRS); do (cd "$$i" && $(MAKE)) || exit; done
config.1: config.xml
./docbook.sh -P "$(PREFIX)" -- "config.1"
configctl.1: configctl.xml
./docbook.sh -P "$(PREFIX)" -- "configctl.1"
config.html: config.css.xml config.xml manual.css.xml
./docbook.sh -P "$(PREFIX)" -- "config.html"
configctl.html: configctl.css.xml configctl.xml manual.css.xml
./docbook.sh -P "$(PREFIX)" -- "configctl.html"
gtkdoc/libSystem.types:
./gtkdoc.sh -P "$(PREFIX)" -- "gtkdoc/libSystem.types"
@ -33,25 +33,25 @@ gtkdoc/html.stamp: gtkdoc/libSystem-docs.xml gtkdoc/sgml.stamp gtkdoc/tmpl.stamp
clean:
@for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) clean) || exit; done
$(RM) -- $(config.1_OBJS) $(config.html_OBJS) $(gtkdoc/libSystem.types_OBJS) $(gtkdoc/tmpl.stamp_OBJS) $(gtkdoc/sgml.stamp_OBJS) $(gtkdoc/html.stamp_OBJS)
$(RM) -- $(configctl.1_OBJS) $(configctl.html_OBJS) $(gtkdoc/libSystem.types_OBJS) $(gtkdoc/tmpl.stamp_OBJS) $(gtkdoc/sgml.stamp_OBJS) $(gtkdoc/html.stamp_OBJS)
./gtkdoc.sh -c -P "$(PREFIX)" -- "gtkdoc/html.stamp"
distclean:
@for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) distclean) || exit; done
$(RM) -- $(config.1_OBJS) $(config.html_OBJS) $(gtkdoc/libSystem.types_OBJS) $(gtkdoc/tmpl.stamp_OBJS) $(gtkdoc/sgml.stamp_OBJS) $(gtkdoc/html.stamp_OBJS)
$(RM) -- $(configctl.1_OBJS) $(configctl.html_OBJS) $(gtkdoc/libSystem.types_OBJS) $(gtkdoc/tmpl.stamp_OBJS) $(gtkdoc/sgml.stamp_OBJS) $(gtkdoc/html.stamp_OBJS)
./gtkdoc.sh -c -P "$(PREFIX)" -- "gtkdoc/html.stamp"
$(RM) -- $(TARGETS)
install: $(TARGETS)
@for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) install) || exit; done
./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "config.1"
./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "config.html"
./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "configctl.1"
./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "configctl.html"
./gtkdoc.sh -P "$(DESTDIR)$(PREFIX)" -i -- "gtkdoc/html.stamp"
uninstall:
@for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) uninstall) || exit; done
./docbook.sh -P "$(DESTDIR)$(PREFIX)" -u -- "config.1"
./docbook.sh -P "$(DESTDIR)$(PREFIX)" -u -- "config.html"
./docbook.sh -P "$(DESTDIR)$(PREFIX)" -u -- "configctl.1"
./docbook.sh -P "$(DESTDIR)$(PREFIX)" -u -- "configctl.html"
./gtkdoc.sh -P "$(DESTDIR)$(PREFIX)" -u -- "gtkdoc/html.stamp"
.PHONY: all subdirs clean distclean install uninstall

View File

@ -9,7 +9,7 @@
<!ENTITY section "1">
<!ENTITY title "libSystem User Manual">
<!ENTITY package "DeforaOS libSystem">
<!ENTITY name "config">
<!ENTITY name "configctl">
<!ENTITY purpose "Generic tool to parse and update configuration files">
]>
<refentry>

View File

@ -1,17 +1,17 @@
subdirs=gtkdoc
targets=config.1,config.html,gtkdoc/libSystem.types,gtkdoc/tmpl.stamp,gtkdoc/sgml.stamp,gtkdoc/html.stamp
dist=Makefile,config.css.xml,config.xml,docbook.sh,gtkdoc.sh,manual.css.xml
targets=configctl.1,configctl.html,gtkdoc/libSystem.types,gtkdoc/tmpl.stamp,gtkdoc/sgml.stamp,gtkdoc/html.stamp
dist=Makefile,configctl.css.xml,configctl.xml,docbook.sh,gtkdoc.sh,manual.css.xml
[config.1]
[configctl.1]
type=script
script=./docbook.sh
depends=config.xml
depends=configctl.xml
install=
[config.html]
[configctl.html]
type=script
script=./docbook.sh
depends=config.css.xml,config.xml,manual.css.xml
depends=configctl.css.xml,configctl.xml,manual.css.xml
install=
[gtkdoc/libSystem.types]

View File

@ -1,4 +1,4 @@
TARGETS = config
TARGETS = configctl
PREFIX = /usr/local
DESTDIR =
BINDIR = $(PREFIX)/bin
@ -17,27 +17,27 @@ INSTALL = install
all: $(TARGETS)
config_OBJS = config.o
config_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS)
config_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
configctl_OBJS = configctl.o
configctl_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS)
configctl_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
config: $(config_OBJS)
$(CC) -o config $(config_OBJS) $(config_LDFLAGS)
configctl: $(configctl_OBJS)
$(CC) -o configctl $(configctl_OBJS) $(configctl_LDFLAGS)
config.o: config.c
$(CC) $(config_CFLAGS) -c config.c
configctl.o: configctl.c
$(CC) $(configctl_CFLAGS) -c configctl.c
clean:
$(RM) -- $(config_OBJS)
$(RM) -- $(configctl_OBJS)
distclean: clean
$(RM) -- $(TARGETS)
install: $(TARGETS)
$(MKDIR) $(DESTDIR)$(BINDIR)
$(INSTALL) -m 0755 config $(DESTDIR)$(BINDIR)/config
$(INSTALL) -m 0755 configctl $(DESTDIR)$(BINDIR)/configctl
uninstall:
$(RM) -- $(DESTDIR)$(BINDIR)/config
$(RM) -- $(DESTDIR)$(BINDIR)/configctl
.PHONY: all clean distclean install uninstall

View File

@ -22,14 +22,14 @@
#include "System/error.h"
#ifndef PROGNAME
# define PROGNAME "config"
# define PROGNAME "configctl"
#endif
/* config */
/* configctl */
/* private */
/* prototypes */
static int _config(int verbose, int write, char const * filename, int argc,
static int _configctl(int verbose, int write, char const * filename, int argc,
char * argv[]);
static int _error(char const * progname, int ret);
@ -37,11 +37,11 @@ static int _usage(void);
/* functions */
/* config */
static int _config_do(int verbose, char const * filename, char const * section,
char const * key, char const * value);
/* configctl */
static int _configctl_do(int verbose, char const * filename,
char const * section, char const * key, char const * value);
static int _config(int verbose, int write, char const * filename, int argc,
static int _configctl(int verbose, int write, char const * filename, int argc,
char * argv[])
{
int ret = 0;
@ -62,13 +62,13 @@ static int _config(int verbose, int write, char const * filename, int argc,
*(key++) = '\0';
if(write && (value = strchr(key, '=')) != NULL)
*(value++) = '\0';
ret |= _config_do(verbose, filename, section, key, value);
ret |= _configctl_do(verbose, filename, section, key, value);
}
return (ret == 0) ? 0 : 2;
}
static int _config_do(int verbose, char const * filename, char const * section,
char const * key, char const * value)
static int _configctl_do(int verbose, char const * filename,
char const * section, char const * key, char const * value)
{
int ret = 0;
Config * config;
@ -113,8 +113,8 @@ static int _error(char const * progname, int ret)
/* usage */
static int _usage(void)
{
fputs("Usage: config -f filename [-v] [section.]key...\n"
" config -w -f filename [-v] [section.]key[=value]...\n", stderr);
fputs("Usage: " PROGNAME " -f filename [-v] [section.]key...\n"
" " PROGNAME " -w -f filename [-v] [section.]key[=value]...\n", stderr);
return 1;
}
@ -146,6 +146,6 @@ int main(int argc, char * argv[])
}
if(filename == NULL || optind == argc)
return _usage();
return (_config(verbose, write, filename, argc - optind, &argv[optind])
== 0) ? 0 : 2;
return (_configctl(verbose, write, filename, argc - optind,
&argv[optind]) == 0) ? 0 : 2;
}

View File

@ -1,4 +1,4 @@
targets=config
targets=configctl
cppflags_force=-I ../include
cppflags=
cflags_force=-W
@ -6,7 +6,7 @@ cflags=-Wall -g -O2 -pedantic
ldflags_force=-L../src -Wl,-rpath,$(PREFIX)/lib -lSystem
dist=COPYING,Makefile
[config]
[configctl]
type=binary
sources=config.c
sources=configctl.c
install=$(BINDIR)