aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-07-05 13:32:16 +0000
committerFrancois Pons <fpons@mandriva.com>2001-07-05 13:32:16 +0000
commit5e6e33a4661b5116e36524b2bcae8793622c1933 (patch)
tree296f66f9022799b3abd92fa3f720c3f716c2bbbd
parent7ae2c69a2fef5f617f68c5f203e71fa4538de27a (diff)
downloadrpmtools-5e6e33a4661b5116e36524b2bcae8793622c1933.tar
rpmtools-5e6e33a4661b5116e36524b2bcae8793622c1933.tar.gz
rpmtools-5e6e33a4661b5116e36524b2bcae8793622c1933.tar.bz2
rpmtools-5e6e33a4661b5116e36524b2bcae8793622c1933.tar.xz
rpmtools-5e6e33a4661b5116e36524b2bcae8793622c1933.zip
added compute_id method.
-rw-r--r--rpmtools.pm19
-rw-r--r--rpmtools.spec5
2 files changed, 23 insertions, 1 deletions
diff --git a/rpmtools.pm b/rpmtools.pm
index eb9aa14..4cd3f0e 100644
--- a/rpmtools.pm
+++ b/rpmtools.pm
@@ -191,6 +191,25 @@ sub read_rpms {
map { rpmtools::_parse_($_, $params->{flags}, $params->{info}, $params->{provides}) } @rpms;
}
+#- allocate id for newly entered value.
+#- this is no more necessary to compute_depslist on them (and impossible)
+sub compute_id {
+ my ($params) = @_;
+
+ #- avoid recomputing already present infos, take care not to modify
+ #- existing entries, as the array here is used instead of values of infos.
+ my @info = grep { ! exists $_->{id} } values %{$params->{info}};
+
+ #- give an id to each packages, start from number of package already
+ #- registered in depslist.
+ my $global_id = scalar @{$params->{depslist}};
+ foreach (sort { package_name_compare($a->{name}, $b->{name}) } @info) {
+ $_->{id} = $global_id++;
+ push @{$params->{depslist}}, $_;
+ }
+ 1;
+}
+
#- compute dependencies, result in stored in info values of params.
#- operations are incremental, it is possible to read just one hdlist, compute
#- dependencies and read another hdlist, and again.
diff --git a/rpmtools.spec b/rpmtools.spec
index e388e07..171d94f 100644
--- a/rpmtools.spec
+++ b/rpmtools.spec
@@ -1,5 +1,5 @@
%define name rpmtools
-%define release 7mdk
+%define release 8mdk
# do not modify here, see Makefile in the CVS
%define version 3.0
@@ -54,6 +54,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/perl5/man/*/*
%changelog
+* Thu Jul 5 2001 François Pons <fpons@mandrakesoft.com> 3.0-8mdk
+- added compute_id function.
+
* Mon Jul 2 2001 François Pons <fpons@mandrakesoft.com> 3.0-7mdk
- added arch check support for parsehdlist.