git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 5/6] web--browse: use (x-)www-browser if available

From
Christian Couder <christian.couder@gmail.com>
Date
Nov 29, 2010, 16:25 UTC
Message-ID
<AANLkTi=Ob=7fvZUGNBy22r4+Pz31tgA+LeY4RqSTf1KU@mail.gmail.com>
In-Reply-To
<AANLkTinGustedMv9rm+RgGMQckfxgbTPA+Yqpz7vqTfm@mail.gmail.com>

On Mon, Nov 29, 2010 at 5:18 PM, Christian Couder <christian.couder@gmail.com> wrote:

Show 24 quoted lines
> Hi,
>
> On Mon, Nov 29, 2010 at 3:47 PM, Giuseppe Bilotta
> <giuseppe.bilotta@gmail.com> wrote:
>>
>> +# Debian and derivatives use x-www-browser or www-browser to set
>> +# the default browser for the system
>> +if test -z "$browser" ; then
>> +       wwwbrowser="/usr/bin/www-browser"
>> +       if test -n "$DISPLAY"; then
>> +               wwwbrowser="/usr/bin/x-www-browser $wwwbrowser"
>> +       fi
>> +       for i in $wwwbrowser; do
>> +               if test -x $i ; then
>> +                       verstring="$($i --version 2> /dev/null | head -n 1)"
>> +                       browser="$(echo "$verstring" | cut -f1 -d' ' | tr A-Z a-z)"
>
> Stupid questions:
>
> Did you check that all the browser we support accept the --version option?
> What if we add support for a new one that doesn't ?
> Shouldn't we add something like :
>
> test -z "$browser" && browser="$(echo $i | cut -f1 -d' ' | tr A-Z a-z)"
Sorry I mean:
 test -z "$browser" && browser="$(readlink $i)"
> And are you sure that when they support --version, the first word of
> the output is
> better than "$(echo $i | cut -f1 -d' ' | tr A-Z a-z)"?
and: "$(readlink $i)"

Thanks, Christian.

Previous: Christian CouderNext: Giuseppe Bilotta
Message 13 of 22 in “web--browse cleanups and extensions”
  1. 0/6 web--browse cleanups and extensionsGiuseppe Bilotta, Nov 29, 2010
  2. 1/6 CodingGuidelines: mention whitespace preferences for shell scriptsGiuseppe Bilotta, Nov 29, 2010
  3. Junio C HamanoNov 30, 2010
  4. Giuseppe BilottaNov 30, 2010
  5. 2/6 web--browse: coding styleGiuseppe Bilotta, Nov 29, 2010
  6. 3/6 web--browse: split valid_tool listGiuseppe Bilotta, Nov 29, 2010
  7. Jonathan NiederNov 29, 2010
  8. Giuseppe BilottaNov 29, 2010
  9. Junio C HamanoNov 29, 2010
  10. 4/6 web--browse: support opera, seamonkey and elinksGiuseppe Bilotta, Nov 29, 2010
  11. 5/6 web--browse: use (x-)www-browser if availableGiuseppe Bilotta, Nov 29, 2010
  12. Christian CouderNov 29, 2010
  13. Christian CouderNov 29, 2010
  14. Giuseppe BilottaNov 29, 2010
  15. Christian CouderNov 30, 2010
  16. Giuseppe BilottaNov 30, 2010
  17. Christian CouderDec 1, 2010
  18. Giuseppe BilottaDec 1, 2010
  19. Jonathan NiederDec 1, 2010
  20. Jonathan NiederNov 29, 2010
  21. Giuseppe BilottaNov 29, 2010
  22. 6/6 web--browse: special-case chromium pathGiuseppe Bilotta, Nov 29, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.