1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
--- tools/any2djvu.orig 2011-03-31 00:54:11.000000000 -0700
+++ tools/any2djvu 2011-03-31 00:56:54.000000000 -0700
@@ -1,6 +1,6 @@
-#! /bin/bash -f
+#!/bin/sh
-function copyright()
+copyright()
{
echo "Copyright (C) 2002 David Kreil <D.Kreil@IEEE.Org>"
echo "Modified by Barak A. Pearlmutter <bap@debian.org>"
@@ -8,7 +8,7 @@
echo "Released under the GNU GPL v2, 21-Oct-2002."
}
-function warranty()
+warranty()
{
echo "This program is distributed in the hope that it will be useful,"
echo "but WITHOUT ANY WARRANTY; without even the implied warranty of"
@@ -16,7 +16,7 @@
echo "GNU General Public License for more details."
}
-function disclaimer()
+disclaimer()
{
echo "By using this tool you accept the following disclaimer:"
echo " Because the any2djvu service is free of charge, there is no"
@@ -34,7 +34,7 @@
ocr=1
docformat=2
-function warn()
+warn()
{
echo "Notes:"
echo " - Internet connection is required."
@@ -47,7 +47,7 @@
echo " - This software comes with NO WARRANTY."
}
-function format_help()
+format_help()
{
echo "Codes for the formats of the input documents to use with -f"
echo " 1 - DjVu Document (for verification or OCR)"
@@ -61,7 +61,7 @@
echo " 9 - Scanned Document - Color/Mixed - >400 dpi"
}
-function usage()
+usage()
{
echo "Convert files from .ps/.ps.gz/.pdf to .djvu"
echo "Usage: $0 [options] [url] {filename(s)}"
@@ -117,13 +117,13 @@
fi
# check OCR option
-if [ ! "x$ocr" == x0 ] && [ ! "x$ocr" == x1 ]; then
+if [ ! "x$ocr" = x0 ] && [ ! "x$ocr" = x1 ]; then
echo 'error: -o OCR must be 0 or 1'
exit 2
fi
# if help is requested or docformat is not specified right - show help
-if [ "x$docformat" == x'help' ]; then
+if [ "x$docformat" = x'help' ]; then
format_help
exit 0
fi
@@ -209,7 +209,7 @@
-F ocr=$ocr -F legal=1 "$rurl/$rcgi" \
| eval tee "'$log'" $shellopts
else
- wget $wgetopts -O - "$rurl/$rcgi?urlupload=$lurl/$in$cgiopts" \
+ /usr/bin/fetch $wgetopts -o - "$rurl/$rcgi?urlupload=$lurl/$in$cgiopts" \
| eval tee "'$log'" $shellopts
fi
l=`egrep 'href=djvu/.*\.djvu' "$log"`
@@ -219,7 +219,7 @@
echo "error: something got wrong. check log file"
exit 1
fi
- wget $wgetopts -O "$b.djvu" "$rurl/$l"
+ /usr/bin/fetch $wgetopts -o "$b.djvu" "$rurl/$l"
[ -z "$doclean" ] || rm "$log"
[ -z $silent ] && ls -l "$b.djvu"
|