[149146] trunk/dports/math
Ryan Schmidt
ryandesign at macports.org
Sun Jun 5 00:21:56 PDT 2016
> On Jun 1, 2016, at 6:41 PM, mcalhoun at macports.org wrote:
>
> Revision
> 149146
> Author
> mcalhoun at macports.org
> Date
> 2016-06-01 16:41:20 -0700 (Wed, 01 Jun 2016)
> Log Message
>
> octave family: writing to a plist file with /usr/bin/defaults is deprecated; use PlistBuddy instead (possible fix of #51424)
> Modified Paths
>
> • trunk/dports/math/octave/Portfile
> • trunk/dports/math/octave-devel/Portfile
> Diff
>
> Modified: trunk/dports/math/octave/Portfile (149145 => 149146)
> --- trunk/dports/math/octave/Portfile 2016-06-01 23:39:34 UTC (rev 149145)
> +++ trunk/dports/math/octave/Portfile 2016-06-01 23:41:20 UTC (rev 149146)
> @@ -375,18 +375,25 @@
> #NSHumanReadableCopyright ''
> #LSUIElement 1
> set values "
> - CFBundleDevelopmentRegion English
> - CFBundleExecutable Octave
> - CFBundleIconFile Octave.icns
> - CFBundleDocumentTypes {-array \'{\"CFBundleTypeExtensions\" = (\"m\"); \"CFBundleTypeOSTypes\" = (\"Mfile\"); \"CFBundleTypeRole\" = \"Editor\";}\'}
> - CFBundleIdentifier org.octave.Octave
> - CFBundleInfoDictionaryVersion 6.0
> - CFBundleSignature Octave
> - CFBundleVersion ${version}
> - CFBundleShortVersionString ${version}
> + CFBundleDevelopmentRegion string English
> + CFBundleExecutable string Octave
> + CFBundleIconFile string Octave.icns
> + CFBundleIdentifier string org.octave.Octave
> + CFBundleInfoDictionaryVersion string 6.0
> + CFBundleSignature string Octave
> + CFBundleVersion string ${version}
> + CFBundleShortVersionString string ${version}
> + CFBundleDocumentTypes array {}
> + CFBundleDocumentTypes: dict {}
> + CFBundleDocumentTypes:0:CFBundleTypeRole string \"Editor\"
> + CFBundleDocumentTypes:0:CFBundleTypeExtensions array {}
> + CFBundleDocumentTypes:0:CFBundleTypeExtensions: string \"m\"
> + CFBundleDocumentTypes:0:CFBundleTypeOSTypes array {}
> + CFBundleDocumentTypes:0:CFBundleTypeOSTypes: string \"Mfile\"
> "
> - foreach {key value} ${values} {
> - system "/usr/bin/defaults write ${worksrcpath}/${appName}/Contents/Info ${key} ${value}"
> +
> + foreach {key type value} ${values} {
> + system -W "${worksrcpath}/${appName}/Contents" "/usr/libexec/PlistBuddy -c \"Add :${key} ${type} ${value}\" Info.plist"
>
> }
Do we maybe need a generic plist-writing function in MacPorts base to make this easier? MacPorts base itself could make use of it for writing launchd plists, and the app portgroup and ports like octave could use it for writing Info.plists.
Note that, if this port previously worked on Tiger, this change will break it, because /usr/libexec/PlistBuddy is not on Tiger (though PlistBuddy is almost certainly elsewhere on Tiger systems, inside at least one of the installer receipts).
More information about the macports-dev
mailing list