#!/usr/bin/tclsh # portbuild package require darwinports # globals set portdir . # Standard procedures proc print_usage args { global argv0 puts "Usage: $argv0 [--target=] \[invoice\]" } proc fatal args { global argv0 puts stderr "$argv0: $args" exit } # Main # KVV kludged this up set target "all" if {$argc > 2} { print_usage } elseif {$argc == 2} { set target [lindex $argv 0] if {[regsub -- "--target=" $target "" target] < 1} { print_usage } set portdir [lindex $argv 1] } elseif {$argc == 1} { set portdir [lindex $argv 0] } darwinports::init darwinports::build $portdir build $target