Mailinglist Archive: opensuse-commit (1945 mails)

< Previous Next >
commit update-desktop-files
  • From: root@xxxxxxxxxxxxxxx (h_root)
  • Date: Sat, 01 Nov 2008 23:19:22 +0100
  • Message-id: <20081101221923.38005678161@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package update-desktop-files
checked in at Sat Nov 1 23:19:22 CET 2008.


--------
--- update-desktop-files/update-desktop-files.changes 2008-10-24
14:04:33.000000000 +0200
+++
/mounts/work_src_done/STABLE/update-desktop-files/update-desktop-files.changes
2008-10-24 15:34:09.000000000 +0200
@@ -6,0 +7,5 @@
+Fri Oct 24 09:41:58 CEST 2008 - coolo@xxxxxxx
+
+- make trim more complex and leave out the old way
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


Old:
----
desktop-translations.tar.bz2
PREPARE_PACKAGE
untranslate.pl

New:
----
macro

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ update-desktop-files.spec ++++++
--- /var/tmp/diff_new_pack.DL3159/_old 2008-11-01 23:19:06.000000000 +0100
+++ /var/tmp/diff_new_pack.DL3159/_new 2008-11-01 23:19:06.000000000 +0100
@@ -20,19 +20,15 @@

Name: update-desktop-files
Version: 11.0
-Release: 57
+Release: 58
Summary: A Build Tool to Update Desktop Files
License: GPL v2 or later
Group: Development/Tools/Building
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Requires: desktop-translations = %{version}
-Requires: suse-desktop-utils
AutoReqProv: on
Source: suse_update_desktop_file.sh
Source1: map-desktop-category.sh
-Source4: untranslate.pl
-Source10: desktop-translations.tar.bz2
-Source99: PREPARE_PACKAGE
+Source2: macro
Source100: mimetypes.prov
BuildArch: noarch

@@ -46,22 +42,6 @@
--------
Stephan Kulow <coolo@xxxxxxx>

-%package -n desktop-translations
-License: GPL v2 or later
-Summary: Desktop Files Translation updates
-Group: System/GUI/Other
-# we do not need them in all systems, if there is an update, we put it in
translate-update-*
-# Provides:
locale(af;ar;bg;bn;bs;ca;cs;cy;da;de;el;en_GB;en_US;es;et;fi;fr;gl;gu;he;hi;hr;hu;id;it;ja;ka;km;ko;lo;lt;mk;mr;nb;nl;pa;pl;pt;ro;ru;si;sk;sl;sr;sr@Latn;sv;ta;tr;uk;vi;wa;xh;zh_CN;zh_TW;zu)
-
-%description -n desktop-translations
-This package provides further translations for installed desktop files.
-
-
-
-Authors:
---------
- Adrian Schroeter <adrian@xxxxxxx>
-
%prep
%setup -q -n . -D -T 0
mkdir %name
@@ -70,48 +50,24 @@
%build

%install
-pushd %name
-tar xfj %SOURCE10
-cd po
-for lang in *; do
- if test "$lang" = "nb_no"; then
- continue
- fi
- if test -f $lang; then
- rm $lang
- else
- mkdir -p
$RPM_BUILD_ROOT/usr/share/%name/locale/translations/en_US/LC_MESSAGES
- mkdir -p $RPM_BUILD_ROOT/usr/share/locale/$lang/LC_MESSAGES
- for f in $lang/*.po; do
- msgfmt -o
$RPM_BUILD_ROOT/usr/share/locale/$lang/LC_MESSAGES/desktop_translations.mo $f
- msgunfmt --no-wrap
$RPM_BUILD_ROOT/usr/share/locale/$lang/LC_MESSAGES/desktop_translations.mo | \
- grep -v '^"[A-Z][^ ]*: ' | grep '[^\][\]n"' && exit 1
- ln -s /usr/share/locale/$lang/LC_MESSAGES/desktop_translations.mo \
-
$RPM_BUILD_ROOT/usr/share/%name/locale/translations/en_US/LC_MESSAGES/$lang\_`echo
$f | sed -e 's#.*/##; s#\.po#.mo#'`
- done
- fi
-done
-install -m 755 %SOURCE4 $RPM_BUILD_ROOT/usr/share/%name/
mkdir -p $RPM_BUILD_ROOT/usr/lib/rpm
install -m 0755 %SOURCE0 %SOURCE1 $RPM_BUILD_ROOT/usr/lib/rpm
-popd
-%find_lang desktop_translations
install -m0755 %SOURCE100 $RPM_BUILD_ROOT/usr/lib/rpm
+install -m0644 -D %SOURCE2 $RPM_BUILD_ROOT/etc/rpm/macros.%name

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
-%lang(en) /usr/share/%name
/usr/lib/rpm/*
-
-%files -f desktop_translations.lang -n desktop-translations
-%defattr(-,root,root)
+/etc/rpm/*

%changelog
* Fri Oct 24 2008 ke@xxxxxxx
- Update translations.
+* Fri Oct 24 2008 coolo@xxxxxxx
+- make trim more complex and leave out the old way
* Sun Oct 12 2008 ke@xxxxxxx
- Update translations.
* Thu Oct 02 2008 vuntz@xxxxxxx

++++++ macro ++++++
# macro: %suse_update_desktop_file
# Used to add easily a category to .desktop files according to XDG
# standard.
%suse_update_desktop_file(cinrud:D:N:C:G:) \
/usr/lib/rpm/suse_update_desktop_file.sh %{?distribution:--project
"%distribution"} %{?_project:--project "%_project"} --basedir %_srcrpmdir %{**}
|| exit 1 \
%nil
++++++ suse_update_desktop_file.sh ++++++
--- /var/tmp/diff_new_pack.DL3159/_old 2008-11-01 23:19:06.000000000 +0100
+++ /var/tmp/diff_new_pack.DL3159/_new 2008-11-01 23:19:06.000000000 +0100
@@ -20,6 +20,8 @@
NAME=no
COMMENT=no
GNAME=no
+BASEDIR=/no
+PROJECT=
while [ "${1:0:1}" = "-" ]; do
case ${1} in
-u|--unimportant)
@@ -75,12 +77,31 @@
GNAME="${1}"
shift
continue;;
+ --basedir)
+ shift
+ BASEDIR="${1}"
+ shift
+ continue;;
+ --project)
+ shift
+ PROJECT="${1}"
+ shift
+ continue;;
*)
echo "UNKNOWN OPTION: $1"
exit 1 ;;
esac
done

+case "$PROJECT" in
+ SUSE:*|SuSE:*|openSUSE:*)
+ TRIM=yes
+ ;;
+ home:coolo:test-desktop-files*)
+ TRIM=yes
+ ;;
+esac
+
APPLICATION="$1"
shift
if [ "$CREATE" = "yes" ]; then
@@ -220,7 +241,7 @@
ret=""
mapCategory $i
if [ -z "$ret" ]; then
- echo WARNING: Category \"$i\" is unknown \!
+ echo 'WARNING: Category \"$i\" is unknown \!'
echo WARNING: it is ignored, until you registered a Category at
adrian@xxxxxxx .
else
echo "$CAT" | grep -q "[=;]$i;" || CAT="$CAT$ret;"
@@ -286,9 +307,7 @@
exit 1
fi

-if [ "$I18N" = "yes" ]; then
-
- if [ "$NAME" != "no" ]; then
+if [ "$NAME" != "no" ]; then
grep -v '^Name\[' $FILE > ${FILE}_
if [ -n "$NAME" ]; then
if ! grep -q ^Name= ${FILE}_; then
@@ -299,9 +318,9 @@
else
grep -v "^Name=" ${FILE}_ > $FILE
fi
- fi
+fi

- if [ "$GNAME" != "no" ]; then
+if [ "$GNAME" != "no" ]; then
grep -v '^GenericName\[' $FILE > ${FILE}_
if [ -n "$GNAME" ]; then
if ! grep -q ^GenericName= ${FILE}_; then
@@ -312,9 +331,9 @@
else
grep -v "^GenericName=" ${FILE}_ > $FILE
fi
- fi
+fi

- if [ "$COMMENT" != "no" ]; then
+if [ "$COMMENT" != "no" ]; then
grep -v '^Comment\[' $FILE > ${FILE}_
if [ -n "$COMMENT" ]; then
if ! grep -q ^Comment= ${FILE}_; then
@@ -325,33 +344,29 @@
else
grep -v "^Comment=" ${FILE}_ > $FILE
fi
- fi
+fi
+
+if [ "$I18N" = "yes" ]; then

if ! iconv -f utf-8 -t utf-8 $FILE &> /dev/null ; then
echo "ERROR: $FILE is not an UTF-8 file"
exit 1
fi

- if [ "$TRIM" = "no" ]; then
- #
- # Merge translations
- #
- cp $FILE ${FILE}.old
- /usr/bin/suse-desktop-merge $FILE > ${FILE}_ || exit 1
- perl /usr/share/update-desktop-files/untranslate.pl ${FILE}_ > ${FILE}.new
- if ! cmp -s ${FILE}.old ${FILE}.new; then
- echo "UNTRANSLATE DOES NOT WORK"
- diff -u ${FILE}.old ${FILE}.new
- exit 1
+ if [ "$TRIM" = "yes" ]; then
+ # save for backup
+ if test -w $BASEDIR && test -f /.buildenv; then
+ echo "<<$FILE>>" >> $BASEDIR/$RPM_PACKAGE_NAME.desktopfiles
+ cat $FILE >> $BASEDIR/$RPM_PACKAGE_NAME.desktopfiles
+ echo "created $BASEDIR/$RPM_PACKAGE_NAME.desktopfiles"
fi
- mv ${FILE}_ $FILE
- rm -f ${FILE}.old ${FILE}.new
- else
#
# Trim translations (desktops will use gettext to find them)
#
grep -v -E '^Name\[|^GenericName\[|^Comment\[' $FILE > ${FILE}_
+ echo "X-SuSE-translate=true" >> ${FILE}_
mv ${FILE}_ $FILE
+ #else - silently do nothing - upstream translations preferred
fi
else
#


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread