2007-05-31 21:28:41 +02:00
|
|
|
#! /bin/sh
|
|
|
|
|
2007-01-16 00:40:16 +01:00
|
|
|
# macro: suse_update_desktop_file
|
|
|
|
#
|
|
|
|
# Used to add easily a category to .desktop files according to XDG
|
|
|
|
# standard.
|
|
|
|
#
|
|
|
|
|
|
|
|
. /usr/lib/rpm/map-desktop-category.sh
|
|
|
|
|
|
|
|
#
|
|
|
|
# parse arguments
|
|
|
|
#
|
|
|
|
INSTALL=no
|
|
|
|
I18N=yes
|
|
|
|
CREATE=no
|
|
|
|
RESET=no
|
|
|
|
UNIMPORTANT=no
|
|
|
|
NAME=no
|
|
|
|
COMMENT=no
|
|
|
|
GNAME=no
|
2009-06-12 16:58:22 +02:00
|
|
|
|
|
|
|
function usage() {
|
|
|
|
local exitcode="$1"
|
|
|
|
if [ -z "$exitcode" ]; then
|
|
|
|
exitcode=1
|
|
|
|
fi
|
|
|
|
echo
|
|
|
|
echo "Usage: $(basename $0) [OPTIONS] <APPLICATION> [CATEGORIES]"
|
|
|
|
echo
|
|
|
|
echo " Summary:"
|
|
|
|
echo " Used to add easily a category to .desktop files according to XDG"
|
|
|
|
echo " standard. More information is available on"
|
|
|
|
echo " http://en.opensuse.org/SUSE_Package_Conventions/RPM_Macros"
|
|
|
|
echo " If you have any questions, please use our mailinglist: "
|
|
|
|
echo " opensuse-packaging@opensuse.org"
|
|
|
|
echo " Options:"
|
|
|
|
echo " <APPLICATION> : The name of the desktop file."
|
|
|
|
echo " Example: use \"qbrew\" to edit qbrew.desktop"
|
|
|
|
echo " If APPLICATION has multiple desktop files, try the exact path"
|
|
|
|
echo " to the desktop file."
|
|
|
|
echo " Example: use \"%suse_update_desktop_file \\"
|
|
|
|
echo " %{buildroot}%{_datadir}/susehelp/meta/%name/%name.desktop\""
|
|
|
|
echo " to edit the susehelp desktop entry file instead."
|
2011-09-29 23:41:55 +02:00
|
|
|
echo " -u|--unimportant : add \"NoDisplay=true\" to the resulting desktop"
|
2009-06-12 16:58:22 +02:00
|
|
|
echo " file."
|
|
|
|
echo " -n|--no-i18n : Do not prepare the desktop file for translators (obsoletes -t)."
|
|
|
|
echo " (adds X-SuSE-translate=false to the desktop file)"
|
|
|
|
echo " -i|--install : Install an existing desktop file in /usr/share/applications/"
|
|
|
|
echo " The to be installed desktop file can be located in:"
|
|
|
|
echo " - RPM_SOURCE_DIR or"
|
|
|
|
echo " - RPM_BUILD_DIR"
|
|
|
|
echo " A referenced icon file (ending *.png; *.xpm) is installed in"
|
|
|
|
echo " /usr/share/pixmaps/ automatically if it is located in one of the "
|
|
|
|
echo " directories mentioned above (-maxdepth 1)."
|
|
|
|
echo " -r|--reset : Reset the \"Categories\" line in an existing desktop file."
|
|
|
|
echo " Normally, categories mentioned in an existing desktop file will be"
|
|
|
|
echo " obtained. Additional categories from commandline are added."
|
|
|
|
echo " -d|--docid <string> : Add \"X-SuSE-DocTeamID=<string>\" to the desktop file."
|
|
|
|
echo " -D|--docpath <path> : Add \"DocPath=<path>\" to the desktop file - do not guess it"
|
|
|
|
echo " automatically."
|
|
|
|
echo " -c|--create <name> : Create a new desktop file in /usr/share/applications/<name>.desktop ."
|
|
|
|
echo " -C|--comment <string> : Use <string> as \"Comment=<string>\" in desktop file."
|
|
|
|
echo " -N|--name <string> : Use <string> as \"Name=<string>\" in desktop file."
|
|
|
|
echo " -G|--genericname <string> : Use <string> as \"GenericName=<string>\" in desktop file."
|
|
|
|
echo ""
|
|
|
|
exit $exitcode
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-01-16 00:40:16 +01:00
|
|
|
while [ "${1:0:1}" = "-" ]; do
|
|
|
|
case ${1} in
|
2009-06-12 16:58:22 +02:00
|
|
|
-h|--help)
|
|
|
|
usage 0 ;;
|
2007-01-16 00:40:16 +01:00
|
|
|
-u|--unimportant)
|
|
|
|
UNIMPORTANT=yes
|
|
|
|
shift
|
|
|
|
continue;;
|
|
|
|
-n|--no-i18n)
|
|
|
|
I18N=no
|
|
|
|
shift
|
|
|
|
continue;;
|
|
|
|
-i|--install)
|
|
|
|
INSTALL=yes
|
|
|
|
shift
|
|
|
|
continue;;
|
|
|
|
-r|--reset)
|
|
|
|
RESET=yes
|
|
|
|
shift
|
|
|
|
continue;;
|
|
|
|
-d|--docid)
|
|
|
|
shift
|
|
|
|
DOCID="${1}"
|
|
|
|
shift
|
|
|
|
continue;;
|
|
|
|
-D|--docpath)
|
|
|
|
shift
|
|
|
|
DOCPATH="${1}"
|
2007-04-24 13:57:29 +02:00
|
|
|
if ! [ -r "$RPM_BUILD_ROOT/opt/kde3/share/doc/HTML/en/$DOCPATH/index.docbook" -o -r $RPM_BUILD_ROOT/usr/share/gnome/help/$DOCPATH/C/$DOCPATH.xml -o -r $RPM_BUILD_ROOT/usr/share/gnome/help/${DOCPATH/\///C/} ] ; then
|
2007-01-16 00:40:16 +01:00
|
|
|
echo WARNING: suse_update_desktop_file: DocPath target $DOCPATH for $FILE does not exist
|
|
|
|
fi
|
|
|
|
shift
|
|
|
|
continue;;
|
|
|
|
-c|--create)
|
|
|
|
CREATE=yes
|
|
|
|
INSTALL=yes
|
|
|
|
shift
|
|
|
|
continue;;
|
|
|
|
-C|--comment)
|
|
|
|
shift
|
|
|
|
COMMENT="${1}"
|
|
|
|
shift
|
|
|
|
continue;;
|
|
|
|
-N|--name)
|
|
|
|
shift
|
|
|
|
NAME="${1}"
|
|
|
|
shift
|
|
|
|
continue;;
|
|
|
|
-G|--genericname)
|
|
|
|
shift
|
|
|
|
GNAME="${1}"
|
|
|
|
shift
|
|
|
|
continue;;
|
|
|
|
*)
|
|
|
|
echo "UNKNOWN OPTION: $1"
|
2009-06-12 16:58:22 +02:00
|
|
|
usage 1 ;;
|
2007-01-16 00:40:16 +01:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
APPLICATION="$1"
|
|
|
|
shift
|
|
|
|
if [ "$CREATE" = "yes" ]; then
|
|
|
|
NAME="$1"
|
|
|
|
shift
|
|
|
|
GNAME="$1"
|
|
|
|
shift
|
|
|
|
EXEC="$1"
|
|
|
|
shift
|
|
|
|
ICON="$1"
|
|
|
|
shift
|
|
|
|
if [ -z "$NAME" -o -z "$EXEC" ]; then
|
2009-06-12 16:58:22 +02:00
|
|
|
echo "ERROR: after --create you should define" >&2
|
|
|
|
echo " DESKTOP_FILE_NAME NAME GENERICNAME EXECUTABLE \[ ICON CATEGORIES... \]" >&2
|
|
|
|
usage 1
|
2007-01-16 00:40:16 +01:00
|
|
|
fi
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/share/applications/
|
|
|
|
cat > $RPM_SOURCE_DIR/$APPLICATION.desktop << EOF
|
|
|
|
[Desktop Entry]
|
2007-05-11 10:36:00 +02:00
|
|
|
Encoding=UTF-8
|
2007-01-16 00:40:16 +01:00
|
|
|
Name=$NAME
|
|
|
|
GenericName=$GNAME
|
|
|
|
Type=Application
|
|
|
|
Exec=$EXEC
|
|
|
|
Icon=$ICON
|
|
|
|
EOF
|
|
|
|
NAME=no
|
|
|
|
GNAME=no
|
|
|
|
fi
|
|
|
|
if [ "$INSTALL" = "yes" ]; then
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/share/applications/
|
2007-07-05 19:27:31 +02:00
|
|
|
FILE=`find $RPM_SOURCE_DIR $RPM_BUILD_DIR . -name $APPLICATION.desktop| sort -r | head -n 1`
|
2007-01-16 00:40:16 +01:00
|
|
|
if [ -s "$FILE" ]; then
|
2007-07-05 01:51:06 +02:00
|
|
|
cp -v "$FILE" $RPM_BUILD_ROOT/usr/share/applications/
|
2007-01-16 00:40:16 +01:00
|
|
|
icon_file=`sed -n '/^\[Desktop Entry\]/,/(\[.*|$)/ s,Icon=\(.*\),\1,p' "$FILE"`
|
2007-07-05 19:27:31 +02:00
|
|
|
icon_file=`find $RPM_SOURCE_DIR $RPM_BUILD_DIR -maxdepth 1 -name ${icon_file}.png -o -name ${icon_file}.xpm -o -name $icon_file | sort -r | head -n 1`
|
2007-01-16 00:40:16 +01:00
|
|
|
if [ -s "$icon_file" ]; then
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps/
|
2007-07-05 01:51:06 +02:00
|
|
|
cp -v "$icon_file" $RPM_BUILD_ROOT/usr/share/pixmaps/
|
2007-01-16 00:40:16 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
while [ "$1" ]; do
|
|
|
|
CATEGORIES="$CATEGORIES;$1"
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
CATEGORIES="${CATEGORIES#;}"
|
|
|
|
if [ -z "$APPLICATION" ]; then
|
2009-06-12 16:58:22 +02:00
|
|
|
echo "ERROR: suse_update_desktop_file: no application argument given" >&2
|
|
|
|
echo " Example: use "qbrew" to edit qbrew.desktop" >&2
|
|
|
|
usage 1
|
2007-01-16 00:40:16 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# find file
|
|
|
|
#
|
2008-03-28 05:05:37 +01:00
|
|
|
for i in /$RPM_BUILD_ROOT/opt/kde3/share/applications/kde/ \
|
|
|
|
/$RPM_BUILD_ROOT/opt/kde3/share/applnk \
|
|
|
|
/$RPM_BUILD_ROOT/usr/share/applications/ \
|
|
|
|
/$RPM_BUILD_ROOT/usr/share/gnome/apps/ \
|
|
|
|
/$RPM_BUILD_ROOT/etc/xdg/autostart/ ; do
|
2007-01-16 00:40:16 +01:00
|
|
|
[ -e "$i" ] && DIRS="$DIRS $i"
|
|
|
|
done
|
|
|
|
if [ "${APPLICATION:0:1}" == "/" -a -e "$APPLICATION" ]; then
|
|
|
|
FILE_="$APPLICATION"
|
|
|
|
else
|
|
|
|
FILE_=`find $DIRS -name $APPLICATION.desktop`
|
|
|
|
fi
|
|
|
|
if [ -z "$FILE_" ]; then
|
2009-06-12 16:58:22 +02:00
|
|
|
echo "ERROR: suse_update_desktop_file: unable to find $APPLICATION" >&2
|
|
|
|
usage 1
|
2007-01-16 00:40:16 +01:00
|
|
|
fi
|
|
|
|
FILE=""
|
|
|
|
for i in $FILE_; do
|
|
|
|
#
|
|
|
|
# fix old files
|
|
|
|
#
|
|
|
|
sed -e 's/\[KDE Desktop Entry\]/[Desktop Entry]/' "$i" > "${i}_" && mv "${i}_" "$i"
|
|
|
|
|
2007-05-17 11:25:10 +02:00
|
|
|
# dos2unix for the poor
|
|
|
|
sed -e 's/
//' "$i" > "${i}_" && mv "${i}_" "$i"
|
|
|
|
|
2007-01-16 00:40:16 +01:00
|
|
|
if [ "$FILE" ]; then
|
2009-06-12 16:58:22 +02:00
|
|
|
echo "ERROR: suse_update_desktop_file: $APPLICATION has multiple desktop files" >&2
|
|
|
|
usage 1
|
2007-01-16 00:40:16 +01:00
|
|
|
fi
|
|
|
|
FILE=$i
|
|
|
|
done
|
|
|
|
|
|
|
|
#
|
|
|
|
# move KDE legacy files to XDG path
|
|
|
|
#
|
|
|
|
if echo $FILE | grep -q /opt/kde3/share/applnk/ ; then
|
|
|
|
if ! echo $FILE | grep -q /opt/kde3/share/applnk/.hidden/ ; then
|
|
|
|
if ! echo $FILE | grep -q /opt/kde3/share/applnk/Settings/ ; then
|
|
|
|
if ! echo $FILE | grep -q /opt/kde3/share/applnk/System/ScreenSavers/ ; then
|
2009-06-12 16:58:22 +02:00
|
|
|
echo "WARNING: file is in old KDE legacy path, moving it to XDG path"
|
2007-01-16 00:40:16 +01:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/opt/kde3/share/applications/kde/
|
|
|
|
mv "$FILE" $RPM_BUILD_ROOT/opt/kde3/share/applications/kde/
|
|
|
|
FILE="$RPM_BUILD_ROOT/opt/kde3/share/applications/kde/${FILE##*/}"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# validate file
|
|
|
|
#
|
|
|
|
if [ ! -r "$FILE" ]; then
|
2009-06-12 16:58:22 +02:00
|
|
|
echo "ERROR: suse_update_desktop_file: unable to read $FILE" >&2
|
|
|
|
usage 1
|
2007-01-16 00:40:16 +01:00
|
|
|
fi
|
|
|
|
# esp. for susehelp
|
|
|
|
FILE_DOCPATH=`sed -n -e '/^\[Desktop Entry\]/,/(\[.*|$)/ s,;, ,g' -e 's,^DocPath=\\(.*\\),\\1,p' ${FILE}`
|
|
|
|
if [ -n "$FILE_DOCPATH" ] ; then
|
2007-04-24 13:57:29 +02:00
|
|
|
if [ ! -r "$RPM_BUILD_ROOT/opt/kde3/share/doc/HTML/en/$FILE_DOCPATH/index.docbook" ] && [ ! -r "$RPM_BUILD_ROOT/usr/share/gnome/help/$FILE_DOCPATH/C/$FILE_DOCPATH.xml" ] && [ ! -r $RPM_BUILD_ROOT/usr/share/gnome/help/${DOCPATH/\///C/} ] ; then
|
2007-01-16 00:40:16 +01:00
|
|
|
echo WARNING: suse_update_desktop_file: DocPath target $FILE_DOCPATH for $FILE does not exist
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# update Categories
|
|
|
|
#
|
|
|
|
if [ "$RESET" = "no" ]; then
|
|
|
|
CATIN=`sed -n -e '/^\[Desktop Entry\]/,/(\[.*|$)/ s,;, ,g' -e 's,^Categories=\\(.*\\),\\1,p' ${FILE}`
|
|
|
|
fi
|
|
|
|
CATIN="$CATIN ${CATEGORIES//;/ }"
|
|
|
|
if [ -z "$CATIN" ]; then
|
|
|
|
case "${FILE%/*}" in
|
|
|
|
*/opt/kde3/*) CATIN="Qt KDE" ;;
|
2007-04-24 13:57:29 +02:00
|
|
|
*/usr/share/gnome*) CATIN="GTK" ;;
|
2007-01-16 00:40:16 +01:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
unset CAT
|
|
|
|
unset DCAT
|
|
|
|
for i in $CATIN; do
|
|
|
|
ret=""
|
|
|
|
mapCategory $i
|
|
|
|
if [ -z "$ret" ]; then
|
2009-06-02 12:19:33 +02:00
|
|
|
echo "WARNING: Category \"$i\" is unknown \!"
|
2009-06-12 16:58:22 +02:00
|
|
|
echo WARNING: it is ignored, until you registered a Category at opensuse-packaging@opensuse.org .
|
2007-01-16 00:40:16 +01:00
|
|
|
else
|
|
|
|
echo "$CAT" | grep -q "[=;]$i;" || CAT="$CAT$ret;"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
echo "" >> "${FILE}"
|
|
|
|
CAT="${CAT#;}"
|
|
|
|
if grep -q ^Categories= $FILE; then
|
|
|
|
sed -e '/^\[Desktop Entry\]/,/(\[.*|$)/ s,^Categories=.*,Categories='${CAT}',' "$FILE" > "${FILE}.new" &&
|
|
|
|
mv "${FILE}.new" "${FILE}"
|
|
|
|
else
|
|
|
|
if [ -n "${CAT%;}" ]; then
|
|
|
|
sed -e '/^\[Desktop Entry\]/a \
|
2007-04-26 19:02:35 +02:00
|
|
|
'"Categories=${CAT%;};" $FILE > ${FILE}_ && mv ${FILE}_ $FILE
|
2007-01-16 00:40:16 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ "$UNIMPORTANT" = "yes" ]; then
|
2011-09-29 23:41:55 +02:00
|
|
|
if grep -q ^NoDisplay= $FILE; then
|
|
|
|
sed -e '/^\[Desktop Entry\]/,/(\[.*|$)/ s,^NoDisplay=.*,NoDisplay=true,' "$FILE" > "${FILE}.new" &&
|
|
|
|
mv "${FILE}.new" "${FILE}"
|
|
|
|
else
|
|
|
|
sed -e '/^\[Desktop Entry\]/a \
|
|
|
|
NoDisplay=true' $FILE > ${FILE}_ && mv ${FILE}_ $FILE
|
|
|
|
fi
|
2007-01-16 00:40:16 +01:00
|
|
|
fi
|
|
|
|
if [ "$DOCID" ]; then
|
|
|
|
sed -e '/^\[Desktop Entry\]/a \
|
|
|
|
'"X-SuSE-DocTeamID=$DOCID" $FILE > ${FILE}_ && mv ${FILE}_ $FILE
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# check or set DocPath
|
|
|
|
#
|
|
|
|
DOCPATH_IS_GUESS=false
|
|
|
|
if [ -z "$DOCPATH" ] ; then
|
2007-04-24 13:57:29 +02:00
|
|
|
if [ -f $RPM_BUILD_ROOT/usr/share/gnome/help/$APPLICATION/C/$APPLICATION.xml ] ; then
|
2007-01-16 00:40:16 +01:00
|
|
|
DOCPATH=$APPLICATION
|
|
|
|
DOCPATH_IS_GUESS=true
|
|
|
|
fi
|
|
|
|
if [ -f $RPM_BUILD_ROOT/opt/kde3/share/doc/HTML/en/$APPLICATION/index.docbook ] ; then
|
|
|
|
DOCPATH=$APPLICATION
|
|
|
|
DOCPATH_IS_GUESS=true
|
|
|
|
fi
|
|
|
|
# NOTE: Here we can add guess for application/file.xml
|
|
|
|
fi
|
|
|
|
if [ -n "$DOCPATH" ] ; then
|
|
|
|
if [ -n "$FILE_DOCPATH" ] ; then
|
|
|
|
# DocPath already exists. Update it only from command line, not from guess.
|
|
|
|
if $DOCPATH_IS_GUESS ; then
|
|
|
|
if [ "$DOCPATH" != "$FILE_DOCPATH" ] ; then
|
|
|
|
echo WARNING: suse_update_desktop_file: DocPath target $FILE_DOCPATH differs from guess $DOCPATH for $FILE
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
sed -e '/^\[Desktop Entry\]/,/(\[.*|$)/ s,^DocPath=.*,DocPath='${DOCPATH}',' "$FILE" > "${FILE}.new" &&
|
|
|
|
mv "${FILE}.new" "${FILE}"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
sed -e '/^\[Desktop Entry\]/a \
|
|
|
|
'"DocPath=${DOCPATH}" $FILE > ${FILE}.new && mv ${FILE}.new $FILE
|
|
|
|
if $DOCPATH_IS_GUESS ; then
|
|
|
|
echo NOTE: suse_update_desktop_file: Guessing DocPath=$DOCPATH in $FILE
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2007-05-17 11:25:10 +02:00
|
|
|
if grep -q ^X-SuSE-translate= $FILE; then
|
2009-06-12 16:58:22 +02:00
|
|
|
echo "ERROR: $FILE contains X-SuSE-translate - called the macro twice?" >&2
|
|
|
|
usage 1
|
2007-05-17 11:25:10 +02:00
|
|
|
fi
|
|
|
|
|
2008-11-01 23:19:26 +01:00
|
|
|
if [ "$NAME" != "no" ]; then
|
2007-01-16 00:40:16 +01:00
|
|
|
grep -v '^Name\[' $FILE > ${FILE}_
|
|
|
|
if [ -n "$NAME" ]; then
|
|
|
|
if ! grep -q ^Name= ${FILE}_; then
|
|
|
|
sed -e '/^\[Desktop Entry\]/a '"Name=${NAME//,/\,}" ${FILE}_ > $FILE
|
|
|
|
else
|
|
|
|
sed -e '/^\[Desktop Entry\]/,/(\[.*|$)/ s,^Name=.*,Name='"${NAME//,/\,}"',' ${FILE}_ > $FILE
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
grep -v "^Name=" ${FILE}_ > $FILE
|
|
|
|
fi
|
2008-11-01 23:19:26 +01:00
|
|
|
fi
|
2007-01-16 00:40:16 +01:00
|
|
|
|
2008-11-01 23:19:26 +01:00
|
|
|
if [ "$GNAME" != "no" ]; then
|
2007-01-16 00:40:16 +01:00
|
|
|
grep -v '^GenericName\[' $FILE > ${FILE}_
|
|
|
|
if [ -n "$GNAME" ]; then
|
|
|
|
if ! grep -q ^GenericName= ${FILE}_; then
|
|
|
|
sed -e '/^\[Desktop Entry\]/a '"GenericName=${GNAME//,/\,}" ${FILE}_ > $FILE
|
|
|
|
else
|
|
|
|
sed -e '/^\[Desktop Entry\]/,/(\[.*|$)/ s,^GenericName=.*,GenericName='"${GNAME//,/\,}"',' ${FILE}_ > $FILE
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
grep -v "^GenericName=" ${FILE}_ > $FILE
|
|
|
|
fi
|
2008-11-01 23:19:26 +01:00
|
|
|
fi
|
2007-01-16 00:40:16 +01:00
|
|
|
|
2008-11-01 23:19:26 +01:00
|
|
|
if [ "$COMMENT" != "no" ]; then
|
2007-01-16 00:40:16 +01:00
|
|
|
grep -v '^Comment\[' $FILE > ${FILE}_
|
|
|
|
if [ -n "$COMMENT" ]; then
|
|
|
|
if ! grep -q ^Comment= ${FILE}_; then
|
|
|
|
sed -e '/^\[Desktop Entry\]/a '"Comment=${COMMENT//,/\,}" ${FILE}_ > $FILE
|
|
|
|
else
|
|
|
|
sed -e '/^\[Desktop Entry\]/,/(\[.*|$)/ s,^Comment=.*,Comment='"${COMMENT//,/\,}"',' ${FILE}_ > $FILE
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
grep -v "^Comment=" ${FILE}_ > $FILE
|
|
|
|
fi
|
2008-11-01 23:19:26 +01:00
|
|
|
fi
|
|
|
|
|
2011-12-13 12:07:15 +01:00
|
|
|
if [ "$I18N" = "no" ]; then
|
2007-01-16 00:40:16 +01:00
|
|
|
#
|
|
|
|
# this file will not get translated
|
|
|
|
#
|
|
|
|
sed -e '/^\[Desktop Entry\]/a \
|
|
|
|
X-SuSE-translate=false' $FILE > ${FILE}_ && mv ${FILE}_ $FILE
|
|
|
|
fi
|