summaryrefslogtreecommitdiff
blob: 6895c8ad584a987c808f8cca67eaf6ffeb6a038d (plain)
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
--- /usr/portage/distfiles/ebookmerge-0.9.3	2006-10-13 05:08:02.000000000 -0700
+++ ebookmerge-0.9.3	2011-10-29 18:56:39.000000000 -0700
@@ -8,9 +8,10 @@
 #-----------------------------------------------------------------------
 
 NO_ARGS=0 
-EBDIR="$HOME/.devhelp/books"
+EBDIR="$HOME/.local/share/devhelp/books"
 DOWNDIR="$PWD"
 TMPDIR=$(mktemp -d)
+BASE_URL="http://htmlhelp.googlecode.com/files/"
 
 # mktemp -d > /tmp/ebookmergetmpdir
 # chmod 666 /tmp/ebookmergetmpdir
@@ -126,12 +127,12 @@
 if [ -n "$optl" ] ; then
     [ ! -f ${EBDIR}/.urls.ebook ] && eerror "First you must use -r option" && exit 1
 
-    cat ${EBDIR}/.urls.ebook | awk 'BEGIN { FS="/" } { print $6}' > ${EBDIR}/.list.ebook
+    cat ${EBDIR}/.urls.ebook | awk 'BEGIN { FS="/" } { print $5}' > ${EBDIR}/.list.ebook
     
     ls ${EBDIR} > ${EBDIR}/.installed.ebook
     NUMBER=$(cat ${EBDIR}/.list.ebook | wc -l)
     
-    einfo "List of know eBooks :"
+    einfo "List of known eBooks :"
     cat ${EBDIR}/.list.ebook
     
     einfo "Total eBooks : ${BOLD}$NUMBER${NORMAL}"
@@ -141,17 +142,17 @@
 fi
 
 if [ -n "$optr" ] ; then
-    einfo "Dowloading list from http://htmlhelp.berlios.de..."
+    einfo "Dowloading list from ${BASE_URL} ..."
     cd ${EBDIR}
     
     if [ -n "$optn" ] ; then
-        wget --no-cache -q ftp://ftp.berlios.de/pub/htmlhelp/
+        wget --no-cache -q -k ${BASE_URL}
     else
-        wget -q ftp://ftp.berlios.de/pub/htmlhelp/
+        wget -q -k ${BASE_URL}
     fi
-  
-    cat index.html | gawk -F\" '{print $2}' | sed -e '1 d' -e '/^[ ]*$/d' -e '/[hc][thl][bmp]$/d' > ${EBDIR}/.urls.ebook
-    rm index.html
+    ## below print field is still 2 for google code, with extra grep
+    grep tgz list | grep Download | gawk -F\" '{print $2}' | sed -e '/^[ ]*$/d' -e '/[hc][thl][bmp]$/d' > ${EBDIR}/.urls.ebook
+    rm list
    
     einfo "Dowloaded. Use ${BOLD}-l${NORMAL} for a list."
 fi
@@ -176,9 +177,9 @@
     einfo "Dowloading eBook $optd in $DOWNDIR..."
     
     if [ -n "$optn" ] ; then
-        wget --no-cache -q -c ftp://ftp.berlios.de/pub/htmlhelp/$optd -P$DOWNDIR
+        wget --no-cache -q -c $BASE_URL/$optd -P$DOWNDIR
     else
-        wget -q -c ftp://ftp.berlios.de/pub/htmlhelp/$optd -P$DOWNDIR
+        wget -q -c $BASE_URL/$optd -P$DOWNDIR
     fi
 
     einfo "Dowloaded."
@@ -207,9 +208,9 @@
     einfo "Dowloading eBook $optd in $TMPDIR..."
 
     if [ -n "$optn" ] ; then
-        wget --no-cache -q -c ftp://ftp.berlios.de/pub/htmlhelp/$opte -P$TMPDIR
+        wget --no-cache -q -c $BASE_URL/$opte -P$TMPDIR
     else
-        wget -q -c ftp://ftp.berlios.de/pub/htmlhelp/$opte -P$TMPDIR
+        wget -q -c $BASE_URL/$opte -P$TMPDIR
     fi
         einfo "Dowloaded."
     $0 -i ${TMPDIR}/$opte