From 23d83ac52c04f58fd8567ec7d08d36b7027ed5c3 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 31 Aug 2017 15:14:12 +0200 Subject: [PATCH] Tweaking ynh-build to handle stretch-unstable branch --- init.sh | 9 ++++++++- ynh-build | 29 +++++++++++++---------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/init.sh b/init.sh index 55ca063..693fa94 100755 --- a/init.sh +++ b/init.sh @@ -15,6 +15,13 @@ git clone https://github.com/yunohost/yunohost-admin git clone https://github.com/yunohost/ssowat git clone https://github.com/yunohost/moulinette +cd yunohost +git symbolic-ref refs/heads/jessie-stable refs/heads/stable +git symbolic-ref refs/heads/jessie-testing refs/heads/testing +git symbolic-ref refs/heads/jessie-unstable refs/heads/unstable +git symbolic-ref refs/heads/stretch-unstable refs/heads/stretch +cd .. + mkdir -p /var/www/repo/debian/conf/ ln -s $VINAIGRETTE_HOME/config/distributions /var/www/repo/debian/conf/distributions @@ -23,7 +30,7 @@ ln -s $VINAIGRETTE_HOME/config/rebuildd.conf /etc/rebuildd/rebuilddrc ln -s $VINAIGRETTE_HOME/images /var/cache/pbuilder/images ln -s /var/cache/pbuilder/result $PBUILDER_RESULTS -cp $VINAIGRETTE_HOME/conf/nginx.conf /etc/nginx/sites-enabled/repo.conf +cp $VINAIGRETTE_HOME/config/nginx.conf /etc/nginx/sites-enabled/repo.conf cat $VINAIGRETTE_HOME/config/keys/$DEBSIGN_KEYID.pub | apt-key add cat $VINAIGRETTE_HOME/config/sources.list > /etc/apt/sources.list.d/vinaigrette.list diff --git a/ynh-build b/ynh-build index e9afc4c..da5a45e 100755 --- a/ynh-build +++ b/ynh-build @@ -7,7 +7,7 @@ source /home/vinaigrette/config/config # ##### # usage() { - echo " + cat << EOF Usage: `basename $0` @@ -16,7 +16,7 @@ Arguments: testing or stable jessie or stretch x.y.z (ex: 2.6.1) -" +EOF } if [[ $1 == "-h" ]]; then @@ -28,36 +28,33 @@ fi # Check user inputs # # ################# # +PROJECT=$1 +BRANCH=$2 +DISTRIB=$3 +VERSION=$4 + ## Project -if [[ $1 =~ ^yunohost|yunohost-admin|moulinette|SSOwat$ ]]; then - PROJECT=$1 -else - echo "Invalid project $1" +if [[ ! $PROJECT =~ ^yunohost|yunohost-admin|moulinette|SSOwat$ ]]; then + echo "Invalid project $PROJECT" usage exit 1 fi ## Branch -if [[ $2 =~ ^testing|stable$ ]]; then - BRANCH=$2 -else - echo "Invalid branch $2" +if [[ ! $BRANCH =~ ^testing|stable$ ]]; then + echo "Invalid branch $BRANCH" usage exit 2 fi # Distribution -if [[ $3 =~ ^jessie|stretch$ ]]; then - DISTRIB=$3 -else - echo "Invalid distribution $3" +if [[ ! $DISTRIB =~ ^jessie|stretch$ ]]; then + echo "Invalid distribution $DISTRIB" usage exit 3 fi # Version -VERSION=$4 -echo $VERSION if [ -z "$VERSION" ]; then echo "Invalid version $VERSION" usage