Add VCS to the so_info file 29/246729/4
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Tue, 3 Nov 2020 10:09:15 +0000 (11:09 +0100)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Tue, 3 Nov 2020 20:00:40 +0000 (21:00 +0100)
VCS is read from the rpm database

Change-Id: Ie8359f1ea91bdff9c77517b8d709334ec0e6226e

src/crash-manager/so-info.c

index 410c6a7..b6d9af1 100644 (file)
@@ -294,10 +294,11 @@ char *get_rpm_info_as_string_for_pkgname(Header h, const char *pkg_name)
        const char *version = headerGetString(h, RPMTAG_VERSION);
        const char *release = headerGetString(h, RPMTAG_RELEASE);
        const char *arch    = headerGetString(h, RPMTAG_ARCH);
+       const char *vcs     = headerGetString(h, RPMTAG_VCS);
 
-       if (version == NULL || release == NULL || arch == NULL)
-               _E("Failed to get version, release and arch for: %s", pkg_name);
-       else if (asprintf(&result, "%s;%s;%s;%s", pkg_name, version, release, arch) == -1)
+       if (version == NULL || release == NULL || arch == NULL || vcs == NULL)
+               _E("Failed to get version, release, arch and VCS for: %s", pkg_name);
+       else if (asprintf(&result, "%s;%s;%s;%s;%s", pkg_name, version, release, arch, vcs) == -1)
                _E("asprintf() error: %m");
 
        return result;