]> git.deb.at Git - deb/packages.git/blob - cron.d/100syncarchive
Remove aboot email override
[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 -q -N ${ftpsite}/dists/${dist}/Release &&
19             wget -q -N ${ftpsite}/dists/${dist}/Release.gpg )
20         
21         foo=\$arch_${dist//-/_}
22         for arch in `eval echo $foo`
23         do
24             test ! "$arch" = "kfreebsd-i386" || continue
25             test ! "$arch" = "kfreebsd-amd64" || continue
26             test ! "$arch" = "armel" || continue
27             for part in ${parts}
28             do
29                 echo retrieve Packages $dist/$part/$arch
30                 test -d us/${dist}/${part}/binary-${arch} || mkdir -p us/${dist}/${part}/binary-${arch}
31                 (cd us/${dist}/${part}/binary-${arch} &&
32                     wget -q -N ${ftpsite}/dists/${dist}/${part}/binary-${arch}/Packages.gz)
33             done
34             #FIXME: no Contents files for p-u
35             test ! "$dist" = "experimental" || continue
36             echo retrieve Contents $dist/$arch
37             (cd us/${dist} &&
38                 wget -q -N ${ftpsite}/dists/${dist}/Contents-${arch}.gz)
39         done
40         for part in ${parts}
41         do
42             echo retrieve Sources $dist/$part
43             test -d us/${dist}/${part}/source || mkdir -p us/${dist}/${part}/source
44             (cd us/${dist}/${part}/source &&
45                 wget -q -N ${ftpsite}/dists/${dist}/${part}/source/Sources.gz)
46         done
47     done
48 else
49     echo using local mirror
50     for dist in $dists
51     do
52         echo "retrieve Releases(.gpg) $dist"
53         test -d us/${dist} || mkdir -p us/${dist}
54         rsync -t ${localdir}/dists/${dist}/Release us/${dist}/Release
55         rsync -t ${localdir}/dists/${dist}/Release.gpg us/${dist}/Release.gpg
56
57         foo=\$arch_${dist//-/_}
58         for arch in `eval echo $foo`
59         do
60             test ! "$arch" = "kfreebsd-i386" || continue
61             test ! "$arch" = "kfreebsd-amd64" || continue
62             test ! "$arch" = "armel" || continue
63             for part in ${parts}
64             do
65                 echo retrieve Packages $dist/$part/$arch
66                 test -d us/${dist}/${part}/binary-${arch} || mkdir -p us/${dist}/${part}/binary-${arch}
67                 rsync -t ${localdir}/dists/${dist}/${part}/binary-${arch}/Packages.gz \
68                     us/${dist}/${part}/binary-${arch}/Packages.gz
69             done
70             #FIXME: no Contents files for p-u
71             test ! "$dist" = "experimental" || continue
72             echo retrieve Contents $dist/$arch
73             rsync -t ${localdir}/dists/${dist}/Contents-${arch}.gz \
74                 us/${dist}/Contents-${arch}.gz
75         done
76         for part in ${parts}
77         do
78             echo retrieve Sources $dist/$part
79             test -d us/${dist}/${part}/source || mkdir -p us/${dist}/${part}/source
80             rsync -t ${localdir}/dists/${dist}/${part}/source/Sources.gz \
81                 us/${dist}/${part}/source/Sources.gz
82         done
83     done
84 fi
85
86 # security archive
87 #
88 for dist in sarge etch lenny
89 do
90     echo "retrieve Release(.gpg) $dist"
91     test -d security/${dist} || mkdir -p security/${dist}
92     (cd security/${dist} &&
93         wget -q -N ${security_ftpsite}/dists/${dist}/updates/Release &&
94         wget -q -N ${security_ftpsite}/dists/${dist}/updates/Release.gpg )
95         
96     foo=\$arch_${dist//-/_}
97     for arch in `eval echo $foo`
98     do
99       for part in ${parts}
100       do
101         echo retrieve Packages $dist/$part/security/$arch
102         test -d security/${dist}/${part}/binary-${arch} || mkdir -p security/${dist}/${part}/binary-${arch}
103         (cd  security/${dist}/${part}/binary-${arch} &&
104             wget -q -N ${security_ftpsite}/dists/${dist}/updates/${part}/binary-${arch}/Packages.gz)
105       done
106     done
107     for part in ${parts}
108     do
109         echo retrieve Sources $dist/$part/security
110         test -d security/${dist}/${part}/source || mkdir -p security/${dist}/${part}/source
111         (cd security/${dist}/${part}/source &&
112             wget -q -N ${security_ftpsite}/dists/${dist}/updates/${part}/source/Sources.gz)
113     done
114 done