tcl-hacks

Check-in [da116e30d4]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:note some immediate fixme's
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:da116e30d439528d43dd034a572c923ab7866b7e
User & Date: aspect 2018-07-24 13:14:37
Context
2018-07-24
13:25
Note some teapot deficiencies while they're fresh check-in: 97b423d7fc user: aspect tags: trunk
13:14
note some immediate fixme's check-in: da116e30d4 user: aspect tags: trunk
13:12
follow dependencies in install! check-in: 3efe5804f5 user: aspect tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to hacks/cuppa/tpc.tcl.

427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
...
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
...
594
595
596
597
598
599
600

601
602
603
604
605
606
607
        db eval {
            select format, data from packages where pkgindex_id = :rowid
        } row {
            log "Already have $name $args"
            return -type ignore [dict merge $_ [row_as_dict row]]
        }
        set data [download $name {*}$args]
        if {[is_zipdata $data]} {
            set format "zip"
        } else {
            set format "tm"
        }
        db eval {
            insert into packages (data, format, pkgindex_id) values (:data, :format, :rowid);
        }
................................................................................
    }]]
}

proc install {dir name args} {
    set fd [open $dir/tclenv.txt r+]
    finally close $fd

    # FIXME: read params from this file
    seek $fd 0 end

    # collect dependencies ..
    set deps {}
    lappend deps [dict create name $name {*}$args]

    for {set i 0} {$i < [llength $deps]} {incr i} {
................................................................................
        dict with _ {}

        switch $type {
            "profile" {
                log "$name is a profile, nothing to install"
            }
            "application" {

                createfile [set loc $dir/bin/$name] $data -permissions 0755
            }
            "package" {
                switch $format {
                    "tm" {
                        createfile [set loc $dir/modules/$name-$ver.tm] $data
                    }







|







 







|







 







>







427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
...
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
...
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
        db eval {
            select format, data from packages where pkgindex_id = :rowid
        } row {
            log "Already have $name $args"
            return -type ignore [dict merge $_ [row_as_dict row]]
        }
        set data [download $name {*}$args]
        if {[is_zipdata $data]} {               ;# FIXME: must use http content-type, as there are executables too
            set format "zip"
        } else {
            set format "tm"
        }
        db eval {
            insert into packages (data, format, pkgindex_id) values (:data, :format, :rowid);
        }
................................................................................
    }]]
}

proc install {dir name args} {
    set fd [open $dir/tclenv.txt r+]
    finally close $fd

    # FIXME: read params from this file, so we know what's already installed
    seek $fd 0 end

    # collect dependencies ..
    set deps {}
    lappend deps [dict create name $name {*}$args]

    for {set i 0} {$i < [llength $deps]} {incr i} {
................................................................................
        dict with _ {}

        switch $type {
            "profile" {
                log "$name is a profile, nothing to install"
            }
            "application" {
                # FIXME: think of extension
                createfile [set loc $dir/bin/$name] $data -permissions 0755
            }
            "package" {
                switch $format {
                    "tm" {
                        createfile [set loc $dir/modules/$name-$ver.tm] $data
                    }