Accepting request 262698 from home:StefanBruens:branches:X11:common:Factory

The grep invocation tries to access ${FILE}_ , which is most likely a result of an bad $FILE -> ${FILE} substitution.

The escaped carrigage return \r is nicer than the ^M sequence, the latter may not show up correctly in some editors.

OBS-URL: https://build.opensuse.org/request/show/262698
OBS-URL: https://build.opensuse.org/package/show/X11:common:Factory/update-desktop-files?expand=0&rev=54
This commit is contained in:
Tomáš Chvátal 2014-12-01 10:03:16 +00:00 committed by Git OBS Bridge
parent b0c70a1480
commit 06ad41b430
2 changed files with 8 additions and 2 deletions

View File

@ -217,7 +217,7 @@ for i in $FILE_; do
sed -e 's/\[KDE Desktop Entry\]/[Desktop Entry]/' "$i" > "${i}_" && mv "${i}_" "$i"
# dos2unix for the poor
sed -e 's/ //' "$i" > "${i}_" && mv "${i}_" "$i"
sed -e 's/\r//' "$i" > "${i}_" && mv "${i}_" "$i"
if [ "$FILE" ]; then
echo "ERROR: suse_update_desktop_file: $APPLICATION has multiple desktop files" >&2
@ -361,7 +361,7 @@ fi
if [ "$GNAME" != "no" ]; then
sed -i -e '/^GenericName\[/d' $FILE
if [ -n "$GNAME" ]; then
if ! grep -q ^GenericName= ${FILE}_; then
if ! grep -q ^GenericName= ${FILE}; then
sed -i -e '/^\[Desktop Entry\]/a '"GenericName=${GNAME//,/\,}" ${FILE}
else
sed -i -e '/^\[Desktop Entry\]/,/(\[.*|$)/ s,^GenericName=.*,GenericName='"${GNAME//,/\,}"',' ${FILE}

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sat Nov 22 16:46:15 UTC 2014 - stefan.bruens@rwth-aachen.de
- Fix bad variable access for --genericname
- replace ^M pattern with \r in sed pattern
-------------------------------------------------------------------
Sat Nov 15 21:09:00 UTC 2014 - Led <ledest@gmail.com>