Change in osmo-ci[master]: OSMO_RELEASE_REPOS: add simtrace2, osmo-remsim

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

osmith gerrit-no-reply at lists.osmocom.org
Fri Dec 10 09:45:22 UTC 2021


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/26491 )


Change subject: OSMO_RELEASE_REPOS: add simtrace2, osmo-remsim
......................................................................

OSMO_RELEASE_REPOS: add simtrace2, osmo-remsim

Adjust to simtrace2's directory structure, which does not have a
configure.ac in the main directory like all other repositories. The main
directory has a regular Makefile without autotools, only the host dir
has a configure.ac file (and only in newer versions). Deal with this by
creating two tarballs, one with "git archive" for the whole directory,
and one for the host dir only with the usual "autoreconf -fi;
./configure; make dist-bzip2". The latter one has the files created by
autoreconf ("configure" script and others).

simtrace2
├── simtrace2-0.1.tar.bz2
├── simtrace2-0.2.tar.bz2
├── simtrace2-0.3.tar.bz2
├── simtrace2-0.4.tar.bz2
├── simtrace2-0.5.1.tar.bz2
├── simtrace2-0.5.tar.bz2
├── simtrace2-0.6.1.tar.bz2
├── simtrace2-0.6.tar.bz2
├── simtrace2-0.7.0.tar.bz2
├── simtrace2-0.7.1.tar.bz2
├── simtrace2-0.8.0.tar.bz2
├── simtrace2-0.8.1.tar.bz2
├── simtrace2-host-0.6.1.tar.bz2
├── simtrace2-host-0.6.tar.bz2
├── simtrace2-host-0.7.0.tar.bz2
├── simtrace2-host-0.7.1.tar.bz2
├── simtrace2-host-0.8.0.tar.bz2
└── simtrace2-host-0.8.1.tar.bz

Closes: OS#5347
Change-Id: Ib52a23a2a7d6ea64bfa539b1d026f035fdb3af57
---
M scripts/common.sh
M scripts/osmocom-release-tarballs.sh
2 files changed, 74 insertions(+), 8 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/91/26491/1

diff --git a/scripts/common.sh b/scripts/common.sh
index 10fe7f3..8657fd8 100644
--- a/scripts/common.sh
+++ b/scripts/common.sh
@@ -29,6 +29,7 @@
 	osmo-msc
 	osmo-pcap
 	osmo-pcu
+	osmo-remsim
 	osmo-sgsn
 	osmo-sip-connector
 	osmo-smlc
@@ -36,6 +37,7 @@
 	osmo-trx
 	osmo-uecups
 	osmocom-bb
+	simtrace2
 "
 
 OSMO_BRANCH_DOCKER_PLAYGROUND="${OSMO_BRANCH_DOCKER_PLAYGROUND:-master}"
diff --git a/scripts/osmocom-release-tarballs.sh b/scripts/osmocom-release-tarballs.sh
index 18ea1d7..8242a49 100755
--- a/scripts/osmocom-release-tarballs.sh
+++ b/scripts/osmocom-release-tarballs.sh
@@ -128,7 +128,7 @@
 }
 
 # Clone an Osmocom repository to $TEMP/repos/$repo, clean it, checkout a tag.
-# $1: Osmocom repository
+# $1: Osmocom repository (may end in subdir, e.g. simtrace2/host)
 # $2: tag (optional, default: master)
 prepare_repo() {
 	local repo="$1"
@@ -144,13 +144,21 @@
 	git checkout -q "$tag"
 }
 
+
+# Get the desired tarball name, replace / with - in $1.
+# $1: Osmocom repository (may end in subdir, e.g. simtrace2/host)
+# $2: tag
+tarball_name() {
+	echo "$(echo "$repo" | tr / -)-$tag.tar.bz2"
+}
+
 # Checkout a given tag and build a release tarball.
-# $1: Osmocom repository
+# $1: Osmocom repository (may end in subdir, e.g. simtrace2/host)
 # $2: tag
 create_tarball() {
 	local repo="$1"
 	local tag="$2"
-	local tarball="$repo-$tag.tar.bz2"
+	local tarball="$(tarball_name "$repo" "$tag")"
 
 	# Be verbose during the tarball build and preparation. Everything else is not verbose, so we can generate an
 	# easy to read overview of tarballs that are already built or are ignored.
@@ -174,15 +182,72 @@
 	fi
 }
 
+# Create a release tarball with "git archive" for non-autotools projects.
+# $1: Osmocom repository
+# $2: tag
+create_tarball_git() {
+	local repo="$1"
+	local tag="$2"
+	local tarball="$(tarball_name "$repo" "$tag")"
+
+	set -x
+
+	cd "$TEMP/repos/$repo"
+	git archive \
+		-o "$tarball" \
+		"$tag"
+
+	set +x
+}
+
 # Move a generated release tarball to the output dir.
+# $1: Osmocom repository (may end in subdir, e.g. simtrace2/host)
+# $2: tag
 move_tarball() {
 	local repo="$1"
 	local tag="$2"
-	local tarball="$repo-$tag.tar.bz2"
+	local tarball="$(tarball_name "$repo" "$tag")"
+	local repo_dir="$(echo "$repo" | cut -d / -f 1)"
 
 	cd "$TEMP/repos/$repo"
-	mkdir -p "$OUTPUT/$repo"
-	mv "$tarball" "$OUTPUT/$repo/$tarball"
+	mkdir -p "$OUTPUT/$repo_dir"
+	mv "$tarball" "$OUTPUT/$repo_dir/$tarball"
+}
+
+# Check if a git tag has a specific file
+# $1: Osmocom repository
+# $2: tag
+# $3: file
+tag_has_file() {
+	local repo="$1"
+	local tag="$2"
+	local file="$3"
+
+	git -C "$TEMP/repos/$repo" show "$tag:$file" >/dev/null 2>&1
+}
+
+# Create and move tarballs for Osmocom repositories.
+# $1: Osmocom repository
+# $2: tag
+create_move_tarball() {
+	local repo="$1"
+	local tag="$2"
+
+	case "$repo" in
+		simtrace2)
+			if tag_has_file "$repo" "$tag" host/configure.ac; then
+				create_tarball "$repo/host" "$tag"
+				move_tarball "$repo/host" "$tag"
+			fi
+
+			create_tarball_git "$repo" "$tag"
+			move_tarball "$repo" "$tag"
+			;;
+		*)
+			create_tarball "$repo" "$tag"
+			move_tarball "$repo" "$tag"
+			;;
+	esac
 }
 
 remove_temp_dir
@@ -211,8 +276,7 @@
 		fi
 
 		echo "  $tarball (creating)"
-		create_tarball "$repo" "$tag"
-		move_tarball "$repo" "$tag"
+		create_move_tarball "$repo" "$tag"
 	done
 done
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/26491
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ib52a23a2a7d6ea64bfa539b1d026f035fdb3af57
Gerrit-Change-Number: 26491
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211210/f61ba84f/attachment.htm>


More information about the gerrit-log mailing list