diff -u -Naur urlview-0.9.orig/system.urlview urlview-0.9.fink/system.urlview --- urlview-0.9.orig/system.urlview Wed Dec 31 19:00:00 1969 +++ urlview-0.9.fink/system.urlview Tue Jan 21 21:16:22 2003 @@ -0,0 +1,10 @@ +# +# Sample urlview(1) configuration file +# + +# regular expression to use to match URLs +REGEXP (((http|https|ftp|gopher)|mailto):(//)?[^ <>"\t]*|www\.[-a-z0-9.]+)[^ .,;\t<">\):] + +# command to invoke for selected URL +COMMAND /etc/urlview/url_handler.sh + diff -u -Naur urlview-0.9.orig/url_handler.sh.fink urlview-0.9.fink/url_handler.sh.fink --- urlview-0.9.orig/url_handler.sh.fink Wed Dec 31 19:00:00 1969 +++ urlview-0.9.fink/url_handler.sh.fink Tue Jan 21 21:11:28 2003 @@ -0,0 +1,120 @@ +#! /bin/bash + +# Copyright (c) 1998 Martin Schulze +# Slightly modified by Luis Francisco Gonzalez + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +########################################################################### +# Configurable section +########################################################################### +# +# Any entry in the lists of programs that urlview handler will try out will +# be made of /path/to/program + ':' + TAG where TAG is one of +# XW: XWindows program +# XT: Launch with an xterm if possible or as VT if not +# VT: Launch in the same terminal + +# The lists of programs to be executed are +https_prgs="/usr/X11R6/bin/netscape:XW /usr/bin/lynx:XT" +http_prgs="/usr/bin/lynx:XT /usr/X11R6/bin/netscape:XW" +mailto_prgs="/usr/bin/mutt:VT /usr/bin/elm:VT /usr/bin/pine:VT /usr/bin/mail:VT" +gopher_prgs="/usr/bin/lynx:XT /usr/bin/gopher:XT" +ftp_prgs="/usr/bin/lynx:XT /usr/bin/ncftp:XT" + +# Program used as an xterm (if it doesn't support -T you'll need to change +# the command line in getprg) +XTERM=/usr/X11R6/bin/xterm + + +########################################################################### +# Change bellow this at your own risk +########################################################################### +function getprg() +{ + local ele tag prog + + for ele in $* + do + tag=${ele##*:} + prog=${ele%%:*} + if [ -x $prog ]; then + case $tag in + XW) + [ -n "$DISPLAY" ] && echo "X:$prog" && return 0 + ;; + XT) + [ -n "$DISPLAY" ] && [ -x "$XTERM" ] && \ + echo "X:$XTERM -e $prog" && return 0 + echo "$prog" && return 0 + ;; + VT) + echo "$prog" && return 0 + ;; + esac + fi + done +} + +url="$1"; shift + +type="${url%%:*}" + +if [ "$url" = "$type" ]; then + type="${url%%.*}" + case "$type" in + www|web) + type=http + ;; + esac + url="$type://$url" +fi + +case $type in +https) + prg=`getprg $https_prgs` + ;; +http) + prg=`getprg $http_prgs` + ;; +ftp) + prg=`getprg $ftp_prgs` + ;; +mailto) + prg=`getprg $mailto_prgs` + url="${url#mailto:}" + ;; +gopher) + prg=`getprg $gopher_prgs` + ;; +*) + echo "Unknown URL type. Please report URL and viewer to:" + echo "joey@debian.org." + echo -n "Press enter to continue."; read x + exit + ;; +esac + +if [ -n "$prg" ]; then + if [ "${prg%:*}" = "X" ]; then + ${prg#*:} "$url" 2>/dev/null & + else + $prg "$url" + fi +fi + + + + diff -u -Naur urlview-0.9.orig/urlview.c urlview-0.9.fink/urlview.c --- urlview-0.9.orig/urlview.c Tue Jul 4 06:14:30 2000 +++ urlview-0.9.fink/urlview.c Tue Jan 21 21:09:10 2003 @@ -48,7 +48,7 @@ #define DEFAULT_REGEXP "(((https?|ftp|gopher)://|(mailto|file|news):)[^' \t<>\"]+|(www|web|w3)\\.[-a-z0-9.]+)[^' \t.,;<>\"\\):]" #define DEFAULT_COMMAND "url_handler.sh %s" -#define SYSTEM_INITFILE "/etc/urlview.conf" +#define SYSTEM_INITFILE "@PREFIX@/etc/urlview.conf" #define OFFSET 2 #define PAGELEN (LINES - 1 - OFFSET) diff -u -Naur urlview-0.9.orig/urlview.html urlview-0.9.fink/urlview.html --- urlview-0.9.orig/urlview.html Wed Dec 31 19:00:00 1969 +++ urlview-0.9.fink/urlview.html Tue Jan 21 22:00:58 2003 @@ -0,0 +1,90 @@ + +urlview - URL extractor/launcher + +

0.1 NAME +

+ +

urlview - URL extractor/launcher

+ +

0.2 SYNOPSIS +

+ +

urlview <filename> [ <filename> ... ]

+ +

0.3 DESCRIPTION +

+ +

urlview is a screen oriented program for extracting URLs from text +files and displaying a menu from which you may launch a command to view a +specific item.

+ +

0.4 CONFIGURATION +

+ +

urlview attempts to read ~/.urlview upon startup. +If this file doesn't exist, it will try to read a system wide file +in /etc/urlview/system.urlview. There are +two configuration commands (order does not matter):

+

REGEXP <regular expression to use for URL matching>

+ +

urlview uses a regular expression to extract URLs from the specified +text files. \r, \t, \n and \f are all converted to +their normal printf(2) meanings. The default REGEXP is

+

+

+(((https?|ftp|gopher)://|(mailto|file|news):)[^' \t<>"]+|(www|web|w3)\.[-a-z0-9.]+)[^' \t.,;<>"\):]
+
+

+ +

COMMAND <command to launch with URL>

+

If the specified command contains a ``%s'', it will be subsituted +with the URL that was requested, otherwise the URL is appended to the +COMMAND string. The default COMMAND is +

+        url_handler.sh '%s'
+
+ +another possibility would be +
+        Netscape -remote 'openURL(%s)'
+
+ +NOTE: you should always put single quotes ('') around usage of +``%s'' and never let the REGEXP to match any string containing +a single quote (note [⁁'...] in the default REGEXP) +to avoid characters in the selected URL from being interpreted +by your shell. For example, I could put the following URL in my email +messages: +
+        X-Nasty-Url: http://www.`program_to_execute_as_you`.com
+
+ +If you pass this URL to your shell, it could have nasty consequences.

+ +

0.5 FILES +

+ +

+

+
/etc/urlview/system.urlview

system-wide urlview configuration file

+
~/.urlview

urlview configuration file

+
+

+ +

0.6 SEE ALSO +

+ +

regcomp(3)

+ +

0.7 AUTHOR +

+ +

Michael Elkins <me@cs.hmc.edu>. +Modified for Debian by Luis Francisco Gonzalez <luisgh@debian.org>. +Modified for SuSE by Dr. Werner Fink <werner@suse.de> and Stepan Kasal <kasal@suse.cz>.

+
+Next +Previous +Contents + + diff -u -Naur urlview-0.9.orig/urlview.man urlview-0.9.fink/urlview.man --- urlview-0.9.orig/urlview.man Tue Jul 4 06:14:30 2000 +++ urlview-0.9.fink/urlview.man Tue Jan 21 21:09:34 2003 @@ -34,7 +34,7 @@ upon startup. If this file doesn't exist, it will try to read a system wide file in -.IR /etc/urlview.conf . +.IR @PREFIX@/etc/urlview.conf . There are two configuration commands (order does not matter): .TP REGEXP \fIregexp\fP @@ -76,7 +76,7 @@ explicitly excludes single quotes.) .SH FILES .PP -.IP "/etc/urlview.conf" +.IP "@PREFIX@/etc/urlview.conf" system-wide urlview configuration file .IP "~/.urlview" urlview configuration file diff -u -Naur urlview-0.9.orig/urlview.sgml urlview-0.9.fink/urlview.sgml --- urlview-0.9.orig/urlview.sgml Tue Jul 4 06:14:30 2000 +++ urlview-0.9.fink/urlview.sgml Tue Jan 21 21:09:49 2003 @@ -20,7 +20,7 @@

˜/.urlview upon startup. If this file doesn't exist, it will try to read a system wide file -in /etc/urlview.conf. There are +in /@PREFIX@etc/urlview.conf. There are two configuration commands (order does not matter):

REGEXP <regular expression to use for URL matching> @@ -62,7 +62,7 @@

-/etc/urlview.conf +@PREFIX@/etc/urlview.conf

system-wide urlview configuration file