Skip to content

Commit 96c95ad

Browse files
author
Marius Cramer
committed
- added anothier lock check for apt
- changed language import to use mb_substr
1 parent 02e7eaf commit 96c95ad

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

interface/web/admin/language_import.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function normalize_string($string, $quote, $allow_special = false) {
3636
$new_string = '';
3737

3838
for($c = 0; $c < mb_strlen($string); $c++) {
39-
$char = $string{$c};
39+
$char = mb_substr($string, $c, 1);
4040

4141
if($in_string === true && $escaped === false && $char === $quote) {
4242
// this marks a string end (e.g. for concatenation)

server/lib/classes/cron.d/100-monitor_system_update.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ public function onRunJob() {
7676
/*
7777
* first update the "apt database"
7878
*/
79-
shell_exec('apt-get update');
79+
shell_exec('while fuser /var/lib/apt/lists/lock >/dev/null 2>&1 ; do sleep 2; done; apt-get update');
8080

8181
/*
8282
* Then test the upgrade.
8383
* if there is any output, then there is a needed update
8484
*/
85-
$aptData = shell_exec('while fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do sleep 2; done; apt-get -s -qq dist-upgrade');
85+
$aptData = shell_exec('while fuser /var/lib/dpkg/lock >/dev/null 2>&1 || fuser /var/lib/apt/lists/lock >/dev/null 2>&1 ; do sleep 2; done; apt-get -s -qq dist-upgrade');
8686
if ($aptData == '') {
8787
/* There is nothing to update! */
8888
$state = 'ok';

0 commit comments

Comments
 (0)