view make/do-mirror.sh @ 81:6adf16f10d54

Split up make.sh so it's easier to call subsets of its functionality.
author Rob Landley <rob@landley.net>
date Tue, 23 Oct 2007 18:35:49 -0500
parents
children
line wrap: on
line source

#!/bin/bash

# Mirror various documentation resources from out on the internet

if [ -z "$WEBDIR" ]
then
  echo set WEBDIR
  exit 1
fi

cd "$WEBDIR"
make/mirror.py
cat mirror/ols2002.pdf.gz | gunzip > mirror/ols2002.pdf
if [ -z "$(find mirror/ols2001 -name "*.pdf")" ]
then
  mkdir -p mirror/ols2001 &&
  cd mirror/ols2001 &&
  wget -r -l 1 -nd http://lwn.net/2001/features/OLS/pdf/pdf/ &&
  cd ../..

  [ $? -ne 0 ] && exit 1
fi

if [ -z "$(find ols/2007 -name "*.pdf")" ]
then
  echo "Split ols files"
  mkdir -p ols/{1999,2000,2001,2002,2003,2004,2005,2006,2007} &&
  cp mirror/ols2001/*.pdf ols/2001 &&
  make/splitols.py mirror ols
  [ $? -ne 0 ] && exit 1
fi