$OpenBSD: patch-installer_tcl,v 1.2 2011/01/05 16:37:10 stu Exp $
--- installer.tcl.orig	Wed Jan 21 23:00:46 2009
+++ installer.tcl	Tue Oct  5 01:23:46 2010
@@ -65,18 +65,25 @@ if {![package vsatisfies [package provide Tcl] 8.0]} {
     puts  $index "unset maindir"
     puts  $index ""
     close $index
+    file attributes [file join $outdir pkgIndex.tcl] -owner root -group bin -permissions 0444
     return
 }
 
 proc xcopyfile {src dest} {
     # dest can be dir or file
     run file copy -force $src $dest
+    if {[file isdirectory $dest]} {
+	set dest [file join $dest [file tail $src]]
+    }
+    file attributes $dest -owner root -group bin -permissions 0444
     return
 }
 
 proc xcopy {src dest recurse {pattern *}} {
     run file mkdir $dest
+    file attributes $dest -owner root -group bin -permissions 0755
     foreach file [glob [file join $src $pattern]] {
+	if {[file extension $file] eq ".orig"} { continue }
         set base [file tail $file]
 	set sub  [file join $dest $base]
 
@@ -100,6 +107,7 @@ proc write_out {f text} {
     catch {file delete -force $f}
     puts -nonewline [set of [open $f w]] $text
     close $of
+    file attributes $f -owner root -group bin -permissions 0444
 }
 
 
@@ -160,7 +168,6 @@ proc doinstall {} {
 
     if {$config(pkg)}       {
 	xinstall   pkg $config(pkg,path)
-	gen_main_index $config(pkg,path) $tklib_name $tklib_version
     }
     if {$config(doc,nroff)} {
 	set config(man.macros) [string trim [get_input [file join $distribution man.macros]]]
