aboutsummaryrefslogtreecommitdiffstats
path: root/genhdlist_cz2
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2000-05-22 18:44:05 +0000
committerFrancois Pons <fpons@mandriva.com>2000-05-22 18:44:05 +0000
commit386b796d218325b85f3903d0ae8b04f04b3a2757 (patch)
treed8c7094f5464a3f169fda2da2942568d7bfdbdee /genhdlist_cz2
parent551fb584eeb15941a36802cedaa75f669234e8e9 (diff)
downloadrpmtools-386b796d218325b85f3903d0ae8b04f04b3a2757.tar
rpmtools-386b796d218325b85f3903d0ae8b04f04b3a2757.tar.gz
rpmtools-386b796d218325b85f3903d0ae8b04f04b3a2757.tar.bz2
rpmtools-386b796d218325b85f3903d0ae8b04f04b3a2757.tar.xz
rpmtools-386b796d218325b85f3903d0ae8b04f04b3a2757.zip
*** empty log message ***
Diffstat (limited to 'genhdlist_cz2')
-rw-r--r--genhdlist_cz217
1 files changed, 12 insertions, 5 deletions
diff --git a/genhdlist_cz2 b/genhdlist_cz2
index ec83e54..6a178a4 100644
--- a/genhdlist_cz2
+++ b/genhdlist_cz2
@@ -38,11 +38,18 @@ my (%keys, @keys);
opendir DIR, $dir or die "unable to opendir $dir: $!\n";
while ($_ = readdir DIR) {
- my ($key) = /(.*)\..*\.rpm$/ or next;
- system("rpm2header $dir/$_ > $key") unless -e $key;
- $? == 0 or unlink($key), die "bad rpm $dir/$_\n";
- -s $key or unlink($key), die "bad rpm $dir/$_\n";
- $keys{$key} = 1;
+ 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 $_, "$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;