diff options
Diffstat (limited to 'rpmtools.pm')
-rw-r--r-- | rpmtools.pm | 18 |
1 files changed, 17 insertions, 1 deletions
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) = @_; |