aboutsummaryrefslogtreecommitdiffstats
path: root/genhdlist_cz2
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-08-05 19:04:10 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-08-05 19:04:10 +0000
commit9be8d3b3407562628b07f0b2c27b673ef208f225 (patch)
tree90b9744ee4fc8b953fc120ff38671d44c35aa35f /genhdlist_cz2
parenteac9649e7ca04a812481abb66c922c2345ef9207 (diff)
downloadrpmtools-9be8d3b3407562628b07f0b2c27b673ef208f225.tar
rpmtools-9be8d3b3407562628b07f0b2c27b673ef208f225.tar.gz
rpmtools-9be8d3b3407562628b07f0b2c27b673ef208f225.tar.bz2
rpmtools-9be8d3b3407562628b07f0b2c27b673ef208f225.tar.xz
rpmtools-9be8d3b3407562628b07f0b2c27b673ef208f225.zip
- remove obsolete stuff4.5.2
- move packdrake.pm in its own directory to make MakeMaker happy
Diffstat (limited to 'genhdlist_cz2')
-rw-r--r--genhdlist_cz265
1 files changed, 0 insertions, 65 deletions
diff --git a/genhdlist_cz2 b/genhdlist_cz2
deleted file mode 100644
index 513358c..0000000
--- a/genhdlist_cz2
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/perl
-
-($noclean, @ARGV) = @ARGV if $ARGV[0] eq "--noclean";
-(undef, $depslist, @ARGV) = @ARGV if $ARGV[0] eq "--ordered-depslist";
-(undef, $hdlist, @ARGV) = @ARGV if $ARGV[0] eq "-o";
-(undef, $root, @ARGV) = @ARGV if $ARGV[0] eq "--distrib";
-
-$hdlist && @ARGV == 1 || $root && @ARGV == 0 or die
-"usage: genhdlist_cz2 [--noclean] [--ordered-depslist <depslist>] -o <hdlist_cz2> <rpm dir>
- or genhdlist_cz2 [--noclean] --distrib <root distrib>
-";
-
-chop($pwd = `pwd`);
-
-if ($root) {
- $root = "$pwd/$root" if $root !~ m|^/|;
- $depslist = "$root/Mandrake/base/depslist.ordered";
- $hdlist = "$root/Mandrake/base/hdlist.cz2";
- $dir = "$root/Mandrake/RPMS";
- $ENV{PATH} = "$ENV{PATH}:$root/misc";
-} else {
- ($dir) = @ARGV;
-}
-
-$depslist = "$pwd/$depslist" if $depslist !~ m|^/|;
-$hdlist = "$pwd/$hdlist" if $hdlist !~ m|^/|;
-$dir = "$pwd/$dir" if $dir !~ m|^/|;
-
-$tmpdir = $ENV{TMPDIR} || "/tmp";
-$work_dir = "$tmpdir/.build_hdlist";
-
-
--e $work_dir && !-d $work_dir and unlink($work_dir) || die "cannot use $work_dir as a working directory";
-chmod 0755, $work_dir or system("rm -rf $work_dir");
--d $work_dir or mkdir $work_dir, 0755 or die "cannot create working directory $work_dir\n";
-chdir $work_dir;
-
-my (%keys, @keys);
-
-opendir DIR, $dir or die "unable to opendir $dir: $!\n";
-while ($_ = readdir DIR) {
- my ($key, $arch) = /(.*)\.(.*)\.rpm$/ or next;
- system("rpm2header $dir/$_ > $_") unless -e $_;
- $? == 0 or unlink($_), die "bad rpm $dir/$_\n";
- -s $_ or unlink($_), die "bad rpm $dir/$_\n";
- if ($keys{$key}) {
- my ($name, $tail) = $key =~ /(.*)(-[^-]*-[^-]*)/;
- $keys{"$name($keys{$key})$tail"} = $keys{$key}; unlink "$name($keys{$key})$tail"; link "$key.$keys{$key}.rpm", "$name($keys{$key})$tail";
- $keys{"$name($arch)$tail"} = $arch; unlink "$name($arch)$tail"; link $_, "$name($arch)$tail";
- delete $keys{$key};
- } else {
- $keys{$key} = $arch; unlink $key; link $_, $key;
- }
-}
-if (-e $depslist) {
- open F, $depslist;
- @keys = map { (split)[0] } <F>;
-}
-@keys = grep { delete $keys{$_} } @keys;
-
-open B, "| packdrake -b9s $hdlist 400000";
-foreach (@keys, keys %keys) { print B "$_\n" }
-close B or die "packdrake failed\n";
-
-system("rm -rf $work_dir") unless $noclean;