1 | #!/bin/bash |
---|
2 | |
---|
3 | SOURCE_OPENSUSE="10.7.102.0::pub/opensuse/" |
---|
4 | |
---|
5 | REPOS="distribution/11.2/repo update/11.2 distribution/12.1/repo update/12.1 |
---|
6 | repositories/Application:/Geo/openSUSE_11.2 |
---|
7 | repositories/Application:/Geo/openSUSE_12.1 |
---|
8 | repositories/LibreOffice:/Stable/openSUSE_12.1 |
---|
9 | repositories/Virtualization:/VMware/SLE_11_SP1 |
---|
10 | repositories/driver:/wireless/12.1-update/ |
---|
11 | repositories/home:/dassit |
---|
12 | repositories/home:/dassit:/systemsmanagement:/puppet |
---|
13 | repositories/home:/steffens:/SmartClient:/client |
---|
14 | repositories/home:/steffens:/SmartClient:/server |
---|
15 | repositories/home:/steffens:/lvermgeo:/client |
---|
16 | repositories/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 | |
---|
29 | RSYNC_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 | |
---|
35 | RSYNC_OPTS="-v -rlLptx --safe-links --stats" |
---|
36 | |
---|
37 | DEST="/anlagen/vmlxlamp/repo/download.opensuse.org" |
---|
38 | |
---|
39 | rsync_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 ------------------------ |
---|
51 | FAILED_REPOS="" |
---|
52 | SUCCESSFUL="" |
---|
53 | |
---|
54 | cd $DEST |
---|
55 | |
---|
56 | for DIR in $REPOS |
---|
57 | do |
---|
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 |
---|
77 | done |
---|
78 | |
---|
79 | /usr/local/sbin/mirror-report-errors.sh mirror-osb "$SUCCESSFUL" "$FAILED_REPOS" |
---|
80 | |
---|
81 | # adapt repository sources |
---|
82 | for 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 |
---|
86 | done |
---|
87 | |
---|