+2020-03-03 Aaron Merey <amerey@redhat.com>
+
+ * debuginfod-client.c (debuginfod_query_server): Update
+ cache_path even when new default path already exists.
+
2020-02-27 Aaron Merey <amerey@redhat.com>
* debuginfod-client.c (xalloc_str): New macro. Call
/* Also check for EEXIST and S_ISDIR in case another client just
happened to create the cache. */
- if (rc == 0
- || (errno == EEXIST
- && stat (cachedir, &st) != 0
- && S_ISDIR (st.st_mode)))
- {
- free (cache_path);
- xalloc_str (cache_path, "%s/%s", cachedir, cache_xdg_name);
- }
- else
+ if (rc < 0
+ && (errno != EEXIST
+ || stat (cachedir, &st) != 0
+ || ! S_ISDIR (st.st_mode)))
{
rc = -errno;
goto out;
}
}
+
+ free (cache_path);
+ xalloc_str (cache_path, "%s/%s", cachedir, cache_xdg_name);
}
}
exit 1
fi
+# $HOME/.cache should be found.
+testrun env HOME=$PWD/tmphome XDG_CACHE_HOME= DEBUGINFOD_CACHE_PATH= ${abs_top_builddir}/debuginfod/debuginfod-find executable $BUILDID
+if [ ! -f $PWD/tmphome/.cache/debuginfod_client/$BUILDID/executable ]; then
+ echo "could not find cache in $PWD/tmphome/.cache"
+ exit 1
+fi
+
# $XDG_CACHE_HOME should take priority over $HOME.cache.
testrun env HOME=$PWD/tmphome XDG_CACHE_HOME=$PWD/tmpxdg DEBUGINFOD_CACHE_PATH= ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $BUILDID
if [ ! -f $PWD/tmpxdg/debuginfod_client/$BUILDID/debuginfo ]; then