#!/usr/bin/env zsh # You need to run this file and place it as mbox-archives.list and all will # be well. if [ -z $1 ] ; then prefix=`pwd` else prefix=$1 fi lists=() entries=() setopt GLOB NULL_GLOB EXTENDED_GLOB echo "# This file is automatically generated by create-archive-list! " for i in $prefix/* ; do if [ ! -d $i ] ; then continue; fi if [[ $i == "$prefix/apachecon.com" ]]; then continue; fi for j in $i/*/ ; do loc=`echo $j | sed "s#$prefix/##g"` first=`echo $loc | cut -f 1 -d / - | cut -f 1 -d - - | sed -e s/.apache.org//g` second=`echo $loc | cut -f 2 -d / -` dirname="$first-$second" entry_name=`echo $dirname | sed "s#-#_#g"` entry="$entry_name=($dirname rsync minotaur.apache.org::public-arch/$loc $j)" lists=($lists $entry_name) entries=($entries $entry) done done echo "ARCHIVES=(" for i in ${lists}; do echo ${i} done echo ")" echo 'set -A ${ARCHIVES}' echo 'export ARCHIVES' for i in ${entries}; do echo ${i} done #for i in ${lists}; do # echo "export ${i}" #done