Update FFmpeg.munki.recipe
<string>com.github.faumac.pkg.FFmpeg</string>
<key>Process</key>
<array>
+ <dict>
+ <key>Processor</key>
+ <string>MunkiPkginfoMerger</string>
+ <key>Arguments</key>
+ <dict>
+ <key>additional_pkginfo</key>
+ <dict>
+ <key>version</key>
+ <string>%version%</string>
+ <key>installcheck_script</key>
+ <string>#!/usr/local/munki/munki-python
+# pylint: disable = invalid-name
+
+'''
+Copyright (c) 2021, dataJAR Ltd. All rights reserved.
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * 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.
+ * Neither data JAR Ltd 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 DATA JAR LTD '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 DATA JAR LTD 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.
+SUPPORT FOR THIS PROGRAM
+ This program is distributed 'as is' by DATA JAR LTD.
+ For more information or support, please utilise the following resources:
+ http://www.datajar.co.uk
+
+DESCRIPTION
+
+See docstring in main()
+
+'''
+
+from distutils.version import LooseVersion
+import os
+import sys
+import subprocess
+
+
+def main():
+ '''
+ Get ffmpeg version (if installed)
+
+ Exit 1 if ffmpeg is installed and newer than what we have in Munki
+
+ Based on:
+ https://github.com/autopkg/andrewzirkel-recipes/blob/master/LightspeedRelaySmartAgent/LightspeedRelaySmartAgent.munki.recipe#L46
+ '''
+
+ ffmpeg_binary = '/usr/local/bin/ffmpeg'
+ munki_version = '%version%'
+
+ # If the binary exists
+ if os.path.isfile(ffmpeg_binary):
+
+ try:
+ installed_ver = subprocess.check_output([ffmpeg_binary, '-version']).split()[2].decode('utf-8').split('-')[0]
+ except subprocess.CalledProcessError:
+ print("Encountered an error when ascertaining ffmpeg version, "
+ "proceeding with install...")
+ sys.exit(0)
+
+ if LooseVersion(installed_ver) &lt; LooseVersion(munki_version):
+ print("Version of ffmpeg older than the munki version, proceeding with install...")
+ sys.exit(0)
+
+ print("Version of ffmpeg same or newer than the munki version, skipping...")
+ sys.exit(1)
+
+ print("Cannot locate ffmpeg binary, proceeding with install...")
+ sys.exit(0)
+
+if __name__ == '__main__':
+ main()
+</string>
+ </dict>
+ </dict>
+ </dict>
<dict>
<key>Processor</key>
<string>MunkiImporter</string>
