]> git.deb.at Git - deb/packages.git/blob - cron.d/100syncarchive
Hardy release
[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             echo retrieve Contents $dist/$arch
32             (cd us/${dist} &&
33                 $wget_cmd -N ${ftpsite}/dists/${dist}/Contents-${arch}.gz)
34         done
35         for part in ${parts}
36         do
37             echo retrieve Sources $dist/$part
38             test -d us/${dist}/${part}/source || mkdir -p us/${dist}/${part}/source
39             (cd us/${dist}/${part}/source &&
40                 $wget_cmd -N ${ftpsite}/dists/${dist}/${part}/source/Sources.gz)
41         done
42     done
43 else
44     echo using local mirror
45     for dist in $dists
46     do
47         echo "retrieve Releases(.gpg) $dist"
48         test -d us/${dist} || mkdir -p us/${dist}
49         rsync -t ${localdir}/dists/${dist}/Release us/${dist}/Release
50         rsync -t ${localdir}/dists/${dist}/Release.gpg us/${dist}/Release.gpg
51
52         foo=\$arch_${dist//-/_}
53         for arch in `eval echo $foo`
54         do
55             for part in ${parts}
56             do
57                 echo retrieve Packages $dist/$part/$arch
58                 test -d us/${dist}/${part}/binary-${arch} || mkdir -p us/${dist}/${part}/binary-${arch}
59                 rsync -t ${localdir}/dists/${dist}/${part}/binary-${arch}/Packages.gz \
60                     us/${dist}/${part}/binary-${arch}/Packages.gz
61             done
62             echo retrieve Contents $dist/$arch
63             rsync -t ${localdir}/dists/${dist}/Contents-${arch}.gz \
64                 us/${dist}/Contents-${arch}.gz
65         done
66         for part in ${parts}
67         do
68             echo retrieve Sources $dist/$part
69             test -d us/${dist}/${part}/source || mkdir -p us/${dist}/${part}/source
70             rsync -t ${localdir}/dists/${dist}/${part}/source/Sources.gz \
71                 us/${dist}/${part}/source/Sources.gz
72         done
73     done
74 fi
75
76 # security archive
77 #
78 for dist in $dists
79 do
80     echo "retrieve Release(.gpg) $dist"
81     test -d security/${dist} || mkdir -p security/${dist}
82     (cd security/${dist} &&
83         $wget_cmd -N ${security_ftpsite}/dists/${dist}-security/Release &&
84         $wget_cmd -N ${security_ftpsite}/dists/${dist}-security/Release.gpg )
85         
86     foo=\$arch_${dist//-/_}
87     for arch in `eval echo $foo`
88     do
89       for part in ${parts}
90       do
91         echo retrieve Packages $dist-security/$part/$arch
92         test -d security/${dist}/${part}/binary-${arch} || mkdir -p security/${dist}/${part}/binary-${arch}
93         (cd  security/${dist}/${part}/binary-${arch} &&
94             $wget_cmd -N ${security_ftpsite}/dists/${dist}-security/${part}/binary-${arch}/Packages.gz)
95       done
96     done
97     for part in ${parts}
98     do
99         echo retrieve Sources $dist/$part/security
100         test -d security/${dist}/${part}/source || mkdir -p security/${dist}/${part}/source
101         (cd security/${dist}/${part}/source &&
102             $wget_cmd -N ${security_ftpsite}/dists/${dist}-security/${part}/source/Sources.gz)
103     done
104 done