File: update-package.sh

package info (click to toggle)
doc-rfc 20170121-1
  • links: PTS, VCS
  • area: non-free
  • in suites: stretch
  • size: 541,932 kB
  • ctags: 32
  • sloc: xml: 267,963; sh: 101; python: 90; perl: 42; makefile: 13
file content (42 lines) | stat: -rwxr-xr-x 956 bytes parent folder | download
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
#! /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/queue2.xml
http://www.rfc-editor.org/queue.html
http://www.rfc-editor.org/
"
wget -N $URLS

# Extract the links to the actual drafts and save their filenames
python ../debian/parsequeue.py queue2.xml > $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