3 # Copyright (c) 2005 Peter Palfrader <peter@palfrader.org>
5 # WARNING: spaces in filenames/paths considered harmful.
7 export SCRIPTVARS=/org/backports.org/dak/config/backports.org/vars
12 for suite in etch lenny; do
13 source="${ftpdir}/dists/${suite}-backports"
14 target="${base}/buildd/dists/${suite}-backports"
16 if ! [ -d "$source" ]; then
17 echo "Source '$source' does not exist or is not a directory or we can't acess it." >&2
20 if ! [ -d "$target" ]; then
21 echo "Target '$target' does not exist or is not a directory or we can't acess it." >&2
25 for file in $( cd "$source" && find . -name 'Packages.gz' -o -name 'Packages' -o -name 'Sources.gz' -o -name 'Sources' -o -name 'Release' ); do
26 basedir=$(dirname "$file")
27 basename=$(basename "$file")
28 targetdir="$target/$basedir"
29 [ -d "$targetdir" ] || mkdir -p "$targetdir"
30 if [ "$basename" = "Release" ]; then
31 cp -a "$source/$file" "$target/$file"
32 echo 'NotAutomatic: yes' >> "$target/$file"
34 cp -a "$source/$file" "$target/$file"
38 # postprocess top level Release file
39 if ! [ -e "$target/Release" ]; then
40 echo "Did not find $target/Release after copying stuff. something's fishy" >&2
47 if (substr($_,0,1) eq " ") {
48 if ($in_sha1 || $in_md5) {
49 ($hash, $size, $file) = @F;
50 $_="",next unless -f $file;
52 (undef,undef,undef,undef,undef,undef,undef,$filesize,
53 undef,undef,undef,undef,undef) = stat($file);
54 if ($size != $filesize) {
56 $hash = `sha1sum "$file" | cut -d " " -f 1`
58 $hash = `md5sum "$file" | cut -d " " -f 1`
61 $_ = sprintf(" %s %16d %s\n", $hash, $filesize, $file);
65 $in_sha1 = ($F[0] eq "SHA1:") ? 1 : 0;
66 $in_md5 = ($F[0] eq "MD5Sum:") ? 1 : 0;
70 rm -f ${base}/buildd/dists/${suite}-backports/Release.gpg
71 gpg --no-options --batch --no-tty --secret-keyring ${base}/s3kr1t/dot-gnupg/secring.gpg --output "Release.gpg" --armor --detach-sign "Release"