Adding WebDruid log analyzer. In the same time, reworking source autoupdate system a bit

svn path=/nixpkgs/trunk/; revision=16859
This commit is contained in:
Michael Raskin
2009-08-26 11:13:36 +00:00
parent e8931adcf3
commit fbea8a558a
12 changed files with 142 additions and 19 deletions
@@ -1,13 +1,18 @@
#! /bin/sh
set -x
own_dir="$(cd "$(dirname "$0")"; sh -c pwd)"
source "$own_dir/snippets.sh"
main_file="$1"
main_dir="$(cd "$(dirname "$main_file")" ; sh -c pwd)"
file_name="$(basename "$main_file")"
defs_file="$main_dir"/src-info-for-"$file_name"
src_file="$main_dir"/src-for-"$file_name"
new_src_file="$main_dir"/updated-src-for-"$file_name"
# OK, [vcs] revert is always possible
new_src_file="$main_dir"/src-for-"$file_name"
forcedUrl="$2"
@@ -23,8 +28,12 @@ getAttr () {
if [ -z "$forcedUrl" ] ; then
freshUrl="$("$own_dir"/urls-from-page.sh "$(getAttr downloadPage)" |
egrep "$(getAttr sourceRegexp '.*[.]tar[.].*')" |
sh -c "$(getAttr choiceCommand 'head -1')")"
eval "egrep \"$(getAttr sourceRegexp '.*[.]tar[.].*')\"" |
eval "$(getAttr choiceCommand 'head -1')")"
if ! egrep ':' freshUrl ; then
freshUrl="$(dirname "$(getAttr downloadPage).")/$freshUrl"
fi
echo "Found download link: $freshUrl" >&2
else
@@ -37,21 +46,35 @@ if [ x"$freshUrl" = x"$(cat "$src_defs_dir"/advertisedUrl)" ]; then
fi
version="$(echo "$freshUrl" |
sed -re "$(getAttr versionExtractorSedScript \
's/.*-([0-9.]+)[.].*/\1/')")"
eval "sed -re \"$(getAttr versionExtractorSedScript \
's/.*-([0-9.]+)[.].*/\1/')\"")"
mirrorUrl="$(echo "$freshUrl" |
sed -r -e "$(getAttr versionReferenceCreator \
's/-([0-9.]+)[.]/-${version}./')" |
sed -r -e "$(getAttr mirrorSedScript)")"
eval "sed -r -e \"$(getAttr versionReferenceCreator \
's/-([0-9.]+)[.]/-${version}./')\"" |
eval "sed -r -e \"$(getAttr mirrorSedScript)\"")"
hash=$(nix-prefetch-url "$freshUrl")
baseName="$(getAttr baseName 'unnamed-package')"
name="$baseName-$version"
advertisedUrl="$freshUrl"
url="$mirrorUrl"
extraAssignments=""
for i in $(getAttr extraVars ''); do
eval "$(getAttr "eval_$i" 'i=""')"
extraAssignments="$extraAssignments $i=\"$(eval echo \"\$$i\")\";"
done
cat << EOF > "$new_src_file"
rec {
advertisedUrl="$freshUrl";
advertisedUrl="$advertisedUrl";
version = "$version";
url="$mirrorUrl";
url="$url";
hash = "$hash";
name = "$name";
$extraAssignments
}
EOF