#!/bin/sh Usage() { cat <&2 ; exit 1; } tmpd=$(mktemp -d ); trap "rm -Rf '${tmpd}'" 0 out=${topdir}/ec2-init_${tag}.orig.tar.gz cd ${tmpd} && bzr branch "${topdir}" ./ec2-init-${tag} && tar czf "${out}" ec2-init-${tag}/ --exclude ec2-init-${tag}/.bzr && echo "wrote ${out}"