From a3cc7c69783fb325cc691344473608eb3e72e8b6 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 27 Aug 2014 16:07:43 +0200 Subject: add support for generating recommends in synthesis aka having @recommends@ lines instead of @suggests@ ones Conflicts: NEWS URPM.xs --- NEWS | 2 ++ URPM.xs | 5 +++-- URPM/Build.pm | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 324d067..bd5d4f5 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,7 @@ - make it compatible with rpm-4.12.0 - use new recommends tags instead of suggests ones +- add support for generating @recommends@ lines instead of @suggests@ ones in + synthesis Version 4.31 - 27 June 2014 diff --git a/URPM.xs b/URPM.xs index 46fc2a9..80552fb 100644 --- a/URPM.xs +++ b/URPM.xs @@ -2066,10 +2066,11 @@ Pkg_free_header(pkg) pkg->h = NULL; void -Pkg_build_info(pkg, fileno, provides_files=NULL) +Pkg_build_info(pkg, fileno, provides_files=NULL, recommends=0) URPM::Package pkg int fileno char *provides_files + int recommends CODE: if (pkg->info) { char buff[65536*2]; @@ -2099,7 +2100,7 @@ Pkg_build_info(pkg, fileno, provides_files=NULL) if (size < sizeof(buff)) write_nocheck(fileno, buff, size); } if (pkg->suggests && *pkg->suggests) { - size = snprintf(buff, sizeof(buff), "@suggests@%s\n", pkg->suggests); + size = snprintf(buff, sizeof(buff), recommends ? "@recommends@%s\n" : "@suggests@%s\n", pkg->suggests); if (size < sizeof(buff)) write_nocheck(fileno, buff, size); } if (pkg->summary && *pkg->summary) { diff --git a/URPM/Build.pm b/URPM/Build.pm index acf8335..3ac41a8 100644 --- a/URPM/Build.pm +++ b/URPM/Build.pm @@ -415,6 +415,7 @@ sub build_hdlist { #- start : index of first package (defaults to first index of depslist). #- end : index of last package (defaults to last index of depslist). #- idlist : id list of rpm to compute (defaults is start .. end) +#- recommends: output recommends instead of suggest #- ratio : compression ratio (default 9). #- filter : program to filter through (default is 'gzip -$ratio'). #- returns true on success @@ -449,7 +450,7 @@ sub build_synthesis { delete @files{$pkg->provides_nosense}; } - $pkg->build_info($options{synthesis} ? fileno $fh : $options{fd}, join('@', keys %files)); + $pkg->build_info($options{synthesis} ? fileno $fh : $options{fd}, join('@', keys %files), $options{recommends}); } close $fh; # returns true on success } -- cgit v1.2.1