Mercurial > hg > lukkari
comparison update.sh @ 82:c553ad61e9c2
Make original data links work for both current and next period mode.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 24 Oct 2012 12:24:48 +0300 |
parents | d1b65d9903ab |
children | acb600abc0c7 |
comparison
equal
deleted
inserted
replaced
81:8501f1b9bba3 | 82:c553ad61e9c2 |
---|---|
13 # Create cache directories, if they do not exist | 13 # Create cache directories, if they do not exist |
14 OLDCACHEDIR="${CACHEDIR}old/" | 14 OLDCACHEDIR="${CACHEDIR}old/" |
15 createdir "${OLDCACHEDIR}" | 15 createdir "${OLDCACHEDIR}" |
16 createdir "${CACHEDIR}" | 16 createdir "${CACHEDIR}" |
17 | 17 |
18 | |
19 URLPREFIX="$1" | 18 URLPREFIX="$1" |
20 CLASSFILE="$2" | 19 CLASSFILE="$2" |
21 LISTFILE="$2.tmp" | 20 LISTFILE="$2.tmp" |
22 PATPREFIX="$3" | 21 PATPREFIX="$3" |
22 | |
23 echo "<? \$origBaseURI = \"${URLPREFIX}${PATPREFIX}\"; \$origBaseExt = \".htm\"; ?>" > "${CACHEDIR}baseuri.data"; | |
23 | 24 |
24 if wget -q -O "$LISTFILE" "$URLPREFIX"; then | 25 if wget -q -O "$LISTFILE" "$URLPREFIX"; then |
25 perl -ne "if (/<a href=\"${PATPREFIX}([A-Z]{3}\d\S+)${URLSUFFIX}\">/) { print \"\$1\n\"; }" < "$LISTFILE" > "$CLASSFILE" | 26 perl -ne "if (/<a href=\"${PATPREFIX}([A-Z]{3}\d\S+)${URLSUFFIX}\">/) { print \"\$1\n\"; }" < "$LISTFILE" > "$CLASSFILE" |
26 echo -n "* Fetched classfile $CLASSFILE: " | 27 echo -n "* Fetched classfile $CLASSFILE: " |
27 cat "$CLASSFILE" | wc -l | 28 cat "$CLASSFILE" | wc -l |