summarylogtreecommitdiffstats
path: root/thunderbird-60.2.1-buildfix.patch
blob: f7742ea912818ec7d9e67a6bc7f491c750e92f34 (plain)
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

# HG changeset patch
# User Chris Manchester <cmanchester@mozilla.com>
# Date 1533063488 25200
# Node ID bc651d3d910cbc0730d870c5436b29ddc01fef10
# Parent  e9dd9434ad9ac15284429d904a45e4daf567c03b
Bug 1479540 - Accept "triplet" strings with only two parts in moz.configure. r=froydnj, a=jcristau

MozReview-Commit-ID: 7pFhoJgBMhQ

diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -586,17 +586,26 @@ option('--target', nargs=1,
 @imports(_from='__builtin__', _import='KeyError')
 @imports(_from='__builtin__', _import='ValueError')
 def split_triplet(triplet, allow_unknown=False):
     # The standard triplet is defined as
     #   CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
     # There is also a quartet form:
     #   CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
     # But we can consider the "KERNEL-OPERATING_SYSTEM" as one.
-    cpu, manufacturer, os = triplet.split('-', 2)
+    # Additionally, some may omit "unknown" when the manufacturer
+    # is not specified and emit
+    #   CPU_TYPE-OPERATING_SYSTEM
+    parts = triplet.split('-', 2)
+    if len(parts) == 3:
+        cpu, _, os = parts
+    elif len(parts) == 2:
+        cpu, os = parts
+    else:
+        die("Unexpected triplet string: %s" % triplet)
 
     # Autoconf uses config.sub to validate and canonicalize those triplets,
     # but the granularity of its results has never been satisfying to our
     # use, so we've had our own, different, canonicalization. We've also
     # historically not been very consistent with how we use the canonicalized
     # values. Hopefully, this will help us make things better.
     # The tests are inherited from our decades-old autoconf-based configure,
     # which can probably be improved/cleaned up because they are based on a