\nOpenACS $channel Compatible Packages\n\n"
+ puts $fw "OpenACS $channel (Git branch $branch)
+ Packages can be installed with the OpenACS Automated Installer on
+ your OpenACS site at /acs-admin/install
. Only packages
+ potentially compatible with your OpenACS kernel will be shown.
+ "
+ set category_title(core) "Core Packages"
+ set package_keys(core) $core_packages
+
+ set category_title(common-app) "Common Applications"
+ set package_keys(common-app) {
+ xowiki
+ xotcl-request-monitor
+ file-storage
+ acs-developer-support
+ forums
+ calendar
+ news
+ faq
+ }
+
+ set category_title(extra) "Extra Packages and Libraries"
+ set package_keys(extra) ""
+ foreach p $packages {
+ if {$p ni $package_keys(core) && $p ni $package_keys(common-app)} {
+ lappend package_keys(extra) $p
+ }
+ }
+
+ foreach category {core common-app extra} {
+
+ template::multirow create pkgs \
+ package_path package_key version pretty_name \
+ package_type summary description \
+ release_date vendor_url vendor \
+ maturity maturity_text \
+ license license_url
+
+ template::multirow foreach packages {
+ if {$package_key in $package_keys($category)} {
+ template::multirow append pkgs \
+ $package_path $package_key $version $pretty_name \
+ $package_type $summary $description \
+ $release_date $vendor_url $vendor \
+ $maturity $maturity_text \
+ $license $license_url
+ }
+ }
+
+ puts $fw "\n$category_title($category)
\n"
+
+ puts $fw [template::adp_include $channel_index_template \
+ [list channel $channel &pkgs pkgs update_pretty_date $update_pretty_date]]
+
+ }
+ close $fw
+
+ ns_log Notice "Repository: Channel $channel complete."
+
+ }
+
+ ns_log Notice "Repository: Finishing Repository"
+
+ foreach channel [dict keys $core_channels] {
+ if {[regexp {^([1-9][0-9]*)-([0-9]+)$} $channel . major minor]} {
+ #
+ # *-compat channels: The "patchlevel" of these channels is
+ # the highest possible value, higher than the released
+ # -final channels.
+ #
+ set tag_order([format %.3d $major]-[format %.3d $minor]-999) $channel
+ set tag_label($channel) "OpenACS $major.$minor"
+ } elseif {[regexp {^([1-9][0-9]*)-([0-9]+)-([0-9]+)$} $channel . major minor patch]} {
+ #
+ # *-final channels: a concrete patchlevel is provided.
+ #
+ set tag_order([format %.3d $major]-[format %.3d $minor]-[format %.3d $patch]) $channel
+ set tag_label($channel) "OpenACS $major.$minor.$patch"
+ } else {
+ set tag_order(999-999-999) $channel
+ set tag_label($channel) "OpenACS $channel"
+ }
+ }
+
+
+ # Write the index page
+ ns_log Notice "Repository: Writing repository index page to ${work_dir}repository/index.adp"
+ template::multirow create channels name tag label
+ foreach key [lsort -decreasing [array names tag_order]] {
+ set channel $tag_order($key)
+ template::multirow append channels $channel [dict get $core_channels $channel] $tag_label($channel)
+ }
+ set fw [open "${work_dir}repository/index.adp" w]
+ puts $fw "\nOpenACS Package Repository\n\n"
+ puts $fw [template::adp_include -- $index_template \
+ [list &channels channels update_pretty_date $update_pretty_date]]
+ close $fw
+
+ # Add a redirector for outdated releases
+ set fw [open "${work_dir}repository/index.vuh" w]
+ puts $fw "ns_returnredirect /repository/"
+ close $fw
+
+ # Without the trailing slash
+ set work_repository_dirname "${work_dir}repository"
+ set repository_dirname [string range $repository_dir 0 end-1]
+ set repository_bak "[string range $repository_dir 0 end-1]_bak"
+
+ ns_log Notice "Repository: Moving work repository $work_repository_dirname to live repository dir at $repository_dir\n"
+
+ if { [file exists $repository_bak] } {
+ file delete -force -- $repository_bak
+ }
+ if { [file exists $repository_dirname] } {
+ file rename -- $repository_dirname $repository_bak
+ }
+ file rename -- $work_repository_dirname $repository_dirname
+
+ ns_log Debug "Repository: DONE"
+
+ return 0
+}
+
#
# Local variables:
# mode: tcl