diff options
-rw-r--r-- | rpmtools.pm | 15 | ||||
-rw-r--r-- | rpmtools.spec | 10 |
2 files changed, 22 insertions, 3 deletions
diff --git a/rpmtools.pm b/rpmtools.pm index b708616..ddad337 100644 --- a/rpmtools.pm +++ b/rpmtools.pm @@ -304,7 +304,7 @@ sub compute_depslist { #- give an id to each packages, start from number of package already #- registered in depslist. my $global_id = scalar @{$params->{depslist}}; - foreach (sort { $ordered{$b->{name}} <=> $ordered{$a->{name}} || $a->{name} cmp $b->{name} } @info) { + foreach (sort { $ordered{$b->{name}} <=> $ordered{$a->{name}} || package_name_compare($a->{name}, $b->{name}) } @info) { $_->{id} = $global_id++; } @@ -570,6 +570,19 @@ sub version_compare { 0; } +#- compare package name to increase chance of avoiding loop in prerequisite chain. +sub package_name_compare { + my ($a, $b) = @_; + my ($sa,$sb); + + ($sa) = ($a =~ /^lib(.*)/); + ($sb) = ($b =~ /^lib(.*)/); + $sa && $sb and return $sa cmp $sb; + $sa and return -1; + $sb and return +1; + $a cmp $b; #- fall back. +} + #- compability function which should be removed soon, do not use anymore and replace code. sub get_packages_installed { my ($prefix, $packages, $names, $flags) = @_; $flags ||= [ qw(name version release)]; diff --git a/rpmtools.spec b/rpmtools.spec index 307caf1..7251d94 100644 --- a/rpmtools.spec +++ b/rpmtools.spec @@ -1,9 +1,11 @@ %define name rpmtools -%define release 22mdk +%define release 23mdk # do not modify here, see Makefile in the CVS %define version 2.3 +%{expand:%%define perlbase_version %(rpm -q --queryformat '%{VERSION}' perl-base)} + Summary: Contains various rpm command-line tools Name: %{name} Version: %{version} @@ -16,7 +18,7 @@ Group: System/Configuration/Packaging BuildRoot: %{_tmppath}/%{name}-buildroot Prefix: %{_prefix} BuildRequires: rpm-devel >= 4.0 bzip2 popt-devel zlib-devel libbzip2-devel db1-devel db2-devel db3-devel perl-devel -Requires: /usr/bin/perl rpm >= 4.0 bzip2 >= 1.0 +Requires: perl-base = %{perlbase_version} rpm >= 4.0 bzip2 >= 1.0 Obsoletes: rpmtools-compat <= 2.0 rpmtools-devel <= 2.0 %description @@ -51,6 +53,10 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/perl5/man/*/* %changelog +* Wed Jun 6 2001 François Pons <fpons@mandrakesoft.com> 2.3-23mdk +- added require on perl-base version used for build. +- fix ordering package to choose libXXX before XXX. + * Tue May 22 2001 François Pons <fpons@mandrakesoft.com> 2.3-22mdk - added arch support. |