2 # This is a helper script for FUBAR, which creates user preferences
3 # directory and populates it with default files, taken from system-wide
7 if [llength [info command link]] {
8 proc symlink {source dest} {
9 link -sym $source $dest
12 proc symlink {source dest} {
13 exec ln -s $source $dest
17 # variables CONFIGDIR and LIBRARYDIR should be provided by invoking
20 proc copyhier {src dest} {
22 foreach f [glob -nocomplain $src/*] {
23 set s [file join $dest [file tail $f]]
24 if [catch {file readlink $f} d] {
25 if [file isdirectory $f] {
38 copyhier $LIBRARYDIR/menu $CONFIGDIR/menu
40 foreach file [glob -nocomplain $LIBRARYDIR/plugins/*] {
42 if {[string match *.txt $file]} continue
43 symlink $f [file join $CONFIGDIR plugins [file tail $file]]
46 foreach f {hosts associations holydays} {
47 if [file exists $LIBRARYDIR/$f] {
48 file copy $LIBRARYDIR/$f $CONFIGDIR/$f
52 symlink $LIBRARYDIR/mail $CONFIGDIR/mail
54 close [open "$CONFIGDIR/phonebook" a+]