Changeset 14485 for trunk/base


Ignore:
Timestamp:
Oct 8, 2005, 9:29:35 PM (15 years ago)
Author:
jberry
Message:

Add a global switch in ports.conf which controls what kind of startupitem
will be generated by default. This may be overridden in particular portfiles
by the startupitem.type key. Legal values are "default", "systemstarter", or "launchd".
In the event of "default", a type appropriate to the platform will be chosen.

Location:
trunk/base
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/doc/ports.conf.in

    r13819 r14485  
    4949# Rsync options
    5050rsync_options           "-rtzv --delete --delete-after"
     51
     52# Options for generated startup items
     53# startupitem_type may be "default", "systemstarter", or "launchd";
     54# if the option is empty or "default" then a startupitem type appropriate
     55# to the platform will be chosen. Tiger will default to launchd, while
     56# older mac ox X systems will default to systemstarter.
     57startupitem_type        default
  • trunk/base/src/darwinports1.0/darwinports.tcl

    r14430 r14485  
    11# darwinports.tcl
    2 # $Id: darwinports.tcl,v 1.197 2005/10/05 13:32:59 jberry Exp $
     2# $Id: darwinports.tcl,v 1.198 2005/10/08 21:29:35 jberry Exp $
    33#
    44# Copyright (c) 2002 Apple Computer, Inc.
     
    3838namespace eval darwinports {
    3939    namespace export bootstrap_options portinterp_options open_dports ui_priorities
    40     variable bootstrap_options "portdbpath libpath binpath auto_path sources_conf prefix portdbformat portinstalltype portarchivemode portarchivepath portarchivetype portautoclean porttrace portverbose destroot_umask variants_conf rsync_server rsync_options rsync_dir xcodeversion xcodebuildcmd"
    41     variable portinterp_options "portdbpath portpath portbuildpath auto_path prefix portsharepath registry.path registry.format registry.installtype portarchivemode portarchivepath portarchivetype portautoclean porttrace portverbose destroot_umask rsync_server rsync_options rsync_dir"
     40    variable bootstrap_options "portdbpath libpath binpath auto_path sources_conf prefix portdbformat portinstalltype portarchivemode portarchivepath portarchivetype portautoclean porttrace portverbose destroot_umask variants_conf rsync_server rsync_options rsync_dir startupitem_type xcodeversion xcodebuildcmd"
     41    variable portinterp_options "portdbpath portpath portbuildpath auto_path prefix portsharepath registry.path registry.format registry.installtype portarchivemode portarchivepath portarchivetype portautoclean porttrace portverbose destroot_umask rsync_server rsync_options rsync_dir startupitem_type"
    4242    # deferred options are only computed when needed.
    4343    # they are not exported to the trace thread.
     
    180180        global darwinports::sources
    181181        global darwinports::sources_conf
     182        global darwinports::startupitem_type
    182183        global darwinports::destroot_umask
    183184        global darwinports::libpath
     
    415416    } else {
    416417        set env(PATH) "$binpath"
     418    }
     419   
     420    # Set startupitem default type (can be overridden by portfile)
     421    if {![info exists startupitem_type]} {
     422        set darwinports::startupitem_type "default"
     423        global darwinports::startupitem_type
    417424    }
    418425   
  • trunk/base/src/port1.0/portdestroot.tcl

    r13738 r14485  
    11# et:ts=4
    22# portdestroot.tcl
    3 # $Id: portdestroot.tcl,v 1.27 2005/08/27 00:07:30 pguyot Exp $
     3# $Id: portdestroot.tcl,v 1.28 2005/10/08 21:29:35 jberry Exp $
    44#
    55# Copyright (c) 2002 - 2003 Apple Computer, Inc.
     
    6767default startupitem.requires    ""
    6868default startupitem.executable  ""
    69 default startupitem.type                ""
     69default startupitem.type                {$system_options(startupitem_type)}
    7070default startupitem.pidfile             ""
    7171default startupitem.logfile             ""
  • trunk/base/src/port1.0/portstartupitem.tcl

    r14484 r14485  
    22# portstartupitem.tcl
    33#
    4 # $Id: portstartupitem.tcl,v 1.18 2005/10/08 20:00:29 jberry Exp $
     4# $Id: portstartupitem.tcl,v 1.19 2005/10/08 21:29:35 jberry Exp $
    55#
    66# Copyright (c) 2004, 2005 Markus W. Weissman <mww@opendarwin.org>,
     
    574574        global startupitem.type os.platform
    575575       
     576        set startupitem.type [string tolower ${startupitem.type}]
     577       
    576578        # Calculate a default value for startupitem.type
    577         # If the option has already been set, default will do nothing
    578         switch -exact ${os.platform} {
    579                 darwin {
    580                         set enableLaunchd ${portutil::autoconf::enable_launchd_support}
    581                         set haveLaunchd ${portutil::autoconf::have_launchd}
    582                        
    583                         if { [tbool enableLaunchd] && [tbool haveLaunchd] } {
    584                                 default startupitem.type "launchd"
    585                         } else {
    586                                 default startupitem.type "SystemStarter"
     579        if {${startupitem.type} == "default" || ${startupitem.type} == ""} {
     580                switch -exact ${os.platform} {
     581                        darwin {
     582                                set enableLaunchd ${portutil::autoconf::enable_launchd_support}
     583                                set haveLaunchd ${portutil::autoconf::have_launchd}
     584                               
     585                                if { [tbool enableLaunchd] && [tbool haveLaunchd] } {
     586                                        set startupitem.type "launchd"
     587                                } else {
     588                                        set startupitem.type "systemstarter"
     589                                }
    587590                        }
    588                 }
    589                 default {
    590                         default startupitem.type "RCng"
    591                 }
    592         }
    593                
     591                        default {
     592                                set startupitem.type "rcng"
     593                        }
     594                }
     595        }
     596
    594597        ui_msg "$UI_PREFIX [msgcat::mc "Creating ${startupitem.type} control script"]"
    595598
    596         switch -- [string tolower ${startupitem.type}] {
     599        switch -- ${startupitem.type} {
    597600                launchd                 { startupitem_create_darwin_launchd }
    598601                systemstarter   { startupitem_create_darwin_systemstarter }
Note: See TracChangeset for help on using the changeset viewer.