[33048] branches/release_1_6/base
jmpp at macports.org
jmpp at macports.org
Wed Jan 16 22:35:27 PST 2008
Revision: 33048
http://trac.macosforge.org/projects/macports/changeset/33048
Author: jmpp at macports.org
Date: 2008-01-16 22:35:25 -0800 (Wed, 16 Jan 2008)
Log Message:
-----------
Merged revisions 31500-31518,31523-31561,31563-31564,31566-31599,31601-31617,31619-31639,31643-31668,31670,31672-31678,31682-31775,31777-31785,31787-31793,31795-31803,31806,31808-31820,31822,31824-31890,31892-31906,31909-31924,31926-31940,31942,31945,31947-31948,31950-31953,31955-31970,31972-31989,31991-32059,32061-32095,32098-32099,32104,32106-32110,32112,32115,32117-32131,32135-32166,32168,32171,32173-32193,32195-32201,32203-32205,32207,32211,32213-32222,32225-32352,32355-32362,32367-32393,32399-32429,32431-32440,32442-32479,32481-32499,32502-32513,32515-32524,32527-32536,32538-32540,32545,32547-32548,32550-32596,32599,32601-32604,32607-32614,32616-32630,32632-32719,32723 via svnmerge from
http://svn.macports.org/repository/macports/trunk/base
........
r31500 | jberry at macports.org | 2007-11-26 01:47:26 -0400 (Mon, 26 Nov 2007) | 6 lines
Initial support for port load and port unload actions.
These actions call invoke launchctl to load or unload the startupitem.plist
for the specified port(s).
........
r31771 | ryandesign at macports.org | 2007-12-06 20:07:50 -0400 (Thu, 06 Dec 2007) | 1 line
fix creation of launchd plists following changes in r31500; see #13518
........
r32336 | jmpp at macports.org | 2007-12-25 18:11:50 -0400 (Tue, 25 Dec 2007) | 1 line
Bail out with a suitable message if the requested port is not installed when polling its dependents.
........
r32723 | afb at macports.org | 2008-01-12 07:19:42 -0430 (Sat, 12 Jan 2008) | 1 line
add new port command: port distcheck distcheck.check=filesize
........
Modified Paths:
--------------
branches/release_1_6/base/src/port/port.tcl
branches/release_1_6/base/src/port1.0/Makefile
branches/release_1_6/base/src/port1.0/port.tcl
branches/release_1_6/base/src/port1.0/portdestroot.tcl
branches/release_1_6/base/src/port1.0/portdistcheck.tcl
branches/release_1_6/base/src/port1.0/portstartupitem.tcl
Added Paths:
-----------
branches/release_1_6/base/src/port1.0/portload.tcl
branches/release_1_6/base/src/port1.0/portunload.tcl
Property Changed:
----------------
branches/release_1_6/base/
Property changes on: branches/release_1_6/base
___________________________________________________________________
Name: svnmerge-integrated
- /trunk/base:1-31490,31493-31494,31497-31499,31501-31519,31521-31599,31601-31770,31772-31906,31909-31945,31947-31950,31971-32060,32096-32193,32195-32335,32337-32365,32367-32499,32502-32721,32724-32800,32802-32999
+ /trunk/base:1-31490,31493-31494,31497-31519,31521-31599,31601-31906,31909-31945,31947-31953,31955-32193,32195-32365,32367-32499,32502-32721,32723-32800,32802-32999
Modified: branches/release_1_6/base/src/port/port.tcl
===================================================================
--- branches/release_1_6/base/src/port/port.tcl 2008-01-17 06:27:23 UTC (rev 33047)
+++ branches/release_1_6/base/src/port/port.tcl 2008-01-17 06:35:25 UTC (rev 33048)
@@ -1444,13 +1444,21 @@
}
-
proc action_dependents { action portlist opts } {
require_portlist portlist
+ set ilist {}
+
foreachport $portlist {
registry::open_dep_map
+
+ set composite_version [composite_version $portversion [array get variations]]
+ if { [catch {set ilist [concat $ilist [registry::installed $portname $composite_version]]} result] } {
+ global errorInfo
+ ui_debug "$errorInfo"
+ break_softcontinue "$result" 1 status
+ }
+
set deplist [registry::list_dependents $portname]
-
if { [llength $deplist] > 0 } {
set dl [list]
# Check the deps first
@@ -2209,6 +2217,8 @@
livecheck action_target
distcheck action_target
mirror action_target
+ load action_target
+ unload action_target
archive action_target
unarchive action_target
Modified: branches/release_1_6/base/src/port1.0/Makefile
===================================================================
--- branches/release_1_6/base/src/port1.0/Makefile 2008-01-17 06:27:23 UTC (rev 33047)
+++ branches/release_1_6/base/src/port1.0/Makefile 2008-01-17 06:35:25 UTC (rev 33048)
@@ -5,7 +5,7 @@
portinstall.tcl portdepends.tcl portdestroot.tcl portlint.tcl \
portclean.tcl porttest.tcl portactivate.tcl portsubmit.tcl \
port_autoconf.tcl portstartupitem.tcl porttrace.tcl portlivecheck.tcl \
- portdistcheck.tcl portmirror.tcl
+ portdistcheck.tcl portmirror.tcl portload.tcl portunload.tcl
SUBDIR= resources
Modified: branches/release_1_6/base/src/port1.0/port.tcl
===================================================================
--- branches/release_1_6/base/src/port1.0/port.tcl 2008-01-17 06:27:23 UTC (rev 33047)
+++ branches/release_1_6/base/src/port1.0/port.tcl 2008-01-17 06:35:25 UTC (rev 33048)
@@ -52,3 +52,5 @@
package require portdistcheck 1.0
package require portlivecheck 1.0
package require portmirror 1.0
+package require portload 1.0
+package require portunload 1.0
Modified: branches/release_1_6/base/src/port1.0/portdestroot.tcl
===================================================================
--- branches/release_1_6/base/src/port1.0/portdestroot.tcl 2008-01-17 06:27:23 UTC (rev 33047)
+++ branches/release_1_6/base/src/port1.0/portdestroot.tcl 2008-01-17 06:35:25 UTC (rev 33048)
@@ -47,6 +47,7 @@
options startupitem.name startupitem.start startupitem.stop startupitem.restart
options startupitem.type startupitem.executable
options startupitem.pidfile startupitem.logfile startupitem.logevents startupitem.netchange
+options startupitem.uniquename startupitem.plist startupitem.location
commands destroot
# Set defaults
@@ -62,6 +63,9 @@
default destroot.violate_mtree no
default startupitem.name {${portname}}
+default startupitem.uniquename {org.macports.${startupitem.name}}
+default startupitem.plist {${startupitem.uniquename}.plist}
+default startupitem.location LaunchDaemons
default startupitem.init ""
default startupitem.start ""
default startupitem.stop ""
Modified: branches/release_1_6/base/src/port1.0/portdistcheck.tcl
===================================================================
--- branches/release_1_6/base/src/port1.0/portdistcheck.tcl 2008-01-17 06:27:23 UTC (rev 33047)
+++ branches/release_1_6/base/src/port1.0/portdistcheck.tcl 2008-01-17 06:35:25 UTC (rev 33048)
@@ -63,6 +63,7 @@
# portfetch 1.0::checkfiles sets fetch_urls list.
global fetch_urls
checkfiles
+ set totalsize 0
# Check all the files.
foreach {url_var distfile} $fetch_urls {
@@ -89,10 +90,46 @@
if {$count == 0} {
ui_error "no mirror had $distfile for $portname"
}
+ } elseif {${distcheck.check} == "filesize"} {
+ set count 0
+ foreach site [set $url_var] {
+ ui_debug [format [msgcat::mc "Checking %s from %s"] $distfile $site]
+ set file_url [portfetch::assemble_url $site $distfile]
+ if {[catch {set urlsize [curl getsize $file_url]} error]} {
+ ui_warn "couldn't fetch $file_url for $portname ($error)"
+ } else {
+ incr count
+ if {$urlsize > 0} {
+ ui_info "port $portname: $distfile $urlsize bytes"
+ incr totalsize $urlsize
+ break
+ }
+ }
+ }
+ if {$count == 0} {
+ ui_error "no mirror had $distfile for $portname"
+ }
} else {
ui_error "unknown distcheck.check ${distcheck.check}"
break
}
}
+
+ if {${distcheck.check} == "filesize" && $totalsize > 0} {
+ if {$totalsize < 1024} {
+ set size $totalsize
+ set humansize "${size}"
+ } elseif {$totalsize < 1024*1024} {
+ set size [expr $totalsize / 1024.0]
+ set humansize [format "%.1fK" $size]
+ } elseif {$totalsize < 1024*1024*1024} {
+ set size [expr $totalsize / (1024.0*1024.0)]
+ set humansize [format "%.1fM" $size]
+ } else {
+ set size [expr $totalsize / (1024.0*1024.0*1024.0)]
+ set humansize [format "%.1fG" $size]
+ }
+ ui_msg "$portname: $humansize"
+ }
}
}
Added: branches/release_1_6/base/src/port1.0/portload.tcl
===================================================================
--- branches/release_1_6/base/src/port1.0/portload.tcl (rev 0)
+++ branches/release_1_6/base/src/port1.0/portload.tcl 2008-01-17 06:35:25 UTC (rev 33048)
@@ -0,0 +1,59 @@
+# et:ts=4
+# portsubmit.tcl
+# $Id$
+#
+# Copyright (c) 2007 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 Apple Computer, Inc. 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 portload 1.0
+package require portutil 1.0
+
+set org.macports.load [target_new org.macports.load load_main]
+target_runtype ${org.macports.load} always
+target_provides ${org.macports.load} load
+target_requires ${org.macports.load} main
+
+set_ui_prefix
+
+proc load_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 {[string length $launchctl_path] == 0} {
+ 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 {
+ exec $launchctl_path load -w $path
+ }
+ }
+
+ return
+}
Property changes on: branches/release_1_6/base/src/port1.0/portload.tcl
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: branches/release_1_6/base/src/port1.0/portstartupitem.tcl
===================================================================
--- branches/release_1_6/base/src/port1.0/portstartupitem.tcl 2008-01-17 06:27:23 UTC (rev 33047)
+++ branches/release_1_6/base/src/port1.0/portstartupitem.tcl 2008-01-17 06:35:25 UTC (rev 33048)
@@ -3,8 +3,9 @@
#
# $Id$
#
-# Copyright (c) 2004, 2005 Markus W. Weissman <mww at macports.org>,
-# Copyright (c) 2005 Robert Shaw <rshaw at opendarwin.org>,
+# Copyright (c) 2004-2007 MacPorts Project
+# Copyright (c) 2006-2007 James D. Berry
+# Copyright (c) 2004,2005 Markus W. Weissman <mww at macports.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -383,16 +384,16 @@
proc startupitem_create_darwin_launchd {args} {
global UI_PREFIX prefix destroot destroot.keepdirs portname os.platform
- global startupitem.name startupitem.requires startupitem.init
- global startupitem.start startupitem.stop startupitem.restart startupitem.executable
+ global startupitem.name startupitem.uniquename startupitem.plist startupitem.location
+ global startupitem.init startupitem.start startupitem.stop startupitem.restart startupitem.executable
global startupitem.pidfile startupitem.logfile startupitem.logevents startupitem.netchange
set scriptdir ${prefix}/etc/startup
set itemname ${startupitem.name}
- set uniquename org.macports.${itemname}
- set plistname ${uniquename}.plist
- set daemondest LaunchDaemons
+ set uniquename ${startupitem.uniquename}
+ set plistname ${startupitem.plist}
+ set daemondest ${startupitem.location}
set itemdir ${prefix}/etc/${daemondest}/${uniquename}
set args [list \
"${prefix}/bin/daemondo" \
Added: branches/release_1_6/base/src/port1.0/portunload.tcl
===================================================================
--- branches/release_1_6/base/src/port1.0/portunload.tcl (rev 0)
+++ branches/release_1_6/base/src/port1.0/portunload.tcl 2008-01-17 06:35:25 UTC (rev 33048)
@@ -0,0 +1,59 @@
+# et:ts=4
+# portsubmit.tcl
+# $Id$
+#
+# Copyright (c) 2007 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 Apple Computer, Inc. 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 portunload 1.0
+package require portutil 1.0
+
+set org.macports.unload [target_new org.macports.unload unload_main]
+target_runtype ${org.macports.unload} always
+target_provides ${org.macports.unload} unload
+target_requires ${org.macports.unload} main
+
+set_ui_prefix
+
+proc unload_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 {[string length $launchctl_path] == 0} {
+ 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 {
+ exec $launchctl_path unload -w $path
+ }
+ }
+
+ return
+}
Property changes on: branches/release_1_6/base/src/port1.0/portunload.tcl
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080116/72c4d376/attachment-0001.html
More information about the macports-changes
mailing list