summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2010-06-01 19:04:30 +0200
committerMichael Schroeder <mls@suse.de>2010-06-01 19:04:30 +0200
commitfc65f224e926876e547291ad247623d2611bd266 (patch)
treeab72edfde63d007380c2e582b7da16ba95b33ee1 /examples
parent1e89b69f2cad43391427343f8f435d1571eda83c (diff)
downloadlibsolv-fc65f224e926876e547291ad247623d2611bd266.tar.gz
libsolv-fc65f224e926876e547291ad247623d2611bd266.tar.bz2
libsolv-fc65f224e926876e547291ad247623d2611bd266.zip
- do not print license or url lines if NULL
Diffstat (limited to 'examples')
-rw-r--r--examples/solv.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/solv.c b/examples/solv.c
index 96a1fcd..85862d2 100644
--- a/examples/solv.c
+++ b/examples/solv.c
@@ -2794,11 +2794,16 @@ main(int argc, char **argv)
Solvable *s = pool_id2solvable(pool, p);
if (mainmode == MODE_INFO)
{
+ const char *str;
printf("Name: %s\n", solvable2str(pool, s));
printf("Repo: %s\n", s->repo->name);
printf("Summary: %s\n", solvable_lookup_str(s, SOLVABLE_SUMMARY));
- printf("Url: %s\n", solvable_lookup_str(s, SOLVABLE_URL));
- printf("License: %s\n", solvable_lookup_str(s, SOLVABLE_LICENSE));
+ str = solvable_lookup_str(s, SOLVABLE_URL);
+ if (str)
+ printf("Url: %s\n", str);
+ str = solvable_lookup_str(s, SOLVABLE_LICENSE);
+ if (str)
+ printf("License: %s\n", str);
printf("Description:\n%s\n", solvable_lookup_str(s, SOLVABLE_DESCRIPTION));
printf("\n");
}