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 | |
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)
-rw-r--r-- | NEWS | 1 | ||||
-rwxr-xr-x | clean-rpmsrate | 5 |
2 files changed, 5 insertions, 1 deletions
@@ -3,6 +3,7 @@ o fix matching dkms packages (broken for years...) o fix matching locales-xx_XX for localized packages o fix matching mga extension (broken since mga fork) + o 11.5% faster on average on cached repo directory 0.1: - initial release 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); |