#!/bin/bash
# Definitions
Quelle="/home/sascha/osc/home:saigkill"
Ziel1="/home/sascha/osc/KDE:KDE4:Community"
Ziel2="/home/sascha/osc/openSUSE:Factory:Contrib"
Ziel3="/home/sascha/osc/games"
Ziel4="/home/sascha/osc/home:saigkill:branches:hamradio"
Ziel5="/home/sascha/osc/home:saigkill:branches:network"
Ziel6="/home/sascha/osc/home:saigkill:playground"
Ziel7="/home/sascha/osc/home:saigkill:medical"

# KDE:Community Folder
echo "Entry KDE:Community Folder"

echo "Entry KDE:Community/kpassgen"
cp ${Quelle}/kpassgen/* ${Ziel1}/kpassgen
cd ${Ziel1}/kpassgen
osc ci --message="Updated kpassgen (KDE:KDE4:Community)"
# osc copypac home:saigkill kpassgen KDE:KDE4:Community
echo "Leave KDE:Community/kpassgen"

echo "Entry KDE:Community/freeremoted"
cp ${Quelle}/freeremoted/* ${Ziel1}/freeremoted
cd ${Ziel1}/freeremoted
osc ci --message="Updated freeremoted (KDE:KDE4:Community)"
# osc copypac home:saigkill kpassgen KDE:KDE4:Community
echo "Leave KDE:Community/freeremoted"

echo "Entry KDE:Community/freeremoteq"
cp ${Quelle}/freeremoteq/* ${Ziel1}/freeremoteq
cd ${Ziel1}/freeremoteq
osc ci --message="Updated freeremoteq (KDE:KDE4:Community)"
# osc copypac home:saigkill kpassgen KDE:KDE4:Community
echo "Leave KDE:Community/freeremoteq"

echo "Entry KDE:Community/assuma"
cp ${Quelle}/assuma/* ${Ziel1}/assuma
cd ${Ziel1}/assuma
osc ci --message="Updated assuma (KDE:KDE4:Community)"
# osc copypac home:saigkill assuma KDE:KDE4:Community
echo "Leave KDE:Community/assuma"

echo "Entry KDE:Community/libdbus++"
cp ${Quelle}/libdbus++/* ${Ziel1}/libdbus++
cd ${Ziel1}/libdbus++
osc ci --message="Updated libdbus++ (KDE:KDE4:Community)"
# osc copypac home:saigkill kpassgen KDE:KDE4:Community
echo "Leave KDE:Community/libdbus++"

echo "Entry KDE:Community/libtinyxml"
cp ${Quelle}/libtinyxml/* ${Ziel1}/libtinyxml
cd ${Ziel1}/libtinyxml
osc ci --message="Updated libtinyxml (KDE:KDE4:Community)"
# osc copypac home:saigkill kpassgen KDE:KDE4:Community
echo "Leave KDE:Community/libtinyxml"

echo "Leave KDE:Community Folder"

# openSUSE Contrib Folder
echo "Entry openSUSE:Factory:Contrib Folder"

echo "Entry openSUSE:Factory:Contrib/lynis"
cp ${Quelle}/lynis/* ${Ziel2}/lynis
cd ${Ziel2}/lynis
osc ci --message="Updated lynis (Contrib)"
echo "Leave openSUSE:Factory:Contrib/lynis"

echo "Entry openSUSE:Factory:Contrib/rkhunter"
cp ${Quelle}/rkhunter/* ${Ziel2}/rkhunter
cd ${Ziel2}/rkhunter
osc ci --message="Updated rkhunter (Contrib)"
echo "Leave openSUSE:Factory:Contrib/rkhunter"

echo "Entry openSUSE:Factory:Contrib/python-icalendar"
cp ${Quelle}/python-icalendar/* ${Ziel2}/python-icalendar
cd ${Ziel2}/python-icalendar
osc ci --message="Updated python-icalendar (Contrib)"
echo "Leave openSUSE:Factory:Contrib/python-icalendar"

echo "Entry openSUSE:Factory:Contrib/mountmanager"
cp ${Quelle}/mountmanager/* ${Ziel2}/mountmanager
sed -i -e /%debug_package/d ${Ziel2}/mountmanager/mountmanager.spec
cd ${Ziel2}/mountmanager
osc ci --message="Updated mountmanager (Contrib)"
echo "Leave openSUSE:Factory:Contrib/mountmanager"

echo "Entry openSUSE:Factory:Contrib/bleachbit"
cp ${Quelle}/bleachbit/* ${Ziel2}/bleachbit
cd ${Ziel2}/bleachbit
osc ci --message="Updated bleachbit (Contrib)"
echo "Entry openSUSE:Factory:Contrib/bleachbit"

echo "Entry openSUSE:Factory;Contrib/kpassgen"
cp ${Quelle}/kpassgen/* ${Ziel2}/kpassgen
cd ${Ziel2}/kpassgen
osc ci --message="Updated kpasgen (Contrib)"
echo "Leave openSUSE:Factory:Contrib/kpassgen"

echo "Entry openSUSE:Factory:Contrib/assuma"
cp ${Quelle}/assuma/* ${Ziel2}/assuma
cd ${Ziel2}/assuma
osc ci --message="Updated assuma (Contrib)"
echo "Leave openSUSE:Facoty:Contrib/assuma"

echo "Leave openSUSE:Factory:Contrib"

# openSUSE games Folder
echo "Entry games Folder"

echo "Entry games/dumb"
cp ${Quelle}/dumb/* ${Ziel3}/dumb
cd ${Ziel3}/dumb
osc ci --message="Updated dumb (games)"
echo "Leave games/dumb"

echo "Entry games:kqlives"
cp ${Quelle}/kqlives/* ${Ziel3}/kqlives
cd ${Ziel3}/kqlives
osc ci --message="Updated kqlives (games)"
echo "Leave games:kqlives"

echo "Leave games Folder"

# openSUSE Hamradio Folder
echo "Entry Hamradio"

# cp ${Quelle}/libatlas3/* ${Ziel4}/libatlas3
# cd ${Ziel4}/libatlas3
# osc ci --message="Updated libatlas3 (Hamradio)"

echo "Entry hamradio/necpp"
cp ${Quelle}/necpp/* ${Ziel4}/necpp
cd ${Ziel4}/necpp
osc ci --message="Updated necpp (Hamradio)"
echo "Leave hamradio/necpp"

echo "Entry hamradio/qantenna"
cp ${Quelle}/qantenna/* ${Ziel4}/qantenna
cd ${Ziel4}/qantenna
osc ci --message="Updated qantenna (Hamradio)"
echo "Leave hamradio/qantenna"

echo "Leave Hamradio"

# openSUSE:Factory Folder
echo "Entry openSUSE:Factory (saigkill:branch)"

echo "Entry network (Factory Branch)"
cp ${Quelle}/boinc-client/* ${Ziel5}/boinc-client
cd ${Ziel5}/boinc-client
# osc ci --message="Updated boinc-client (saigkill:branch)"
echo "Leave network (Factory Branch)"

echo "Leave openSUSE:Factory (saigkill:branch)"

echo "Mirroring done..."

logger Mirroring done


