[Replicant] [vendor_replicant-release-scripts] [PATCH 1/2] make_source_tarball.sh: add support for git:// for Replicant <= 4.2-0004

Denis 'GNUtoo' Carikli GNUtoo at cyberdimension.org
Mon Mar 29 16:38:48 UTC 2021


Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at cyberdimension.org>
---
 make_source_tarball.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/make_source_tarball.sh b/make_source_tarball.sh
index ec8b290..41b8195 100755
--- a/make_source_tarball.sh
+++ b/make_source_tarball.sh
@@ -29,6 +29,10 @@ outdir="$2"
 replicant_dir="${outdir}/${tag}"
 repo_branch="refs/tags/${tag}"
 
+version="$(echo ${tag} | sed 's/replicant-//')"
+major_version="$(echo ${version} | sed 's/-.*//')"
+minor_version="$(echo ${version} | sed 's/.*-//')"
+
 if [ $# -ne 2 ] ; then
 	usage
 fi
@@ -42,8 +46,23 @@ if [ ! -d .repo ] ; then
 		--depth=1 || rm -rf .repo/
 fi
 
+# We have an issue with all the Replicant releases before Replicant 6.0-0001:
+# All the manifests use git://, however over the time we moved several git
+# repositories and wrote some apache redirect rules to handle that.
+# Due to that, only http:// and https:// work fine.
+# This should be fixed in all the replicant-<version>-dev branches, however
+# we cannot use that here as we are making tarballs of former releases.
+if [ $(echo ${major_version} | sed 's/\..*//') -lt 6 ] ; then
+	sed 's#git://#https://#g' -i \
+	    .repo/manifests/default.xml
+fi
+
 repo sync
 
+if [ $(echo $major_version | sed 's/\..*//') -lt 6 ] ; then
+	git -C .repo/manifests reset --hard
+fi
+
 cd ..
 tarball="${tag}.tar"
 if [ ! -f "${tarball}" ] && [ ! -f "${tarball}.xz" ] ; then
-- 
2.30.2



More information about the Replicant mailing list