From b086eb0cb9b6ffeee0f04bf991d5420640d7b784 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Tue, 22 Jan 2002 18:39:51 +0000 Subject: new 4.1 version. --- rpmtools.pm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'rpmtools.pm') diff --git a/rpmtools.pm b/rpmtools.pm index 3695d73..90727eb 100644 --- a/rpmtools.pm +++ b/rpmtools.pm @@ -6,7 +6,7 @@ use vars qw($VERSION @ISA %compat_arch); require DynaLoader; @ISA = qw(DynaLoader); -$VERSION = '4.0'; +$VERSION = '4.1'; bootstrap rpmtools $VERSION; @@ -141,6 +141,22 @@ sub read_hdlists { @names; } +#- build the synthesis file (normally used by urpmi only) +#- for all package not currently with computed dependencies. +sub write_synthesis_hdlist { + my ($params, $FILE) = @_; + + #- avoid writing already present infos with id. + foreach my $pkg (grep { ! exists $_->{id} } values %{$params->{info}}) { + foreach (qw(provides requires conflicts obsoletes)) { + @{$pkg->{$_} || []} and print $FILE join('@', $pkg->{name}, $_, @{$pkg->{$_} || []}) . "\n"; + } + print $FILE join('@', + $pkg->{name}, 'info', "$pkg->{name}-$pkg->{version}-$pkg->{release}.$pkg->{arch}", + $pkg->{serial} || 0, $pkg->{size} || 0, $pkg->{group}, $pkg->{file} ? ($pkg->{file}) : ()). "\n"; + } +} + #- build an hdlist from a list of files. sub build_hdlist { my ($params, $noclean, $ratio, $dir, $hdlist, @rpms) = @_; -- cgit v1.2.1