From fa69e69d99ad4a1194de5eb4b67355280d4578e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Thu, 13 Feb 2014 08:12:44 +0100 Subject: [PATCH] The slowness of urls-https came from calling sed multiple times Calling it only once means that files are read and written only once too. Total time it takes to run it on the actual fdroiddata dropped from ~25sec to ~6sec. --- tools/urls-https.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tools/urls-https.sh b/tools/urls-https.sh index 5da54ab50f..6fff994951 100755 --- a/tools/urls-https.sh +++ b/tools/urls-https.sh @@ -7,18 +7,18 @@ # meta data leaks. for f in metadata/*.txt; do - # this shows progress based on 1st letter of package name - printf `echo $f | cut -b10` - sed -i 's,http://dl.google.com,https://dl.google.com,g' $f - sed -i 's,http://pypi,https://pypi,g' $f - sed -i 's,http://code.google.com,https://code.google.com,g' $f - sed -i 's,http://github.com,https://github.com,g' $f - sed -i 's,git://github.com,https://github.com,g' $f - sed -i 's,http://\([^.]*\).googlecode.com/svn,https://\1.googlecode.com/svn,g' $f - sed -i 's,http://svn.apache.org/repos,https://svn.apache.org/repos,g' $f - sed -i 's,http://svn.code.sf.net,https://svn.code.sf.net,g' $f - sed -i 's,svn://svn.code.sf.net,https://svn.code.sf.net,g' $f - sed -i 's,http://gitorious.org,https://gitorious.org,g' $f - sed -i 's,git://gitorious.org,https://gitorious.org,g' $f + # this shows progress based on 1st letter of package name + printf `echo $f | cut -b10` + sed -i -e 's,http://dl.google.com,https://dl.google.com,g' \ + -e 's,http://pypi,https://pypi,g' \ + -e 's,http://code.google.com,https://code.google.com,g' \ + -e 's,http://github.com,https://github.com,g' \ + -e 's,git://github.com,https://github.com,g' \ + -e 's,http://\([^.]*\).googlecode.com/svn,https://\1.googlecode.com/svn,g' \ + -e 's,http://svn.apache.org/repos,https://svn.apache.org/repos,g' \ + -e 's,http://svn.code.sf.net,https://svn.code.sf.net,g' \ + -e 's,svn://svn.code.sf.net,https://svn.code.sf.net,g' \ + -e 's,http://gitorious.org,https://gitorious.org,g' \ + -e 's,git://gitorious.org,https://gitorious.org,g' $f done -echo "" +echo