summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-09-19 14:33:04 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-09-19 14:33:04 +0000
commit26a8b557279b07fc994cbfcd2313d9a176fd50d9 (patch)
tree7ab41f13976aa30a096fef9824caf5e80595e94f
parent432a2fdfb8793208b148ad5f15936f2c0f380532 (diff)
downloadldetect-lst-26a8b557279b07fc994cbfcd2313d9a176fd50d9.tar
ldetect-lst-26a8b557279b07fc994cbfcd2313d9a176fd50d9.tar.gz
ldetect-lst-26a8b557279b07fc994cbfcd2313d9a176fd50d9.tar.bz2
ldetect-lst-26a8b557279b07fc994cbfcd2313d9a176fd50d9.tar.xz
ldetect-lst-26a8b557279b07fc994cbfcd2313d9a176fd50d9.zip
fix update-ldetect-lst ordering of mixed *.lst and *.lst.gzMDK-2006_0
-rw-r--r--ldetect-lst.spec5
-rw-r--r--update-ldetect-lst12
2 files changed, 9 insertions, 8 deletions
diff --git a/ldetect-lst.spec b/ldetect-lst.spec
index 5e88824c..5c870308 100644
--- a/ldetect-lst.spec
+++ b/ldetect-lst.spec
@@ -1,5 +1,5 @@
%define name ldetect-lst
-%define version 0.1.113
+%define version 0.1.114
%define release 1mdk
Name: %{name}
@@ -64,6 +64,9 @@ fi
%{_bindir}/*
%changelog
+* Mon Sep 19 2005 Pixel <pixel@mandriva.com> 0.1.114-1mdk
+- fix update-ldetect-lst ordering of mixed *.lst and *.lst.gz
+
* Sun Sep 18 2005 Thierry Vignaud <tvignaud@mandriva.com> 0.1.113-1mdk
- prevent writing unparsable xorg.conf files
diff --git a/update-ldetect-lst b/update-ldetect-lst
index beabe069..197fe22d 100644
--- a/update-ldetect-lst
+++ b/update-ldetect-lst
@@ -10,16 +10,14 @@ $ARGV[0] eq '--clean' and exit 0;
foreach (@files) {
my $d = "$dir/$_.d";
-d $d or next;
- my @l = sort glob("$d/*.lst");
- my @l_gz = sort glob("$d/*.lst.gz");
- @l || @l_gz or next;
- if (@l == 0 && @l_gz == 1) {
- link $l_gz[0], "$dir/$_.gz";
+ my @l = sort(glob("$d/*.lst"), glob("$d/*.lst.gz")) or next;
+
+ if (@l == 1 && $l[0] =~ /gz$/) {
+ link $l[0], "$dir/$_.gz";
} else {
open(my $OUT, "| gzip -9 > $dir/$_.gz");
- push @l, map { "gzip -dc $_ |" } @l_gz;
foreach (@l) {
- open(my $IN, $_) or next;
+ open(my $IN, /gz$/ ? "gzip -dc $_ |" : $_) or next;
print $OUT $_ foreach <$IN>;
}
}