From 411823a24d28b247c2b589ab21f14c2fa6624569 Mon Sep 17 00:00:00 2001 From: Automatic Release Builder Date: Fri, 12 Feb 2021 22:28:52 +0000 Subject: [PATCH] Add script to create base package and update TXZ --- .gitignore | 1 + build_release_linux.sh | 6 --- release_builder/create_base_package.sh | 59 ++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 6 deletions(-) create mode 100755 release_builder/create_base_package.sh diff --git a/.gitignore b/.gitignore index 10f8a93..97fe590 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,5 @@ CMakeCache.txt build-* testOutput* md5sum.xml +staging diff --git a/build_release_linux.sh b/build_release_linux.sh index 2cd5f7f..d14b310 100755 --- a/build_release_linux.sh +++ b/build_release_linux.sh @@ -57,9 +57,3 @@ make install make package_source cp flightgear-*.tar.bz2 ../output/. -##################################################################################### - -echo "Assembling base package" -cd $WORKSPACE - -tar cjf output/FlightGear-$VERSION-data.tar.bz2 fgdata/ diff --git a/release_builder/create_base_package.sh b/release_builder/create_base_package.sh new file mode 100755 index 0000000..3cdbf7b --- /dev/null +++ b/release_builder/create_base_package.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +##################################################################################### + + +if [ "$WORKSPACE" == "" ]; then + echo "ERROR: Missing WORKSPACE environment variable." + exit 1 +fi + +if [ ! -d "$WORKSPACE/fgdata" ]; then + echo "No fgdata subdir in WORKSPACE: can't continue" + exit 1 +fi + + +VERSION=`cat fgdata/version` +BASE_VERSION_TAG="version/2020.3.1" +SCENERY_PACK_AIRPORT=BIKF +SCENERY_PACK_URI="https://sourceforge.net/projects/flightgear/files/scenery/SceneryPack.${SCENERY_PACK_AIRPORT}.tgz/download" + +echo "Assembling base package for $VERSION" +cd $WORKSPACE + + +# wipe directories and re-create +rm -rf output +rm -rf staging +mkdir -p output +mkdir -p staging + +rsync -az --exclude=".git" fgdata staging/ + +# add all the scenery pack files into it + +SCENERY_PACK_NAME=SceneryPack_${SCENERY_PACK_AIRPORT}.tgz + +# Should we re-download the SceneryPack periodically? Or just rely on doing a workspace wipe? +if [ ! -f $SCENERY_PACK_NAME ]; then + echo "Downlaod scenery pack from ${SCENERY_PACK_URI}" + # -L to follow the SF redirect + curl -L $SCENERY_PACK_URI --output $SCENERY_PACK_NAME +fi + +tar -xf $SCENERY_PACK_NAME --directory staging/fgdata +pushd staging/fgdata +mv SceneryPack.${SCENERY_PACK_AIRPORT} Scenery +popd + +# Creating full base package TXZ + +OUTPUT_NAME=FlightGear-$VERSION-data +tar -cJf output/$OUTPUT_NAME.txz --directory staging fgdata + +echo "Creating updates package" + +tar -cJf output/FlightGear-$VERSION-update-data.txz `git -C fgdata diff --name-only --line-prefix="fgdata/" $BASE_VERSION_TAG..HEAD` + +echo "Done, data TXZs are in output/"