Index: usemod2trac/usemod2trac.sh =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ usemod2trac/usemod2trac.sh 2008-01-21 11:34:00.000000000 +0100 @@ -0,0 +1,41 @@ +#!/bin/sh + +# Silly wrapper for usemod2trac to automate exporting of several +# usemod wikis and display some (hopefully) helpful hints. + +indir=$1 +outdir=$2 +converterdir=~/download/usemod2trac + +if [ ! $# -eq 2 ]; then + echo "Usage: $0 usemod_dir empty_trac_output_dir" + exit 1 +fi +if [ ! -d $indir/page ]; then + echo "$1: Not a usemod directory" + exit 1 +fi +if [ ! -d $outdir ]; then + echo "$2: Not a directory" + exit 1 +fi +if [ $(echo $outdir/* | wc -w) -ne 1 ]; then + echo "$2: Output directory not empty" + exit 1 +fi + +cd $2 +echo Exporting usemod pages from $1 to $2... +$converterdir/extract_pages_from_usemod.py $1 +m=$(echo $outdir/*.um | wc -w) +echo Converting $n usemod pages to $2/trac... +for file in *.um; do + echo " $file" + $converterdir/convert_usemod_to_trac.py $file +done + +n=$(echo $outdir/trac/* | wc -w) +echo +echo $n out of $m pages have been converted to trac at $2/trac. +echo They can be imported into trac using the trac-admin tool: +echo $ trac-admin /path/to/projenv wiki load $2/trac