File: update-package.sh

package info (click to toggle)
doc-rfc 20120225-2
  • links: PTS, VCS
  • area: non-free
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 461,380 kB
  • ctags: 166
  • sloc: xml: 204,780; perl: 240; sh: 59; makefile: 10
file content (53 lines) | stat: -rwxr-xr-x 1,568 bytes parent folder | download | duplicates (2)
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
#! /bin/bash

set -e

me=${0%.sh}
me=${me##*/}

(

mkdir -p tmp
cd tmp

rsync --progress -vzrltD --partial --stats \
    ftp.rfc-editor.org::rfc-ed-all/tar/RFC-all.tar.gz .

rsync --progress -vzrltD --partial --stats \
    ftp.rfc-editor.org::rfcs/rfc-index.txt ::rfc-index.xml .

date="$( env - ls -l --full RFC-all.tar.gz | \
         awk '{ print $6, " ", $7, " ", $8; }' | sed 's/\.000*//' )"
date2=$( date -u -d "$date" "+%Y%m%d" )

touch -d "$date" $date2

ln -sf RFC-all.tar.gz doc-rfc_${date2}.orig.tar.gz

URLS="
http://www.rfc-editor.org/categories/rfc-best.html
http://www.rfc-editor.org/categories/rfc-draft.html
http://www.rfc-editor.org/categories/rfc-experimental.html
http://www.rfc-editor.org/categories/rfc-fyi.html
http://www.rfc-editor.org/categories/rfc-historic.html
http://www.rfc-editor.org/categories/rfc-informational.html
http://www.rfc-editor.org/categories/rfc-proposed.html
http://www.rfc-editor.org/categories/rfc-standard.html
http://www.rfc-editor.org/categories/rfc-unknown.html
http://www.rfc-editor.org/queue.html
http://www.rfc-editor.org/rfcxx00.html
http://www.rfc-editor.org/rfcxx00.txt
http://www.rfc-editor.org/
"
wget -N $URLS

# Extract the links to the actual drafts and save their filenames
grep '^[0-9][0-9][0-9][0-9][/-][0-9][0-9][/-][0-9][0-9]' queue.html | \
    sed -re 's|.*<a href="[^">]+">([^<]+)</a>|\1|' > $me.include

# and now sync the respective files
rsync --progress -vzrltD --partial --stats \
    --include-from $me.include --exclude '*' \
    ftp.rfc-editor.org::internet-drafts/ .

) 2>&1 | tee $me.log