#!/bin/bash
# vim:set sw=4 ts=4:
#
#############################################################################
#
# ALICE
# Automatic Linux Installation and Configuration Environment
#
# Copyright (c) 2000-2002 SuSE Linux Solutions AG, Eschborn, Germany
#               2002-2004 SuSE Linux AG, Eschborn, Germany
#               2005           SUSE GmbH, Nuernberg, Germany
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#############################################################################
#
# Author: 
#
#	 make_pkg_dirs

DOCROOT=/srv/www/htdocs/inst
IDIR=/space
STDR=streams
DIR1="mediasets"
DIR2="patches mirror"
PROD="SuSE-SLES SUSE-SLES SUSE-CORE UnitedLinux"
SPCK="UnitedLinux-1.0-Service-Pack"
ARCH="i386 x86_64 ia64"

cd $DOCROOT
mkdir -p $STDR

for d in $DIR1; do
	ln -s $IDIR/$d
	for p in $PROD $SPCK; do
		for a in $ARCH; do
			mkdir -p $d/$p
			case $p in
				SuSE-SLES)
				for v in 7 8; do
					mkdir -p $d/$p/$v/$a/CD1
				done
				;;
				UnitedLinux)
				for c in CD1 CD2 CD3; do
					mkdir -p $d/$p/1.0/$a/$c
				done
				;;
				UnitedLinux-1.0-Service-Pack)
				for v in 2a 3 4 5; do
					for c in CD1 CD2; do
						mkdir -p $d/$p/$v/$a/$c
					done
				done
				;;
				SUSE-SLES)
				for v in 9; do
					mkdir -p $d/$p/$v/$a/CD1
				done
				;;
				SUSE-CORE)
				for v in 9; do
					for c in CD1 CD2 CD3 CD4 CD5; do
						mkdir -p $d/$p/$v/$a/$c
					done
				done
				;;
			esac
		done
	done
done

for d in $DIR2; do
	ln -s $IDIR/$d
	for a in $ARCH; do
		mkdir -p $d/$a
		case $d in
			mirror)
			mkdir -p $d/$a/update
			for p in $PROD; do
				#mkdir -p $d/$a/update/$p
				for s in scripts rpm patches; do
				case $p in
					SuSE-SLES)
					for v in 7 8; do
						mkdir -p $d/$a/update/$p/$v/$s
					done
					;;
					SUSE-SLES)
					for v in 9; do
						mkdir -p $d/$a/update/$p/$v/$s
					done
					;;
				esac
				done
			done
			;;
			patches)
			;;
		esac
	done
done

#
