Ticket #42487: port_reload.patch

File port_reload.patch, 6.1 KB (added by xeron (Ivan Larionov), 11 years ago)
  • doc/port.1

     
    617617.Dl launchctl load -w /Library/LaunchDaemons/org.macports.${port}.plist
    618618.Ss unload
    619619A shortcut to launchctl, like load, but unloads the daemon.
     620.Ss reload
     621Unloads the daemon and loads it again.
    620622.Ss gohome
    621623Loads the home page for the given
    622624.Ar portname
  • src/port/port-help.tcl

     
    254254
    255255set porthelp(quit) $porthelp(exit)
    256256
     257set porthelp(reload) $porthelp(load)
     258
    257259set porthelp(rev-upgrade) {
    258260Scan for broken binaries in the installed ports and rebuild them as needed. Can
    259261be run with -y to only report broken ports, but not automatically rebuild them.
  • src/port/port.tcl

     
    42314231    mirror      [list action_target         [ACTION_ARGS_PORTS]] \
    42324232    load        [list action_target         [ACTION_ARGS_PORTS]] \
    42334233    unload      [list action_target         [ACTION_ARGS_PORTS]] \
     4234    reload      [list action_target         [ACTION_ARGS_PORTS]] \
    42344235    distfiles   [list action_target         [ACTION_ARGS_PORTS]] \
    42354236    \
    42364237    archivefetch [list action_target         [ACTION_ARGS_PORTS]] \
  • src/port1.0/Makefile.in

     
    99        portinstall.tcl portuninstall.tcl portdepends.tcl portdestroot.tcl \
    1010        portlint.tcl portclean.tcl porttest.tcl portactivate.tcl \
    1111        portdeactivate.tcl portstartupitem.tcl porttrace.tcl portlivecheck.tcl \
    12         portdistcheck.tcl portmirror.tcl portload.tcl portunload.tcl \
     12        portdistcheck.tcl portmirror.tcl portload.tcl portunload.tcl portreload.tcl \
    1313        portdistfiles.tcl fetch_common.tcl portsandbox.tcl
    1414
    1515include $(srcdir)/../../Mk/macports.subdir.mk
  • src/port1.0/port.tcl

     
    8282package require portmirror 1.0
    8383package require portload 1.0
    8484package require portunload 1.0
     85package require portreload 1.0
    8586
    8687package require portdistfiles 1.0
    8788package require portsandbox 1.0
  • src/port1.0/portreload.tcl

     
     1# et:ts=4
     2# portreload.tcl
     3# $Id$
     4#
     5# Copyright (c) 2007, 2009, 2011 The MacPorts Project
     6# Copyright (c) 2007 James D. Berry
     7# All rights reserved.
     8#
     9# Redistribution and use in source and binary forms, with or without
     10# modification, are permitted provided that the following conditions
     11# are met:
     12# 1. Redistributions of source code must retain the above copyright
     13#    notice, this list of conditions and the following disclaimer.
     14# 2. Redistributions in binary form must reproduce the above copyright
     15#    notice, this list of conditions and the following disclaimer in the
     16#    documentation and/or other materials provided with the distribution.
     17# 3. Neither the name of The MacPorts Project nor the names of its contributors
     18#    may be used to endorse or promote products derived from this software
     19#    without specific prior written permission.
     20#
     21# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     25# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     31# POSSIBILITY OF SUCH DAMAGE.
     32#
     33
     34package provide portreload 1.0
     35package require portutil 1.0
     36
     37set org.macports.reload [target_new org.macports.reload portreload::reload_main]
     38target_runtype ${org.macports.reload} always
     39target_state ${org.macports.reload} no
     40target_provides ${org.macports.reload} reload
     41target_requires ${org.macports.reload} main
     42
     43namespace eval portreload {
     44}
     45
     46options reload.asroot
     47default reload.asroot yes
     48
     49set_ui_prefix
     50
     51proc portreload::reload_main {args} {
     52    global startupitem.type startupitem.name startupitem.location startupitem.plist
     53    set launchctl_path ${portutil::autoconf::launchctl_path}
     54
     55    foreach { path } "/Library/${startupitem.location}/${startupitem.plist}" {
     56        if {$launchctl_path eq ""} {
     57            return -code error [format [msgcat::mc "launchctl command was not found by configure"]]
     58        } elseif {![file exists $path]} {
     59            return -code error [format [msgcat::mc "Launchd plist %s was not found"] $path]
     60        } else {
     61            exec $launchctl_path unload $path 2>@stderr
     62            after 1000
     63            exec $launchctl_path load $path 2>@stderr
     64        }
     65    }
     66
     67    return
     68}
  • src/port1.0/portsandbox.tcl

    Property changes on: src/port1.0/portreload.tcl
    ___________________________________________________________________
    Added: svn:keywords
    ## -0,0 +1 ##
    +Id
    \ No newline at end of property
    Added: svn:eol-style
    ## -0,0 +1 ##
    +native
    \ No newline at end of property
     
    5151        dmg -
    5252        mdmg -
    5353        load -
    54         unload {
     54        unload -
     55        reload {
    5556            set portsandbox_profile ""
    5657            return
    5758        }