Process relative URLs

svn path=/nixpkgs/trunk/; revision=34367
nixos-19.03
Michael Raskin 11 years ago
parent 36d30b8279
commit 43bc3880f6
  1. 4
      pkgs/build-support/upstream-updater/urls-from-page.sh

@ -4,9 +4,11 @@ url="$1"
protocol="${url%%:*}"
path="${url#$protocol://}"
server="${path%%/*}"
basepath="${path%/*}"
relpath="${path#$server}"
echo "URL: $url" >&2
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…
Cancel
Save