]> git.deb.at Git - deb/packages.git/blob - cron.d/100syncarchive
Replace few tabs by spaces
[deb/packages.git] / cron.d / 100syncarchive
1 #! /bin/bash
2
3 . `dirname $0`/../config.sh
4
5 test -d ${archivedir} || mkdir -p ${archivedir}
6 cd ${archivedir}
7
8 # Main archive
9 #
10 if [ -z "${localdir}" ]
11 then
12     echo using remote mirror
13     for dist in $dists
14     do
15         echo "retrieve Release(.gpg) $dist"
16         test -d us/${dist} || mkdir -p us/${dist}
17         (cd us/${dist} &&
18             $wget_cmd -N ${ftpsite}/dists/${dist}/Release &&
19             $wget_cmd -N ${ftpsite}/dists/${dist}/Release.gpg )
20         
21         foo=\$arch_${dist//-/_}
22         for arch in `eval echo $foo`
23         do
24             for part in ${parts}
25             do
26                 echo retrieve Packages $dist/$part/$arch
27                 test -d us/${dist}/${part}/binary-${arch} || mkdir -p us/${dist}/${part}/binary-${arch}
28                 (cd us/${dist}/${part}/binary-${arch} &&
29                     $wget_cmd -N ${ftpsite}/dists/${dist}/${part}/binary-${arch}/Packages.gz)
30             done
31             #FIXME: no Contents files for p-u
32             echo retrieve Contents $dist/$arch
33             (cd us/${dist} &&
34                 $wget_cmd -N ${ftpsite}/dists/${dist}/Contents-${arch}.gz)
35         done
36         for part in ${parts}
37         do
38             echo retrieve Sources $dist/$part
39             test -d us/${dist}/${part}/source || mkdir -p us/${dist}/${part}/source
40             (cd us/${dist}/${part}/source &&
41                 $wget_cmd -N ${ftpsite}/dists/${dist}/${part}/source/Sources.gz)
42         done
43
44         $check_release_cmd $archivedir/us/${dist}/Release
45     done
46 else
47     echo using local mirror
48     for dist in $dists
49     do
50         echo "retrieve Releases(.gpg) $dist"
51         test -d us/${dist} || mkdir -p us/${dist}
52         rsync -t ${localdir}/dists/${dist}/Release us/${dist}/Release
53         rsync -t ${localdir}/dists/${dist}/Release.gpg us/${dist}/Release.gpg
54
55         foo=\$arch_${dist//-/_}
56         for arch in `eval echo $foo`
57         do
58             for part in ${parts}
59             do
60                 echo retrieve Packages $dist/$part/$arch
61                 test -d us/${dist}/${part}/binary-${arch} || mkdir -p us/${dist}/${part}/binary-${arch}
62                 rsync -t ${localdir}/dists/${dist}/${part}/binary-${arch}/Packages.gz \
63                     us/${dist}/${part}/binary-${arch}/Packages.gz
64             done
65             #FIXME: no Contents files for p-u
66             echo retrieve Contents $dist/$arch
67             rsync -t ${localdir}/dists/${dist}/Contents-${arch}.gz \
68                 us/${dist}/Contents-${arch}.gz
69         done
70         for part in ${parts}
71         do
72             echo retrieve Sources $dist/$part
73             test -d us/${dist}/${part}/source || mkdir -p us/${dist}/${part}/source
74             rsync -t ${localdir}/dists/${dist}/${part}/source/Sources.gz \
75                 us/${dist}/${part}/source/Sources.gz
76         done
77
78         $check_release_cmd $archivedir/us/${dist}/Release
79     done
80 fi
81
82 # security archive
83 #
84 for dist in etch lenny
85 do
86     echo "retrieve Release(.gpg) $dist"
87     test -d security/${dist} || mkdir -p security/${dist}
88     (cd security/${dist} &&
89         $wget_cmd -N ${security_ftpsite}/dists/${dist}/updates/Release &&
90         $wget_cmd -N ${security_ftpsite}/dists/${dist}/updates/Release.gpg )
91         
92     foo=\$arch_${dist//-/_}
93     for arch in `eval echo $foo`
94     do
95       for part in ${parts}
96       do
97         echo retrieve Packages $dist/$part/security/$arch
98         test -d security/${dist}/${part}/binary-${arch} || mkdir -p security/${dist}/${part}/binary-${arch}
99         (cd  security/${dist}/${part}/binary-${arch} &&
100             $wget_cmd -N ${security_ftpsite}/dists/${dist}/updates/${part}/binary-${arch}/Packages.gz)
101       done
102     done
103     for part in ${parts}
104     do
105         echo retrieve Sources $dist/$part/security
106         test -d security/${dist}/${part}/source || mkdir -p security/${dist}/${part}/source
107         (cd security/${dist}/${part}/source &&
108             $wget_cmd -N ${security_ftpsite}/dists/${dist}/updates/${part}/source/Sources.gz)
109     done
110
111     $check_release_cmd $archivedir/security/${dist}/Release
112 done