chiark / gitweb /
fiddling with release script
authorRichard Kettlewell <rjk@terraraq.org.uk>
Sat, 8 Jun 2013 12:26:14 +0000 (13:26 +0100)
committerRichard Kettlewell <rjk@terraraq.org.uk>
Sat, 8 Jun 2013 12:26:14 +0000 (13:26 +0100)
scripts/dist

index e927b5f..d2f3dcd 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/bash
 #
 # This file is part of rsbackup
-# Copyright (C) 2010, 2011 Richard Kettlewell
+# Copyright (C) 2010, 2011, 2013 Richard Kettlewell
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -25,6 +25,8 @@ s() {
   "$@"
 }
 
+hostname=$(uname -n)
+
 # r HOST COMMAND...
 #
 # Echo a command then execute it remotely.
@@ -32,7 +34,17 @@ r() {
   local host=$1
   shift
   echo "$host:" "$@" >&2
-  ssh $host "$@"
+  case "$host" in
+  chroot:* )
+    (
+      cd
+      schroot -pc${host#chroot:} -- bash -c "$@"
+    )
+    ;;
+  * )
+    ssh $host "$@"
+    ;;
+  esac
 }
 
 # build HOST ARCH
@@ -52,19 +64,35 @@ build() {
   echo
   r $host "mkdir -p _builds"
   r $host "cd _builds && rm -rf ${source} ${archive} ${debs}"
-  s scp ${archive} $host:_builds/.
+  case "$host" in
+  chroot:* )
+    cp ${archive} $HOME/_builds/.
+    ;;
+  * )
+    s scp ${archive} $host:_builds/.
+    ;;
+  esac
   r $host "cd _builds && tar xfz ${archive}"
   r $host "cd _builds/${source} && debian/rules build"
   r $host "cd _builds/${source} && fakeroot debian/rules binary"
   for deb in $debs; do
-    s scp $host:_builds/$deb .
-    products="$products $deb"
+    case "$host" in
+    chroot:* )
+      cp $HOME/_builds/$deb products/
+      ;;
+    * )
+      s scp $host:_builds/$deb products/
+      ;;
+    esac
   done
   echo
   echo "Built $debs"
   echo
 }
 
+rm -rf products
+mkdir products
+
 # Build the source archive
 s make -C doc html
 s make distcheck
@@ -78,12 +106,9 @@ archive=${srcpkg}-${version}.tar.gz # tarball
 products="$archive"
 
 # Build .deb files
-s build araminta amd64          # squeeze
-s build sandestin i386          # squeeze
+s build araminta amd64          # wheezy
+s build chroot:wheezy32 i386    # wheezy
 
-rm -rf products
-mkdir products
-cp doc/*.html doc/*.css ${products} products/.
+cp doc/*.html doc/*.css products/.
 mv products//CHANGES.html products/rsbackup-CHANGES.html
-rm -f ${products}
 ls -l products