release.pl: handle apostrophe in release name and keep source ts file

This commit is contained in:
Juergen E. Fischer 2023-03-03 13:33:50 +01:00
parent 08c7d66e30
commit a7133df5e1
3 changed files with 6 additions and 3 deletions

View File

@ -26,10 +26,11 @@ MACRO(CREATE_QGSVERSION)
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
ELSE(WIN32 AND NOT CMAKE_CROSS_COMPILING)
STRING(REPLACE "'" "%x27" _rn ${RELEASE_NAME})
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_BINARY_DIR}/qgsversion.h ${CMAKE_BINARY_DIR}/qgsversion.inc
COMMAND ${GITCOMMAND} log -n1 --pretty=\#define\\ QGSVERSION\\ \\"%h\\" >${CMAKE_BINARY_DIR}/qgsversion.h.temp
COMMAND ${GITCOMMAND} log -n1 --pretty='PROJECT_NUMBER = \"${COMPLETE_VERSION}-${RELEASE_NAME} \(%h\)\"' >${CMAKE_BINARY_DIR}/qgsversion.inc
COMMAND ${GITCOMMAND} log -n1 --pretty='PROJECT_NUMBER = \"${COMPLETE_VERSION}-${_rn} \(%h\)\"' >${CMAKE_BINARY_DIR}/qgsversion.inc
COMMAND ${GITCOMMAND} config remote.$$\(${GITCOMMAND} config branch.$$\(${GITCOMMAND} name-rev --name-only HEAD\).remote\).url | sed -e 's/^/\#define QGS_GIT_REMOTE_URL \"/' -e 's/$$/\"/' >>${CMAKE_BINARY_DIR}/qgsversion.h.temp
COMMAND ${CMAKE_COMMAND} -DSRC=${CMAKE_BINARY_DIR}/qgsversion.h.temp -DDST=${CMAKE_BINARY_DIR}/qgsversion.h -P ${CMAKE_SOURCE_DIR}/cmake/CopyIfChanged.cmake
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/.git/index

View File

@ -162,7 +162,7 @@ run( "scripts/create_changelog.sh", "create_changelog.sh failed" );
run( "perl -i -pe 's#<releases>#<releases>\n <release version=\"$newmajor.$newminor.$newpatch\" date=\"" . strftime("%Y-%m-%d", localtime) . "\" />#' linux/org.qgis.qgis.appdata.xml.in", "appdata update failed" );
unless( defined $dopoint ) {
run( "scripts/update_news.pl $newmajor.$newminor '$newreleasename'", "could not update news" ) if $major>2 || ($major==2 && $minor>14);
run( "scripts/update_news.pl $newmajor.$newminor \"$newreleasename\"", "could not update news" ) if $major>2 || ($major==2 && $minor>14);
run( "git commit -n -a -m \"changelog and news update for $release\"", "could not commit changelog and news update" );
@ -181,7 +181,7 @@ unless( defined $dopoint ) {
run( "perl -i -pe 's/qgis-dev-deps/qgis-ltr-deps/;' INSTALL.md", "could not update osgeo4w deps package" ) if $doltr;
run( "perl -i -pe 's/qgis-dev-deps/qgis-rel-deps/;' INSTALL.md", "could not update osgeo4w deps package" ) unless $doltr;
run( "cp -v images/splash/splash-$newmajor.$newminor.png images/splash/splash.png", "splash png switch failed" );
run( "git commit -n -a -m 'Release of $release ($newreleasename)'", "release commit failed" );
run( "git commit -n -a -m \"Release of $release ($newreleasename)\"", "release commit failed" );
run( "git tag $reltag -m 'Version $release'", "release tag failed" );
run( "for i in \$(seq 20); do tx push -s --branch $relbranch && exit 0; echo \"Retry \$i/20...\"; done; exit 1", "push translation for $relbranch branch" );
} else {

View File

@ -135,7 +135,9 @@ if [ $action = push ]; then
cp i18n/qgis_en.ts /tmp/qgis_en.ts-downloaded
perl scripts/ts_clear.pl # reset English translations
elif [ $action = pull ]; then
mv i18n/qgis_en.ts i18n/qgis_en.ts.source
rm -f i18n/qgis_*.ts
mv i18n/qgis_en.ts.source i18n/qgis_en.ts
echo Pulling new translations...
if [ "$#" -gt 0 ]; then