5 wm title .
"LilyPond Contributor's GUI"
6 button .
update -text "Update LilyPond" -command update_lilypond
8 text .output.
text -width 80 -height 15 \
9 -xscrollcommand [list .output.horizontal
set] \
10 -yscrollcommand [list .output.vertical
set]
11 scrollbar .output.horizontal
-orient h
-command [list .output.
text xview
]
12 scrollbar .output.vertical
-orient v
-command [list .output.
text yview
]
13 pack .output.horizontal
-side bottom
-fill x
14 pack .output.vertical
-side right
-fill y
15 pack .output.
text -expand true
-anchor nw
-fill both
18 set lily_dir
$env(HOME
)/lilypond
20 if {![file exists
$lily_dir]} {
21 .
update configure
-text "Clone LilyPond"
24 proc write_to_output
{s
} {
25 .output.
text insert insert
$s
29 proc write_file_to_output
{f
} {
32 fconfigure $f -blocking true
33 if {[catch {close $f} err
]} {
34 tk_messageBox -type ok
-message "Git aborted: $err"
38 write_to_output
[read $f 24]
43 global lily_dir git_command
45 set git_command
[linsert $args 0 "|git" "--git-dir=$lily_dir/.git"]
46 set git_command
"$git_command 2>@1"
47 #.output.text insert end "$git_command\n"
48 set git
[open $git_command r
]
49 fconfigure $git -blocking false
50 fileevent $git readable
[list write_file_to_output
$git]
56 set p
[open [linsert $args 0 "|git" --git-dir
=$lily_dir/.git config
] r
]
57 set result
[regsub "\n\$" [read $p] ""]
62 proc update_lilypond
{} {
64 if {![file exists
$lily_dir]} {
67 git config core.bare false
68 git remote add
-t master
\
69 origin git
://repo.or.cz
/lilypond.git
71 git reset
--hard origin
/master
72 git config branch.master.remote origin
73 git config branch.master.merge refs
/heads
/master
74 .
update configure
-text "Update LilyPond"
77 git merge origin
/master
79 write_to_output
"Done.\n"