diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-03-15 19:13:03 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-03-15 19:13:03 +0000 |
commit | 1c69a2a16eba297caf673fc75dd857c8a3082ab8 (patch) | |
tree | 298da8a6023ebd611fa8d9db4a9d1b9ee2198f94 /clean-rpmsrate | |
parent | 292fc31ae6e7bcf6622fbaa3cb87232e3e19c834 (diff) | |
download | mgatools-1c69a2a16eba297caf673fc75dd857c8a3082ab8.tar mgatools-1c69a2a16eba297caf673fc75dd857c8a3082ab8.tar.gz mgatools-1c69a2a16eba297caf673fc75dd857c8a3082ab8.tar.bz2 mgatools-1c69a2a16eba297caf673fc75dd857c8a3082ab8.tar.xz mgatools-1c69a2a16eba297caf673fc75dd857c8a3082ab8.zip |
make clean-rpmsrate 11.5% faster on average on cached repo directory by
doing less work in the regexp engine and less path walks
elapsed time consistently go down from 0.70 to 0.62 on scores of run
(mainly a win in time spend in the kernel)
Diffstat (limited to 'clean-rpmsrate')
-rwxr-xr-x | clean-rpmsrate | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clean-rpmsrate b/clean-rpmsrate index 2bdac4f..dc7a317 100755 --- a/clean-rpmsrate +++ b/clean-rpmsrate @@ -18,6 +18,9 @@ my $rpmsrate_raw_file = shift @ARGV; my %rpm; foreach my $dir (@ARGV) { - $rpm{$dir} = [ map { s!$dir/?(.*)\.rpm$!$1!; $_ } glob "$dir/*.rpm" ]; + chdir($dir); + $rpm{$dir} = [ map { s!(.*)\.rpm$!$1!; $_ } glob "*.rpm" ]; } +chdir($ENV{PWD}); # in case -o referes to a relative path + cleanrpmsrate($rpmsrate_raw_file, $output_file, \%rpm); |