summaryrefslogtreecommitdiff
path: root/upload-to-bootstrap
blob: a3a6b34a39f3a266fcb87cdff08000e90290ced6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh

set -e -u

if [ $# -gt 3 ] || ! pkgbase="$1"; then
  >&2 echo 'usage:'
  >&2 echo '  upload-to-bootstrap $pkgbase [$slave [$slave_host]]'
fi
slave_host="${3-nlopc46}"
slave="${2-arch32-bs0}"

tmp_file=$(mktemp 'pkgs.XXXXXXXX.tar' --tmpdir)
trap 'rm -f "${tmp_file}"' EXIT

ssh "${slave_host}" '
  ssh "'"${slave}"'" "
    cd '"$1"';
    tar -c *.pkg.tar.xz{,.sig}
  "
' > \
  "${tmp_file}"

for i in 1 2; do
  ssh bs32mirror$i '
    cd bootstrap/i486/;
    pkgs=$(
      tar -xv | \
        grep "\.xz\$"
    );
    repo-add bootstrap.db.tar.gz ${pkgs}
  ' < \
  "${tmp_file}"
done