]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
tools: Hide new commands behind experimental flag
authorLucas De Marchi <lucas.demarchi@intel.com>
Sun, 7 Jun 2015 02:26:31 +0000 (23:26 -0300)
committerLucas De Marchi <lucas.demarchi@intel.com>
Sun, 7 Jun 2015 02:26:31 +0000 (23:26 -0300)
Hide the commands behind a flag so we can continue doing releases while
the commands aren't ready.

Makefile.am
configure.ac
tools/kmod.c

index b9919363ba461bd7372353ad1d9dc3069a5ec720..56143177c7c4519c31041d57d930292c71b96767 100644 (file)
@@ -127,9 +127,14 @@ tools_kmod_SOURCES = \
        tools/rmmod.c tools/insmod.c \
        tools/modinfo.c tools/modprobe.c \
        tools/depmod.c tools/log.h tools/log.c \
-       tools/insert.c \
-       tools/remove.c \
        tools/static-nodes.c
+
+if BUILD_EXPERIMENTAL
+tools_kmod_SOURCES += \
+       tools/insert.c \
+       tools/remove.c
+endif
+
 tools_kmod_LDADD = \
        shared/libshared.la \
        libkmod/libkmod-internal.la
@@ -323,8 +328,12 @@ TESTSUITE = \
        testsuite/test-modinfo testsuite/test-util testsuite/test-new-module \
        testsuite/test-modprobe testsuite/test-blacklist \
        testsuite/test-dependencies testsuite/test-depmod \
-       testsuite/test-list \
+       testsuite/test-list
+
+if BUILD_EXPERIMENTAL
+TESTSUITE += \
        testsuite/test-tools
+endif
 
 check_PROGRAMS = $(TESTSUITE)
 TESTS = $(TESTSUITE)
@@ -364,8 +373,11 @@ testsuite_test_depmod_LDADD = $(TESTSUITE_LDADD)
 testsuite_test_depmod_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
 testsuite_test_list_LDADD = $(TESTSUITE_LDADD)
 testsuite_test_list_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
+
+if BUILD_EXPERIMENTAL
 testsuite_test_tools_LDADD = $(TESTSUITE_LDADD)
 testsuite_test_tools_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
+endif
 
 testsuite-distclean:
        $(RM) -r $(ROOTFS)
index 6e675846f781b3197b4af4dda4cb5c28435c7918..f83eed5405473c458f84999d25052e8de339a533 100644 (file)
@@ -117,6 +117,14 @@ AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
 # --enable-
 #####################################################################
 
+AC_ARG_ENABLE([experimental],
+        AS_HELP_STRING([--enable-experimental], [enable experimental tools and features. Do not enable it unless you know what you are doing. @<:@default=disabled@:>@]),
+        [], enable_experimental=no)
+AM_CONDITIONAL([BUILD_EXPERIMENTAL], [test "x$enable_experimental" = "xyes"])
+AS_IF([test "x$enable_experimental" = "xyes"], [
+       AC_DEFINE(ENABLE_EXPERIMENTAL, [1], [Experimental features.])
+])
+
 AC_ARG_ENABLE([tools],
         AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]),
        [], enable_tools=yes)
@@ -279,6 +287,7 @@ AC_MSG_RESULT([
        cflags:                 ${with_cflags} ${CFLAGS}
        ldflags:                ${with_ldflags} ${LDFLAGS}
 
+       experimental features:  ${enable_experimental}
        tools:                  ${enable_tools}
        python bindings:        ${enable_python}
        logging:                ${enable_logging}
index 5ebe70a053c9acf73cb0bd774294a685a1ee9374..c9d2cc82a150d6de2bcb2f803ede3800a54bc8d0 100644 (file)
@@ -40,10 +40,13 @@ static const struct kmod_cmd kmod_cmd_help;
 
 static const struct kmod_cmd *kmod_cmds[] = {
        &kmod_cmd_help,
-       &kmod_cmd_insert,
        &kmod_cmd_list,
-       &kmod_cmd_remove,
        &kmod_cmd_static_nodes,
+
+#ifdef ENABLE_EXPERIMENTAL
+       &kmod_cmd_insert,
+       &kmod_cmd_remove,
+#endif
 };
 
 static const struct kmod_cmd *kmod_compat_cmds[] = {