#!/usr/local/ActiveTcl/bin/tclsh lappend auto_path /usr/local/ActiveTcl/lib; # commitCheck.tcl ################################################################# set user [lindex $argv 0]; set repository [lindex $argv 1]; set fileList [lrange $argv 2 end]; puts "Attempting commit:\n${argv}\nUser:$user Repos:$repository Files:\n$fileList"; set checkoutAll 0; switch $user { "heyu" - "ldong" { puts "Permission always granted to the mighty CVSAdmin!"; #Source cvsDb.tcl for history recording #source [file join $env(CVSROOT) CVSROOT cvsDb.tcl]; puts "Recording history"; #appendHist [list action COMMIT username $user repository "$repository" comment "Commit: $fileList"] Y; exit 0; } default { puts "Verifying permissions..."; } } if { [catch { #Temporary controls until we can import actual scripts: switch -regexp $repository { "^/cvsroot/database/oracle/gtss2" - "^/cvsroot/database/oracle/gtss2/*" { puts "Commits to this repository currently disabled. Contact administrator (4-2062) for more info." exit 1; } } switch -regexp $repository { "^/usr/local/cvsroot/project/dev" { switch $user { "id" { puts "Permission Granted- Development Area"; puts "Have a nice day." } default { puts "You don't have permission to commit to Development."; exit 1; } } } "^/usr/local/cvsroot/project/qa" { switch $user { "id" - "id2" - "id3" { puts "Permission Granted- qa Area"; puts "Have a nice day." } default { puts "You don't have permission to commit to qa."; exit 1; } } } default { switch $user { default { puts "You don't have permission to commit to this project (${repository}). Contact administrator." exit 1; } } } } } ret] } { #Error! puts "CVS Server error. Email me with this info:$::errorInfo"; exit 1; } else { #Success! #if {$checkoutAll == 1} { # exec /cvsroot/CVSROOT/checkoutAll.tcl &; #} exit 0; }