From 18bce70c370eabbbfd6f74f736e6c144550a0050 Mon Sep 17 00:00:00 2001 From: Tomas Mlcoch Date: Wed, 7 Nov 2012 16:04:15 +0100 Subject: [PATCH] Add cr_package_nvra function --- src/package.c | 7 +++++++ src/package.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/package.c b/src/package.c index 445cb65..91873bd 100644 --- a/src/package.c +++ b/src/package.c @@ -116,3 +116,10 @@ cr_package_free(cr_Package *package) g_free (package); } + +gchar * +cr_package_nvra(cr_Package *package) +{ + return g_strdup_printf("%s-%s-%s.%s", package->name, package->version, + package->release, package->arch); +} diff --git a/src/package.h b/src/package.h index 931b511..744ea97 100644 --- a/src/package.h +++ b/src/package.h @@ -149,6 +149,13 @@ cr_Package *cr_package_new_without_chunk(void); */ void cr_package_free(cr_Package *package); +/** \ingroup package + * Get NVRA package string + * @param package cr_Package + * @return nvra string + */ +gchar *cr_package_nvra(cr_Package *package); + #ifdef __cplusplus } #endif -- 2.7.4