Package: botch / 0.21-8

add-patch-to-fix-ftbfs-due-to-api-breaka Patch series | download
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
From: Johannes Schauer <josch@debian.org>
Date: Sat, 28 Jan 2017 10:26:13 +0100
X-Dgit-Generated: 0.21-3 e3fbc643e6af55da3b9b547e41d6189a7fed4c7e
Subject: Add patch to fix FTBFS due to API breakage introduced by src:dose3 5.0.1-8 (closes: #852917)


---

--- botch-0.21.orig/bin2src.ml
+++ botch-0.21/bin2src.ml
@@ -49,7 +49,7 @@ module Options = struct
   StdOptions.OutputOptions.add_options ~default options;;
 
   include StdOptions.DistribOptions;;
-  let default = List.filter (fun e -> not (List.mem e ["deb-drop-b-d-indep"; "deb-profiles"; "deb-ignore-essential"; "deb-builds-from"])) StdOptions.DistribOptions.default_options in
+  let default = List.filter (fun e -> not (List.mem e ["deb-drop-b-d-indep"; "deb-drop-b-d-arch"; "deb-profiles"; "deb-ignore-essential"; "deb-builds-from"])) StdOptions.DistribOptions.default_options in
   StdOptions.DistribOptions.add_debian_options ~default options ;;
 end
 
--- botch-0.21.orig/buildcheck-more-problems.ml
+++ botch-0.21/buildcheck-more-problems.ml
@@ -32,7 +32,7 @@ module Options = struct
   let dump = StdOpt.str_option ()
   let maforeign = StdOpt.store_true ()
   let includextra = StdOpt.store_true ()
-  let triplettable = StdOpt.str_option ()
+  let tupletable = StdOpt.str_option ()
   let cputable = StdOpt.str_option ()
   let dropalternatives = StdOpt.store_true ()
 
@@ -54,8 +54,8 @@ module Options = struct
   include StdOptions.DistribOptions ;;
   StdOptions.DistribOptions.add_debian_options options ;;
   let group = StdOptions.DistribOptions.deb_group options in
-  StdOptions.DistribOptions.add_option options ~group ~long_name:"deb-triplettable"
-    ~help:"Path to an architecture triplet table like /usr/share/dpkg/triplettable" triplettable;
+  StdOptions.DistribOptions.add_option options ~group ~long_name:"deb-tupletable"
+    ~help:"Path to an architecture tuple table like /usr/share/dpkg/tupletable" tupletable;
   StdOptions.DistribOptions.add_option options ~group ~long_name:"deb-cputable"
     ~help:"Path to a cpu table like /usr/share/dpkg/cputable" cputable;
   StdOptions.DistribOptions.add_option options ~group ~long_name:"deb-defaulted-m-a-foreign"
@@ -110,15 +110,15 @@ let main () =
       with Not_found -> true
   in
 
-  if (OptParse.Opt.is_set Options.triplettable)
+  if (OptParse.Opt.is_set Options.tupletable)
   || OptParse.Opt.is_set Options.cputable then begin
-    let ttfile = if OptParse.Opt.is_set Options.triplettable then
-        Some (OptParse.Opt.get Options.triplettable)
+    let ttfile = if OptParse.Opt.is_set Options.tupletable then
+        Some (OptParse.Opt.get Options.tupletable)
       else None in
     let ctfile = if OptParse.Opt.is_set Options.cputable then
         Some (OptParse.Opt.get Options.cputable)
       else None in
-    Architecture.read_triplettable ~ttfile ~ctfile ()
+    Architecture.read_tupletable ~ttfile ~ctfile ()
   end;
 
   let pkglist, srclist =
--- botch-0.21.orig/doc/man/botch-annotate-strong.pod
+++ botch-0.21/doc/man/botch-annotate-strong.pod
@@ -40,6 +40,10 @@ do not print any messages
 
 Drop Build-Depends-Indep dependencies
 
+=item B<--deb-drop-b-d-arch>
+
+Drop Build-Depends-Arch dependencies
+
 =item B<--deb-native-arch=>I<arch>
 
 Native architecture I<arch>.
--- botch-0.21.orig/doc/man/botch-build-fixpoint.pod
+++ botch-0.21/doc/man/botch-build-fixpoint.pod
@@ -49,6 +49,10 @@ I<Packages>.
 
 Drop Build-Depends-Indep dependencies
 
+=item B<--deb-drop-b-d-arch>
+
+Drop Build-Depends-Arch dependencies
+
 =item B<--allowsrcmismatch>
 
 If a binary package is without a source package but there is a source package
--- botch-0.21.orig/doc/man/botch-buildgraph2srcgraph.pod
+++ botch-0.21/doc/man/botch-buildgraph2srcgraph.pod
@@ -39,6 +39,10 @@ do no print any messages
 
 Drop Build-Depends-Indep dependencies
 
+=item B<--deb-drop-b-d-arch>
+
+Drop Build-Depends-Arch dependencies
+
 =item B<--fg=>I<PKGS>
 
 Additional Packages lists that are checked and used for resolving dependencies
--- botch-0.21.orig/doc/man/botch-calculate-fas.pod
+++ botch-0.21/doc/man/botch-calculate-fas.pod
@@ -43,6 +43,10 @@ maximum length of found cycles for fas s
 
 Drop Build-Depends-Indep dependencies
 
+=item B<--deb-drop-b-d-arch>
+
+Drop Build-Depends-Arch dependencies
+
 =item B<--fg=>I<PKGS>
 
 Additional Packages lists that are checked and used for resolving dependencies
--- botch-0.21.orig/doc/man/botch-clean-repository.pod
+++ botch-0.21/doc/man/botch-clean-repository.pod
@@ -51,6 +51,10 @@ add source packages which only build arc
 
 Drop Build-Depends-Indep dependencies
 
+=item B<--deb-drop-b-d-arch>
+
+Drop Build-Depends-Arch dependencies
+
 =item B<--allowsrcmismatch>
 
 If a binary package is without a source package but there is a source package
--- botch-0.21.orig/doc/man/botch-collapse-srcgraph.pod
+++ botch-0.21/doc/man/botch-collapse-srcgraph.pod
@@ -38,6 +38,10 @@ do no print any messages
 
 Drop Build-Depends-Indep dependencies
 
+=item B<--deb-drop-b-d-arch>
+
+Drop Build-Depends-Arch dependencies
+
 =item B<--fg=>I<PKGS>
 
 Additional Packages lists that are checked and used for resolving dependencies
--- botch-0.21.orig/doc/man/botch-create-graph.pod
+++ botch-0.21/doc/man/botch-create-graph.pod
@@ -47,6 +47,10 @@ list of files with dependencies that sho
 
 Drop Build-Depends-Indep dependencies
 
+=item B<--deb-drop-b-d-arch>
+
+Drop Build-Depends-Arch dependencies
+
 =item B<--allowsrcmismatch>
 
 If a binary package is without a source package but there is a source package
--- botch-0.21.orig/doc/man/botch-find-fvs.pod
+++ botch-0.21/doc/man/botch-find-fvs.pod
@@ -39,6 +39,10 @@ do no print any messages
 
 Drop Build-Depends-Indep dependencies
 
+=item B<--deb-drop-b-d-arch>
+
+Drop Build-Depends-Arch dependencies
+
 =item B<--max-length-fvs=>I<INT>
 
 maximum length of found cycles for fvs search (default=4)
--- botch-0.21.orig/doc/man/botch-optuniv.pod
+++ botch-0.21/doc/man/botch-optuniv.pod
@@ -53,6 +53,10 @@ also add source packages for Architectur
 
 Drop Build-Depends-Indep dependencies
 
+=item B<--deb-drop-b-d-arch>
+
+Drop Build-Depends-Arch dependencies
+
 =item B<--allowsrcmismatch>
 
 If a binary package is without a source package but there is a source package
--- botch-0.21.orig/doc/man/botch-partial-order.pod
+++ botch-0.21/doc/man/botch-partial-order.pod
@@ -38,6 +38,10 @@ do no print any messages
 
 Drop Build-Depends-Indep dependencies
 
+=item B<--deb-drop-b-d-arch>
+
+Drop Build-Depends-Arch dependencies
+
 =item B<--fg=>I<PKGS>
 
 Additional Packages lists that are checked and used for resolving dependencies
--- botch-0.21.orig/doc/man/botch-print-stats.pod
+++ botch-0.21/doc/man/botch-print-stats.pod
@@ -63,6 +63,10 @@ List of available packages (arch:all, cr
 
 Drop Build-Depends-Indep dependencies
 
+=item B<--deb-drop-b-d-arch>
+
+Drop Build-Depends-Arch dependencies
+
 =item B<--allowsrcmismatch>
 
 If a binary package is without a source package but there is a source package
--- botch-0.21.orig/src2bin.ml
+++ botch-0.21/src2bin.ml
@@ -55,7 +55,7 @@ module Options = struct
   StdOptions.OutputOptions.add_options ~default options;;
 
   include StdOptions.DistribOptions;;
-  let default = List.filter (fun e -> not (List.mem e ["deb-drop-b-d-indep"; "deb-profiles"; "deb-ignore-essential"; "deb-builds-from"])) StdOptions.DistribOptions.default_options in
+  let default = List.filter (fun e -> not (List.mem e ["deb-drop-b-d-indep"; "deb-drop-b-d-arch"; "deb-profiles"; "deb-ignore-essential"; "deb-builds-from"])) StdOptions.DistribOptions.default_options in
   StdOptions.DistribOptions.add_debian_options ~default options;;
 end
 
--- botch-0.21.orig/tools/debarch.py
+++ botch-0.21/tools/debarch.py
@@ -1,7 +1,7 @@
 """architecture matching
 
 @copyright: 2014, Ansgar Burchardt <ansgar@debian.org>
-@copyright: 2014, Johannes Schauer <j.schauer@email.de>
+@copyright: 2014-2017, Johannes Schauer <j.schauer@email.de>
 @license: GPL-2+
 """
 
@@ -22,8 +22,8 @@
 # FIXME: this should be integrated into python-debian
 #        see: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=771058
 
-_cached_arch2triplet = None
-_cached_triplet2arch = None
+_cached_arch2tuple = None
+_cached_tuple2arch = None
 _cached_cputable = None
 
 
@@ -44,66 +44,68 @@ def _read_cputable():
     return _cached_cputable
 
 
-def _read_triplettable():
-    global _cached_arch2triplet, _cached_triplet2arch
-    if _cached_arch2triplet is None or _cached_triplet2arch is None:
-        table = _load_table('/usr/share/dpkg/triplettable')
-        arch2triplet = dict()
-        triplet2arch = dict()
+def _read_tupletable():
+    global _cached_arch2tuple, _cached_tuple2arch
+    if _cached_arch2tuple is None or _cached_tuple2arch is None:
+        table = _load_table('/usr/share/dpkg/tupletable')
+        arch2tuple = dict()
+        tuple2arch = dict()
         for row in table:
-            debtriplet = row[0]
+            debtuple = row[0]
             debarch = row[1]
-            if '<cpu>' in debtriplet:
+            if '<cpu>' in debtuple:
                 for r in _read_cputable():
                     cpu = r[0]
-                    dt = debtriplet.replace('<cpu>', cpu)
+                    dt = debtuple.replace('<cpu>', cpu)
                     da = debarch.replace('<cpu>', cpu)
-                    arch2triplet[da] = dt
-                    triplet2arch[dt] = da
+                    arch2tuple[da] = dt
+                    tuple2arch[dt] = da
             else:
-                arch2triplet[debarch] = debtriplet
-                triplet2arch[debtriplet] = debarch
-        _cached_arch2triplet = arch2triplet
-        _cached_triplet2arch = triplet2arch
-    return _cached_triplet2arch, _cached_arch2triplet
+                arch2tuple[debarch] = debtuple
+                tuple2arch[debtuple] = debarch
+        _cached_arch2tuple = arch2tuple
+        _cached_tuple2arch = tuple2arch
+    return _cached_tuple2arch, _cached_arch2tuple
 
 
-def debwildcard_to_debtriplet(arch):
-    arch_tuple = arch.split('-', 2)
+def debwildcard_to_debtuple(arch):
+    arch_tuple = arch.split('-', 3)
 
     if 'any' in arch_tuple:
-        if len(arch_tuple) == 3:
+        if len(arch_tuple) == 4:
             return arch_tuple
+        elif len(arch_tuple) == 3:
+            return ('any', arch_tuple[0], arch_tuple[1], arch_tuple[2])
         elif len(arch_tuple) == 2:
-            return ('any', arch_tuple[0], arch_tuple[1])
+            return ('any', 'any', arch_tuple[0], arch_tuple[1])
         else:
-            return ('any', 'any', 'any')
+            return ('any', 'any', 'any', 'any')
     else:
-        return debarch_to_debtriplet(arch)
+        return debarch_to_debtuple(arch)
 
 
-def debarch_to_debtriplet(arch):
+def debarch_to_debtuple(arch):
     if (arch.startswith("linux-")):
         arch = arch[6:]
 
-    triplet = _read_triplettable()[1].get(arch)
+    tuple = _read_tupletable()[1].get(arch)
 
-    if triplet is None:
+    if tuple is None:
         return
-    return triplet.split('-', 2)
+    return tuple.split('-', 3)
 
 
 def match_architecture(real, alias):
     if alias == real or alias == "any":
         return True
 
-    real = debarch_to_debtriplet(real)
-    alias = debwildcard_to_debtriplet(alias)
+    real = debarch_to_debtuple(real)
+    alias = debwildcard_to_debtuple(alias)
 
-    if real is None or len(real) != 3 or alias is None or len(alias) != 3:
+    if real is None or len(real) != 4 or alias is None or len(alias) != 4:
         return False
 
-    for i in range(0, 3):
+    for i in range(0, 4):
         if (alias[i] != real[i] and alias[i] != "any"):
             return False
     return True