

if {![info exists tcl::pkgCache]} {
    error "tcl::pkgCache not set.  Exiting"
}

tclLog "Clearing package cache..."
foreach package [package names] {
    foreach version [package versions $package] {
	package forget $package $version
    }
}

tclLog "Prime package cache:"
tclPkgUnknown Tcl 8.4

tclLog "Regenerating $::tcl::pkgCache"
set fp [open $::tcl::pkgCache w]
foreach package [package names] {
    foreach version [package versions $package] {
	puts $fp [list package ifneeded $package $version \
		      [package ifneeded $package $version]]
    }
}
close $fp

tclLog "Done."
