]> thyrsus.com Git - imgsizer.git/commitdiff
Last Perl version.
authorEric S. Raymond <esr@thyrsus.com>
Wed, 11 Jul 2001 10:15:32 +0000 (10:15 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 11 Jul 2001 10:15:32 +0000 (10:15 +0000)
imgsizer

index 12677a320a317c588f54fb0405a2d595376d69af..c41b998214804d9eff1f6ce3b8806bdeeb146f9c 100755 (executable)
--- a/imgsizer
+++ b/imgsizer
@@ -87,8 +87,16 @@ Options:
 EOT
 
 # Anything that can fetch a URL defined on the command line 
-# and dump it to stdout will do here. 
-$fetcher = 'httpget';  
+# and dump it to stdout will do here.  We try a number of
+# alternatives and crap out if we can't find any of them
+%fetchers = {"curl":"curl", "httpget":"httpget", "lynx":"lynx -source"}
+$fetcher = ""
+for $trythis in keys(fetchers) {
+    if (system(`whereis $trythis >/dev/null`) == 0) {
+       $fetcher = $fetchers{trythis}
+    }
+unless ($fetcher)
+    die("Can't find a remote URL fetcher.\n")
 
 # Output uppercase tags, surrounded by quotes, by default.
 $lower = 0;