diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-07-25 14:22:27 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-07-25 14:22:27 -0400 |
commit | 78e658c8774c5009d9ff601fb6ac9a66810790b6 (patch) | |
tree | 3fb3343293e46876356094894e0f88128f3f52be /utils/file2url | |
parent | 51b5a4b1150234fe8b0040bcab68f51bcd224db0 (diff) |
Makefile: avoid shelling out inside of a loop. Also fix a 'download:' bug.
- This should speed up Makefile parse times
- This is still not avoided for the "magic foreach loop".
- The bug in 'download:' is that it was always using the 'file'; for git
and tar, it needs the 'base'.
Diffstat (limited to 'utils/file2url')
-rwxr-xr-x | utils/file2url | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/utils/file2url b/utils/file2url index 513b7a2..44900b7 100755 --- a/utils/file2url +++ b/utils/file2url @@ -1,10 +1,12 @@ #!/usr/bin/env bash -IFS=/ read -r type url extra <<<"$*" +for file in "$@"; do + IFS=/ read -r type url extra <<<"$file" -url=${url//^2F//} -url=${url//^3A/:} -url=${url//^3D/=} -url=${url//^5E/^} + url=${url//^2F//} + url=${url//^3A/:} + url=${url//^3D/=} + url=${url//^5E/^} -echo "${url}" + echo "${url}" +done |