[Desktop-packages] [Bug 1517956] Re: xdg-settings assumes desktop files have exactly one Exec line

2015-11-19 Thread Chad Miller
Kep this from happening again.

The old "|sed" way perserved many line. The new function call that has
"|read" and echo first, only yields the first entry.

** Patch added: "add tests."
   
https://bugs.launchpad.net/xdg-utils/+bug/1517956/+attachment/4522191/+files/fdbug118501-many-execs-in-desktop-files.diff

** Summary changed:

- xdg-settings assumes desktop files have exactly one Exec line
+ xdg-settings (used to) assume desktop files have exactly one Exec line

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to xdg-utils in Ubuntu.
https://bugs.launchpad.net/bugs/1517956

Title:
  xdg-settings (used to) assume desktop files have exactly one Exec line

Status in Xdg-utils:
  Confirmed
Status in xdg-utils package in Ubuntu:
  Fix Committed

Bug description:
  In searching the desktop file for suitability, it scans for all lines
  that begin "Exec", and takes the result and packs it into a variable.

  If there is exactly one Exec line, this takes out a command name to
  test for existence, but when more than one matches, the program name
  is captured as "firstexecprog\nsecondexecprog\nthirdexecprog", and
  "which" doesn't know how to look up a program like that and the
  subsequent tests fail.

To manage notifications about this bug go to:
https://bugs.launchpad.net/xdg-utils/+bug/1517956/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp


[Desktop-packages] [Bug 1517956] Re: xdg-settings assumes desktop files have exactly one Exec line

2015-11-19 Thread Chad Miller
This is solved by "first_word" shell function.

** Changed in: xdg-utils (Ubuntu)
   Status: New => Fix Committed

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to xdg-utils in Ubuntu.
https://bugs.launchpad.net/bugs/1517956

Title:
  xdg-settings assumes desktop files have exactly one Exec line

Status in Xdg-utils:
  Confirmed
Status in xdg-utils package in Ubuntu:
  Fix Committed

Bug description:
  In searching the desktop file for suitability, it scans for all lines
  that begin "Exec", and takes the result and packs it into a variable.

  If there is exactly one Exec line, this takes out a command name to
  test for existence, but when more than one matches, the program name
  is captured as "firstexecprog\nsecondexecprog\nthirdexecprog", and
  "which" doesn't know how to look up a program like that and the
  subsequent tests fail.

To manage notifications about this bug go to:
https://bugs.launchpad.net/xdg-utils/+bug/1517956/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp


[Desktop-packages] [Bug 1517956] Re: xdg-settings assumes desktop files have exactly one Exec line

2015-11-19 Thread Bug Watch Updater
Launchpad has imported 2 comments from the remote bug at
https://bugs.freedesktop.org/show_bug.cgi?id=92170.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.


On 2015-09-28T22:23:42+00:00 Chad Miller wrote:

Example command:

xdg-settings set default-web-browser chromium-browser.desktop


In searching the desktop file for suitability, it scans for all lines that 
begin "Exec", and takes the result and packs it into a variable.

If there is exactly one Exec line, this takes out a command name to test
for existence, but when more than one matches, the program name is
captured as "firstexecprog\nsecondexecprog\nthirdexecprog", and "which"
doesn't know how to look up a program like that and the subsequent tests
fail.

Output with sh's "-x" option on:


+ grep -E ^Exec(\[[^]=]*])?= /usr/share//applications/chromium-browser.desktop
+ command=chromium-browser
chromium-browser
chromium-browser
chromium-browser
+ which chromium-browser
chromium-browser
chromium-browser
chromium-browser
+ command=
+ readlink -f
+ return
+ binary=
+ [  ]
+ exit_failure_file_missing
+ [ 0 -gt 0 ]


In desktop_file_to_binary and binary_to_desktop_file functions, it makes false 
assumptions how many times grep may match. Those should treat each Exec match 
separately.

Reply at: https://bugs.launchpad.net/ubuntu/+source/xdg-
utils/+bug/1517956/comments/0


On 2015-09-28T22:30:30+00:00 Chad Miller wrote:

Created attachment 118501
desktopfile/binary mapping works for multi-Exec destop files

Patch against git tip to treat each matched line as a separate program.

Reply at: https://bugs.launchpad.net/ubuntu/+source/xdg-
utils/+bug/1517956/comments/1


** Changed in: xdg-utils
   Status: Unknown => Confirmed

** Changed in: xdg-utils
   Importance: Unknown => Medium

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to xdg-utils in Ubuntu.
https://bugs.launchpad.net/bugs/1517956

Title:
  xdg-settings assumes desktop files have exactly one Exec line

Status in Xdg-utils:
  Confirmed
Status in xdg-utils package in Ubuntu:
  New

Bug description:
  In searching the desktop file for suitability, it scans for all lines
  that begin "Exec", and takes the result and packs it into a variable.

  If there is exactly one Exec line, this takes out a command name to
  test for existence, but when more than one matches, the program name
  is captured as "firstexecprog\nsecondexecprog\nthirdexecprog", and
  "which" doesn't know how to look up a program like that and the
  subsequent tests fail.

To manage notifications about this bug go to:
https://bugs.launchpad.net/xdg-utils/+bug/1517956/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp