strip buildroot
OBS-URL: https://build.opensuse.org/package/show/X11:common:Factory/update-desktop-files?expand=0&rev=30
This commit is contained in:
parent
7e61e8d818
commit
065e41031d
@ -10,6 +10,13 @@
|
||||
# find file
|
||||
#
|
||||
BASEDIR=`dirname $RPM_SOURCE_DIR`/OTHER
|
||||
|
||||
if ! test -f /.buildenv; then
|
||||
# this looks fishy, skip it
|
||||
echo "WARNING: I better not trim without a /.buildenv around"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! test -w $BASEDIR; then
|
||||
echo "WARNING: Can't write to $BASEDIR, skipping"
|
||||
exit 0
|
||||
@ -23,24 +30,24 @@ find /$RPM_BUILD_ROOT/opt/kde3/share/applications/kde/ \
|
||||
/$RPM_BUILD_ROOT/usr/share/gnome/apps/ \
|
||||
/$RPM_BUILD_ROOT/etc/xdg/autostart/ -name *.desktop -o -name .directory 2>/dev/null | while read FILE; do
|
||||
|
||||
if grep -q ^X-SuSE-translate= "$FILE"; then
|
||||
echo "DEBUG: $FILE contains X-SuSE-translate - skipping" >&2
|
||||
continue
|
||||
fi
|
||||
if grep -q ^X-SuSE-translate= "$FILE"; then
|
||||
echo "DEBUG: $FILE contains X-SuSE-translate - skipping" >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
# 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
|
||||
#
|
||||
# Trim translations (desktops will use gettext to find them)
|
||||
#
|
||||
grep -v -E '^Name\[|^GenericName\[|^Comment\[' $FILE > ${FILE}_
|
||||
sed -i -e '/^\[Desktop Entry\]/a \
|
||||
# save for backup
|
||||
NFILE=${FILE#$RPM_BUILD_ROOT}
|
||||
echo "<<$NFILE>>" >> $BASEDIR/$RPM_PACKAGE_NAME.desktopfiles
|
||||
cat $FILE >> $BASEDIR/$RPM_PACKAGE_NAME.desktopfiles
|
||||
echo "trimmed output to $BASEDIR/$RPM_PACKAGE_NAME.desktopfiles"
|
||||
|
||||
#
|
||||
# Trim translations (desktops will use gettext to find them)
|
||||
#
|
||||
grep -v -E '^Name\[|^GenericName\[|^Comment\[' $FILE > ${FILE}_
|
||||
sed -i -e '/^\[Desktop Entry\]/a \
|
||||
X-SuSE-translate=true' ${FILE}_
|
||||
mv ${FILE}_ $FILE
|
||||
mv ${FILE}_ $FILE
|
||||
|
||||
done
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
Name: update-desktop-files
|
||||
Version: 12.1
|
||||
Release: 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user