# HG changeset patch # User Aleksej Bobylev # Date 1446908785 -7200 # Node ID e177315d46eb5f03e317e50b5f72b6ff7d0868fa # Parent 5afd5252a5e739d2b08fa75cb76219e3c99b4b22 fix-desktop-file: not remove Comment[locale] unconditionally when Name[locale] == Name diff -r 5afd5252a5e7 -r e177315d46eb cook --- a/cook Sat Nov 07 16:00:41 2015 +0200 +++ b/cook Sat Nov 07 17:06:25 2015 +0200 @@ -485,11 +485,11 @@ fi for desktop in $(find $install/usr/share/applications -name '*.desktop'); do + cp "$desktop" "$desktop.orig" + # Sort out .desktop file (is prerequisite to correct working of `fix-desktop-file`) sdft "$desktop" -i - cp "$desktop" "$desktop.orig" - # Fix common errors in .desktop file fix-desktop-file "$desktop" diff -r 5afd5252a5e7 -r e177315d46eb fix-desktop-file --- a/fix-desktop-file Sat Nov 07 16:00:41 2015 +0200 +++ b/fix-desktop-file Sat Nov 07 17:06:25 2015 +0200 @@ -74,12 +74,6 @@ if (Name) next; # Name already printed Name = gensub(/^[^=]+=[[:space:]]*/, "", ""); print; - for (i in name) { - if (name[i] && - name[i] != Name) { # skip redundant - printf "Name[%s]=%s\n", i, name[i]; - } - } next; } @@ -91,12 +85,8 @@ name[locale] = value; if (Name && Name != value) { # skip redundant - name[locale] = value; print; } - if (comment[locale] && # print pending Comment[xx] - tolower(comment[locale]) != tolower(name[locale])) - printf "Comment[%s]=%s\n", locale, comment[locale]; next; } @@ -109,13 +99,6 @@ } else { print; } - for (i in comment) { - if (comment[i] && - tolower(comment[i]) != tolower(Comment) && - tolower(comment[i]) != tolower(name[i])) { # skip redundant - printf "Comment[%s]=%s\n", i, comment[i]; - } - } next; } @@ -125,9 +108,7 @@ locomm = gensub(/^[^=]*=[[:space:]]*(.*)$/, "\\1", ""); if (comment[locale]) next; # Comment[locale] already printed comment[locale] = locomm; - if (Comment && # pending until Comment appear - name[locale] && # pending until Name[xx] appear - tolower(locomm) != tolower(Comment) && + if (tolower(locomm) != tolower(Comment) && tolower(locomm) != tolower(name[locale])) { # skip redundant comment[locale] = locomm; print;