summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-10-23 09:21:04 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-10-23 09:21:04 +0000
commit961192d783a0cd962e90fe5f0beabb6a7977b25f (patch)
tree141ed6504edbd0abbf689a95bfb664f25954cfb0
parent575726c46f9e4ff3e686afc0c1f1cb7ff1cbda5f (diff)
downloaddrakx-961192d783a0cd962e90fe5f0beabb6a7977b25f.tar
drakx-961192d783a0cd962e90fe5f0beabb6a7977b25f.tar.gz
drakx-961192d783a0cd962e90fe5f0beabb6a7977b25f.tar.bz2
drakx-961192d783a0cd962e90fe5f0beabb6a7977b25f.tar.xz
drakx-961192d783a0cd962e90fe5f0beabb6a7977b25f.zip
simplify previous commit (detect when @l becomes empty instead of not doing
things when it's empty)
-rwxr-xr-xtools/install-xml-file-list12
1 files changed, 5 insertions, 7 deletions
diff --git a/tools/install-xml-file-list b/tools/install-xml-file-list
index f187f746e..f53f6993b 100755
--- a/tools/install-xml-file-list
+++ b/tools/install-xml-file-list
@@ -349,24 +349,22 @@ sub apply_filter {
chdir $to_dir;
foreach (group_by_n(20, $all_files)) {
my @l = $b_flatten ? (map { basename($_) } @$_) : (map { "./$_" } @$_);
- @l = grep { ! -d $_ } @l;
+ @l = grep { ! -d $_ } @l or next;
if (my $subst = $filter->{subst}) {
- system('perl', '-pi', '-e', $subst, @l) if @l;
+ system('perl', '-pi', '-e', $subst, @l);
}
if (my $command = $filter->{command}) {
$command = $initial_dir . "/$command" if $command =~ m!^..?/!;
if ($command =~ /simplify-drakx-modules/) {
- @l = grep { !/\.so($|\.)/ } @l;
+ @l = grep { !/\.so($|\.)/ } @l or next;
}
my @options = (
if_($command eq 'gzip', '-9f'),
if_($command eq 'strip', '2>/dev/null'),
);
- if (@l) {
- warn "running $command @options @l\n" if $verbose;
- system(join(' ', $command, @options, @l));
- }
+ warn "running $command @options @l\n" if $verbose;
+ system(join(' ', $command, @options, @l));
}
}
chdir $initial_dir;