1
0
Fork 0

Add script to create base package and update TXZ

This commit is contained in:
Automatic Release Builder 2021-02-12 22:28:52 +00:00
parent 799633854b
commit 411823a24d
3 changed files with 60 additions and 6 deletions

1
.gitignore vendored
View file

@ -23,4 +23,5 @@ CMakeCache.txt
build-*
testOutput*
md5sum.xml
staging

View file

@ -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/

View file

@ -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/"