<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/3dde77d7d6c66dbb8fcc1d4b1b4972a2ac8b1947">https://github.com/macports/macports-base/commit/3dde77d7d6c66dbb8fcc1d4b1b4972a2ac8b1947</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 3dde77d Honour startupitem.install at activation time
</span>3dde77d is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 3dde77d7d6c66dbb8fcc1d4b1b4972a2ac8b1947
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Sun Apr 8 11:16:22 2018 +1000
<span style='display:block; white-space:pre;color:#404040;'> Honour startupitem.install at activation time
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> When activating files, move plists from /Library/Launch* to
</span><span style='display:block; white-space:pre;color:#404040;'> ${prefix}/etc/Launch* if the port was built with startupitem_install
</span><span style='display:block; white-space:pre;color:#404040;'> on but it is currently off, and vice versa in the opposite case.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Fixes: https://trac.macports.org/ticket/44496
</span>---
src/port1.0/portactivate.tcl | 15 +++++++++++++--
src/port1.0/portstartupitem.tcl | 2 ++
src/registry2.0/portimage.tcl | 24 ++++++++++++++++++++++--
3 files changed, 37 insertions(+), 4 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portactivate.tcl b/src/port1.0/portactivate.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index ef6930c..135874e 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portactivate.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portactivate.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -59,9 +59,20 @@ proc portactivate::activate_start {args} {
</span> }
proc portactivate::activate_main {args} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- global subport version revision portvariants user_options PortInfo
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global subport version revision portvariants prefix user_options
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>- registry_activate $subport $version $revision $portvariants [array get user_options]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set optionlist [array get user_options]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set renames {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ portstartupitem::foreach_startupitem {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$si_install} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend renames ${prefix}/etc/${si_location}/${si_plist} /Library/${si_location}/${si_plist}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend renames /Library/${si_location}/${si_plist} ${prefix}/etc/${si_location}/${si_plist}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend optionlist portactivate_rename_files $renames
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ registry_activate $subport $version $revision $portvariants $optionlist
</span>
return 0
}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portstartupitem.tcl b/src/port1.0/portstartupitem.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 414015d..3233212 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portstartupitem.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portstartupitem.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -463,6 +463,8 @@ proc portstartupitem::startupitem_create_darwin_launchd {attrs} {
</span> if {[getuid] == 0 && $si(install)} {
file mkdir "${destroot}/Library/${daemondest}"
ln -sf "${itemdir}/${plistname}" "${destroot}/Library/${daemondest}"
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ln -sf ${itemdir}/${plistname} ${destroot}${prefix}/etc/${daemondest}
</span> }
}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/registry2.0/portimage.tcl b/src/registry2.0/portimage.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 72dcdfd..6f1639a 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/registry2.0/portimage.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/registry2.0/portimage.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -88,6 +88,10 @@ proc activate {name {version ""} {revision ""} {variants 0} {optionslist ""}} {
</span> if {[info exists options(ports_activate_no-exec)]} {
set noexec $options(ports_activate_no-exec)
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ set rename_list {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[info exists options(portactivate_rename_files)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set rename_list $options(portactivate_rename_files)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> if {![info exists registry_open]} {
registry::open [::file join ${macports::registry.path} registry registry.db]
set registry_open yes
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -132,7 +136,7 @@ proc activate {name {version ""} {revision ""} {variants 0} {optionslist ""}} {
</span>
ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s @%s"] $name $specifier]"
<span style='display:block; white-space:pre;background:#ffe0e0;'>- _activate_contents $requested
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _activate_contents $requested $rename_list
</span> }
# takes a composite version spec rather than separate version,revision,variants
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -439,7 +443,7 @@ proc extract_archive_to_tmpdir {location} {
</span> }
## Activates the contents of a port
<span style='display:block; white-space:pre;background:#ffe0e0;'>-proc _activate_contents {port {imagefiles {}} {location {}}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc _activate_contents {port {rename_list {}}} {
</span> variable force
variable noexec
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -543,6 +547,15 @@ proc _activate_contents {port {imagefiles {}} {location {}}} {
</span> # We don't have to do this as mentioned above, but it makes the
# debug output of activate make more sense.
set files [lsort -increasing -unique $files]
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ # handle files that are to be renamed
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set confirmed_rename_list {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach {src dest} $rename_list {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set index [lsearch -exact -sorted $files $src]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$index != -1} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set files [lreplace $files $index $index]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend confirmed_rename_list $src $dest
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> set rollback_filelist {}
registry::write {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -554,6 +567,13 @@ proc _activate_contents {port {imagefiles {}} {location {}}} {
</span> lappend rollback_filelist $file
}
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach {src dest} $confirmed_rename_list {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $port deactivate [list $src]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $port activate [list $src] [list $dest]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[_activate_file ${extracted_dir}${src} $dest] == 1} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend rollback_filelist $dest
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span>
# Recording that the port has been activated should be done
# here so that this information cannot be inconsistent with the
</pre><pre style='margin:0'>
</pre>