Skip to content

Commit

Permalink
Preparing for Quill 0.2.0 release
Browse files Browse the repository at this point in the history
Fixed a bug in 'teacup getbase'.
  • Loading branch information
wduquette committed Aug 31, 2014
1 parent bb545d4 commit 090bef4
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 28 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/bin/*-osx
/bin/*-linux
teapot.txt
/*.zip

# SublimeText files
*.sublime-*
1 change: 0 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ This is the official list of work to be done.

* Fix the distributions in project.quill; they contain different things.
* quill new lib
* Update release docs.
* Building exes:
* Allow "exe" apptype for building in just the local flavor, whatever it is.
* Add check on "teacup" executable for build 298288 or later.
Expand Down
2 changes: 1 addition & 1 deletion lib/quill/pkgIndex.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
#-------------------------------------------------------------------------

# -quill-ifneeded-begin DO NOT EDIT BY HAND
package ifneeded quill 0.2.0a1 [list source [file join $dir pkgModules.tcl]]
package ifneeded quill 0.2.0 [list source [file join $dir pkgModules.tcl]]
# -quill-ifneeded-end

2 changes: 1 addition & 1 deletion lib/quill/pkgModules.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#-----------------------------------------------------------------------

# -quill-provide-begin DO NOT EDIT BY HAND
package provide quill 0.2.0a1
package provide quill 0.2.0
# -quill-provide-end


Expand Down
2 changes: 1 addition & 1 deletion lib/quillapp/pkgIndex.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
#-------------------------------------------------------------------------

# -quill-ifneeded-begin DO NOT EDIT BY HAND
package ifneeded quillapp 0.2.0a1 [list source [file join $dir pkgModules.tcl]]
package ifneeded quillapp 0.2.0 [list source [file join $dir pkgModules.tcl]]
# -quill-ifneeded-end

4 changes: 2 additions & 2 deletions lib/quillapp/pkgModules.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#-----------------------------------------------------------------------

# -quill-provide-begin DO NOT EDIT BY HAND
package provide quillapp 0.2.0a1
package provide quillapp 0.2.0
# -quill-provide-end

#-----------------------------------------------------------------------
Expand All @@ -23,7 +23,7 @@ package provide quillapp 0.2.0a1
# -quill-require-begin INSERT PACKAGE REQUIRES HERE
package require snit 2.3
package require zipfile::encode 0.3
package require quill 0.2.0a1
package require quill 0.2.0
# -quill-require-end

namespace import quill::*
Expand Down
81 changes: 65 additions & 16 deletions lib/quillapp/teacup.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ snit::type ::quillapp::teacup {
# on failure.

typemethod getbase {tcltk version flavor outdir} {
puts "Looking for TCL $version on $flavor"

# FIRST, get the right arch pattern.
switch $flavor {
linux { set arch "linux-*-ix86" }
Expand All @@ -120,39 +122,86 @@ snit::type ::quillapp::teacup {
set table [teacup list --is application --all-platforms \
base-$tcltk-thread]

# NEXT, filter the list for the correct platform.
set ptable [list]

foreach record $table {
set p [dict get $record platform]

if {[string match $arch $p]} {
lappend ptable $record
}
}
set table $ptable

# NEXT, search through the table for the entry that
# matches the arch pattern and best matches the version.
# most exactly matches the version, which is an x.y.z.
lassign [ExactBasekitVersion $table $version] bv bp

if {$bv eq ""} {
set version [VerXY $version]
lassign [ExactBasekitVersion $table $version] bv bp
}

if {$bv eq ""} {
throw NOTFOUND [outdent "
Could not find basekit for $tcltk $version on $flavor
"]
}


set best(platform) ""
set best(version) 0.0
puts "Best match: base-$tcltk-thread $bv $bp"

# NEXT, retrieve it.
call get --is application --output $outdir \
base-$tcltk-thread $bv $bp
}

# VerXY version
#
# version - an x.y.z... version string
#
# Returns the x.y.

proc VerXY {version} {
return [join [lrange [split $version .] 0 1] .]
}

# ExactBasekitVersion table version
#
# table - The table of basekits
# version - The desired version, either x.y.z or x.y
#
# Finds the best matching version, and returns a list
# "version platform", or the empty string on failure.

proc ExactBasekitVersion {table version} {
set bp ""
set bv 0.0

foreach record $table {
set v [dict get $record version]
set p [dict get $record platform]

if {![string match $arch $p]} {
continue
}

# If they asked for 8.5, say, make sure this is an 8.5.
if {![string match $version* $v]} {
if {![string match $version.* $v]} {
continue
}

if {[package vcompare $v $best(version)] == 1} {
set best(platform) $p
set best(version) $v
if {[package vcompare $v $bv] == 1} {
set bp $p
set bv $v
}
}

# NEXT, retrieve it.
call get --is application --output $outdir \
base-$tcltk-thread $best(version) $best(platform)
if {$bv ne "0.0"} {
return [list $bv $bp]
}

return ""
}

# install pkg ver
#
# pkg - a package name
# ver - A version number
#
# Installs the specified package from the default teapot;
Expand Down
11 changes: 8 additions & 3 deletions lib/quillinfo/quillinfo.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ namespace eval ::quillinfo {
variable meta
array set meta {distpat-osx {
bin/quill-osx
%docs
docs/*.html
docs/*/*.html
docs/*.md
%libs
LICENSE
README.md
Expand All @@ -33,10 +35,13 @@ namespace eval ::quillinfo {
README.md
} version-textutil::expander 1.3.1 version-snit 2.3 local-Tcl 0 apps quill local-zipfile::encode 0 distpat-linux {
bin/quill-linux
%docs
docs/*.html
docs/*/*.html
docs/*.md
%libs
LICENSE
README.md
} local-textutil::expander 0 local-snit 0 version 0.2.0a1 version-Tcl 8.6 project tcl-quill dists {linux osx windows}}
} local-textutil::expander 0 local-snit 0 version 0.2.0 version-Tcl 8.6 project tcl-quill dists {linux osx windows}}

namespace export \
project \
Expand Down
11 changes: 8 additions & 3 deletions project.quill
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project tcl-quill 0.2.0a1 "Quill Project Build System for Tcl/Tk"
project tcl-quill 0.2.0 "Quill Project Build System for Tcl/Tk"
homepage http://github.com/wduquette/tcl-quill
app quill -apptypes {linux osx windows}
provide quill
Expand All @@ -10,14 +10,19 @@ require zipfile::encode 0.3

dist linux {
bin/quill-linux
%docs
docs/*.html
docs/*/*.html
docs/*.md
%libs
LICENSE
README.md
}

dist osx {
bin/quill-osx
%docs
docs/*.html
docs/*/*.html
docs/*.md
%libs
LICENSE
README.md
Expand Down

0 comments on commit 090bef4

Please sign in to comment.