Hi,

sorry, holiday came in between:

On 30/08/14 10:56, Charles Plessy wrote:
for the first part of your proposition, I think that there is a serious
obstacle: with the mailcap system, it is not possible to determine if a program
would be able to use an URL to retreive a file.

The idea was actually that there is a one-to-one relationship from a file:-URL to a standard path by removing the prefix, something like the following under bash:

        # the file:-URL format is not well defined or known
URL[0]=file:///tmp/test.txt # absolute path, with empty server field
        URL[1]=file:/tmp/test.txt   # absolute path, without server field
URL[2]=file://tmp/test.txt # relative path, with empty server field
        URL[3]=file:tmp/test.txt    # relative path, without server field

        for i in "${URL[@]}"
        do # or in Perl s#^file:\(//\)?## (if I remember well)
                i=${i#file://}
                i=${i#file:}
                echo "$i"
        done

And the resulting $i could just be handled like any file path given.


For the second part, here is what we could do:

  - send a patch to the sensible-utils package, to add two lines in its
    mailcap file, where the media types x-scheme-handler/http and
    x-scheme-handler/ftp would be associated to the sensible-browser
    program.

  - Detect URLs passed to run-mailcap, and execute what /etc/mailcap proposes
    for the corresponding media type.

The problem I have with this approach is that x-scheme-handler media types
are not registered to the IANA.  As far as I know, they originate from the
Shared MIME-info Database specification.

     http://standards.freedesktop.org/shared-mime-info-spec/

Perhaps it would be better to ask for comments on debian-devel before using
these unregistered media types outside the scope where thay have been developed
originally.

What do you think about this ?
Eeh, to be honest, I think I had a much simpler (one could say hackish) kind of approach in mind:

is the switch --allow-url set?
if yes, does the thing have a URL-kind of format (something like a match on ^\w+://.*/.*$ - or more complex but still without knowledge of specific URL-schemes)?
if yes, hand over to sensible-browser and forget about it.
if no, do as usual...

Thanks for taking care anyway,
Eric


Have a nice week-end,

--
Charles Plessy
Tsurumi, Kanagawa, Japan



--
I'm subscribed on debian-java, debian-mentors, pkg-java-maintainers and pkg-vdr-dvb-devel.
No need to CC me on these lists.


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to