From 5b84b73820fe23c26588e209906af8505d1aef3f753411a254d36f85892f0efd Mon Sep 17 00:00:00 2001 From: Stanislav Brabec Date: Wed, 26 Aug 2015 15:19:27 +0000 Subject: [PATCH] Accepting request 325047 from home:sbrabec:branches:translation-update-upstream-bsc894913 - upstream-collect.sh supplementary script: Prevent plural form clash in case of additions only (bsc#894913). OBS-URL: https://build.opensuse.org/request/show/325047 OBS-URL: https://build.opensuse.org/package/show/Base:System/translation-update-upstream?expand=0&rev=61 --- translation-update-upstream.changes | 6 ++++++ translation-update-upstream.spec | 2 +- upstream-collect.sh | 8 +++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/translation-update-upstream.changes b/translation-update-upstream.changes index 3053838..b825450 100644 --- a/translation-update-upstream.changes +++ b/translation-update-upstream.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Aug 21 16:23:02 CEST 2015 - sbrabec@suse.com + +- upstream-collect.sh supplementary script: Prevent plural form + clash in case of additions only (bsc#894913). + ------------------------------------------------------------------- Thu Sep 4 17:32:24 CEST 2014 - sbrabec@suse.cz diff --git a/translation-update-upstream.spec b/translation-update-upstream.spec index d78f1e1..1a7a63f 100644 --- a/translation-update-upstream.spec +++ b/translation-update-upstream.spec @@ -1,7 +1,7 @@ # # spec file for package translation-update-upstream # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed diff --git a/upstream-collect.sh b/upstream-collect.sh index 305ca5a..e39f5e4 100644 --- a/upstream-collect.sh +++ b/upstream-collect.sh @@ -564,7 +564,6 @@ for TLST in *.tlst ; do echo >>$WORK_DIR/upstream-collect.log "package=$PACKAGE domain=$DOMAIN gettext-package=$REAL_DOMAIN repository=$REPO directory=$RPMPODIR branch=${BRANCH:(default)} po=$PO: old po file, skipping fixes" OLD_UPDATE=true fi - # FIXME: There could be an exotic case, where obsolete update adds new strings that contain plurals, and plural number changed. In such case, exclusion of updates may cause plural clash. In such case we have to validate additions only with the new or old plural-form header, and if both fails, skip additions as well. (bnc#894913) msgcat --force-po --use-first ${PO%.po}-uheader.po ${PO%.po}-backport.po~ $WORK_DIR/UPDATE/po/$REAL_DOMAIN/$PO -o ${PO%.po}-upstream.po if ! validate_po_with_plural_check ${PO%.po}-upstream.po ; then if $PLURAL_FAILURE ; then @@ -594,6 +593,13 @@ for TLST in *.tlst ; do if $OLD_UPDATE ; then # If the update has an old time stamp, don't include fixes. Use just additions. msgcat ${PO%.po}-additions.po~ -o $RPMPODIR/${PO%.po}-updatesraw.po + # "updatesraw" can have inconsistent plural forms even if "upstream" has them consistent (bsc#894913). + # Other failures are not possible here (superset was already validated). + if ! validate_po_with_plural_check ${PO%.po}-updatesraw.po ; then + # => There is no chance that --old-plural-forms succeeds. Don't try it and fail. + echo >>$WORK_DIR/upstream-collect.log "package=$PACKAGE domain=$DOMAIN gettext-package=$REAL_DOMAIN repository=$REPO directory=$RPMPODIR branch=${BRANCH:(default)} po=$PO: validation error (merged translation additions), possible plural forms clash" + exit + fi else msgcat ${PO%.po}-fixes.po~ ${PO%.po}-additions.po~ -o $RPMPODIR/${PO%.po}-updatesraw.po fi