89 lines
2.5 KiB
Bash
89 lines
2.5 KiB
Bash
#!/bin/bash
|
|
|
|
test -f update-desktop-files.spec || { "cwd must contain update-desktop-files.spec"; exit 1; }
|
|
|
|
if test -d "$MY_LCN_CHECKOUT"; then
|
|
echo "Updating $MY_LCN_CHECKOUT"
|
|
svn up $MY_LCN_CHECKOUT
|
|
else
|
|
echo "No \$MY_LCN_CHECKOUT set, will checkout temporarly"
|
|
svn export https://forgesvn1.novell.com/svn/suse-i18n/trunk/lcn
|
|
export MY_LCN_CHECKOUT=$PWD/lcn
|
|
fi
|
|
|
|
rm -rf po
|
|
mkdir po
|
|
rm -f failed
|
|
for file in $MY_LCN_CHECKOUT/*/po/update-desktop-files*.po; do
|
|
lang=`echo $file | sed -e "s,/po/up.*,,; s,.*/,,"`
|
|
echo $lang
|
|
test -d po/$lang || mkdir po/$lang
|
|
# package valid files only
|
|
msgfmt -o /dev/null --check $file || {
|
|
rmdir po/$lang
|
|
echo $file >>failed
|
|
continue
|
|
}
|
|
# cp $file po/$lang/entries.po
|
|
# instead of copying, convert to the old inline format
|
|
msgattrib -o - --no-obsolete $file | awk '/^msgctxt/ {
|
|
body = 1
|
|
ctxt=gensub(/msgctxt \"(.+)\"/, "\\1", "g")
|
|
next
|
|
}
|
|
/^msgid/ && body == 1 {
|
|
sub(/msgid \"/, "&" ctxt ": ")
|
|
print
|
|
next
|
|
}
|
|
{print}
|
|
' > po/$lang/entries.po.new
|
|
if test -f po/$lang/entries.po; then
|
|
msgcat -o po/$lang/entries.po --use-first po/$lang/entries.po po/$lang/entries.po.new
|
|
rm po/$lang/entries.po.new
|
|
else
|
|
mv po/$lang/entries.po.new po/$lang/entries.po
|
|
fi
|
|
done
|
|
rm -f desktop-translations.tar.bz2
|
|
tar cfj desktop-translations.tar.bz2 po
|
|
rm -rf po
|
|
echo broken files, skipped:
|
|
cat failed
|
|
exit 0
|
|
|
|
rm -rf kappfinder
|
|
svn export svn://anonsvn.kde.org/home/kde/branches/KDE/3.5/kdebase/kappfinder/apps kappfinder
|
|
cd kappfinder/
|
|
# make sure we only have one desktop file of each.
|
|
if test $(find -type f -printf '%f\n' 2>/dev/null | grep -v Makefile.am | sort | uniq -c | sort -n | awk '{print $1}' | grep -v 1 | wc -l) -ne 0; then
|
|
echo "There is some duplicate desktop file!!!!"
|
|
echo " FIX ME!"
|
|
exit 1
|
|
fi
|
|
rm -f ../kappfinder.tar.bz2
|
|
tar cfj ../kappfinder.tar.bz2 *
|
|
cd -
|
|
rm -rf kappfinder-icons
|
|
mkdir -p kappfinder-icons
|
|
BASEDIR=/mounts/dist/unpacked/i386.full/opt/kde3
|
|
find kappfinder/ -name \*.desktop | while read f; do
|
|
oicon=`sed -n 's,Icon=\(.*\),\1,p' $f`
|
|
icon=`find $BASEDIR/share/icons/default.kde/32x32 -name $oicon -o -name $oicon.png -o -name $oicon.xpm | head -n 1`
|
|
if [ ! -r "$icon" ] ; then
|
|
icon=`find $BASEDIR/share/icons/*/32x32/apps -name $oicon -o -name $oicon.png -o -name $oicon.xpm | head -n 1`
|
|
fi
|
|
if [ -r "$icon" ] ; then
|
|
cp $icon kappfinder-icons/
|
|
else
|
|
echo "can't find icon $oicon from file $f"
|
|
# grep -v ^Icon= $f > ${f}_ && mv ${f}_ $f
|
|
fi
|
|
done
|
|
rm -f kappfinder-icons.tar.bz2
|
|
tar cfj kappfinder-icons.tar.bz2 kappfinder-icons
|
|
rm -rf kappfinder-icons
|
|
rm -rf kappfinder
|
|
|
|
|