1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
|
From: Guilhem Moulin <guilhem@debian.org>
Date: Sat, 8 Jun 2019 00:44:47 +0200
Subject: Fix INSTALL_PATH for bin/*.sh and tests/bootstrap.php
These scripts get installed to /usr/share/roundcube/bin, but
INSTALL_PATH should be /var/lib/roundcube/. Fixed/updated with
sed -ri "s#(\\s*define\\s*\\(\\s*(['\"])INSTALL_PATH\\2)\\s*,.*#\\1, '/var/lib/roundcube/');#" \
bin/*.sh installer/index.php program/include/iniset.php
Except:
- bin/install-jsdeps.sh, where we keep define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' ); and
- bin/updatecss.sh, where we use define('INSTALL_PATH', './');
We also edit tests/bootstrap.php to use the RCUBE_INSTALL_PATH environment variable.
Forwarded: not-needed
---
bin/cleandb.sh | 2 +-
bin/decrypt.sh | 2 +-
bin/deluser.sh | 2 +-
bin/gc.sh | 2 +-
bin/indexcontacts.sh | 2 +-
bin/initdb.sh | 2 +-
bin/installto.sh | 2 +-
bin/moduserprefs.sh | 2 +-
bin/msgexport.sh | 2 +-
bin/msgimport.sh | 2 +-
bin/update.sh | 2 +-
bin/updatecss.sh | 2 +-
bin/updatedb.sh | 2 +-
installer/index.php | 2 +-
program/include/iniset.php | 2 +-
tests/bootstrap.php | 2 +-
16 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/bin/cleandb.sh b/bin/cleandb.sh
index 711f32b..b5db662 100755
--- a/bin/cleandb.sh
+++ b/bin/cleandb.sh
@@ -17,7 +17,7 @@
+-----------------------------------------------------------------------+
*/
-define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
+define('INSTALL_PATH', '/var/lib/roundcube/');
require INSTALL_PATH.'program/include/clisetup.php';
diff --git a/bin/decrypt.sh b/bin/decrypt.sh
index b684cd6..965daf0 100755
--- a/bin/decrypt.sh
+++ b/bin/decrypt.sh
@@ -50,7 +50,7 @@
* - you are dealing with counterfeit header data.
*/
-define('INSTALL_PATH', realpath(__DIR__ .'/..') . '/');
+define('INSTALL_PATH', '/var/lib/roundcube/');
require INSTALL_PATH . 'program/include/clisetup.php';
diff --git a/bin/deluser.sh b/bin/deluser.sh
index 37ea2df..1c4d8f9 100755
--- a/bin/deluser.sh
+++ b/bin/deluser.sh
@@ -19,7 +19,7 @@
+-----------------------------------------------------------------------+
*/
-define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
+define('INSTALL_PATH', '/var/lib/roundcube/');
require_once INSTALL_PATH . 'program/include/clisetup.php';
diff --git a/bin/gc.sh b/bin/gc.sh
index e83d18e..41caab6 100755
--- a/bin/gc.sh
+++ b/bin/gc.sh
@@ -17,7 +17,7 @@
+-----------------------------------------------------------------------+
*/
-define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
+define('INSTALL_PATH', '/var/lib/roundcube/');
require INSTALL_PATH.'program/include/clisetup.php';
diff --git a/bin/indexcontacts.sh b/bin/indexcontacts.sh
index 3fcff80..8b55ca2 100755
--- a/bin/indexcontacts.sh
+++ b/bin/indexcontacts.sh
@@ -18,7 +18,7 @@
+-----------------------------------------------------------------------+
*/
-define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
+define('INSTALL_PATH', '/var/lib/roundcube/');
require_once INSTALL_PATH.'program/include/clisetup.php';
ini_set('memory_limit', -1);
diff --git a/bin/initdb.sh b/bin/initdb.sh
index a98bbf5..fd8e8cb 100755
--- a/bin/initdb.sh
+++ b/bin/initdb.sh
@@ -18,7 +18,7 @@
+-----------------------------------------------------------------------+
*/
-define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
+define('INSTALL_PATH', '/var/lib/roundcube/');
require_once INSTALL_PATH . 'program/include/clisetup.php';
diff --git a/bin/installto.sh b/bin/installto.sh
index 757edf6..595415b 100755
--- a/bin/installto.sh
+++ b/bin/installto.sh
@@ -18,7 +18,7 @@
+-----------------------------------------------------------------------+
*/
-define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
+define('INSTALL_PATH', '/var/lib/roundcube/');
require_once INSTALL_PATH . 'program/include/clisetup.php';
diff --git a/bin/moduserprefs.sh b/bin/moduserprefs.sh
index b3402df..a29dcd8 100755
--- a/bin/moduserprefs.sh
+++ b/bin/moduserprefs.sh
@@ -17,7 +17,7 @@
+-----------------------------------------------------------------------+
*/
-define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
+define('INSTALL_PATH', '/var/lib/roundcube/');
require_once INSTALL_PATH.'program/include/clisetup.php';
diff --git a/bin/msgexport.sh b/bin/msgexport.sh
index 42624e5..54ef252 100755
--- a/bin/msgexport.sh
+++ b/bin/msgexport.sh
@@ -14,7 +14,7 @@
+-----------------------------------------------------------------------+
*/
-define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
+define('INSTALL_PATH', '/var/lib/roundcube/');
ini_set('memory_limit', -1);
require_once INSTALL_PATH.'program/include/clisetup.php';
diff --git a/bin/msgimport.sh b/bin/msgimport.sh
index e7dd5cb..3c07a81 100755
--- a/bin/msgimport.sh
+++ b/bin/msgimport.sh
@@ -14,7 +14,7 @@
+-----------------------------------------------------------------------+
*/
-define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
+define('INSTALL_PATH', '/var/lib/roundcube/');
ini_set('memory_limit', -1);
require_once INSTALL_PATH.'program/include/clisetup.php';
diff --git a/bin/update.sh b/bin/update.sh
index 13f0846..c123385 100755
--- a/bin/update.sh
+++ b/bin/update.sh
@@ -18,7 +18,7 @@
+-----------------------------------------------------------------------+
*/
-define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
+define('INSTALL_PATH', '/var/lib/roundcube/');
require_once INSTALL_PATH . 'program/include/clisetup.php';
diff --git a/bin/updatecss.sh b/bin/updatecss.sh
index cac7201..71c94eb 100755
--- a/bin/updatecss.sh
+++ b/bin/updatecss.sh
@@ -17,7 +17,7 @@
+-----------------------------------------------------------------------+
*/
-define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
+define('INSTALL_PATH', './');
require_once INSTALL_PATH . 'program/include/clisetup.php';
diff --git a/bin/updatedb.sh b/bin/updatedb.sh
index 133d4a4..fbd48ac 100755
--- a/bin/updatedb.sh
+++ b/bin/updatedb.sh
@@ -18,7 +18,7 @@
+-----------------------------------------------------------------------+
*/
-define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
+define('INSTALL_PATH', '/var/lib/roundcube/');
require_once INSTALL_PATH . 'program/include/clisetup.php';
diff --git a/installer/index.php b/installer/index.php
index c645378..e3d089f 100644
--- a/installer/index.php
+++ b/installer/index.php
@@ -38,7 +38,7 @@
ini_set('display_errors', 1);
-define('INSTALL_PATH', realpath(__DIR__ . '/../').'/');
+define('INSTALL_PATH', '/var/lib/roundcube/');
require INSTALL_PATH . 'program/include/iniset.php';
diff --git a/program/include/iniset.php b/program/include/iniset.php
index 6f9946e..c4ab39f 100644
--- a/program/include/iniset.php
+++ b/program/include/iniset.php
@@ -28,7 +28,7 @@ define('RCMAIL_VERSION', '1.6-git');
define('RCMAIL_START', microtime(true));
if (!defined('INSTALL_PATH')) {
- define('INSTALL_PATH', dirname($_SERVER['SCRIPT_FILENAME']).'/');
+ define('INSTALL_PATH', '/var/lib/roundcube/');
}
if (!defined('RCMAIL_CONFIG_DIR')) {
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index e0204d58..6cfd610 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -22,7 +22,7 @@ if (php_sapi_name() != 'cli') {
die("Not in shell mode (php-cli)");
}
-if (!defined('INSTALL_PATH')) define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
+define('INSTALL_PATH', getenv('RCUBE_INSTALL_PATH') . '/');
define('ROUNDCUBE_TEST_MODE', true);
define('TESTS_DIR', __DIR__ . '/');
|