diff --git a/cross/transmission/Makefile b/cross/transmission/Makefile index a30e8bcb812..75e0ec638f6 100644 --- a/cross/transmission/Makefile +++ b/cross/transmission/Makefile @@ -1,5 +1,5 @@ PKG_NAME = transmission -PKG_VERS = 4.0.4 +PKG_VERS = 4.0.5 PKG_EXT = tar.xz PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) PKG_DIST_SITE = https://github.com/transmission/transmission/releases/download/$(PKG_VERS) diff --git a/cross/transmission/digests b/cross/transmission/digests index f347654ca88..836ecf79cfc 100644 --- a/cross/transmission/digests +++ b/cross/transmission/digests @@ -1,3 +1,3 @@ -transmission-4.0.4.tar.xz SHA1 b2dcf3d25e094a5b52125cafb65515294963a620 -transmission-4.0.4.tar.xz SHA256 15f7b4318fdfbffb19aa8d9a6b0fd89348e6ef1e86baa21a0806ffd1893bd5a6 -transmission-4.0.4.tar.xz MD5 a9985ff897d060d40b80e763263ffaf9 +transmission-4.0.5.tar.xz SHA1 25e581e54a0046afbc23a288f28bb76cf6cad3b0 +transmission-4.0.5.tar.xz SHA256 fd68ff114a479200043c30c7e69dba4c1932f7af36ca4c5b5d2edcb5866e6357 +transmission-4.0.5.tar.xz MD5 d3cda868215246644c429b18a30f7e47 diff --git a/cross/transmission/patches/001-use_TMP_DIR.patch b/cross/transmission/patches/001-use_TMP_DIR.patch deleted file mode 100644 index 8768eeb98c4..00000000000 --- a/cross/transmission/patches/001-use_TMP_DIR.patch +++ /dev/null @@ -1,16 +0,0 @@ -# if available use TMP_DIR as tmp folder -# ---- libtransmission/platform.cc.orig 2023-04-14 02:22:25.000000000 +0000 -+++ libtransmission/platform.cc 2023-09-01 13:16:59.494547485 +0000 -@@ -336,6 +336,11 @@ - { - #ifndef _WIN32 - -+ if (auto dir = tr_env_get_string("TMP_DIR"sv); !std::empty(dir)) -+ { -+ return dir; -+ } -+ - return std::string{ "/tmp"sv }; - - #else diff --git a/cross/transmission/patches/002-fix_empty_blocklist.patch b/cross/transmission/patches/002-fix_empty_blocklist.patch deleted file mode 100644 index c31c75caf59..00000000000 --- a/cross/transmission/patches/002-fix_empty_blocklist.patch +++ /dev/null @@ -1,29 +0,0 @@ -# Fix empty blocklist files in some situations. -# -# ARMv7 archs (and may be other systems with older kernel) fail to fallback from sendfile64 usage to user-space copy -# The use of sendfile64 might fail with EINVAL (22) -# This is in addition to the fallback from copy_file_range that might fail with EXDEV (18) -# Both errors must be considered in the fallback to user-space copy. ---- libtransmission/file-posix.cc.orig 2023-08-23 22:56:00.000000000 +0000 -+++ libtransmission/file-posix.cc 2023-09-04 15:50:43.120245644 +0000 -@@ -439,7 +439,10 @@ - if (copied == -1) - { - errno_cpy = errno; /* remember me for later */ -- tr_error_set_from_errno(error, errno); -+ if (errno != EINVAL) -+ { -+ tr_error_set_from_errno(error, errno); -+ } - if (file_size > 0U) - { - file_size = info->size; /* restore file_size for next fallback */ -@@ -460,7 +463,7 @@ - /* Fallback to user-space copy. */ - /* if file_size>0 and errno_cpy==0, we probably never entered any copy attempt, also: */ - /* if we (still) got something to copy and we encountered certain error in previous attempts */ -- if (file_size > 0U && (errno_cpy == 0 || errno_cpy == EXDEV)) -+ if (file_size > 0U && (errno_cpy == 0 || errno_cpy == EXDEV || errno_cpy == EINVAL)) - { - static auto constexpr Buflen = size_t{ 1024U * 1024U }; /* 1024 KiB buffer */ - auto buf = std::vector{}; diff --git a/cross/transmission/patches/armv7/003-force-use-of-flock.patch b/cross/transmission/patches/armv7/003-force-use-of-flock.patch deleted file mode 100644 index d46937fde3e..00000000000 --- a/cross/transmission/patches/armv7/003-force-use-of-flock.patch +++ /dev/null @@ -1,52 +0,0 @@ -# Creating locks with fcntl does not work on 32-bit arm models -# It results in EINVAL (error: invalid argument (22)) and does not lock the file. -# flock does work (at least for the session-id file). -# -# REMARKS: -# The numbering scheme of the patches must not change the sequence. -# 002-fix_empty_blocklist.patch must be applied first, since it modifies the file-posix.cc too -# and is applied for all archs. -# The line numbers here (003-*.patch) are taken from the version patched with 002-*.patch -# ---- libtransmission/file-posix.cc.orig 2023-09-04 15:50:24.051131190 +0000 -+++ libtransmission/file-posix.cc 2023-09-04 18:02:06.029986405 +0000 -@@ -1003,38 +1006,7 @@ - - bool ret = false; - --#if defined(F_OFD_SETLK) -- -- struct flock fl = {}; -- -- switch (operation & (TR_SYS_FILE_LOCK_SH | TR_SYS_FILE_LOCK_EX | TR_SYS_FILE_LOCK_UN)) -- { -- case TR_SYS_FILE_LOCK_SH: -- fl.l_type = F_RDLCK; -- break; -- -- case TR_SYS_FILE_LOCK_EX: -- fl.l_type = F_WRLCK; -- break; -- -- case TR_SYS_FILE_LOCK_UN: -- fl.l_type = F_UNLCK; -- break; -- } -- -- fl.l_whence = SEEK_SET; -- -- do -- { -- ret = fcntl(handle, (operation & TR_SYS_FILE_LOCK_NB) != 0 ? F_OFD_SETLK : F_OFD_SETLKW, &fl) != -1; -- } while (!ret && errno == EINTR); -- -- if (!ret && errno == EAGAIN) -- { -- errno = EWOULDBLOCK; -- } -- --#elif defined(HAVE_FLOCK) -+#if defined(HAVE_FLOCK) - - int native_operation = 0; - diff --git a/spk/transmission/Makefile b/spk/transmission/Makefile index c57e46ec51d..27554a34c6a 100644 --- a/spk/transmission/Makefile +++ b/spk/transmission/Makefile @@ -1,6 +1,6 @@ SPK_NAME = transmission -SPK_VERS = 4.0.4 -SPK_REV = 24 +SPK_VERS = 4.0.5 +SPK_REV = 25 SPK_ICON = src/transmission.png DEPENDS = cross/transmission @@ -14,15 +14,16 @@ DESCRIPTION_FRE = Transmission est un client BitTorrent simple et rapide. Vous p DESCRIPTION_SPN = Transmission es un cliente BitTorrent simple y rápido. Puedes controlarlo remotamente mediante su interfaz web o alguna aplicación dedicada. STARTABLE = yes DISPLAY_NAME = Transmission -CHANGELOG = "1. Update Transmission to v4.0.4.
2. Fix issue with empty blocklist files for 32-bit arm cpu models." +CHANGELOG = "1. Update Transmission to v4.0.5.
2. Use new shared folder handling." HOMEPAGE = https://transmissionbt.com LICENSE = GPLv2/GPLv3 WIZARDS_DIR = src/wizard/ +CONF_DIR = src/conf/ SERVICE_USER = auto -SERVICE_WIZARD_SHARE = wizard_download_share +SERVICE_WIZARD_SHARENAME = wizard_shared_folder_name SERVICE_SETUP = src/service-setup.sh SERVICE_PORT = 9091 SERVICE_PORT_TITLE = Transmission Web UI diff --git a/spk/transmission/src/conf/resource b/spk/transmission/src/conf/resource new file mode 100644 index 00000000000..5b8db0848db --- /dev/null +++ b/spk/transmission/src/conf/resource @@ -0,0 +1,11 @@ +{ + "data-share": { + "shares": [{ + "name": "{{wizard_shared_folder_name}}", + "permission": { + "rw": ["sc-transmission"] + }, + "once": true + }] + } +} diff --git a/spk/transmission/src/service-setup.sh b/spk/transmission/src/service-setup.sh index d01817fb37a..b3d562a59e5 100644 --- a/spk/transmission/src/service-setup.sh +++ b/spk/transmission/src/service-setup.sh @@ -8,19 +8,14 @@ SERVICE_COMMAND="${TRANSMISSION} --config-dir ${SYNOPKG_PKGVAR} --pid-file ${PID service_postinst () { if [ "${SYNOPKG_PKG_STATUS}" = "INSTALL" ]; then - # Capture wizard variable - TXN_DNLOAD=${wizard_download_dir:=volume1/downloads} - # Check that the path exists, if not, use path in package shares - if [ ! -d "${TXN_DNLOAD}" ]; then - TXN_DNLOAD=$(realpath "/var/packages/${SYNOPKG_PKGNAME}/shares/${wizard_download_share}") - fi + # Define managed functions and folders TXN_FUNCTS=("complete" "incomplete" "watch") TXN_FOLDRS=("complete" "incomplete" "watch-transmission") TXN_PATHS=() # Create the managed folders for item in "${TXN_FOLDRS[@]}"; do - folder="$TXN_DNLOAD/$item" + folder="${SHARE_PATH}/$item" mkdir -p "$folder" TXN_PATHS+=("$folder") done @@ -32,22 +27,12 @@ service_postinst () i=0 while [ $i -lt ${#TXN_FUNCTS[@]} ]; do - if [ -d "${TXN_PATHS[$i]}" ]; then - if [ "${TXN_FUNCTS[$i]}" = "complete" ]; then - sed -e "s|@download_dir@|${TXN_PATHS[$i]}|g" -i "${CFG_FILE}" - else - sed -e "s|@${TXN_FUNCTS[$i]}_dir_enabled@|true|g" \ - -e "s|@${TXN_FUNCTS[$i]}_dir@|${TXN_PATHS[$i]}|g" \ - -i "${CFG_FILE}" - fi + if [ "${TXN_FUNCTS[$i]}" = "complete" ]; then + sed -e "s|@download_dir@|${TXN_PATHS[$i]}|g" -i "${CFG_FILE}" else - if [ "${TXN_FUNCTS[$i]}" = "complete" ]; then - sed -e "s|@download_dir@|${TXN_DNLOAD}|g" -i "${CFG_FILE}" - else - sed -e "s|@${TXN_FUNCTS[$i]}_dir_enabled@|false|g" \ - -e "/@${TXN_FUNCTS[$i]}_dir@/d" \ - -i "${CFG_FILE}" - fi + sed -e "s|@${TXN_FUNCTS[$i]}_dir_enabled@|true|g" \ + -e "s|@${TXN_FUNCTS[$i]}_dir@|${TXN_PATHS[$i]}|g" \ + -i "${CFG_FILE}" fi i=$((i+1)) done diff --git a/spk/transmission/src/wizard/install_uifile.sh b/spk/transmission/src/wizard/install_uifile.sh index a2c9a3eeb4c..3531a628a5a 100644 --- a/spk/transmission/src/wizard/install_uifile.sh +++ b/spk/transmission/src/wizard/install_uifile.sh @@ -15,93 +15,24 @@ page_append () fi } -wizard_download_share_validator() -{ - DOWNLOAD_SHARE=$(/bin/cat<