diff options
author | John Hiesey <john@hiesey.com> | 2015-08-25 18:15:53 -0700 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2015-08-26 16:25:28 -0400 |
commit | 43d045309c7d4d72baa889ed4c474ea10f390132 (patch) | |
tree | 73e1d1251b739e1d7050327d9f7d35f061f4f373 | |
parent | 4f57aa5b15cc003f6d785abb706ea685e9d59471 (diff) | |
download | ostree-43d045309c7d4d72baa889ed4c474ea10f390132.tar.gz |
static-delta: Ignore symlinks when computing similar objects
_ostree_delta_compute_similar_objects should not output symlinks.
Previously, a symlink in the "from" commit could be matched to a
real file in the "to" commit, since nothing was filtering symlinks
on the "from" side. This led to failures running the bzdiff
algorithm.
-rw-r--r-- | src/libostree/ostree-repo-static-delta-compilation-analysis.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/libostree/ostree-repo-static-delta-compilation-analysis.c b/src/libostree/ostree-repo-static-delta-compilation-analysis.c index 33647871..876c041f 100644 --- a/src/libostree/ostree-repo-static-delta-compilation-analysis.c +++ b/src/libostree/ostree-repo-static-delta-compilation-analysis.c @@ -76,20 +76,18 @@ build_content_sizenames_recurse (OstreeRepo *repo, { g_autoptr(GFileInfo) finfo = NULL; - csizenames = g_new0 (OstreeDeltaContentSizeNames, 1); - csizenames->checksum = g_strdup (checksum); - - /* Transfer ownership so things get cleaned up if we - * throw an exception below. - */ - g_hash_table_replace (sizenames_map, csizenames->checksum, csizenames); - if (!ostree_repo_load_file (repo, checksum, NULL, &finfo, NULL, cancellable, error)) goto out; - + + if (g_file_info_get_file_type (finfo) != G_FILE_TYPE_REGULAR) + continue; + + csizenames = g_new0 (OstreeDeltaContentSizeNames, 1); + csizenames->checksum = g_strdup (checksum); csizenames->size = g_file_info_get_size (finfo); + g_hash_table_replace (sizenames_map, csizenames->checksum, csizenames); } if (!csizenames->basenames) |