Patchwork [5,of,7,v3,stable,osx-packaging] hghave: add check for OS X packaging tools

login
register
mail settings
Submitter Kevin Bullock
Date April 29, 2016, 7:17 p.m.
Message ID <948a2528c44c808a844f.1461957428@billings.local>
Download mbox | patch
Permalink /patch/14835/
State Accepted
Headers show

Comments

Kevin Bullock - April 29, 2016, 7:17 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1461771955 14400
#      Wed Apr 27 11:45:55 2016 -0400
# Branch stable
# Node ID 948a2528c44c808a844fc36de1cdbb66099299ab
# Parent  f885dd89a93375b64479b8c2d1e40b8cb6f9adb5
hghave: add check for OS X packaging tools

Patch

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -464,6 +464,19 @@  def has_bdistmpkg():
     except ImportError:
         return False
 
+@check("osxpackaging", "OS X packaging tools")
+def has_osxpackaging():
+    try:
+        return (matchoutput('pkgbuild', 'Usage: pkgbuild ', ignorestatus=1)
+                and matchoutput(
+                    'productbuild', 'Usage: productbuild ',
+                    ignorestatus=1)
+                and matchoutput('lsbom', 'Usage: lsbom', ignorestatus=1)
+                and matchoutput(
+                    'xar --help', 'Usage: xar', ignorestatus=1))
+    except ImportError:
+        return False
+
 @check("docker", "docker support")
 def has_docker():
     pat = r'A self-sufficient runtime for'