]> git.decadent.org.uk Git - dak.git/blob - scripts/debian/generate-d-i
generate-d-i: Use "set -u"
[dak.git] / scripts / debian / generate-d-i
1 #!/bin/bash
2
3 # Original written from Jeroen van Wolffelaar <jeroen@debian.org>
4
5 set -e
6 set -u
7
8 export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars
9 . $SCRIPTVARS
10
11 export PAGER=cat
12
13 exec > $webdir/d-i 2>&1
14
15 testing_id=$(psql -t -c "SELECT id FROM suite WHERE suite_name='testing'")
16 testing_pu_id=$(psql -t -c "SELECT id FROM suite WHERE suite_name='testing-proposed-updates'")
17 unstable_id=$(psql -t -c "SELECT id FROM suite WHERE suite_name='unstable'")
18
19 echo "udeb's in testing that don't (anymore) correspond to any testing source:"
20 psql -c "
21   SELECT
22     b.package,
23     b.version,
24     (SELECT arch_string from architecture where b.architecture = architecture.id) as arch,
25     s.source
26   FROM bin_associations ba
27   LEFT JOIN binaries b on (ba.bin = b.id)
28   LEFT JOIN source s on (b.source = s.id)
29   WHERE ba.suite = ${testing_id}
30     AND s.id NOT IN (SELECT source from src_associations WHERE suite = ${testing_id})
31     AND b.type = 'udeb'
32   ORDER BY s.source, b.package, b.architecture;
33   "
34
35 echo "udeb's in unstable that should be in testing too:"
36 psql -c "
37   SELECT
38     b.package,
39     b.version,
40     (SELECT arch_string from architecture where b.architecture = architecture.id) as arch,
41     s.source
42   FROM bin_associations ba
43   LEFT JOIN binaries b on (ba.bin=b.id)
44   LEFT JOIN source s on (b.source=s.id)
45   WHERE ba.suite = ${unstable_id}
46     AND NOT EXISTS (SELECT 1 FROM bin_associations ba2 WHERE ba2.suite = ${testing_id} AND ba2.bin = ba.bin)
47     AND s.id IN (SELECT source from src_associations WHERE suite = ${testing_id})
48     AND b.type = 'udeb'
49     AND b.architecture IN (SELECT architecture FROM suite_architectures WHERE suite = ${testing_id})
50   ORDER BY s.source, b.package, b.architecture;
51   "
52
53 echo "udeb's in t-p-u that should be in testing too:"
54 psql -c "
55   SELECT
56     b.package,
57     b.version,
58     (SELECT arch_string from architecture where b.architecture=architecture.id) as arch,
59     s.source
60   FROM bin_associations ba
61   LEFT JOIN binaries b ON ba.bin = b.id
62   LEFT JOIN source s ON b.source = s.id
63   WHERE ba.suite = ${testing_pu_id}
64     AND NOT EXISTS (SELECT 1 FROM bin_associations ba2 WHERE ba2.suite = ${testing_id} AND ba2.bin = ba.bin)
65     AND s.id IN (SELECT source from src_associations WHERE suite = ${testing_id})
66     AND b.type = 'udeb'
67     AND b.architecture IN (SELECT architecture FROM suite_architectures WHERE suite = ${testing_id})
68   ORDER BY s.source, b.package, b.architecture;
69   "