[151138] contrib/mp-buildbot/mpbb-list-subports

ryandesign at macports.org ryandesign at macports.org
Sun Aug 7 20:30:15 PDT 2016


Revision: 151138
          https://trac.macports.org/changeset/151138
Author:   ryandesign at macports.org
Date:     2016-08-07 20:30:15 -0700 (Sun, 07 Aug 2016)
Log Message:
-----------
mp-buildbot: use sw_vers and sysctl only once, outside the loop

Modified Paths:
--------------
    contrib/mp-buildbot/mpbb-list-subports

Modified: contrib/mp-buildbot/mpbb-list-subports
===================================================================
--- contrib/mp-buildbot/mpbb-list-subports	2016-08-08 02:08:18 UTC (rev 151137)
+++ contrib/mp-buildbot/mpbb-list-subports	2016-08-08 03:30:15 UTC (rev 151138)
@@ -19,6 +19,8 @@
     local exclude_reasons
     local reason
 
+    os_version="$(sw_vers -productVersion | cut -d . -f 1-2)"
+    is_64bit_capable="$(sysctl -n hw.cpu64bit_capable)"
     ports=$("${option_prefix}/bin/port" -q info --index --line --name "${portname}" "subportof:${portname}" 2>/dev/null) || return $?
     for port in $ports; do
         exclude=0
@@ -36,8 +38,7 @@
             fi
         done
 
-        os_version="$(sw_vers -productVersion | cut -d . -f 1-2)"
-        if [[ "${os_version}" = "10.6" && "$(sysctl -n hw.cpu64bit_capable)" = "0" ]]; then
+        if [[ "${os_version}" = "10.6" && "${is_64bit_capable}" = "0" ]]; then
             supported_archs=$("${option_prefix}/bin/port-tclsh" "${thisdir}/tools/supported-archs.tcl" "${port}")
             if [[ -n "${supported_archs}" && !("${supported_archs}" == *"x86_64"* && "${supported_archs}" == *"i386"*) ]]; then
                 exclude=1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160807/720e5fb3/attachment-0001.html>


More information about the macports-changes mailing list