Misc fixes in scripts

This commit is contained in:
Alexandre Aubin 2019-01-30 18:50:30 +00:00
parent 8ddee56c38
commit 6584a2f830
3 changed files with 10 additions and 11 deletions

View file

@ -12,12 +12,12 @@ source /home/vinaigrette/config/config
function main()
{
if [[ "$(tty)" == "not a tty" ]]
then
echo "You aint in a tty (are you in a 'lxc exec' ?)"
echo "The script can't run because pbuilder won't be happy :|"
exit
fi
#if [[ "$(tty)" == "not a tty" ]]
#then
# echo "You aint in a tty (are you in a 'lxc exec' ?)"
# echo "The script can't run because pbuilder won't be happy :|"
# exit
#fi
for PACKAGE in $PACKAGES;
do

View file

@ -74,7 +74,7 @@ function build_sources()
{
boxed "Building source package of ${PACKAGE} ${VERSION} ..."
sudo pbuilder execute --bindmounts ${ROOT_DIR} --basetgz ${IMG} -- ${BUILD_SOURCES} $PKG_DIR \
pbuilder execute --bindmounts ${ROOT_DIR} --basetgz ${IMG} -- ${BUILD_SOURCES} $PKG_DIR \
|| critical "An error occured while building source package"
[[ -f ${CHANGES_FILE} ]] || critical "An error occured while building source package (no change file available)"

View file

@ -3,8 +3,8 @@
readonly THISSCRIPT=$0
readonly PROJECT=$1
readonly BRANCH=$2
readonly DISTRIB=$3
readonly VERSION=$4
readonly DISTRIB="stretch"
readonly VERSION=$3
readonly TAG=$(echo "debian/$VERSION" | tr '~' '-')
source /home/vinaigrette/config/config
@ -24,7 +24,6 @@ Usage:
Arguments:
<project> moulinette, yunohost, yunohost-admin or SSOwat
<branch> testing or stable
<distrib> stretch (can only build for stretch, no jessie)
<version> x.y.z (ex: 2.6.1)
EOF
@ -38,7 +37,7 @@ function validate_arguments()
{
[[ $PROJECT =~ ^yunohost|yunohost-admin|moulinette|SSOwat$ ]] || critical "Invalid project $PROJECT"
[[ $BRANCH =~ ^testing|stable|unstable$ ]] || critical "Invalid branch $BRANCH"
[[ $DISTRIB =~ ^stretch$ ]]; || critical "Invalid distribution $DISTRIB"
[[ $DISTRIB =~ ^stretch$ ]] || critical "Invalid distribution $DISTRIB"
[[ ! -z "$VERSION" ]] || critical "Invalid version $VERSION"
[[ "$(tty)" != "not a tty" ]] || critical "You aint in a tty (are you in a 'lxc exec' ?) The script can't run because pbuilder won't be happy :|"
}