target_root: Copy a file instead of tar|tar

When we want to install a single file we can copy it instead of using
the tar tar dance.

tar_tar is still left as a fallback if copy fails

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
This commit is contained in:
Otavio Pontes
2020-04-17 15:20:10 -07:00
parent 5e776f8df6
commit 3f189f9278
+6
View File
@@ -278,7 +278,13 @@ static enum swupd_code stage_single_file(struct file *file, struct manifest *mom
if (!file->is_config && !file->is_state && !file->use_xattrs && !file->is_link) {
ret = link(fullfile_path, staged_file);
}
if (ret < 0) {
ret = copy(fullfile_path, staged_file);
}
if (ret < 0) {
// If file failed to link or copy
UNEXPECTED();
ret = install_file_using_tar(fullfile_path, target_path, target_basename);
if (ret) {
goto out;