Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package yast2-devtools for openSUSE:Factory checked in at 2022-04-28 23:07:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-devtools (Old) and /work/SRC/openSUSE:Factory/.yast2-devtools.new.1538 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-devtools" Thu Apr 28 23:07:13 2022 rev:105 rq:972945 version:4.5.3 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-devtools/yast2-devtools.changes 2022-04-14 17:25:34.439271000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-devtools.new.1538/yast2-devtools.changes 2022-04-28 23:07:16.124641765 +0200 @@ -1,0 +2,9 @@ +Thu Apr 21 12:32:14 UTC 2022 - Ladislav Slez??k <lsle...@suse.cz> + +- Generate correct source location for POT messages extracted + from XML files (bsc#1198261) +- Allow extracting only the comments for translators, ignore e.g. + the license headers (bsc#1198220) +- 4.5.3 + +------------------------------------------------------------------- Old: ---- yast2-devtools-4.5.2.tar.bz2 New: ---- yast2-devtools-4.5.3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-devtools.spec ++++++ --- /var/tmp/diff_new_pack.V64rjv/_old 2022-04-28 23:07:16.704642397 +0200 +++ /var/tmp/diff_new_pack.V64rjv/_new 2022-04-28 23:07:16.708642401 +0200 @@ -17,7 +17,7 @@ Name: yast2-devtools -Version: 4.5.2 +Version: 4.5.3 Release: 0 Summary: YaST2 - Development Tools License: GPL-2.0-or-later @@ -131,7 +131,7 @@ %{_datadir}/YaST2/data/devtools/bin/ycp_puttext %{_datadir}/YaST2/data/devtools/data/rubocop*_yast_style.yml %dir %{_datadir}/YaST2/control/ -%{_datadir}/YaST2/control/control_to_glade.xsl +%{_datadir}/YaST2/control/yast_control.its %files -n yast2-buildtools %{_rpmmacrodir}/macros.yast ++++++ yast2-devtools-4.5.2.tar.bz2 -> yast2-devtools-4.5.3.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-devtools-4.5.2/build-tools/scripts/Makefile.am new/yast2-devtools-4.5.3/build-tools/scripts/Makefile.am --- old/yast2-devtools-4.5.2/build-tools/scripts/Makefile.am 2022-04-13 11:10:57.000000000 +0200 +++ new/yast2-devtools-4.5.3/build-tools/scripts/Makefile.am 2022-04-26 17:57:25.000000000 +0200 @@ -16,4 +16,4 @@ # sourced by 'check-textdomain' and 'y2makepot'. dist_pkgdata_DATA = gettextdomains -dist_control_DATA = control_to_glade.xsl +dist_control_DATA = yast_control.its diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-devtools-4.5.2/build-tools/scripts/control_to_glade.xsl new/yast2-devtools-4.5.3/build-tools/scripts/control_to_glade.xsl --- old/yast2-devtools-4.5.2/build-tools/scripts/control_to_glade.xsl 2022-04-13 11:10:57.000000000 +0200 +++ new/yast2-devtools-4.5.3/build-tools/scripts/control_to_glade.xsl 1970-01-01 01:00:00.000000000 +0100 @@ -1,103 +0,0 @@ -<!-- - Extract translatable strings from a Yast XML control file, output them in the - format accepted by xgettext (Glade compatible XML) ---> - -<xsl:stylesheet version="1.0" - xmlns:n="http://www.suse.com/1.0/yast2ns" - xmlns:config="http://www.suse.com/1.0/configns" - xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - -<xsl:output method="xml" indent="yes"/> - -<!-- attribute definition for <interface> element --> -<xsl:attribute-set name="translatable_label"> - <xsl:attribute name="name">label</xsl:attribute> - <xsl:attribute name="translatable">yes</xsl:attribute> -</xsl:attribute-set> - -<!-- - Template for trimming leading and trailing white space (spaces and new lines) - from a string. - - Notes: - - The XSL already contains built-in function "normalize-space()", unfortunately - this also trims extra white space *inside* the string which we do not want - in this case. :-( - - Inspired by https://stackoverflow.com/a/30463195 - - In XSL "substring()" function the index starts from 1!! ---> -<xsl:template name="trim"> - <xsl:param name="str"/> - - <xsl:choose> - <!-- starts with a new line, tab or space? --> - <xsl:when test="string-length($str) > 0 and (substring($str, 1, 1) = '
' or substring($str, 1, 1) = '	' or substring($str, 1, 1) = ' ')"> - <!-- recursively call self with the string without the first character --> - <xsl:call-template name="trim"> - <xsl:with-param name="str"> - <xsl:value-of select="substring($str, 2)"/> - </xsl:with-param> - </xsl:call-template> - </xsl:when> - <!-- ends with a new line, tab or space? --> - <xsl:when test="string-length($str) > 0 and (substring($str, string-length($str)) = '
' or substring($str, string-length($str)) = '	' or substring($str, string-length($str)) = ' ')"> - <!-- recursively call self with the string without the last character --> - <xsl:call-template name="trim"> - <xsl:with-param name="str"> - <xsl:value-of select="substring($str, 1, string-length($str) - 1)"/> - </xsl:with-param> - </xsl:call-template> - </xsl:when> - <!-- otherwise just return the original string --> - <xsl:otherwise> - <xsl:value-of select="$str"/> - </xsl:otherwise> - </xsl:choose> -</xsl:template> - -<!-- replace <label> by <property>, trim the leading and trailing white space from the value --> -<xsl:template match="n:label"> - <xsl:element name="property" use-attribute-sets="translatable_label"> - <xsl:call-template name="trim"> - <xsl:with-param name="str" select="text()"/> - </xsl:call-template> - </xsl:element> -</xsl:template> - -<!-- comments for translators --> -<!-- match a comment immediately preceding a <label>, - see http://stackoverflow.com/questions/2613159/xslt-and-xpath-match-preceding-comments --> -<xsl:template match="comment()[following-sibling::*[1]/self::n:label]"> - <xsl:copy> - <xsl:apply-templates/> - </xsl:copy> -</xsl:template> - -<!-- - replace the root <productDefines> element by <interface> - due to namespace it cannot be used literally ---> -<xsl:template match="/n:productDefines"> - <xsl:element name="interface"> - <xsl:apply-templates select="node()|@*"/> - </xsl:element> -</xsl:template> - -<!-- - Allow processing also the XSL files which contain translations. - Handle it like an XML file, just replace the root <xsl:stylesheet> tag - by <interface> as expected by xgettext in *.glade files. ---> -<xsl:template match="/xsl:stylesheet"> - <interface> - <xsl:apply-templates select="node()|@*"/> - </interface> -</xsl:template> - -<!-- remove the remaining non-matched text --> -<xsl:template match="text()"> -</xsl:template> - -</xsl:stylesheet> - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-devtools-4.5.2/build-tools/scripts/gettextdomains new/yast2-devtools-4.5.3/build-tools/scripts/gettextdomains --- old/yast2-devtools-4.5.2/build-tools/scripts/gettextdomains 2022-04-13 11:10:57.000000000 +0200 +++ new/yast2-devtools-4.5.3/build-tools/scripts/gettextdomains 2022-04-26 17:57:25.000000000 +0200 @@ -26,6 +26,8 @@ -o -name "*.cpp" \ -o -name "*.erb" \ -o -name "*.glade" \ + -o -name "*.ycontrol.xml" \ + -o -name "*.ycontrol.xsl" \ -o -name "*.rb" ` if test "$?" != "0"; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-devtools-4.5.2/build-tools/scripts/y2makepot new/yast2-devtools-4.5.3/build-tools/scripts/y2makepot --- old/yast2-devtools-4.5.2/build-tools/scripts/y2makepot 2022-04-13 11:10:57.000000000 +0200 +++ new/yast2-devtools-4.5.3/build-tools/scripts/y2makepot 2022-04-26 17:57:25.000000000 +0200 @@ -20,15 +20,22 @@ # this is assumed to be in the same directory as this script. PO_ADD_FORMAT_HINTS=$CWD/po_add_format_hints - -# list of generated files which should be removed at the end -CLEAN_FILES="" +# use the local file when running from a Git checkout +if [ -f "$CWD/yast_control.its" ]; then + CONTROL_ITS="$CWD/yast_control.its" +else + CONTROL_ITS="/usr/share/YaST2/control/yast_control.its" +fi function gettext_call() { MODULE=$1 SOURCE_FILES=$2 SOURCE_RUBY_FILES=$3 + SOURCE_CONTROL_FILES=$4 + + # remove the old file + rm -f "$MODULE.pot" # Is POT file merge needed? (both Ruby and non-Ruby files found) if [ -n "$SOURCE_FILES" -a -n "$SOURCE_RUBY_FILES" ]; then @@ -50,10 +57,25 @@ rxgettext_call "$MODULE" "$SOURCE_RUBY_FILES" fi - if [ -n "$CLEAN_FILES" ]; then - echo "Removing generated files: $CLEAN_FILES" - rm -f $CLEAN_FILES - CLEAN_FILES="" + if [ -n "$SOURCE_CONTROL_FILES" ]; then + # a POT file was created from other files, we need to do the merge + if [ -f "$MODULE.pot" ]; then + mv "$MODULE.pot" "$MODULE.other.pot" + xgettext_call "$MODULE" "$SOURCE_CONTROL_FILES" "--omit-header --its=$CONTROL_ITS" + if [ -f "$MODULE.pot" ]; then + # new file was created, merge the files + mv "$MODULE.pot" "$MODULE.control.pot" + echo "Merging the .pot files..." + msgcat -o "$MODULE.pot" "$MODULE.other.pot" "$MODULE.control.pot" + rm "$MODULE.control.pot" "$MODULE.other.pot" + else + # no new file created, just rename it back + mv "$MODULE.other.pot" "$MODULE.pot" + fi + else + # no merge needed, just run gettext and that's it + xgettext_call "$MODULE" "$SOURCE_CONTROL_FILES" "--its=$CONTROL_ITS" + fi fi } @@ -65,7 +87,7 @@ if [ -n "$FILES" ]; then echo "Creating ./$MODULE.pot from $FILES ..."; - $XGETTEXT --no-wrap --add-comments --add-location \ + $XGETTEXT --no-wrap --add-comments="$POTCOMMENTS" --add-location \ --keyword=_ --keyword=_:1,2 --keyword=__ \ --foreign-user $OPTIONS \ --copyright-holder="SuSE Linux Products GmbH, Nuernberg" \ @@ -86,7 +108,7 @@ # rubygem-gettext is a weak dependency, check if it is present if [ -x "$RXGETTEXT_PATH" ]; then $RXGETTEXT --copyright-holder="SuSE Linux Products GmbH, Nuernberg" \ - --add-comments --output=$MODULE.pot $FILES; + --add-comments="$POTCOMMENTS" --output=$MODULE.pot $FILES; # remove plural forms template, the dummy values are invalid # and do not pass the following check @@ -155,6 +177,7 @@ # gather files that share a domain to FILES and call xgettext FILES=""; RUBY_FILES="" + CONTROL_FILES="" for I in $DOMAINS; do D=${I%%:*} ; @@ -174,12 +197,15 @@ if [[ "$F" =~ \.(erb|rb)$ ]]; then RUBY_FILES="$RUBY_FILES $F"; else - if [[ "$F" =~ \.glade$ ]]; then - echo "Processing $F file..." - GLADE_FILE="$F.translations.glade" - xsltproc /usr/share/YaST2/control/control_to_glade.xsl "$F" > "$GLADE_FILE" - FILES="$FILES $GLADE_FILE" ; - CLEAN_FILES="$CLEAN_FILES $GLADE_FILE" ; + # TODO: later remove support for the .glade workaround, + # it is kept just for the backward compatibility + if [[ "$F" =~ \.glade$ || "$F" =~ \.ycontrol.x[ms]l$ ]]; then + # follow symlinks to have correct file locations + if [ -L "$F" ]; then + CONTROL_FILES="$CONTROL_FILES `realpath --relative-to=. \"$F\"`"; + else + CONTROL_FILES="$CONTROL_FILES $F"; + fi else FILES="$FILES $F" ; fi @@ -187,47 +213,7 @@ done POT_DST="$POT_DST $MODULE.pot" - gettext_call "$MODULE" "$FILES" "$RUBY_FILES" -} - - -function checkin_potfiles() -{ - ADDED="" - CHANGED="" - - for f in $POT_DST; do - MODIFIER="`svn status $f | cut -d' ' -f1`" - - # file has changed in repository - if test "$MODIFIER" == "M"; then - echo "$f is already under version control and has changed." - CHANGED="$CHANGED $f" - # file has been added already - elif test "$MODIFIER" == "A"; then - echo "$f has already been added." - ADDED="$ADDED $f" - # file is not under version control - else - if test "`svn add $f | cut -d' ' -f1`" == "A"; then - echo "Added $f to svn repository." - ADDED="$ADDED $f" - else - echo "warning: Could not add $f to svn repository" - fi - fi - done - - if test -n "$ADDED" -o -n "$CHANGED"; then - # commit the added or changed files now - svn commit --message "Committed potfile(s) $f to repository" $ADDED $CHANGED - - if test "$?" == "0"; then - echo "Committed files $ADDED $CHANGED to repository" - else - echo "Error while committing files to repository"; - fi - fi + gettext_call "$MODULE" "$FILES" "$RUBY_FILES" "$CONTROL_FILES" } # -- function defininitions -- end --------------------------------------------- @@ -244,12 +230,14 @@ SRCDIR="." POT_DST="" +# read the POTCOMMENTS file if it is present +POTCOMMENTS=`test -e "$SRCDIR/POTCOMMENTS" && cat "$SRCDIR/POTCOMMENTS"` # parse command line options while getopts "chfs::" opt; do case $opt in c) - CHECKIN=0 + echo "y2makepot: ignoring obsolete option -c" ;; f) echo "y2makepot: ignoring obsolete option -f" @@ -265,10 +253,6 @@ generate_potfiles -if test $CHECKIN = 0; then - checkin_potfiles -fi - exit 0 # -- main -- end --------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-devtools-4.5.2/build-tools/scripts/yast_control.its new/yast2-devtools-4.5.3/build-tools/scripts/yast_control.its --- old/yast2-devtools-4.5.2/build-tools/scripts/yast_control.its 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-devtools-4.5.3/build-tools/scripts/yast_control.its 2022-04-26 17:57:25.000000000 +0200 @@ -0,0 +1,27 @@ +<?xml version="1.0"?> +<!-- Rules for extracting the translatable strings from YaST control files --> +<!-- see https://www.gnu.org/software/gettext/manual/html_node/Preparing-ITS-Rules.html --> +<!-- see https://www.w3.org/TR/its20/ --> +<its:rules xmlns:its="http://www.w3.org/2005/11/its" + xmlns:gt="https://www.gnu.org/s/gettext/ns/its/extensions/1.0" + version="2.0"> + + <!-- by default all texts in file are translated, disable translations for all nodes below the root <productDefines> --> + <its:translateRule selector="/n:productDefines" + translate="no" + xmlns:n="http://www.suse.com/1.0/yast2ns"/> + <!-- or for all nodes in XSL definitions --> + <its:translateRule selector="/xsl:stylesheet" + translate="no" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"/> + <!-- translate only the texts in the <label> nodes anywhere --> + <its:translateRule selector="//n:label" + translate="yes" + xmlns:n="http://www.suse.com/1.0/yast2ns"/> + <!-- gettext extension: disable escaping of special XML characters like "<", ">" in the texts --> + <gt:escapeRule selector="//n:label" escape="no" xmlns:n="http://www.suse.com/1.0/yast2ns"/> + <!-- gettext extension: trim the leading and trailing whitespace but keep it in the middle, --> + <!-- to be compatible with the YaST XML parser --> + <gt:preserveSpaceRule selector="//n:label" space="trim" xmlns:n="http://www.suse.com/1.0/yast2ns"/> + +</its:rules> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-devtools-4.5.2/package/yast2-devtools.changes new/yast2-devtools-4.5.3/package/yast2-devtools.changes --- old/yast2-devtools-4.5.2/package/yast2-devtools.changes 2022-04-13 11:10:57.000000000 +0200 +++ new/yast2-devtools-4.5.3/package/yast2-devtools.changes 2022-04-26 17:57:25.000000000 +0200 @@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Thu Apr 21 12:32:14 UTC 2022 - Ladislav Slez??k <lsle...@suse.cz> + +- Generate correct source location for POT messages extracted + from XML files (bsc#1198261) +- Allow extracting only the comments for translators, ignore e.g. + the license headers (bsc#1198220) +- 4.5.3 + +------------------------------------------------------------------- Wed Apr 13 08:45:45 UTC 2022 - Ladislav Slez??k <lsle...@suse.cz> - Fix for previous change, trim also the tabs (bsc#1197965) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-devtools-4.5.2/package/yast2-devtools.spec new/yast2-devtools-4.5.3/package/yast2-devtools.spec --- old/yast2-devtools-4.5.2/package/yast2-devtools.spec 2022-04-13 11:10:57.000000000 +0200 +++ new/yast2-devtools-4.5.3/package/yast2-devtools.spec 2022-04-26 17:57:25.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-devtools -Version: 4.5.2 +Version: 4.5.3 Release: 0 Summary: YaST2 - Development Tools License: GPL-2.0-or-later @@ -130,7 +130,7 @@ %{_datadir}/YaST2/data/devtools/bin/ycp_puttext %{_datadir}/YaST2/data/devtools/data/rubocop*_yast_style.yml %dir %{_datadir}/YaST2/control/ -%{_datadir}/YaST2/control/control_to_glade.xsl +%{_datadir}/YaST2/control/yast_control.its %files -n yast2-buildtools %{_rpmmacrodir}/macros.yast