From 6ba4380525e9ec78d87e432f7aefee5abddfb1bb Mon Sep 17 00:00:00 2001 From: opi Date: Tue, 11 Nov 2014 16:22:53 +0100 Subject: [PATCH 01/10] [enh] Append downloads button. --- scripts/install | 5 +++++ sources/toolbar-downloads.png | Bin 0 -> 1984 bytes sources/ynh_common.css | 4 ++++ 3 files changed, 9 insertions(+) create mode 100644 sources/toolbar-downloads.png create mode 100644 sources/ynh_common.css diff --git a/scripts/install b/scripts/install index b864552..1e2355f 100644 --- a/scripts/install +++ b/scripts/install @@ -43,6 +43,11 @@ sudo service transmission-daemon reload # Monitor service sudo yunohost service add transmission-daemon +# Patch sources to add a download button +sudo cp sources/toolbar-downloads.png /usr/share/transmission/web/style/transmission/images/toolbar-downloads.png +sudo cat sources/ynh_common.css >> /usr/share/transmission/web/style/transmission/common.css +sudo sed -i "s@
@
@g" /usr/share/transmission/web/index.html + # Configure Nginx and reload sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/transmission.conf diff --git a/sources/toolbar-downloads.png b/sources/toolbar-downloads.png new file mode 100644 index 0000000000000000000000000000000000000000..e60479f6670114432669e053ca4da5ef4d830717 GIT binary patch literal 1984 zcmV;x2S50UP)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00$^ZL_t(o!@ZY#j9gV6$3N%Z zJNM3Gr#rh_sC_I8Dj1bVN;L-m(4wIrLJ%QF17a-Jg!+tzV7j7_*!Y*42%!cEh!`SZ zYk9;#D?~BzQ6)$SjUl;VrD&_HTdB&TFn)w@XAo1Yecd z_4om%nupka%kDQ1uw~1ZD<>uFSD^*aQ$G30%7CN^8 zlp-IU+Y4^J^=B7MPEOvpb?a8U6adaSk|ZWc5?;S8lOmxSR_DKq6`WrXhS4GgL>a_6 znunXz%0qp%Iz4LTA%=#A=ytoSfdfkdhzMa=C0vkb&PISZ?=c&<8LcmWLj@|8I@t)+UP-*#68BPN_$1y!c#JuNc9)zKmP$+K%&yo>LR78*@Rt``R7)P$Zdk{xhJ#(filBgM zWfafV5tD%O1`rBAs8NmzI=MqB#atqXFx%}>sgF!qa7N(pbg%T_qkkJOwAr`-ASKWG z3Ou|2Ae%n9j;@A7U5j=7Li0RG(&-Z_kZ27k9AE{EK&w|!DM_qF+1$eJKRt71VeF0D zzIpjC=XU`_C@*6Fk(g74tE^hyVBd_xSWwC%@WDskPys7Gq7+uZI?w{S1JO`8c;#TT zK0VX<`_I2|*-sV~A>=q4^V}u{co}2YTR{2CKn1 z*uU@PF+qLrm|Y-JLZrcKvr~L(&2kbgc*?`~6n}pD9-7ntVQTtSJYNvs5P4-7>;Q$r z`31AHEpGeGX6m&ny*T5uSKN+virj!HKwD8qj!f54>aisNa-54vih>oRLmcc{LeHTT zbmAuKKXe{Z{VY2A5ZY#V%I_yv3Z=kP9#?T!NGq-~He5yFAx;q}pOWWu@dq|?_X7`-%~lz!o<_AYOca#~!-y~p z3BwB2@(5$q)0k;`Y=8U-F8TP6$c;~4cw}0Uq~dit-HIsn+>#d(=TcssZL)H72qzBT zv-qCDSB8<{VXnRWMz-(XMKT*PT3JK2JUjrXP%SqYt&B4>rFh`6-CT6xEoceJ3PW00 zvI62vR2;`;l-hd?Kwp7~X0ODljT+X0hli&ElnOuvylZ?Nmwxz5-1o>M#M31j(Q2wu zgG$(-5w7C!tD0Xw`Usa_dK=bjkQOD3 zN}|+(C6D8xC^MV;jMXbx3(on-pqaQqLovYW@wHeh+_Pf`U;OmvD0IrN9@@b<=Y5`1 zWesr_V637rpbZp8ND4@OFwXd*)bud`)>^WxNp1^D@#>%yv zy>5v6cRz`Bj`ytHgkKxS*@#pZ6ov%=kmZp1;1Ca`(qjOOF~spHXw_q6sKQj&pe4kJ zLc0Ng>vuBGMGSc`v0@dg#y*N(kSMp1YUTlqfx div#toolbar-downloads { + background: url("images/toolbar-download.png") no-repeat; + } From a6325a714a4138bf3ab26202f29a509f0828c3c3 Mon Sep 17 00:00:00 2001 From: opi Date: Tue, 11 Nov 2014 16:25:08 +0100 Subject: [PATCH 02/10] [enh] Append downloads button on upgrade script. --- scripts/upgrade | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 12a5fd3..ab7217f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,6 +24,11 @@ sed -i "s@PATHTOCHANGE@$path@g" ../conf/settings.json sudo cp ../conf/settings.json /etc/transmission-daemon/settings.json sudo service transmission-daemon reload +# Patch sources to add a download button +sudo cp sources/toolbar-downloads.png /usr/share/transmission/web/style/transmission/images/toolbar-downloads.png +sudo cat sources/ynh_common.css >> /usr/share/transmission/web/style/transmission/common.css +sudo sed -i "s@
@
@g" /usr/share/transmission/web/index.html + # Configure Nginx and reload sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/transmission.conf From 1e57f23ee6d65696e1aa0499d50cea1d8315b1ab Mon Sep 17 00:00:00 2001 From: opi Date: Tue, 11 Nov 2014 16:36:22 +0100 Subject: [PATCH 03/10] =?UTF-8?q?[fix]=C2=A0Force=20blank=20line=20when=20?= =?UTF-8?q?insterting=20css.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/ynh_common.css | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/ynh_common.css b/sources/ynh_common.css index 7b7adda..6575384 100644 --- a/sources/ynh_common.css +++ b/sources/ynh_common.css @@ -1,3 +1,4 @@ + /* Inserted by Yunohost install script */ div#toolbar > div#toolbar-downloads { background: url("images/toolbar-download.png") no-repeat; From c4f7c226a24c93f3b8871fab742e273217b3a499 Mon Sep 17 00:00:00 2001 From: opi Date: Tue, 11 Nov 2014 16:37:09 +0100 Subject: [PATCH 04/10] =?UTF-8?q?[fix]=C2=A0Wrong=20paths=20and=20permissi?= =?UTF-8?q?ons=20when=20patching=20transmission=20sources.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install | 4 ++-- scripts/upgrade | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 1e2355f..0af09fc 100644 --- a/scripts/install +++ b/scripts/install @@ -44,8 +44,8 @@ sudo service transmission-daemon reload sudo yunohost service add transmission-daemon # Patch sources to add a download button -sudo cp sources/toolbar-downloads.png /usr/share/transmission/web/style/transmission/images/toolbar-downloads.png -sudo cat sources/ynh_common.css >> /usr/share/transmission/web/style/transmission/common.css +sudo cp ../sources/toolbar-downloads.png /usr/share/transmission/web/style/transmission/images/toolbar-downloads.png +sudo bash -c 'cat ../sources/ynh_common.css >> /usr/share/transmission/web/style/transmission/common.css' sudo sed -i "s@
@
@g" /usr/share/transmission/web/index.html # Configure Nginx and reload diff --git a/scripts/upgrade b/scripts/upgrade index ab7217f..a707e51 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,8 +25,8 @@ sudo cp ../conf/settings.json /etc/transmission-daemon/settings.json sudo service transmission-daemon reload # Patch sources to add a download button -sudo cp sources/toolbar-downloads.png /usr/share/transmission/web/style/transmission/images/toolbar-downloads.png -sudo cat sources/ynh_common.css >> /usr/share/transmission/web/style/transmission/common.css +sudo cp ../sources/toolbar-downloads.png /usr/share/transmission/web/style/transmission/images/toolbar-downloads.png +sudo bash -c 'cat ../sources/ynh_common.css >> /usr/share/transmission/web/style/transmission/common.css' sudo sed -i "s@
@
@g" /usr/share/transmission/web/index.html # Configure Nginx and reload From de7eebf8ea0821a3acf4f3106a9aa89ed1ccf7a7 Mon Sep 17 00:00:00 2001 From: opi Date: Tue, 11 Nov 2014 16:39:13 +0100 Subject: [PATCH 05/10] [fix] Wrong image filename. --- sources/ynh_common.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/ynh_common.css b/sources/ynh_common.css index 6575384..8c712ec 100644 --- a/sources/ynh_common.css +++ b/sources/ynh_common.css @@ -1,5 +1,5 @@ /* Inserted by Yunohost install script */ div#toolbar > div#toolbar-downloads { - background: url("images/toolbar-download.png") no-repeat; + background: url("images/toolbar-downloads.png") no-repeat; } From 54ea5083713d79efb54f930f6a633d6fa1cc2ac2 Mon Sep 17 00:00:00 2001 From: opi Date: Tue, 11 Nov 2014 16:39:27 +0100 Subject: [PATCH 06/10] [fix] Remove trailing spaces. --- scripts/install | 12 ++++++------ scripts/upgrade | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/install b/scripts/install index 0af09fc..b118002 100644 --- a/scripts/install +++ b/scripts/install @@ -1,11 +1,11 @@ -#!/bin/bash +#!/bin/bash # Retrieve arguments domain=$1 path=$2 sudo yunohost app checkurl $domain$path -a transmission -if [[ ! $? -eq 0 ]]; then +if [[ ! $? -eq 0 ]]; then exit 1 fi @@ -15,18 +15,18 @@ path=${path%/} # Check port availability sudo yunohost app checkport 9091 if [[ ! $? -eq 0 ]]; then - exit 1 + exit 1 fi sudo yunohost app checkport 51413 -if [[ ! $? -eq 0 ]]; then - exit 1 +if [[ ! $? -eq 0 ]]; then + exit 1 fi # Open port in firewall sudo yunohost firewall allow TCP 51413 > /dev/null 2>&1 # Install official debian package -sudo apt-get install transmission-daemon -y -qq +sudo apt-get install transmission-daemon -y -qq # Make directories and set rights sudo mkdir -p /home/yunohost.transmission/{progress,completed} diff --git a/scripts/upgrade b/scripts/upgrade index a707e51..5a48397 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash # Retrieve arguments domain=$(sudo yunohost app setting transmission domain) @@ -11,7 +11,7 @@ path=${path%/} sudo yunohost firewall allow TCP 51413 > /dev/null 2>&1 # Upgrade official debian package -sudo apt-get install transmission-daemon -y -qq +sudo apt-get install transmission-daemon -y -qq # Make directories and set rights sudo mkdir -p /home/yunohost.transmission/{progress,completed} From cef8d78a493ed4901caa7dd8513989f33d62c1de Mon Sep 17 00:00:00 2001 From: opi Date: Tue, 11 Nov 2014 16:47:59 +0100 Subject: [PATCH 07/10] [fix] Invalid css. --- sources/ynh_common.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/ynh_common.css b/sources/ynh_common.css index 8c712ec..7d0afd2 100644 --- a/sources/ynh_common.css +++ b/sources/ynh_common.css @@ -1,5 +1,5 @@ /* Inserted by Yunohost install script */ - div#toolbar > div#toolbar-downloads { - background: url("images/toolbar-downloads.png") no-repeat; + div#toolbar > #toolbar-downloads { + background-image: url("images/toolbar-downloads.png"); } From c075d93f7a9b2af5c6f43e70c3dc4b892f79cb84 Mon Sep 17 00:00:00 2001 From: opi Date: Tue, 11 Nov 2014 16:55:15 +0100 Subject: [PATCH 08/10] [fix] Prevent patching sources twice. --- scripts/upgrade | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 5a48397..f52fd20 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,9 +25,13 @@ sudo cp ../conf/settings.json /etc/transmission-daemon/settings.json sudo service transmission-daemon reload # Patch sources to add a download button -sudo cp ../sources/toolbar-downloads.png /usr/share/transmission/web/style/transmission/images/toolbar-downloads.png -sudo bash -c 'cat ../sources/ynh_common.css >> /usr/share/transmission/web/style/transmission/common.css' -sudo sed -i "s@
@
@g" /usr/share/transmission/web/index.html +if grep 'toolbar-downloads' /usr/share/transmission/web/index.html --quiet; then + sudo cp ../sources/toolbar-downloads.png /usr/share/transmission/web/style/transmission/images/toolbar-downloads.png + sudo bash -c 'cat ../sources/ynh_common.css >> /usr/share/transmission/web/style/transmission/common.css' + sudo sed -i "s@
@
@g" /usr/share/transmission/web/index.html +fi + + # Configure Nginx and reload sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf From 14d09296ca57aecd3ce003214606645a486190f4 Mon Sep 17 00:00:00 2001 From: opi Date: Tue, 11 Nov 2014 17:00:05 +0100 Subject: [PATCH 09/10] =?UTF-8?q?[fix]=C2=A0Wrong=20grep=20condition.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/upgrade | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index f52fd20..96b1ccc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,7 +25,8 @@ sudo cp ../conf/settings.json /etc/transmission-daemon/settings.json sudo service transmission-daemon reload # Patch sources to add a download button -if grep 'toolbar-downloads' /usr/share/transmission/web/index.html --quiet; then +if ! grep 'toolbar-downloads' /usr/share/transmission/web/index.html --quiet; then + sudo cp ../sources/toolbar-downloads.png /usr/share/transmission/web/style/transmission/images/toolbar-downloads.png sudo bash -c 'cat ../sources/ynh_common.css >> /usr/share/transmission/web/style/transmission/common.css' sudo sed -i "s@
@
@g" /usr/share/transmission/web/index.html From c9d0718d332b5ed95a8906c2cc7f6e2203f275d8 Mon Sep 17 00:00:00 2001 From: opi Date: Tue, 11 Nov 2014 19:52:03 +0100 Subject: [PATCH 10/10] [fix] Backport upstream CSS fix for toolbar buttons. --- sources/ynh_common.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sources/ynh_common.css b/sources/ynh_common.css index 7d0afd2..ebcf246 100644 --- a/sources/ynh_common.css +++ b/sources/ynh_common.css @@ -1,5 +1,9 @@ /* Inserted by Yunohost install script */ + div#toolbar > * { + background-position: center center; + background-repeat: no-repeat; + } div#toolbar > #toolbar-downloads { background-image: url("images/toolbar-downloads.png"); }