You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/04/28 17:34:57 UTC
[incubator-nuttx] branch master updated: tools/zipme.sh: Let
major.minor.patch argument optional
This is an automated email from the ASF dual-hosted git repository.
aguettouche 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 0932f08 tools/zipme.sh: Let major.minor.patch argument optional
0932f08 is described below
commit 0932f08b93fdf3b7f36c687bdfc179b9dd338b8b
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Apr 21 12:22:56 2020 +0800
tools/zipme.sh: Let major.minor.patch argument optional
since version.sh can generate this information for us
Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
tools/README.txt | 2 +-
tools/zipme.sh | 69 ++++++++++++++++++++++++++++----------------------------
2 files changed, 35 insertions(+), 36 deletions(-)
diff --git a/tools/README.txt b/tools/README.txt
index 64666eb..023a174 100644
--- a/tools/README.txt
+++ b/tools/README.txt
@@ -1120,7 +1120,7 @@ zipme.sh
Any VCS files or directories are excluded from the final tarballs.
$ ./tools/zipme.sh -h
- USAGE="USAGE: ./tools/zipme.sh [-d|h|v|s] [-b <build]> [-e <exclude>] [-k <key-id>] <major.minor.patch>"
+ USAGE="USAGE: ./tools/zipme.sh [-d|h|v|s] [-b <build]> [-e <exclude>] [-k <key-id>] [<major.minor.patch>]"
Examples:
./tools/zipme.sh -s 9.0.0
Create version 9.0.0 tarballs and sign them.
diff --git a/tools/zipme.sh b/tools/zipme.sh
old mode 100755
new mode 100644
index b46cacc..5e0a199
--- a/tools/zipme.sh
+++ b/tools/zipme.sh
@@ -50,7 +50,7 @@ EXCLPAT="
"
# Get command line parameters
-USAGE="USAGE: $0 [-d|h|v|s] [-b <build]> [-e <exclude>] [-k <key-id>] <major.minor.patch>"
+USAGE="USAGE: $0 [-d|h|v|s] [-b <build]> [-e <exclude>] [-k <key-id>] [<major.minor.patch>]"
ADVICE="Try '$0 -h' for more information"
unset VERSION
@@ -95,14 +95,14 @@ while [ ! -z "$1" ]; do
echo " Enable script debug"
echo " -h"
echo " show this help message and exit"
- echo " -e"
+ echo " -e"
echo " Exclude a list of files or folders"
echo " NOTE: The list must be quoted, example -e \"*.out tmp\""
- echo " -v"
+ echo " -v"
echo " Be verbose. The output could be more than you care to see."
- echo " -s"
+ echo " -s"
echo " PGP sign the final tarballs and create digests."
- echo " -k"
+ echo " -k"
echo " PGP key ID. If not provided the default ID will be used."
echo " <major.minor.patch>"
echo " The NuttX version number expressed as a major, minor and patch number separated"
@@ -119,7 +119,9 @@ done
# The last thing on the command line is the version number
VERSION=$1
-VERSIONOPT="-v ${VERSION}"
+if [ -n ${VERSION} ] ; then
+ VERSIONOPT="-v ${VERSION}"
+if
# Full tar options
@@ -135,15 +137,6 @@ else
TAR+=" -czf"
fi
-# Make sure we know what is going on
-
-if [ -z ${VERSION} ] ; then
- echo "You must supply a version like xx.yy as a parameter"
- echo $USAGE
- echo $ADVICE
- exit 1;
-fi
-
# Find the directory we were executed from and were we expect to
# see the directories to tar up
@@ -189,16 +182,18 @@ if [ ! -d ${APPSDIR} ] ; then
exit 1
fi
-# Create the versioned tarball names
+# Perform a full clean for the distribution
-NUTTX_TARNAME=apache-nuttx-${VERSION}-incubating.tar
-APPS_TARNAME=apache-nuttx-apps-${VERSION}-incubating.tar
-NUTTX_ZIPNAME=${NUTTX_TARNAME}.gz
-APPS_ZIPNAME=${APPS_TARNAME}.gz
-NUTTX_ASCNAME=${NUTTX_ZIPNAME}.asc
-APPS_ASCNAME=${APPS_ZIPNAME}.asc
-NUTTX_SHANAME=${NUTTX_ZIPNAME}.sha512
-APPS_SHANAME=${APPS_ZIPNAME}.sha512
+cd ${TRUNKDIR} || \
+ { echo "Failed to cd to ${TRUNKDIR}" ; exit 1 ; }
+
+echo "Cleaning the repositories"
+
+if [ $verbose != 0 ] ; then
+ make -C ${NUTTXDIR} distclean
+else
+ make -C ${NUTTXDIR} distclean 1>/dev/null
+fi
# Prepare the nuttx directory
@@ -221,6 +216,12 @@ ${VERSIONSH} ${DEBUG} ${BUILD} ${VERSIONOPT} ${NUTTXDIR}/.version || \
chmod 755 ${NUTTXDIR}/.version || \
{ echo "'chmod 755 ${NUTTXDIR}/.version' failed"; exit 1; }
+if [ -z ${VERSION} ] ; then
+ source ${NUTTXDIR}/.version
+ VERSION=${CONFIG_VERSION_STRING}
+ VERSIONOPT="-v ${VERSION}"
+fi
+
# Update the configuration variable documentation
#
# MKCONFIGVARS=${NUTTXDIR}/tools/mkconfigvars.sh
@@ -240,18 +241,16 @@ chmod 755 ${NUTTXDIR}/.version || \
# { echo "'chmod 644 ${CONFIGVARHTML}' failed"; exit 1; }
#
-# Perform a full clean for the distribution
-
-cd ${TRUNKDIR} || \
- { echo "Failed to cd to ${TRUNKDIR}" ; exit 1 ; }
-
-echo "Cleaning the repositories"
+# Create the versioned tarball names
-if [ $verbose != 0 ] ; then
- make -C ${NUTTXDIR} distclean
-else
- make -C ${NUTTXDIR} distclean 1>/dev/null
-fi
+NUTTX_TARNAME=apache-nuttx-${VERSION}-incubating.tar
+APPS_TARNAME=apache-nuttx-apps-${VERSION}-incubating.tar
+NUTTX_ZIPNAME=${NUTTX_TARNAME}.gz
+APPS_ZIPNAME=${APPS_TARNAME}.gz
+NUTTX_ASCNAME=${NUTTX_ZIPNAME}.asc
+APPS_ASCNAME=${APPS_ZIPNAME}.asc
+NUTTX_SHANAME=${NUTTX_ZIPNAME}.sha512
+APPS_SHANAME=${APPS_ZIPNAME}.sha512
# Remove any previous tarballs