From fa3de093eab57899fd5521a0cf356d02dfee591b Mon Sep 17 00:00:00 2001 From: Michael Reid Date: Mon, 4 Dec 2023 11:29:33 -0400 Subject: [PATCH] ownCloud: Update to v10.13.3 (#5949) * Update ownCloud to 10.13.3 * Improve backup function * Add upgrade check on install from archive --- cross/owncloud/Makefile | 4 +- cross/owncloud/digests | 6 +-- spk/owncloud/Makefile | 6 +-- spk/owncloud/src/service-setup.sh | 37 +++++++++++++------ .../src/wizard_templates/install_uifile.sh | 1 + 5 files changed, 35 insertions(+), 19 deletions(-) diff --git a/cross/owncloud/Makefile b/cross/owncloud/Makefile index f522ab06132..64ba4cfa1fa 100644 --- a/cross/owncloud/Makefile +++ b/cross/owncloud/Makefile @@ -1,6 +1,6 @@ PKG_NAME = owncloud -PKG_VERS = 10.13.2 -PKG_DATE = 20231009 +PKG_VERS = 10.13.3 +PKG_DATE = 20231121 PKG_EXT = tar.bz2 PKG_DIST_NAME = $(PKG_NAME)-complete-$(PKG_DATE).$(PKG_EXT) PKG_DIST_SITE = https://download.owncloud.com/server/stable diff --git a/cross/owncloud/digests b/cross/owncloud/digests index 4505e21812e..672ae3da2dd 100644 --- a/cross/owncloud/digests +++ b/cross/owncloud/digests @@ -1,3 +1,3 @@ -owncloud-complete-20231009.tar.bz2 SHA1 240643ff4eaef8cf5432e5a4ab673b6e06bef59a -owncloud-complete-20231009.tar.bz2 SHA256 0eee3bf9dacd86ef6b5efba4d71d99188e98d3ff83a49078e87d4ea4e3937cec -owncloud-complete-20231009.tar.bz2 MD5 2f8e340a760c18b184859680a8c29e1c +owncloud-complete-20231121.tar.bz2 SHA1 031c3ae5847dd3419a308da28c485428ca487545 +owncloud-complete-20231121.tar.bz2 SHA256 4b42022ee12c28e7032617d46ca4c88cdbecd96100dcebcbf9184b2bb77530fc +owncloud-complete-20231121.tar.bz2 MD5 2c351c6502c6dd4147188f03d431379f diff --git a/spk/owncloud/Makefile b/spk/owncloud/Makefile index 037b55b2b21..7277a5cd04e 100644 --- a/spk/owncloud/Makefile +++ b/spk/owncloud/Makefile @@ -1,6 +1,6 @@ SPK_NAME = owncloud -SPK_VERS = 10.13.2 -SPK_REV = 13 +SPK_VERS = 10.13.3 +SPK_REV = 14 SPK_ICON = src/owncloud.png DEPENDS = cross/owncloud @@ -13,7 +13,7 @@ SPK_DEPENDS = WebStation:PHP7.4:Apache2.4 MAINTAINER = ymartin59 DESCRIPTION = ownCloud is a personal cloud which runs on your own server and gives you freedom and control over your own data. DISPLAY_NAME = ownCloud -CHANGELOG = "1. Update ownCloud to 10.13.2.
2. New backup and restore functions.
3. Use new shared folder handling.
4. Package maintenance optimisation." +CHANGELOG = "1. Update ownCloud to 10.13.3.
2. Improved backup function." HOMEPAGE = https://owncloud.org/ LICENSE = AGPL diff --git a/spk/owncloud/src/service-setup.sh b/spk/owncloud/src/service-setup.sh index b33ca646a3b..c8e2773ad85 100755 --- a/spk/owncloud/src/service-setup.sh +++ b/spk/owncloud/src/service-setup.sh @@ -253,6 +253,17 @@ service_postinst () # Disable maintenance mode exec_occ maintenance:mode --off + # Extract the version number using awk and cut + file_version=$(echo "$filename" | awk -F "${expected_prefix}" '{print $2}' | cut -d '_' -f 1) + package_version=$(echo ${SYNOPKG_PKGVER} | cut -d '-' -f 1) + if [ -n "$file_version" ]; then + # Compare the extracted version with package_version using awk + if awk "BEGIN {exit !($file_version < $package_version) }"; then + echo "The archive version ($file_version) is older than the package version ($package_version). Triggering upgrade." + exec_occ upgrade + fi + fi + # Clean-up temporary files ${RM} "${TEMPDIR}" else @@ -275,6 +286,18 @@ service_preuninst () if [ "${SYNOPKG_PKG_STATUS}" = "UNINSTALL" ]; then # Check export directory if [ -n "${wizard_export_path}" ]; then + if [ ! -d "${wizard_export_path}" ]; then + # If the export path directory does not exist, create it + ${MKDIR} "${wizard_export_path}" || { + # If mkdir fails, print an error message and exit + echo "Error: Unable to create directory ${wizard_export_path}. Check permissions." + exit 1 + } + elif [ ! -w "${wizard_export_path}" ]; then + # If the export path directory is not writable, print an error message and exit + echo "Error: Unable to write to directory ${wizard_export_path}. Check permissions." + exit 1 + fi # Get data directory DATADIR="$(exec_occ config:system:get datadirectory)" # Data directory fail-safe @@ -315,17 +338,9 @@ service_preuninst () ${TAR} -C "$TEMPDIR" -czf "${SYNOPKG_PKGTMP}/$archive_name" . 2>&1 # Move archive to export directory - ${MKDIR} "${wizard_export_path}" - if ${RSYNC} "${SYNOPKG_PKGTMP}/$archive_name" "${wizard_export_path}/"; then - echo "Backup file copied successfully to ${wizard_export_path}." - else - echo "File copy failed. Trying to copy to alternate location..." - if ${RSYNC} "${SYNOPKG_PKGTMP}/$archive_name" "${SYNOPKG_PKGDEST_VOL}/@tmp/"; then - echo "Backup file copied successfully to alternate location (${SYNOPKG_PKGDEST_VOL}/@tmp)." - else - echo "File copy failed. Backup of ownCloud data will not be saved." - fi - fi + RSYNC_BAK_ARGS="--backup --suffix=.bak" + rsync -aX ${RSYNC_BAK_ARGS} "${SYNOPKG_PKGTMP}/$archive_name" "${wizard_export_path}/" 2>&1 + echo "Backup file copied successfully to ${wizard_export_path}." # Clean-up temporary files ${RM} "${TEMPDIR}" diff --git a/spk/owncloud/src/wizard_templates/install_uifile.sh b/spk/owncloud/src/wizard_templates/install_uifile.sh index 301f107f457..238414b9e99 100644 --- a/spk/owncloud/src/wizard_templates/install_uifile.sh +++ b/spk/owncloud/src/wizard_templates/install_uifile.sh @@ -56,6 +56,7 @@ getBackupFile() if (backupFile) { filePath.setDisabled(false); } else { + filePath.setValue(""); filePath.setDisabled(true); } return true;