Changeset 2428

Show
Ignore:
Timestamp:
12/31/07 16:28:52 (1 year ago)
Author:
taj
Message:

* makepackage: Fix translations with @ (encoding) marking in metadata. If the translation with the @ is the only translation for that language, the @ and encoding are stripped
(sr@Latn -> sr). If there is already a translation with no encoding marking, the one with the mark is dropped. Fixes #55.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • main/trunk/ChangeLog

    r2426 r2428  
     1Mon Dec 31 21:24:12 UTC 2007  Taj Morton  <tajmorton@gmail.com> 
     2        * makepackage: Fix translations with @ (encoding) marking in metadata. If 
     3          the translation with the @ is the only translation for that language, the 
     4          @ and encoding are stripped (sr@Latn -> sr). If there is already a 
     5          translation with no encoding marking, the one with the mark is dropped. 
     6          Fixes #55. 
     7 
    18Sat Dec 29 21:33:12 UTC 2007  Taj Morton  <tajmorton@gmail.com> 
    2         * share/apkg-bashlib: Add errorMessage() function for displaying warnings in a GUI dialog or the 
    3           shell. This function is private until 1.3. 
    4         * share/installer.[2].template: Tell users they have to install the 32-bit compat libs when attempting to 
    5           install Autopackage on a 64-bit system. Fixes #45. 
     9        * share/apkg-bashlib: Add errorMessage() function for displaying warnings 
     10          in a GUI dialog or the shell. This function is private until 1.3. 
     11        * share/installer.[2].template: Tell users they have to install the 32-bit 
     12          compat libs when attempting to install Autopackage on a 64-bit system. 
     13          Fixes #45. 
    614        * makepackage: Substitute %ErrorMessage% in installer.[?].template. 
    715 
     
    2028 
    21292007-09-04  Isak Savo  <isak.savo@gmail.com> 
    22         * share/apkg-dep: Make sure dependency information aren't lost when package are automatically installed as a result of require/recommend failure. Fixes #44. Patch from Unfleshed One. 
    23         * share/apkg-funclib: Erase dep info before calling [Uninstall]-script to make it possible for meta packages to remove their dependencies with them. Fixes #46. Patch from Unfleshed One. 
     30        * share/apkg-dep: Make sure dependency information aren't lost when package are 
     31          automatically installed as a result of require/recommend failure. Fixes #44. 
     32          Patch from Unfleshed One. 
     33        * share/apkg-funclib: Erase dep info before calling [Uninstall]-script to make 
     34          it possible for meta packages to remove their dependencies with them. Fixes #46. 
     35          Patch from Unfleshed One. 
    2436 
    25372007-09-04  Isak Savo  <isak.savo@gmail.com> 
  • main/trunk/makepackage

    r2425 r2428  
    555555                # Summary: <data>               --->    SUMMARY="<data>" 
    556556                # Summary[fr]: <data>           --->    SUMMARY_fr="<data>" 
     557                # Summary[fr@Latn]: <data>      ---->   SUMMARY_fr="<data>" 
    557558                # 
    558559                # allow ':' to be used in Meta data, need to focus on the first instance of ':' 
    559560                # first instance can be determined on localized keys because of the ']: ' so substitute in '=' 
    560561                # and non-localized keys are converted to variables in subup function 
     562                meta_localized=`echo "$meta_localized" | sed 's/@.*\]/\]/g'` 
    561563                meta_localized=`echo "$meta_localized" | sed 's/\]: /\=\"/g'` 
    562564                meta_localized=`echo "$meta_localized" | sed 's/\(.\)$/\1"/g'` 
     
    16621664                meta_desktop_languages="en" 
    16631665                for line in $meta_names $meta_comments; do 
    1664                         meta_desktop_language_add=`echo "$line" | awk 'BEGIN { FS="]=" } { print $1 }'
     1666                        meta_desktop_language_add=`echo "$line" | awk 'BEGIN { FS="]=" } { print $1 }' | sed 's/@.*//g'
    16651667                        meta_desktop_languages=`echo "$meta_desktop_languages"; echo "$meta_desktop_language_add"` 
    16661668                done 
     
    16711673                # check to see if DISPLAYNAME_en is available and if not use DISPLAYNAME instead and write DISPLAYNAME_en to $meta_names 
    16721674                meta_name_en=`echo "$meta_names" | grep '^DISPLAYNAME_en=' | awk 'BEGIN { FS="=" } { print $2 }'` 
     1675                 
     1676                encoding_lines=`echo "$meta_names" | grep '@.*='` 
     1677                for line in $encoding_lines; do 
     1678                        # find any translations that have @ (encoding) markings 
     1679                        if echo "$meta_names" | grep -q `echo "$line" | sed 's/@.*=.*/=/g'`; then 
     1680                                # drop if there's already a translation w/o encoding marking 
     1681                                meta_names=`echo "$meta_names" | sed "s/$line//g"` 
     1682                        else 
     1683                                # there's no translation for this language, so use it 
     1684                                # (we can't handle @s) 
     1685                                old_encoding=`echo "$line" | sed 's/.*\(_.*@.*\)=.*/\1/g'` 
     1686                                new_encoding=`echo "$old_encoding" | sed 's/@.*//g'` 
     1687                                meta_names=`echo "$meta_names" | sed "s/$old_encoding/$new_encoding/g"` 
     1688                                 
     1689                        fi 
     1690                done 
     1691                 
    16731692                if [ "$meta_name_en" == "" ]; then 
    16741693                        meta_name_en=`echo "$meta_names" | grep '^DISPLAYNAME=' | awk 'BEGIN { FS="=" } { print $2 }'` 
     
    16821701                # check to see if SUMMARY_en is available and if not use SUMMARY instead and write SUMMARY_en to $meta_comments 
    16831702                meta_comment_en=`echo "$meta_comments" | grep '^SUMMARY_en=' | awk 'BEGIN { FS="=" } { print $2 }'` 
     1703                 
     1704                encoding_lines=`echo "$meta_comments" | grep '@.*='` 
     1705                for line in $encoding_lines; do 
     1706                        # find any translations that have @ (encoding) markings 
     1707                        if echo "$meta_comments" | grep -q `echo "$line" | sed 's/@.*=.*/=/g'`; then 
     1708                                # drop if there's already a translation w/o encoding marking 
     1709                                meta_comments=`echo "$meta_comments" | sed "s/$line//g"` 
     1710                        else 
     1711                                # there's no translation for this language, so use it 
     1712                                # (we can't handle @s) 
     1713                                old_encoding=`echo "$line" | sed 's/.*\(_.*@.*\)=.*/\1/g'` 
     1714                                new_encoding=`echo "$old_encoding" | sed 's/@.*//g'` 
     1715                                meta_comments=`echo "$meta_comments" | sed "s/$old_encoding/$new_encoding/g"` 
     1716                        fi 
     1717                done 
     1718                 
    16841719                if [ "$meta_comment_en" == "" ]; then 
    16851720                        meta_comment_en=`echo "$meta_comments" | grep '^SUMMARY=' | awk 'BEGIN { FS="=" } { print $2 }'`