aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-04-29 17:01:21 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-04-30 14:55:28 +0200
commit6e37b01545024f2d61cb525cb341fa4e3db43a76 (patch)
tree288b2b0fda045cc08786f107c61196b82fb834cb
parent47d23b1efc9200fe081f60eee8354a017c5a73d9 (diff)
downloadvendor_replicant-release-scripts-wip-after-rc5.tar.gz
vendor_replicant-release-scripts-wip-after-rc5.tar.bz2
vendor_replicant-release-scripts-wip-after-rc5.zip
WIP script: TODO: move checkout_revision after fetchwip-after-rc5
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rwxr-xr-xmake_source_tarball.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/make_source_tarball.sh b/make_source_tarball.sh
index 3843eed..6958b01 100755
--- a/make_source_tarball.sh
+++ b/make_source_tarball.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+set -x
#
# Copyright (C) 2021 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
#
@@ -46,6 +47,32 @@ get_option()
fi
}
+get_revision()
+{
+ repo="$1"
+
+ shift 1
+
+ git -C "${repo}" --no-pager log --oneline --format='%H' $@
+}
+
+checkout_revision()
+{
+ repo="$1"
+ given_revision="$2"
+
+ # TODO: handle multiple remotes
+ # Make sure to have the revision
+ git -C "${repo}" fetch $(git -C "${repo}" remote) "${given_revision}"
+
+ current_revision="$(get_revision ${repo} HEAD -1)"
+ desired_revision="$(get_revision ${repo} ${given_revision})"
+
+ if [ "${current_revision}" != "${desired_revision}" ] ; then
+ git -C "${repo}" checkout "${given_revision}"
+ fi
+}
+
if [ $# -ne 2 -a $# -ne 4 -a $# -ne 6 ] ; then
usage
elif [ $# -eq 4 ] ; then
@@ -77,6 +104,10 @@ if [ ! -d .repo ] ; then
--depth=1 || rm -rf .repo/
fi
+for repo in $(repo list | awk '{print $1}') ; do
+ checkout_revision "${repo}" "${tag}"
+done
+
# 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.
@@ -90,6 +121,8 @@ fi
repo sync -j "${jobs}"
+
+
# We want the exact same source code used to build the images, so we need to
# remove all the modifications we did to enable fetching the source code
if [ $(echo $major_version | sed 's/\..*//') -lt 6 ] ; then