tools: move useful tools from test dir to tools dir
authorDerrick Brashear <shadow@dementix.org>
Tue, 3 Apr 2012 17:51:38 +0000 (13:51 -0400)
committerDerrick Brashear <shadow@dementix.org>
Tue, 3 Apr 2012 18:35:30 +0000 (11:35 -0700)
move the dump utilities out of tests

Change-Id: I21d0550e09fde3b1feb078bde4e9b4dc7ca3614e
Reviewed-on: http://gerrit.openafs.org/7043
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

36 files changed:
Makefile.in
configure.ac
src/tests/Makefile.in
src/tools/Makefile.in [new file with mode: 0644]
src/tools/TEMPLATE [moved from src/tests/TEMPLATE with 100% similarity]
src/tools/afsdump_dirlist.c [moved from src/tests/afsdump_dirlist.c with 100% similarity]
src/tools/afsdump_extract.c [moved from src/tests/afsdump_extract.c with 100% similarity]
src/tools/afsdump_scan.c [moved from src/tests/afsdump_scan.c with 100% similarity]
src/tools/afsdump_xsed.c [moved from src/tests/afsdump_xsed.c with 100% similarity]
src/tools/backuphdr.c [moved from src/tests/backuphdr.c with 100% similarity]
src/tools/directory.c [moved from src/tests/directory.c with 100% similarity]
src/tools/dump.c [moved from src/tests/dump.c with 100% similarity]
src/tools/dumpfmt.h [moved from src/tests/dumpfmt.h with 100% similarity]
src/tools/dumpscan.h [moved from src/tests/dumpscan.h with 100% similarity]
src/tools/dumpscan_errs.et [moved from src/tests/dumpscan_errs.et with 100% similarity]
src/tools/dumptool.c [moved from src/tests/dumptool.c with 99% similarity]
src/tools/int64.c [moved from src/tests/int64.c with 100% similarity]
src/tools/intNN.h [moved from src/tests/intNN.h with 100% similarity]
src/tools/internal.h [moved from src/tests/internal.h with 100% similarity]
src/tools/parsedump.c [moved from src/tests/parsedump.c with 100% similarity]
src/tools/parsetag.c [moved from src/tests/parsetag.c with 100% similarity]
src/tools/parsevnode.c [moved from src/tests/parsevnode.c with 100% similarity]
src/tools/parsevol.c [moved from src/tests/parsevol.c with 100% similarity]
src/tools/pathname.c [moved from src/tests/pathname.c with 100% similarity]
src/tools/primitive.c [moved from src/tests/primitive.c with 100% similarity]
src/tools/repair.c [moved from src/tests/repair.c with 100% similarity]
src/tools/stagehdr.c [moved from src/tests/stagehdr.c with 100% similarity]
src/tools/stagehdr.h [moved from src/tests/stagehdr.h with 100% similarity]
src/tools/util.c [moved from src/tests/util.c with 100% similarity]
src/tools/xf_errs.et [moved from src/tests/xf_errs.et with 100% similarity]
src/tools/xf_files.c [moved from src/tests/xf_files.c with 100% similarity]
src/tools/xf_printf.c [moved from src/tests/xf_printf.c with 100% similarity]
src/tools/xf_profile.c [moved from src/tests/xf_profile.c with 100% similarity]
src/tools/xf_rxcall.c [moved from src/tests/xf_rxcall.c with 100% similarity]
src/tools/xfiles.c [moved from src/tests/xfiles.c with 100% similarity]
src/tools/xfiles.h [moved from src/tests/xfiles.h with 100% similarity]

index 01891e1..f9a7f9b 100644 (file)
@@ -401,6 +401,9 @@ authtools: pam tsm41 sgistuff aklog
 platform: config cmd vol
        +${COMPILE_PART1} platform ${COMPILE_PART2}
 
+tools: config audit volser vlserver
+       +${COMPILE_PART1} tools ${COMPILE_PART2}
+
 man-pages: config
        +if test -d "doc/man-pages" ; then \
                cd doc/man-pages ${COMPILE_PART2} ; \
@@ -650,7 +653,7 @@ finale: project cmd comerr afsd butc tbutc tbudb @ENABLE_KERNEL_MODULE@ libuafs
        dviced dvolser libafscp\
        venus update xstat afsmonitor rxdebug libafsrpc rfc3961 hcrypto \
        libafsauthent shlibafsrpc shlibafsauthent libadmin man-pages \
-       platform kopenafs authtools $(DIR_roken)
+       tools platform kopenafs authtools $(DIR_roken)
        +${COMPILE_PART1} finale ${COMPILE_PART2}
 
 finale_nolibafs: project cmd comerr afsd butc tbutc tbudb libuafs audit kauth log \
@@ -658,7 +661,7 @@ finale_nolibafs: project cmd comerr afsd butc tbutc tbudb libuafs audit kauth lo
        dviced dvolser libafscp\
        venus update xstat afsmonitor rxdebug libafsrpc rfc3961 hcrypto \
        libafsauthent shlibafsrpc shlibafsauthent libadmin man-pages \
-       platform kopenafs authtools $(DIR_roken)
+       tools platform kopenafs authtools $(DIR_roken)
        +${COMPILE_PART1} finale ${COMPILE_PART2}
 
 check test: finale
@@ -749,13 +752,13 @@ clean2:
        -${COMPILE_PART1} bucoord ${COMPILE_CLEAN}
        -${COMPILE_PART1} xstat ${COMPILE_CLEAN}
        -${COMPILE_PART1} afsmonitor ${COMPILE_CLEAN}
-       -${COMPILE_PART1} tests ${COMPILE_CLEAN}
        -${COMPILE_PART1} rxdebug ${COMPILE_CLEAN}
        -${COMPILE_PART1} libafsrpc ${COMPILE_CLEAN}
        -${COMPILE_PART1} libafsauthent ${COMPILE_CLEAN}
        -${COMPILE_PART1} shlibafsrpc ${COMPILE_CLEAN}
        -${COMPILE_PART1} shlibafsauthent ${COMPILE_CLEAN}
        -${COMPILE_PART1} kopenafs ${COMPILE_CLEAN}
+       -${COMPILE_PART1} tools ${COMPILE_CLEAN}
        -${COMPILE_PART1} platform ${COMPILE_CLEAN}
        -${COMPILE_PART1} libadmin ${COMPILE_CLEAN}
        -${COMPILE_PART1} libadmin/adminutil ${COMPILE_CLEAN}
@@ -904,6 +907,7 @@ distclean: clean
        src/tests/Makefile \
        src/tests/run-tests \
        src/tests/auth/Makefile \
+       src/tools/Makefile \
        src/tsalvaged/Makefile \
        src/tsm41/Makefile \
        src/tvolser/Makefile \
index 4178954..af9b181 100644 (file)
@@ -227,6 +227,7 @@ src/sys/Makefile \
 src/tbutc/Makefile \
 src/tests/Makefile \
 src/tests/run-tests \
+src/tools/Makefile \
 src/tsalvaged/Makefile \
 src/tsm41/Makefile \
 src/tvolser/Makefile \
index b0150a9..c9a82f5 100644 (file)
@@ -2,97 +2,11 @@ srcdir                = @srcdir@
 include @TOP_OBJDIR@/src/config/Makefile.config
 include @TOP_OBJDIR@/src/config/Makefile.lwp
 
-
 SHELL          = /bin/sh
 
-INCDIRS=-I${TOP_OBJDIR}/src/config -I${TOP_INCDIR}/afs -I${TOP_INCDIR}
-INCLIBS=-L${SRCDIR}/lib/afs -L${TOP_LIBDIR}
-
-LIBS=\
-       libdumpscan.a \
-       libxfiles.a \
-       ${TOP_LIBDIR}/libauth.a \
-       ${TOP_LIBDIR}/libaudit.a \
-       ${TOP_LIBDIR}/libvolser.a \
-       ${TOP_LIBDIR}/libvldb.a \
-       ${TOP_LIBDIR}/libubik.a \
-       ${TOP_LIBDIR}/librxkad.a \
-       ${TOP_LIBDIR}/libsys.a \
-       ${TOP_LIBDIR}/librx.a \
-       ${TOP_LIBDIR}/liblwp.a \
-       ${TOP_LIBDIR}/util.a \
-       ${TOP_LIBDIR}/libafscom_err.a \
-       $(LIB_roken) \
-       ${XLIBS}
-
-OBJS_afsdump_scan    = afsdump_scan.o repair.o
-OBJS_afsdump_xsed    = afsdump_xsed.o repair.o
-OBJS_libxfiles.a     = xfiles.o xf_errs.o xf_printf.o int64.o \
-                       xf_files.o xf_rxcall.o xf_profile.o
-OBJS_libdumpscan.a   = primitive.o util.o dumpscan_errs.o parsetag.o \
-                       parsedump.o parsevol.o parsevnode.o dump.o \
-                       directory.o pathname.o backuphdr.o stagehdr.o
-
-TARGETS = libxfiles.a libdumpscan.a \
-          afsdump_scan afsdump_dirlist afsdump_extract dumptool
-
-all: run-tests OpenAFS/Dirpath.pm libxfiles.a libdumpscan.a $(TEST_PROGRAMS)\
-       afsdump_scan afsdump_dirlist afsdump_extract dumptool OpenAFS/Dirpath.sh
+all: run-tests OpenAFS/Dirpath.pm $(TEST_PROGRAMS) OpenAFS/Dirpath.sh
        @chmod +x run-tests
 
-generated: xf_errs.c xf_errs.h dumpscan_errs.c dumpscan_errs.h
-
-afsdump_scan: libxfiles.a libdumpscan.a $(OBJS_afsdump_scan)
-       $(AFS_LDRULE) $(OBJS_afsdump_scan) $(LIBS)
-
-
-afsdump_xsed: libxfiles.a libdumpscan.a $(OBJS_afsdump_xsed)
-       $(AFS_LDRULE) $(OBJS_afsdump_xsed) $(LIBS)
-
-afsdump_dirlist: libxfiles.a libdumpscan.a afsdump_dirlist.o
-       $(AFS_LDRULE) afsdump_dirlist.o $(LIBS)
-
-afsdump_extract: libxfiles.a libdumpscan.a afsdump_extract.o
-       $(AFS_LDRULE) afsdump_extract.o $(LIBS)
-
-null-search: libxfiles.a libdumpscan.a null-search.c
-       $(AFS_LDRULE) null-search.c $(LIBS)
-
-dumptool: dumptool.c
-       $(AFS_LDRULE) dumptool.c
-
-libxfiles.a: $(OBJS_libxfiles.a)
-       -rm -f libxfiles.a
-       $(AR) r libxfiles.a $(OBJS_libxfiles.a)
-       $(RANLIB) libxfiles.a
-
-libdumpscan.a: $(OBJS_libdumpscan.a)
-       -rm -f libdumpscan.a
-       $(AR) r libdumpscan.a $(OBJS_libdumpscan.a)
-       $(RANLIB) libdumpscan.a
-
-xf_errs.c xf_errs.h: xf_errs.et
-       $(COMPILE_ET) xf_errs.et
-
-dumpscan_errs.c dumpscan_errs.h: dumpscan_errs.et
-       $(COMPILE_ET) dumpscan_errs.et
-
-util.o xfiles.o xf_files.o: xf_errs.h
-backuphdr.o directory.o parsedump.o parsetag.o: dumpscan_errs.h
-parsevnode.o parsevol.o pathname.o stagehdr.o:  dumpscan_errs.h
-util.o:                                         dumpscan_errs.h
-
-# repair addresses the same storage as two different types of structs at the
-# same time.
-CFLAGS_repair.o = @CFLAGS_NOSTRICT@
-repair.o: repair.c dumpscan_errs.h
-
-${TOP_LIBDIR}/libxfiles.a: libxfiles.a
-       ${INSTALL_DATA} $? $@
-
-${TOP_LIBDIR}/libdumpscan.a: libdumpscan.a
-       ${INSTALL_DATA} $? $@
-
 SYS_LIBS       = ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/librx.a ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/util.a
 
 AUTH_LIBS      = ${TOP_LIBDIR}/libauth.a ${SYS_LIBS}
@@ -345,8 +259,8 @@ install:
 uninstall:
 
 clean:
-       -rm -f xf_errs.c xf_errs.h dumpscan_errs.c dumpscan_errs.h *.o \
-       $(TARGETS) run-tests $(TEST_PROGRAMS) OpenAFS/Dirpath.pm OpenAFS/Dirpath.sh
+       -rm -f *.o  run-tests $(TEST_PROGRAMS) OpenAFS/Dirpath.pm \
+       OpenAFS/Dirpath.sh
 
 include ../config/Makefile.version
 
diff --git a/src/tools/Makefile.in b/src/tools/Makefile.in
new file mode 100644 (file)
index 0000000..3f3e620
--- /dev/null
@@ -0,0 +1,107 @@
+srcdir         = @srcdir@
+include @TOP_OBJDIR@/src/config/Makefile.config
+include @TOP_OBJDIR@/src/config/Makefile.lwp
+
+
+SHELL          = /bin/sh
+
+INCDIRS=-I${TOP_OBJDIR}/src/config -I${TOP_INCDIR}/afs -I${TOP_INCDIR}
+INCLIBS=-L${SRCDIR}/lib/afs -L${TOP_LIBDIR}
+
+LIBS=\
+       libdumpscan.a \
+       libxfiles.a \
+       ${TOP_LIBDIR}/libauth.a \
+       ${TOP_LIBDIR}/libaudit.a \
+       ${TOP_LIBDIR}/libvolser.a \
+       ${TOP_LIBDIR}/libvldb.a \
+       ${TOP_LIBDIR}/libubik.a \
+       ${TOP_LIBDIR}/librxkad.a \
+       ${TOP_LIBDIR}/libsys.a \
+       ${TOP_LIBDIR}/librx.a \
+       ${TOP_LIBDIR}/liblwp.a \
+       ${TOP_LIBDIR}/util.a \
+       $(TOP_LIBDIR)/libopr.a \
+       ${TOP_LIBDIR}/libafscom_err.a \
+       $(LIB_roken) \
+       ${XLIBS}
+
+OBJS_afsdump_scan    = afsdump_scan.o repair.o
+OBJS_afsdump_xsed    = afsdump_xsed.o repair.o
+OBJS_libxfiles.a     = xfiles.o xf_errs.o xf_printf.o int64.o \
+                       xf_files.o xf_rxcall.o xf_profile.o
+OBJS_libdumpscan.a   = primitive.o util.o dumpscan_errs.o parsetag.o \
+                       parsedump.o parsevol.o parsevnode.o dump.o \
+                       directory.o pathname.o backuphdr.o stagehdr.o
+
+TARGETS = libxfiles.a libdumpscan.a \
+          afsdump_scan afsdump_dirlist afsdump_extract dumptool
+
+all: libxfiles.a libdumpscan.a \
+       afsdump_scan afsdump_dirlist afsdump_extract dumptool
+
+generated: xf_errs.c xf_errs.h dumpscan_errs.c dumpscan_errs.h
+
+afsdump_scan: libxfiles.a libdumpscan.a $(OBJS_afsdump_scan)
+       $(AFS_LDRULE) $(OBJS_afsdump_scan) $(LIBS)
+
+afsdump_xsed: libxfiles.a libdumpscan.a $(OBJS_afsdump_xsed)
+       $(AFS_LDRULE) $(OBJS_afsdump_xsed) $(LIBS)
+
+afsdump_dirlist: libxfiles.a libdumpscan.a afsdump_dirlist.o
+       $(AFS_LDRULE) afsdump_dirlist.o $(LIBS)
+
+afsdump_extract: libxfiles.a libdumpscan.a afsdump_extract.o
+       $(AFS_LDRULE) afsdump_extract.o $(LIBS)
+
+null-search: libxfiles.a libdumpscan.a null-search.c
+       $(AFS_LDRULE) null-search.c $(LIBS)
+
+dumptool: dumptool.c
+       $(AFS_LDRULE) dumptool.c
+
+libxfiles.a: $(OBJS_libxfiles.a)
+       -rm -f libxfiles.a
+       $(AR) r libxfiles.a $(OBJS_libxfiles.a)
+       $(RANLIB) libxfiles.a
+
+libdumpscan.a: $(OBJS_libdumpscan.a)
+       -rm -f libdumpscan.a
+       $(AR) r libdumpscan.a $(OBJS_libdumpscan.a)
+       $(RANLIB) libdumpscan.a
+
+xf_errs.c xf_errs.h: xf_errs.et
+       $(COMPILE_ET) xf_errs.et
+
+dumpscan_errs.c dumpscan_errs.h: dumpscan_errs.et
+       $(COMPILE_ET) dumpscan_errs.et
+
+util.o xfiles.o xf_files.o: xf_errs.h
+backuphdr.o directory.o parsedump.o parsetag.o: dumpscan_errs.h
+parsevnode.o parsevol.o pathname.o stagehdr.o:  dumpscan_errs.h
+util.o:                                         dumpscan_errs.h
+
+# repair addresses the same storage as two different types of structs at the
+# same time.
+CFLAGS_repair.o = @CFLAGS_NOSTRICT@
+repair.o: repair.c dumpscan_errs.h
+
+${TOP_LIBDIR}/libxfiles.a: libxfiles.a
+       ${INSTALL_DATA} $? $@
+
+${TOP_LIBDIR}/libdumpscan.a: libdumpscan.a
+       ${INSTALL_DATA} $? $@
+
+dest:
+
+install:
+
+uninstall:
+
+clean:
+       -rm -f xf_errs.c xf_errs.h dumpscan_errs.c dumpscan_errs.h *.o \
+       $(TARGETS)
+
+include ../config/Makefile.version
+
+.PHONY:                all install clean realclean distclean mostlyclean install uninstall
similarity index 100%
rename from src/tests/TEMPLATE
rename to src/tools/TEMPLATE
similarity index 100%
rename from src/tests/backuphdr.c
rename to src/tools/backuphdr.c
similarity index 100%
rename from src/tests/directory.c
rename to src/tools/directory.c
similarity index 100%
rename from src/tests/dump.c
rename to src/tools/dump.c
similarity index 100%
rename from src/tests/dumpfmt.h
rename to src/tools/dumpfmt.h
similarity index 100%
rename from src/tests/dumpscan.h
rename to src/tools/dumpscan.h
similarity index 99%
rename from src/tests/dumptool.c
rename to src/tools/dumptool.c
index 79c48cf..d514cde 100644 (file)
@@ -287,6 +287,7 @@ int ShutdownInProgress = 0;
  * Our local function prototypes
  */
 
+static int DirHash(char *string);
 static int ReadDumpHeader(FILE *, struct DumpHeader *);
 static int ReadVolumeHeader(FILE *, VolumeDiskData *);
 static int ScanVnodes(FILE *, VolumeDiskData *, int);
@@ -2426,7 +2427,7 @@ ReadByteString(FILE * f, void *s, int size)
  * The directory hashing algorithm used by AFS
  */
 
-int
+static int
 DirHash(char *string)
 {
     /* Hash a string to a number between 0 and NHASHENT. */
similarity index 100%
rename from src/tests/int64.c
rename to src/tools/int64.c
similarity index 100%
rename from src/tests/intNN.h
rename to src/tools/intNN.h
similarity index 100%
rename from src/tests/internal.h
rename to src/tools/internal.h
similarity index 100%
rename from src/tests/parsedump.c
rename to src/tools/parsedump.c
similarity index 100%
rename from src/tests/parsetag.c
rename to src/tools/parsetag.c
similarity index 100%
rename from src/tests/parsevol.c
rename to src/tools/parsevol.c
similarity index 100%
rename from src/tests/pathname.c
rename to src/tools/pathname.c
similarity index 100%
rename from src/tests/primitive.c
rename to src/tools/primitive.c
similarity index 100%
rename from src/tests/repair.c
rename to src/tools/repair.c
similarity index 100%
rename from src/tests/stagehdr.c
rename to src/tools/stagehdr.c
similarity index 100%
rename from src/tests/stagehdr.h
rename to src/tools/stagehdr.h
similarity index 100%
rename from src/tests/util.c
rename to src/tools/util.c
similarity index 100%
rename from src/tests/xf_errs.et
rename to src/tools/xf_errs.et
similarity index 100%
rename from src/tests/xf_files.c
rename to src/tools/xf_files.c
similarity index 100%
rename from src/tests/xf_printf.c
rename to src/tools/xf_printf.c
similarity index 100%
rename from src/tests/xf_rxcall.c
rename to src/tools/xf_rxcall.c
similarity index 100%
rename from src/tests/xfiles.c
rename to src/tools/xfiles.c
similarity index 100%
rename from src/tests/xfiles.h
rename to src/tools/xfiles.h