#!/bin/bash set -e set -o pipefail if ls *.changes > /dev/null 2> /dev/null; then echo echo ".changes files already exist!" echo -n "Clean repo before building? (y/N) " read -n 1 PRECLEAN echo if [ "$PRECLEAN" == "y" ]; then git clean -f; else exit 1; fi fi echo echo -n "Sign built packages? (y/N) " read -n 1 SIGN echo if [ "$SIGN" == "y" ]; then SIGNARGS=""; else SIGNARGS="-uc -us"; fi for SOURCE in libpiny piny pinyweb pinyadmin pinyconfigs; do (cd "$SOURCE"; debuild $SIGNARGS -tc "$@"); done if which lintian > /dev/null 2> /dev/null; then echo echo -n "Run lintian on packages? (Y/n) " read -n 1 LINTIAN echo if [ "$LINTIAN" != "n" ]; then for CHANGES in *.changes; do echo "$CHANGES"; lintian -I --suppress-tags dir-or-file-in-srv "$CHANGES"; done; fi fi echo echo -n "Install packages on this machine? (y/N) " read -n 1 INSTALL echo if [ "$INSTALL" == "y" ]; then for CHANGES in *.changes; do sudo debi "$CHANGES"; done; fi echo echo -n "Upload packages to debian? (y/N) " read -n 1 PUSH echo if [ "$PUSH" == "y" ]; then dput *.changes; fi echo echo -n "Clean repo? (y/N) " read -n 1 CLEAN echo if [ "$CLEAN" == "y" ]; then git clean -f; fi