]>
Commit | Line | Data |
---|---|---|
e41327ce JP |
1 | |
2 | # HG changeset patch | |
3 | # User Chris Manchester <cmanchester@mozilla.com> | |
4 | # Date 1533063488 25200 | |
5 | # Node ID 36f4ba2fb6f5139b7942e81554190354da1f369a | |
6 | # Parent ff18e94c90460faa9cca8ff39a0ea4876b0c2039 | |
7 | Bug 1479540 - Accept "triplet" strings with only two parts in moz.configure. r=froydnj | |
8 | ||
9 | MozReview-Commit-ID: 7pFhoJgBMhQ | |
10 | ||
11 | diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure | |
12 | --- a/build/moz.configure/init.configure | |
13 | +++ b/build/moz.configure/init.configure | |
14 | @@ -587,17 +587,26 @@ option('--target', nargs=1, | |
15 | @imports(_from='__builtin__', _import='KeyError') | |
16 | @imports(_from='__builtin__', _import='ValueError') | |
17 | def split_triplet(triplet, allow_unknown=False): | |
18 | # The standard triplet is defined as | |
19 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM | |
20 | # There is also a quartet form: | |
21 | # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM | |
22 | # But we can consider the "KERNEL-OPERATING_SYSTEM" as one. | |
23 | - cpu, manufacturer, os = triplet.split('-', 2) | |
24 | + # Additionally, some may omit "unknown" when the manufacturer | |
25 | + # is not specified and emit | |
26 | + # CPU_TYPE-OPERATING_SYSTEM | |
27 | + parts = triplet.split('-', 2) | |
28 | + if len(parts) == 3: | |
29 | + cpu, _, os = parts | |
30 | + elif len(parts) == 2: | |
31 | + cpu, os = parts | |
32 | + else: | |
33 | + die("Unexpected triplet string: %s" % triplet) | |
34 | ||
35 | # Autoconf uses config.sub to validate and canonicalize those triplets, | |
36 | # but the granularity of its results has never been satisfying to our | |
37 | # use, so we've had our own, different, canonicalization. We've also | |
38 | # historically not been very consistent with how we use the canonicalized | |
39 | # values. Hopefully, this will help us make things better. | |
40 | # The tests are inherited from our decades-old autoconf-based configure, | |
41 | # which can probably be improved/cleaned up because they are based on a | |
42 |