From: Mark Wooding Date: Thu, 28 Aug 2014 13:55:23 +0000 (+0100) Subject: Merge branch 'master' into distorted X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/mirror-admin/commitdiff_plain/36ed96dfe5eb08b68dfaf8a59691bedb92edf08d?hp=b8bf5b4099828ec24fe3cda6964f5a28d92d01ea Merge branch 'master' into distorted * master: bin/run-mirrors: Command line lists patterns limiting mirrors to run. --- diff --git a/.userv/rc b/.userv/rc index b86f0c0..daff920 100644 --- a/.userv/rc +++ b/.userv/rc @@ -1,7 +1,9 @@ ### -*-conf-*- if ( glob service run - & glob calling-group ftpadmin + & ( glob calling-group ftpadmin + | glob calling-user root + ) ) no-suppress-args execute bin/run-mirrors diff --git a/bin/run-mirrors b/bin/run-mirrors index 34a3733..ed6fb46 100755 --- a/bin/run-mirrors +++ b/bin/run-mirrors @@ -9,8 +9,8 @@ case $(id -un) in esac ## Set up a plausible environment. -HOME=/var/lib/mirror-admin; export HOME; cd -MIRRORS=/mnt/mirrors; export MIRRORS +HOME=/var/lib/mirror; export HOME; cd +MIRRORS=/mnt/ftp/pub/mirrors; export MIRRORS PATH=$HOME/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/usr/local/sbin export PATH umask 002 diff --git a/etc/ftpsync-common.conf b/etc/ftpsync-common.conf index 5af48ee..19cff88 100644 --- a/etc/ftpsync-common.conf +++ b/etc/ftpsync-common.conf @@ -21,7 +21,7 @@ : ${RSYNC_PATH="$LABEL"} ## The host we mirror from -: ${RSYNC_HOST=ftp.de.debian.org} +: ${RSYNC_HOST=ftp.uk.debian.org} ## In case we need a user to access the rsync share at our upstream host : ${RSYNC_USER=} @@ -30,7 +30,7 @@ : ${RSYNC_PASSWORD=} ## Architectures we want to carry. -: ${WANT_ARCH="i386:amd64"} +: ${WANT_ARCH="i386:amd64:armel"} ## Distributions to inspect for available architectures. : ${SEARCH_DISTS="oldstable stable testing unstable experimental"} @@ -83,7 +83,6 @@ ## want. Crazy, no? ARCH_EXCLUDE=$( bin/debian-excludes $RSYNC_HOST $RSYNC_PATH $WANT_ARCH $SEARCH_DISTS - echo source ) ## Do we have leaf mirror to signal we are done and they should sync? diff --git a/etc/ftpsync-debian-security.conf b/etc/ftpsync-debian-security.conf index 17aaf8d..7069fa8 100644 --- a/etc/ftpsync-debian-security.conf +++ b/etc/ftpsync-debian-security.conf @@ -5,7 +5,7 @@ LABEL=debian-security RSYNC_HOST=security.debian.org SEARCH_DISTS=$( - for i in oldstable stable testing; do + for i in stable testing; do echo $i/updates done ) diff --git a/etc/ftpsync-debian.conf b/etc/ftpsync-debian.conf index 3417c94..db7a9fd 100644 --- a/etc/ftpsync-debian.conf +++ b/etc/ftpsync-debian.conf @@ -3,7 +3,7 @@ ### ftpsync configuration for the Debian main archive. LABEL=debian -RSYNC_HOST=ftp.de.debian.org -SEARCH_DISTS="oldstable stable testing unstable experimental" +RSYNC_HOST=ftp.uk.debian.org +SEARCH_DISTS="stable testing unstable experimental" . etc/ftpsync-common.conf diff --git a/etc/logrotate.conf b/etc/logrotate.conf index 601aeb5..ce3c186 100644 --- a/etc/logrotate.conf +++ b/etc/logrotate.conf @@ -2,7 +2,7 @@ ### ### Log rotation configuration for mirrors. -/var/lib/mirror-admin/log/*.log { +/var/lib/mirror/log/*.log { compress rotate 8 notifempty diff --git a/etc/mirror.packages b/etc/mirror.packages index a790722..a3c951c 100644 --- a/etc/mirror.packages +++ b/etc/mirror.packages @@ -24,4 +24,14 @@ package=defaults do_deletes=true max_delete_files=80% +###-------------------------------------------------------------------------- +### Nelson Beebe's BibTeX database archive. + +package=utah-bib + site=ftp.math.utah.edu + remote_dir=/pub/tex/bib/ + local_dir=utah-bib + recursive=false + get_patt=\.bib$ + ###----- That's all, folks -------------------------------------------------- diff --git a/etc/mirrors.d/50-debian b/etc/mirrors.d/50-debian new file mode 100755 index 0000000..c17194d --- /dev/null +++ b/etc/mirrors.d/50-debian @@ -0,0 +1,7 @@ +#! /bin/sh -e +### +### Mirror Debian archives. + +for archive in debian-security debian; do + RSYNC="rsync -4" bin/ftpsync sync:all sync:archive:$archive +done diff --git a/etc/mirrors.d/50-distorted b/etc/mirrors.d/50-distorted new file mode 100755 index 0000000..1a3316e --- /dev/null +++ b/etc/mirrors.d/50-distorted @@ -0,0 +1,13 @@ +#! /bin/sh -e +### +### Mirror `distorted.org.uk' FTP archive from telecaster. + +. lib/functions.sh +cd $MIRRORS + +## Fetch the RFC collection. +standard_rsync "$@" \ + --exclude="/pub/debian/mini-dinstall/" \ + ftp.distorted.org.uk::ftp/pub \ + ftp.distorted.org.uk::ftp/u \ + distorted diff --git a/etc/mirrors.d/50-eprint-bib b/etc/mirrors.d/50-eprint-bib new file mode 100755 index 0000000..8065424 --- /dev/null +++ b/etc/mirrors.d/50-eprint-bib @@ -0,0 +1,42 @@ +#! /bin/bash + +set -e + +## Initial setup. +mkdir -p $MIRRORS/eprint-bib; cd $MIRRORS/eprint-bib +eprint=http://eprint.iacr.org +rm -f list tags + +## Fetch the master index. +curl -sS -o list -z '1 hour ago' $eprint/complete/ +[ -r list ] || exit 0 + +## Pick out the article tags. +sed -n '/^.*$/ s::\1:p' list >tags + +## For each tag, make sure we have the article information. +while read tag; do + dir=${tag%/*} + mkdir -p $dir + file=$dir/eprint-${tag/\//-}.bib + [ -r $file ] || { + curl -sS -o $file.in "$eprint/cgi-bin/cite.pl?entry=$tag" + sed -n " + /^
/,/<\/PRE>/ {
+      /^
/ d
+      s:
.*:: + s%note =.*\$%url = {http://eprint.iacr.org/$tag},% + p + }" $file.in >$file.sed + mv $file.sed $file + rm -f $file.in + echo $tag + } +done eprint.bib.new +mv eprint.bib.new eprint.bib diff --git a/etc/mirrors.d/50-mirror b/etc/mirrors.d/50-mirror new file mode 100755 index 0000000..a65823d --- /dev/null +++ b/etc/mirrors.d/50-mirror @@ -0,0 +1,7 @@ +#! /bin/sh -e +### +### Lee MacLoughlin's mirror scripts. + +here=$(pwd) +cd $MIRRORS +mirror -d "$@" "$here"/etc/mirror.packages diff --git a/etc/mirrors.d/50-rfc b/etc/mirrors.d/50-rfc new file mode 100755 index 0000000..29dcca4 --- /dev/null +++ b/etc/mirrors.d/50-rfc @@ -0,0 +1,29 @@ +#! /bin/sh -e +### +### Mirror RFCs and Internet Drafts from mirrorservice.org + +. lib/functions.sh +cd $MIRRORS + +## Fetch the RFC collection. +standard_rsync "$@" \ + --exclude=/tar/ \ + ftp.rfc-editor.org::rfc-ed-all/ \ + rfc/ + +## Fetch the Internet Draft collection. +standard_rsync "$@" \ + ftp.rfc-editor.org::internet-drafts/ \ + internet-drafts/ + +## Build a usable BibTeX database of RFCs. XSLT runes are by Roland +## Bless, taken from http://www.tm.uka.de/~bless/bibrfcindex.html +mkdir -p rfc-bib +if [ rfc/rfc-index.xml -nt rfc-bib/rfc.bib ]; then + xsltproc $HOME/lib/rfcxmlindex2bibtex.xslt rfc/rfc-index.xml | + sed ' + s/\([_&%#$]\)/\\\1/g + /author=/s/\([^ ]*\) \(3rd\|Jr\.\)/\{\1 \2\}/g + ' >rfc-bib/rfc-bib.new + mv rfc-bib/rfc-bib.new rfc-bib/rfc.bib +fi diff --git a/lib/rfcxmlindex2bibtex.xslt b/lib/rfcxmlindex2bibtex.xslt new file mode 100644 index 0000000..3006969 --- /dev/null +++ b/lib/rfcxmlindex2bibtex.xslt @@ -0,0 +1,233 @@ + + + + + + + + + + + + + @misc + + + +RFC + + + +http://www.ietf.org/rfc/ + + + +Obsoleted by + + + +Updated by + + +STANDARD +DRAFT STANDARD +PROPOSED STANDARD +UNKNOWN +BEST CURRENT PRACTICE +FOR YOUR INFORMATION +EXPERIMENTAL +HISTORIC +INFORMATIONAL + +Standard +Draft Standard +Proposed Standard +Unknown +Best Current Practice +For Your Information +Experimental +Historic +Informational + + + + + + + + + + _ + + + + + + + + + + + + + + {rfc + + , + author=" + + + + + and + + ", + , + series="Request for Comments", + number="", + howpublished="RFC + + + + + + + + + + + + + + + + + + ()", + publisher="IETF", + organisation="Internet Engineering Task Force", + year=, + month=, + + + note=" + + + + + + , + + + + + + ", + url="rfc.txt", +} + + + + + + title="{}" + + + + + title="{ + + + + + + + + + + + + + + + }" + + + + + + + + + + + + + + + + + + + + \ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +day="", + + + + + RFCs + + + + , + + + + + + RFCs + + + + , + + + + +