mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
Process relative URLs
svn path=/nixpkgs/trunk/; revision=34367
This commit is contained in:
parent
36d30b8279
commit
43bc3880f6
@ -4,9 +4,11 @@ url="$1"
|
|||||||
protocol="${url%%:*}"
|
protocol="${url%%:*}"
|
||||||
path="${url#$protocol://}"
|
path="${url#$protocol://}"
|
||||||
server="${path%%/*}"
|
server="${path%%/*}"
|
||||||
|
basepath="${path%/*}"
|
||||||
relpath="${path#$server}"
|
relpath="${path#$server}"
|
||||||
|
|
||||||
echo "URL: $url" >&2
|
echo "URL: $url" >&2
|
||||||
|
|
||||||
curl -L -k "$url" | sed -re 's/^/-/;s/[hH][rR][eE][fF]="([^"]*)"/\n+\1\n-/g' | \
|
curl -L -k "$url" | sed -re 's/^/-/;s/[hH][rR][eE][fF]="([^"]*)"/\n+\1\n-/g' | \
|
||||||
sed -e '/^-/d; s/^[+]//; /^#/d;'"s/^\\//$protocol:\\/\\/$server\\//g"
|
sed -e '/^-/d; s/^[+]//; /^#/d;'"s/^\\//$protocol:\\/\\/$server\\//g" | \
|
||||||
|
sed -re 's~^[^:]*$~'"$protocol://$basepath/&~"
|
||||||
|
Loading…
Reference in New Issue
Block a user