source: dass-tools/usr/bin/mirror-obs.sh@ 1153

Last change on this file since 1153 was 1093, checked in by joergs, on Sep 7, 2012 at 12:03:56 PM

adapted

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#!/bin/bash
2
3SOURCE_OPENSUSE="ftp5.gwdg.de::pub/opensuse/"
4
5REPOS="repositories/home:/dassit
6"
7
8#
9# disabled repos:
10#
11#distribution/11.2/repo update/11.2 distribution/12.1/repo update/12.1
12
13RSYNC_DELETE="--delete"
14
15#RSYNC_OPTS="-v -rlLptx --safe-links --stats \
16# --exclude=*.src.rpm --exclude=*.nosrc.rpm --exclude=*.spm \
17# --exclude=*.patch.rpm"
18
19RSYNC_OPTS="-v -rlLptx --safe-links --stats"
20
21DEST="/space/installtree/install/download.opensuse.org"
22
23rsync_if_exists()
24{
25 src=$1
26 dest=$2
27
28 rsync -q $src || return 1
29 echo rsync-quelle $src gefunden.
30 [ -d "$dest" ] || return 2
31 rsync $RSYNC_OPTS $RSYNC_DELETE $src ./$dest
32}
33
34# ---------------- mirror openSUSE repositories ------------------------
35FAILED_REPOS=""
36SUCCESSFUL=""
37
38cd $DEST
39
40for DIR in $REPOS
41do
42 SOURCE_DIR=${SOURCE_OPENSUSE}/${DIR}/.
43 DEST_DIR=${DEST}/${DIR}/.
44 mkdir -p ${DEST_DIR}
45 rsync_if_exists "${SOURCE_OPENSUSE}$DIR/" "$DIR"
46 case $? in
47 1) echo Distribution $DIR nicht gefunden
48 FAILED_REPOS="$FAILED_REPOS $DIR"
49 ;;
50 2) echo Zielverzeichnis $(pwd)/$DIR nicht vorhanden
51 FAILED_REPOS="$FAILED_REPOS $DIR"
52 ;;
53 0)
54 SUCCESSFUL="$SUCCESSFUL $DIR"
55 ;;
56 *)
57 echo Fehler $?
58 FAILED_REPOS="$FAILED_REPOS $DIR"
59 ;;
60 esac
61done
62
63# /usr/local/sbin/mirror-report-errors.sh mirror-osb "$SUCCESSFUL" "$FAILED_REPOS"
64#
65# # adapt repository sources
66# for i in `find $DEST/repositories -name "*.repo" -a ! -name "vermkv-*.repo"`; do
67# basename=`basename $i`
68# dirname=`dirname $i`
69# sed "s|http://|http://install.vermkv/freigabe/|" $i > $dirname/vermkv-$basename
70# done
71
Note: See TracBrowser for help on using the repository browser.