summaryrefslogtreecommitdiffstats
path: root/rtems-release-package
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2016-11-11 02:31:43 +0000
committerChris Johns <chrisj@rtems.org>2016-11-11 02:31:43 +0000
commite86b33f5093b99a3194fcd28ead8936b0c3c5821 (patch)
tree21458e754ce5cd574595246bbc65951d5b3859b3 /rtems-release-package
parentFix the doco and packaging of docs. Sort out the README.txt templates. (diff)
downloadrtems-release-e86b33f5093b99a3194fcd28ead8936b0c3c5821.tar.bz2
Add examples-v2 and libbsd.
These repos have submodules which need special handling to archive. Add release notes.
Diffstat (limited to 'rtems-release-package')
-rwxr-xr-xrtems-release-package57
1 files changed, 49 insertions, 8 deletions
diff --git a/rtems-release-package b/rtems-release-package
index 02f5d7e..506a13b 100755
--- a/rtems-release-package
+++ b/rtems-release-package
@@ -50,28 +50,69 @@ set -e
echo "git clone ${git_remote} ${git_local}"
git clone ${git_remote} ${git_local}
-stamped_tar=${prefix}-unstamped.tar.xz
+stamped_tar=${prefix}-unstamped
+#
+# Clone the repo and then check if there are any submodules.
+#
+# If there are submodules, exclude the ones we do not wish to package, eg the
+# whole of the FreeBSD source tree. For the ones to package get the commit
+# (treeish) for the branch we releasing and then create an archive. The
+# submodule archives are merged into the main archive once we have collected
+# them all.
+#
+#
cd ${git_local}
echo "git fetch origin"
git fetch origin
+ git_submodules=$(git submodule | cut -w -f 2)
+ if [ -n "${git_submodules}" ]; then
+ echo "git submodules found ...."
+ git submodule init
+ for s in ${git_submodules}
+ do
+ ok=$(echo ${git_submodules_excludes} | sed -e "s/.*${s}.*/no/g")
+ if [ "${ok}" != "no" ]; then
+ echo "git submodule update ${s}"
+ git submodule update ${s}
+ treeish=$(git ls-tree origin/${version} ${s} | cut -w -f 3)
+ cd ${s}
+ echo "git archive --format=tar --prefix=${prefix}/${s}/ ${treeish}"
+ git archive --format=tar --prefix=${prefix}/${s}/ ${treeish} > \
+ ../../${stamped_tar}-${s}.tar
+ cd .. # ${s}
+ else
+ echo "git submodule ${s} excluded"
+ fi
+ done
+ fi
echo "git archive --format=tar --prefix=${prefix}/ origin/${version}"
- git archive --format=tar --prefix=${prefix}/ origin/${version} | \
- xz > ../${stamped_tar}
- cd ..
+ git archive --format=tar --prefix=${prefix}/ origin/${version} > \
+ ../${stamped_tar}.tar
+ cd .. # ${git_local}
-if [ ! -f ${stamped_tar} ]; then
+if [ ! -f ${stamped_tar}.tar ]; then
echo "error: git archive failed, no tar file"
exit 1
fi
-echo "tar Jxf ${stamped_tar}"
-tar Jxf ${stamped_tar}
+echo "tar Jxf ${stamped_tar}.tar"
+tar Jxf ${stamped_tar}.tar
+if [ -n "${git_submodules}" ]; then
+ for s in ${git_submodules}
+ do
+ ok=$(echo ${git_submodules_excludes} | sed -e "s/.*${s}.*/no/g")
+ if [ "${ok}" != "no" ]; then
+ echo "tar Jxf ${stamped_tar}-${s}.tar"
+ tar Jxf ${stamped_tar}-${s}.tar
+ fi
+ done
+fi
cd ${prefix}
echo "Creating VERSION: ${release}"
echo "[version]" > VERSION
echo "release = ${release}" >> VERSION
- cd ..
+ cd .. # ${prefix}
#
# Run the worker script if provided. It can perform any package