Check-in [0c51e0404a]
Overview
SHA1:0c51e0404af60a84651b104485346e61eb4b32c0
Date: 2016-03-08 17:44:03
User: dbohdan
Comment:Added build/utils/kitcreator-downloader.tcl, a script to download Tclkits built with the Web Interface
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2016-03-08
18:20
[0aa347b99c] KitCreator downloader: use /buildinfo URLs instead of parsing building pages. (user: dbohdan, tags: trunk)
17:44
[0c51e0404a] Added build/utils/kitcreator-downloader.tcl, a script to download Tclkits built with the Web Interface (user: dbohdan, tags: trunk)
2016-03-07
20:28
[91026bbefb] Grouped options better in KitCreator Web UI (user: rkeene, tags: trunk)
Changes

Added build/utils/kitcreator-downloader.tcl version [a94515b53d].



























































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env tclsh
# KitCreator downloader v0.1.1 -- download Tclkits generated by
# http://kitcreator.rkeene.org/kitcreator. Works with Tcl 8.5+ and Jim Tcl.
# Copyright (C) 2016, dbohdan.
# License: MIT.
proc download url {
    set page [split [exec curl -s $url] \n]
    set descr [lsearch -glob -inline $page *Description:*]
    regexp {(http://kitcreator.rkeene.org/[^"]+/tclkit)} \
            [lsearch -glob -inline $page *URL:*] _ url

    set filename tclkit

    regexp {Tcl ([0-9.]+)} $descr _ version
    append filename -$version

    regexp {Platform ([-a-z0-9]+)} $descr _ platform
    append filename -$platform

    if {[regexp {packages statically linked} $descr]} {
        append filename -staticpkgs
    }

    if {[regexp {Threaded} $descr]} {
        append filename -threaded
    }

    if {[regexp {Packages: (.*)} $descr _ packages]} {
        foreach package $packages {
            set package [string trimright $package ,]
            append filename -$package
        }
    }

    puts "Downloading $url to $filename..."
    exec curl -o $filename $url >@ stdout 2>@ stderr
}

set url [lindex $argv 0]
if {$url eq {}} {
    puts "usage: $argv0 url"
    puts {The URL must be a KitCreator Web Interface build page.}
} else {
    download $url
}