Index: openacs-4/packages/acs-admin/www/apm/packages-install-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/packages-install-2.tcl,v diff -u -N -r1.5 -r1.5.2.1 --- openacs-4/packages/acs-admin/www/apm/packages-install-2.tcl 18 Sep 2002 11:54:42 -0000 1.5 +++ openacs-4/packages/acs-admin/www/apm/packages-install-2.tcl 5 Mar 2003 14:43:12 -0000 1.5.2.1 @@ -18,23 +18,27 @@ ad_set_client_property -clob t apm pkg_install_list "" ad_set_client_property -clob t apm pkg_enable_list "" -foreach install_key $install { - foreach spec_file $spec_files { - # Find the spec_file that has the install_key - if { [catch { - array set package [apm_read_package_info_file $spec_file] - } errmsg] } { - # Unable to parse specification file. - # If we get here, its because someone hacked the archive the loading process - # which checks the info file and displays an error. - # process - ns_log Error "$spec_file could not be parsed correctly. It is not being installed. - The error: $errmsg" - } - if {![string compare $package(package.key) $install_key]} { - lappend install_spec_files $spec_file - } +foreach spec_file $spec_files { + # Get package info, and find out if this is a package we should install + if { [catch { + array set package [apm_read_package_info_file $spec_file] + } errmsg] } { + # Unable to parse specification file. + # If we get here, its because someone hacked the archive the loading process + # which checks the info file and displays an error. + # process + ns_log Error "$spec_file could not be parsed correctly. It is not being installed. + The error: $errmsg" } + + # Save the package info, we may need it for dependency satisfaction later + lappend pkg_info_list [pkg_info_new $package(package.key) $spec_file \ + $package(provides) $package(requires) ""] + + if { [lsearch -exact $install $package(package.key)] != -1 } { + # This is a package which we should install + lappend install_spec_files $spec_file + } } if {![info exists install_spec_files]} { @@ -44,9 +48,40 @@ } ### Dependency Check -set dependency_results [apm_dependency_check $install_spec_files] +set dependency_results [apm_dependency_check -pkg_info_all $pkg_info_list $install_spec_files] -if { ([lindex $dependency_results 0] == 1) || ![string compare $force_p "t"]} { +if { [lindex $dependency_results 0] == 1 && [llength [lindex $dependency_results 2]] > 0 } { + + set extra_package_keys [lindex $dependency_results 2] + + # Check was good after adding a couple more pacakges + + doc_body_append "[apm_header "Package Installation"] +

Additional Packages Automatically Added

+ + Some of the packages you were trying to install required other packages to be installed first. + We've added these additional packages needed, and ask you to review the list of packages below. + +

+ [export_form_vars spec_files]

+ +

+ + " + + set install [concat $install $extra_package_keys] + set enable [concat $enable $extra_package_keys] + + doc_body_append [apm_package_selection_widget [lindex $dependency_results 1] $install $enable] + + doc_body_append " +
+ +
+ [ad_footer] + " + +} elseif { ([lindex $dependency_results 0] == 1) || ![string compare $force_p "t"]} { ### Check passed! Initiate install. # We use client properties to pass along this information as it is fairly large. @@ -63,7 +98,7 @@ Some of the packages you are trying to install have unsatisfied dependencies. The packages with unsatisfied dependencies have been deselected. If you wish to install packages that do not pass dependencies, please click the \"force\" option below. -
+