]> git.decadent.org.uk Git - dak.git/blob - setup/core-init.d/060_archive
Merge remote-tracking branch 'jcristau/cs-set-log-suite'
[dak.git] / setup / core-init.d / 060_archive
1 #!/bin/sh
2
3 set -e
4 set -u
5
6 POOLPATH="${DAKBASE}/ftp/pool/"
7
8 echo "Setting up archive and locations"
9 psql -c "INSERT INTO archive (name, origin_server, description)
10                       VALUES ('${DAKHOST}', '${DAKFQDN}', 'Master server')" >/dev/null
11
12 for component in main contrib non-free; do
13     psql -c "INSERT INTO location (path, type, component, archive)
14                           VALUES ('${POOLPATH}', 'pool',
15                                   (SELECT id FROM component WHERE name = '${component}'),
16                                   (SELECT id FROM archive WHERE name = '${DAKHOST}'))" >/dev/null
17 done