diff options
author | nachoparker <nacho@ownyourbits.com> | 2017-12-05 19:41:53 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2017-12-05 19:42:24 +0300 |
commit | 3fedf4f432521b56b5f8040e5a8f3de0675dfc00 (patch) | |
tree | 17fa8e39b1ec818d55e67a85bb9b7afee2a45ea2 /bin | |
parent | 3896b7f5300226812dba383b1af5cdcaaa8b012f (diff) |
ncp-config: show changelog on updatesv0.41.6
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ncp-check-version | 9 | ||||
-rwxr-xr-x | bin/ncp-update | 7 | ||||
-rwxr-xr-x | bin/nextcloudpi-config | 7 |
3 files changed, 21 insertions, 2 deletions
diff --git a/bin/ncp-check-version b/bin/ncp-check-version index 5075edfb..ed5072c5 100755 --- a/bin/ncp-check-version +++ b/bin/ncp-check-version @@ -6,12 +6,21 @@ ping -W 2 -w 1 -q github.com &>/dev/null || { echo "No internet connectivity"; exit 1; } +rm -rf /tmp/ncp-check-tmp + git clone --depth 20 -q --bare https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-check-tmp || exit 1 cd /tmp/ncp-check-tmp || exit 1 VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" ) grep -qP "v\d+\.\d+\.\d+" <<< "$VER" && { # check format echo "$VER" > /var/run/.ncp-latest-version + + # write changelog + git log --graph --oneline --decorate \ + --pretty=format:"[%D] %s" --date=short | \ + grep 'tag: v' | \ + sed '/HEAD ->\|origin/s|\[.*\(tag: v[0-9]\+\.[0-9]\+\.[0-9]\+\).*\]|[\1]|' | \ + sed 's|* \[tag: |[|' > /usr/local/etc/ncp-changelog } cd / || exit 1 diff --git a/bin/ncp-update b/bin/ncp-update index 54f6a23e..9456819c 100755 --- a/bin/ncp-update +++ b/bin/ncp-update @@ -17,6 +17,13 @@ grep -qP "v\d+\.\d+\.\d+" <<< "$VER" && { # check format echo "$VER" > /usr/local/etc/ncp-version echo "$VER" > /var/run/.ncp-latest-version + + # write changelog + git log --graph --oneline --decorate \ + --pretty=format:"[%D] %s" --date=short | \ + grep 'tag: v' | \ + sed '/HEAD ->\|origin/s|\[.*\(tag: v[0-9]\+\.[0-9]\+\.[0-9]\+\).*\]|[\1]|' | \ + sed 's|* \[tag: |[|' > /usr/local/etc/ncp-changelog } echo -e "NextCloudPi updated to version $VER" } diff --git a/bin/nextcloudpi-config b/bin/nextcloudpi-config index d914121d..f247e516 100755 --- a/bin/nextcloudpi-config +++ b/bin/nextcloudpi-config @@ -26,11 +26,14 @@ function nextcloud-config() test -f $VERFILE || ncp-check-version # ask for update if outdated + + test -f /usr/local/etc/ncp-changelog && \ + local CHANGELOG=$( head -4 /usr/local/etc/ncp-changelog ) ncp-test-updates && \ whiptail --backtitle "$BACKTITLE $( cat /usr/local/etc/ncp-version )" \ --title "NextCloudPi update available" \ - --clear --yesno "Update to $( cat $VERFILE )?\n\n\n\nSee changes at\n\nhttps://github.com/nextcloud/nextcloudpi/blob/master/changelog.md" \ - 20 70 + --clear --yesno "Update to $( cat $VERFILE )?\n\n$CHANGELOG" \ + 15 70 [[ $? -eq $DIALOG_OK ]] && ncp-update while true; do |