]> git.deb.at Git - deb/packages.git/blob - cron.d/100syncarchive
Finally fix the new packages rss feed
[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             for part in ${parts}
26             do
27                 echo retrieve Packages $dist/$part/$arch
28                 test -d us/${dist}/${part}/binary-${arch} || mkdir -p us/${dist}/${part}/binary-${arch}
29                 (cd us/${dist}/${part}/binary-${arch} &&
30                     wget -q -N ${ftpsite}/dists/${dist}/${part}/binary-${arch}/Packages.gz)
31             done
32             #FIXME: no Contents files for p-u
33             test ! "$dist" = "experimental" || continue
34             echo retrieve Contents $dist/$arch
35             (cd us/${dist} &&
36                 wget -q -N ${ftpsite}/dists/${dist}/Contents-${arch}.gz)
37         done
38         for part in ${parts}
39         do
40             echo retrieve Sources $dist/$part
41             test -d us/${dist}/${part}/source || mkdir -p us/${dist}/${part}/source
42             (cd us/${dist}/${part}/source &&
43                 wget -q -N ${ftpsite}/dists/${dist}/${part}/source/Sources.gz)
44         done
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         (cd us/${dist} &&
53             rsync -t ${localdir}/dists/${dist}/Release &&
54             rsync -t ${localdir}/dists/${dist}/Release.gpg )
55
56         foo=\$arch_${dist//-/_}
57         for arch in `eval echo $foo`
58         do
59             test ! "$arch" = "kfreebsd-i386" || continue
60             for part in ${parts}
61             do
62                 echo retrieve Packages $dist/$part/$arch
63                 test -d us/${dist}/${part}/binary-${arch} || mkdir -p us/${dist}/${part}/binary-${arch}
64                 rsync -t ${localdir}/dists/${dist}/${part}/binary-${arch}/Packages.gz \
65                     us/${dist}/${part}/binary-${arch}/Packages.gz
66             done
67             #FIXME: no Contents files for p-u
68             test ! "$dist" = "experimental" || continue
69             echo retrieve Contents $dist/$arch
70             rsync -t ${localdir}/dists/${dist}/Contents-${arch}.gz \
71                 us/${dist}/Contents-${arch}.gz
72         done
73         for part in ${parts}
74         do
75             echo retrieve Sources $dist/$part
76             test -d us/${dist}/${part}/source || mkdir -p us/${dist}/${part}/source
77             rsync -t ${localdir}/dists/${dist}/${part}/source/Sources.gz \
78                 us/${dist}/${part}/source/Sources.gz
79         done
80     done
81 fi
82
83 # Non-US archive
84 #
85 for dist in oldstable
86 do
87     foo=\$arch_${dist//-/_}
88     for arch in `eval echo $foo`
89     do
90         for part in ${parts}
91         do
92             echo retrieve Packages $dist/$part/non-US/$arch
93             test -d non-US/${dist}/${part}/binary-${arch} || mkdir -p non-US/${dist}/${part}/binary-${arch}
94             (cd non-US/${dist}/${part}/binary-${arch} &&
95                 wget -q -N ${nonus_ftpsite}/dists/${dist}/non-US/${part}/binary-${arch}/Packages.gz)
96         done
97         #FIXME: no Contents files for p-u
98         echo retrieve Contents $dist/non-US/$arch
99         (cd non-US/${dist} &&
100             wget -q -N ${nonus_ftpsite}/dists/${dist}/non-US/Contents-${arch}.gz)
101     done
102     for part in ${parts}
103     do
104         echo retrieve Sources $dist/$part/non-US
105         test -d non-US/${dist}/${part}/source || mkdir -p non-US/${dist}/${part}/source
106         (cd non-US/${dist}/${part}/source &&
107             wget -q -N ${nonus_ftpsite}/dists/${dist}/non-US/${part}/source/Sources.gz)
108     done
109 done
110
111 # security archive
112 #
113 for dist in oldstable stable testing
114 do
115     foo=\$arch_${dist//-/_}
116     for arch in `eval echo $foo`
117     do
118       for part in ${parts}
119       do
120         echo retrieve Packages $dist/$part/security/$arch
121         test -d security/${dist}/${part}/binary-${arch} || mkdir -p security/${dist}/${part}/binary-${arch}
122         (cd  security/${dist}/${part}/binary-${arch} &&
123             wget -q -N ${security_ftpsite}/dists/${dist}/updates/${part}/binary-${arch}/Packages.gz)
124       done
125     done
126     for part in ${parts}
127     do
128         echo retrieve Sources $dist/$part/security
129         test -d security/${dist}/${part}/source || mkdir -p security/${dist}/${part}/source
130         (cd security/${dist}/${part}/source &&
131             wget -q -N ${security_ftpsite}/dists/${dist}/updates/${part}/source/Sources.gz)
132     done
133 done