aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-01-22 18:39:51 +0000
committerFrancois Pons <fpons@mandriva.com>2002-01-22 18:39:51 +0000
commitb086eb0cb9b6ffeee0f04bf991d5420640d7b784 (patch)
tree33bf5113a01ec88299c0c0f9c7cad72a64617eab
parent362a3293bf2f2da458dce726e1c4281533464784 (diff)
downloadrpmtools-b086eb0cb9b6ffeee0f04bf991d5420640d7b784.tar
rpmtools-b086eb0cb9b6ffeee0f04bf991d5420640d7b784.tar.gz
rpmtools-b086eb0cb9b6ffeee0f04bf991d5420640d7b784.tar.bz2
rpmtools-b086eb0cb9b6ffeee0f04bf991d5420640d7b784.tar.xz
rpmtools-b086eb0cb9b6ffeee0f04bf991d5420640d7b784.zip
new 4.1 version.4.1
-rw-r--r--Makefile2
-rwxr-xr-xgendistrib27
-rw-r--r--rpmtools.pm18
-rw-r--r--rpmtools.spec9
4 files changed, 52 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 1538032..d7b4152 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION = 4.0
+VERSION = 4.1
NAME = rpmtools
FROMC = parsehdlist rpm2header #rpm-find-leaves
FROMCC = #gendepslist2 hdlist2names hdlist2files hdlist2prereq hdlist2groups
diff --git a/gendistrib b/gendistrib
index b0e47f3..a570179 100755
--- a/gendistrib
+++ b/gendistrib
@@ -134,6 +134,33 @@ unless ($nobasefiles) {
open F, ">$compss" or die "unable to write compss file $compss";
$params->write_compss(\*F);
close F;
+
+ #- generate all synthesis file.
+ foreach (@hdlists) {
+ if ($_->[0] =~ /(.*)\/hdlist(.*)/) {
+ my $synthesis = "$1/synthesis.hdlist$2";
+ my $params_sense = new rpmtools(qw(sense));
+
+ print STDERR "reading $_->[0]\n";
+ $params_sense->read_hdlists($_->[0]);
+
+ #- use existing provides just generated to
+ #- add missing entries in each package provides list,
+ #- this is really $params and not $params_sense.
+ foreach my $file (keys %{$params->{provides}}) {
+ $file =~ /^\// or next;
+ foreach (keys %{$params->{provides}{$file} || {}}) {
+ my $pkg = $params_sense->{info}{$_} or next;
+ push @{$pkg->{provides}}, $file;
+ }
+ }
+
+ open F, "| gzip -9 >$synthesis";
+ print STDERR "writing $synthesis\n";
+ $params_sense->write_synthesis_hdlist(\*F);
+ close F or print STDERR "unable to build $synthesis\n";
+ }
+ }
} else {
if (-r $provides) {
print STDERR "using existing $provides file\n";
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) = @_;
diff --git a/rpmtools.spec b/rpmtools.spec
index 3b56637..ce93322 100644
--- a/rpmtools.spec
+++ b/rpmtools.spec
@@ -1,8 +1,8 @@
%define name rpmtools
-%define release 7mdk
+%define release 1mdk
# do not modify here, see Makefile in the CVS
-%define version 4.0
+%define version 4.1
%{expand:%%define perlbase_version %(rpm -q --queryformat '%{VERSION}' perl-base)}
%{expand:%%define rpm_version %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' rpm)}
@@ -54,6 +54,11 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/perl5/man/*/*
%changelog
+* Tue Jan 22 2002 François Pons <fpons@mandrakesoft.com> 4.1-1mdk
+- added write_synthesis_hdlist function to handle synthesis file.
+- gendistrib now build good synthesis file in Mandrake/base
+ directory.
+
* Thu Jan 17 2002 François Pons <fpons@mandrakesoft.com> 4.0-7mdk
- added safe guard delay to ensure data is available.
- updated parsehdlist with such above feature.