[123673] trunk/base/src

cal at macports.org cal at macports.org
Tue Aug 12 03:25:35 PDT 2014


Revision: 123673
          https://trac.macports.org/changeset/123673
Author:   cal at macports.org
Date:     2014-08-12 03:25:35 -0700 (Tue, 12 Aug 2014)
Log Message:
-----------
base: Add port reload, closes #36054, patch from #42487

Modified Paths:
--------------
    trunk/base/src/port/port.tcl
    trunk/base/src/port1.0/Makefile.in
    trunk/base/src/port1.0/port.tcl
    trunk/base/src/port1.0/portsandbox.tcl

Added Paths:
-----------
    trunk/base/src/port1.0/portreload.tcl

Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl	2014-08-12 09:44:19 UTC (rev 123672)
+++ trunk/base/src/port/port.tcl	2014-08-12 10:25:35 UTC (rev 123673)
@@ -4250,6 +4250,7 @@
     mirror      [list action_target         [ACTION_ARGS_PORTS]] \
     load        [list action_target         [ACTION_ARGS_PORTS]] \
     unload      [list action_target         [ACTION_ARGS_PORTS]] \
+    reload      [list action_target         [ACTION_ARGS_PORTS]] \
     distfiles   [list action_target         [ACTION_ARGS_PORTS]] \
     \
     archivefetch [list action_target         [ACTION_ARGS_PORTS]] \

Modified: trunk/base/src/port1.0/Makefile.in
===================================================================
--- trunk/base/src/port1.0/Makefile.in	2014-08-12 09:44:19 UTC (rev 123672)
+++ trunk/base/src/port1.0/Makefile.in	2014-08-12 10:25:35 UTC (rev 123673)
@@ -11,7 +11,7 @@
 	portinstall.tcl portuninstall.tcl portdepends.tcl portdestroot.tcl \
 	portlint.tcl portclean.tcl porttest.tcl portactivate.tcl \
 	portdeactivate.tcl portstartupitem.tcl porttrace.tcl portlivecheck.tcl \
-	portdistcheck.tcl portmirror.tcl portload.tcl portunload.tcl \
+	portdistcheck.tcl portmirror.tcl portload.tcl portunload.tcl portreload.tcl \
 	portdistfiles.tcl fetch_common.tcl portsandbox.tcl
 
 include $(srcdir)/../../Mk/macports.subdir.mk

Modified: trunk/base/src/port1.0/port.tcl
===================================================================
--- trunk/base/src/port1.0/port.tcl	2014-08-12 09:44:19 UTC (rev 123672)
+++ trunk/base/src/port1.0/port.tcl	2014-08-12 10:25:35 UTC (rev 123673)
@@ -82,6 +82,7 @@
 package require portmirror 1.0
 package require portload 1.0
 package require portunload 1.0
+package require portreload 1.0
 
 package require portdistfiles 1.0
 package require portsandbox 1.0

Added: trunk/base/src/port1.0/portreload.tcl
===================================================================
--- trunk/base/src/port1.0/portreload.tcl	                        (rev 0)
+++ trunk/base/src/port1.0/portreload.tcl	2014-08-12 10:25:35 UTC (rev 123673)
@@ -0,0 +1,68 @@
+# et:ts=4
+# portreload.tcl
+# $Id$
+#
+# Copyright (c) 2007, 2009, 2011 The MacPorts Project
+# Copyright (c) 2007 James D. Berry
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of The MacPorts Project nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+package provide portreload 1.0
+package require portutil 1.0
+
+set org.macports.reload [target_new org.macports.reload portreload::reload_main]
+target_runtype ${org.macports.reload} always
+target_state ${org.macports.reload} no
+target_provides ${org.macports.reload} reload
+target_requires ${org.macports.reload} main
+
+namespace eval portreload {
+}
+
+options reload.asroot
+default reload.asroot yes
+
+set_ui_prefix
+
+proc portreload::reload_main {args} {
+    global startupitem.type startupitem.name startupitem.location startupitem.plist
+    set launchctl_path ${portutil::autoconf::launchctl_path}
+
+    foreach { path } "/Library/${startupitem.location}/${startupitem.plist}" {
+        if {$launchctl_path eq ""} {
+            return -code error [format [msgcat::mc "launchctl command was not found by configure"]]
+        } elseif {![file exists $path]} {
+            return -code error [format [msgcat::mc "Launchd plist %s was not found"] $path]
+        } else {
+            # Basically run port unload; port load.
+            exec -ignorestderr $launchctl_path unload -w $path
+            exec -ignorestderr $launchctl_path load -w $path
+        }
+    }
+
+    return
+}


Property changes on: trunk/base/src/port1.0/portreload.tcl
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Modified: trunk/base/src/port1.0/portsandbox.tcl
===================================================================
--- trunk/base/src/port1.0/portsandbox.tcl	2014-08-12 09:44:19 UTC (rev 123672)
+++ trunk/base/src/port1.0/portsandbox.tcl	2014-08-12 10:25:35 UTC (rev 123673)
@@ -51,7 +51,8 @@
         dmg -
         mdmg -
         load -
-        unload {
+        unload -
+        reload {
             set portsandbox_profile ""
             return
         }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140812/ff6dc46e/attachment-0001.html>


More information about the macports-changes mailing list