Prevent mingw-find-lang.sh from clobbering previous find-lang results

This commit is contained in:
Sandro Mani 2022-12-09 12:28:47 +01:00
parent 404594a9fc
commit 846156c1bd
2 changed files with 13 additions and 4 deletions

View File

@ -9,7 +9,7 @@
%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
Name: mingw-filesystem
Version: 142
Version: 143
Release: 1%{?dist}
Summary: MinGW cross compiler base filesystem and environment
@ -376,6 +376,9 @@ echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/x86_64-w64-mingw32ucrt-p
%dir %{_prefix}/lib/debug/%{_prefix}/x86_64-w64-mingw32ucrt
%changelog
* Fri Dec 09 2022 Sandro Mani <manisandro@gmail.com> - 143-1
- Prevent mingw-find-lang.sh from clobbering previous find-lang results
* Tue Oct 18 2022 Sandro Mani <manisandro@gmail.com> - 142-1
- Require mingw-binutils-generic

View File

@ -2,16 +2,22 @@
# Wrapper for the %find_lang macro which splits out the various translations in per-target lists
PACKAGE_NAME=$2
# If previous result from native find-lang exists, filter mingw entries and move it out of the way
test -f ${PACKAGE_NAME}.lang && grep -v mingw32 ${PACKAGE_NAME}.lang > ${PACKAGE_NAME}-native.lang
/usr/lib/rpm/find-lang.sh $*
if test $? != 0 ; then
test -f ${PACKAGE_NAME}-native.lang && mv ${PACKAGE_NAME}-native.lang ${PACKAGE_NAME}.lang
exit 1
fi
PACKAGE_NAME=$2
targets=`rpm --eval '%{mingw_build_targets}'`
for target in $targets; do
prefix=`rpm --eval "%{${target}_prefix}"`
cat $2.lang | grep "$prefix" > ${target}-$PACKAGE_NAME.lang
cat ${PACKAGE_NAME}.lang | grep "$prefix" > ${target}-$PACKAGE_NAME.lang
done
exit 0
test -f ${PACKAGE_NAME}-native.lang && mv ${PACKAGE_NAME}-native.lang ${PACKAGE_NAME}.lang