Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c8b783710 | ||
|
|
e34d02edbc | ||
|
|
3810a31230 | ||
|
|
00710497b0 | ||
|
|
420034d5b5 | ||
|
|
b3893f7bda | ||
|
|
4e28b88c22 | ||
|
|
fa0dcb5d4d | ||
|
|
819074136a | ||
|
|
03ac46120c | ||
|
|
cc76052038 | ||
|
|
3f38a3cf18 | ||
|
|
1c7dcaf5d5 | ||
|
|
dbdfc52a00 | ||
|
|
d4489091e2 | ||
|
|
6fa2edf9d5 |
+4
-4
@@ -1,11 +1,11 @@
|
|||||||
[submodule "simgear"]
|
[submodule "simgear"]
|
||||||
path = simgear
|
path = simgear
|
||||||
url = ../simgear
|
url = ../simgear
|
||||||
branch = release/2020.1
|
branch = next
|
||||||
[submodule "flightgear"]
|
[submodule "flightgear"]
|
||||||
path = flightgear
|
path = flightgear
|
||||||
url = ../flightgear
|
url = ../flightgear
|
||||||
branch = release/2020.1
|
branch = next
|
||||||
[submodule "fgrun"]
|
[submodule "fgrun"]
|
||||||
path = fgrun
|
path = fgrun
|
||||||
url = ../fgrun
|
url = ../fgrun
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
[submodule "fgdata"]
|
[submodule "fgdata"]
|
||||||
path = fgdata
|
path = fgdata
|
||||||
url = ../fgdata
|
url = ../fgdata
|
||||||
branch = release/2020.1
|
branch = next
|
||||||
[submodule "windows-3rd-party"]
|
[submodule "windows-3rd-party"]
|
||||||
path = windows-3rd-party
|
path = windows-3rd-party
|
||||||
url = ../windows-3rd-party
|
url = ../windows-3rd-party
|
||||||
@@ -21,4 +21,4 @@
|
|||||||
[submodule "getstart"]
|
[submodule "getstart"]
|
||||||
path = getstart
|
path = getstart
|
||||||
url = ../getstart
|
url = ../getstart
|
||||||
branch = release/2020.1
|
branch = next
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
; we copy everything in install/<arch>/bin except these, which aren't
|
; we copy everything in install/<arch>/bin except these, which aren't
|
||||||
; useful to the end-user to ship
|
; useful to the end-user to ship
|
||||||
#define ExcludedBinaries "*smooth.exe,metar.exe,js_demo.exe"
|
#define ExcludedBinaries "*smooth.exe,metar.exe"
|
||||||
|
|
||||||
[Setup]
|
[Setup]
|
||||||
AppId=FlightGear
|
AppId=FlightGear
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<version n="0">2019.*</version>
|
<version n="0">2019.*</version>
|
||||||
<version n="1">2018.*</version>
|
<version n="1">2018.*</version>
|
||||||
|
<version n="2">2020.1.*</version>
|
||||||
|
<version n="3">2020.2.*</version>
|
||||||
|
|
||||||
<id>org.flightgear.fgaddon.trunk</id>
|
<id>org.flightgear.fgaddon.trunk</id>
|
||||||
<license>GPL</license>
|
<license>GPL</license>
|
||||||
|
|||||||
+133
-8
@@ -88,6 +88,54 @@ function _logOutput(){
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _yes_no_quit_prompt(){
|
||||||
|
local prompt="$1"
|
||||||
|
local default="$2"
|
||||||
|
local choices res answer
|
||||||
|
|
||||||
|
case "$default" in
|
||||||
|
[yY]) choices='Y/n/q' ;;
|
||||||
|
[nN]) choices='y/N/q' ;;
|
||||||
|
[qQ]) choices='y/n/Q' ;;
|
||||||
|
"")
|
||||||
|
if [[ "$INTERACTIVE_MODE" -eq 0 ]]; then
|
||||||
|
_printLog "Non-interactive mode requested, but found a question with" \
|
||||||
|
"no default answer;"
|
||||||
|
_printLog "this can't work, aborting."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
choices='y/n/q'
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
_printLog \
|
||||||
|
"Invalid default choice for _yes_no_quit_prompt(): this is a bug in the"
|
||||||
|
"script, aborting."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
if [[ "$INTERACTIVE_MODE" -eq 0 ]]; then
|
||||||
|
answer="$default"
|
||||||
|
else
|
||||||
|
read -r -p "$prompt [$choices] " answer
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$answer" ]]; then
|
||||||
|
answer="$default"
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$answer" in
|
||||||
|
[yY]) res=0; break ;;
|
||||||
|
[nN]) res=1; break ;;
|
||||||
|
[qQ]) res=2; break ;;
|
||||||
|
*) ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
return $res
|
||||||
|
}
|
||||||
|
|
||||||
function _aptUpdate(){
|
function _aptUpdate(){
|
||||||
local cmd=()
|
local cmd=()
|
||||||
|
|
||||||
@@ -171,7 +219,6 @@ function _gitDownload(){
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ -f "README" -o -f "README.txt" -o -f "README.rst" ]; then
|
if [ -f "README" -o -f "README.txt" -o -f "README.rst" ]; then
|
||||||
_printLog "$component: the repository already exists"
|
_printLog "$component: the repository already exists"
|
||||||
else
|
else
|
||||||
@@ -179,11 +226,73 @@ function _gitDownload(){
|
|||||||
"${REPO_USERNAME[$component]}" \
|
"${REPO_USERNAME[$component]}" \
|
||||||
"$component")
|
"$component")
|
||||||
clone_arg="${proto_spec}${REPO_ADDRESS[$component]}"
|
clone_arg="${proto_spec}${REPO_ADDRESS[$component]}"
|
||||||
_printLog "Fetching $component with 'git clone $clone_arg'"
|
|
||||||
git clone "$clone_arg" .
|
# Test whether $clone_arg is 'https://git.code.sf.net/p/flightgear/fgdata'
|
||||||
|
if _check_clone_url_and_maybe_ask "$clone_arg"; then
|
||||||
|
_clone_fgdata # Work around a problem at SourceForge
|
||||||
|
else
|
||||||
|
_printLog "Fetching $component with 'git clone $clone_arg'"
|
||||||
|
git clone "$clone_arg" .
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Return 0 if _clone_fgdata() should be used, otherwise 1.
|
||||||
|
function _check_clone_url_and_maybe_ask(){
|
||||||
|
local -i retcode=1
|
||||||
|
|
||||||
|
if [[ "$1" = "https://git.code.sf.net/p/flightgear/fgdata" ]]; then
|
||||||
|
local prompt_res=-1
|
||||||
|
set +e
|
||||||
|
if [[ "$INTERACTIVE_MODE" -eq 1 ]]; then
|
||||||
|
printf "From experience, cloning FGData from SourceForge using https does \
|
||||||
|
not work\n(probably a problem at SourceForge), but updates do work. Thus, we \
|
||||||
|
propose to\nclone FGData from GitLab and change the repository setup so that \
|
||||||
|
subsequent\nupdates are fetched from SourceForge. This should be quite safe, \
|
||||||
|
because\n<https://gitlab.com/flightgear/fgdata> is an official mirror of \
|
||||||
|
FGData (it is\nmaintained by FlightGear developers). Answer 'y' to proceed \
|
||||||
|
this way. If you\nanswer 'n', we'll *try* to clone FGData from SourceForge \
|
||||||
|
using https. Answer 'q'\nif you want to quit. "
|
||||||
|
fi
|
||||||
|
_yes_no_quit_prompt "What is your choice?" y; prompt_res=$?
|
||||||
|
set -e
|
||||||
|
case $prompt_res in
|
||||||
|
0) retcode=0 ;;
|
||||||
|
1) retcode=1 ;;
|
||||||
|
2) exit 0 ;;
|
||||||
|
*) _printLog "Unexpected return code from _yes_no_quit_prompt() in" \
|
||||||
|
"_check_clone_url_and_maybe_ask(); aborting."
|
||||||
|
exit 1 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [[ $retcode -eq 1 ]]; then
|
||||||
|
_printLog "Okay, will try to clone FGData from SourceForge using" \
|
||||||
|
"https, but be aware that"
|
||||||
|
_printLog "this is likely to fail."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
return $retcode
|
||||||
|
}
|
||||||
|
|
||||||
|
# Special function for cloning FGData with https. This is needed because there
|
||||||
|
# seems to be a problem at SourceForge that doesn't allow the clone operation
|
||||||
|
# to succeed for FGData using https---presumably because of its large size.
|
||||||
|
function _clone_fgdata(){
|
||||||
|
local url="https://${REPO_ADDRESS[DATA_ALT]}"
|
||||||
|
_printLog "Starting special initialization routine for the DATA component..."
|
||||||
|
_printLog "Fetching FGData with 'git clone $url'"
|
||||||
|
git clone "$url" .
|
||||||
|
_printLog "Creating the 'next' local branch"
|
||||||
|
git checkout -b next origin/next
|
||||||
|
url="https://${REPO_ADDRESS[DATA]}"
|
||||||
|
_printLog "Setting FGData's 'origin' remote to $url"
|
||||||
|
git remote set-url origin "$url"
|
||||||
|
_printLog "Updating FGData from $url"
|
||||||
|
git pull --ff-only
|
||||||
|
_printLog "Special initialization routine for the DATA component: done."
|
||||||
|
}
|
||||||
|
|
||||||
function _make(){
|
function _make(){
|
||||||
if [ "$COMPILE" = "y" ]; then
|
if [ "$COMPILE" = "y" ]; then
|
||||||
pkg="$1"
|
pkg="$1"
|
||||||
@@ -364,7 +473,17 @@ function _usage() {
|
|||||||
echo " doing the same for SIMGEAR (e.g., if doing repeated TERRAGEAR"
|
echo " doing the same for SIMGEAR (e.g., if doing repeated TERRAGEAR"
|
||||||
echo " builds and you know your SIMGEAR is already fine and up-to-date)."
|
echo " builds and you know your SIMGEAR is already fine and up-to-date)."
|
||||||
echo " -s compile only the last known stable versions"
|
echo " -s compile only the last known stable versions"
|
||||||
echo " --compositor build FlightGear with compositor enabled."
|
echo " --compositor build FlightGear with compositor enabled"
|
||||||
|
echo " --non-interactive"
|
||||||
|
echo " don't ask any question; always assume the default answer in"
|
||||||
|
echo " situations where a question would normally be asked."
|
||||||
|
echo
|
||||||
|
echo "More detailed information can be found on the FlightGear wiki:"
|
||||||
|
echo ""
|
||||||
|
echo " http://wiki.flightgear.org/Scripted_Compilation_on_Linux_Debian/Ubuntu"
|
||||||
|
echo ""
|
||||||
|
echo "The wiki may sometimes be a bit outdated; if in doubt, consider this help text"
|
||||||
|
echo "as the reference."
|
||||||
}
|
}
|
||||||
|
|
||||||
#######################################################
|
#######################################################
|
||||||
@@ -373,6 +492,7 @@ set -e
|
|||||||
|
|
||||||
CBD="$PWD"
|
CBD="$PWD"
|
||||||
LOGFILE="$CBD/compilation_log.txt"
|
LOGFILE="$CBD/compilation_log.txt"
|
||||||
|
INTERACTIVE_MODE=1
|
||||||
|
|
||||||
# Available values for WHATTOBUILD and WHATTOBUILDALL:
|
# Available values for WHATTOBUILD and WHATTOBUILDALL:
|
||||||
declare -a WHATTOBUILD_AVAIL=(
|
declare -a WHATTOBUILD_AVAIL=(
|
||||||
@@ -450,6 +570,9 @@ REPO_ADDRESS[SIMGEAR]="git.code.sf.net/p/flightgear/simgear"
|
|||||||
REPO_SITE[SIMGEAR]="SourceForge"
|
REPO_SITE[SIMGEAR]="SourceForge"
|
||||||
REPO_ADDRESS[DATA]="git.code.sf.net/p/flightgear/fgdata"
|
REPO_ADDRESS[DATA]="git.code.sf.net/p/flightgear/fgdata"
|
||||||
REPO_SITE[DATA]="SourceForge"
|
REPO_SITE[DATA]="SourceForge"
|
||||||
|
# This is an official mirror of FGData
|
||||||
|
REPO_ADDRESS[DATA_ALT]="gitlab.com/flightgear/fgdata.git"
|
||||||
|
REPO_SITE[DATA_ALT]="GitLab"
|
||||||
REPO_ADDRESS[FGFS]="git.code.sf.net/p/flightgear/flightgear"
|
REPO_ADDRESS[FGFS]="git.code.sf.net/p/flightgear/flightgear"
|
||||||
REPO_SITE[FGFS]="SourceForge"
|
REPO_SITE[FGFS]="SourceForge"
|
||||||
REPO_ADDRESS[FGRUN]="git.code.sf.net/p/flightgear/fgrun"
|
REPO_ADDRESS[FGRUN]="git.code.sf.net/p/flightgear/fgrun"
|
||||||
@@ -471,7 +594,8 @@ if [[ `uname` == 'OpenBSD' ]]; then
|
|||||||
fi
|
fi
|
||||||
TEMP=$($getopt -o '+shc:p:a:d:r:j:O:ib:' \
|
TEMP=$($getopt -o '+shc:p:a:d:r:j:O:ib:' \
|
||||||
--longoptions git-clone-default-proto:,git-clone-site-params:,help \
|
--longoptions git-clone-default-proto:,git-clone-site-params:,help \
|
||||||
--longoptions package-manager:,sudo:,ignore-intercomponent-deps,compositor,version \
|
--longoptions package-manager:,sudo:,ignore-intercomponent-deps,compositor \
|
||||||
|
--longoptions non-interactive,version \
|
||||||
-n "$PROGNAME" -- "$@")
|
-n "$PROGNAME" -- "$@")
|
||||||
|
|
||||||
case $? in
|
case $? in
|
||||||
@@ -549,6 +673,7 @@ while true; do
|
|||||||
-i) OPENRTI="OPENRTI"; shift ;;
|
-i) OPENRTI="OPENRTI"; shift ;;
|
||||||
-b) BUILD_TYPE="$2"; shift 2 ;;
|
-b) BUILD_TYPE="$2"; shift 2 ;;
|
||||||
--compositor) COMPOSITOR="-DENABLE_COMPOSITOR=ON"; shift ;;
|
--compositor) COMPOSITOR="-DENABLE_COMPOSITOR=ON"; shift ;;
|
||||||
|
--non-interactive) INTERACTIVE_MODE=0; shift ;;
|
||||||
-h|--help) _usage; exit 0 ;;
|
-h|--help) _usage; exit 0 ;;
|
||||||
--version) _printVersion; exit 0 ;;
|
--version) _printVersion; exit 0 ;;
|
||||||
--) shift; break ;;
|
--) shift; break ;;
|
||||||
@@ -691,7 +816,7 @@ if [[ "$DOWNLOAD_PACKAGES" = "y" ]]; then
|
|||||||
# CMake
|
# CMake
|
||||||
if _elementIn "CMAKE" "${WHATTOBUILD[@]}"; then
|
if _elementIn "CMAKE" "${WHATTOBUILD[@]}"; then
|
||||||
PKG+=(libarchive-dev libbz2-dev libexpat1-dev libjsoncpp-dev liblzma-dev
|
PKG+=(libarchive-dev libbz2-dev libexpat1-dev libjsoncpp-dev liblzma-dev
|
||||||
libncurses5-dev procps zlib1g-dev)
|
libncurses5-dev libssl-dev procps zlib1g-dev)
|
||||||
else
|
else
|
||||||
PKG+=(cmake)
|
PKG+=(cmake)
|
||||||
fi
|
fi
|
||||||
@@ -1071,11 +1196,11 @@ if _elementIn "FGFS" "${WHATTOBUILD[@]}" || \
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
cd "$CBD"
|
cd "$CBD"
|
||||||
|
|
||||||
paths="../../$SIMGEAR_INSTALL_DIR/lib:../../$OSG_INSTALL_DIR/lib:../../$OPENRTI_INSTALL_DIR/lib:../../$PLIB_INSTALL_DIR/lib"
|
paths="../../$SIMGEAR_INSTALL_DIR/lib:../../$OSG_INSTALL_DIR/lib:../../$OPENRTI_INSTALL_DIR/lib:../../$PLIB_INSTALL_DIR/lib"
|
||||||
gdb="gdb"
|
gdb="gdb"
|
||||||
set_ld_library_path="export LD_LIBRARY_PATH='$paths'\"\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}\""
|
set_ld_library_path="export LD_LIBRARY_PATH='$paths'\"\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}\""
|
||||||
|
|
||||||
common=""
|
common=""
|
||||||
common="${common}#!/bin/sh\n"
|
common="${common}#!/bin/sh\n"
|
||||||
common="${common}cd \"\$(dirname \"\$0\")\"\n"
|
common="${common}cd \"\$(dirname \"\$0\")\"\n"
|
||||||
|
|||||||
+1
-1
Submodule fgdata updated: f5b4cb1d0b...7d78937a4c
+1
-1
Submodule flightgear updated: 34a29b9106...61808019a0
+1
-1
Submodule getstart updated: b7ab2fa1e9...4313401e95
@@ -22,7 +22,7 @@ echo "Build path is: $PATH"
|
|||||||
# to be necessary all the same
|
# to be necessary all the same
|
||||||
#export PKG_CONFIG_PATH=$WORKSPACE/dist/lib/pkgconfig
|
#export PKG_CONFIG_PATH=$WORKSPACE/dist/lib/pkgconfig
|
||||||
|
|
||||||
cmakeCommonArgs="-G Ninja -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DCMAKE_BUILD_TYPE=RelWithDebInfo"
|
cmakeCommonArgs="-G Ninja -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DCMAKE_BUILD_TYPE=Debug"
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
echo "Starting on SimGear"
|
echo "Starting on SimGear"
|
||||||
@@ -30,7 +30,6 @@ pushd sgBuild
|
|||||||
cmake ${cmakeCommonArgs} ../simgear
|
cmake ${cmakeCommonArgs} ../simgear
|
||||||
|
|
||||||
# compile
|
# compile
|
||||||
cmake --build . --target debug_symbols
|
|
||||||
cmake --build . --target install
|
cmake --build . --target install
|
||||||
|
|
||||||
if [ $? -ne '0' ]; then
|
if [ $? -ne '0' ]; then
|
||||||
@@ -52,7 +51,6 @@ fi
|
|||||||
|
|
||||||
cmake -DFG_BUILD_TYPE=$FGBUILDTYPE -DENABLE_SWIFT:BOOL=ON ${cmakeCommonArgs} ../flightgear
|
cmake -DFG_BUILD_TYPE=$FGBUILDTYPE -DENABLE_SWIFT:BOOL=ON ${cmakeCommonArgs} ../flightgear
|
||||||
|
|
||||||
cmake --build . --target debug_symbols
|
|
||||||
cmake --build . --target install
|
cmake --build . --target install
|
||||||
|
|
||||||
if [ $? -ne '0' ]; then
|
if [ $? -ne '0' ]; then
|
||||||
@@ -64,9 +62,6 @@ popd
|
|||||||
|
|
||||||
chmod +x $WORKSPACE/dist/bin/osgversion
|
chmod +x $WORKSPACE/dist/bin/osgversion
|
||||||
|
|
||||||
echo "Running symbol upload script"
|
|
||||||
./sentry-dSYM-upload-mac.sh
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# run the unlock script now - we need to do this right before code-signing,
|
# run the unlock script now - we need to do this right before code-signing,
|
||||||
|
|||||||
@@ -167,8 +167,9 @@ if !$isRelease
|
|||||||
--file #{dmgPath}`
|
--file #{dmgPath}`
|
||||||
|
|
||||||
|
|
||||||
else
|
end
|
||||||
puts "Creating full image with data"
|
|
||||||
|
puts "Creating full image with data"
|
||||||
|
|
||||||
`rsync -a fgdata/ #{resourcesDir}/data`
|
`rsync -a fgdata/ #{resourcesDir}/data`
|
||||||
|
|
||||||
@@ -186,8 +187,6 @@ puts "Notarizing DMG #{dmgFullPath}"
|
|||||||
--username "zakalawe@mac.com" \
|
--username "zakalawe@mac.com" \
|
||||||
--password "@keychain:FlightGearAppStoreConnectUserName" \
|
--password "@keychain:FlightGearAppStoreConnectUserName" \
|
||||||
--file #{dmgFullPath}`
|
--file #{dmgFullPath}`
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
puts "Packaging complete"
|
puts "Packaging complete"
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ localization files in $FG_ROOT/Translations/<language_code>):
|
|||||||
fg-update-translation-files --transl-dir="$FG_ROOT/Translations" \
|
fg-update-translation-files --transl-dir="$FG_ROOT/Translations" \
|
||||||
merge-new-master $languages
|
merge-new-master $languages
|
||||||
|
|
||||||
|
Note: you may omit $languages in the fg-update-translation-files command if
|
||||||
|
you want to autodetect the FlightGear-nonQt.xlf files present in
|
||||||
|
$FG_ROOT/Translations.
|
||||||
|
|
||||||
Updating XLIFF files to reflect changes in the default translation
|
Updating XLIFF files to reflect changes in the default translation
|
||||||
------------------------------------------------------------------
|
------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -45,6 +49,9 @@ modified or removed, or categories added or removed[3]):
|
|||||||
fg-update-translation-files --transl-dir="$FG_ROOT/Translations" \
|
fg-update-translation-files --transl-dir="$FG_ROOT/Translations" \
|
||||||
merge-new-master $languages
|
merge-new-master $languages
|
||||||
|
|
||||||
|
Note: you may omit $languages in this command if you want to autodetect the
|
||||||
|
FlightGear-nonQt.xlf files present in $FG_ROOT/Translations.
|
||||||
|
|
||||||
Updating XLIFF files to mark or remove obsolete translated strings
|
Updating XLIFF files to mark or remove obsolete translated strings
|
||||||
------------------------------------------------------------------
|
------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -53,9 +60,14 @@ To remove unused translated strings (not to be done too often in my opinion):
|
|||||||
fg-update-translation-files --transl-dir="$FG_ROOT/Translations" \
|
fg-update-translation-files --transl-dir="$FG_ROOT/Translations" \
|
||||||
remove-unused $languages
|
remove-unused $languages
|
||||||
|
|
||||||
(you may replace 'remove-unused' with 'mark-unused' to just mark the strings
|
Notes:
|
||||||
as not-to-be-translated, however 'merge-new-master' presented above already
|
|
||||||
does that)
|
- You may omit $languages in this command if you want to autodetect the
|
||||||
|
FlightGear-nonQt.xlf files present in $FG_ROOT/Translations.
|
||||||
|
|
||||||
|
- It is possible to replace 'remove-unused' with 'mark-unused' to just mark
|
||||||
|
the strings as not-to-be-translated; however, 'merge-new-master' presented
|
||||||
|
above already does that.
|
||||||
|
|
||||||
Merging contents from an XLIFF file into another one
|
Merging contents from an XLIFF file into another one
|
||||||
----------------------------------------------------
|
----------------------------------------------------
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import sys
|
|||||||
|
|
||||||
import flightgear.meta.logging
|
import flightgear.meta.logging
|
||||||
import flightgear.meta.i18n as fg_i18n
|
import flightgear.meta.i18n as fg_i18n
|
||||||
|
from flightgear.meta.i18n import XliffFormatHandler
|
||||||
|
|
||||||
|
|
||||||
PROGNAME = os.path.basename(sys.argv[0])
|
PROGNAME = os.path.basename(sys.argv[0])
|
||||||
@@ -45,7 +46,7 @@ def processCommandLine():
|
|||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
usage="""\
|
usage="""\
|
||||||
%(prog)s [OPTION ...] ACTION LANGUAGE_CODE...
|
%(prog)s [OPTION ...] ACTION [LANGUAGE_CODE]...
|
||||||
Update FlightGear XLIFF localization files.""",
|
Update FlightGear XLIFF localization files.""",
|
||||||
description="""\
|
description="""\
|
||||||
This program performs the following operations (actions) on FlightGear XLIFF
|
This program performs the following operations (actions) on FlightGear XLIFF
|
||||||
@@ -68,6 +69,13 @@ translation files (*.xlf):
|
|||||||
In the XLIFF localization files corresponding to the specified
|
In the XLIFF localization files corresponding to the specified
|
||||||
language(s), remove all translated strings that are marked as unused.
|
language(s), remove all translated strings that are marked as unused.
|
||||||
|
|
||||||
|
If no LANGUAGE_CODE is provided as an argument, then assuming $transl_dir
|
||||||
|
represents the value passed to --transl-dir, all directories $d such that a
|
||||||
|
file named FlightGear-nonQt.xlf is found in $transl_dir/$d will be acted on as
|
||||||
|
if they had been passed as LANGUAGE_CODE arguments (actually, the directory
|
||||||
|
$transl_dir/default is not considered as a candidate; it is simply skipped).
|
||||||
|
Typically, $transl_dir is /path/to/FGData/Translations.
|
||||||
|
|
||||||
A translated string that is marked as unused is still present in the XLIFF
|
A translated string that is marked as unused is still present in the XLIFF
|
||||||
localization file; it is just presented in a way that tells translators they
|
localization file; it is just presented in a way that tells translators they
|
||||||
don't need to worry about it. On the other hand, when a translated string is
|
don't need to worry about it. On the other hand, when a translated string is
|
||||||
@@ -105,7 +113,7 @@ general on the short or mid-term: they only take some space.
|
|||||||
remove those already marked as unused from the XLIFF
|
remove those already marked as unused from the XLIFF
|
||||||
files corresponding to each given LANGUAGE_CODE (i.e.,
|
files corresponding to each given LANGUAGE_CODE (i.e.,
|
||||||
those that are not in the default translation)""")
|
those that are not in the default translation)""")
|
||||||
parser.add_argument("lang_code", metavar="LANGUAGE_CODE", nargs="+",
|
parser.add_argument("lang_code", metavar="LANGUAGE_CODE", nargs="*",
|
||||||
help="""\
|
help="""\
|
||||||
codes of languages to operate on (e.g., fr, en_GB, it,
|
codes of languages to operate on (e.g., fr, en_GB, it,
|
||||||
es_ES...)""")
|
es_ES...)""")
|
||||||
@@ -125,11 +133,19 @@ class MarkOrRemoveUnusedAction(enum.Enum):
|
|||||||
mark, remove = range(2)
|
mark, remove = range(2)
|
||||||
|
|
||||||
|
|
||||||
|
def langCodesToActOn():
|
||||||
|
"""Return an iterable of all language codes we were told to work on."""
|
||||||
|
if params.lang_code:
|
||||||
|
return params.lang_code
|
||||||
|
else:
|
||||||
|
return XliffFormatHandler.availableTranslations(params.transl_dir)
|
||||||
|
|
||||||
|
|
||||||
def markOrRemoveUnused(l10nResPoolMgr, action):
|
def markOrRemoveUnused(l10nResPoolMgr, action):
|
||||||
formatHandler = fg_i18n.XliffFormatHandler()
|
formatHandler = fg_i18n.XliffFormatHandler()
|
||||||
masterTransl = l10nResPoolMgr.readFgMasterTranslation().transl
|
masterTransl = l10nResPoolMgr.readFgMasterTranslation().transl
|
||||||
|
|
||||||
for langCode in params.lang_code:
|
for langCode in langCodesToActOn():
|
||||||
xliffPath = formatHandler.defaultFilePath(params.transl_dir, langCode)
|
xliffPath = formatHandler.defaultFilePath(params.transl_dir, langCode)
|
||||||
transl = formatHandler.readTranslation(xliffPath)
|
transl = formatHandler.readTranslation(xliffPath)
|
||||||
|
|
||||||
@@ -148,7 +164,7 @@ def mergeNewMaster(l10nResPoolMgr):
|
|||||||
formatHandler = fg_i18n.XliffFormatHandler()
|
formatHandler = fg_i18n.XliffFormatHandler()
|
||||||
masterTransl = l10nResPoolMgr.readFgMasterTranslation().transl
|
masterTransl = l10nResPoolMgr.readFgMasterTranslation().transl
|
||||||
|
|
||||||
for langCode in params.lang_code:
|
for langCode in langCodesToActOn():
|
||||||
xliffPath = formatHandler.defaultFilePath(params.transl_dir, langCode)
|
xliffPath = formatHandler.defaultFilePath(params.transl_dir, langCode)
|
||||||
transl = formatHandler.readTranslation(xliffPath)
|
transl = formatHandler.readTranslation(xliffPath)
|
||||||
transl.mergeMasterTranslation(masterTransl, logger=logger)
|
transl.mergeMasterTranslation(masterTransl, logger=logger)
|
||||||
|
|||||||
@@ -1001,6 +1001,33 @@ class AbstractFormatHandler(metaclass=abc.ABCMeta):
|
|||||||
baseName = cls.defaultFileBaseName(targetLanguage)
|
baseName = cls.defaultFileBaseName(targetLanguage)
|
||||||
return os.path.join(translationsDir, targetLanguage, baseName)
|
return os.path.join(translationsDir, targetLanguage, baseName)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def availableTranslations(cls, translationsDir):
|
||||||
|
"""Return a list of all available translations in translationsDir.
|
||||||
|
|
||||||
|
This method expects a particular layout for translation files:
|
||||||
|
the one used in $FG_ROOT/Translations. More precisely, it looks
|
||||||
|
for all files named LANG_CODE/NAME in translationsDir, where
|
||||||
|
NAME is cls.defaultFileBaseName(LANG_CODE). The special
|
||||||
|
directory translationsDir/DEFAULT_LANG_DIR is not explored;
|
||||||
|
thus, the result cannot contain DEFAULT_LANG_DIR.
|
||||||
|
|
||||||
|
Return a list of language codes, sorted with list.sort().
|
||||||
|
|
||||||
|
"""
|
||||||
|
res = []
|
||||||
|
with os.scandir(translationsDir) as it:
|
||||||
|
for entry in it:
|
||||||
|
if (entry.name != DEFAULT_LANG_DIR and entry.is_dir() and
|
||||||
|
os.path.isfile(
|
||||||
|
os.path.join(
|
||||||
|
translationsDir, entry.name,
|
||||||
|
cls.defaultFileBaseName(entry.name)))):
|
||||||
|
res.append(entry.name)
|
||||||
|
|
||||||
|
res.sort()
|
||||||
|
return res
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def writeTranslation(self, transl, filePath):
|
def writeTranslation(self, transl, filePath):
|
||||||
"""Write a Translation instance to a file."""
|
"""Write a Translation instance to a file."""
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
THIS_RELEASE="2019.1"
|
THIS_RELEASE="2020.1"
|
||||||
NEXT_RELEASE="2019.2"
|
NEXT_RELEASE="2020.2"
|
||||||
SUBMODULES="simgear flightgear fgdata getstart"
|
SUBMODULES="simgear flightgear fgdata getstart"
|
||||||
|
|
||||||
#:<< 'COMMENT_END'
|
#:<< 'COMMENT_END'
|
||||||
@@ -39,6 +39,6 @@ done
|
|||||||
# IdentitiesOnly yes
|
# IdentitiesOnly yes
|
||||||
# User user_sf_username
|
# User user_sf_username
|
||||||
|
|
||||||
svn copy svn+ssh://svn.code.sf.net/p/flightgear/fgaddon/trunk \
|
#svn copy svn+ssh://svn.code.sf.net/p/flightgear/fgaddon/trunk \
|
||||||
svn+ssh://svn.code.sf.net/p/flightgear/fgaddon/branches/release-${THIS_RELEASE} \
|
# svn+ssh://svn.code.sf.net/p/flightgear/fgaddon/branches/release-${THIS_RELEASE} \
|
||||||
-m "branching for release ${THIS_RELEASE}"
|
# -m "branching for release ${THIS_RELEASE}"
|
||||||
|
|||||||
+1
-1
Submodule simgear updated: 17f86567f1...bd93fb279b
Reference in New Issue
Block a user