nixpkgs/pkgs/build-support/upstream-updater/urls-from-page.sh
Michael Raskin 5a6e313abf Add an automated updater script and definitions for its use for WebKit
svn path=/nixpkgs/trunk/; revision=16816
2009-08-23 22:10:08 +00:00

13 lines
291 B
Bash
Executable file

#! /bin/sh
url="$1"
protocol="${url%%:*}"
path="${url#$protocol://}"
server="${path%%/*}"
relpath="${path#$server}"
echo "URL: $url" >&2
curl -k "$url" | sed -re 's/^/-/;s/[hH][rR][eE][fF]="([^"]*)"/\n+\1\n-/g' | \
sed -e '/^-/d; s/^[+]//; /^#/d;'"s/^\\//$protocol:\\/\\/$server\\//g"