Changeset 50253


Ignore:
Timestamp:
Apr 28, 2009, 8:42:07 AM (10 years ago)
Author:
blb@…
Message:

Always use install type of image

Location:
branches/images-and-archives/base/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/images-and-archives/base/src/macports1.0/macports.tcl

    r50252 r50253  
    4242    variable bootstrap_options "\
    4343        portdbpath libpath binpath auto_path extra_env sources_conf prefix x11prefix portdbformat \
    44         portinstalltype portarchivepath portarchivetype portautoclean \
     44        portarchivepath portarchivetype portautoclean \
    4545        porttrace portverbose destroot_umask variants_conf rsync_server rsync_options \
    4646        rsync_dir startupitem_type place_worksymlink xcodeversion xcodebuildcmd \
     
    5151    variable portinterp_options "\
    5252        portdbpath porturl portpath portbuildpath auto_path prefix prefix_frozen x11prefix portsharepath \
    53         registry.path registry.format registry.installtype portarchivepath \
     53        registry.path registry.format portarchivepath \
    5454        portarchivetype portautoclean porttrace portverbose destroot_umask rsync_server \
    5555        rsync_options rsync_dir startupitem_type place_worksymlink \
     
    340340    global macports::prefix_frozen
    341341    global macports::x11prefix
    342     global macports::registry.installtype
    343342    global macports::rsync_dir
    344343    global macports::rsync_options
     
    501500    }
    502501
    503     # Installation type, whether to use port "images" or install "direct"
    504     if {[info exists portinstalltype]} {
    505         set registry.installtype $portinstalltype
    506     } else {
    507         set registry.installtype image
    508     }
    509    
    510502    # Autoclean mode, whether to automatically call clean after "install"
    511503    if {![info exists portautoclean]} {
     
    752744
    753745proc macports::worker_init {workername portpath porturl portbuildpath options variations} {
    754     global macports::portinterp_options macports::portinterp_deferred_options registry.installtype
     746    global macports::portinterp_options macports::portinterp_deferred_options
    755747
    756748    # Hide any Tcl commands that should be inaccessible to port1.0 and Portfiles
     
    849841        $workername eval set variations($var) $val
    850842    }
    851 
    852     if { [info exists registry.installtype] } {
    853         $workername eval set installtype ${registry.installtype}
    854     }
    855843}
    856844
     
    12541242}
    12551243
    1256 ### _mportinstalled is private; may change without notice
    1257 
    1258 # Determine if a port is already *installed*, as in "in the registry".
    1259 proc _mportinstalled {mport} {
    1260     # Check for the presence of the port in the registry
    1261     set workername [ditem_key $mport workername]
    1262     return [$workername eval registry_exists_for_name \${portname}]
    1263 }
    1264 
    12651244# Determine if a port is active (only for image mode)
    12661245proc _mportactive {mport} {
     
    12831262proc _mportispresent {mport depspec} {
    12841263    ui_debug "Searching for dependency: [ditem_key $mport provides]"
    1285     if {[string equal ${macports::registry.installtype} "image"]} {
    1286         set res [_mportactive $mport]
    1287     } else {
    1288         set res [_mportinstalled $mport]
    1289     }
     1264    set res [_mportactive $mport]
    12901265    if {$res != 0} {
    12911266        ui_debug "Found Dependency: receipt exists for [ditem_key $mport provides]"
     
    13341309# Execute the specified target of the given mport.
    13351310proc mportexec {mport target} {
    1336     global macports::registry.installtype
    1337 
    13381311    set workername [ditem_key $mport workername]
    13391312
     
    13741347        # xxx: as with below, this is ugly.  and deps need to be fixed to
    13751348        # understand Port Images before this can get prettier
    1376         if { [string equal ${macports::registry.installtype} "image"] } {
    1377             set result [dlist_eval $dlist _mportactive [list _mportexec "activate"]]
    1378         } else {
    1379             set result [dlist_eval $dlist _mportinstalled [list _mportexec "install"]]
    1380         }
    1381        
     1349        set result [dlist_eval $dlist _mportactive [list _mportexec "activate"]]
     1350
    13821351        if {$result != {}} {
    13831352            set errstring "The following dependencies failed to build:"
     
    14031372    # If we're doing image installs, then we should activate after install
    14041373    # xxx: This isn't pretty
    1405     if { [string equal ${macports::registry.installtype} "image"] && [string equal $target "install"] } {
     1374    if {[string equal $target "install"]} {
    14061375        set target activate
    14071376    }
     
    21382107# upgrade procedure
    21392108proc macports::upgrade {portname dspec globalvarlist variationslist optionslist {depscachename ""}} {
    2140     global macports::registry.installtype
    21412109    array set options $optionslist
    21422110
     
    24022370    }
    24032371
    2404     # always uninstall old port in direct mode
    2405     if { 0 != [string compare "image" ${macports::registry.installtype}] } {
    2406         # uninstall old
    2407         ui_debug "Uninstalling $portname ${version_installed}_${revision_installed}${variant_installed}"
     2372    # are we installing an existing version due to force or epoch override?
     2373    if {([info exists options(ports_force)] || $epoch_override == 1)
     2374        && [registry::entry_exists $portname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants)]} {
     2375         ui_debug "Uninstalling $portname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants)"
    24082376        # we have to force the uninstall in case of dependents
    24092377        set force_cur [info exists options(ports_force)]
    24102378        set options(ports_force) yes
    24112379        if {$is_dryrun eq "yes"} {
    2412             ui_msg "Skipping uninstall $portname @${version_installed}_${revision_installed}${variant_installed} (dry run)"
    2413         } elseif {[catch {portuninstall::uninstall $portname ${version_installed}_${revision_installed}${variant_installed} [array get options]} result]} {
     2380            ui_msg "Skipping uninstall $portname @${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) (dry run)"
     2381        } elseif {[catch {portuninstall::uninstall $portname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) [array get options]} result]} {
    24142382            global errorInfo
    24152383            ui_debug "$errorInfo"
    2416             ui_error "Uninstall $portname ${version_installed}_${revision_installed}${variant_installed} failed: $result"
     2384            ui_error "Uninstall $portname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) failed: $result"
    24172385            return 1
    24182386        }
     
    24202388            unset options(ports_force)
    24212389        }
    2422     } else {
    2423         # are we installing an existing version due to force or epoch override?
    2424         if {([info exists options(ports_force)] || $epoch_override == 1)
    2425             && [registry::entry_exists $portname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants)]} {
    2426              ui_debug "Uninstalling $portname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants)"
    2427             # we have to force the uninstall in case of dependents
    2428             set force_cur [info exists options(ports_force)]
    2429             set options(ports_force) yes
    2430             if {$is_dryrun eq "yes"} {
    2431                 ui_msg "Skipping uninstall $portname @${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) (dry run)"
    2432             } elseif {[catch {portuninstall::uninstall $portname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) [array get options]} result]} {
    2433                 global errorInfo
    2434                 ui_debug "$errorInfo"
    2435                 ui_error "Uninstall $portname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) failed: $result"
    2436                 return 1
    2437             }
    2438             if {!$force_cur} {
    2439                 unset options(ports_force)
    2440             }
    2441             if {$anyactive && $version_in_tree == $version_active && $revision_in_tree == $revision_active
    2442                 && $portinfo(canonical_active_variants) == $variant_active} {
    2443                 set anyactive no
    2444             }
    2445         }
    2446         if {$anyactive} {
    2447             # deactivate version_active
    2448             if {$is_dryrun eq "yes"} {
    2449                 ui_msg "Skipping deactivate $portname @${version_active}_${revision_active} (dry run)"
    2450             } elseif {[catch {portimage::deactivate $portname ${version_active}_${revision_active}${variant_active} $optionslist} result]} {
    2451                 global errorInfo
    2452                 ui_debug "$errorInfo"
    2453                 ui_error "Deactivating $portname ${version_active}_${revision_active} failed: $result"
    2454                 return 1
    2455             }
    2456         }
    2457         if {[info exists options(port_uninstall_old)]} {
    2458             # uninstalling now could fail due to dependents when not forced,
    2459             # because the new version is not installed
    2460             set uninstall_later yes
    2461         }
     2390        if {$anyactive && $version_in_tree == $version_active && $revision_in_tree == $revision_active
     2391            && $portinfo(canonical_active_variants) == $variant_active} {
     2392            set anyactive no
     2393        }
     2394    }
     2395    if {$anyactive} {
     2396        # deactivate version_active
     2397        if {$is_dryrun eq "yes"} {
     2398            ui_msg "Skipping deactivate $portname @${version_active}_${revision_active} (dry run)"
     2399        } elseif {[catch {portimage::deactivate $portname ${version_active}_${revision_active}${variant_active} $optionslist} result]} {
     2400            global errorInfo
     2401            ui_debug "$errorInfo"
     2402            ui_error "Deactivating $portname ${version_active}_${revision_active} failed: $result"
     2403            return 1
     2404        }
     2405    }
     2406    if {[info exists options(port_uninstall_old)]} {
     2407        # uninstalling now could fail due to dependents when not forced,
     2408        # because the new version is not installed
     2409        set uninstall_later yes
    24622410    }
    24632411
  • branches/images-and-archives/base/src/port/port.tcl

    r49845 r50253  
    661661
    662662proc get_outdated_ports {} {
    663     global macports::registry.installtype
    664     set is_image_mode [expr 0 == [string compare "image" ${macports::registry.installtype}]]
    665 
    666663    # Get the list of installed ports
    667664    set ilist {}
     
    687684
    688685            set is_active           [lindex $i 4]
    689             if { $is_active == 0 && $is_image_mode } continue
     686            if {$is_active == 0} continue
    690687
    691688            set installed_epoch     [lindex $i 5]
     
    17041701
    17051702        set ref [registry::open_entry $portname $version $revision $variants]
    1706         if { [string equal [registry::property_retrieve $ref installtype] "image"] } {
    1707             set imagedir [registry::property_retrieve $ref imagedir]
    1708             if {![macports::ui_isset ports_quiet]} {
    1709                 puts "Port $portname ${version}_${revision}${variants} is installed as an image in:"
    1710             }
    1711             puts $imagedir
    1712         } else {
    1713             break_softcontinue "Port $portname is not installed as an image." 1 status
    1714         }
     1703        set imagedir [registry::property_retrieve $ref imagedir]
     1704        if {![macports::ui_isset ports_quiet]} {
     1705            puts "Port $portname ${version}_${revision}${variants} is installed as an image in:"
     1706        }
     1707        puts $imagedir
    17151708    }
    17161709   
     
    21562149
    21572150proc action_outdated { action portlist opts } {
    2158     global macports::registry.installtype private_options
    2159     set is_image_mode [expr 0 == [string compare "image" ${macports::registry.installtype}]]
    2160 
    21612151    set status 0
    21622152
     
    22002190
    22012191            set is_active [lindex $i 4]
    2202             if { $is_active == 0 && $is_image_mode } {
     2192            if {$is_active == 0} {
    22032193                continue
    22042194            }
  • branches/images-and-archives/base/src/port1.0/portinstall.tcl

    r50252 r50253  
    115115        }
    116116       
    117         if { [registry_prop_retr $regref installtype] == "image" } {
    118                 set imagedir [registry_prop_retr $regref imagedir]
    119                 set root [file join $root $imagedir]
    120         }
     117        set imagedir [registry_prop_retr $regref imagedir]
     118        set root [file join $root $imagedir]
    121119       
    122120        set dst_element [file join $root $element]
     
    177175    if {[info exists installPlist]} {
    178176                registry_prop_store $regref contents [registry_fileinfo_for_index $installPlist]
    179                 if { [registry_prop_retr $regref installtype] != "image" } {
    180                         registry_bulk_register_files [registry_fileinfo_for_index $installPlist] $portname
    181                 }
    182177        }
    183178        if {[info exists package-install]} {
  • branches/images-and-archives/base/src/registry1.0/portimage.tcl

    r49347 r50253  
    109109        set ref [registry::open_entry $name $version $revision $variants]
    110110       
    111         if { ![string equal [registry::property_retrieve $ref installtype] "image"] } {
    112                 return -code error "Image error: ${name} @${version}_${revision}${variants} not installed as an image."
    113         }
    114111        if { [registry::property_retrieve $ref active] != 0 } {
    115112                return -code error "Image error: ${name} @${version}_${revision}${variants} is already active."
     
    174171        set ref [registry::open_entry $name $version $revision $variants]
    175172
    176         if { ![string equal [registry::property_retrieve $ref installtype] "image"] } {
    177                 return -code error "Image error: ${name} @${fqversion} not installed as an image."
    178         }
    179173        if { [registry::property_retrieve $ref active] != 1 } {
    180174                return -code error "Image error: ${name} @${fqversion} is not active."
  • branches/images-and-archives/base/src/registry1.0/portuninstall.tcl

    r49845 r50253  
    123123        }
    124124
    125         set installtype [registry::property_retrieve $ref installtype]
    126         if { $installtype == "image" && [registry::property_retrieve $ref active] == 1} {
     125        if {[registry::property_retrieve $ref active] == 1} {
    127126                #return -code error [msgcat::mc "Registry Error: ${portname} ${version}_${revision}${variants} is active."]
    128127                portimage::deactivate $portname ${version}_${revision}${variants} $optionslist
  • branches/images-and-archives/base/src/registry1.0/receipt_flat.tcl

    r49846 r50253  
    102102# Open an existing entry and return its reference number.
    103103proc open_entry {name {version ""} {revision 0} {variants ""}} {
    104         global macports::registry.installtype
    105104        global macports::registry.path
    106105        variable ref_index
     
    311310# variants                      the variants of the port.
    312311proc write_entry {ref name version {revision 0} {variants ""}} {
    313         global macports::registry.installtype
    314312        variable receipt_$ref
    315313
  • branches/images-and-archives/base/src/registry1.0/registry.tcl

    r49845 r50253  
    4444# This process assembles the directory name and creates a receipt dlist
    4545proc new_entry {name version {revision 0} {variants ""} {epoch 0} } {
    46         global macports::registry.path macports::registry.format macports::registry.installtype macports::prefix
     46        global macports::registry.path macports::registry.format macports::prefix
    4747
    4848       
     
    6161                # (because we'll compare this with a file mtime).
    6262                property_store $ref date [expr [clock scan now -gmt true] - [clock scan "1970-1-1 00:00:00" -gmt true]]
    63                 property_store $ref installtype ${macports::registry.installtype}
    6463                property_store $ref receipt_f ${macports::registry.format}
    65                 if { ${macports::registry.installtype} == "image" } {
    66                         set imagedir [file join ${macports::registry.path} software ${name} ${version}_${revision}${variants}]
    67                         property_store $ref imagedir $imagedir
    68                         property_store $ref active 0
    69                         property_store $ref compact 0
    70                 }
     64                set imagedir [file join ${macports::registry.path} software ${name} ${version}_${revision}${variants}]
     65                property_store $ref imagedir $imagedir
     66                property_store $ref active 0
     67                property_store $ref compact 0
    7168
    7269                return $ref
Note: See TracChangeset for help on using the changeset viewer.