Skip to content

Commit

Permalink
Transmission: Update to 4.0.5 (SynoCommunity#5956)
Browse files Browse the repository at this point in the history
* Transmission: Update to 4.0.5
* Removed fix for empty blocklist files on 32-bit arm cpu models (addressed upstream).
* Use new shared folder handling
  • Loading branch information
mreid-tt authored Dec 15, 2023
1 parent c5161a6 commit b3632b2
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 201 deletions.
2 changes: 1 addition & 1 deletion cross/transmission/Makefile
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
6 changes: 3 additions & 3 deletions cross/transmission/digests
Original file line number Diff line number Diff line change
@@ -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
16 changes: 0 additions & 16 deletions cross/transmission/patches/001-use_TMP_DIR.patch

This file was deleted.

29 changes: 0 additions & 29 deletions cross/transmission/patches/002-fix_empty_blocklist.patch

This file was deleted.

52 changes: 0 additions & 52 deletions cross/transmission/patches/armv7/003-force-use-of-flock.patch

This file was deleted.

9 changes: 5 additions & 4 deletions spk/transmission/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.<br/>2. Fix issue with empty blocklist files for 32-bit arm cpu models."
CHANGELOG = "1. Update Transmission to v4.0.5.<br/>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
Expand Down
11 changes: 11 additions & 0 deletions spk/transmission/src/conf/resource
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"data-share": {
"shares": [{
"name": "{{wizard_shared_folder_name}}",
"permission": {
"rw": ["sc-transmission"]
},
"once": true
}]
}
}
29 changes: 7 additions & 22 deletions spk/transmission/src/service-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
79 changes: 5 additions & 74 deletions spk/transmission/src/wizard/install_uifile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,93 +15,24 @@ page_append ()
fi
}

wizard_download_share_validator()
{
DOWNLOAD_SHARE=$(/bin/cat<<EOF
{
var value = arguments[0];
var step = arguments[2];
step.items.map['wizard_download_dir'].setValue(step.items.map['wizard_download_volume'].value + '/' + value);
return true;
}
EOF
)
echo "$DOWNLOAD_SHARE" | quote_json
}

wizard_download_volume_validator()
{
DOWNLOAD_VOLUME=$(/bin/cat<<EOF
{
var value = arguments[0];
var step = arguments[2];
step.items.map['wizard_download_dir'].setValue(value + '/' + step.items.map['wizard_download_share'].value);
return true;
}
EOF
)
echo "$DOWNLOAD_VOLUME" | quote_json
}

DIR_VALID="/^[\\w _-]+$/"

PAGE_BASE_CONFIG=$(/bin/cat<<EOF
{
"step_title": "Basic configuration",
"invalid_next_disabled_v2": true,
"items": [{
"type": "combobox",
"desc": "Please select a volume to use for the download folder",
"subitems": [{
"key": "wizard_download_volume",
"desc": "Volume name",
"defaultValue": "volume1",
"displayField": "display_name",
"valueField": "volume_path",
"editable": false,
"mode": "remote",
"api_store": {
"api": "SYNO.Core.Storage.Volume",
"method": "list",
"version": 1,
"baseParams": {
"limit": -1,
"offset": 0,
"location": "internal"
},
"root": "volumes",
"idProperty": "volume_path",
"fields": [
"display_name",
"volume_path"
]
},
"validator": {
"fn": "$(wizard_download_volume_validator)"
}
}]
},
{
"type": "textfield",
"desc": "Download shared folder (using the volume chosen above)",
"desc": "Please select a shared folder for storing downloads. If this folder doesn't exist at the time of installation, it will be created.",
"subitems": [{
"key": "wizard_download_share",
"desc": "Download shared folder",
"key": "wizard_shared_folder_name",
"desc": "Shared folder",
"defaultValue": "downloads",
"validator": {
"allowBlank": false,
"regex": {
"expr": "$(echo ${DIR_VALID} | quote_json)",
"expr": "/^[\\\w.][\\\w. -]{0,30}[\\\w.-][\\\\$]?$|^[\\\w][\\\\$]?$/",
"errorText": "Subdirectories are not supported."
},
"fn": "$(wizard_download_share_validator)"
}
}
},
{
"key": "wizard_download_dir",
"desc": "Full path to the shared download folder",
"defaultValue": "/volume1/downloads",
"hidden": true
}
]
}
Expand Down

0 comments on commit b3632b2

Please sign in to comment.