diff options
author | Richard Hughes <richard@hughsie.com> | 2014-10-30 09:26:12 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-10-30 09:26:33 +0000 |
commit | a6c656bf7ce08d23051950c07307b356200441f9 (patch) | |
tree | 9716e5d5b1dde6df1e93bd3fb6eba5ff223fb495 | |
parent | 68cfb9556327fa4eae1e8fb214edc79e2d9603cd (diff) | |
download | appstream-glib-a6c656bf7ce08d23051950c07307b356200441f9.tar.gz |
Do not create a hardlink when the target does not exist
This works around a failure to decompress, although the proper fix would be to
do two passes of the archive.
-rw-r--r-- | libappstream-builder/asb-utils.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libappstream-builder/asb-utils.c b/libappstream-builder/asb-utils.c index 0e4a89a..a4f04a5 100644 --- a/libappstream-builder/asb-utils.c +++ b/libappstream-builder/asb-utils.c @@ -249,6 +249,10 @@ asb_utils_explode_file (struct archive_entry *entry, if (tmp != NULL) { g_ptr_array_add (symlink_glob, asb_glob_value_new (tmp, "")); g_snprintf (buf, PATH_MAX, "%s/%s", dir, tmp); + if (!g_file_test (buf, G_FILE_TEST_EXISTS)) { + g_warning ("%s does not exist, cannot hardlink", tmp); + return FALSE; + } archive_entry_update_hardlink_utf8 (entry, buf); } |