source: dass-tools/usr/bin/mirror-osb.sh @ 1091

Last change on this file since 1091 was 1091, checked in by joergs, 9 years ago

initial. from vermkv

  • Property svn:executable set to *
File size: 2.3 KB
Line 
1#!/bin/bash
2
3SOURCE_OPENSUSE="10.7.102.0::pub/opensuse/"
4
5REPOS="distribution/11.2/repo update/11.2 distribution/12.1/repo update/12.1
6repositories/Application:/Geo/openSUSE_11.2
7repositories/Application:/Geo/openSUSE_12.1
8repositories/LibreOffice:/Stable/openSUSE_12.1
9repositories/Virtualization:/VMware/SLE_11_SP1
10repositories/driver:/wireless/12.1-update/
11repositories/home:/dassit
12repositories/home:/dassit:/systemsmanagement:/puppet
13repositories/home:/steffens:/SmartClient:/client
14repositories/home:/steffens:/SmartClient:/server
15repositories/home:/steffens:/lvermgeo:/client
16repositories/home:/steffens:/lvermgeo:/server
17"
18# Folgender Eintrag aus der Variable REPOS entfernt, da auf dem BuildServer geloescht, 28.03.2012 Pruem
19#repositories/home:/steffens:/branches:/openSUSE:/11.2:/Update
20
21#
22# disabled repos:
23#
24# nicht mehr verfügbar
25#   repositories/LibreOffice:/Stable/openSUSE_11.2
26# enthält derzeit keine Pakete
27#   repositories/home:/steffens:/branches:/openSUSE:/11.2
28
29RSYNC_DELETE="--delete"
30
31#RSYNC_OPTS="-v -rlLptx --safe-links --stats \
32#        --exclude=*.src.rpm --exclude=*.nosrc.rpm --exclude=*.spm \
33#        --exclude=*.patch.rpm"
34
35RSYNC_OPTS="-v -rlLptx --safe-links --stats"
36
37DEST="/anlagen/vmlxlamp/repo/download.opensuse.org"
38
39rsync_if_exists()
40{
41        src=$1
42        dest=$2
43
44        rsync -q $src || return 1
45        echo rsync-quelle $src gefunden.
46        [ -d "$dest" ] || return 2
47        rsync $RSYNC_OPTS $RSYNC_DELETE $src ./$dest
48}
49
50# ---------------- mirror openSUSE repositories ------------------------
51FAILED_REPOS=""
52SUCCESSFUL=""
53
54cd $DEST
55
56for DIR in $REPOS
57do
58  SOURCE_DIR=${SOURCE_OPENSUSE}/${DIR}/.
59  DEST_DIR=${DEST}/${DIR}/.
60  mkdir -p ${DEST_DIR}
61  rsync_if_exists  "${SOURCE_OPENSUSE}$DIR/" "$DIR"
62  case $? in
63        1)      echo Distribution $DIR nicht gefunden
64                FAILED_REPOS="$FAILED_REPOS $DIR"
65                ;;
66        2)      echo Zielverzeichnis $(pwd)/$DIR nicht vorhanden
67                FAILED_REPOS="$FAILED_REPOS $DIR"
68                ;;
69        0)
70                SUCCESSFUL="$SUCCESSFUL $DIR"
71                ;;
72        *)
73                echo Fehler $?
74                FAILED_REPOS="$FAILED_REPOS $DIR"
75                ;;
76  esac
77done
78
79/usr/local/sbin/mirror-report-errors.sh mirror-osb "$SUCCESSFUL" "$FAILED_REPOS"
80
81# adapt repository sources
82for i in `find $DEST/repositories -name "*.repo" -a ! -name "vermkv-*.repo"`; do
83        basename=`basename $i`
84        dirname=`dirname $i`
85        sed "s|http://|http://install.vermkv/freigabe/|" $i > $dirname/vermkv-$basename
86done
87
Note: See TracBrowser for help on using the repository browser.