From efe473b4d7b2eea161358eca39739c6353b8bccc Mon Sep 17 00:00:00 2001 From: shypike Date: Sat, 25 Oct 2014 11:25:22 +0200 Subject: [PATCH] Update OSX signing. Lion build can only be signed on Lion. ML/Mav build must be signed on Mav. --- make_dmg.py | 9 +++++---- package.py | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/make_dmg.py b/make_dmg.py index f37f449..fcd9081 100644 --- a/make_dmg.py +++ b/make_dmg.py @@ -27,7 +27,7 @@ OSX_MAV = [int(n) for n in platform.mac_ver()[0].split('.')] >= [10, 9, 0] # Check if signing is possible authority = os.environ.get('SIGNING_AUTH') if authority and not OSX_MAV: - print 'Signing is only possible on OSX Mavericks (10.9.x) or higher' + print 'Signing should be done on OSX Mavericks (10.9.x) or higher' exit(1) if len(sys.argv) < 2: @@ -78,12 +78,13 @@ m = re.search(r'/dev/(\w+)\s+', data) volume = 'SABnzbd-' + str(release) os.system('diskutil rename %s %s' % (m.group(1), volume)) -# Unpack build into image and sign if possible +# Unpack build into image and sign if possible and not already done and not SnowLeopard for build in xrange(len(builds)): vol_path = '/Volumes/%s/%s/' % (volume, build_folders[build]) os.system('ditto -x -z "%s" "%s"' % (build_paths[build], vol_path)) - if authority: - os.system('codesign --deep -f -i "org.sabnzbd.SABnzbd" -s "%s" "%s/SABnzbd.app"' % (authority, vol_path)) + if authority and builds[build] != 'sl': + if not os.path.exists(os.path.join(vol_path, 'SABnzbd.app/Contents/_CodeSignature')): + os.system('codesign --deep -f -i "org.sabnzbd.SABnzbd" -s "%s" "%s/SABnzbd.app"' % (authority, vol_path)) # Put README.rtf in root diff --git a/package.py b/package.py index 66c7439..a211df6 100755 --- a/package.py +++ b/package.py @@ -456,6 +456,11 @@ if target == 'app': os.system("sleep 5") + # Sign if possible + authority = os.environ.get('SIGNING_AUTH') + if authority: + os.system('codesign --deep -f -i "org.sabnzbd.SABnzbd" -s "%s" "dist/SABnzbd.app"' % authority) + # Archive result to share, if present dest_path = os.environ.get('SHARE') if dest_path and os.path.exists(dest_path):