From: Mateusz Moscicki Date: Tue, 27 Apr 2021 11:53:20 +0000 (+0200) Subject: Add support for delta.tar.gz X-Git-Tag: submit/tizen/20210514.153447~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05c22b52450878c40ca7512ee13f922a0227c21c;p=platform%2Fcore%2Fsystem%2Fupdate-control.git Add support for delta.tar.gz By using compressed delta.tar files, the amount of data that must be downloaded to perform a device update is reduced. Change-Id: I67a0f8405d67d8b07711e421b8fb782e7fadb82f --- diff --git a/update-manager/fota/fota-installer.c b/update-manager/fota/fota-installer.c index 20d7b06..5635ff0 100644 --- a/update-manager/fota/fota-installer.c +++ b/update-manager/fota/fota-installer.c @@ -29,9 +29,15 @@ int fota_installer_execute() client_delta_path = g_strjoin("/", APP_SHARED_DIR, appid, APP_SHARED_DATA, FOTA_DELTA_FILENAME, NULL); if (!g_file_test(client_delta_path, G_FILE_TEST_EXISTS)) { - _FLOGI("%s doesn't have delta.tar", appid); - status = -2; - goto execute_destroy; + gchar *tmp_client_delta_path = client_delta_path; + client_delta_path = g_strconcat(tmp_client_delta_path, ".gz", NULL); + free(tmp_client_delta_path); + + if (!g_file_test(client_delta_path, G_FILE_TEST_EXISTS)) { + _FLOGI("%s doesn't have delta.tar.gz", appid); + status = -2; + goto execute_destroy; + } } /* 2. Check client have appropriate delta */ diff --git a/update-manager/fota/fota-storage-checker.c b/update-manager/fota/fota-storage-checker.c index c04b387..ca50249 100644 --- a/update-manager/fota/fota-storage-checker.c +++ b/update-manager/fota/fota-storage-checker.c @@ -28,8 +28,14 @@ gchar *fota_storage_find_delta(const char* mount_path, const char *folder_name) /* 2. Check storage have delta.tar */ storage_delta_path = g_strjoin("/", mount_path, folder_name, FOTA_DELTA_FILENAME, NULL); if (!g_file_test(storage_delta_path, G_FILE_TEST_EXISTS)) { - _FLOGI("Storage doesn't have %s", storage_delta_path); - goto verify_destroy; + gchar *tmp_storage_delta_path = storage_delta_path; + storage_delta_path = g_strconcat(tmp_storage_delta_path, ".gz", NULL); + free(tmp_storage_delta_path); + + if (!g_file_test(storage_delta_path, G_FILE_TEST_EXISTS)) { + _FLOGI("Storage doesn't have %s", storage_delta_path); + goto verify_destroy; + } } /* 3. Check storage have appropriate delta */