Changeset 17207 for trunk/base


Ignore:
Timestamp:
Mar 28, 2006, 6:50:37 AM (14 years ago)
Author:
jberry
Message:

Bug: 8021
Submitted by: John Mitchell

Improve handling of port installed/outdated and the pseudo-portnames installed/outdated
for case where there are no installed ports. An exception or other ugly error messages
were being displayed for these cases.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port/port.tcl

    r17031 r17207  
    33exec @TCLSH@ "$0" "$@"
    44# port.tcl
    5 # $Id: port.tcl,v 1.157 2006/03/17 00:22:23 jberry Exp $
     5# $Id: port.tcl,v 1.158 2006/03/28 06:50:37 jberry Exp $
    66#
    77# Copyright (c) 2002-2006 DarwinPorts organization
     
    495495
    496496proc get_installed_ports { {ignore_active yes} {active yes} } {
     497        set ilist {}
    497498        if { [catch {set ilist [registry::installed]} result] } {
    498                 if {$result == "Registry error: No ports registered as installed."} {
    499                         fatal "No ports installed!"
    500                 } else {
     499                if {$result != "Registry error: No ports registered as installed."} {
    501500                        global errorInfo
    502501                        ui_debug "$errorInfo"
     
    545544        set is_image_mode [expr 0 == [string compare "image" ${darwinports::registry.installtype}]]
    546545       
    547         # Get the list of install ports
     546        # Get the list of installed ports
     547        set ilist {}
    548548        if { [catch {set ilist [registry::installed]} result] } {
    549                 global errorInfo
    550                 ui_debug "$errorInfo"
    551                 fatal "can't get installed ports: $result"
     549                if {$result != "Registry error: No ports registered as installed."} {
     550                        global errorInfo
     551                        ui_debug "$errorInfo"
     552                        fatal "port installed failed: $result"
     553                }
    552554        }
    553555
     
    14921494proc action_installed { action portlist opts } {
    14931495        set status 0
     1496        set ilist {}
    14941497        if { [llength $portlist] } {
    1495                 set ilist {}
    14961498                foreachport $portlist {
    14971499                        set composite_version [composite_version $portversion [array get variations]]
     
    15081510        } else {
    15091511                if { [catch {set ilist [registry::installed]} result] } {
    1510                         if {$result == "Registry error: No ports registered as installed."} {
    1511                                 set ilist {}
    1512                                 puts "No ports are installed!"
    1513                         } else {
     1512                        if {$result != "Registry error: No ports registered as installed."} {
    15141513                                global errorInfo
    15151514                                ui_debug "$errorInfo"
     
    15481547
    15491548        # If port names were supplied, limit ourselves to those port, else check all installed ports
     1549        set ilist {}
    15501550        if { [llength $portlist] } {
    1551                 set ilist {}
    15521551                foreach portspec $portlist {
    15531552                        array set port $portspec
     
    15641563        } else {
    15651564                if { [catch {set ilist [registry::installed]} result] } {
    1566                         global errorInfo
    1567                         ui_debug "$errorInfo"
    1568                         ui_error "port outdated failed: $result"
    1569                         set status 1
     1565                        if {$result != "Registry error: No ports registered as installed."} {
     1566                                global errorInfo
     1567                                ui_debug "$errorInfo"
     1568                                ui_error "port installed failed: $result"
     1569                                set status 1
     1570                        }
    15701571                }
    15711572        }
Note: See TracChangeset for help on using the changeset viewer.