Index: openacs.org-dev/www/packages/package-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/www/packages/package-list.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs.org-dev/www/packages/package-list.tcl 13 Jul 2002 17:53:20 -0000 1.1 @@ -0,0 +1,102 @@ +ad_page_contract { + + Show all packages available. Hackish right now, will have to fix it. + + @author Roberto Mello + @cvs-id $Id: package-list.tcl,v 1.1 2002/07/13 17:53:20 rmello Exp $ + +} { + {install_path [apm_workspace_install_dir]} +} + +ad_return_top_of_page "[ad_header "Package List"]" + +### Selection Phase +set spec_files [apm_scan_packages $install_path] + +# Nothing in the install dir, maybe they just copied the files in under packages. +if { [empty_string_p $spec_files] } { + set actual_install_path "[acs_root_dir]/packages" + set spec_files [apm_scan_packages $actual_install_path] + # We don't need to copy any files, because they are already there. + ad_set_client_property apm copy_files_p 0 +} else { + ad_set_client_property apm copy_files_p 1 + set actual_install_path $install_path +} + +if { [empty_string_p $spec_files] } { + # No spec files to work with. + ns_write " +

No Packages in the Packages directory

+ " +} else { + + ns_write " +

Packages Available on this OpenACS installation

+

+ + + + + + + + " + + + # Client properties do not deplete the limited URL variable space. + # But they are limited to the maximum length of a varchar ... + + ad_set_client_property -clob t apm spec_files $spec_files + ad_set_client_property apm install_path $actual_install_path + + set errors [list] + set i 0 + foreach spec_file $spec_files { + ### Parse the package. + if { [catch { array set package [apm_read_package_info_file $spec_file] } errmsg] } { + lappend errors "
  • Unable to parse $spec_file. The following error was generated: +
    [ad_quotehtml $errmsg]

    " + } else { + ns_log notice [join [array names package]] + if { $i % 2 > 0 } { + ns_write " +

  • " + } else { + ns_write " + " + } + ns_write " + " + if { [empty_string_p $package(description)] } { + ns_write " + " + } else { + ns_write " + " + } + ns_write " + + + " + incr i + } + } + + ns_write " +
    PackageDescriptionProvidesRequires
    $package(package-name)$package(summary)$package(description)[join $package(provides) ','][join $package(requires) ',']
    +

    " + + if {![empty_string_p $errors]} { + ns_write "The following errors were generated +

    + " + } +} + +ns_write " +[ad_footer] +"