You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/04/03 04:43:15 UTC
[incubator-nuttx] branch master updated: testbuild.sh: Make the use
of "git clean" optional
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 8851d3a testbuild.sh: Make the use of "git clean" optional
8851d3a is described below
commit 8851d3a7d361197bf62b10ddd279a90889371a8e
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Fri Apr 3 11:35:30 2020 +0900
testbuild.sh: Make the use of "git clean" optional
Also, update the list of command line options in the help text.
---
tools/README.txt | 20 ++++++++++++++------
tools/testbuild.sh | 18 ++++++++++++++++--
2 files changed, 30 insertions(+), 8 deletions(-)
diff --git a/tools/README.txt b/tools/README.txt
index 3433783..d2b3e3b 100644
--- a/tools/README.txt
+++ b/tools/README.txt
@@ -994,18 +994,26 @@ testbuild.sh
$ ./testbuild.sh -h
- USAGE: ./testbuild.sh [-l|m|c|u|g|n] [-d] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] <testlist-file>
+ USAGE: ./testbuild.sh [-l|m|c|u|g|n] [-d] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] [-p] [-G] <testlist-file>
./testbuild.sh -h
Where:
-l|m|c|u|g|n selects Linux (l), macOS (m), Cygwin (c),
- Ubuntu under Windows 10 (u), or Windows native (n). Default Linux
- -a <appsdir> provides the relative path to the apps/ directory. Default ../apps
- -t <topdir> provides the absolute path to top nuttx/ directory. Default $PWD/../nuttx
- -p only print the list of configs without running any builds
- -j <ncpus> passed on to make. Default: No -j make option
+ Ubuntu under Windows 10 (u), MSYS/MSYS2 (g) or Windows native (n). Default Linux
-d enables script debug output
-x exit on build failures
+ -j <ncpus> passed on to make. Default: No -j make option.
+ -a <appsdir> provides the relative path to the apps/ directory. Default ../apps
+ -t <topdir> provides the absolute path to top nuttx/ directory.
+ Default $WD/../nuttx, where $WD is the parent directory of
+ the directory where this script is.
+ -p only print the list of configs without running any builds
+ -G Use "git clean -xfdq" instead of "make distclean" to clean the tree.
+ This option may speed up the builds. However, note that:
+ * This assumes that your trees are git based.
+ * This assumes that only nuttx and apps repos need to be cleaned.
+ * If the tree has files not managed by git, they will be removed
+ as well.
-h will show this help test and terminate
<testlist-file> selects the list of configurations to test. No default
diff --git a/tools/testbuild.sh b/tools/testbuild.sh
index 8025f1d..fd901b6 100755
--- a/tools/testbuild.sh
+++ b/tools/testbuild.sh
@@ -44,10 +44,11 @@ unset testfile
unset HOPTION
unset JOPTION
PRINTLISTONLY=0
+GITCLEAN=0
function showusage {
echo ""
- echo "USAGE: $progname [-l|m|c|u|g|n] [-si|-sl>] [-d] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] <testlist-file>"
+ echo "USAGE: $progname [-l|m|c|u|g|n] [-d] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] [-p] [-G] <testlist-file>"
echo " $progname -h"
echo ""
echo "Where:"
@@ -59,6 +60,12 @@ function showusage {
echo " -a <appsdir> provides the relative path to the apps/ directory. Default ../apps"
echo " -t <topdir> provides the absolute path to top nuttx/ directory. Default $PWD/../nuttx"
echo " -p only print the list of configs without running any builds"
+ echo " -G Use \"git clean -xfdq\" instead of \"make distclean\" to clean the tree."
+ echo " This option may speed up the builds. However, note that:"
+ echo " * This assumes that your trees are git based."
+ echo " * This assumes that only nuttx and apps repos need to be cleaned."
+ echo " * If the tree has files not managed by git, they will be removed"
+ echo " as well."
echo " -h will show this help test and terminate"
echo " <testlist-file> selects the list of configurations to test. No default"
echo ""
@@ -97,6 +104,9 @@ while [ ! -z "$1" ]; do
-p )
PRINTLISTONLY=1
;;
+ -G )
+ GITCLEAN=1
+ ;;
-h )
showusage
;;
@@ -159,7 +169,11 @@ function distclean_with_git {
function distclean {
if [ -f .config ]; then
echo " Cleaning..."
- distclean_with_git || makefunc ${JOPTION} ${MAKE_FLAGS} distclean 1>/dev/null
+ if [ ${GITCLEAN} -eq 1 ]; then
+ distclean_with_git
+ else
+ makefunc ${JOPTION} ${MAKE_FLAGS} distclean 1>/dev/null
+ fi
fi
}