aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2014-09-06 17:19:17 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2014-09-07 04:38:58 +0200
commitfa1efafb5d4e75534a481f27f57976e332a4003d (patch)
tree6c408e8d513dc0405dd259e07b45954494ab7a9f
parent30312306639015fcb80c36867e3c2e14999d2338 (diff)
downloadrpmtools-fa1efafb5d4e75534a481f27f57976e332a4003d.tar
rpmtools-fa1efafb5d4e75534a481f27f57976e332a4003d.tar.gz
rpmtools-fa1efafb5d4e75534a481f27f57976e332a4003d.tar.bz2
rpmtools-fa1efafb5d4e75534a481f27f57976e332a4003d.tar.xz
rpmtools-fa1efafb5d4e75534a481f27f57976e332a4003d.zip
generates @recommends@ lines on mga5+
(instead of @suggests@ ones)
-rw-r--r--NEWS3
-rwxr-xr-xgenhdlist220
2 files changed, 21 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 89ecd28..2b6f6cd 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- synthesis format change:
+ o generates @recommends@ lines (instead of @suggests@ ones) on mga5+
+
Version 6.6 - 6 September 2014, by Thierry Vignaud
- switch from 'xz -5 --text' to 'xz -7' (much faster for little space overhead)
diff --git a/genhdlist2 b/genhdlist2
index 3daf4aa..4b0a380 100755
--- a/genhdlist2
+++ b/genhdlist2
@@ -3,6 +3,7 @@
our ($VERSION) = q(Id: genhdlist2 20460 2006-11-23 13:19:11Z pixel ) =~ /(\d+\.\d+)/;
use URPM;
+use List::Util 'any';
use MDV::Packdrakeng;
use Getopt::Long;
use strict;
@@ -61,6 +62,18 @@ sub main() {
my ($no_bad_rpm, $verbose);
my $tmp_header;
+sub do_we_use_recommends {
+ my ($rpms_dir) = @_;
+ my @files = glob("$rpms_dir/../../core/release/mageia-release-common*");
+ if (@files) {
+ # fast path:
+ return !any { /mga[1-4]/ } @files;
+ } else {
+ # slow path:
+ return glob("$rpms_dir/*mga[5-9].*.rpm") ? 1 : 0;
+ }
+}
+
sub do_it {
my ($rpms_dir, %options) = @_;
@@ -114,9 +127,11 @@ sub do_it {
$options{xml_info} = -e "$media_info_dir/info.xml$xml_info_suffix";
}
my @xml_media_info = $options{xml_info} ? ('info', 'files', 'changelog') : @{[]};
+ # default to "@suggests@" lines on older distros, "@recommends@" lines on newer:
+ my $output_recommends = do_we_use_recommends($rpms_dir);
build($urpm, \%rpms_todo, $media_info_dir, $rpms_dir, \@xml_media_info, $options{no_incremental}, $options{no_hdlist}, $xml_info_suffix, $xml_info_filter, $synthesis);
- build_synthesis($urpm, "$synthesis.tmp", $synthesis_filter);
+ build_synthesis($urpm, "$synthesis.tmp", $synthesis_filter, $output_recommends);
if (1) {
my @media_info_files = ($options{no_hdlist} ? @{[]} : 'hdlist.cz',
@@ -374,12 +389,13 @@ sub add_pkg_header {
}
sub build_synthesis {
- my ($urpm, $synthesis, $synthesis_filter) = @_;
+ my ($urpm, $synthesis, $synthesis_filter, $output_recommends) = @_;
$urpm->build_synthesis(
start => 0,
end => $#{$urpm->{depslist}},
synthesis => $synthesis,
filter => $synthesis_filter,
+ recommends => $output_recommends,
) or die "build_synthesis failed (disk full?)\n";
}