Index: openacs-4/packages/acs-admin/www/apm/build-repository.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/Attic/build-repository.tcl,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/acs-admin/www/apm/build-repository.tcl 11 Feb 2004 16:28:05 -0000 1.8
+++ openacs-4/packages/acs-admin/www/apm/build-repository.tcl 11 Feb 2004 17:15:01 -0000 1.9
@@ -1,5 +1,8 @@
ad_page_contract {
Build package repository.
+
+ @cvs-id $Id$
+ @author Lars Pind (lars@collaboraid.biz)
}
# TODO: Build repository in temp dir, then rename
@@ -17,17 +20,24 @@
set repository_dir "[acs_root_dir]/www/repository/"
set repository_url "http://openacs.org/repository/"
+set channel_index_template "/packages/acs-admin/www/apm/repository-channel-index"
+set index_template "/packages/acs-admin/www/apm/repository-index"
+
set exclude_package_list { cms cms-news-demo glossary site-wide-search spam library }
set head_channel "5-1"
+# Set this to 1 to only checkout sample packages -- useful for debugging and testing
+set debug_p 1
+
#----------------------------------------------------------------------
# Prepare output
#----------------------------------------------------------------------
ReturnHeaders
ns_write [ad_header "Building repository"]
+ns_write "
Building OpenACS Package Repository
"
ns_write
#----------------------------------------------------------------------
@@ -80,7 +90,7 @@
set channel_tag($head_channel) HEAD
-ns_write "- Channels are: [array get channel_tag]\n"
+ns_write "
- Channels are: [array get channel_tag]
\n"
#----------------------------------------------------------------------
@@ -93,7 +103,7 @@
cd $work_dir
foreach channel [lsort -decreasing [array names channel_tag]] {
- ns_write "Starting channel $channel with tag $channel_tag($channel)\n"
+ ns_write "Channel $channel using tag $channel_tag($channel)
"
# Wipe and re-create the checkout directory
file delete -force "${work_dir}openacs-4"
@@ -109,22 +119,37 @@
set packages [list]
# Checkout from the tag given by channel_tag($channel)
- if { ![string equal $channel_tag($channel) HEAD] } {
- catch { exec $cvs_command -d $cvs_root -z3 co -r $channel_tag($channel) openacs-4/packages } output
- catch { exec $cvs_command -d $cvs_root -z3 co -r $channel_tag($channel) openacs-4/contrib/packages } output
- cd ${work_dir}dotlrn/packages/
- catch { exec $cvs_command -d $dotlrn_cvs_root -z3 co -r $channel_tag($channel) dotlrn-core } output
- cd $work_dir
+ if { $debug_p } {
+ # Smaller list for debugging purposes
+ set checkout_list [list \
+ $work_dir $cvs_root openacs-4/packages/acs-kernel \
+ $work_dir $cvs_root openacs-4/contrib/packages/bcms \
+ ${work_dir}dotlrn/packages/ $dotlrn_cvs_root dotlrn]
} else {
- catch { exec $cvs_command -d $cvs_root -z3 co openacs-4/packages } output
- catch { exec $cvs_command -d $cvs_root -z3 co openacs-4/contrib/packages } output
- cd ${work_dir}dotlrn/packages/
- catch { exec $cvs_command -d $dotlrn_cvs_root -z3 co dotlrn-core } output
- cd $work_dir
+ # Full list for real use
+ set checkout_list [list \
+ $work_dir $cvs_root openacs-4/packages \
+ $work_dir $cvs_root openacs-4/contrib/packages \
+ ${work_dir}dotlrn/packages/ $dotlrn_cvs_root dotlrn-core]
}
+
+ foreach { cur_work_dir cur_cvs_root cur_module } $checkout_list {
+ cd $cur_work_dir
+ if { ![string equal $channel_tag($channel) HEAD] } {
+ catch { exec $cvs_command -d $cur_cvs_root -z3 co -r $channel_tag($channel) $cur_module } output
+ } else {
+ catch { exec $cvs_command -d $cur_cvs_root -z3 co $cur_module } output
+ }
+ }
+ cd $work_dir
set manifest {}
append manifest \n
+
+ template::multirow create packages \
+ package_path package_key version pretty_name \
+ package_type summary description \
+ release_date vendor_url vendor
foreach packages_dir \
[list "${work_dir}openacs-4/packages" \
@@ -169,9 +194,14 @@
append manifest { } {}
append manifest [ad_quotehtml $version(vendor)] {} \n
+ template::multirow append packages \
+ $package_path $package_key $version(name) $version(package-name) \
+ $version(package.type) $version(summary) $version(description) \
+ $version(release-date) $version(vendor.url) $version(vendor)
+
set apm_file "${channel_dir}${version(package.key)}-${version(name)}.apm"
- ns_write "- Building package $package_key for channel $channel in file $apm_file\n"
+ ns_write "
- Building package $package_key for channel $channel\n"
set files [apm_get_package_files \
-all_db_types \
@@ -222,10 +252,28 @@
puts $fw $manifest
close $fw
- ns_write "
- Channel $channel complete.\n"
+ ns_write "
- Writing $channel index page to ${channel_dir}index.html"
+ set fw [open "${channel_dir}index.html" w]
+ puts $fw [ad_parse_template -params [list channel packages] -- $channel_index_template]
+ close $fw
+
+ ns_write "
- Channel $channel complete.
\n"
}
+ns_write "Finishing Repository
"
+
+# Write the index page
+ns_write "- Writing repository index page to ${work_dir}repository/index.html"
+template::multirow create channels name
+foreach channel [lsort -decreasing [array names channel_tag]] {
+ template::multirow append channels $channel
+}
+set fw [open "${work_dir}repository/index.html" w]
+puts $fw [ad_parse_template -params [list channels] -- $index_template]
+close $fw
+
+
# Without the trailing slash
set work_repository_dirname "${work_dir}repository"
set repository_dirname [string range $repository_dir 0 end-1]
@@ -241,6 +289,6 @@
}
file rename $work_repository_dirname $repository_dirname
-ns_write "
DONE.\n"
+ns_write " DONE
\n"
Index: openacs-4/packages/acs-admin/www/apm/repository-channel-index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/repository-channel-index.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-admin/www/apm/repository-channel-index.adp 11 Feb 2004 17:15:01 -0000 1.1
@@ -0,0 +1,15 @@
+OpenACS Repository Channel @channel@
+
+
+
+ Package |
+ Description |
+
+
+
+ @packages.pretty_name@ key: @packages.package_key@ |
+ @packages.summary@ @packages.description@ |
+
+
+
+
Index: openacs-4/packages/acs-admin/www/apm/repository-index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/repository-index.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-admin/www/apm/repository-index.adp 11 Feb 2004 17:15:01 -0000 1.1
@@ -0,0 +1,10 @@
+OpenACS Package Repository
+
+ Available channels.
+
+
+