diff options
author | Francois Pons <fpons@mandriva.com> | 2002-06-18 15:57:58 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2002-06-18 15:57:58 +0000 |
commit | ed94a2cad345d6b1a631f7cedf683a0be9be96c6 (patch) | |
tree | 209a7e5d6d4750df5869cf1f137eebc9675d0f27 | |
parent | eaae50adaa99db6a8d285f5a9122228a88484d2f (diff) | |
download | rpmtools-ed94a2cad345d6b1a631f7cedf683a0be9be96c6.tar rpmtools-ed94a2cad345d6b1a631f7cedf683a0be9be96c6.tar.gz rpmtools-ed94a2cad345d6b1a631f7cedf683a0be9be96c6.tar.bz2 rpmtools-ed94a2cad345d6b1a631f7cedf683a0be9be96c6.tar.xz rpmtools-ed94a2cad345d6b1a631f7cedf683a0be9be96c6.zip |
4.3-3mdk (added genhdlist)
-rw-r--r-- | genhdlist | 51 | ||||
-rw-r--r-- | rpmtools.spec | 5 |
2 files changed, 55 insertions, 1 deletions
diff --git a/genhdlist b/genhdlist new file mode 100644 index 0000000..0521947 --- /dev/null +++ b/genhdlist @@ -0,0 +1,51 @@ +#!/usr/bin/perl + +use strict; +use URPM; +use URPM::Build; +use File::Find; +use File::Path; + +my $urpm = new URPM; +my $tmpdir = "/tmp/genhdlist"; +my $index="hdlist.cz"; +my $synthesis="synthesis.$index"; +my $dir = @ARGV[0] or die "usage: genhdlist <dir>"; + +chdir $dir or die "can't chdir in directory $dir"; + +# get rpm list +my @rpms; +File::Find::find({wanted => \&wanted}, "."); +sub wanted { + if (-f $_ && $_ =~ /^.*\.rpm$/ ) { + print "$File::Find::name\n"; + push(@rpms, $File::Find::name); + } +} +if (!@rpms) { + print "no rpms found, aborting\n"; + exit(0); +} + +# create index file +mkpath($tmpdir); +$urpm->parse_rpms_build_headers(dir => $tmpdir, + rpms => \@rpms); +@{$urpm->{depslist}} > 0 or die "nothing read"; +$urpm->build_hdlist(start => 0, + end => $#{$urpm->{depslist}}, + dir => $tmpdir, + hdlist => $index, + ratio => 9); +rmtree($tmpdir); + +# create synthesis file +$urpm->build_synthesis(start => 0, + end => $#{$urpm->{depslist}}, + synthesis => $synthesis); + +# create list file +open(LIST, "> list") or die "can't create list file list: $!"; +foreach my $rpm (@rpms) { print LIST "$rpm\n" }; +close(LIST); diff --git a/rpmtools.spec b/rpmtools.spec index 7377afd..b77ad9e 100644 --- a/rpmtools.spec +++ b/rpmtools.spec @@ -1,5 +1,5 @@ %define name rpmtools -%define release 2mdk +%define release 3mdk # do not modify here, see Makefile in the CVS %define version 4.3 @@ -53,6 +53,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/perl5/man/*/* %changelog +* Tue Jun 18 2002 François Pons <fpons@mandrakesoft.com> 4.3-3mdk +- added genhdlist (from Guillaume Rousse). + * Mon Jun 3 2002 François Pons <fpons@mandrakesoft.com> 4.3-2mdk - use perl-URPM >= 0.02 (modified interface). |