[50253] branches/images-and-archives/base/src
blb at macports.org
blb at macports.org
Tue Apr 28 01:42:08 PDT 2009
Revision: 50253
http://trac.macports.org/changeset/50253
Author: blb at macports.org
Date: 2009-04-28 01:42:07 -0700 (Tue, 28 Apr 2009)
Log Message:
-----------
Always use install type of image
Modified Paths:
--------------
branches/images-and-archives/base/src/macports1.0/macports.tcl
branches/images-and-archives/base/src/port/port.tcl
branches/images-and-archives/base/src/port1.0/portinstall.tcl
branches/images-and-archives/base/src/registry1.0/portimage.tcl
branches/images-and-archives/base/src/registry1.0/portuninstall.tcl
branches/images-and-archives/base/src/registry1.0/receipt_flat.tcl
branches/images-and-archives/base/src/registry1.0/registry.tcl
Modified: branches/images-and-archives/base/src/macports1.0/macports.tcl
===================================================================
--- branches/images-and-archives/base/src/macports1.0/macports.tcl 2009-04-28 07:41:08 UTC (rev 50252)
+++ branches/images-and-archives/base/src/macports1.0/macports.tcl 2009-04-28 08:42:07 UTC (rev 50253)
@@ -41,7 +41,7 @@
namespace export bootstrap_options user_options portinterp_options open_mports ui_priorities
variable bootstrap_options "\
portdbpath libpath binpath auto_path extra_env sources_conf prefix x11prefix portdbformat \
- portinstalltype portarchivepath portarchivetype portautoclean \
+ portarchivepath portarchivetype portautoclean \
porttrace portverbose destroot_umask variants_conf rsync_server rsync_options \
rsync_dir startupitem_type place_worksymlink xcodeversion xcodebuildcmd \
mp_remote_url mp_remote_submit_url configureccache configuredistcc configurepipe buildnicevalue buildmakejobs \
@@ -50,7 +50,7 @@
variable user_options "submitter_name submitter_email submitter_key"
variable portinterp_options "\
portdbpath porturl portpath portbuildpath auto_path prefix prefix_frozen x11prefix portsharepath \
- registry.path registry.format registry.installtype portarchivepath \
+ registry.path registry.format portarchivepath \
portarchivetype portautoclean porttrace portverbose destroot_umask rsync_server \
rsync_options rsync_dir startupitem_type place_worksymlink \
mp_remote_url mp_remote_submit_url configureccache configuredistcc configurepipe buildnicevalue buildmakejobs \
@@ -339,7 +339,6 @@
global macports::macportsuser
global macports::prefix_frozen
global macports::x11prefix
- global macports::registry.installtype
global macports::rsync_dir
global macports::rsync_options
global macports::rsync_server
@@ -500,13 +499,6 @@
set registry.format receipt_flat
}
- # Installation type, whether to use port "images" or install "direct"
- if {[info exists portinstalltype]} {
- set registry.installtype $portinstalltype
- } else {
- set registry.installtype image
- }
-
# Autoclean mode, whether to automatically call clean after "install"
if {![info exists portautoclean]} {
set macports::portautoclean "yes"
@@ -751,7 +743,7 @@
}
proc macports::worker_init {workername portpath porturl portbuildpath options variations} {
- global macports::portinterp_options macports::portinterp_deferred_options registry.installtype
+ global macports::portinterp_options macports::portinterp_deferred_options
# Hide any Tcl commands that should be inaccessible to port1.0 and Portfiles
# exit: It should not be possible to exit the interpreter
@@ -848,10 +840,6 @@
foreach {var val} $variations {
$workername eval set variations($var) $val
}
-
- if { [info exists registry.installtype] } {
- $workername eval set installtype ${registry.installtype}
- }
}
# Create a thread with most configuration options set.
@@ -1253,15 +1241,6 @@
return 0
}
-### _mportinstalled is private; may change without notice
-
-# Determine if a port is already *installed*, as in "in the registry".
-proc _mportinstalled {mport} {
- # Check for the presence of the port in the registry
- set workername [ditem_key $mport workername]
- return [$workername eval registry_exists_for_name \${portname}]
-}
-
# Determine if a port is active (only for image mode)
proc _mportactive {mport} {
set workername [ditem_key $mport workername]
@@ -1282,11 +1261,7 @@
# depspec the dependency test specification (path, bin, lib, etc.)
proc _mportispresent {mport depspec} {
ui_debug "Searching for dependency: [ditem_key $mport provides]"
- if {[string equal ${macports::registry.installtype} "image"]} {
- set res [_mportactive $mport]
- } else {
- set res [_mportinstalled $mport]
- }
+ set res [_mportactive $mport]
if {$res != 0} {
ui_debug "Found Dependency: receipt exists for [ditem_key $mport provides]"
return 1
@@ -1333,8 +1308,6 @@
# mportexec
# Execute the specified target of the given mport.
proc mportexec {mport target} {
- global macports::registry.installtype
-
set workername [ditem_key $mport workername]
# check variants
@@ -1373,12 +1346,8 @@
# install them
# xxx: as with below, this is ugly. and deps need to be fixed to
# understand Port Images before this can get prettier
- if { [string equal ${macports::registry.installtype} "image"] } {
- set result [dlist_eval $dlist _mportactive [list _mportexec "activate"]]
- } else {
- set result [dlist_eval $dlist _mportinstalled [list _mportexec "install"]]
- }
-
+ set result [dlist_eval $dlist _mportactive [list _mportexec "activate"]]
+
if {$result != {}} {
set errstring "The following dependencies failed to build:"
foreach ditem $result {
@@ -1402,7 +1371,7 @@
# If we're doing image installs, then we should activate after install
# xxx: This isn't pretty
- if { [string equal ${macports::registry.installtype} "image"] && [string equal $target "install"] } {
+ if {[string equal $target "install"]} {
set target activate
}
@@ -2137,7 +2106,6 @@
# upgrade procedure
proc macports::upgrade {portname dspec globalvarlist variationslist optionslist {depscachename ""}} {
- global macports::registry.installtype
array set options $optionslist
# Note $variationslist is left alone and so retains the original
@@ -2401,65 +2369,45 @@
return 1
}
- # always uninstall old port in direct mode
- if { 0 != [string compare "image" ${macports::registry.installtype}] } {
- # uninstall old
- ui_debug "Uninstalling $portname ${version_installed}_${revision_installed}${variant_installed}"
+ # are we installing an existing version due to force or epoch override?
+ if {([info exists options(ports_force)] || $epoch_override == 1)
+ && [registry::entry_exists $portname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants)]} {
+ ui_debug "Uninstalling $portname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants)"
# we have to force the uninstall in case of dependents
set force_cur [info exists options(ports_force)]
set options(ports_force) yes
if {$is_dryrun eq "yes"} {
- ui_msg "Skipping uninstall $portname @${version_installed}_${revision_installed}${variant_installed} (dry run)"
- } elseif {[catch {portuninstall::uninstall $portname ${version_installed}_${revision_installed}${variant_installed} [array get options]} result]} {
+ ui_msg "Skipping uninstall $portname @${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) (dry run)"
+ } elseif {[catch {portuninstall::uninstall $portname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) [array get options]} result]} {
global errorInfo
ui_debug "$errorInfo"
- ui_error "Uninstall $portname ${version_installed}_${revision_installed}${variant_installed} failed: $result"
+ ui_error "Uninstall $portname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) failed: $result"
return 1
}
if {!$force_cur} {
unset options(ports_force)
}
- } else {
- # are we installing an existing version due to force or epoch override?
- if {([info exists options(ports_force)] || $epoch_override == 1)
- && [registry::entry_exists $portname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants)]} {
- ui_debug "Uninstalling $portname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants)"
- # we have to force the uninstall in case of dependents
- set force_cur [info exists options(ports_force)]
- set options(ports_force) yes
- if {$is_dryrun eq "yes"} {
- ui_msg "Skipping uninstall $portname @${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) (dry run)"
- } elseif {[catch {portuninstall::uninstall $portname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) [array get options]} result]} {
- global errorInfo
- ui_debug "$errorInfo"
- ui_error "Uninstall $portname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) failed: $result"
- return 1
- }
- if {!$force_cur} {
- unset options(ports_force)
- }
- if {$anyactive && $version_in_tree == $version_active && $revision_in_tree == $revision_active
- && $portinfo(canonical_active_variants) == $variant_active} {
- set anyactive no
- }
+ if {$anyactive && $version_in_tree == $version_active && $revision_in_tree == $revision_active
+ && $portinfo(canonical_active_variants) == $variant_active} {
+ set anyactive no
}
- if {$anyactive} {
- # deactivate version_active
- if {$is_dryrun eq "yes"} {
- ui_msg "Skipping deactivate $portname @${version_active}_${revision_active} (dry run)"
- } elseif {[catch {portimage::deactivate $portname ${version_active}_${revision_active}${variant_active} $optionslist} result]} {
- global errorInfo
- ui_debug "$errorInfo"
- ui_error "Deactivating $portname ${version_active}_${revision_active} failed: $result"
- return 1
- }
+ }
+ if {$anyactive} {
+ # deactivate version_active
+ if {$is_dryrun eq "yes"} {
+ ui_msg "Skipping deactivate $portname @${version_active}_${revision_active} (dry run)"
+ } elseif {[catch {portimage::deactivate $portname ${version_active}_${revision_active}${variant_active} $optionslist} result]} {
+ global errorInfo
+ ui_debug "$errorInfo"
+ ui_error "Deactivating $portname ${version_active}_${revision_active} failed: $result"
+ return 1
}
- if {[info exists options(port_uninstall_old)]} {
- # uninstalling now could fail due to dependents when not forced,
- # because the new version is not installed
- set uninstall_later yes
- }
}
+ if {[info exists options(port_uninstall_old)]} {
+ # uninstalling now could fail due to dependents when not forced,
+ # because the new version is not installed
+ set uninstall_later yes
+ }
if {$is_dryrun eq "yes"} {
ui_msg "Skipping activate $portname @${version_in_tree}_${revision_in_tree} (dry run)"
Modified: branches/images-and-archives/base/src/port/port.tcl
===================================================================
--- branches/images-and-archives/base/src/port/port.tcl 2009-04-28 07:41:08 UTC (rev 50252)
+++ branches/images-and-archives/base/src/port/port.tcl 2009-04-28 08:42:07 UTC (rev 50253)
@@ -660,9 +660,6 @@
proc get_outdated_ports {} {
- global macports::registry.installtype
- set is_image_mode [expr 0 == [string compare "image" ${macports::registry.installtype}]]
-
# Get the list of installed ports
set ilist {}
if { [catch {set ilist [registry::installed]} result] } {
@@ -686,7 +683,7 @@
set installed_variants [lindex $i 3]
set is_active [lindex $i 4]
- if { $is_active == 0 && $is_image_mode } continue
+ if {$is_active == 0} continue
set installed_epoch [lindex $i 5]
@@ -1703,15 +1700,11 @@
}
set ref [registry::open_entry $portname $version $revision $variants]
- if { [string equal [registry::property_retrieve $ref installtype] "image"] } {
- set imagedir [registry::property_retrieve $ref imagedir]
- if {![macports::ui_isset ports_quiet]} {
- puts "Port $portname ${version}_${revision}${variants} is installed as an image in:"
- }
- puts $imagedir
- } else {
- break_softcontinue "Port $portname is not installed as an image." 1 status
+ set imagedir [registry::property_retrieve $ref imagedir]
+ if {![macports::ui_isset ports_quiet]} {
+ puts "Port $portname ${version}_${revision}${variants} is installed as an image in:"
}
+ puts $imagedir
}
return $status
@@ -2155,9 +2148,6 @@
proc action_outdated { action portlist opts } {
- global macports::registry.installtype private_options
- set is_image_mode [expr 0 == [string compare "image" ${macports::registry.installtype}]]
-
set status 0
# If port names were supplied, limit ourselves to those ports, else check all installed ports
@@ -2199,7 +2189,7 @@
set installed_compound "${installed_version}_${installed_revision}"
set is_active [lindex $i 4]
- if { $is_active == 0 && $is_image_mode } {
+ if {$is_active == 0} {
continue
}
set installed_epoch [lindex $i 5]
Modified: branches/images-and-archives/base/src/port1.0/portinstall.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portinstall.tcl 2009-04-28 07:41:08 UTC (rev 50252)
+++ branches/images-and-archives/base/src/port1.0/portinstall.tcl 2009-04-28 08:42:07 UTC (rev 50253)
@@ -114,10 +114,8 @@
}
}
- if { [registry_prop_retr $regref installtype] == "image" } {
- set imagedir [registry_prop_retr $regref imagedir]
- set root [file join $root $imagedir]
- }
+ set imagedir [registry_prop_retr $regref imagedir]
+ set root [file join $root $imagedir]
set dst_element [file join $root $element]
set src_element [file join $rootdir $element]
@@ -176,9 +174,6 @@
}
if {[info exists installPlist]} {
registry_prop_store $regref contents [registry_fileinfo_for_index $installPlist]
- if { [registry_prop_retr $regref installtype] != "image" } {
- registry_bulk_register_files [registry_fileinfo_for_index $installPlist] $portname
- }
}
if {[info exists package-install]} {
registry_prop_store $regref package-install ${package-install}
Modified: branches/images-and-archives/base/src/registry1.0/portimage.tcl
===================================================================
--- branches/images-and-archives/base/src/registry1.0/portimage.tcl 2009-04-28 07:41:08 UTC (rev 50252)
+++ branches/images-and-archives/base/src/registry1.0/portimage.tcl 2009-04-28 08:42:07 UTC (rev 50253)
@@ -108,9 +108,6 @@
set ref [registry::open_entry $name $version $revision $variants]
- if { ![string equal [registry::property_retrieve $ref installtype] "image"] } {
- return -code error "Image error: ${name} @${version}_${revision}${variants} not installed as an image."
- }
if { [registry::property_retrieve $ref active] != 0 } {
return -code error "Image error: ${name} @${version}_${revision}${variants} is already active."
}
@@ -173,9 +170,6 @@
set ref [registry::open_entry $name $version $revision $variants]
- if { ![string equal [registry::property_retrieve $ref installtype] "image"] } {
- return -code error "Image error: ${name} @${fqversion} not installed as an image."
- }
if { [registry::property_retrieve $ref active] != 1 } {
return -code error "Image error: ${name} @${fqversion} is not active."
}
Modified: branches/images-and-archives/base/src/registry1.0/portuninstall.tcl
===================================================================
--- branches/images-and-archives/base/src/registry1.0/portuninstall.tcl 2009-04-28 07:41:08 UTC (rev 50252)
+++ branches/images-and-archives/base/src/registry1.0/portuninstall.tcl 2009-04-28 08:42:07 UTC (rev 50253)
@@ -122,8 +122,7 @@
}
}
- set installtype [registry::property_retrieve $ref installtype]
- if { $installtype == "image" && [registry::property_retrieve $ref active] == 1} {
+ if {[registry::property_retrieve $ref active] == 1} {
#return -code error [msgcat::mc "Registry Error: ${portname} ${version}_${revision}${variants} is active."]
portimage::deactivate $portname ${version}_${revision}${variants} $optionslist
}
Modified: branches/images-and-archives/base/src/registry1.0/receipt_flat.tcl
===================================================================
--- branches/images-and-archives/base/src/registry1.0/receipt_flat.tcl 2009-04-28 07:41:08 UTC (rev 50252)
+++ branches/images-and-archives/base/src/registry1.0/receipt_flat.tcl 2009-04-28 08:42:07 UTC (rev 50253)
@@ -101,7 +101,6 @@
#
# Open an existing entry and return its reference number.
proc open_entry {name {version ""} {revision 0} {variants ""}} {
- global macports::registry.installtype
global macports::registry.path
variable ref_index
@@ -310,7 +309,6 @@
# version the version of the port.
# variants the variants of the port.
proc write_entry {ref name version {revision 0} {variants ""}} {
- global macports::registry.installtype
variable receipt_$ref
set receipt_contents [array get receipt_$ref]
Modified: branches/images-and-archives/base/src/registry1.0/registry.tcl
===================================================================
--- branches/images-and-archives/base/src/registry1.0/registry.tcl 2009-04-28 07:41:08 UTC (rev 50252)
+++ branches/images-and-archives/base/src/registry1.0/registry.tcl 2009-04-28 08:42:07 UTC (rev 50253)
@@ -43,7 +43,7 @@
# Begin creating a new registry entry for the port version_revision+variant
# This process assembles the directory name and creates a receipt dlist
proc new_entry {name version {revision 0} {variants ""} {epoch 0} } {
- global macports::registry.path macports::registry.format macports::registry.installtype macports::prefix
+ global macports::registry.path macports::registry.format macports::prefix
# Make sure we don't already have an entry in the Registry for this
@@ -60,14 +60,11 @@
# Trick to have a portable GMT-POSIX epoch-based time.
# (because we'll compare this with a file mtime).
property_store $ref date [expr [clock scan now -gmt true] - [clock scan "1970-1-1 00:00:00" -gmt true]]
- property_store $ref installtype ${macports::registry.installtype}
property_store $ref receipt_f ${macports::registry.format}
- if { ${macports::registry.installtype} == "image" } {
- set imagedir [file join ${macports::registry.path} software ${name} ${version}_${revision}${variants}]
- property_store $ref imagedir $imagedir
- property_store $ref active 0
- property_store $ref compact 0
- }
+ set imagedir [file join ${macports::registry.path} software ${name} ${version}_${revision}${variants}]
+ property_store $ref imagedir $imagedir
+ property_store $ref active 0
+ property_store $ref compact 0
return $ref
} else {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090428/6498fd51/attachment-0001.html>
More information about the macports-changes
mailing list