From 92247340e10efbf1faeb7d6164e3089d547836a2 Mon Sep 17 00:00:00 2001 From: mithomas Date: Mon, 4 Nov 2019 08:38:10 +0100 Subject: [PATCH] Fixed issues with Z-Push shared folder configuration. (#278) start.sh generated wrong config key for folder id and wrong datatypes for folder type and flags. This has been corrected both there and in the automated tests. --- zpush/commander.yaml | 2 +- zpush/start.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zpush/commander.yaml b/zpush/commander.yaml index 2c4ef49..bd0e815 100644 --- a/zpush/commander.yaml +++ b/zpush/commander.yaml @@ -61,7 +61,7 @@ tests: exit-code: 0 stdout: contains: - - " $additionalFolders = array(\n array('store' => \"SYSTEM\", 'folderrid' => \"42\", 'name' => \"Calendar\", 'type' => \"SYNC_FOLDER_TYPE_USER_APPOINTMENT\", 'flags' => \"4\"),\n array('store' => \"SYSTEM\", 'folderrid' => \"21\", 'name' => \"Mail\", 'type' => \"SYNC_FOLDER_TYPE_USER_MAIL\", 'flags' => \"0\"),\n );" + - " $additionalFolders = array(\n array('store' => \"SYSTEM\", 'folderid' => \"42\", 'name' => \"Calendar\", 'type' => SYNC_FOLDER_TYPE_USER_APPOINTMENT, 'flags' => 4),\n array('store' => \"SYSTEM\", 'folderid' => \"21\", 'name' => \"Mail\", 'type' => SYNC_FOLDER_TYPE_USER_MAIL, 'flags' => 0),\n );" not-contains: # default entry - "\t$additionalFolders = array(" - "\t);" diff --git a/zpush/start.sh b/zpush/start.sh index a7b24f8..df9eb29 100755 --- a/zpush/start.sh +++ b/zpush/start.sh @@ -106,7 +106,7 @@ perl -i -0pe 's/\$additionalFolders.*\);//s' /etc/z-push/z-push.conf.php echo -e " \$additionalFolders = array(" >> /etc/z-push/z-push.conf.php echo "$ZPUSH_ADDITIONAL_FOLDERS" | jq -c '.[]' | while read -r folder; do eval "$(echo "$folder" | jq -r '@sh "NAME=\(.name) ID=\(.id) TYPE=\(.type) FLAGS=\(.flags)"')" - echo -e " array('store' => \"SYSTEM\", 'folderrid' => \"$ID\", 'name' => \"$NAME\", 'type' => \"$TYPE\", 'flags' => \"$FLAGS\")," >> /etc/z-push/z-push.conf.php + echo -e " array('store' => \"SYSTEM\", 'folderid' => \"$ID\", 'name' => \"$NAME\", 'type' => $TYPE, 'flags' => $FLAGS)," >> /etc/z-push/z-push.conf.php done echo -e ' );' >> /etc/z-push/z-push.conf.php