From 78a39d6019e14a576bd58a26f0c161980ae51daf Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Fri, 6 Dec 2013 23:32:14 +0100 Subject: [PATCH] LibUCW: Added `ucw-' prefix to utils. --- ucw/daemon.h | 2 +- ucw/default.cfg | 2 +- ucw/doc/basecode.txt | 2 +- ucw/doc/daemon.txt | 2 +- ucw/shell/Makefile | 10 +++++----- ucw/shell/config.t | 10 +++++----- ucw/shell/libucw.sh | 10 +++++----- ucw/shell/{config.c => ucw-config.c} | 4 ++-- ucw/shell/{logger.c => ucw-logger.c} | 4 ++-- ucw/shell/{logoutput.c => ucw-logoutput.c} | 10 +++++----- ucw/utils/Makefile | 14 +++++++------- ucw/utils/basecode.t | 6 +++--- ucw/utils/{basecode.c => ucw-basecode.c} | 2 +- .../{daemon-control.c => ucw-daemon-control.c} | 8 ++++---- ucw/utils/{daemon-helper.c => ucw-daemon-helper.c} | 12 ++++++------ ucw/utils/{rotate-log.pl => ucw-rotate-log.pl} | 2 +- ucw/utils/{urltool.c => ucw-urltool.c} | 2 +- 17 files changed, 51 insertions(+), 51 deletions(-) rename ucw/shell/{config.c => ucw-config.c} (98%) rename ucw/shell/{logger.c => ucw-logger.c} (90%) rename ucw/shell/{logoutput.c => ucw-logoutput.c} (97%) rename ucw/utils/{basecode.c => ucw-basecode.c} (93%) rename ucw/utils/{daemon-control.c => ucw-daemon-control.c} (93%) rename ucw/utils/{daemon-helper.c => ucw-daemon-helper.c} (92%) rename ucw/utils/{rotate-log.pl => ucw-rotate-log.pl} (86%) rename ucw/utils/{urltool.c => ucw-urltool.c} (98%) diff --git a/ucw/daemon.h b/ucw/daemon.h index c5beacc0..303e8c84 100644 --- a/ucw/daemon.h +++ b/ucw/daemon.h @@ -95,7 +95,7 @@ enum daemon_control_action { **/ enum daemon_control_status daemon_control(struct daemon_control_params *dc); -// XXX: Also used as exit codes of the daemon-control utility. +// XXX: Also used as exit codes of the ucw-daemon-control utility. enum daemon_control_status { DAEMON_STATUS_OK = 0, DAEMON_STATUS_ALREADY_DONE = 100, diff --git a/ucw/default.cfg b/ucw/default.cfg index 7a2236da..ec8feabb 100644 --- a/ucw/default.cfg +++ b/ucw/default.cfg @@ -44,7 +44,7 @@ Set("CONFIG_UCW_SHELL_UTILS" => 1); # Include utilities Set("CONFIG_UCW_UTILS" => 1); -# Include obsolete daemon-helper utility +# Include obsolete ucw-daemon-helper utility UnSet("CONFIG_UCW_OBSOLETE_DAEMON_HELPER"); # Default configuration file diff --git a/ucw/doc/basecode.txt b/ucw/doc/basecode.txt index 6741470e..ca2aa86e 100644 --- a/ucw/doc/basecode.txt +++ b/ucw/doc/basecode.txt @@ -58,7 +58,7 @@ way as base64. The basecode utility -------------------- You can use the encoding/decoding routines from command line, trough -`basecode` command. You have to specify the operation by a command +`ucw-basecode` command. You have to specify the operation by a command line argument and give it the data on standard input. The arguments are: diff --git a/ucw/doc/daemon.txt b/ucw/doc/daemon.txt index a58c92f4..6077e603 100644 --- a/ucw/doc/daemon.txt +++ b/ucw/doc/daemon.txt @@ -58,7 +58,7 @@ since there can be multiple instances of the daemon running simultaneously. We therefore recommend the following daemon control protocol, which prevents all such race conditions. Its implementation is available in form of the daemon_control() library -function or the `daemon-control` stand-alone utility. +function or the `ucw-daemon-control` stand-alone utility. * There exist two files: ** PID file (usually `/var/run/daemon.pid`), which contains the PID of the daemon diff --git a/ucw/shell/Makefile b/ucw/shell/Makefile index 62ecb968..96491f73 100644 --- a/ucw/shell/Makefile +++ b/ucw/shell/Makefile @@ -1,17 +1,17 @@ # Support routines for shell scripts DIRS+=ucw/shell -UCW_SHELL_PROGS=$(addprefix $(o)/ucw/shell/,config logger logoutput) +UCW_SHELL_PROGS=$(addprefix $(o)/ucw/shell/ucw-,config logger logoutput) PROGS+=$(UCW_SHELL_PROGS) DATAFILES+=$(o)/ucw/shell/libucw.sh -$(o)/ucw/shell/config: $(o)/ucw/shell/config.o $(LIBUCW) -$(o)/ucw/shell/logger: $(o)/ucw/shell/logger.o $(LIBUCW) -$(o)/ucw/shell/logoutput: $(o)/ucw/shell/logoutput.o $(LIBUCW) +$(o)/ucw/shell/ucw-config: $(o)/ucw/shell/ucw-config.o $(LIBUCW) +$(o)/ucw/shell/ucw-logger: $(o)/ucw/shell/ucw-logger.o $(LIBUCW) +$(o)/ucw/shell/ucw-logoutput: $(o)/ucw/shell/ucw-logoutput.o $(LIBUCW) TESTS+=$(addprefix $(o)/ucw/shell/,config.test) -$(o)/ucw/shell/config.test: $(o)/ucw/shell/config +$(o)/ucw/shell/config.test: $(o)/ucw/shell/ucw-config INSTALL_TARGETS+=install-ucw-shell install-ucw-shell: diff --git a/ucw/shell/config.t b/ucw/shell/config.t index a90f2744..fdcfc854 100644 --- a/ucw/shell/config.t +++ b/ucw/shell/config.t @@ -1,6 +1,6 @@ # Tests for configuration parser -Run: ../obj/ucw/shell/config -C/dev/null -S 'sec1{int1=23; long1=1234567812345678; long2=4321; str1="s1"; str2="s2"}' 'sec1 {#int1; ##long1; -str1; str2; #int2=123; ##long2=1234; #int3=0x10; #int4; $dbl1=001.100; $dbl2}; sec2{str3}' +Run: ../obj/ucw/shell/ucw-config -C/dev/null -S 'sec1{int1=23; long1=1234567812345678; long2=4321; str1="s1"; str2="s2"}' 'sec1 {#int1; ##long1; -str1; str2; #int2=123; ##long2=1234; #int3=0x10; #int4; $dbl1=001.100; $dbl2}; sec2{str3}' Out: CF_sec1_int1='23' CF_sec1_long1='1234567812345678' CF_sec1_str2='s2' @@ -12,13 +12,13 @@ Out: CF_sec1_int1='23' CF_sec1_dbl2='0' CF_sec2_str3='' -Run: ../obj/ucw/shell/config -C/dev/null -S 'sec1{list1 1 a1 b1; list1:clear; list1 2 a2 b2 3 a3 b3}' 'sec1 {@list1 {#int1; str1; -str2}}' +Run: ../obj/ucw/shell/ucw-config -C/dev/null -S 'sec1{list1 1 a1 b1; list1:clear; list1 2 a2 b2 3 a3 b3}' 'sec1 {@list1 {#int1; str1; -str2}}' Out: CF_sec1_list1_int1[1]='2' CF_sec1_list1_str1[1]='a2' CF_sec1_list1_int1[2]='3' CF_sec1_list1_str1[2]='a3' -Run: ../obj/ucw/shell/config -C/dev/null -S 'sec1{ar1 a b c d; ar1 a b c; ar2 1 2; ar3 1.1}' 'sec1 {ar1[]; #ar2[2]; $ar3[-2]}' +Run: ../obj/ucw/shell/ucw-config -C/dev/null -S 'sec1{ar1 a b c d; ar1 a b c; ar2 1 2; ar3 1.1}' 'sec1 {ar1[]; #ar2[2]; $ar3[-2]}' Out: CF_sec1_ar1[1]='a' CF_sec1_ar1[2]='b' CF_sec1_ar1[3]='c' @@ -26,7 +26,7 @@ Out: CF_sec1_ar1[1]='a' CF_sec1_ar2[2]='2' CF_sec1_ar3[1]='1.1' -Run: ../obj/ucw/shell/config -C/dev/null -S 'sec1{list1 {str1=1; list2=a b c}; list1 {str1=2; list2=d e}}' 'sec1 {@list1 {str1; @list2{str2}}}' +Run: ../obj/ucw/shell/ucw-config -C/dev/null -S 'sec1{list1 {str1=1; list2=a b c}; list1 {str1=2; list2=d e}}' 'sec1 {@list1 {str1; @list2{str2}}}' Out: CF_sec1_list1_str1[1]='1' CF_sec1_list1_list2_str2[1]='a' CF_sec1_list1_list2_str2[2]='b' @@ -35,5 +35,5 @@ Out: CF_sec1_list1_str1[1]='1' CF_sec1_list1_list2_str2[4]='d' CF_sec1_list1_list2_str2[5]='e' -Run: ../obj/ucw/shell/config -C/dev/null 'sec{str=a'\''b"c'\''d"\\e'\''f"g}' +Run: ../obj/ucw/shell/ucw-config -C/dev/null 'sec{str=a'\''b"c'\''d"\\e'\''f"g}' Out: CF_sec_str='ab"cd\e'\''fg' diff --git a/ucw/shell/libucw.sh b/ucw/shell/libucw.sh index b02230cf..143e431e 100644 --- a/ucw/shell/libucw.sh +++ b/ucw/shell/libucw.sh @@ -17,26 +17,26 @@ done function log # msg { - bin/logger $UCW_PROGNAME I "$1" + bin/ucw-logger $UCW_PROGNAME I "$1" } function errlog # msg { - bin/logger $UCW_PROGNAME E "$1" + bin/ucw-logger $UCW_PROGNAME E "$1" } function warnlog # msg { - bin/logger $UCW_PROGNAME E "$1" + bin/ucw-logger $UCW_PROGNAME E "$1" } function die # msg { - bin/logger $UCW_PROGNAME ! "$1" + bin/ucw-logger $UCW_PROGNAME ! "$1" exit 1 } function parse-config # section vars... { - eval `bin/config$UCW_CF "$@"` + eval `bin/ucw-config$UCW_CF "$@"` } diff --git a/ucw/shell/config.c b/ucw/shell/ucw-config.c similarity index 98% rename from ucw/shell/config.c rename to ucw/shell/ucw-config.c index 780ff792..6217ac69 100644 --- a/ucw/shell/config.c +++ b/ucw/shell/ucw-config.c @@ -36,7 +36,7 @@ static void help(void) { fputs("\n\ -Usage: config [-C] [-S
.