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

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

            1  +#!/usr/bin/env tclsh
            2  +# KitCreator downloader v0.1.1 -- download Tclkits generated by
            3  +# http://kitcreator.rkeene.org/kitcreator. Works with Tcl 8.5+ and Jim Tcl.
            4  +# Copyright (C) 2016, dbohdan.
            5  +# License: MIT.
            6  +proc download url {
            7  +    set page [split [exec curl -s $url] \n]
            8  +    set descr [lsearch -glob -inline $page *Description:*]
            9  +    regexp {(http://kitcreator.rkeene.org/[^"]+/tclkit)} \
           10  +            [lsearch -glob -inline $page *URL:*] _ url
           11  +
           12  +    set filename tclkit
           13  +
           14  +    regexp {Tcl ([0-9.]+)} $descr _ version
           15  +    append filename -$version
           16  +
           17  +    regexp {Platform ([-a-z0-9]+)} $descr _ platform
           18  +    append filename -$platform
           19  +
           20  +    if {[regexp {packages statically linked} $descr]} {
           21  +        append filename -staticpkgs
           22  +    }
           23  +
           24  +    if {[regexp {Threaded} $descr]} {
           25  +        append filename -threaded
           26  +    }
           27  +
           28  +    if {[regexp {Packages: (.*)} $descr _ packages]} {
           29  +        foreach package $packages {
           30  +            set package [string trimright $package ,]
           31  +            append filename -$package
           32  +        }
           33  +    }
           34  +
           35  +    puts "Downloading $url to $filename..."
           36  +    exec curl -o $filename $url >@ stdout 2>@ stderr
           37  +}
           38  +
           39  +set url [lindex $argv 0]
           40  +if {$url eq {}} {
           41  +    puts "usage: $argv0 url"
           42  +    puts {The URL must be a KitCreator Web Interface build page.}
           43  +} else {
           44  +    download $url
           45  +}