-
Notifications
You must be signed in to change notification settings - Fork 20
/
fetch-binary-build.py
49 lines (42 loc) · 1.17 KB
/
fetch-binary-build.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import urllib2
import os
pieces = """
Security.hdrs.tar.gz
Security.root.tar.gz
SecurityTokend.hdrs.tar.gz
SecurityTokend.root.tar.gz
libsecurity_cdsa_client.hdrs.tar.gz
libsecurity_cdsa_client.root.tar.gz
libsecurity_cdsa_utilities.hdrs.tar.gz
libsecurity_cdsa_utilities.root.tar.gz
libsecurity_utilities.root.tar.gz
libsecurity_utilities.hdrs.tar.gz
"""
pieces = pieces.rstrip().lstrip().split("\n")
snowleopard = ["10A432", "10B504", "10C540", "10D573"]
snowleopard.sort()
snowleopard.reverse()
leopard = ["9A581", "9B18", "9C31", "9D34", "9E17", "9F33", "9G55", "9J61", "9L30"]
leopard.sort()
leopard.reverse()
ROOT = "http://src.macosforge.org/Roots/"
try:
os.mkdir("build-snowleopard")
except OSError:
pass
os.chdir("build-snowleopard")
for release in snowleopard:
for piece in pieces:
url = "%s%s/%s" % (ROOT, release, piece)
filename = piece
if not os.path.exists(filename):
try:
print "Trying %s" % (url)
req = urllib2.urlopen(url)
print "Fetching %s" % (url)
f = open(filename, "w")
f.write(req.read())
f.close()
except urllib2.HTTPError as problem:
if problem.getcode() != 404:
raise