From adf55c2636dc5cf1fd6bb2b87b97683d2cd9a06a Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Thu, 27 Apr 2017 00:47:02 +0200 Subject: [PATCH] Check YEP 1.7 --- package_check.sh | 14 +++++++++++++- sub_scripts/launcher.sh | 4 ++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/package_check.sh b/package_check.sh index bc309f1..f5016a1 100755 --- a/package_check.sh +++ b/package_check.sh @@ -606,12 +606,24 @@ TEST_RESULTS () { # -> The package can be backup and restore without error if level_can_change 6 then + # Check the YEP 1.7 (https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-17---ajouter-lapp-%C3%A0-lorganisation-yunohost-apps---valid%C3%A9--manuel--official-) + # Default value, YEP 1.7 not checked + YEP17=-1 + if echo "$app_arg" | grep --extended-regexp --quiet "https?:\/\/" + then + # If the app have been picked from github, check if this app was under the YunoHost-Apps organisation + # YEP17 will be equal to 1 if the app was under the YunoHost-Apps organisation + YEP17=$(echo "$app_arg" | grep --count "github.com/YunoHost-Apps/") + [ $YEP17 -eq 1 ] || ECHO_FORMAT "This app doesn't respect the YEP 1.7 ! (https://yunohost.org/#/packaging_apps_guidelines_fr)\n" "red" + fi + # Validated if backup and restore are ok. Or if backup and restore have been not tested but already validated before. if ( [ $RESULT_check_backup -eq 1 ] && \ [ $RESULT_check_restore -eq 1 ] ) || \ ( [ $RESULT_check_backup -ne -1 ] && \ [ $RESULT_check_restore -ne -1 ] && \ - [ "${level[6]}" == "2" ] ) + [ "${level[6]}" == "2" ] ) && \ + [ $YEP17 -ne 0 ] then level[6]=2 else level[6]=0 fi diff --git a/sub_scripts/launcher.sh b/sub_scripts/launcher.sh index 04d3854..cff0719 100755 --- a/sub_scripts/launcher.sh +++ b/sub_scripts/launcher.sh @@ -40,10 +40,10 @@ LXC_START () { # Start the container and log the booting process in $script_dir/lxc_boot.log # Try to start only if the container is not already started if ! is_lxc_running; then - echo "Start the LXC container" | tee --append "$test_result" + echo -n "Start the LXC container" | tee --append "$test_result" sudo lxc-start --name=$lxc_name --daemon --logfile "$script_dir/lxc_boot.log" | tee --append "$test_result" 2>&1 else - echo "A LXC container is already running" | tee --append "$test_result" + echo -n "A LXC container is already running" | tee --append "$test_result" fi # Check during 20 seconds if the container has finished to start.