Merge branch 'nuxwin-#6704'

pull/6724/head
Aleksander Machniak 6 years ago
commit fc44e4612f

@ -14,6 +14,7 @@ CHANGELOG Roundcube Webmail
- Fix bug where next row wasn't selected after deleting a collapsed thread (#6655) - Fix bug where next row wasn't selected after deleting a collapsed thread (#6655)
- Fix bug where external content (e.g. mail body) was passed to templates parsing code (#6640) - Fix bug where external content (e.g. mail body) was passed to templates parsing code (#6640)
- Fix bug where attachment preview didn't work with x_frame_options=deny (#6688) - Fix bug where attachment preview didn't work with x_frame_options=deny (#6688)
- Fix so bin/install-jsdeps.sh returns error code on error (#6704)
RELEASE 1.4-rc1 RELEASE 1.4-rc1
--------------- ---------------

@ -13,7 +13,7 @@
| | | |
| PURPOSE: | | PURPOSE: |
| Utility script to fetch and install all 3rd party javascript | | Utility script to fetch and install all 3rd party javascript |
| libraries unsed in Roundcube from source. | | libraries used in Roundcube from source. |
+-----------------------------------------------------------------------+ +-----------------------------------------------------------------------+
| Author: Thomas Bruederli <thomas@roundcube.net> | | Author: Thomas Bruederli <thomas@roundcube.net> |
+-----------------------------------------------------------------------+ +-----------------------------------------------------------------------+
@ -24,13 +24,14 @@ define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
require_once INSTALL_PATH . 'program/include/clisetup.php'; require_once INSTALL_PATH . 'program/include/clisetup.php';
if (!function_exists('exec')) { if (!function_exists('exec')) {
die("PHP exec() function is required. Check disable_functions in php.ini\n"); rcube::raise_error("PHP exec() function is required. Check disable_functions in php.ini.", false, true);
} }
$SOURCES = json_decode(file_get_contents(INSTALL_PATH . 'jsdeps.json'), true); $cfgfile = INSTALL_PATH . 'jsdeps.json';
$SOURCES = json_decode(file_get_contents($cfgfile), true);
if (empty($SOURCES['dependencies'])) { if (empty($SOURCES['dependencies'])) {
die("ERROR: Failed to read sources from " . INSTALL_PATH . "jsdeps.json\n"); rcube::raise_error("ERROR: Failed to read dependencies list from $cfgfile", false, true);
} }
$CURL = trim(`which curl`); $CURL = trim(`which curl`);
@ -116,7 +117,7 @@ function fetch_from_source($package, $useCache = true, &$filetype = null)
if (!is_readable($cache_file) || !$useCache) { if (!is_readable($cache_file) || !$useCache) {
if (empty($CURL) && empty($WGET)) { if (empty($CURL) && empty($WGET)) {
die("ERROR: Required program 'wget' or 'curl' not found\n"); rcube::raise_error("Required 'wget' or 'curl' program not found.", false, true);
} }
$url = str_replace('$v', $package['version'], $package['url']); $url = str_replace('$v', $package['version'], $package['url']);
@ -133,7 +134,7 @@ function fetch_from_source($package, $useCache = true, &$filetype = null)
$url = str_replace('$v', $package['version'], $package['api_url']); $url = str_replace('$v', $package['version'], $package['api_url']);
$header = 'Accept:application/vnd.github.v3.raw'; $header = 'Accept:application/vnd.github.v3.raw';
echo "Fetching failed. Using Github API on $url\n"; rcube::raise_error("Fetching failed. Using Github API on $url");
if ($CURL) if ($CURL)
exec(sprintf('%s -L -H %s -s %s -o %s', $CURL, escapeshellarg($header), escapeshellarg($url), $cache_file), $out, $retval); exec(sprintf('%s -L -H %s -s %s -o %s', $CURL, escapeshellarg($header), escapeshellarg($url), $cache_file), $out, $retval);
@ -142,7 +143,7 @@ function fetch_from_source($package, $useCache = true, &$filetype = null)
} }
if ($retval !== 0) { if ($retval !== 0) {
die("ERROR: Failed to download source file from " . $url . "\n"); rcube::raise_error("Failed to download source file from $url", false, true);
} }
} }
@ -160,7 +161,7 @@ function extract_filetype($package, &$filetype = null)
$cache_file = $CACHEDIR . '/' . $package['lib'] . '-' . $package['version'] . '.' . $filetype; $cache_file = $CACHEDIR . '/' . $package['lib'] . '-' . $package['version'] . '.' . $filetype;
if (empty($FILEINFO)) { if (empty($FILEINFO)) {
die("ERROR: Required program 'file' not found\n"); rcube::raise_error("Required program 'file' not found.", false, true);
} }
// detect downloaded/cached file type // detect downloaded/cached file type
@ -207,7 +208,7 @@ function compose_destfile($package, $srcfile)
echo "Wrote file " . INSTALL_PATH . $package['dest'] . "\n"; echo "Wrote file " . INSTALL_PATH . $package['dest'] . "\n";
} }
else { else {
die("ERROR: Failed to write destination file " . INSTALL_PATH . $package['dest'] . "\n"); rcube::raise_error("Failed to write destination file " . INSTALL_PATH . $package['dest'], false, true);
} }
} }
@ -219,7 +220,7 @@ function extract_zipfile($package, $srcfile)
global $UNZIP, $CACHEDIR; global $UNZIP, $CACHEDIR;
if (empty($UNZIP)) { if (empty($UNZIP)) {
die("ERROR: Required program 'unzip' not found\n"); rcube::raise_error("Required 'unzip' program not found.", false, true);
} }
$destdir = INSTALL_PATH . $package['dest']; $destdir = INSTALL_PATH . $package['dest'];
@ -228,7 +229,7 @@ function extract_zipfile($package, $srcfile)
} }
if (!is_writeable($destdir)) { if (!is_writeable($destdir)) {
die("ERROR: Cannot write to destination directory $destdir\n"); rcube::raise_error("Cannot write to destination directory: $destdir", false, true);
} }
// pick files from zip archive // pick files from zip archive
@ -237,7 +238,7 @@ function extract_zipfile($package, $srcfile)
echo "Extracting files $pattern into $destdir\n"; echo "Extracting files $pattern into $destdir\n";
exec(sprintf('%s -o %s %s -d %s', $UNZIP, escapeshellarg($srcfile), escapeshellarg($pattern), $destdir), $out, $retval); exec(sprintf('%s -o %s %s -d %s', $UNZIP, escapeshellarg($srcfile), escapeshellarg($pattern), $destdir), $out, $retval);
if ($retval !== 0) { if ($retval !== 0) {
echo "ERROR: Failed to unpack $pattern; " . join('; ' . $out) . "\n"; rcube::raise_error("Failed to unpack $pattern; " . join('; ' . $out));
} }
} }
} }
@ -273,7 +274,7 @@ function extract_zipfile($package, $srcfile)
exec(sprintf('mv -f %s/%s %s/%s', $sourcedir, $src, $destdir, $dest), $out, $retval); exec(sprintf('mv -f %s/%s %s/%s', $sourcedir, $src, $destdir, $dest), $out, $retval);
if ($retval !== 0) { if ($retval !== 0) {
echo "ERROR: Failed to move $src into $destdir/$dest; " . join('; ' . $out) . "\n"; rcube::raise_error("Failed to move $src into $destdir/$dest; " . join('; ' . $out));
} }
} }
@ -285,7 +286,7 @@ function extract_zipfile($package, $srcfile)
echo "Extracting zip archive into $destdir\n"; echo "Extracting zip archive into $destdir\n";
exec(sprintf('%s -o %s -d %s', $UNZIP, escapeshellarg($srcfile), $destdir), $out, $retval); exec(sprintf('%s -o %s -d %s', $UNZIP, escapeshellarg($srcfile), $destdir), $out, $retval);
if ($retval !== 0) { if ($retval !== 0) {
echo "ERROR: Failed to unzip $srcfile; " . join('; ' . $out) . "\n"; rcube::raise_error("Failed to unzip $srcfile; " . join('; ' . $out));
} }
} }
@ -357,7 +358,7 @@ foreach ($SOURCES['dependencies'] as $package) {
} }
if (!empty($package['sha1']) && ($sum = sha1_file($srcfile)) !== $package['sha1']) { if (!empty($package['sha1']) && ($sum = sha1_file($srcfile)) !== $package['sha1']) {
die("ERROR: Incorrect sha1 sum of $srcfile. Expected: {$package['sha1']}, got: $sum\n"); rcube::raise_error("Incorrect sha1 sum of $srcfile. Expected: {$package['sha1']}, got: $sum", false, true);
} }
if ($args['extract']) { if ($args['extract']) {

Loading…
Cancel
Save