Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 388927
Collapse All | Expand All

(-)/usr/portage/distfiles/ebookmerge-0.9.3 (-13 / +14 lines)
Lines 8-16 Link Here
8
#-----------------------------------------------------------------------
8
#-----------------------------------------------------------------------
9
9
10
NO_ARGS=0 
10
NO_ARGS=0 
11
EBDIR="$HOME/.devhelp/books"
11
EBDIR="$HOME/.local/share/devhelp/books"
12
DOWNDIR="$PWD"
12
DOWNDIR="$PWD"
13
TMPDIR=$(mktemp -d)
13
TMPDIR=$(mktemp -d)
14
BASE_URL="http://htmlhelp.googlecode.com/files/"
14
15
15
# mktemp -d > /tmp/ebookmergetmpdir
16
# mktemp -d > /tmp/ebookmergetmpdir
16
# chmod 666 /tmp/ebookmergetmpdir
17
# chmod 666 /tmp/ebookmergetmpdir
Lines 126-137 Link Here
126
if [ -n "$optl" ] ; then
127
if [ -n "$optl" ] ; then
127
    [ ! -f ${EBDIR}/.urls.ebook ] && eerror "First you must use -r option" && exit 1
128
    [ ! -f ${EBDIR}/.urls.ebook ] && eerror "First you must use -r option" && exit 1
128
129
129
    cat ${EBDIR}/.urls.ebook | awk 'BEGIN { FS="/" } { print $6}' > ${EBDIR}/.list.ebook
130
    cat ${EBDIR}/.urls.ebook | awk 'BEGIN { FS="/" } { print $5}' > ${EBDIR}/.list.ebook
130
    
131
    
131
    ls ${EBDIR} > ${EBDIR}/.installed.ebook
132
    ls ${EBDIR} > ${EBDIR}/.installed.ebook
132
    NUMBER=$(cat ${EBDIR}/.list.ebook | wc -l)
133
    NUMBER=$(cat ${EBDIR}/.list.ebook | wc -l)
133
    
134
    
134
    einfo "List of know eBooks :"
135
    einfo "List of known eBooks :"
135
    cat ${EBDIR}/.list.ebook
136
    cat ${EBDIR}/.list.ebook
136
    
137
    
137
    einfo "Total eBooks : ${BOLD}$NUMBER${NORMAL}"
138
    einfo "Total eBooks : ${BOLD}$NUMBER${NORMAL}"
Lines 141-157 Link Here
141
fi
142
fi
142
143
143
if [ -n "$optr" ] ; then
144
if [ -n "$optr" ] ; then
144
    einfo "Dowloading list from http://htmlhelp.berlios.de..."
145
    einfo "Dowloading list from ${BASE_URL} ..."
145
    cd ${EBDIR}
146
    cd ${EBDIR}
146
    
147
    
147
    if [ -n "$optn" ] ; then
148
    if [ -n "$optn" ] ; then
148
        wget --no-cache -q ftp://ftp.berlios.de/pub/htmlhelp/
149
        wget --no-cache -q -k ${BASE_URL}
149
    else
150
    else
150
        wget -q ftp://ftp.berlios.de/pub/htmlhelp/
151
        wget -q -k ${BASE_URL}
151
    fi
152
    fi
152
  
153
    ## below print field is still 2 for google code, with extra grep
153
    cat index.html | gawk -F\" '{print $2}' | sed -e '1 d' -e '/^[ ]*$/d' -e '/[hc][thl][bmp]$/d' > ${EBDIR}/.urls.ebook
154
    grep tgz list | grep Download | gawk -F\" '{print $2}' | sed -e '/^[ ]*$/d' -e '/[hc][thl][bmp]$/d' > ${EBDIR}/.urls.ebook
154
    rm index.html
155
    rm list
155
   
156
   
156
    einfo "Dowloaded. Use ${BOLD}-l${NORMAL} for a list."
157
    einfo "Dowloaded. Use ${BOLD}-l${NORMAL} for a list."
157
fi
158
fi
Lines 176-184 Link Here
176
    einfo "Dowloading eBook $optd in $DOWNDIR..."
177
    einfo "Dowloading eBook $optd in $DOWNDIR..."
177
    
178
    
178
    if [ -n "$optn" ] ; then
179
    if [ -n "$optn" ] ; then
179
        wget --no-cache -q -c ftp://ftp.berlios.de/pub/htmlhelp/$optd -P$DOWNDIR
180
        wget --no-cache -q -c $BASE_URL/$optd -P$DOWNDIR
180
    else
181
    else
181
        wget -q -c ftp://ftp.berlios.de/pub/htmlhelp/$optd -P$DOWNDIR
182
        wget -q -c $BASE_URL/$optd -P$DOWNDIR
182
    fi
183
    fi
183
184
184
    einfo "Dowloaded."
185
    einfo "Dowloaded."
Lines 207-215 Link Here
207
    einfo "Dowloading eBook $optd in $TMPDIR..."
208
    einfo "Dowloading eBook $optd in $TMPDIR..."
208
209
209
    if [ -n "$optn" ] ; then
210
    if [ -n "$optn" ] ; then
210
        wget --no-cache -q -c ftp://ftp.berlios.de/pub/htmlhelp/$opte -P$TMPDIR
211
        wget --no-cache -q -c $BASE_URL/$opte -P$TMPDIR
211
    else
212
    else
212
        wget -q -c ftp://ftp.berlios.de/pub/htmlhelp/$opte -P$TMPDIR
213
        wget -q -c $BASE_URL/$opte -P$TMPDIR
213
    fi
214
    fi
214
        einfo "Dowloaded."
215
        einfo "Dowloaded."
215
    $0 -i ${TMPDIR}/$opte
216
    $0 -i ${TMPDIR}/$opte

Return to bug 388927