Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=f60910ca036555dc5fb20b735dbd2d28e7bc2fcd

commit f60910ca036555dc5fb20b735dbd2d28e7bc2fcd
Author: Michel Hermier <herm...@frugalware.org>
Date:   Fri Apr 9 18:51:39 2010 +0200

util.sh

* Introduce Fwcat utility that dumps an url content to stdout (https
complients).
* Make Flastarchive use Fwcat so that https have not to be a special
case.

diff --git a/source/include/util.sh b/source/include/util.sh
index d319c4c..4ad8283 100644
--- a/source/include/util.sh
+++ b/source/include/util.sh
@@ -1063,12 +1063,20 @@ Fsanitizeversion() {
}

###
+# * Fwcat: Extracts a page to stdout. Parameters: 1) url of the page.
+###
+Fwcat() {
+       # Note "-e robots=off" disable robots.txt grabbing
+       wget -O - -q --no-check-certificate "$1"
+}
+
+###
# * Flastarchive: Extracts last archive version from a page. Parameters: 1)
# url (optional) of the page, else stdin if not present 2) extension_filter
# for the archive type
###
Flastarchive() {
-       local lynx="lynx -dump"
+       local lynx="lynx -stdin -dump"

if [ -z "$_F_archive_nolinksonly" ]; then
lynx="$lynx -listonly"
@@ -1080,14 +1088,14 @@ Flastarchive() {

if [ $# -gt 1 ]; then
if [ -n "$_F_archive_grep" ]; then
-                       $lynx $1 | grep -- "$_F_archive_grep" | Flastarchive $2
+                       Fwcat $1 | $lynx | grep -- "$_F_archive_grep" | 
Flastarchive $2
return
fi
if [ -n "$_F_archive_grepv" ]; then
-                       $lynx $1 | grep -v -- "$_F_archive_grepv" | 
Flastarchive $2
+                       Fwcat $1 | $lynx | grep -v -- "$_F_archive_grepv" | 
Flastarchive $2
return
fi
-               $lynx $1 | Flastarchive $2
+               Fwcat $1 | $lynx | Flastarchive $2
else
if [ -z "$_F_archive_nosort" ]; then
sed -n "s/.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/p" \
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to