patches/wv-02-w3m-dump.diff
author jurikm
Sun, 12 Feb 2012 14:04:10 +0000
changeset 8245 383896da4129
parent 492 5c737a73fcd0
permissions -rw-r--r--
SFEsauerbraten.spec: add IPS package name
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
489
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
     1
Index: wv-trunk/wvText.in
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
     2
===================================================================
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
     3
--- wv-trunk/wvText.in	(revision 21979)
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
     4
+++ wv-trunk/wvText.in	(working copy)
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
     5
@@ -18,20 +18,25 @@
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
     6
 else
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
     7
     which links >/dev/null 2>&1
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
     8
     if [ ${?} -eq "0" ]; then
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
     9
-	USE_DUMP=2
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    10
+		USE_DUMP=2
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    11
     else
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    12
-	which lynx >/dev/null 2>&1
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    13
-	if [ ${?} -eq "0" ]; then
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    14
-	    USE_DUMP=1
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    15
-	fi
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    16
+		which lynx >/dev/null 2>&1
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    17
+		if [ ${?} -eq "0" ]; then
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    18
+			USE_DUMP=1
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    19
+		else
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    20
+			which w3m >/dev/null 2>&1
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    21
+			if [ ${?} -eq "0" ]; then
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    22
+				USE_DUMP=4
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    23
+			fi
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    24
+		fi
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    25
     fi    
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    26
 fi
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    27
 
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    28
 if [ $USE_DUMP -eq "1" ]; then
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    29
-	echo "Could not find required program 'elinks' or 'links'"
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    30
+	echo "Could not find required program 'elinks' or 'links' or 'w3m'"
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    31
 	echo "Using lynx. Ouput will be pretty ugly."
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    32
 elif [ $USE_DUMP -eq "0" ]; then
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    33
-	echo "Could not find required program 'elinks', 'links', or even 'lynx'"
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    34
+	echo "Could not find required program 'elinks', 'links', 'w3m', or even 'lynx'"
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    35
 	echo "Using wvWare -x wvText.xml. Ouput will be pretty bad."
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    36
 fi
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    37
 
492
5c737a73fcd0 2007-09-19 Halton Huo <[email protected]>
nonsea
parents: 489
diff changeset
    38
@@ -54,7 +59,10 @@
489
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    39
 	exit 1
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    40
     fi
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    41
 
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    42
-    if [ $USE_DUMP -eq "3" ]; then
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    43
+    if [ $USE_DUMP -eq "4" ]; then
492
5c737a73fcd0 2007-09-19 Halton Huo <[email protected]>
nonsea
parents: 489
diff changeset
    44
+	# w3m
5c737a73fcd0 2007-09-19 Halton Huo <[email protected]>
nonsea
parents: 489
diff changeset
    45
+	w3m -T text/html -dump "${tmpdir}/${TMP_FILE}" > "${2}"
5c737a73fcd0 2007-09-19 Halton Huo <[email protected]>
nonsea
parents: 489
diff changeset
    46
+    elif [ $USE_DUMP -eq "3" ]; then
489
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    47
 	# elinks does the best
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    48
 	elinks -dump -force-html "${tmpdir}/${TMP_FILE}" > "${2}"
68595c833e01 2007-09-18 Halton Huo <[email protected]>
nonsea
parents:
diff changeset
    49
     elif [ $USE_DUMP -eq "2" ]; then