aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-01-22 12:53:40 +0000
committerFrancois Pons <fpons@mandriva.com>2001-01-22 12:53:40 +0000
commit5804b221839844741bf787e065c4db9b2670de95 (patch)
treed8f5d7ec7ab72afcdf7e377fcb8cf7ced870372d
parent41355045f77377466d8ddf6fd74c6459b83f1ea6 (diff)
downloadrpmtools-5804b221839844741bf787e065c4db9b2670de95.tar
rpmtools-5804b221839844741bf787e065c4db9b2670de95.tar.gz
rpmtools-5804b221839844741bf787e065c4db9b2670de95.tar.bz2
rpmtools-5804b221839844741bf787e065c4db9b2670de95.tar.xz
rpmtools-5804b221839844741bf787e065c4db9b2670de95.zip
modified to use rpmtools module.
-rw-r--r--genhdlists19
1 files changed, 11 insertions, 8 deletions
diff --git a/genhdlists b/genhdlists
index 7c62cfc..a34af88 100644
--- a/genhdlists
+++ b/genhdlists
@@ -1,7 +1,11 @@
#!/usr/bin/perl
-($noclean, @ARGV) = @ARGV if $ARGV[0] eq "--noclean";
-(undef, $root, @ARGV) = @ARGV if $ARGV[0] eq "--distrib";
+use rpmtools;
+
+$params = new rpmtools;
+
+($params->{options}{noclean}, @ARGV) = @ARGV if $ARGV[0] eq "--noclean";
+(undef, $root, @ARGV) = @ARGV if $ARGV[0] eq "--distrib";
$root && @ARGV == 0 or die
"usage: genhdlists [--noclean] --distrib <root distrib>
@@ -10,6 +14,10 @@ $root && @ARGV == 0 or die
$depslist = "$root/Mandrake/base/depslist.ordered";
$hdlists = "$root/Mandrake/base/hdlists";
+open F, $depslist;
+$params->read_depslist(\*F);
+close F;
+
open F, $hdlists or die "unable to open $hdlists";
foreach (<F>) {
chomp;
@@ -18,12 +26,7 @@ foreach (<F>) {
m/^\s*(hdlist\S*\.cz2?)\s+(\S+)\s*(.*)$/ or die "invalid hdlist description \"$_\" in hdlists file";
my ($hdlist, $dir, $descr) = ($1, $2, $3);
- my $command = "genhdlist_cz2";
- $noclean and $command .= " --noclean";
- -e $depslist and $command .= " --ordered-depslist $depslist";
- $command .= " -o $root/Mandrake/base/$hdlist $root/$dir";
- system($command);
- system("touch $root/Mandrake/base/$hdlist");
+ $params->build_hdlist("$root/Mandrake/base/$hdlist", glob("$root/$dir/*.rpm"));
}
close F;