diff options
author | nachoparker <nacho@ownyourbits.com> | 2019-01-09 07:04:30 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2019-01-09 08:43:15 +0300 |
commit | f1d348e961e830a98939b86280825d6b8cf50fc2 (patch) | |
tree | f4c97b97f06ee464542ffa6f42d3cf09cae27c4d /bin/ncp-update-nc | |
parent | 5bf8492bf012ebea3a2282af5831c15ea67e238e (diff) |
Revert "nc-update-nc: check app compatibility before before executing NC update (#682)"
This reverts commit 7ead0f0ad40ca48d803b848932ef95c1a6bf2d3a.
Diffstat (limited to 'bin/ncp-update-nc')
-rwxr-xr-x | bin/ncp-update-nc | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/bin/ncp-update-nc b/bin/ncp-update-nc index 53944fdc..273f568a 100755 --- a/bin/ncp-update-nc +++ b/bin/ncp-update-nc @@ -61,61 +61,6 @@ echo "Current Nextcloud version $CURRENT" echo "Available Nextcloud version $VER" [[ "$NEED_UPDATE" == "true" ]] || { echo "Nothing to update"; exit 1; } - -# app compatibility check -########################## - -incompatibleApps="" - -#for a in a b c; do echo $a; done -for jsonWord in $(ncc app:list --output="json_pretty" | grep \"disabled\": -B5000 | grep " ") -do - appQuoteStripped=${jsonWord//\"} - app=${appQuoteStripped//:} - - # if line ends in ':' and app directory exist -> app is valid; else skip current app - [[ -z "${appQuoteStripped##*:}" && -d "/var/www/nextcloud/apps/$app" ]] || continue - - appDir=nextcloud/apps/$app - appInfoPath=$appDir/appinfo/info.xml - [[ -f "$appInfoPath" ]] || { echo "ERROR: info.xml not found for $app (searching in '$appInfoPath')!"; exit 1; } - - versionXML=$(grep "$appInfoPath" -e '< *nextcloud *min-version="[0-9][0-9]*" *max-version="[0-9][0-9]*" */>' | tr -d "\n") - for word in $versionXML - do - minGrep=$(grep -o 'min-version="[0-9][0-9]*"' <<< $word | sed "s/min-version=\"//") - maxGrep=$(grep -o 'max-version="[0-9][0-9]*"' <<< $word | sed "s/max-version=\"//") - - if [[ ! -z "$minGrep" ]]; then - minVersion="${minGrep//\"}" - fi - if [[ ! -z "$maxGrep" ]]; then - maxVersion="${maxGrep//\"}" - fi - - done - - # verify min and max version are numbers - [[ ! -z "$minVersion" && ! -z "$maxVersion" && "$minVersion" -eq "$minVersion" && "$maxVersion" -eq "$maxVersion" ]] || { - echo "ERROR: Malformed compatibility info (min/max version) for app '$app'!" - exit 1 - } - - if [[ "$MAJOR" -lt "$minVersion" || "$MAJOR" -gt "$maxVersion" ]]; then - incompatibleApps="$incompatibleApps$app (requires NC $minVersion-$maxVersion), " - fi - -done - -if [ "$incompatibleApps" != "" ]; then - echo "1 or more apps are not compatible with the latest Nextcloud version! Update will be held back..." - echo "Not compatible: ${incompatibleApps%, }" - exit 1 -else - echo "All apps are compatible with the new NC version. Proceeding..." -fi - - # make sure that cron.php is not running and there are no pending jobs # https://github.com/nextcloud/server/issues/10949 pgrep -cf cron.php &>/dev/null && { pkill -f cron.php; sleep 3; } |