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