[rtems-release commit] Add a release_url to the arguments for the various steps.
Chris Johns
chrisj at rtems.org
Fri Feb 28 04:34:45 UTC 2020
Module: rtems-release
Branch: master
Commit: 4aa7034e6e9dfe3a79bd238abef03294d186dee1
Changeset: http://git.rtems.org/rtems-release/commit/?id=4aa7034e6e9dfe3a79bd238abef03294d186dee1
Author: Chris Johns <chrisj at rtems.org>
Date: Fri Feb 28 15:32:08 2020 +1100
Add a release_url to the arguments for the various steps.
- The release_url can be used for testing or to allow deployment
by setting the top level URL the source is fetched from.
- Move libbsd up in the order so the RSB can get a hash for it.
---
rtems-release | 58 ++++++++++++++++++++++++++++++++++-----------
rtems-release-defaults | 8 +++++++
rtems-release-kernel | 9 +++----
rtems-release-package | 2 +-
rtems-release-package-start | 13 +++++-----
rtems-release-rsb-version | 23 +++++++++---------
rtems-release-sources | 5 ++--
7 files changed, 80 insertions(+), 38 deletions(-)
diff --git a/rtems-release b/rtems-release
index f647075..7d3c671 100755
--- a/rtems-release
+++ b/rtems-release
@@ -49,10 +49,40 @@ export release_top=${PWD}
. ${release_top}/rtems-release-defaults
#
-# The version and revision.
+# Usage for this tool.
+#
+usage() {
+ echo "Usage: $0 [-u RSB-URL] version revision" 1>&2
+ echo " where:" 1>&2
+ echo " version : The version of RTEMS, eg 5" 1>&2
+ echo " revision : The revision, eg 0.0 or 0.0-myrev" 1>&2
+ echo " -u [RSB-URL] : The primary download path the RSB uses (for testing)." 1>&2
+ exit 1
+}
+
+#
+# Option defaults
+#
+release_url=${rtems_release_url}
+
+#
+# Manage the command line.
#
+while getopts ":u:" opt; do
+ case "${opt}" in
+ u)
+ release_url=${OPTARG}
+ ;;
+ *)
+ usage
+ ;;
+ esac
+done
+shift $((OPTIND-1))
+
+
if [ $# -ne 2 ]; then
- echo "error: must be 2 arguments, version and revision."
+ echo "error: 2 arguments must be supplied, version and revision. See -h for help"
exit 1
fi
version=$1
@@ -76,43 +106,43 @@ mkdir ${release}
# Package the RSB, must be before the kernel. The kernel worker script uses the
# RSB to create autoconf and automake so it can bootstrap the kernel.
#
-build rtems-source-builder ${version} ${revision}
-build rtems-tools ${version} ${revision}
-build rtems ${version} ${revision} rtems-release-kernel
-build rtems-source-builder ${version} ${revision} rtems-release-rsb-version
+build rtems-source-builder ${version} ${revision} ${release_url}
+build rtems-tools ${version} ${revision} ${release_url}
+build rtems ${version} ${revision} ${release_url} rtems-release-kernel
+if [ ${rtems_libbsd} = yes ]; then
+ build rtems-libbsd ${version} ${revision} ${release_url}
+fi
+build rtems-source-builder ${version} ${revision} ${release_url} rtems-release-rsb-version
if [ ${rtems_examples} = yes ]; then
if [ ${version} -lt 5 ]; then
- build examples-v2 ${version} ${revision}
+ build examples-v2 ${version} ${revision} ${release_url}
# Hack around the repo naming.
mv ${release}/examples-v2-${release}.tar.${comp_ext} \
${release}/rtems-examples-v2-${release}.tar.${comp_ext}
else
- build rtems-examples ${version} ${revision}
+ build rtems-examples ${version} ${revision} ${release_url}
fi
fi
-if [ ${rtems_libbsd} = yes ]; then
- build rtems-libbsd ${version} ${revision}
-fi
#
# Documentation.
#
if [ ${rtems_docs} = yes ]; then
- ./rtems-release-docs rtems-docs ${version} ${revision}
+ ./rtems-release-docs rtems-docs ${version} ${revision} ${release_url}
fi
#
# Release notes.
#
if [ ${rtems_release_notes} = yes ]; then
- ./rtems-release-notes rtems-release-notes ${version} ${revision}
+ ./rtems-release-notes rtems-release-notes ${version} ${revision} ${release_url}
fi
#
# The sources is always last.
#
echo "Collect tools sources"
-./rtems-release-sources ${version} ${revision}
+./rtems-release-sources ${version} ${revision} ${release_url}
#
# Create the README.txt
diff --git a/rtems-release-defaults b/rtems-release-defaults
index 9be04bb..b6c75bf 100755
--- a/rtems-release-defaults
+++ b/rtems-release-defaults
@@ -66,6 +66,7 @@ rtems_readme=README.txt.in
rtems_readme_release_notes=
rtems_release_conf=
rtems_release_url=https://ftp.rtems.org/pub/rtems/releases
+rtems_rsb_hash="rtems-tools rtems"
#
# The date stamp
@@ -80,3 +81,10 @@ if [ -f rtems-release-${version}-conf ]; then
rtems_release_conf=rtems-release-${version}-conf
. rtems-release-${version}-conf
fi
+
+#
+# Conditional add libbsd for an RSB hash if enabled.
+#
+if [ ${rtems_libbsd} = yes ]; then
+ rtems_rsb_hash="${rtems_rsb_hash} rtems-libbsd"
+fi
diff --git a/rtems-release-kernel b/rtems-release-kernel
index 9d22668..ab48adb 100755
--- a/rtems-release-kernel
+++ b/rtems-release-kernel
@@ -43,17 +43,18 @@ echo "RTEMS Release RTEMS Kernel, v${rtems_release_version}"
. ${release_top}/rtems-release-defaults
#
-# The package, version and revision.
+# The package, version, revision and release URL.
#
-if [ $# -ne 4 ]; then
+if [ $# -ne 5 ]; then
echo "error: must be arguments, the package, version," \
- "release and the top directory."
+ "release, release URL and the top directory."
exit 1
fi
package=$1
version=$2
revision=$3
-toptop=$4
+release_url=$4
+toptop=$5
release=${version}.${revision}
prefix=${package}-${release}
diff --git a/rtems-release-package b/rtems-release-package
index 4a150a7..8e2ca53 100755
--- a/rtems-release-package
+++ b/rtems-release-package
@@ -128,7 +128,7 @@ cd ${prefix}
# package the release.
#
if [ -n "${worker}" ]; then
- ${worker} ${package} ${version} ${revision} ${top}
+ ${worker} ${package} ${version} ${revision} ${release_url} ${top}
fi
#
diff --git a/rtems-release-package-start b/rtems-release-package-start
index 19efbcd..92ad89b 100755
--- a/rtems-release-package-start
+++ b/rtems-release-package-start
@@ -39,20 +39,21 @@ top=${PWD}
#
# The package, version and revision amd maybe a worker script.
#
-if [ $# -lt 3 -o $# -gt 4 ]; then
- echo "error: must be 3 or 4 arguments, the package, version," \
- "release and optionally a worker script."
+if [ $# -lt 4 -o $# -gt 5 ]; then
+ echo "error: must be 4 or 5 arguments, the package, version," \
+ "release, release URL and optionally a worker script."
exit 1
fi
package=$1
version=$2
revision=$3
-if [ $# -eq 4 ]; then
- if [ ! -x ${top}/$4 ]; then
+release_url=$4
+if [ $# -eq 5 ]; then
+ if [ ! -x ${top}/$5 ]; then
echo "error: cannot find the worker: $4"
exit 1
fi
- worker=${top}/$4
+ worker=${top}/$5
else
worker=
fi
diff --git a/rtems-release-rsb-version b/rtems-release-rsb-version
index 62abb74..c960dfc 100755
--- a/rtems-release-rsb-version
+++ b/rtems-release-rsb-version
@@ -43,17 +43,18 @@ echo "RTEMS Release RSB Versioning, v${rtems_release_version}"
. ${release_top}/rtems-release-defaults
#
-# The package, version and revision.
+# The package, version, revision and release URL.
#
-if [ $# -ne 4 ]; then
+if [ $# -ne 5 ]; then
echo "error: must be arguments, the package, version," \
- "release and the top directory."
+ "release, release URL and the top directory."
exit 1
fi
package=$1
version=$2
revision=$3
-toptop=$4
+release_url=$4
+toptop=$5
release=${version}.${revision}
prefix=${package}-${release}
@@ -66,15 +67,15 @@ echo "Release: ${release}"
#
if [ \( $(echo "${release}" | sed -e 's/.*rc.*/yes/') = "yes" \) -o \
\( $(echo "${release}" | sed -e 's/.*RC.*/yes/') = "yes" \) ]; then
- rp="${rtems_release_url}/${version}/rc/${release}"
- rp="${rp},${rtems_release_url}/${version}/rc/${release}/sources"
+ rp="${release_url}/${version}/rc/${release}"
+ rp="${rp},${release_url}/${version}/rc/${release}/sources"
elif [ \( $(echo "${release}" | sed -e 's/.*-m.*/yes/') = "yes" \) ]; then
revision=$(echo "${release}" | sed -e 's/-m.*//')
- rp="${rtems_release_url}/${version}/${revision}/${release}"
- rp="${rp},${rtems_release_url}/${version}/${revision}/${release}/sources"
+ rp="${release_url}/${version}/${revision}/${release}"
+ rp="${rp},${release_url}/${version}/${revision}/${release}/sources"
else
- rp="${rtems_release_url}/${version}/${release}"
- rp="${rp},${rtems_release_url}/${version}/${release}/sources"
+ rp="${release_url}/${version}/${release}"
+ rp="${rp},${release_url}/${version}/${release}/sources"
fi
echo "release_path = ${rp}" >> ${prefix}/VERSION
@@ -86,7 +87,7 @@ checksum=sha512
#
echo >> ${prefix}/VERSION
echo "[hashes]" >> ${prefix}/VERSION
-for p in rtems-tools rtems
+for p in ${rtems_rsb_hash}
do
file=${p}-${release}.tar.xz
hash=$(${checksum} -q ${toptop}/${release}/${file})
diff --git a/rtems-release-sources b/rtems-release-sources
index d743da2..e6f88ca 100755
--- a/rtems-release-sources
+++ b/rtems-release-sources
@@ -45,12 +45,13 @@ echo "RTEMS Release Sources, v${rtems_release_version}"
#
# The version and revision.
#
-if [ $# -ne 2 ]; then
- echo "error: must be 2 arguments, the version, and release."
+if [ $# -ne 3 ]; then
+ echo "error: must be 3 arguments, the version, release and release URL."
exit 1
fi
version=$1
revision=$2
+release_url=$3
package=rtems-source-builder
More information about the vc
mailing list