Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > cffa7e52474afabc794a42260ccf9f48 > files > 20

apache-mod_mbox-0.2-1.r670198.5mdv2010.1.x86_64.rpm

#!/bin/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 private 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