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
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
|
2023-09-23 Colin Watson <cjwatson@debian.org>
Release man-db 2.12.0
2023-09-19 Colin Watson <cjwatson@debian.org>
systemd: Avoid duplicate cleanup of old cat pages
Thanks to Ferenc Wágner. Fixes https://bugs.debian.org/1052221.
* init/systemd/man-db.service.in: Remove call to `find`; this is already
handled equivalently by `init/systemd/man-db.conf.in`, and having both
can result in error messages due to the two cleanups running
concurrently.
* NEWS.md: Document this.
2023-08-20 Colin Watson <cjwatson@debian.org>
bootstrap: Make --skip-po disable Gnulib downloads too
Fixes https://bugs.debian.org/1050089.
* bootstrap.conf: If the `--skip-po` option is explicitly passed, then
don't pass `--po-base` or `--po-domain` options to `gnulib-tool`, and
don't merge `gl/ref-po/` into `gl/po/`.
2023-08-07 Colin Watson <cjwatson@debian.org>
README.md: Update my copyright notice
2023-08-07 Colin Watson <cjwatson@debian.org>
Update URLs for libpipeline and flex
* NEWS.md, docs/INSTALL.quick: Update libpipeline URLs to
<https://libpipeline.gitlab.io/libpipeline/>.
* docs/INSTALL.quick: Update flex URL to
<https://github.com/westes/flex>.
2023-08-07 Colin Watson <cjwatson@debian.org>
Update to Gnulib stable-202307 as of 20230728
* bootstrap.conf (GNULIB_REVISION): Set to
d1b40e09c9c04d5c1ff120373397c6180bc16beb.
2023-08-07 Colin Watson <cjwatson@debian.org>
Update syscall lists from systemd ab9617a766
* lib/sandbox.c (make_seccomp_filter): Add `futex_waitv`,
`riscv_hwprobe`, and `arm_fadvise64_64`.
2023-08-07 Petr Pisar <petr.pisar@atlas.cz>
Update Czech translation
* po/cs.po: Update from Translation Project.
2023-08-07 Mario Blättermann <mario.blaettermann@gmail.com>
Update German manual page translation
* man/po4a/po/de.po: Update from Translation Project.
2023-08-07 Boyuan Yang <073plan@gmail.com>
Update Simplified Chinese manual page translation
* man/po4a/po/zh_CN.po: Update from Translation Project.
2023-08-07 Boyuan Yang <073plan@gmail.com>
Update Simplified Chinese translation
* po/zh_CN.po: Update from Translation Project.
2023-08-07 Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
Update Romanian manual page translation
* man/po4a/po/ro.po: Update from Translation Project.
2023-08-07 Seong-ho Cho <darkcircle.0426@gmail.com>
Update Korean manual page translation
* man/po4a/po/ko.po: Update from Translation Project.
2023-08-07 Seong-ho Cho <darkcircle.0426@gmail.com>
Update Korean translation
* po/ko.po: Update from Translation Project.
2023-08-06 Colin Watson <cjwatson@debian.org>
Release man-db 2.12.0-pre2
2023-08-06 Colin Watson <cjwatson@debian.org>
Update translation files
* man/po4a/po/*.pot, man/po4a/po/*.po, po/*.pot, po/*.po: Update.
2023-08-06 Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
Update Romanian manual page translation
* man/po4a/po/ro.po: Update from Translation Project.
2023-08-06 Colin Watson <cjwatson@debian.org>
man(1): Document handling of file names without -l more accurately
Fixes https://gitlab.com/man-db/man-db/-/issues/18.
* man/man1/man.man1: Without `-l`, we only fall back to interpreting
arguments as local file names if they contain a slash. Explain this
more accurately.
* NEWS.md: Document this.
2023-08-06 Colin Watson <cjwatson@chiark.greenend.org.uk>
Merge branch 'cjwatson/man-negative-warnings' into 'main'
man: Allow disabling warnings enabled by default in groff
See merge request man-db/man-db!8
2023-08-06 Colin Watson <cjwatson@chiark.greenend.org.uk>
man: Allow disabling warnings enabled by default in groff
2023-08-06 Colin Watson <cjwatson@debian.org>
man(1): Fix typography in STANDARDS
Reported by Mario Blättermann.
* man/man/man.man1 (STANDARDS): Use `\-`, not a mix of Unicode hyphens
and unescaped ASCII hyphens.
* man/po4a/po/*.pot, man/po4a/po/*.po: Update.
2023-08-06 Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
Update Romanian translation
* po/ro.po: Update from Translation Project.
2023-08-06 Mario Blättermann <mario.blaettermann@gmail.com>
Update German manual page translation
* man/po4a/po/de.po: Update from Translation Project.
2023-08-06 Mario Blättermann <mario.blaettermann@gmail.com>
Update German translation
* po/de.po: Update from Translation Project.
2023-08-06 Yi-Jyun Pan <pan93412@gmail.com>
Update Traditional Chinese translation
* po/zh_TW.po: Update from Translation Project.
2023-08-06 Colin Watson <cjwatson@debian.org>
Declare variable as const
* lib/util.c (init_locale): Declare `locale` as const.
2023-08-06 Colin Watson <cjwatson@chiark.greenend.org.uk>
Merge branch 'guess_manpath_fix' into 'main'
Fixed add_man_subdirs to correctly add PATH elements with trailing paths
See merge request man-db/man-db!10
2023-08-06 Jan Seeger <jan.seeger@thenybble.de>
Fixed add_man_subdirs to correctly add PATH elements with trailing paths
2023-08-06 Colin Watson <cjwatson@debian.org>
Release man-db 2.12.0-pre1
* man/po4a/po/*.pot, man/po4a/po/*.po, po/man-db.pot, po/*.po: Update.
* NEWS.md: Bump next version to 2.12.0.
* configure.ac: Update version and date.
2023-08-06 Colin Watson <cjwatson@debian.org>
Always pass a line length to nroff
Fixes https://bugs.debian.org/1041704.
* src/man.c (get_roff_line_length): Remove `line_length != 80`
condition.
* NEWS.md: Document this.
2023-08-01 Colin Watson <cjwatson@chiark.greenend.org.uk>
Merge branch 'branden-lexgrog-thinko' into 'main'
lexgrog.1: Fix thinko in my recent contribution
See merge request man-db/man-db!9
2023-07-28 G. Branden Robinson <g.branden.robinson@gmail.com>
lexgrog.1: Fix thinko in my recent contribution
In commit bbf7701c4f, 19 July, I got the sense of the tests that
governed the macro definitions backwards. I fooled myself because I use
a more complex test in groff's an-ext.tmac file (written in a
non-intuitive way due to AT&T troff limitations) so that it's easy to
run groff's automated tests on them.
2023-07-22 Colin Watson <cjwatson@debian.org>
Ensure that time_t can go past 2038
* bootstrap.conf (gnulib_modules): Add `year2038-recommended`.
* NEWS.md: Document this.
2023-07-22 Colin Watson <cjwatson@debian.org>
man: Pass --regex/--wildcard on to whatis/apropos
Fixes https://gitlab.com/man-db/man-db/-/issues/13.
* src/man.c (do_extern): Pass `-r` or `-w` options to the external
program if necessary.
* man/man1/man.man1 (Main modes of operation): Document that `-f` and
`-k` are still only approximately equivalent to `whatis` and `apropos`
respectively (since `man` accepts slightly different options).
* NEWS.md: Document this.
2023-07-22 Colin Watson <cjwatson@debian.org>
Update pre-commit hooks
* .pre-commit-config.yaml (shellcheck-py): Update to v0.9.0.5.
2023-07-22 Colin Watson <cjwatson@debian.org>
Upgrade to Gnulib stable-202307
* bootstrap: Sync to Gnulib b7f7ed06961454cdf77b93c6c00c3e3f26202663.
* bootstrap.conf (GNULIB_REVISION): Set to
b7f7ed06961454cdf77b93c6c00c3e3f26202663.
* src/tests/Makefile.am (fspause_LDADD): Link with `$(NANOSLEEP_LIB)`
instead of `$(LIB_NANOSLEEP)`.
* NEWS.md: Document this.
2023-07-21 Colin Watson <cjwatson@debian.org>
Include .lf corrections in debugging output
The pipeline command names in `PIPELINE_DEBUG` output are deliberately
abbreviated in the cases where the command is inserting data into the
`*roff` input stream, in an attempt to convey the essential parts
without overwhelming the reader. However, it probably does make sense
to include `.lf` corrections there, since if you're relying on the
debugging output to construct a manual shell pipeline when debugging an
issue with a page, you'll want the `.lf` corrections so that line
numbers still come out correctly.
* src/man.c (add_roff_line_length, display): Include `echo .lf 1` in
command names where appropriate.
2023-07-20 Colin Watson <cjwatson@debian.org>
Take advantage of groff's AD string and HY register
Fixes https://gitlab.com/man-db/man-db/-/issues/23. Thanks to G.
Branden Robinson for assistance.
* src/man.c (make_roff_command) [TROFF_IS_GROFF]: Implement
`--no-hyphenation` using `-rHY=0`. This requires groff >= 1.19,
released in 2003.
(disable_hyphenation): Only define if `TROFF_IS_GROFF` is not defined.
(display): Only use the more complex hyphenation-control mechanism if
`TROFF_IS_GROFF` is not defined.
* src/man.c (disable_justification): Implement using `.ds AD l` if groff
is at least version 1.23.0.
(display): Adjust debugging output to reflect this (more or less).
* NEWS.md: Document this.
2023-07-20 Colin Watson <cjwatson@debian.org>
Document false negatives from "man -K"
Fixes https://gitlab.com/man-db/man-db/-/issues/14.
* man/man1/man.man1 (Main modes of operation): Document false negatives
due to things like `\-`.
* NEWS.md: Document this.
2023-07-20 Colin Watson <cjwatson@debian.org>
man(1): Add a STANDARDS section
Fixes https://gitlab.com/man-db/man-db/-/issues/20.
* man/man1/man.man1 (STANDARDS): New section.
* NEWS.md: Document this.
2023-07-19 Colin Watson <cjwatson@debian.org>
Change "CONFORMING TO" to "STANDARDS"
This is in line with `man-pages(7)`.
See https://gitlab.com/man-db/man-db/-/issues/20.
* man/man1/man.man1 (DESCRIPTION): Recommend `STANDARDS` rather than
`CONFORMING TO`.
* NEWS.md: Document this.
2023-07-19 Colin Watson <cjwatson@debian.org>
Fix test failures when a working iconv is not available
Part of https://gitlab.com/man-db/man-db/-/issues/25.
* configure.ac: Substitute `HAVE_ICONV`.
* src/tests/Makefile.am (TESTS_ENVIRONMENT): Export `HAVE_ICONV`.
* src/tests/testlib.sh (report_skip): New function to skip an individual
test out of several in a file.
(skip): Refactor slightly to call `report_skip`.
* src/tests/man-recode-in-place, src/tests/man-recode-suffix,
src/tests/manconv-coding-tags, src/tests/manconv-guess-from-encoding,
src/tests/manconv-incomplete-char-at-eof,
src/tests/manconv-odd-combinations: Skip several tests if `HAVE_ICONV`
is not `yes`.
* NEWS.md: Document this.
2023-07-19 Colin Watson <cjwatson@debian.org>
NEWS.md: Document some recent commits
2023-07-19 Colin Watson <cjwatson@debian.org>
Update warning regex for groff 1.23.0
Part of https://gitlab.com/man-db/man-db/-/issues/25.
* man/check-man: groff 1.23.0 says "cannot break line" rather than
"can't break line"; update regular expression.
2023-07-19 Colin Watson <cjwatson@debian.org>
Avoid translation fallout from lexgrog(1) fix
* man/man1/lexgrog.man1: Protect `.ds mC CW` with `.if !'po4a'hide'`, to
avoid "CW" showing up as a string for translation.
2023-07-19 G. Branden Robinson <g.branden.robinson@gmail.com>
Improve lexgrog(1) portability
This fixes a test failure in man1/lexgrog.1 when building against groff
1.23.0.
Borrow code from groff 1.23.0's "an-ext.tmac" file (licensed as
permissively as a decadent society) to implement `EX` and `EE` extension
macros from Ninth Edition Research Unix (1986) (and groff) to get
monospaced code displays in a more portable way. There is no way to
portably change font families in pure man(7) itself, and the names of
troff typefaces aren't very portable either. There is also no portable
way to test for the _existence_ of a font. FTW.
("Portable" here largely means "to AT&T device-independent troff
implementations", for which there has been no official source since the
mid-1990s.[1] Several AT&T Unix System V licensees/descendants have
continued to ship their own vendored versions, but these have enjoyed
little or no development for the past 3 decades.)
* Define a string `mC` to store the name of a presumed monospaced roman
typeface. Use "CW", which is portable to AT&T device-independent
troff of the early 1980s before it occurred to anyone that Courier
might someday be available in italic and bold styles (and budget
available to purchase them).
* Define `mC` as "CR" if using a typesetting device and the formatter is
groff, or claims groff compatibility by the setting the `.g` register.
This is reasonably portable to modern implementations given
traditional troff font naming practices and the pervasive influence of
Adobe Software and the "base fonts" of its PostScript and PDF
specifications.
* If not typesetting (i.e., if using nroff), define `mC` as "R", which
is certain to be available.
* Define `EX` and `EE` macros as groff does, if the formatter does not
set the `.g` register.
* Migrate from `ft CW` and `nf` requests to `EX` macro calls.
* Migrate from `ft P` and `fi` requests to `EE` macro calls.
* Replace an inline use of `\f(CW` with a change to inline bold. There
is to date no portable way to inline a font family change.
Test passes now. Tested as-is and with the `EX` and `EE` macro
definitions forcibly enabled.
[1] https://groups.google.com/g/comp.text/c/COkqrii4W0E/m/7HarA8Ha2dAJ
2023-07-08 Colin Watson <cjwatson@debian.org>
Correct typography of "~/.manpath"
`~` should be written as `\(ti` in manual pages to avoid being rendered
as something along the lines of U+02DC SMALL TILDE in PDF output, or as
of groff 1.23.0 in UTF-8 output.
* man/man1/apropos.man1, man/man1/man.man1, man/man1/manpath.man1,
man/man1/whatis.man1, man/man8/catman.man8, man/man8/mandb.man8,
man/it/man1/apropos.man1, man/it/man1/man.man1: Write `\(ti` when shell
tilde expansion is intended.
2023-07-03 Colin Watson <cjwatson@debian.org>
systemd: Sort hardening options
* init/systemd/man-db.service.in: Sort hardening options.
2023-05-21 Мирослав Николић <miroslavnikolic@rocketmail.com>
Update Serbian manual page translation
* man/po4a/po/sr.po: Update from Translation Project.
2023-04-14 Temuri Doghonadze <temuri.doghonadze@gmail.com>
Add Georgian translation
* po/ka.po: New from Translation Project.
* po/LINGUAS: Add ka.
* man/THANKS: Add translator credit.
2023-04-09 Colin Watson <cjwatson@debian.org>
mandb: Warn if not running as cache owner
Fixes https://gitlab.com/man-db/man-db/-/issues/17.
* src/mandb.c (main): If effective user ID doesn't match the configured
cache owner (if any), and the `--quiet` option wasn't used, then issue a
warning.
* NEWS.md: Document this.
2023-04-09 Colin Watson <cjwatson@debian.org>
Deduplicate search results from "man -K"
Reported by Alejandro Colomar.
* src/man.c (do_global_apropos_section): Skip entries whose ultimate
source path have already been seen.
(do_global_apropos): Create/free set used to track seen entries.
* NEWS.md: Document this.
2023-03-29 Colin Watson <cjwatson@debian.org>
README.md: Explain where INSTALL.autoconf comes from
Fixes https://gitlab.com/man-db/man-db/-/issues/16.
* README.md: Explain that you may need to run `./bootstrap` to create
`docs/INSTALL.autoconf`.
2023-03-10 Colin Watson <cjwatson@debian.org>
sandbox: Work around Firebuild
Fixes https://gitlab.com/man-db/man-db/-/issues/15.
* lib/sandbox.c (make_seccomp_filter): Allow some socket-related system
calls if libfirebuild.so is preloaded.
* NEWS.md: Document this.
2023-03-02 Colin Watson <cjwatson@debian.org>
Upgrade to Gnulib stable-202301 as of 20230209
* bootstrap.conf (GNULIB_REVISION): Set to
c5dc86ca5c2e5c16177508bc32afe755b7995685.
2023-02-23 Colin Watson <cjwatson@debian.org>
Fix several spelling errors
Found by codespell, although I haven't added it to our pre-commit hooks
since it gets confused by rather too many bits of syntax here.
* docs/manpages.example, lib/cleanup.c, lib/decompression.c,
lib/filenames.c (filename_info), src/ult_src.c (test_for_include): Fix
spelling errors.
2023-01-14 Colin Watson <cjwatson@debian.org>
Copy files during bootstrapping
* .gitlab-ci.yml (bootstrap): Run `./bootstrap` with `--copy`.
2023-01-14 Colin Watson <cjwatson@debian.org>
Fix bootstrap_epilogue to handle running without --copy
* bootstrap.conf (bootstrap_epilogue): Avoid leaving
`docs/INSTALL.autoconf` as a dangling symbolic link if the `--copy`
option is not used.
2023-01-14 Colin Watson <cjwatson@debian.org>
Ensure that .gitignore and po/LINGUAS remain sorted
* .pre-commit-config.yaml (pre-commit-hooks): Add `file-contents-sorter`
for `.gitignore` and `po/LINGUAS`.
* .gitignore: Sort.
2023-01-14 Colin Watson <cjwatson@debian.org>
Update pre-commit hooks
* .pre-commit-config.yaml (pre-commit-hooks): Update to v4.4.0.
(shellcheck-py): Update to v0.9.0.2.
2023-01-14 Colin Watson <cjwatson@debian.org>
Upgrade to Gnulib stable-202301
* bootstrap: Sync to Gnulib 32a72f45374c9a36afa574d1a08bb98090270012.
* bootstrap.conf (GNULIB_REVISION): Set to
32a72f45374c9a36afa574d1a08bb98090270012.
* NEWS.md: Document this.
2023-01-14 Colin Watson <cjwatson@debian.org>
Update syscall lists from systemd fc2a0bc05e
* lib/sandbox.c (make_seccomp_filter): Add `cacheflush`,
`clock_getres_time64`, `clock_nanosleep_time64`, `close_range`,
`clone3`, `epoll_pwait2`, `faccessat2`, `futex_time64`, `pidfd_open`,
`pidfd_send_signal`, `ppoll_time64`, `pselect6_time64`,
`riscv_flush_icache`, `rt_sigtimedwait_time64`, and `utimensat_time64`.
Reorganize positions of some other syscalls according to their positions
in systemd's sets.
* NEWS.md: Document this.
2023-01-08 Colin Watson <cjwatson@debian.org>
Release man-db 2.11.2
2023-01-01 Colin Watson <cjwatson@debian.org>
mandb: Check for stray cats even if the manpath is unchanged
* src/mandb.c (mandb): Require the database file to be open before
calling `straycats`, but don't require `create_db` or
`update_db_wrapper` to have made any changes to it.
* src/tests/mandb-whatis-broken-link-changes: Update expected output.
* NEWS.md: Document this.
2023-01-01 Colin Watson <cjwatson@debian.org>
mandb: Fix crash when processing stray cats
Regression introduced in man-db 2.11.0. Fixes Debian bug #1027487.
* src/straycats.c (check_for_stray): Pass a basic trace list to
`store_descriptions`, since that's required as of commit
d3e4b5522ae8152f10db0bb98e6873c9cc17ed59.
* NEWS.md: Document this.
2022-12-31 Colin Watson <cjwatson@debian.org>
Pacify gcc -Wanalyzer-use-of-uninitialized-value
It incorrectly thought that `outleft` could be uninitialized in some
cases. Restructure code slightly to simplify its analysis.
* src/manconv.c (try_iconv): Initialize `outptr` in all branches of the
conditional beginning with `if (handle_iconv_errors)`.
2022-12-31 Colin Watson <cjwatson@debian.org>
Fix segfault when nroff is not installed
* src/man.c (try_section): Only free the `names` list if it is non-NULL
due to `NROFF_MISSING` being defined, and return early if options are
set such that cat files cannot be used either.
* NEWS.md: Document this.
2022-12-31 Colin Watson <cjwatson@debian.org>
Fix compile and test failures when troff is not groff
Fixes https://gitlab.com/man-db/man-db/-/issues/12.
* src/man.c (ONLY_TROFF_IS_GROFF): Only define if `HAS_TROFF` is
defined.
(init_html_pager): Only define if `TROFF_IS_GROFF` is defined.
(format_display): Mark `man_file` as unused if `TROFF_IS_GROFF` is not
defined.
* configure.ac: Substitute `troff_is_groff`.
* src/tests/Makefile.am (TESTS_ENVIRONMENT): Export `troff_is_groff`.
* src/tests/man-language-specific-requests: Adjust expected
language-specific requests if `troff_is_groff` is not `yes`.
* NEWS.md: Document this.
2022-11-29 Seong-ho Cho <darkcircle.0426@gmail.com>
Update Korean manual page translation
* man/po4a/po/ko.po: Update from Translation Project.
2022-11-28 Yuri Kozlov <yuray@komyakino.ru>
Update Russian manual page translation
* man/po4a/po/ru.po: Update from Translation Project.
2022-11-15 Colin Watson <cjwatson@debian.org>
Release man-db 2.11.1
2022-11-15 Colin Watson <cjwatson@debian.org>
Tweak README for better readability
* README.md: Add blank line for improved Markdown rendering.
2022-11-14 Colin Watson <cjwatson@debian.org>
web: Fix man.png width/height
* web/index.html: Update width and height for man.png.
2022-11-14 Colin Watson <cjwatson@debian.org>
web: Update man(1) image
* web/man.png: Replace with a fresh screenshot.
2022-11-14 Colin Watson <cjwatson@debian.org>
Link to project home page
* README.md: Add home page link (https://man-db.gitlab.io/man-db/).
2022-11-14 Colin Watson <cjwatson@debian.org>
Add GitLab Pages site
* .gitlab-ci.yml (stages): Add deploy.
(pages): New job.
* web/development.html, web/index.html, web/man.png, web/standard.css,
web/white.css: New files.
2022-11-14 Colin Watson <cjwatson@debian.org>
Transfer Git repository to new group
* README.md, docs/HACKING.md, man/man1/apropos.man1,
man/man1/lexgrog.man1, man/man1/man-recode.man1, man/man1/man.man1,
man/man1/manconv.man1, man/man1/manpath.man1, man/man1/whatis.man1,
man/man1/zsoelim.man1, man/man5/manpath.man5, man/man8/accessdb.man8,
man/man8/catman.man8, man/man8/mandb.man8: Change GitLab URL to
https://gitlab.com/man-db/man-db.
* NEWS.md: Document this.
2022-11-12 Colin Watson <cjwatson@debian.org>
Remove unused include
* src/manconv_client.c: Remove unused `#include "idpriv.h"`.
2022-11-05 Colin Watson <cjwatson@debian.org>
Fix distribution of Korean manual page translation
Accidentally omitted from 8f12d39bbb6748a1257358269028ef919f9c92e6.
* man/Makefile.am (DIST_SUBDIRS): Add ko.
2022-11-05 Colin Watson <cjwatson@debian.org>
Replace $ in page names rather than trying to escape it
Jakub Wilk points out in Debian bug #1021951 that attempting to use the
`--use-backslash` option has a number of complications. Just replace
dollar signs with question marks instead.
* include/manconfig.h (LESS_OPTS): Revert addition of `--use-backslash`.
* src/man.c: Replace `$` characters with `?` rather than trying to
escape them.
* NEWS.md: Document this.
2022-11-05 Colin Watson <cjwatson@debian.org>
Add Korean manual page translation
* man/po4a/po/ko.po: New from Translation Project (thanks, Seong-ho
Cho).
* configure.ac (AC_CONFIG_FILES): Add man/ko/Makefile.
* man/LINGUAS.po4a: Add ko.
* man/Makefile.am (DIST_SUBDIRS): Add ko.
* man/ko/Makefile.am, man/ko/translator.add: New files.
* man/po4a/Makefile.am (POFILES): Add po/ko.po.
* man/po4a/po4a.cfg (po4a_langs): Add ko.
* man/THANKS: Update translator credit.
* .gitignore: Add man/ko/man1, man/ko/man5, and man/ko/man8.
2022-10-28 Seong-ho Cho <darkcircle.0426@gmail.com>
Add Korean translation
* po/ko.po: New from Translation Project.
* po/LINGUAS: Add ko.
* man/THANKS: Add translator credit.
2022-10-28 Sebastian Rasmussen <sebras@gmail.com>
Update Swedish manual page translation
* man/po4a/po/sv.po: Update from Translation Project.
2022-10-18 Colin Watson <cjwatson@debian.org>
zsoelim_open_file: Fix use of uninitialized value
In the case where `filename` has no directory part and does not contain
a dot, we could reach the decision of whether to emit a "can't open %s"
error message without initializing `decomp`. Noticed by `gcc -Og`.
* src/zsoelim.l (zsoelim_open_file): Initialize `decomp` to NULL.
2022-10-18 Colin Watson <cjwatson@debian.org>
Recognize more Hungarian translations of the NAME section
* src/lexgrog.l (hu_name): Handle the case where "É" or "é" is written
as "\('E" or "\('e".
* NEWS.md: Document this.
2022-10-18 Colin Watson <cjwatson@debian.org>
Sort whatis references below real pages more aggressively
I think this makes more sense in most cases, and it definitely fixes
some observed odd behaviour.
Fixes Debian bug #780235.
* src/man.c (compare_candidates): Compare IDs before comparing sections.
* NEWS.md: Document this.
2022-10-17 Colin Watson <cjwatson@debian.org>
Silence error for empty mandir with missing catdir
Fixes https://gitlab.com/cjwatson/man-db/-/issues/8.
* src/check_mandirs.c (ensure_db_open): Don't call `gripe_rwopen_failed`
before returning false (since it only makes sense for one of the two
callers).
(testmandirs): Call `gripe_rwopen_failed` if `ensure_db_open` returns
false.
2022-10-17 Colin Watson <cjwatson@debian.org>
Add 3type to default section list
This is used by the Linux man-pages package, and should be lower
priority than section 2. Suggested by Alejandro Colomar.
Fixes https://gitlab.com/cjwatson/man-db/-/issues/5.
* include/manconfig.h (STD_SECTIONS): Add `3type` between sections `2`
and `5`.
* m4/man-arg-sections.m4 (MAN_ARG_SECTIONS): Likewise.
* man/man5/manpath.man5 (FORMAT): Update documentation of SECTION.
* src/tests/man-exact-section-matches: Update default section order.
* src/man_db.conf.in (SECTION): Update documentation.
* NEWS.md: Document this.
2022-10-17 Colin Watson <cjwatson@debian.org>
Escape $ in page names when constructing less prompts
Fixes Debian bug #1021951.
* include/manconfig.h (LESS_OPTS): Add `--use-backslash`.
* src/man.c (escape_less): Also escape `$` characters.
* NEWS.md: Document this.
2022-10-15 Colin Watson <cjwatson@debian.org>
Release man-db 2.11.0
2022-10-13 Colin Watson <cjwatson@debian.org>
ult_src: Fix possible NULL dereference
`gcc -fanalyzer` noticed that `canonicalize_file_name` can return NULL,
therefore `find_include` could return NULL, and therefore it was
possible for `ult_src` to attempt to dereference NULL in the `stat
(base, &st)` call. Push more work down to `find_include` so that we can
consistently treat it as an error if it returns NULL.
* src/ult_src.c (ult_softlink): Move error messages to ...
(gripe_canonicalize_failed): ... here (new function).
(find_include): Replace simple suffix globbing with `comp_file`, and use
this approach in both the relative-to-mantree and
relative-to-dirname-of-page cases; we previously only tried it in the
latter case. Call `gripe_canonicalize_failed` if the final
canonicalization step fails; print a "can't resolve %s" error if we
can't even find anything to canonicalize.
(ult_src): Remove `comp_file` processing, now done by `find_include`.
* src/ult_src.h (gripe_canonicalize_failed): Add prototype.
* src/straycats.c (check_for_stray): Use `gripe_canonicalize_failed`.
2022-10-11 Colin Watson <cjwatson@debian.org>
Fix regression in preprocessor string handling
We need to stop looking for characters that identify preprocessors after
the first space or dash, as otherwise encoding declarations of the kind
specified in man-recode(1) may break.
* src/man.c (make_roff_command): Only consider the part of the
preprocessor string up to the first space or dash, if any.
2022-10-11 Colin Watson <cjwatson@debian.org>
match_in_directory: Split into multiple functions
`match_in_directory` had two almost entirely disjoint code paths, one
for regex patterns and one for wildcard patterns; but its structure made
it difficult for `gcc -fanalyzer` to understand that, and it was a bit
unclear for humans too. Split it up for clarity.
* src/globbing.c (match_in_directory): Split out the
regex/wildcard-handling parts to ...
(match_regex_in_directory, match_wildcard_in_directory): ... here,
respectively.
2022-10-11 Colin Watson <cjwatson@debian.org>
Assert that another xasprintf call returns non-NULL
As with commit a22f140354c80a7c5c52c4a413f1c929e105a24c, `gcc
-fanalyzer` notices that `xasprintf` can return NULL in some situations.
I believe those situations would all amount to programming errors here,
so add an assert.
* src/mandb.c (main): Assert that `xasprintf` returns non-NULL.
2022-10-09 Colin Watson <cjwatson@debian.org>
Fix error message
* src/straycats.c (check_for_stray): If canonicalizing `catdir` returns
NULL, then substitute `catdir` into the "warning: %s is a dangling
symlink" message, not `fullpath` (which at this point must be NULL).
2022-10-08 Colin Watson <cjwatson@debian.org>
Convert many more ints to bools
I don't expect this to make a significant runtime difference, but it
makes some things easier to analyse visually.
* lib/cleanup.c (do_cleanups_sigsafe): Change `in_sighandler` parameter
type to bool. Update all callers.
(push_cleanup): Change `handler_installed` local variable type to bool.
* lib/cleanup.h (do_cleanups_sigsafe): Update prototype.
* lib/compression.c (comp_info): Change `want_stem` parameter type to
bool. Update all callers.
* lib/compression.h (comp_info): Update prototype.
* lib/sandbox.c (seccomp_filter_unavailable): Change type to bool.
Update all references.
(make_seccomp_filter): Change `permissive` parameter type to bool.
Update all callers.
(_sandbox_load): Likewise.
* lib/util.c (remove_directory): Change `recurse` parameter type to
bool. Update all callers.
* lib/util.h (remove_directory): Update prototype.
* libdb/db_gdbm.c (opening): Change type to bool. Update all
references.
* libdb/db_store.c (compare_ids): Change `promote_links` parameter type
to bool. Update all callers.
* libdb/db_storage.h (compare_ids): Update prototype.
* src/catman.c (parse_for_sec): Change `message` local variable type to
bool.
(check_access): Change return type to bool.
(purge_whatis): Change `cat` parameter type to bool. Update all
callers.
(check_multi_key): Change return type to bool.
* src/descriptions.c (parse_descriptions): Change `seen_base` local
variable type to bool.
* src/globbing.c (look_for_file): Change `cat` parameter type to bool.
Update all callers.
* src/globbing.h (look_for_file): Update prototype.
* src/lexgrog.l (fill_mode, waiting_for_quote): Change types to bool.
Update all references.
* src/man.c (skip, created_tmp_cat): Change types to bool. Update all
references.
(run_mandb): Change `create` parameter type to bool. Update all
callers.
(squeeze_blank_lines): Change `in_blank_line` and `got_blank_line` local
variable types to bool.
(display): Change `format` and `printed` local variable types to bool.
(convert_name): Change `fsstnd` parameter type to bool. Update all
callers.
(add_candidate): Change `dupcand` local variable type to bool.
(main): Change `maybe_section` local variable type to bool.
* src/manp.c (add_sections): Change `user` parameter type to bool.
Update all callers.
(add_def): Likewise.
(add_mandb_map): Likewise.
(add_to_dirlist): Likewise.
(read_config_file): Change `done` local variable type to bool.
(get_manpath_from_path): Change `mandatory` parameter type to bool.
Update all callers.
* src/manp.h (get_manpath_from_path): Update prototype.
* src/whatis.c (do_apropos): Change `matched` local variable type to
bool.
* src/zsoelim.l (no_newline): Change type to bool. Update all
references.
(zsoelim_open_file): Change return type to true.
* src/zsoelim.h (zsoelim_open_file): Update prototype.
2022-10-07 Colin Watson <cjwatson@debian.org>
Remove unused variable
* src/man.c (found_a_stray): Remove; it was set but no longer used.
(display_database): Remove setting of `found_a_stray`.
2022-10-07 Colin Watson <cjwatson@debian.org>
Add some more pure function attributes
* lib/encodings.c (compatible_encodings): Mark as pure.
* src/man.c (is_section): Likewise.
* src/manp.c (get_config, get_def, get_def_user, is_global_mandir):
Likewise.
2022-10-07 Colin Watson <cjwatson@debian.org>
Default to --disable-cache-owner on systems without getuid
* m4/man-arg-cache-owner.m4 (MAN_ARG_CACHE_OWNER): If the system doesn't
have `getuid`, force cache files to have unconstrained cache ownership,
and issue a warning if `--enable-cache-owner` was given.
2022-10-07 Colin Watson <cjwatson@debian.org>
Fix installation on systems with non-empty EXEEXT
* src/Makefile.am (install-exec-hook): Add `$(EXEEXT)` to
`chown`/`chmod` calls.
* NEWS.md: Document MinGW portability work.
2022-10-07 Colin Watson <cjwatson@debian.org>
Fix build on systems without SIGPIPE
* bootstrap.conf (gnulib_modules): Add sigpipe.
* src/mandb.c (main): Drop `#ifdef SIGPIPE` guards, as Gnulib now
ensures that it's defined.
2022-10-07 Colin Watson <cjwatson@debian.org>
Fix build on systems without getuid
* lib/tempfile.c (running_setid): New function; always returns false if
the system doesn't have `getuid`, since in that case we won't have been
able to drop privileges either.
2022-10-07 Colin Watson <cjwatson@debian.org>
Fix build on systems without <pwd.h>
* lib/security.h: Only include `<pwd.h>` if `MAN_OWNER` is defined.
2022-10-07 Colin Watson <cjwatson@debian.org>
Fix build on systems without <termios.h>
* bootstrap.conf (gnulib_modules): Add termios.
* src/man.c (get_term): Replace with a no-op stub if the system has no
`<termios.h>` (Gnulib tests for it and can replace some functions, but
its replacement isn't sufficient here).
2022-10-07 Colin Watson <cjwatson@debian.org>
Fix build on systems without SIGHUP
* lib/cleanup.c (trap_abnormal_exits, untrap_abnormal_exits): Guard uses
of `SIGHUP` with an `#ifdef`.
2022-10-06 Colin Watson <cjwatson@debian.org>
Run preprocessors in the correct order
We have no particular reason to trust the order of filters in a
preprocessor string specified in a page; it's easy for authors to get
this wrong by accident. Do as groff(1) does and run them in a
canonicalized order.
Fixes Debian bug #1012078.
* src/man.c (add_filter): New function, split out from
`make_roff_command`.
(make_roff_command): Iterate through possible preprocessors and add each
one depending on whether it's present in the preprocessor string, rather
than iterating through the preprocessor string and acting on each of its
characters. Turn several `int` variables into `bool` variables in
passing.
* NEWS.md: Document this.
2022-10-06 Emir SARI <emir_sari@icloud.com>
Update Turkish translation
* po/tr.po: Update from Translation Project.
2022-10-06 Emir SARI <emir_sari@icloud.com>
Update Turkish manual page translation
* man/po4a/po/tr.po: Update from Translation Project.
2022-10-06 Boyuan Yang <073plan@gmail.com>
Update Simplified Chinese manual page translation
* man/po4a/po/zh_CN.po: Update from Translation Project.
2022-10-06 Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
Update Romanian manual page translation
* man/po4a/po/ro.po: Update from Translation Project.
2022-10-06 Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
Update Romanian translation
* po/ro.po: Update from Translation Project.
2022-10-03 Mario Blättermann <mario.blaettermann@gmail.com>
Update German manual page translation
* man/po4a/po/de.po: Update from Translation Project.
2022-10-02 Colin Watson <cjwatson@debian.org>
Release man-db 2.11.0-pre1
2022-10-02 Colin Watson <cjwatson@debian.org>
Bump next version to 2.11.0
There are quite a few substantial changes here that I think justify an
updated minor number.
* NEWS.md: Bump to 2.11.0.
2022-10-02 Colin Watson <cjwatson@debian.org>
Update translation files
* po/man-db.pot, po/*.po: Update.
2022-10-02 Colin Watson <cjwatson@debian.org>
Fix harmless but incorrect cast
* libdb/db_xdbm.c (man_xdbm_firstkey): Cast `gl_list_free` to
`gl_mapvalue_dispose_fn`, not `gl_listelement_dispose_fn`. (These were
in practice identical but are semantically distinct.)
2022-10-02 Colin Watson <cjwatson@debian.org>
Reformat option declarations using macros
The previous tabular presentation had some advantages, but it only
looked reasonable in wide terminals, was often quite cumbersome to
maintain, and played poorly with `clang-format`.
* include/manconfig.h (OPT, OPT_FULL, OPT_ALIAS, OPT_HIDDEN,
OPT_GROUP_HEADER, OPT_HELP_COMPAT): New macros.
* src/accessdb.c (options): Rewrite using `OPT*` macros.
* src/catman.c (options): Likewise.
* src/globbing_test.c (options): Likewise.
* src/lexgrog_test.c (options): Likewise.
* src/man-recode.c (options): Likewise.
* src/man.c (options): Likewise.
* src/manconv_main.c (options): Likewise.
* src/mandb.c (options): Likewise.
* src/manpath.c (options): Likewise.
* src/whatis.c (options): Likewise.
* src/zsoelim_main.c (options): Likewise.
2022-10-02 Colin Watson <cjwatson@debian.org>
Add CI checks for Berkeley DB and NDBM
* .gitlab-ci.yml (build-berkeley-db, build-ndbm): New jobs.
2022-10-02 Colin Watson <cjwatson@debian.org>
mandb: Fully reorganize databases
This allows us to produce bitwise-identical databases regardless of the
order in which pages were scanned (at least with GDBM).
`gdbm_reorganize` isn't enough for this, probably because entries end up
in different positions in hash buckets depending on insertion order; but
reading in the entire database and writing it back out in sorted order
seems to do the job with negligible cost.
Fixes Debian bug #1010957.
* src/mandb.c (reorganize): New function: read all the items from a
database in sorted order and write them back out.
(mandb): Stop calling `MYDBM_REORG`, which saved space after deletions
but didn't help with reproducibility.
(process_manpath): Call `reorganize` if any changes were made to a
database.
* libdb/mydbm.h (MYDBM_REORG): Remove macro.
* NEWS.md: Document this.
2022-10-02 Colin Watson <cjwatson@debian.org>
mandb: Rearrange database path operations
Moving these into "methods" of `struct dbpaths` makes the control flow
clearer by avoiding lots of inlined `#ifdef`s.
I fixed a possible crash in `mandb -f` in the process, exposed by the
clearer control flow.
* src/mandb.c (dbpaths_init, dbpaths_copy_to_tmp, dbpaths_remove_tmp):
New functions.
(finish_up): Rename to ...
(dbpaths_rename_from_tmp): ... this.
(do_chown): Rename to ...
(dbpaths_chown_if_possible): ... this.
(cleanup_sigsafe): Rename to ...
(dbpaths_unlink_tmp): ... this, and take a `struct dbpaths *` argument
rather than `void *`.
(cleanup): Rename to ...
(dbpaths_free_elements): ... this, and take a `struct dbpaths *`
argument rather than `void *`.
(mandb, process_manpath): Use new `dbpaths_*` functions. Only call
`dbpaths_rename_from_tmp` if `run_mandb` is set (in practice this was
always true anyway but this makes it clearer). Only call
`dbpaths_chown_if_possible` if `run_mandb` is set and
`dbpaths_rename_from_tmp` was called (this may have caused a crash in
some edge cases involving `mandb -f`).
2022-10-01 Colin Watson <cjwatson@debian.org>
test_manfile: Remove "already exists" check
This produced inconsistent results in some unusual cases. For example,
if `/usr/share/man/man5/inetd.conf.5.gz` was a symlink to
`/usr/share/man/man8/inetd.8.gz` and had `NAME` entries for both `inetd`
and `inetd.conf`, then if `inetd.8.gz` was scanned first we would
include a `WHATIS_MAN` entry in section 8 for `inetd.conf`, while if
`inetd.conf.5.gz` was scanned first we'd skip that due to hitting the
already-exists check when scanning `inetd.8.gz`.
This was originally a performance optimization. Now that we cache the
results of `ult_src` and `find_name`, this optimization no longer helps
us much, so it can go.
* src/check_mandirs.c (test_manfile): Don't return early if the page
already exists with matching details.
* NEWS.md: Document this.
2022-10-01 Colin Watson <cjwatson@debian.org>
Further improve name selection for whatis targets
In commit 9aff3c30b0, I used the rule "first name in the trace out of
those that have the best ID". However, a better rule turns out to be to
pick the last entry in the trace that has the same section and extension
as the starting page. This is already guaranteed to have at least as
good an ID as the starting page, and since whatis pointers don't include
the target section and extension we need to ensure that they don't cross
sections/extensions; otherwise we just end up with database entries that
man(1) refuses to use, which isn't particularly useful.
* src/descriptions_store.c (store_descriptions): Parse and cache all the
filenames in the trace at the start. Use the last entry in the trace
with the same section/extension as the starting page as the pointer for
`WHATIS_*` entries.
2022-10-01 Colin Watson <cjwatson@debian.org>
test_manfile: Stop caching ult_src traces
Now that `test_manfile` always calls `ult_src` before adding database
entries, there's no need for it to cache the resulting traces, and doing
so had some confusing consequences since `store_descriptions` could end
up seeing cached traces that didn't include the initial path.
* src/check_mandirs.c (struct whatis): Remove `trace` element.
(whatis_free): Stop freeing `whatis->trace`.
(test_manfile): Stop caching `ult->trace`; pass it directly to
`store_descriptions` instead.
2022-10-01 Colin Watson <cjwatson@debian.org>
Restructure ult_src to add caching
* src/ult_src.c (struct ult_key): New structure.
(ult_key_new, ult_key_equals, ult_key_hash, ult_key_free, ult_value_new,
ult_value_free): New functions.
(ult_cache): New map.
(ult_src): Instead of returning a path as a string and taking `trace` as
an output parameter, return a `struct ult_value *` containing both path
and trace. Cache the return value in a hash map (indexed by a composite
key consisting of `name` and `flags`), and return cached values where
possible rather than repeating the same work. Update all callers to
reflect the new signature.
* src/ult_src.h (struct ult_value): New structure.
(ult_src): Update prototype.
* src/check_mandirs.c (test_manfile): Simplify `ult_src` calling
arrangements now that repeated calls with the same `name` and `flags`
arguments are cheap. At the moment this may end up doing a little more
work in some rare cases (links to already-scanned pages with `.so`
links), but that doesn't seem to be very significant at the moment, and
caching could be improved inside `ult_src` if it proves to be a problem.
* src/descriptions_store.c (store_descriptions): `trace` is now always
set. Add an assertion of this and drop a couple of conditionals.
2022-09-25 Colin Watson <cjwatson@debian.org>
ult_src: Remove recursion
The use of recursion for `.so` handling in `ult_src` is somewhat
inconvenient, and it's relatively easy to convert it to an iterative
implementation.
There should be no functional change from this commit, except to some
details of debug messages.
* src/ult_src.c (find_include_directive): New function, extracted from
`ult_src`.
(ult_src): Handle `.so` links using a loop rather than recursion. Check
for compression extensions towards the end of the loop rather than at
the beginning, to avoid nonexistent files showing up in the trace.
2022-09-25 Colin Watson <cjwatson@debian.org>
mandb: Improve debugging
* src/check_mandirs.c (test_manfile): Log the file under consideration
on entry. Log when we return early due to an existing database entry.
Remove some unnecessary parentheses from debug messages.
* src/ult_src.c (ult_src): Remove leading newline from debug message.
2022-09-25 Colin Watson <cjwatson@debian.org>
Don't skip adding a database entry due to SO_MAN
An existing `SO_MAN` entry shouldn't stop us considering a page for
insertion into the database, because until we run `ult_src` we don't yet
know whether that page will be `ULT_MAN` (which should replace the
existing entry) or `SO_MAN` (which shouldn't).
* src/check_mandirs.c (test_manfile): Don't return early due to an
existing matching `SO_MAN` entry, but only due to an `ULT_MAN` entry.
* NEWS.md: Document this.
2022-09-24 Colin Watson <cjwatson@debian.org>
Fix section/extension for whatis entries in database
* src/descriptions_store.c (store_descriptions): Use the
section/extension of the best name for whatis entries, since we don't
have anything better.
2022-09-24 Colin Watson <cjwatson@debian.org>
store_descriptions: Improve debugging
* src/descriptions_store.c (store_descriptions): Log the extension of
each entry being stored.
2022-09-24 Colin Watson <cjwatson@debian.org>
Extend database entry replacement rules
These rules were previously ambiguous such that the targets of whatis
entries depended on the order in which files were scanned.
* libdb/db_store.c (enum replace_action): Add.
(replace_if_necessary): Extend rules for greater stability. We now also
take mtimes and pointers into account, as well as including a case for
when the new ID is weaker than the old one (there was already a case for
when it was stronger).
(dbstore): Use `replace_if_necessary` when considering replacing multi
keys.
2022-09-24 Colin Watson <cjwatson@debian.org>
Fix section/extension for links in database
In some cases this resulted in spurious database entries. For example,
if `man5/inetd.conf.5` was a symlink to `man8/inetd.8` and that page had
a `NAME` entry for `inetd`, then as well as entries for `inetd` in
section 8 and `inetd.conf` in section 5, we would also store a spurious
entry for `inetd` in section 5. We no longer do that.
* src/descriptions_store.c (store_descriptions): For names corresponding
to entries in the ultimate source trace and not to the base name of the
file, use the section and extension of the trace entry rather than of
the ultimate source.
2022-09-24 Colin Watson <cjwatson@debian.org>
Pick a more consistent name for whatis targets
We don't want the targets of whatis entries in the database to depend on
the order in which files were scanned. Prefer the first name in the
trace out of those that have the best ID.
* src/descriptions_store.c (store_descriptions): Defer adding names that
don't appear in the ultimate source trace (i.e. whatis entries) until we
know the best name to use as the target, and use that best name as the
pointer for each of them.
2022-09-24 Colin Watson <cjwatson@debian.org>
Fix stored ID for links
Database entries for links were often incorrectly stored as `ULT_MAN`,
depending on the exact order in which pages were scanned. They are now
stored more consistently as `SO_MAN`.
* src/descriptions_store.c (store_descriptions): Override the ID from
`ULT_MAN` to `SO_MAN` if the name is not the last entry in the trace.
(Previously we overrode from `SO_MAN` to `ULT_MAN` if the name was the
last entry in the trace, but not the converse.)
* NEWS.md: Document this.
2022-09-24 Colin Watson <cjwatson@debian.org>
Simplify struct mandata memory allocation
The arrangement where most of the fields of `struct mandata` were
constant pointers into the `addr` field was a bit more memory-efficient,
but it made some kinds of analysis and reorganization very difficult,
and we don't actually need to be quite that frugal about memory.
Reorganize this to allocate each field independently instead.
* lib/filenames.c (filename_info): Allocate each field independently.
Use Gnulib's `base_name` and `dir_name` functions to parse paths. Stop
setting `info->addr`.
(free_mandata_struct): Free the `ext`, `sec`, `pointer`, `comp`,
`filter`, and `whatis` fields. Stop freeing `addr`.
* lib/filenames.h (struct mandata): Remove `addr`. Make `ext`, `sec`,
`pointer`, `comp`, `filter`, and `whatis` non-`const`.
* libdb/db_lookup.c (split_content): Copy the `ext`, `sec`, `pointer`,
`filter`, `comp`, and `whatis` fields. Stop setting `addr`.
* libdb/db_store.c (make_content): Copy the `pointer`, `comp`, `filter`,
and `whatis` fields.
* src/descriptions_store.c (store_descriptions): Copy `pointer` and
`whatis` fields.
* src/straycats.c (check_for_stray): Copy `comp`, `ext`, `sec`, and
`filter` fields.
* libdb/db_lookup.c (dblookup): Always free `cont`'s data pointer, since
it's no longer sometimes borrowed.
* libdb/db_store.c (dbstore): Free `cont`'s and `oldcont`'s data
pointers, since they're no longer borrowed.
* src/check_mandirs.c (purge_missing): Free `content`'s data pointer,
since it's no longer borrowed.
* libdb/db_lookup.c (dblookup_pattern): Stop freeing `info->addr`.
* src/catman.c (parse_for_sec): Stop freeing `entry->addr`.
* src/whatis.c (do_apropos): Stop freeing `info->addr`.
2022-09-24 Colin Watson <cjwatson@debian.org>
Stop using the addr field of struct mandata
The `addr` field of `struct mandata` is just intended as an internal
buffer, but some functions were extracting information from it in
complicated ways, which made it difficult to refactor the memory
allocation here. Use different approaches.
* src/check_mandirs (test_manfile): Calculate `len` using `comp_info`.
This duplicates some of what `filename_info` does, but it's just some
cheap string manipulation, and it expresses what we want in a less
confusing way (the length of the file name with any compression
extension removed).
* src/descriptions_store.c (store_descriptions): Check whether `path` is
a prefix of `trace_name` rather than of `trace_info->addr`.
`trace_info->addr` is always itself a prefix of `trace_name`, so if
`path` is not a prefix of `trace_name` then it can't be a prefix of
`trace_info->addr`.
2022-09-24 Colin Watson <cjwatson@debian.org>
is_prefix: Improve parameter naming
The second parameter doesn't have to be a directory, so stop implying
that in the parameter name.
* src/descriptions_store.c (is_prefix): Rename `path` to `parent`; rename
`dir` to `child`.
2022-09-24 Colin Watson <cjwatson@debian.org>
Simplify split_content interface
Now that `struct mandata` is always allocated on the heap, we might as
well just have `split_content` return a freshly-allocated `struct
mandata` rather than taking a pointer to one as a parameter.
* libdb/db_lookup.c (split_content): Allocate and return a `struct
mandata`; remove `pinfo` parameter. Update all callers.
* libdb/db_storage.h (split_content): Update prototype.
2022-09-24 Colin Watson <cjwatson@debian.org>
Always allocate struct mandata on the heap
This means we no longer need two slightly different functions for
freeing it.
* libdb/db_lookup.c (dblookup_pattern): Allocate `struct mandata` on the
heap. Simplify arrangements for adding to the `infos` list.
(dbstore): Allocate `struct mandata` on the heap.
* src/catman.c (parse_for_sec): Likewise.
* src/check_mandirs.c (purge_pointers, purge_missing): Likewise.
* src/straycats.c (check_for_stray): Likewise.
* src/whatis.c (do_apropos): Likewise.
* lib/filenames.c (free_mandata_elements): Remove function and move its
contents to ...
(free_mandata_struct): ... here, if `pinfo` is set.
* lib/filenames.h (free_mandata_elements): Remove prototype.
2022-09-24 Colin Watson <cjwatson@debian.org>
filename_info: Always allocate info->name
Only one call site has any interest in this being unset (in order to
pass the result to `dbstore`), and even there it's easier for the caller
to deal with unsetting it. Otherwise, it's strictly more convenient if
the structure returned by `filename_info` always includes the name of
the page.
* lib/filenames.c (filename_info): Remove `req_name` parameter; update
all callers. Always set `info->name` before returning successfully.
* lib/filenames.h (filename_info): Update prototype.
* src/check_mandirs.c (test_manfile): Use `info->name` for
`manpage_base` rather than poking around in `info->addr`.
(count_glob_matches): Remove `name` parameter; update all callers.
* src/descriptions_store.c (store_descriptions): Drop now-unnecessary
check for `trace_info->name`.
* src/man.c (do_global_apropos_section): Build `title` using
`info->name` rather than poking around in `info->addr`.
* src/mandb.c (update_one_file): Drop now-unnecessary check for
`info->name`.
2022-09-23 Colin Watson <cjwatson@debian.org>
Reduce indentation in store_descriptions a bit
* src/descriptions_store.c (store_descriptions): Use an early-continue
construction to save a level of indentation.
2022-09-23 Colin Watson <cjwatson@debian.org>
Simplify the filename_info interface
This interface is a bit less confusing.
* libdb/db_lookup.c (free_mandata_elements, free_mandata_struct): Move
to ...
* lib/filenames.c (free_mandata_elements, free_mandata_struct): ...
here.
* libdb/db_storage.h (free_mandata_elements, free_mandata_struct): Move
to ...
* lib/filenames.h (free_mandata_elements, free_mandata_struct): ...
here.
* lib/filenames.c (filename_info): Return a `struct mandata` with the
`addr` element set to the buffer containing the fields, rather than
returning the buffer and taking a pointer to a `struct mandata` as a
parameter. Update all callers.
* lib/filenames.h (filename_info): Update prototype.
2022-09-23 Colin Watson <cjwatson@debian.org>
Move manual page file name utilities to lib/
* src/filenames.c: Move to ...
* lib/filenames.c: ... here.
* src/filenames.h: Move to ...
* lib/filenames.h: ... here. Update positioning of all includes.
* lib/Makefile.am (libman_la_SOURCES): Add `filenames.c` and
`filenames.h`.
* src/Makefile.am (man_recode_LDADD): Link with `$(LIBMAN)` instead of
`$(LIBMANDB)`.
(lexgrog_SOURCES, man_SOURCES, mandb_SOURCES): Remove `filenames.c` and
`filenames.h`.
* po/POTFILES.in: Rename `src/filenames.c` to `lib/filenames.c`.
* lib/filenames.c (gripe_bogus_manpage): Remove `quiet < 2` condition.
(filename_info): Add `warn_if_bogus` parameter; only call
`gripe_bogus_manpage` if it is set. Update all callers.
* lib/filename.h (filename_info): Update prototype.
* libdb/db_storage.h (struct mandata): Move to ...
* lib/filenames.h (struct mandata): ... here. Add includes where
necessary.
2022-09-23 Colin Watson <cjwatson@debian.org>
Fix distcheck
* po/POTFILES.in: Rename `src/compression.c` to `lib/compression.c`.
2022-09-23 Colin Watson <cjwatson@debian.org>
Move compression file name utilities to lib/
This makes more sense as a home for plain file name manipulation
utilities. I also merged `include/comp_src.h.in` into
`lib/compression.c`, because structure definitions (as opposed to
declarations) don't belong in header files.
* src/compression.c: Move to ...
* lib/compression.c: ... here. Remove unnecessary `pipeline.h` include.
* src/compression.h: Move to ...
* lib/compression.h: ... here. Update positioning of all includes.
* lib/Makefile.am (libman_la_SOURCES): Add `compression.c` and
`compression.h`.
* lib/README: Add `compression.*`.
* src/Makefile.am (lexgrog_SOURCES, man_SOURCES, man_recode_SOURCES,
mandb_SOURCES): Remove `compression.c` and `compression.h`.
* include/comp_src.h (comp_list): Move to ...
* lib/compression.c (comp_list): ... here. Update all references.
* include/manconfig.h (struct compression, comp_list): Move to ...
* lib/compression.h (struct compression, comp_list): ... here. Add
includes where necessary.
* Makefile.am (noinst_HEADERS): Remove `include/comp_src.h`.
2022-09-23 Colin Watson <cjwatson@debian.org>
Remove infoalloc macro
It doesn't really pull its weight.
* libdb/db_lookup.c (dblookup, dblookup_pattern): Call `XZALLOC (struct
mandata)` rather than `infoalloc ()`.
* src/man.c (try_section, do_global_apropos_section): Likewise.
* libdb/db_storage.h (infoalloc): Remove.
2022-09-19 Colin Watson <cjwatson@debian.org>
Maintain multi key references in sorted order
This is a step towards being able to reproduce the same database given
the same manual page tree.
* bootstrap.conf (gnulib_modules): Add stpcpy.
* libdb/db_lookup.c (name_ext_equals): Remove static; add pure
attribute.
(name_ext_compare): New function.
(list_extensions): Add entries in sorted order.
* libdb/db_storage.h (name_ext_equals, name_ext_compare): Add
prototypes.
* libdb/db_store.c (make_extensions_reference): New function.
(dbstore): When building or updating multi key references, maintain them
in sorted order.
* NEWS.md: Document this.
2022-09-19 Colin Watson <cjwatson@debian.org>
Remove some excessive debugging output
This hasn't been of any practical use for many years.
* lib/security.c (drop_effective_privs, regain_effective_privs): Remove
debug messages emitted when increasing or decreasing the privilege drop
count.
2022-08-11 Colin Watson <cjwatson@debian.org>
Fix use of pointer (address only) after free
I don't believe this was technically undefined behaviour, since we
didn't actually dereference the dangling pointer, merely compared its
value (the pointer address itself) against entries in the cleanup stack.
However, the compiler probably had a hard time proving that, so the
use-after-free warning issued by recent versions of GCC seems fair
enough.
* src/mandb.c (cleanup): Don't free dbpaths.
(process_manpath): Free it here instead, after calling pop_cleanup.
2022-08-11 Colin Watson <cjwatson@debian.org>
Make CATWIDTH override MINCATWIDTH/MAXCATWIDTH
Otherwise setting `CATWIDTH` to something larger than 80 confusingly
doesn't work unless you also set `MAXCATWIDTH`.
Fixes https://gitlab.com/cjwatson/man-db/-/issues/9.
* src/man.c (add_roff_line_length): Skip terminal width range check if
`cat_width` is set.
* man/man5/manpath.man5 (FORMAT): Remove note that `CATWIDTH` should be
within the range set by `MINCATWIDTH` and `MAXCATWIDTH`, and instead say
that it overrides them.
* NEWS.md: Document this.
2022-07-22 Colin Watson <cjwatson@debian.org>
Add more case variants of localized versions of NAME
* src/lexgrog.l (bg_name, lt_name, ru_name, sr_name, srlatin_name,
tr_name, uk_name, vi_name): Add more case variants.
* NEWS.md: Document this.
2022-07-18 Colin Watson <cjwatson@debian.org>
Update pre-commit hooks
* .pre-commit-config.yaml (pre-commit-hooks): Update to v4.3.0.
2022-07-18 Colin Watson <cjwatson@debian.org>
Update to Gnulib 20220717
Fixes https://gitlab.com/cjwatson/man-db/-/issues/6.
* bootstrap: Sync to Gnulib df336dc1ae60d8ad9f452f2234951133fe617bb0.
* bootstrap.conf (GNULIB_REVISION): Set to
df336dc1ae60d8ad9f452f2234951133fe617bb0.
* NEWS.md: Document build fix.
2022-07-15 Colin Watson <cjwatson@chiark.greenend.org.uk>
Merge branch 'drop-lsm' into 'main'
Drop LSM file
See merge request cjwatson/man-db!4
2022-07-13 Pino Toscano <toscano.pino@tiscali.it>
Drop LSM file
The LSM format is a very old format for software, and it is dead for
many years already. Since keeping the .lsm up-to-date is basically not
much of use, simply drop it altogether.
* docs/Makefile.am (dist_noinst_DATA): Remove man-db.lsm.
* docs/HACKING.md: Stop mentioning man-db.lsm.
* docs/man-db.lsm: Remove file.
2022-07-05 Stéphane Aulery <lkppo@free.fr>
Update French manual page translation
* man/po4a/po/fr.po: Update from Translation Project.
2022-06-02 Joe Hansen <joedalton2@yahoo.dk>
Update Danish translation
* po/da.po: Update from Translation Project.
2022-05-18 Colin Watson <cjwatson@debian.org>
Cache filters alongside whatis information
`mandb` needs to cache filters together with whatis information, as
otherwise pages were incorrectly recorded with no filters if `mandb`
happened to use cached whatis information for them rather than reading
it from scratch.
* src/check_mandirs.c (struct whatis): Add filters.
(whatis_free): Free whatis->filters.
(test_manfile): Store and use whatis->filters.
* NEWS.md: Document this.
2022-04-27 Andika Triwidada <andika@gmail.com>
Update Indonesian translation
* po/id.po: Update from Translation Project.
* man/THANKS: Add translator credit.
2022-04-23 Colin Watson <cjwatson@debian.org>
Stop GitLab from getting confused about licences
GitLab uses https://github.com/licensee/licensee to detect the project's
licence, and if that finds multiple matching files then it throws up its
hands and refuses to make a licence assertion, with no apparent way to
override it.
To avoid this problem, move the secondary licence files (those that
apply only to some files, rather than to the project as a whole) back
into a subdirectory, so that `licensee` doesn't notice them.
* COPYING.GPLv2: Move to ...
* docs/COPYING.GPLv2: ... here. Update all references.
* COPYING.LIB: Move to ...
* docs/COPYING.LIB: ... here. Update all references.
* Makefile.am (dist_noinst_DATA): Remove COPYING.GPLv2.
* docs/Makefile.am (dist_noinst_DATA): Add COPYING.GPLv2 and
COPYING.LIB.
2022-04-23 Colin Watson <cjwatson@debian.org>
Clarify effective GPLv3 licensing
While man-db's own files are individually licensed under GPLv2 (or in a
few cases LGPLv2.1), the project as a whole is effectively GPLv3 due to
Gnulib. This was already explained in README.md, but make it a bit
clearer by having the top-level COPYING file be a copy of GPLv3.
* COPYING: Move to ...
* COPYING.GPLv2: ... here.
* COPYING: New file.
* Makefile.am (dist_noinst_DATA): Add COPYING.GPLv2.
* lib/README, man/it/man1/apropos.man1, man/it/man1/man.man1,
man/it/man1/manpath.man1, man/it/man1/whatis.man1,
man/it/man1/zsoelim.man1, man/it/man5/manpath.man5,
man/it/man8/accessdb.man8, man/it/man8/catman.man8,
man/it/man8/mandb.man8, man/man1/apropos.man1, man/man1/lexgrog.man1,
man/man1/man-recode.man1, man/man1/man.man1, man/man1/manconv.man1,
man/man1/manpath.man1, man/man1/whatis.man1, man/man1/zsoelim.man1,
man/man5/manpath.man5, man/man8/accessdb.man8, man/man8/catman.man8,
man/man8/mandb.man8, manual/comp.me, manual/db.me, manual/files.me,
manual/format.me, manual/glossary.me, manual/intro.me, manual/leader.me,
manual/man_db.me, manual/misc.me, manual/sec.me: Refer to COPYING.GPLv2
rather than COPYING.
2022-04-23 Colin Watson <cjwatson@debian.org>
Update pre-commit hooks
* .pre-commit-config.yaml (pre-commit-hooks): Update to v4.2.0.
2022-04-17 Emir SARI <emir_sari@icloud.com>
Update Turkish manual page translation
* man/po4a/po/tr.po: Update from Translation Project.
* man/THANKS: Update translator credit.
2022-04-16 Colin Watson <cjwatson@debian.org>
Recognize another Turkish translation of NAME
Emir SARI reports that "AD" is the de facto standard technical
terminology for "NAME" in Turkish, rather than "İSİM" which sounds
slightly colloquial. Recognize it as well.
* src/lexgrog.l (tr_name): Add "AD".
2022-04-12 Emir SARI <emir_sari@icloud.com>
Update Turkish translation
* po/tr.po: Update from Translation Project.
* man/THANKS: Add translator credit.
2022-03-17 Colin Watson <cjwatson@debian.org>
Release man-db 2.10.2
NEWS.md: Fix typo for 2.7.6
2022-03-08 Colin Watson <cjwatson@debian.org>
pre-commit: Avoid need for multiple shellcheck runs
* .shellcheckrc: Set `external-sources=true`.
* src/tests/lexgrog-backslash-dash-rhs, src/tests/lexgrog-basic,
src/tests/lexgrog-multiple-whatis, src/tests/man-deleted-directory,
src/tests/man-exact-section-matches,
src/tests/man-executable-page-on-path, src/tests/man-invalid-db-entry,
src/tests/man-language-specific-requests,
src/tests/man-mandatory-manpath, src/tests/man-missing-locales,
src/tests/man-override-dir, src/tests/man-recode-in-place,
src/tests/man-recode-suffix, src/tests/man-so-links-same-section,
src/tests/man-suffixed-extension,
src/tests/man-symlinks-with-matching-names,
src/tests/manconv-coding-tags, src/tests/manconv-guess-from-encoding,
src/tests/manconv-incomplete-char-at-eof,
src/tests/manconv-odd-combinations, src/tests/mandb-basic,
src/tests/mandb-bogus-symlink, src/tests/mandb-cachedir-tag,
src/tests/mandb-empty-page, src/tests/mandb-purge-updates-timestamp,
src/tests/mandb-regular-file-symlink-changes,
src/tests/mandb-symlink-beats-whatis-ref,
src/tests/mandb-symlink-target-timestamp,
src/tests/mandb-whatis-broken-link-changes,
src/tests/whatis-path-to-executable, src/tests/zsoelim-so-includes: Add
`shellcheck source-path=SCRIPTDIR` directive before sourcing testlib.sh.
* .pre-commit-config.yaml: Consolidate the two shellcheck hooks into
one.
2022-03-08 Colin Watson <cjwatson@debian.org>
pre-commit: Add shellcheck
* .pre-commit-config.yaml: Add shellcheck. We need separate hooks for
`src/tests/` and for everything else, since shellcheck needs a `-P`
option to correctly handle sourced files in `src/tests/`.
* .shellcheckrc: New file.
2022-03-08 Colin Watson <cjwatson@debian.org>
Refactor use of cd in shell scripts
shellcheck warns about unchecked uses of `cd` (SC2164). Either check it
or refactor to avoid changing directory.
* src/tests/man-deleted-directory: Check `cd` call.
* src/tests/man-suffixed-extension: Avoid changing directory.
* tools/mkcatdirs: Likewise.
2022-03-08 Colin Watson <cjwatson@debian.org>
mkcatdirs: Skip nonexistent man directories
* tools/mkcatdirs: `manpath -qg` may return man directories that are
mentioned in the configuration file but that don't exist on the
filesystem. Skip these.
2022-03-08 Colin Watson <cjwatson@debian.org>
mkcatdirs: Refactor using install(1)
I'm not sure this script is widely-used, but it might as well work. It
previously relied on `mkinstalldirs`, which is a build tool not
typically installed on end-user systems.
* tools/mkcatdirs: Refactor cat directory creation using install(1).
2022-03-08 Colin Watson <cjwatson@debian.org>
Apply various minor shell syntax improvements
* manual/print-options: Explicitly set `LANGUAGE=''` rather than
`LANGUAGE=`, pacifying shellcheck SC1007 which notes that this
construction might otherwise be misread.
* src/tests/manconv-odd-combinations: Use `printf %b` to pacify
shellcheck SC2059.
* src/tests/testlib.sh: Tell shellcheck which shell syntax to assume,
since this file has no `#!` line.
(run): Disable shellcheck SC2154; `abs_top_builddir` is always set by
the test runner.
(report): Remove unnecessary `$` before variable in arithmetic context.
(tools/checkman): Use `$(...)` for command substitution. Quote
variables properly where possible, and ignore shellcheck SC2068 in a
couple of other places.
2022-03-07 Colin Watson <cjwatson@debian.org>
tests: Pacify shellcheck SC2188
The previous construction resulted in:
SC2188 (warning): This redirection doesn't have a command. Move to its
command (or use 'true' as no-op).
* src/tests/man-mandatory-manpath, src/tests/testlib.sh: Avoid
redirections without a command.
2022-03-07 Colin Watson <cjwatson@debian.org>
tests: Make pass/fail reporting more shellcheck-friendly
* src/tests/testlib.sh (report): New function, similar to expect_pass
but taking an exit code rather than a command string to evaluate.
(expect_pass): Remove.
(expect_files_equal): Refactor using report function.
* src/tests/man-deleted-directory,
src/tests/man-executable-page-on-path, src/tests/man-missing-locales,
src/tests/man-recode-in-place, src/tests/manconv-incomplete-char-at-eof,
src/tests/mandb-bogus-symlink, src/tests/mandb-cachedir-tag,
src/tests/mandb-empty-page, src/tests/mandb-purge-updates-timestamp:
Refactor to use report function rather than expect_pass.
2022-03-07 Colin Watson <cjwatson@debian.org>
tests: Add an expect_files_equal helper function
* src/tests/testlib.sh (expect_files_equal): New function.
* src/tests/lexgrog-backslash-dash-rhs, src/tests/lexgrog-basic,
src/tests/lexgrog-multiple-whatis, src/tests/man-exact-section-matches,
src/tests/man-invalid-db-entry,
src/tests/man-language-specific-requests,
src/tests/man-mandatory-manpath, src/tests/man-override-dir,
src/tests/man-recode-in-place, src/tests/man-recode-suffix,
src/tests/man-so-links-same-section, src/tests/man-suffixed-extension,
src/tests/man-symlinks-with-matching-names,
src/tests/manconv-coding-tags, src/tests/manconv-guess-from-encoding,
src/tests/manconv-odd-combinations, src/tests/mandb-basic,
src/tests/mandb-purge-updates-timestamp,
src/tests/mandb-regular-file-symlink-changes,
src/tests/mandb-symlink-beats-whatis-ref,
src/tests/mandb-symlink-target-timestamp,
src/tests/mandb-whatis-broken-link-changes,
src/tests/whatis-path-to-executable, src/tests/zsoelim-so-includes: Use
expect_files_equal instead of the equivalent expect_pass construction.
2022-03-07 Colin Watson <cjwatson@debian.org>
tests: Improve quoting
* src/tests/lexgrog-backslash-dash-rhs, src/tests/lexgrog-basic,
src/tests/lexgrog-multiple-whatis, src/tests/man-deleted-directory,
src/tests/man-exact-section-matches,
src/tests/man-executable-page-on-path, src/tests/man-invalid-db-entry,
src/tests/man-language-specific-requests,
src/tests/man-mandatory-manpath, src/tests/man-missing-locales,
src/tests/man-override-dir, src/tests/man-recode-in-place,
src/tests/man-recode-suffix, src/tests/man-so-links-same-section,
src/tests/man-suffixed-extension,
src/tests/man-symlinks-with-matching-names,
src/tests/manconv-coding-tags, src/tests/manconv-guess-from-encoding,
src/tests/manconv-incomplete-char-at-eof,
src/tests/manconv-odd-combinations, src/tests/mandb-basic,
src/tests/mandb-bogus-symlink, src/tests/mandb-cachedir-tag,
src/tests/mandb-empty-page, src/tests/mandb-purge-updates-timestamp,
src/tests/mandb-regular-file-symlink-changes,
src/tests/mandb-symlink-beats-whatis-ref,
src/tests/mandb-symlink-target-timestamp,
src/tests/mandb-whatis-broken-link-changes,
src/tests/whatis-path-to-executable, src/tests/zsoelim-so-includes: Use
': "${var=default}"' idiom to assign default values rather than
': ${var=default}', pacifying shellcheck.
2022-03-06 Nikola Forró <nforro@redhat.com>
Add --with-snapdir configure option
* m4/man-arg-snapdir.m4: New file.
* configure.ac: Call MAN_ARG_SNAPDIR.
* src/man_db.conf.in: Use @snapdir@ rather than hardcoding /snap.
* NEWS.md: Document this.
2022-03-06 Colin Watson <cjwatson@debian.org>
Tidy up NEWS.md slightly
* NEWS.md: Reorder fixes and improvements; add credit for last commit.
2022-03-06 Mihail Konev <k.mvc@ya.ru>
man(1): Fix override dir handling
Previously, override dir was affecting only some cases of manpath
determination. Apply it only when all paths have been gathered instead.
Also look for override dir when sorting candidates.
Fixes src/tests/man-override-dir failing when --with-override-dir=od is
passed to ./configure.
[cjwatson: Refactored candidate comparison to use a strcmp-style
function, and simplified the addition of override directories a little
more.]
* src/man.c (compare_override_dir): New function.
(compare_candidates): Compare override directory status between
comparing section extensions and comparing locale elements.
* src/manp.c (insert_override_dir): Remove.
(get_manpath_from_path, add_man_subdirs): Remove calls to
insert_override_dir.
(create_pathlist): Add OVERRIDE_DIR at the canonicalization stage
instead.
* NEWS.md: Document this.
Reported-by: Nikola Forró <nforro@redhat.com>
Tested-by: Nikola Forró <nforro@redhat.com>
2022-03-06 Colin Watson <cjwatson@debian.org>
Update to Gnulib 20220301
In line with Gnulib, we now require Automake 1.14.
* bootstrap.conf (GNULIB_REVISION): Set to
8c4f4d7a3c28f88b64fce2fb1d0dc0e570d1a482.
(buildreq): Bump required automake version to 1.14.
* configure.ac (AM_INIT_AUTOMAKE): Bump minimum version to 1.14.
* NEWS.md: Document this.
2022-03-06 Colin Watson <cjwatson@debian.org>
Add some hardening options to the systemd service
Based on a patch by Johannes Segitz in the openSUSE packaging, although
I added `PrivateTmp=true` and `LockPersonality=true` as well.
* init/systemd/man-db.service.in: Add some hardening options. (This may
produce warnings with `systemd < 244`.)
* NEWS.md: Document this.
2022-03-05 Colin Watson <cjwatson@debian.org>
Make the man-db manual build reproducible
Inspired by a patch from B. Wiedemann, but implemented differently.
* manual/Makefile.am (version): Set "td" string to the package's release
date, since otherwise groff's me package will use the current date.
* NEWS.md: Document this.
2022-03-05 Dr. Werner Fink <werner@suse.de>
Fix showing HTML, as firefox runs into background too fast
[cjwatson: I'm not 100% keen on this approach, since it randomly depends
on how long the browser happens to take to launch and might be a bit
annoying for users of light browsers such as w3m, but there doesn't seem
to be any other good alternative for the more common case of people
using typical graphical browsers.]
Fixes Debian bug #335411 and Savannah bug #59542.
* src/man.c (format_display): Sleep for a few seconds after starting the
browser, since it may background itself before loading files.
* NEWS.md: Document this.
2022-02-18 Мирослав Николић <miroslavnikolic@rocketmail.com>
Update Serbian manual page translation
* man/po4a/po/sr.po: Update from Translation Project.
2022-02-17 Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
Update Romanian translation
* po/ro.po: Update from Translation Project.
* man/THANKS: Update translator credit.
2022-02-15 Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
Update Romanian manual page translation
* man/po4a/po/ro.po: Update from Translation Project.
2022-02-15 Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
Update Romanian manual page translation
* man/po4a/po/ro.po: Update from Translation Project.
* man/THANKS: Add translator credit.
2022-02-10 Colin Watson <cjwatson@debian.org>
Release man-db 2.10.1
2022-02-10 Colin Watson <cjwatson@debian.org>
Add a top-level update-po target
This simplifies the common task of ensuring that both program and manual
page translation files are up to date.
* Makefile.am (update-po): New target.
2022-02-09 Colin Watson <cjwatson@debian.org>
Fix warnings when building without zlib
* src/decompress.c (decompress_new_inprocess): Only define this function
if HAVE_LIBZ is defined.
(OPEN_FLAGS_UNUSED): New macro, defined to MAYBE_UNUSED if HAVE_LIBZ is
undefined.
(decompress_open): Declare flags as unused if HAVE_LIBZ is defined.
2022-02-08 Colin Watson <cjwatson@debian.org>
Use Gnulib raise module
This can be made slightly more portable (e.g. to MinGW).
* bootstrap.conf (gnulib_modules): Add raise.
* lib/cleanup.c (sighandler): Call raise rather than kill.
2022-02-08 Colin Watson <cjwatson@chiark.greenend.org.uk>
Merge branch 'libintl' into 'main'
libdb: link against libintl explicitly
See merge request cjwatson/man-db!3
2022-02-08 Colin Watson <cjwatson@debian.org>
Use @LTLIBINTL@ rather than $(LIBINTL)
This matches our other Makefiles.
2022-02-08 Boyuan Yang <073plan@gmail.com>
Update Simplified Chinese manual page translation
Fixes Debian bug #1005139.
* man/po4a/po/zh_CN.po: Update from Translation Project.
2022-02-08 Colin Watson <cjwatson@debian.org>
Fix building on Cygwin
Achim reported that 2.10.0 no longer builds on Cygwin, while 2.9.4 did.
This was magnificently obscure, at least to this Unix-head. Initially
it appeared to be an issue with inter-library linking between libman and
libmandb, but 2.9.4 relied on that too, just slightly less so.
The actual problem was that libman only exported
`gl_get_setlocale_null_lock` and not all the other symbols it's supposed
to export, which is because that was explicitly marked for export and no
other symbols were. Building libman with `-Wl,--export-all-symbols`
fixes this; libman is intended as an aggregation of various helper
functions, including those from Gnulib, and it doesn't make sense to be
especially selective since it's only installed as a private library
anyway.
(I'm still not exactly sure why 2.9.4 didn't do the same thing, but this
seems to be a good enough fix.)
* configure.ac: Set LIBMAN_EXPORT_LDFLAGS to '-Wl,--export-all-symbols'
when linking with GNU ld on Windows platforms.
* lib/Makefile.am (libman_la_LDFLAGS): Add $(LIBMAN_EXPORT_LDFLAGS).
* src/Makefile.am (LIBMAN): Remove $(top_builddir)/gl/lib/libgnu.la; as
a convenience library, this is already incorporated into libman.la, and
specifying it again causes multiple-definition errors on Cygwin.
* src/tests/Makefile.am (get_mtime_LDADD): Likewise.
* NEWS.md: Document this.
2022-02-08 Colin Watson <cjwatson@debian.org>
Document fix for building without iconv
* NEWS.md: Document previous change.
2022-02-08 Colin Watson <cjwatson@debian.org>
Fix building without iconv
* src/convert.c (convert_to_locale) [!HAVE_ICONV]: Declare a function
rather than a macro.
(convert_to_locale): Add ATTRIBUTE_MALLOC.
2022-02-08 Colin Watson <cjwatson@debian.org>
Remove some unused includes
* lib/encodings.c: Remove unused #include "pipeline.h". Explicitly
include <stdio.h>, previously included implicitly via "pipeline.h".
* lib/security.c, lib/util.c: Remove unused #include "pipeline.h".
2022-02-07 Fabian Groffen <grobian@gentoo.org>
libdb: link against libintl explicitly
Necessary since gettext is used for translations.
[sam: originally found downstream in Gentoo on Gentoo Prefix on macOS.]
2022-02-06 Colin Watson <cjwatson@debian.org>
Suppress Clang warnings with -Wconstant-logical-operand
* src/lexgrog.l (find_name): Explicitly test `*PROG_COL != '\0'` rather
than just `*PROG_COL`, to pacify `clang -Wconstant-logical-operand`.
* src/man.c (make_roff_command, make_display_command): Likewise.
2022-02-06 Colin Watson <cjwatson@debian.org>
Revert "Reduce indentation depth using C99"
This reverts commit c4d20840f3487588c4a0da4397b1acb6dc83a1e5. Even in
C99, a declaration isn't valid immediately after a label; this didn't
become valid until C2x, although gcc allows it as an extension.
Fixes https://gitlab.com/cjwatson/man-db/-/issues/2.
* src/man.c (parse_opt): Restore enclosing block for OPT_WARNINGS.
* NEWS: Document this.
2022-02-04 Colin Watson <cjwatson@debian.org>
Fix another edge case in mandb-symlink-target-timestamp
* src/tests/mandb-symlink-target-timestamp: Fix handling of the case
where the nanosecond part of a timestamp is exactly 0 (probably because
the filesystem doesn't support nanosecond resolution).
2022-02-04 Colin Watson <cjwatson@debian.org>
Fix occasional mandb-symlink-target-timestamp test failure
* src/tests/mandb-symlink-target-timestamp: Fix handling of the case
where the nanosecond part of a timestamp starts with a zero.
* NEWS.md: Document this.
2022-02-04 Colin Watson <cjwatson@debian.org>
Update man-db.lsm properly
Release man-db 2.10.0
2022-01-31 Colin Watson <cjwatson@debian.org>
gitlab-ci: Run tests with VERBOSE=1
This makes it easier to diagnose test failures.
* .gitlab-ci.yml (build-distcheck:script, build-out-of-tree:script): Set
VERBOSE=1.
2022-01-31 Colin Watson <cjwatson@debian.org>
man: Avoid spurious error messages due to subpages
Since man-db 2.4.2, `man` has behaved as if the `-l` option was given if
a manual page argument contains a slash. Since man-db 2.5.6, this has
interacted slightly poorly with the subpage feature, emitting spurious
error messages if given multiple manual page arguments some of which
include a slash. `man` no longer emits spurious error messages in this
case.
Fixes Savannah bug #53708.
* src/man.c (man): Move name-contains-slash case to ...
(man_maybe_local): ... here (new function).
(main): Call man_maybe_local instead of man where checking for names
containing slashes is acceptable.
* NEWS.md: Document this.
2022-01-31 Colin Watson <cjwatson@debian.org>
mandb: Fix handling of link target mtimes
Depending on directory iteration order, mandb sometimes incorrectly
stored the mtime of a symlink as the mtime of its target as well.
Fixes Debian bug #691643.
* src/descriptions_store.c (store_descriptions): When adding entries
based on an ult_src trace, use the mtime of the target file if possible
rather than the mtime of the base entry.
* src/tests/Makefile.am (ALL_TESTS): Add mandb-symlink-target-timestamp.
* src/tests/get-mtime.c (main): Use lstat rather than stat.
* src/tests/mandb-symlink-target-timestamp: New file.
* NEWS.md: Document this.
2022-01-30 Colin Watson <cjwatson@debian.org>
Update translation files
* po/man-db.pot, po/*.po: Update.
2022-01-30 Colin Watson <cjwatson@debian.org>
Update to Gnulib 20220130
* bootstrap: Sync to Gnulib 735f319cde4ab7e98294557181d682564241d846.
* bootstrap.conf (GNULIB_REVISION): Set to
735f319cde4ab7e98294557181d682564241d846.
2022-01-30 Colin Watson <cjwatson@debian.org>
Simplify static analysis of fatal errors
The usual idiom for fatal error reporting in man-db is `error (FATAL,
...)` (there are a few cases using different exit codes, but they're
less common). Unfortunately, there's no easy way to tell the compiler
that this call doesn't return, because `error (0, ...)` *does* return.
As a result, some call sites required extra work to give the compiler
this information, which can sometimes make a difference to static
analysis.
To simplify this, add a new `fatal` helper function which always exits
`FATAL` (i.e. 2) and never returns. This is declared with `_Noreturn`
so that the compiler can straightforwardly know what's going on.
* bootstrap.conf (gnulib_modules): Add verror.
(XGETTEXT_OPTIONS): Add --flag=fatal:2:c-format.
* lib/fatal.c, lib/fatal.h: New files.
* lib/Makefile.am (libman_la_SOURCES): Add fatal.c and fatal.h.
* src/tests/Makefile.am (AM_CPPFLAGS): Add -I$(top_srcdir)/lib.
(get_mtime_LDADD): Add $(top_builddir)/lib/libman.la.
* lib/pathsearch.c (pathsearch, directory_on_path): Use fatal.
* lib/sandbox.c (can_load_seccomp, make_seccomp_filter, _sandbox_load):
Likewise.
* lib/security.c (gripe_set_euid): Likewise.
* lib/xregcomp.c (xregcomp): Likewise.
* libdb/db_lookup.c (gripe_corrupt_data, dblookup_pattern): Likewise.
* libdb/db_ver.c (dbver_wr): Likewise.
* src/accessdb.c (main): Likewise.
* src/catman.c (parse_for_sec): Likewise.
* src/check_mandirs.c (chown_if_possible): Likewise.
* src/man-recode.c (recode): Likewise.
* src/man.c (open_cat_stream, format_display, gripe_converting_name):
Likewise.
* src/manconv.c (add_output): Likewise.
* src/manp.c (add_dir_to_path_list): Likewise.
* src/tests/get-mtime.c (main): Likewise.
* src/whatis.c (do_apropos): Likewise.
* src/zsoelim.l (<so>\"?[^ \t\n\"]+\"?): Likewise.
* libdb/db_lookup.c (gripe_corrupt_data, gripe_replace_key): Declare as
_Noreturn.
* src/accessdb.c (main): Remove now-unnecessary assertion.
* src/man.c (gripe_converting_name): Remove now-unnecessary abort.
2022-01-30 Colin Watson <cjwatson@debian.org>
docs: Move COPYING and COPYING.LIB to top level
I think people are more likely to expect to find them here - I recently
even found myself confused by their previous placement.
* docs/COPYING, docs/COPYING.LIB: Move to ...
* COPYING, COPYING.LIB: ... here, respectively.
* lib/README: Update references.
2022-01-30 Colin Watson <cjwatson@debian.org>
man: Don't modify MANSECT environment variable
Reported and diagnosed by Rob Hoelz. Fixes Savannah bug #58896.
* src/man.c (get_section_list): Copy colon_sep_section_list before
passing it to strtok.
* NEWS.md: Document this.
2022-01-30 Colin Watson <cjwatson@debian.org>
libdb: Pacify gcc -Wempty-body
* libdb/mydbm.h (MYDBM_REORG) [NDBM, BTREE]: Change no-op macro
definition to avoid "suggest braces around empty body" warning in mandb.
2022-01-30 Alejandro Cendejas Tena <alex.cendejas@gmail.com>
Update Spanish manual page translation
* man/po4a/po/es.po: Update from Translation Project.
2022-01-30 Colin Watson <cjwatson@debian.org>
mandb: Don't modify DB without changing its mtime
In d9ebedad15 (man-db 2.7.0), mandb started relying on the modification
times of database files themselves rather than using a special row, in
order to make databases reproducible between otherwise-identical
installations (subject to predictable behaviour from the underlying
database).
There was a difficulty with this change. Because purging deleted pages
from the database opened and closed the database in a separate phase
before the main phase of looking for updated manual pages, and because
the main phase relies on comparing against the mtime of the database to
find changed files, I had to arrange to restore the original mtime at
the end of the purge phase in order to avoid confusing the main phase
into being a no-op. However, in some cases (perhaps due to other bugs,
but nevertheless), it's possible for the purge phase to find work to do
without the main phase ever finding any modified directories, which
meant that the net effect of mandb would be to modify its database
without changing its mtime. This is bad form, and confused some backup
systems into believing that the filesystem had been corrupted, since
files having their contents changed without updating their mtime is
indeed a likely symptom of filesystem corruption.
To avoid this, restructure our database-handling code so that a given
mandb run opens any given database at most once. This means that we no
longer need to modify mtimes manually, so the usual filesystem rules
apply.
Fixes Debian bug #1004355 and Ubuntu bug #1411633.
* bootstrap.conf (gnulib_modules): Remove futimens.
* libdb/db_btree.c (man_btree_close): Rename to ...
(man_btree_free): ... this. Check whether wrap->file is set. Free
wrap->mtime.
(man_btree_new): New function.
(man_btree_open): Convert to running on the result of man_btree_new.
(man_btree_get_time): Cache return value in wrap->mtime.
(man_btree_set_time): Remove.
* libdb/db_gdbm.c (man_gdbm_new): New function.
(man_gdbm_open_wrapper): Convert to running on the result of
man_gdbm_new.
(man_gdbm_get_time): Cache return value in wrap->mtime.
(man_gdbm_set_time): Remove.
(raw_close): Check whether wrap->file is set.
(man_gdbm_close): Rename to ...
(man_gdbm_free): ... this.
* libdb/db_ndbm.c (raw_close): Check whether wrap->file is set.
(man_ndbm_close): Rename to ...
(man_ndbm_free): ... this.
(man_ndbm_new): New function.
(man_ndbm_open): Convert to running on the result of man_ndbm_new.
(man_ndbm_get_time): Cache return value in wrap->mtime.
(man_ndbm_set_time): Remove.
* libdb/db_xdbm.c (man_xdbm_close): Rename to ...
(man_xdbm_free): ... this. Update all callers. Free dbf->mtime.
* libdb/db_xdbm.h (man_xdbm_close): Rename to ...
(man_xdbm_free): ... this.
* libdb/mydbm.h (man_gdbm_wrapper, man_ndbm_wrapper, man_btree_wrapper):
Add mtime.
(man_gdbm_new, man_ndbm_new, man_btree_new): Add prototypes.
(man_gdbm_open_wrapper, man_ndbm_open, man_btree_open): Update
prototypes.
(man_gdbm_set_time, man_ndbm_set_time, man_btree_set_time): Remove
prototypes.
(man_gdbm_close, man_ndbm_close, man_btree_close): Rename to ...
(man_gdbm_free, man_ndbm_free, man_btree_free): ... these, respectively.
(MYDBM_NEW): New macro.
(MYDBM_CTRWOPEN, MYDBM_RWOPEN, MYDBM_RDOPEN): Rename file argument to
wrap.
(MYDBM_CLOSE): Rename to ...
(MYDBM_FREE): ... this.
(MYDBM_SET_TIME): Remove macro.
* src/catman.c (parse_for_sec): Take a MYDBM_FILE argument rather than a
database path.
* src/check_mandirs.c (gripe_rwopen_failed, testmandirs, create_db,
update_db, purge_missing): Likewise.
* src/mandb.c (update_one_file, update_db_wrapper): Likewise.
* src/straycats.c (straycats): Likewise.
* src/check_mandirs.h (create_db, update_db, purge_missing): Update
prototypes.
* src/straycats.h (straycats): Likewise.
* src/check_mandirs.c (ensure_db_open): New function.
(testmandirs): Only open the database if it wasn't already open, and
don't close it.
(update_db, purge_missing): Likewise.
* src/mandb.c (update_one_file): Likewise.
* src/straycats.c (straycats): Assert that the database is already open,
and don't close it.
* src/accessdb.c (main): Update database opening code.
* src/catman.c (post_fork): Update database closing code.
(parse_for_sec): Move database opening and closing code to ...
(main): ... here, and update it.
* src/man.c (dbdelete_wrapper): Update database opening and closing
code.
* src/whatis.c (search): Update database opening and closing code.
* src/check_mandirs.c (purge_missing): Don't reorganize the database.
* src/mandb.c (mandb): Create a MYDBM_FILE from the database path, and
close and free it before returning. Rearrange purging so that it runs
on the temporary database copy, which we close and remove if
purge_missing finds a consistency problem requiring us to rescan from
scratch. Unless purging requires a rescan, all of the purge, main, and
stray cats phases now run on the same open database file. Reorganize
the database before closing it if the purge phase did any work.
(process_manpath): Rename the temporary database into place if either of
the purge or stray cats phases did any work, even if the main phase
didn't.
* src/check_mandirs.c (update_db_time): Remove.
(create_db): Don't manually update the database mtime.
(update_db, purge_missing): Likewise.
* src/tests/Makefile.am (ALL_TESTS): Add mandb-purge-updates-timestamp.
(check_PROGRAMS): Add get-mtime.
(get_mtime_SOURCES, get_mtime_LDADD): Add.
* src/tests/get-mtime.c: New file: test helper to get a file's mtime
portably.
* src/tests/mandb-purge-updates-timestamp: New file.
* .gitignore: Add src/tests/get-mtime.
* NEWS: Document this.
2022-01-29 Colin Watson <cjwatson@debian.org>
man: Make dbdelete_wrapper use the correct database
Even if it has permissions to delete stale entries from the database,
dbdelete_wrapper can't assume that the most recently opened database is
the one from which it should delete the entry; it needs to use the
database to which the candidate in question belongs.
* src/man.c (database): Remove global variable.
(dbdelete_wrapper): Add a manpath argument, and attempt to open the
associated database locally.
(display_database_check): Pass the candidate's path (i.e. manpath) to
dbdelete_wrapper.
(try_db): Make the database path a local variable. Reorganize cleanup
paths.
(main): Stop freeing database, since it's no longer a global variable.
2022-01-29 Colin Watson <cjwatson@debian.org>
mandb: Fix some details of error handling
* src/check_mandirs.c (testmandirs): Return -1 rather than -errno on
failure to create the database.
(create_db, update_db): Only call update_db_time if amount > 0, rather
than if it is non-zero (since it may be negative to indicate an error,
and updating the database time doesn't make sense in that case).
(update_db): Return -1 rather than EOF.
* src/mandb.c (update_db_wrapper): Check whether amount is non-zero
rather than whether it is unequal to EOF.
2022-01-29 Colin Watson <cjwatson@debian.org>
libdb: Remove unused MYDBM_CRWOPEN macro
* libdb/mydbm.h (MYDBM_CRWOPEN): Remove.
2022-01-29 Colin Watson <cjwatson@debian.org>
mandb: Call purge_missing and straycats from mandb
We can simplify some logic by pushing these down a layer.
* src/check_mandirs.c (purge_missing): Remove will_run_mandb argument,
which was always true due to --filename implying --no-purge.
* src/check_mandirs.h (purge_missing): Update prototype.
* src/mandb.c (process_manpath): Move purge_missing and straycats calls
to ...
(mandb): ... here.
2022-01-29 Colin Watson <cjwatson@debian.org>
mandb: Factor out some duplicate code
* src/mandb.c (mandb): Move common create/update logic outside the
database-type-specific #ifdefs.
2022-01-26 Colin Watson <cjwatson@debian.org>
Use bool in more places in mandb
* src/check_mandirs.c (testmandirs): Change "create" parameter and
"created" local variable types to bool. Update all callers.
(check_multi_key): Change "valid" local variable to bool.
(purge_missing): Change "will_run_mandb" parameter and "db_exists" local
variable types to bool. Update all callers.
* src/check_mandirs.h (purge_missing): Update prototype.
* src/mandb.c (struct tried_catdirs_entry): Change "seen" element type
to bool. Update all users.
(mandb): Change "should_create" and "cachedir_tag_exists" local variable
types to bool.
(process_manpath): Change "run_mandb" local variable type to bool.
(is_lang_dir): Return bool.
2022-01-26 Yi-Jyun Pan <pan93412@gmail.com>
Update Traditional Chinese translation
* po/zh_TW.po: Update from Translation Project.
* man/THANKS: Update translator credit.
2022-01-25 Colin Watson <cjwatson@debian.org>
Add Spanish translator credit
* man/THANKS: Add translator credit.
2022-01-25 Petr Pisar <petr.pisar@atlas.cz>
Update Czech translation
* po/cs.po: Update from Translation Project.
* man/THANKS: Add translator credit.
2022-01-24 Mario Blättermann <mario.blaettermann@gmail.com>
Update German manual page translation
* man/po4a/po/de.po: Update from Translation Project.
2022-01-24 Alejandro Cendejas Tena <alex.cendejas@gmail.com>
Update Spanish manual page translation
* man/po4a/po/es.po: Update from Translation Project.
2022-01-24 Alejandro Cendejas Tena <alex.cendejas@gmail.com>
Update Spanish manual page translation
* man/po4a/po/es.po: Update from Translation Project.
2022-01-24 Colin Watson <cjwatson@debian.org>
Fix upload/release machinery to handle .tar.xz
Release man-db 2.10.0-pre1
2022-01-24 Colin Watson <cjwatson@debian.org>
Improve documentation of search path handling
Fixes Savannah bug #61862.
* man/man5/manpath.man5 (SEARCH PATH): New section.
* man/man1/apropos.man1 (ENVIRONMENT): Refer to manpath(5) for details
of MANPATH.
* man/man1/man.man1 (ENVIRONMENT): Likewise.
* man/man1/manpath.man1 (ENVIRONMENT): Likewise.
* man/man1/whatis.man1 (ENVIRONMENT): Likewise.
* man/man8/catman.man8 (ENVIRONMENT): Likewise.
2022-01-24 Colin Watson <cjwatson@debian.org>
Fix typos in descriptions of --systems
Fixes Savannah bug #61861.
* man/man1/apropos.man1 (OPTIONS): "system's" → "systems'".
* man/man1/man.man1 (Finding manual pages): Likewise.
* man/man1/manpath.man1 (OPTIONS): Likewise.
* man/man1/whatis.man1 (OPTIONS): Likewise.
2022-01-24 Colin Watson <cjwatson@chiark.greenend.org.uk>
Merge branch 'optimize-decompression' into 'main'
Significantly improve mandb performance
See merge request cjwatson/man-db!2
2022-01-24 Colin Watson <cjwatson@debian.org>
Optimize manconv_inprocess for UTF-8 target encoding
If the target encoding is UTF-8, then manconv's first stage (trial
conversion from UTF-8) can more efficiently be replaced with UTF-8
validation, leaving the original decompressed buffer unchanged on
success. Suggested by Steinar H. Gunderson.
* src/manconfig.h (UNLIKELY): New macro.
* src/decompress.c (decompress_inprocess_buf): New function.
* src/decompress.h (decompress_inprocess_buf): Add prototype.
* src/utf8.c, src/utf8.h: New files, based on glib's UTF-8 validation
code.
* src/manconv_client.c (manconv_inprocess): Optimize case where
source_encoding is not UTF-8 and target_encoding is UTF-8 by returning
early if UTF-8 validation passes.
* src/Makefile.am (lexgrog_SOURCES, man_SOURCES, man_recode_SOURCES,
mandb_SOURCES): Add utf8.c and utf8.h.
2022-01-24 Colin Watson <cjwatson@debian.org>
Significantly improve mandb performance
Forking large numbers of subprocesses is slow. An ideal fix would
involve work in libpipeline (e.g. generator functions or
multithreading), but in the meantime we can do much better in the common
case of moderately-sized pages compressed using zlib by doing in-process
decompression. On my test system, this takes `mandb -c` from 344
seconds (or 152 seconds with `MAN_DISABLE_SECCOMP=1` before 50200d151d,
or 78 seconds with `MAN_DISABLE_SECCOMP=1` after 50200d151d) to 10
seconds.
Thanks to Steinar H. Gunderson for a proof of concept, which I reworked
extensively.
Fixes Debian bugs #630799 and #1003089, and Ubuntu bug #1858777.
* NEWS.md: Document this. Bump version to 2.10.0.
* src/decompress.c (enum decompress_tag): Add DECOMPRESS_INPROCESS.
(struct decompress_inprocess): New structure.
(struct decompress): Add an inprocess element.
(decompress_new_inprocess, decompress_try_zlib, decompress_is_pipeline,
decompress_inprocess_len, decompress_inprocess_replace): New functions.
(decompress_open): Add flags argument. Try in-process zlib
decompression if requested via DECOMPRESS_ALLOW_INPROCESS. Update all
callers to pass a flags argument (0 unless otherwise stated).
(decompress_start, decompress_read, decompress_peek,
decompress_peek_skip, decompress_readline, decompress_peekline,
decompress_wait, decompress_free): Implement in-process mode.
* src/decompress.h (DECOMPRESS_ALLOW_INPROCESS): Define.
(decompress_open): Update prototype.
(decompress_fdopen): Update comment to indicate that this always uses
pipeline-based decompression.
(decompress_is_pipeline, decompress_inprocess_len,
decompress_inprocess_replace): Add prototypes.
(decompress_start, decompress_wait): Update comments to document
behaviour for in-process decompressors.
* src/manconv.c (add_output): Add output buffer argument; append to
output buffer if given, otherwise write to stdout as before.
(try_iconv): Add and pass output buffer argument.
(manconv): Likewise. Update all callers to pass output buffer argument
(NULL unless otherwise stated).
* src/manconv.h (struct manconv_outbuf): New structure.
(manconv): Update prototype.
* src/manconv_client.c (manconv_inprocess): New function.
* src/manconv_client.h (manconv_inprocess): Add prototype.
* src/lexgrog.l (find_name): Request in-process decompression unless
operating on a cat page. Use manconv_inprocess rather than add_manconv
in the in-process case.
* src/man.c (grep): Request in-process decompression.
* src/ult_src.c (ult_src): Likewise.
* src/zsoelim.l (try_compressed, zsoelim_open_file): Likewise.
2022-01-24 Colin Watson <cjwatson@debian.org>
Avoid a manconv subprocess in more cases
Suggested by Steinar H. Gunderson.
* src/manconv_client.c (add_manconv): Return early if the source and
target encodings are equal, not just if they're both UTF-8.
2022-01-22 Colin Watson <cjwatson@debian.org>
Make manconv error handling less abrupt
Exiting immediately on errors works OK if manconv is only ever used in a
subprocess, but that approach makes it hard to use in an in-process
context.
* src/manconv.c (add_output): New function, factored out of try_iconv
and manconv.
(tried_iconv): New enumeration.
(try_iconv): Use add_output. Return TRIED_ICONV_FATAL where we would
previously have exited the process.
(manconv): Use add_output. Return non-zero if add_output returns
non-zero or try_iconv returns TRIED_ICONV_FATAL.
* src/manconv.h (manconv): Update prototype.
* src/manconv_client.c (manconv_stdin): Exit with FATAL if manconv
returns non-zero.
* src/manconv_main.c (main): Likewise.
2022-01-22 Colin Watson <cjwatson@debian.org>
Clarify argument naming in add_manconv
Suggested by Steinar H. Gunderson.
* src/manconv_client.c (add_manconv): Rename source to source_encoding,
and target to target_encoding.
* src/manconv_client.h (add_manconv): Update prototype.
2022-01-19 Colin Watson <cjwatson@debian.org>
Add a layer of abstraction to decompression
It would be useful to have an optimized version of the common case of
zlib decompression that doesn't involve forking subprocesses. As
preparation for this, insert an abstraction layer around code that reads
from decompressors. This abstraction layer looks almost identical to
the `libpipeline` API except for name changes, but having it allows us
to implement decompression in some other way.
Code that requires `libpipeline`-based decompression can use
`decompress_get_pipeline` to assert that the decompressor uses
`libpipeline` and return the underlying `pipeline *`.
* src/decompress.c (enum decompress_tag, struct decompress,
decompress_new_pipeline, decompress_get_pipeline, decompress_start,
decompress_read, decompress_peek, decompress_peek_skip,
decompress_readline, decompress_peekline, decompress_wait,
decompress_free): Add.
(decompress_open, decompress_fdopen): Return `decompress *` rather than
`pipeline *`.
* src/decompress.h (decompress): New typedef.
(decompress_open, decompress_fdopen): Update prototypes.
(decompress_get_pipeline, decompress_start, decompress_read,
decompress_peek, decompress_peek_skip, decompress_readline,
decompress_peekline, decompress_wait, decompress_free): Add prototypes.
* src/lexgrog.l (YY_INPUT, find_name, find_name_decompressed): Use
decompression API.
* src/man-recode.c (recode): Likewise.
* src/man.c (get_preprocessors_from_file, get_preprocessors,
make_roff_command, format_display_and_save, format_display,
display_catman, display, display_pages, grep): Likewise.
* src/manconv.c (check_preprocessor_encoding, try_iconv, manconv):
Likewise.
* src/manconv_client.c (manconv_stdin): Likewise.
* src/manconv_main.c (main): Likewise.
* src/straycats.c (check_for_stray): Likewise.
* src/ult_src.c (ult_src): Likewise.
* src/zsoelim.l (YY_INPUT, <<EOF>>, zsoelim_parse_file, try_compressed,
zsoelim_open_file): Likewise.
* src/lexgrog.h (find_name_decompressed): Update prototype.
* src/manconv.h (check_preprocessor_encoding, manconv): Likewise.
2022-01-19 Alejandro Cendejas Tena <alex.cendejas@gmail.com>
Update Spanish manual page translation
* man/po4a/po/es.po: Update from Translation Project.
2022-01-18 Colin Watson <cjwatson@debian.org>
Fix missing options when invoking troff
Broken by 000cda3ec5.
* configure.ac: Move PROG_TROFF definition after all assignments to
$troff.
2022-01-18 Colin Watson <cjwatson@debian.org>
Fix override-dir handling
Broken by 000cda3ec5.
* m4/man-arg-override-dir.m4 (MAN_ARG_OVERRIDE_DIR): Remove superfluous
"$" from AC_DEFINE_UNQUOTED call.
2022-01-17 Colin Watson <cjwatson@debian.org>
Remove AM_MAINTAINER_MODE
I enabled this in fb4afb0b75, saying that timestamps were too fragile
for the rebuild rules to work well. However, I've changed my mind: git
is good at making sure that file modification times are updated when
checking out a different commit, and tarballs include timestamp
information. Moreover, with `AM_MAINTAINER_MODE` and without passing
`--enable-maintainer-mode`, flex output isn't automatically regenerated,
which is impossibly annoying and has tripped me up countless times since
2010.
* configure.ac (AM_MAINTAINER_MODE): Remove.
2022-01-17 Colin Watson <cjwatson@debian.org>
NEWS.md: Document previous commit
2022-01-17 Colin Watson <cjwatson@chiark.greenend.org.uk>
Merge branch 'C0rn3j-main-patch-74046' into 'main'
man-db.timer: Use RandomizedDelaySec over AccuracySec
See merge request cjwatson/man-db!1
2022-01-17 Colin Watson <cjwatson@debian.org>
Avoid libpipeline linkage in libman
Since it's only used by one function, and not all of man-db's tools need
libpipeline in their own right (e.g. accessdb), it seems worth pushing
this up a layer.
* lib/encodings.c (struct conversion_entry, conversion_table,
convert_encoding, check_preprocessor_encoding): Move to ...
* src/manconv.c: ... here.
* lib/encodings.h (check_preprocessor_encoding): Move to ...
* src/manconv.h: ... here.
* lib/Makefile.am (libman_la_CPPFLAGS): Remove $(libpipeline_CFLAGS).
(libman_la_LDFLAGS): Remove $(libpipeline_LIBS).
* src/man-recode.c, src/man.c, src/manconv.c: Include manconv.h.
2022-01-17 Colin Watson <cjwatson@debian.org>
Pacify cppcheck in check_preprocessor_encoding
* lib/encoding.c (check_preprocessor_encoding): Explicitly initialize
directive_end and ppsearch. If directive is non-NULL by the time these
are used then they're always initialized, but cppcheck didn't manage to
spot that.
2022-01-16 Colin Watson <cjwatson@debian.org>
Update to Gnulib 20220116
* bootstrap: Sync to Gnulib 1eae0f7ea3c220d054025f2c9211700665f9f4a0.
* bootstrap.conf (GNULIB_REVISION): Set to
1eae0f7ea3c220d054025f2c9211700665f9f4a0.
2022-01-16 Colin Watson <cjwatson@debian.org>
Move some more declarations out of manconfig.h
Header includes should be in the same translation unit as the code that
uses them rather than being ambient across the whole project.
* include/manconfig.h: Remove obsolete header comment about program
paths.
* include/manconfig.h: Remove includes of "xvasprintf.h", <stddef.h>,
"xalloc.h", and "xstrndup.h", as well as "struct pipeline" declaration.
Update all files that relied on these to include/declare them directly
instead as needed.
* include/manconfig.h (MAN_DB, mkdbname): Move to ...
* libdb/mydbm.h: ... here.
2022-01-16 Colin Watson <cjwatson@debian.org>
Move appendstr out of manconfig.h
* include/manconfig.h (appendstr): Move to ...
* lib/appendstr.h: ... here (new file).
* lib/Makefile.am (libman_la_SOURCES): Add appendstr.h.
* lib/README: Update file names.
* lib/appendstr.c, libdb/db_delete.c, src/catman.c, src/check_mandirs.c,
src/compression.c, src/filenames.c, src/globbing.c, src/man.c,
src/manconv_client.c, src/manconv_main.c, src/manp.c, src/straycats.c,
src/whatis.c, src/zsoelim.l: Include appendstr.h.
2022-01-16 Colin Watson <cjwatson@debian.org>
Move debug-related declarations out of manconfig.h
* include/manconfig.h (debug_level, init_debug, debug, debug_error):
Move to ...
* lib/debug.h: ... here (new file).
* lib/Makefile.am (libman_la_SOURCES): Add debug.h.
* lib/README: Update file names.
* lib/debug.c, lib/encodings.c, lib/sandbox.c, lib/security.c,
lib/util.c, libdb/db_btree.c, libdb/db_delete.c, libdb/db_gdbm.c,
libdb/db_lookup.c, libdb/db_store.c, libdb/db_ver.c, src/accessdb.c,
src/catman.c, src/check_mandirs.c, src/descriptions.c,
src/descriptions_store.c, src/filenames.c, src/globbing.c,
src/globbing_test.c, src/lexgrog_test.c, src/man-recode.c, src/man.c,
src/manconv.c, src/manconv_main.c, src/mandb.c, src/manp.c,
src/manpath.c, src/straycats.c, src/ult_src.c, src/whatis.c,
src/zsoelim.l, src/zsoelim_main.c: Include debug.h.
2022-01-16 Colin Watson <cjwatson@debian.org>
Move create_tempdir out of manconfig.h
* include/manconfig.h (create_tempdir): Move to ...
* lib/tempfile.h: ... here (new file).
* lib/Makefile.am (libman_la_SOURCES): Add tempfile.h.
* lib/tempfile.c, src/man.c: Include tempfile.h.
2022-01-16 Colin Watson <cjwatson@debian.org>
Move util.c-related declarations out of manconfig.h
* include/manconfig.h (is_changed, is_directory, escape_shell,
remove_directory, trim_spaces, lang_dir, init_locale): Move to ...
* lib/util.h: ... here (new file).
* lib/Makefile.am (libman_la_SOURCES): Add util.h.
* lib/util.c, src/accessdb.c, src/catman.c, src/check_mandirs.c,
src/descriptions.c, src/globbing.c, src/globbing_test.c, src/lexgrog.l,
src/lexgrog_test.c, src/man-recode.c, src/man.c, src/manconv_main.c,
src/mandb.c, src/manp.c, src/manpath.c, src/straycats.c, src/whatis.c,
src/zsoelim_main.c: Include util.h.
2022-01-16 Colin Watson <cjwatson@debian.org>
Move comp_info and comp_file out of manconfig.h
* include/manconfig.h (comp_info, comp_file): Move to ...
* src/compression.h: ... here (new file).
* src/Makefile.am (lexgrog_SOURCES, man_SOURCES, man_recode_SOURCES,
mandb_SOURCES): Add compression.h.
* src/compression.c, src/filenames.c, src/man-recode.c, src/man.c,
src/straycats.c, src/ult_src.c: Include compression.h.
2022-01-16 Colin Watson <cjwatson@debian.org>
Move straycats out of manconfig.h
* include/manconfig.h (straycats): Move to ...
* src/straycats.h: ... here (new file).
* src/Makefile.am (mandb_SOURCES): Add straycats.h.
* src/mandb.c, src/straycats.c: Include straycats.h.
2022-01-16 Colin Watson <cjwatson@debian.org>
Use lexgrog type definitions consistently
* include/manconfig.h (MANPAGE, CATPAGE): Move to ...
* src/lexgrog.h (MANPAGE, CATPAGE): ... here.
* src/lexgrog.l (find_name, find_name_decompressed): Compare p_lg->type
against CATPAGE rather than testing its truth value.
* src/lexgrog_test.c (main): Set type to MANPAGE/CATPAGE rather than
0/1.
2022-01-16 Colin Watson <cjwatson@debian.org>
Update translation files
* po/man-db.pot, po/*.po: Update.
2022-01-16 Colin Watson <cjwatson@debian.org>
Fix build system following changes to include/*.h
* Makefile.am (noinst_HEADERS): Add include/comp_src.h and
include/manconfig.h.
* lib/Makefile.am (libman_la_CPPFLAGS): Replace
-I$(top_builddir)/include with -I$(top_srcdir)/include.
* libdb/Makefile.am (libmandb_la_CPPFLAGS): Likewise.
* src/Makefile.am (AM_CPPFLAGS): Likewise.
* src/tests/Makefile.am (AM_CPPFLAGS): Likewise.
2022-01-16 Colin Watson <cjwatson@debian.org>
Remove Checker support
The GNU Checker package was last released in 2005, and its web page
(https://www.gnu.org/software/checker/) says that it has been
decommissioned in favour of Valgrind.
* include/manconfig.h (chkr_garbage_detector): Remove.
* src/man.c (main): Remove call to chkr_garbage_detector.
* src/mandb.c (main): Likewise.
* src/whatis.c (search): Likewise.
2022-01-16 Colin Watson <cjwatson@debian.org>
Remove obsolete include/README
* include/README: Remove; it claimed that this directory contains files
created by configure, which is no longer true, and it said nothing else
useful.
* Makefile.am (dist_noinst_DATA): Remove include/README.
2022-01-16 Colin Watson <cjwatson@debian.org>
Stop generating include/*.h from configure
This was inconvenient when making changes to those central header files.
All `configure`-generated preprocessor symbols are now in `config.h`.
* configure.ac: Define various PROG_* symbols. Remove AC_SUBST calls
for compressors and decompressors.
(AC_CONFIG_FILES): Remove include/comp_src.h and include/manconfig.h.
* m4/man-arg-override-dir.m4: Define OVERRIDE_DIR symbol.
* include/manconfig.h.in: Rename to ...
* include/manconfig.h: ... this. Remove PROG_*, OVERRIDE_DIR, and
COMPRESS_EXT definitions.
* include/comp_src.h.in: Rename to ...
* include/comp_src.h: ... this.
* README.md: Update references to include/manconfig.h.
* .gitignore: Remove include/*.h.
2022-01-16 Colin Watson <cjwatson@debian.org>
Rename program preprocessor symbols to PROG_*
This is mainly in order to avoid potential confusion with `PIC` (defined
when building position-independent code), but I renamed all these
variables for consistency.
* include/manconfig.h.in (PAGER, CAT, WEB_BROWSER, TR, GREP, TROFF,
NROFF, EQN, NEQN, TBL, COL, VGRIND, REFER, GRAP, PIC, COMPRESSOR,
GUNZIP, UNCOMPRESS, BUNZIP2, UNLZMA, UNXZ, LZIP, UNZSTD): Rename to ...
(PROG_PAGER, PROG_CAT, PROG_BROWSER, PROG_TR, PROG_GREP, PROG_TROFF,
PROG_NROFF, PROG_EQN, PROG_NEQN, PROG_TBL, PROG_COL, PROG_VGRIND,
PROG_REFER, PROG_GRAP, PROG_PIC, PROG_COMPRESSOR, PROG_GUNZIP,
PROG_UNCOMPRESS, PROG_BUNZIP2, PROG_UNLZMA, PROG_UNXZ, PROG_LZIP,
PROG_UNZSTD): ... these (respectively). Update all references.
2022-01-16 Colin Watson <cjwatson@debian.org>
Move lexgrog-related bits out of manconfig.h
It's generally cleaner for things like this to be in a dedicated header
file.
* include/manconfig.h.in (struct lexgrog, find_name,
find_name_decompressed): Move to ...
* src/lexgrog.h: ... here (new file). Simplify declarations slightly.
* include/manconfig.h.in (lexgrog filter enum): Move to ...
* src/lexgrog.l: ... here.
* src/Makefile.am (lexgrog_SOURCES, mandb_SOURCES): Add lexgrog.h.
* src/check_mandirs.c, src/lexgrog.l, src/lexgrog_test.c,
src/straycats.c: Include lexgrog.h.
2022-01-16 Martin <spleefer90@gmail.com>
man-db.timer: Use RandomizedDelaySec Avoids congesting resources, otherwise this runs daily at 12:00 and 00:00 https://www.freedesktop.org/software/systemd/man/systemd.timer.html
2022-01-09 Colin Watson <cjwatson@debian.org>
Recognize Arabic and Persian translations of NAME
* src/lexgrog.l (ar_name, fa_name): Add.
(name): Add ar_name and fa_name.
* NEWS.md: Document this.
2022-01-09 Colin Watson <cjwatson@debian.org>
Note Macedonian support
* src/lexgrog.l: Note that bg_name also works for mk (Macedonian).
2022-01-09 Colin Watson <cjwatson@debian.org>
Downgrade "malformed .lf request" warning to debug
Fixes Debian bug #998426.
* src/zsoelim.l (<lfnumber,lfname>.): Downgrade and rephrase message,
since *roff arithmetic expressions are valid here and we can't
reasonably parse them.
* NEWS.md: Document this.
2022-01-09 Colin Watson <cjwatson@debian.org>
NEWS.md: Fix rendering with some parsers
2022-01-09 Colin Watson <cjwatson@debian.org>
Use MAYBE_UNUSED rather than _GL_UNUSED
We should be using the public name from Gnulib's `attribute.h`.
* lib/orderfiles.c (order_files) [!HAVE_LINUX_FIEMAP_H &&
!HAVE_POSIX_FADVISE]: Use MAYBE_UNUSED rather than _GL_UNUSED.
* lib/sandbox.c (_sandbox_load) [!HAVE_LIBSECCOMP]: Likewise.
* lib/security.c (drop_privs): Likewise.
* libdb/db_ndbm.c (unsorted_nextkey): Likewise.
* src/accessdb.c (help_filter): Likewise.
* src/check_mandirs.c (chown_if_possible) [!MAN_OWNER]: Likewise.
* src/convert.c (close_conv_to_locale): Likewise.
* src/decompress.c (decompress_zlib): Likewise.
* src/lexgrog_test.c (help_filter): Likewise.
* src/man.c (help_filter, squeeze_blank_lines, disable_hyphenation,
disable_justification): Likewise.
* src/manconv.c (manconv): Likewise.
* src/manp.c (free_config_file): Likewise.
* src/tests/fspause.c (main): Likewise.
* src/whatis.c (help_filter): Likewise.
* src/zsoelim_main.c (parse_opt): Likewise.
2022-01-09 Colin Watson <cjwatson@debian.org>
lexgrog: Produce output in the user's locale
Fixes Debian bug #970482.
* src/whatis.c (simple_convert): Move to ...
* src/convert.c: ... here (new file). Rename to convert_to_locale, and
automatically handle setup/teardown of the iconv descriptor.
* src/convert.h: New file.
* src/whatis.c (display): Use convert_to_locale instead of
simple_convert.
(main): Remove setup/teardown of iconv descriptor, now handled
automatically by convert_to_locale.
* src/lexgrog_test.c (main): Convert name and whatis to the user's
locale.
* src/Makefile.am (lexgrog_SOURCES, whatis_SOURCES): Add convert.c and
convert.h.
* NEWS.md: Document this.
2022-01-03 Colin Watson <cjwatson@debian.org>
Add man-pages(7) reference to man(1)
Fixes Debian bug #974174.
* man/man1/man.man1 (DESCRIPTION): Add man-pages(7) reference to
description of section 7.
* man/po4a/po/man-db-manpages.pot, man/po4a/po/*.po: Update.
* NEWS.md: Document this.
2022-01-03 Colin Watson <cjwatson@debian.org>
Document MAN_DISABLE_SECCOMP and PIPELINE_DEBUG
Fixes Debian bug #941622.
* man/man1/man.man1 (ENVIRONMENT): Document MAN_DISABLE_SECCOMP and
PIPELINE_DEBUG.
* man/po4a/po/man-db-manpages.pot, man/po4a/po/*.po: Update.
* NEWS: Document this.
2022-01-03 Colin Watson <cjwatson@debian.org>
NEWS: Document previous commit
2022-01-03 Colin Watson <cjwatson@debian.org>
Reduce overhead of MAN_DISABLE_SECCOMP=1
If MAN_DISABLE_SECCOMP=1 is set (or if seccomp is otherwise
unavailable), then there's no need to call seccomp_init and friends,
which can have significant overhead even if we never actually load the
resulting filter.
Pointed out by Steinar H. Gunderson in https://bugs.debian.org/1003089.
* lib/sandbox.c (make_seccomp_filter): Return NULL early if
can_load_seccomp returns false.
(_sandbox_load): Return early if the relevant context is NULL.
(sandbox_free): Only call seccomp_release if the relevant context is
non-NULL.
2022-01-03 Colin Watson <cjwatson@debian.org>
Indicate that merge requests are preferred
* docs/HACKING.md (Sending patches): Describe merge request workflow and
indicate that it is preferred.
2022-01-03 Colin Watson <cjwatson@debian.org>
Reformat hacking documentation as Markdown
* docs/HACKING: Move to ...
* docs/HACKING.md: ... here. Reformat as Markdown.
* docs/Makefile.am (dist_noinst_DATA): Replace HACKING with HACKING.md.
2022-01-03 Colin Watson <cjwatson@debian.org>
Add release automation
When a tag is pushed to GitLab, upload the bootstrapped source tarball
to the package registry, and create a release in GitLab associated with
the tag.
* .gitlab-ci.yml (stages): Remove test, since it had no jobs. Add
upload and release.
(build-distcheck:script): Configure with --enable-maintainer-mode, to
ensure that flex-generated scanners are fresh.
(upload, release): New jobs.
* release.sh: Remove. GitLab CI handles building releases now.
* Makefile.am (EXTRA_DIST): Remove release.sh.
* docs/HACKING: Update for GitLab-based release process.
2022-01-03 Colin Watson <cjwatson@debian.org>
Reformat release notes as Markdown
* NEWS: Move to ...
* NEWS.md: ... here. Reformat as Markdown.
* Makefile.am (dist_noinst_DATA): Remove NEWS; Automake automatically
includes this file (or NEWS.md) in the distribution without help.
* README.md, docs/HACKING: Refer to NEWS.md instead of NEWS.
2022-01-02 Colin Watson <cjwatson@debian.org>
Remove superfluous quotes
* Makefile.am (gen_start_date): Remove superfluous quotes.
2022-01-02 Colin Watson <cjwatson@debian.org>
Add build-distcheck CI artifact
This should eventually allow publishing release tarballs built by a CI
process rather than on my laptop.
* .gitlab-ci.yml (variables): Set GIT_DEPTH to 0; we need full history
in order to build the ChangeLog file.
(bootstrap:before_script): Add wget, needed to fetch Gnulib PO files.
(build-distcheck:before_script): Add git, needed by gitlog-to-changelog.
(build-distcheck:artifacts): Add bootstrapped/*.tar.xz.
2022-01-02 Colin Watson <cjwatson@debian.org>
Switch CI image to debian:unstable
This gives us newer versions of various dependencies such as the
autotools.
* .gitlab-ci.yml (default:image): Switch from gcc to debian:unstable.
(pre-commit:before_script, bootstrap:before_script): Explicitly install
git.
2022-01-02 Colin Watson <cjwatson@debian.org>
Pacify gcc -fanalyzer in manconv
* src/manconv_main.c (main): Assert that from_code is non-NULL; this is
guaranteed by the argp state machine, but the compiler can't prove that.
2022-01-02 Colin Watson <cjwatson@debian.org>
Fix crash in globbing if run with no arguments
* src/globbing_test.c (parse_opt): Emit a usage message if there are no
non-option arguments.
(main): Assert that remaining_args is non-NULL; this is now guaranteed
by the argp state machine, but the compiler can't prove that.
* NEWS: Document this.
2022-01-02 Colin Watson <cjwatson@debian.org>
Pacify gcc -fanalyzer in catman
It isn't actually possible for sections to be NULL after argp parsing
has finished, but "gcc -fanalyzer" can't easily determine that, and it's
easy enough to arrange for it not to matter.
* src/catman.c (main): Handle case where sections is NULL.
2022-01-02 Colin Watson <cjwatson@debian.org>
Pacify gcc -fanalyzer in some database functions
In GCC 11.2.0, -fanalyzer seems to get confused by copies by assignment
of "struct datum", and thinks that there are use-after-free or
double-free possibilities with multiple loop iterations. These seem to
be false positives, so ignore them for now.
* libdb/db_lookup.c (dblookup_pattern): Ignore false use-after-free
diagnostic.
* src/accessdb.c (main): Ignore false double-free diagnostics.
* src/catman.c (parse_for_sec): Ignore false use-after-free diagnostics.
* src/check_mandirs.c (sanity_check_db): Ignore false double-free
diagnostics.
(purge_pointers, purge_missing): Ignore false use-after-free
diagnostics.
* src/whatis.c (do_apropos): Ignore false use-after-free and double-free
diagnostics.
2022-01-02 Colin Watson <cjwatson@debian.org>
Pacify gcc -fanalyzer in dbdelete
The refs list can't in fact be empty by this point (because we checked
earlier that we could look up this_ref in it), but it's hard for "gcc
-fanalyzer" to prove that, so help it understand that multi_content can
never end up being NULL.
* libdb/db_delete.c (dbdelete): Initialize multi_content before looping
over refs.
2022-01-02 Colin Watson <cjwatson@debian.org>
Assert that some xasprintf calls return non-NULL
"gcc -fanalyzer" notices that xasprintf can return NULL in some
situations (string length > INT_MAX, invalid format string, or multibyte
conversion error), and that we weren't handling this in various cases
where we use the return value in contexts that require non-NULL values.
The situations seem obscure enough for simple asserts to be appropriate.
* lib/pathsearch.c (pathsearch): Assert that xasprintf returns non-NULL.
* lib/tempfile.c (create_tempdir): Likewise.
* lib/util.c (remove_directory): Likewise.
* libdb/db_lookup.c (make_multi_key): Likewise.
* libdb/db_store.c (make_content, dbstore): Likewise.
* src/check_mandirs.c (add_dir_entries, fix_permissions_tree): Likewise.
* src/compression.c (comp_file): Likewise.
* src/globbing.c (look_for_file): Likewise.
* src/man.c (main): Likewise.
* src/mandb.c (mandb, purge_catsubdirs): Likewise.
* src/manp.c (pathappend): Likewise.
* src/ult_src.c (find_include): Likewise.
* src/whatis.c (use_grep): Likewise.
* src/zsoelim.l (zsoelim_open_file): Likewise.
2022-01-02 Colin Watson <cjwatson@debian.org>
Fix path searching crash if getcwd fails
xgetcwd can return NULL if getcwd returns NULL for reasons other than
ENOMEM, so we should handle this. Found by "gcc -fanalyzer".
* lib/pathsearch.c (pathsearch, directory_on_path): Emit a fatal error
if xgetcwd returns NULL.
* po/POTFILES.in: Add lib/pathsearch.c.
* NEWS: Document this.
2022-01-02 Colin Watson <cjwatson@debian.org>
Update to Gnulib 20211231
In line with Gnulib, we now require Autoconf 2.64.
* bootstrap: Sync to Gnulib 14db2b71b5bd05b94ec6126617fd32cd5f1016cd.
* bootstrap.conf (GNULIB_REVISION): Set to
14db2b71b5bd05b94ec6126617fd32cd5f1016cd.
(buildreq): Bump required autoconf version to 2.64.
* configure.ac (AC_PREREQ): Bump to 2.64.
(--enable-gcc-warnings): New option, based on code in coreutils. Use
this to enable -fanalyzer only if --enable-gcc-warnings=expensive is
used; it's useful but slow.
* include/manconfig.h.in (create_tempdir, appendstr): Move NODISCARD to
the start of these function declarations, required by draft C2x.
* patches/argp-domain.patch: Rebase.
* NEWS: Document this.
2022-01-02 Colin Watson <cjwatson@debian.org>
Fix NULL dereference in get_locale_charset callers
* lib/encodings.c (get_canonical_charset_name): Declare argument and
return value as non-NULL.
(get_locale_charset): Declare return value as non-NULL. Fall back to
"ANSI_X3.4-1968" if locale_charset returned NULL or the empty string.
2022-01-02 Colin Watson <cjwatson@debian.org>
Trim down direct Gnulib dependencies a little
* bootstrap.conf (gnulib_modules): Add c99 (already used indirectly, but
seems like a good idea to request directly now). Remove getopt-gnu,
lock, and unsetenv, none of which we use directly. Replace fcntl with
fcntl-h and signal with signal-h, since we use the corresponding header
files directly but not the corresponding functions.
* .gitignore: Remove lib/getopt.h.
2022-01-01 Colin Watson <cjwatson@debian.org>
Fix warnings with Autoconf >= 2.70
* configure.ac (AC_PROG_LEX): Add noyywrap argument (new in Autoconf
2.70, but ignored in previous versions).
* m4/man-bdb.m4 (MAN_CHECK_BDB): Autoconf 2.70 warns about non-literal
arguments to AC_CHECK_HEADERS. Refactor loops so that the header and
library names are visible to m4.
2022-01-01 Colin Watson <cjwatson@debian.org>
Add an SC_ALLOW_PERMISSIVE macro
This plays slightly better with clang-format.
* lib/sandbox.c (SC_ALLOW_PERMISSIVE): New macro.
(make_seccomp_filter): Use SC_ALLOW_PERMISSIVE instead of forms such as
"if (permissive) SC_ALLOW (name);".
2022-01-01 Colin Watson <cjwatson@debian.org>
Use Gnulib attribute.h properly
manconfig.h previously used _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM without
first including "stdio.h", which caused build failures. We should be
using the public names anyway.
* bootstrap.conf (gnulib_modules): Add attribute.
* include/manconfig.h.in (create_tempdir, appendstr): Use NODISCARD
rather than _GL_ATTRIBUTE_NODISCARD.
* include/manconfig.h.in (debug, debug_error): Use ATTRIBUTE_FORMAT
rather than _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM.
* lib/debug.c (vdebug): Likewise.
* include/manconfig.h.in (appendstr): Use ATTRIBUTE_SENTINEL rather than
_GL_ATTRIBUTE_SENTINEL.
* lib/encodings.c (get_page_encoding): Use ATTRIBUTE_MALLOC rather than
_GL_ATTRIBUTE_MALLOC.
* lib/util.c (trim_spaces): Likewise.
* lib/encodings.c (is_roff_device, get_output_encoding,
get_less_charset, get_jless_charset): Use ATTRIBUTE_PURE rather than
_GL_ATTRIBUTE_PURE.
* lib/glcontainers.c (string_equals, string_hash): Likewise.
* lib/security.c (running_setuid): Likewise.
* src/manp.c (canonicalized_path_equals, canonicalized_path_hash):
Likewise.
* src/whatis.c (match): Likewise.
* libdb/db_lookup.c (dash_if_unset): Use ATTRIBUTE_CONST rather than
_GL_ATTRIBUTE_CONST.
* libdb/db_store.c (compare_ids): Likewise.
2022-01-01 Colin Watson <cjwatson@debian.org>
Reduce indentation depth using C99
* src/man.c (parse_opt): Remove an enclosing block and associated
indentation level, since C99 allows mixing declarations and code.
2022-01-01 Colin Watson <cjwatson@debian.org>
Pacify pre-commit
* lib/mp.h: Remove trailing whitespace.
2022-01-01 Colin Watson <cjwatson@debian.org>
Simplify interface to container iterator macros
The Gnulib container iterator macros (GL_LIST_FOREACH_* and
GL_MAP_FOREACH_*) have to run code both before and after a chunk of
user-supplied code. This previously required a START/END macro pair
used something like this:
GL_LIST_FOREACH_START (names, name) {
...
} GL_LIST_FOREACH_END (names);
This doesn't look natural in C, and so it was easy to get it wrong.
It's possible to do better, at the cost of some tricky macros.
Fortunately, Simon Tatham has already done the hard work in
https://www.chiark.greenend.org.uk/~sgtatham/mp/, and the necessary
header file is MIT-licensed, so we can incorporate it. Now these
iterator macros are used more like this, which is a much more natural C
style:
GL_LIST_FOREACH (names, name) {
...
}
* lib/mp.h: New file.
* lib/Makefile.am (libman_la_SOURCES): Add mp.h.
* lib/README: Add mp.h. Rephrase introductory text about licensing to
account for an MIT-licensed file.
* lib/glcontainers.h (GL_LIST_FOREACH_START, GL_LIST_FOREACH_END):
Rewrite as ...
(GL_LIST_FOREACH): ... this. Update all callers.
(GL_MAP_FOREACH_START, GL_MAP_FOREACH_END): Rewrite as ...
(GL_MAP_FOREACH): ... this. Update all callers.
* NEWS, README.md, docs/HACKING: Document C99 compiler requirement.
2022-01-01 Colin Watson <cjwatson@debian.org>
Simplify some GCC attribute handling
* include/manconfig.h.in (ATTRIBUTE_FORMAT_PRINTF,
ATTRIBUTE_WARN_UNUSED_RESULT, ATTRIBUTE_SENTINEL): Remove in favour of
Gnulib-provided macros.
(create_tempdir, appendstr): Use _GL_ATTRIBUTE_NODISCARD rather than
ATTRIBUTE_WARN_UNUSED_RESULT.
(debug, debug_error): Use _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM rather than
ATTRIBUTE_FORMAT_PRINTF.
(appendstr): Use _GL_ATTRIBUTE_SENTINEL rather than ATTRIBUTE_SENTINEL.
* lib/debug.c (vdebug): Use _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM rather
than ATTRIBUTE_FORMAT_PRINTF.
2022-01-01 Colin Watson <cjwatson@debian.org>
Introduce pre-commit
* .pre-commit-config.yaml: New file.
* .gitlab-ci.yml (stages): Add bootstrap.
(pre-commit): New job.
(bootstrap): Move to bootstrap stage.
Remove trailing whitespace from all files.
2022-01-01 Colin Watson <cjwatson@debian.org>
Update licence texts
There are no substantive licensing changes here, only formatting
adjustments and referring to the "GNU Lesser General Public License"
rather than the "GNU Library General Public License".
* docs/COPYING: Update from current contents of
https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
* docs/COPYING.LIB: Update from current contents of
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt.
2021-12-31 Colin Watson <cjwatson@debian.org>
Document migration to GitLab
* README.md: Add link to GitLab repository.
(Contacting the maintainer): Add GitLab issues link.
* docs/HACKING (Revision control): Update for GitLab.
* man/man1/apropos.man1 (BUGS): Add GitLab issues link.
* man/man1/lexgrog.man1 (BUGS): Likewise.
* man/man1/man-recode.man1 (BUGS): Likewise.
* man/man1/man.man1 (BUGS): Likewise.
* man/man1/manconv.man1 (BUGS): Likewise.
* man/man1/manpath.man1 (BUGS): Likewise.
* man/man1/whatis.man1 (BUGS): Likewise.
* man/man1/zsoelim.man1 (BUGS): Likewise.
* man/man5/manpath.man5 (BUGS): Likewise.
* man/man8/accessdb.man8 (BUGS): Likewise.
* man/man8/catman.man8 (BUGS): Likewise.
* man/man8/mandb.man8 (BUGS): Likewise.
* NEWS: Document this.
2021-11-17 Colin Watson <cjwatson@debian.org>
Reformat README
* README: Move to ...
* README.md: ... here. Reformat as Markdown.
* Makefile.am (dist_noinst_DATA): Replace README with README.md.
* docs/INSTALL.quick: Likewise.
2021-11-16 Colin Watson <cjwatson@debian.org>
Add .gitlab-ci.yml
2021-09-19 Colin Watson <cjwatson@debian.org>
Update some obsolete Autoconf macros
* configure.ac: Replace AC_GNU_SOURCE and AC_ISC_POSIX with
AC_USE_SYSTEM_EXTENSIONS. Replace AC_CONFIG_HEADER with
AC_CONFIG_HEADERS. Remove an obsolete comment.
2021-09-19 Colin Watson <cjwatson@debian.org>
Stop using obsolete AC_TRY_LINK
This has been obsolete since Autoconf 2.55. Use its AC_LINK_IFELSE
expansion instead.
* m4/man-bdb.m4 (MAN_CHECK_BDB): Expand AC_TRY_LINK call using
AC_LINK_IFELSE.
2021-09-18 Mario Blättermann <mario.blaettermann@gmail.com>
Update German manual page translation
* man/po4a/po/de.po: Update from Translation Project.
2021-09-18 Mario Blättermann <mario.blaettermann@gmail.com>
Update German manual page translation
* man/po4a/po/de.po: Update from Translation Project.
2021-07-11 Colin Watson <cjwatson@debian.org>
Fix mishandling of suffix matches in manpath
Fixes Savannah bug #60906.
* src/manp.c (pathappend): strstr might return matches that are not at
the start of a manpath element, resulting in incorrect truncation. Skip
any such matches.
2021-02-08 Colin Watson <cjwatson@debian.org>
Release man-db 2.9.4
2021-02-08 Colin Watson <cjwatson@debian.org>
Fix distribution of Romanian manual page translation
Accidentally omitted from 1c7b46aecbed76c9833e0a5c833fc2ffd1a7a85a.
* man/Makefile.am (DIST_SUBDIRS): Add ro.
2021-02-08 Мирослав Николић <miroslavnikolic@rocketmail.com>
Update Serbian manual page translation
* man/po4a/po/sr.po: Update from Translation Project.
2020-12-11 Mario Blättermann <mario.blaettermann@gmail.com>
Update German manual page translation
* man/po4a/po/de.po: Update from Translation Project.
2020-09-13 Colin Watson <cjwatson@debian.org>
Handle \[en] escapes in NAME section
Fixes Debian bug #970122.
* src/lexgrog.l (MAN_NAME): Treat "\[en]" (and similar) as another
synonym for "\-", and thus as a separator. (This spelling is
groff-specific; the older "\(en" spelling was already accepted.)
* NEWS: Document this.
2020-08-22 Colin Watson <cjwatson@debian.org>
Fix gcc -Wzero-length-bounds warning
* lib/orderfiles.c (order_files): Avoid accessing an element of a
zero-length array.
2020-08-22 S. Gilles <sgilles@umd.edu>
Allow clock_gettime64; return ENOSYS so libcs can engage fallbacks
libcs such as musl expect ENOSYS to be returned (not EPERM) in their
fallback code, so change the seccomp filter to be more agreeable to
them.
At the same time, clock_gettime is permitted in the filter, so permit
clock_gettime64 as well -- it will be needed by 2038 in any case.
* lib/sandbox.c (make_seccomp_filter): Set default action to
SCMP_ACT_ERRNO (ENOSYS). Allow clock_gettime64.
* NEWS: Document this.
2020-07-04 Colin Watson <cjwatson@debian.org>
Add Romanian manual page translation
* man/po4a/po/ro.po: New from Translation Project (thanks, Florentina
Mușat).
* configure.ac (AC_CONFIG_FILES): Add man/ro/Makefile.
* man/LINGUAS.po4a: Add ro.
* man/Makefile.am (DIST_SUBDIRS): Add ro.
* man/ro/Makefile.am, man/ro/translator.add: New files.
* man/po4a/Makefile.am (POFILES): Add po/ro.po.
* man/po4a/po4a.cfg (po4a_langs): Add ro.
* man/THANKS: Update translator credit.
* .gitignore: Add man/ro/man1, man/ro/man5, and man/ro/man8.
2020-07-04 Colin Watson <cjwatson@debian.org>
Remove "Type" column from DB table in mandb(8)
The database types table in mandb(8) has always been a bit
dubiously-placed; it's really more about how man-db is configured, and
as such makes more sense in manual/db.me (which indeed has an extended
version of the same table). It causes particular problems in translated
versions of this page, where it's very easy for it to become too wide
and cause "make check" failures.
A proper fix for this would probably require updating existing
translations, but an easy improvement is to remove the "Type" column: it
has negligible relevance here, and removing it makes it much easier for
translated versions to stay within page width limits.
* man/man8/mandb.man8 (DATABASE CACHES): Remove "Type" column from
table.
2020-07-02 Colin Watson <cjwatson@debian.org>
Recognise Romanian translations of NAME
* src/lexgrog.l (ro_name): Add.
(name): Add ro_name.
* NEWS: Document this.
2020-06-24 Florentina Mușat <florentina.musat.28@gmail.com>
Update Romanian translation
* po/ro.po: Update from Translation Project.
* man/THANKS: Add translator credit.
2020-06-22 Colin Watson <cjwatson@debian.org>
Release man-db 2.9.3
2020-06-22 Colin Watson <cjwatson@debian.org>
Avoid po4a confusion with \c
po4a >= 0.58 (I think) changes its handling of \c slightly, resulting in
incorrect output for the admittedly awkward uses of \c in man(1).
Rearrange markup to avoid this.
* man/man1/man.man1 (OVERVIEW): Recast description of the syntax of
locale environment variables using \f[BIR] rather than .B/.RI and \c.
(Controlling formatted output): Coalesce markup for the default prompt
into a single .BI macro, avoiding the need for \c. Unfuzzy most
translations.
* NEWS: Document this.
2020-06-22 Colin Watson <cjwatson@debian.org>
Fix po4a version comparison
po4a's versions don't quite conform to Perl's standard versioning
arrangements, producing very confusing results when trying to compare
two-component and three-component versions (because "0.47" is equivalent
to "v0.470.0"). Perhaps we should use some other version comparison
system instead, but in the meantime patch things up so that what we
currently use behaves more sensibly.
* man/po4a/Locale/Po4a/Manext.pm (_parse_version): New subroutine.
(shiftline, pushline, translate): Use _parse_version, and always use a
leading "v" on the right-hand side.
2020-06-01 Colin Watson <cjwatson@debian.org>
Clarify description of zstd in configure
Suggested by crabbed halo ablution in Savannah bug #57558.
* configure.ac: Describe zstd as "LZ77/entropy-coding compression
utility".
2020-06-01 Colin Watson <cjwatson@debian.org>
Release man-db 2.9.2
2020-06-01 Colin Watson <cjwatson@debian.org>
Update to Gnulib 20200531
* bootstrap: Sync to Gnulib d4429157c13b49d1749f5ea18fb30e24ffa646aa.
* bootstrap.conf (GNULIB_REVISION): Set to
d4429157c13b49d1749f5ea18fb30e24ffa646aa.
2020-06-01 Bernhard Rosenkränzer <bero@lindev.ch>
Add support for zstd-compressed manual pages
* configure.ac: Check for zstd.
* include/comp_src.h.in (comp_list): Add zstd.
* include/manconfig.h.in: Define UNZSTD.
* NEWS: Document this.
2020-05-31 Colin Watson <cjwatson@debian.org>
Fix configure logic for enabling COMP_CAT
Only enable COMP_CAT if a compressor is defined. (We don't have all
possible decompression utilities set up to be compressors too.)
* configure.ac: Only enable COMP_CAT if $compressor is non-empty.
2020-05-31 Colin Watson <cjwatson@debian.org>
Make gxditview work with seccomp sandbox
"man -X" and friends used to work by running groff with -X, causing it
to run gxditview itself. This didn't work with the seccomp sandbox: the
sorts of system calls that a text processor needs to make are not very
much related to the sorts of system calls that an X client needs to
make.
Instead, run groff with -X -Z to pass the appropriate options to troff
but stop it from running gxditview, and then run gxditview ourselves
without sandboxing. This also lets us set a better window title.
* src/man.c (make_roff_command): In gxditview mode, run groff with -Z as
well as -X.
(make_display_command): In gxditview mode, add an appropriate gxditview
process.
(display): In gxditview mode, call the ordinary "display formatted page"
logic, without saving a cat page.
2020-05-31 Colin Watson <cjwatson@debian.org>
* NEWS: Move misplaced entry to "Fixes".
2020-05-31 Colin Watson <cjwatson@debian.org>
Fix document font size for -X75-12 and -X100-12
Reported by Konrad Schwarz.
* src/man.c (make_roff_command): Add the "-rS12" argument if the
argument to -X contains "-12".
* NEWS: Document this.
2020-05-17 Stéphane Aulery <lkppo@free.fr>
Update French manual page translation
* man/po4a/po/fr.po: Update from Translation Project.
* man/THANKS: Update translator credit.
2020-04-12 Mario Blättermann <mario.blaettermann@gmail.com>
Update German manual page translation
Fixes Debian bug #955320.
* man/po4a/po/de.po: Update from Translation Project.
2020-04-12 Colin Watson <cjwatson@debian.org>
NEWS: Remove superfluous ")"
2020-04-03 Boyuan Yang <073plan@gmail.com>
Update Simplified Chinese manual page translation
* man/po4a/po/zh_CN.po: Update from Translation Project.
2020-04-02 Мирослав Николић <miroslavnikolic@rocketmail.com>
Update Serbian translation
* po/sr.po: Update from Translation Project.
2020-03-29 Colin Watson <cjwatson@debian.org>
Add bug tracker link to manual pages
Fixes Savannah bug #58039.
* man/man1/apropos.man1 (BUGS), man/man1/lexgrog.man1 (BUGS),
man/man1/man-recode.man1 (BUGS), man/man1/man.man1 (BUGS),
man/man1/manconv.man1 (BUGS), man/man1/manpath.man1 (BUGS),
man/man1/whatis.man1 (BUGS), man/man1/zsoelim.man1 (BUGS),
man/man8/accessdb.man8 (BUGS), man/man8/catman.man8 (BUGS),
man/man8/mandb.man8 (BUGS): New section, containing a link to the bug
tracker.
* man/man5/manpath.man5 (BUGS): Add a link to the bug tracker.
* NEWS: Document this.
2020-03-28 Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
man/man8/*: Fix misuse of two-fonts macros
Correct the misuse of a two-fonts macro, which function is to
1) use the first font for each odd numbered argument and the second
font for all others.
2) join (output) the arguments without an intervening space.
Fixes Debian bug #955187.
* man/man8/accessdb.man8 (OPTIONS): Use a one-font macro when there is
only a single argument.
* man/man8/catman.man8 (OPTIONS): Likewise.
* man/man8/mandb.man8 (OPTIONS): Likewise.
2020-03-28 Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
man/man1/*: Fix misuse of two-fonts macros
Correct the misuse of a two-fonts macro, which function is to
1) use the first font for each odd numbered argument and the second
font for all others.
2) join (output) the arguments without an intervening space.
Fixes Debian bug #955185.
* man/man1/lexgrog.man1 (OPTIONS): Use a one-font macro when there is
only a single argument.
* man/man1/man-recode.man1 (OPTIONS): Likewise.
* man/man1/man.man1 (DESCRIPTION): Likewise.
* man/man1/whatis.man1 (OPTIONS): Likewise.
* man/man1/zsoelim.man1 (DESCRIPTION): Likewise.
2020-02-25 Colin Watson <cjwatson@debian.org>
Release man-db 2.9.1
2020-02-25 Colin Watson <cjwatson@debian.org>
Update to Gnulib 20200224
* bootstrap: Sync to Gnulib d279bc6d9f9323e19ad8c32b6d12ff96dfb0f5ba.
* bootstrap.conf (GNULIB_REVISION): Set to
d279bc6d9f9323e19ad8c32b6d12ff96dfb0f5ba.
(gnulib_modules): Add havelib, needed for AM_GNU_GETTEXT in
configure.ac.
2020-01-27 Colin Watson <cjwatson@debian.org>
Add cat path configuration for /snap/man
Add MANDB_MAP entry mapping the prospective /snap/man directory to
/var/cache/man/snap, as discussed with the snapd team.
* src/man_db.conf.in: Add "MANDB_MAP /snap/man /var/cache/man/snap".
* NEWS: Document this.
2019-12-26 Felipe Castro <fefcas@gmail.com>
Update Esperanto translation
* po/eo.po: Update from Translation Project.
2019-12-26 Sebastian Rasmussen <sebras@gmail.com>
Update Swedish manual page translation
* man/po4a/po/sv.po: Update from Translation Project.
2019-12-26 Sebastian Rasmussen <sebras@gmail.com>
Update Swedish translation
* po/sv.po: Update from Translation Project.
2019-11-23 Colin Watson <cjwatson@debian.org>
Drop fdutimens patch for GNU/Hurd
The bug (https://bugs.debian.org/762677) that this was working around
was fixed in glibc 2.28, or Debian glibc 2.27-2.
* patches/fdutimens-hurd.patch: Remove.
* bootstrap.conf (bootstrap_post_import_hook): Stop applying
patches/fdutimens-hurd.patch.
* Makefile.am (EXTRA_DIST): Remove patches/fdutimens-hurd.patch.
* NEWS: Document this.
2019-10-23 Colin Watson <cjwatson@debian.org>
Release man-db 2.9.0
2019-10-23 Antonio Ceballos Roa <aceballos@gmail.com>
Update Spanish manual page translation
* man/po4a/po/es.po: Update from Translation Project.
2019-10-18 Antonio Ceballos Roa <aceballos@gmail.com>
Update Spanish manual page translation
* man/po4a/po/es.po: Update from Translation Project.
2019-10-10 Mario Blättermann <mario.blaettermann@gmail.com>
Update German manual page translation
* man/po4a/po/de.po: Update from Translation Project.
2019-10-10 Antonio Ceballos Roa <aceballos@gmail.com>
Update Spanish manual page translation
* man/po4a/po/es.po: Update from Translation Project.
2019-10-07 Antonio Ceballos Roa <aceballos@gmail.com>
Update Spanish manual page translation
* man/po4a/po/es.po: Update from Translation Project.
2019-10-05 Antonio Ceballos Roa <aceballos@gmail.com>
Update Spanish manual page translation
* man/po4a/po/es.po: Update from Translation Project.
* man/THANKS: Update translator credit.
2019-10-05 Yuri Kozlov <yuray@komyakino.ru>
Update Russian manual page translation
* man/po4a/po/ru.po: Update from Translation Project.
2019-10-05 Pedro Albuquerque <palbuquerque73@gmail.com>
Update Portuguese manual page translation
* man/po4a/po/pt.po: Update from Translation Project.
2019-10-05 Pedro Albuquerque <palbuquerque73@gmail.com>
Update Portuguese translation
* po/pt.po: Update from Translation Project.
2019-10-05 Rafael Fontenelle <rafaelff@gnome.org>
Update Brazilian Portuguese manual page translation
* man/po4a/po/pt_BR.po: Update from Translation Project.
2019-10-03 Colin Watson <cjwatson@debian.org>
Fix language/territory candidate comparison logic
When I extracted the COMPARE_LOCALE_ELEMENTS macro, I apparently left in
an explicit reference to territory that should have been the "elt"
parameter. As a result, some cases of language and territory comparison
went wrong, in particular resulting in pt_BR users seeing pt pages ahead
of pt_BR pages.
Reported by Rafael Fontenelle.
* src/man.c (compare_candidates): Fix incorrect territory-specific
comparison in COMPARE_LOCALE_ELEMENTS.
* NEWS: Document this.
2019-10-03 Stéphane Aulery <lkppo@free.fr>
Update French translation
* po/fr.po: Update from Translation Project.
* man/THANKS: Add translator credit.
2019-10-03 Mario Blättermann <mario.blaettermann@gmail.com>
Update German translation
* po/de.po: Update from Translation Project.
2019-10-03 Yuri Kozlov <yuray@komyakino.ru>
Update Russian translation
* po/ru.po: Update from Translation Project.
2019-10-03 Boyuan Yang <073plan@gmail.com>
Update Simplified Chinese translation
* po/zh_CN.po: Update from Translation Project.
2019-10-03 Antonio Ceballos Roa <aceballos@gmail.com>
Update Spanish translation
* po/es.po: Update from Translation Project.
* man/THANKS: Add translator credit.
2019-10-03 pan93412 <pan93412@gmail.com>
Update Traditional Chinese translation
* po/zh_TW.po: Update from Translation Project.
2019-10-03 Rafael Fontenelle <rafaelff@gnome.org>
Update Brazilian Portuguese translation
* po/pt_BR.po: Update from Translation Project.
2019-10-01 Colin Watson <cjwatson@debian.org>
Release man-db 2.9.0-pre1
2019-09-30 Colin Watson <cjwatson@debian.org>
Add a new man-recode program
This has an interface designed for bulk conversion, and so can be much
faster than running "man --recode" on each page.
Fixes Debian bug #933576.
* bootstrap.conf (gnulib_modules): Add renameat, tempname, and unlinkat.
* src/man-recode.c: New file.
* src/Makefile.am (bin_PROGRAMS): Add man-recode.
(man_recode_LDADD, man_recode_SOURCES): Add.
* src/tests/man-recode-in-place, src/tests/man-recode-suffix: New files.
* src/tests/Makefile.am (ALL_TESTS): Add man-recode-in-place and
man-recode-suffix.
* .gitignore: Add src/man-recode.
* po/POTFILES.in: Add src/man-recode.c.
* m4/man-trans-subst.m4 (MAN_TRANS_SUBST): Adjust to support program
names containing dashes.
* configure.ac: Add substitutions for man-recode.
* man/man1/man-recode.man1: New file.
* man/man1/man.man1 (Main modes of operation): Add a note to the
description of --recode suggesting man-recode instead.
* man/man1/manconv.man1 (SEE ALSO): Add reference to man-recode(1).
* man/Makefile.am (man1_MANS): Add man1/man-recode.1.
* man/da/Makefile.am (man1_MANS): Likewise.
* man/de/Makefile.am (man1_MANS): Likewise.
* man/es/Makefile.am (man1_MANS): Likewise.
* man/fr/Makefile.am (man1_MANS): Likewise.
* man/id/Makefile.am (man1_MANS): Likewise.
* man/ja/Makefile.am (man1_MANS): Likewise.
* man/nl/Makefile.am (man1_MANS): Likewise.
* man/pl/Makefile.am (man1_MANS): Likewise.
* man/pt/Makefile.am (man1_MANS): Likewise.
* man/pt_BR/Makefile.am (man1_MANS): Likewise.
* man/ru/Makefile.am (man1_MANS): Likewise.
* man/sr/Makefile.am (man1_MANS): Likewise.
* man/sv/Makefile.am (man1_MANS): Likewise.
* man/tr/Makefile.am (man1_MANS): Likewise.
* man/zh_CN/Makefile.am (man1_MANS): Likewise.
* man/po4a/po4a.cfg: Add support for man-recode.
* man/replace.sin.in: Substitute %man_recode% and %thman_recode%.
* NEWS: Document this.
2019-09-30 Colin Watson <cjwatson@debian.org>
manconv: Guess input encoding if necessary
* src/manconv_main.c (args_doc): Mark -f option as optional.
(parse_opt): Don't fail if no input encoding was specified.
(main): If no input encoding was specified, guess it from the file name
in the same way that man does.
* man/man1/manconv.man1 (SYNOPSIS): Mark -f option as optional.
(OPTIONS): Describe new default behaviour for -f.
* configure.ac: Disable -Winline; we don't care about gl_list_add_last
not always being inlined.
* NEWS: Document this.
2019-09-30 Colin Watson <cjwatson@debian.org>
lexgrog, zsoelim: Suppress more compiler warnings
-Wsuggest-attribute=malloc was added in GCC 8, so don't try to ignore it
with earlier versions.
* src/lexgrog.l: Guard '#pragma GCC diagnostic ignored
"-Wsuggest-attribute=malloc"' so that it is only invoked with GCC >= 8.
* src/zsoelim.l: Likewise.
2019-09-11 Colin Watson <cjwatson@debian.org>
apropos(1), whatis(1): Fix typo
Already fixed in man(1) by commit
68ef9f324832c790a7e3565f726fa1bc9a6d0178.
* man/man1/apropos.man1 (ENVIRONMENT): an -> and.
* man/man1/whatis.man1 (ENVIRONMENT): Likewise.
2019-09-09 Colin Watson <cjwatson@debian.org>
man: Accept "page(section)" form on command line
Suggested by Tanguy Ortolo and Paul Wise. Fixes Debian bug #677350.
* src/man.c (split_page_name): Accept "page(section)" form as well as
"page.section".
* src/tests/man-suffixed-extension: Test the "page(section)" form.
* man/man1/man.man1 (SYNOPSIS): Don't mention the "page.section" form
here; it gets too unwieldy to try to express all the possibilities in a
synopsis.
(EXAMPLES): Document "page(section)" form.
(OPTIONS): Hyphenate "Non-argument options" thus.
* NEWS: Document this.
2019-09-08 Colin Watson <cjwatson@debian.org>
Make some debugging output less verbose
Also indent some sections of debugging output, which allows removing
some blank lines.
Fixes Debian bug #863920.
* src/catman.c (main): Remove unnecessary debugging output of manp
before calling create_pathlist.
* src/manp.c (main): Likewise.
* src/mandb.c (main): Likewise.
* src/man.c (main): Remove debugging output of ruid and euid, which was
redundant with init_security. Remove extra newline before "using %s as
pager".
* src/manp.c (describe_flag, print_list): Remove: everything that adds
items to this list already emits a more human-friendly debugging
message. Remove caller of print_list.
(add_sections): Squash debugging output onto one line, and indent it by
two spaces.
(add_def, add_manpath_map, add_mandb_map, add_mandatory): Indent
debugging output by two spaces.
(read_config_file): Remove extra newline after "From the config file
%s:".
(get_manpath_from_path): Remove extra newlines before "path directory
%s" and "adding mandatory man directories".
(add_expanded_dir_to_list): Remove noisy "%s is already in the manpath"
debugging output. Indent "adding %s to manpath" by two spaces.
(add_man_subdirs): Remove noisy "and doesn't have ../man, man,
../share/man, or share/man subdirectories" debugging output.
2019-09-08 Colin Watson <cjwatson@debian.org>
Refactor deduplication in create_pathlist
This is more efficient, and also has the useful side-effect of reducing
noise in debug output.
* src/manp.c (struct canonicalized_path): New structure.
(canonicalized_path_new, canonicalized_path_equals,
canonicalized_path_hash, canonicalized_path_free): New functions.
(add_dir_to_path_list): Canonicalize the given path and (if it exists)
add both the original and canonicalized versions as a pair.
(create_pathlist): Simplify: rather than doing a second quadratic-time
pass to eliminate duplicates, we now avoid inserting them in linear time
as we go along.
2019-09-08 Colin Watson <cjwatson@debian.org>
man(1): Explain interactions between -w/-W and -a
Reported by Bjarni Ingi Gislason. Fixes Debian bug #803712.
* man/man1/man.man1 (Main modes of operation): Explain that the -w and
-W options only print a single match by default, but that -a can be used
to print all matches.
2019-09-08 Colin Watson <cjwatson@debian.org>
Suggest "man man" if run with no arguments
Fixes Debian bug #869798.
* src/man.c (gripe_no_name): Suggest running "man man".
* NEWS: Document this.
2019-09-08 Colin Watson <cjwatson@debian.org>
* NEWS: Document recent manual page improvements.
2019-09-08 Colin Watson <cjwatson@debian.org>
Mention where other manual pages come from
* man/man1/man.man1 (OVERVIEW): Explain that individual manual pages
normally come with whatever they document.
2019-09-08 Colin Watson <cjwatson@debian.org>
Revamp man(1) to be a more accessible introduction
Fixes Savannah bug #53050.
* man/man1/man.man1 (SYNOPSIS): Delete details of most options, as it
had got much too long and indigestible. The OPTIONS section below
remains, and is better-organised and easier to read. Delete the "man
-c" form entirely, as it's only for internal use by catman.
(DESCRIPTION): Move list of default sections to ...
(DEFAULTS): ... here.
(EXAMPLES): Use a real example rather than the peculiar "alias"
terminology for "man -t".
(OVERVIEW): Various minor editorial improvements. Remove discussion of
index database caches: it's mostly irrelevant to users, and is already
better-documented in mandb(8), apropos(1), and whatis(1). Simplify
discussion of where pages are stored. Briefly describe what cat pages
are. Rewrite description of localisation support to read more fluently
and to take into account that most users will already have a suitable
locale set up. Drop discussion of translations of this package's own
messages: this should be standard rather than something that we
explicitly need to call out here, and the term "message catalogues" was
opaque.
(DEFAULTS): Remove discussion of index database caches, as above.
Remove discussion of cat pages, since this is an implementation detail
and confused matters here too much.
(Finding manual pages): Tighten up language in description of
--sections. Simplify description of --update, and tell readers that it
is normally better to run mandb(8) instead.
(FILES): Remove mention of index database caches from here. While
man(1) does use them, they're an implementation detail and are
better-documented elsewhere.
(SEE ALSO): Remove overly-detailed cross-references to setlocale(3),
ascii(7), latin1(7), the man-db manual, and the FSSTND. Add a paragraph
mentioning documentation in other formats, such as info(1) or HTML.
* man/man5/manpath.man5 (FORMAT): Remove stray quote before the FSSTND
keyword.
* man/man8/mandb.man8 (DESCRIPTION): Remove claim that index database
caches are usually maintained by man(1).
* man/man1/man.man1, man/man1/manpath.man1: Use the "..." style of
quoting rather than the `...' style.
2019-09-08 Colin Watson <cjwatson@debian.org>
Improve documentation of MANROFFOPT
Reported by Bjarni Ingi Gislason. Fixes Debian bug #914938.
* man/man1/man.man1 (ENVIRONMENT): Rephrase description of MANROFFOPT to
make it clear that it is added to the formatter's command line, rather
than to man's command line.
2019-09-08 Colin Watson <cjwatson@debian.org>
Remove confusing use of "on-line"
Nowadays "on-line" tends to be understood as "on the internet" rather
than "on a screen", so avoid the term.
Reported by Dan Jacobson. Fixes Debian bug #774402.
* docs/man-db.lsm: Say "system help files" rather than "on-line help
files".
* man/man1/man.man1 (NAME): Say "system reference manuals" rather than
"on-line reference manuals".
* manual/intro.me (Introduction): Say "information" rather than "online
information".
* manual/man_db.me: Say "manual page system" rather than "online manual
page system".
* man/man1/lexgrog.man1 (EXAMPLES): Update examples quoting man(1)'s
description.
* manual/db.me (Example database): Likewise.
* manual/intro.me (Introduction): Likewise.
* src/tests/man-mandatory-manpath: Update test quoting man(1)'s
description.
2019-09-08 Colin Watson <cjwatson@debian.org>
Tidy up formatting of Wilf's name
Based on similar changes elsewhere by Bjarni Ingi Gislason.
* man/man1/lexgrog.man1 (AUTHOR): Protect "." with "\&" if it is
followed by a space and does not mean the end of a sentence.
* man/man1/manpath.man1 (AUTHOR): Likewise.
* man/man1/whatis.man1 (AUTHOR): Likewise.
* man/man1/zsoelim.man1 (AUTHOR): Likewise.
* man/man8/accessdb.man8 (AUTHOR): Likewise.
* man/man8/catman.man8 (AUTHOR): Likewise.
* man/man8/mandb.man8 (AUTHOR): Likewise.
2019-09-08 Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
manpath(1): Correct some typographic mistakes
Fixes Debian bug #927452.
* man/man1/manpath.man1 (DESCRIPTION): Use \(en for a dash where
appropriate.
(OPTIONS): Change .BR to .B if there is only one argument.
2019-09-08 Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
apropos(1): Minor typographic changes
Fixes Debian bug #892421.
* man/man1/apropos.man1 (DESCRIPTION): Use "\e" to print the escape
character instead of "\\" (which is interpreted in copy mode).
(OPTIONS): Change .BR to .B if there is only one argument.
(FILES): Add a space around "|" to increase readability.
(AUTHOR): Protect "." with "\&" if it is followed by a space and does
not mean the end of a sentence.
2019-09-08 Colin Watson <cjwatson@debian.org>
Apply italic corrections
Partly based on suggestions from Bjarni Ingi Gislason in Debian
bug #892421, although I had to take a slightly different approach to
avoid confusing po4a.
* man/man1/apropos.man1 (OPTIONS): Apply italic corrections to
descriptions of --sections and --systems. Simplify three-font handling
for --systems.
* man/man1/man.man1 (Finding manual pages): Likewise.
* man/man1/whatis.man1 (OPTIONS): Likewise.
* man/man1/manpath.man1 (OPTIONS): Apply italic corrections to
description of --systems, and simplify three-font handling.
2019-09-07 Colin Watson <cjwatson@debian.org>
man(1): Adjust description of section 5
* man/man1/man.man1 (DESCRIPTION): Add a comma before "e.g.".
2019-09-07 Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
man(1): Minor typographic changes
Fixes Debian bug #892230.
* man/man1/man.man1 (DESCRIPTION, HISTORY): Protect "." with "\&" if it
is followed by a space and does not mean the end of a sentence.
(EXAMPLES): Use a macro to change to the italic font instead of \fI if
possible. The macros have the italic corrections.
(EXAMPLES, Controlling formatted output, Getting help, SEE ALSO): Change
.BR/.IR to .B/.I if there is only one argument, or else separate the
second argument from the first if needed.
(DEFAULTS): Begin each sentence on a new line.
(FILES): Add a space around "|" to increase readability.
2019-09-07 Colin Watson <cjwatson@debian.org>
Make long lines in man(1) less likely
Fixes part of Debian bug #892230.
* man/man1/man.man1 (DESCRIPTION, ENVIRONMENT): Put the expansion of
%sections% on its own line.
2019-09-07 Colin Watson <cjwatson@debian.org>
Escape %troff% expansion correctly in manual pages
Fixes part of Debian bug #892230.
* configure.ac: Substitute troff_as_troff_input, which is the same as
troff but with suitable escaping so that "groff -mandoc" turns into
"groff \-mandoc".
* man/replace.sin.in (%troff%): Substitute @troff_as_troff_input@ rather
than @troff@.
2019-09-07 Colin Watson <cjwatson@debian.org>
Remove trailing whitespace from manual pages
* man/man1/apropos.man1, man/man1/lexgrog.man1, man/man1/man.man1,
man/man1/manpath.man1, man/man1/whatis.man1, man/man1/zsoelim.man1,
man/man5/manpath.man5, man/man8/accessdb.man8, man/man8/catman.man8,
man/man8/mandb.man8: Remove trailing whitespace.
2019-09-07 Sebastian Rasmussen <sebras@gmail.com>
Fix trivial typo in man manpage
Fixes Savannah bug #48663.
* man/man1/man.man1: an -> and.
2019-09-07 Colin Watson <cjwatson@debian.org>
Remove stray words from man(1)
Reported by Bjarni Ingi Gislason. Fixes Debian bug #939599.
* man/man1/man.man1 (DEFAULTS): Remove two stray words from the
description of how the pager is specified.
2019-09-05 Colin Watson <cjwatson@debian.org>
Adjust encoding declarations when recoding
* lib/encodings.c (check_preprocessor_encoding): Return a modified
encoding declaration in *modified_line if the new to_encoding and
modified_line parameters are non-NULL.
* lib/encodings.h (check_preprocessor_encoding): Update prototype.
* src/man.c (make_roff_command): Pass NULL as to_encoding and
modified_line arguments to check_preprocessor_encoding.
* src/manconv.c (manconv): Output a modified encoding declaration if
necessary.
* src/tests/manconv-coding-tags: Adjust for new expected output. Add a
test for the case where the coding tag matches the target encoding.
* src/tests/manconv-odd-combinations: Adjust for new expected output.
* NEWS: Document this.
2019-09-05 Colin Watson <cjwatson@debian.org>
Give test cases more meaningful names
* src/tests/lexgrog-1: Rename to ...
* src/tests/lexgrog-basic: ... this.
* src/tests/lexgrog-2: Rename to ...
* src/tests/lexgrog-multiple-whatis: ... this.
* src/tests/lexgrog-3: Rename to ...
* src/tests/lexgrog-backslash-dash-rhs: ... this.
* src/tests/man-1: Rename to ...
* src/tests/man-symlinks-with-matching-names: ... this.
* src/tests/man-10: Rename to ...
* src/tests/man-deleted-directory: ... this.
* src/tests/man-11: Rename to ...
* src/tests/man-suffixed-extension: ... this.
* src/tests/man-2: Rename to ...
* src/tests/man-executable-page-on-path: ... this.
* src/tests/man-3: Rename to ...
* src/tests/man-exact-section-matches: ... this.
* src/tests/man-4: Rename to ...
* src/tests/man-mandatory-manpath: ... this.
* src/tests/man-5: Rename to ...
* src/tests/man-so-links-same-section: ... this.
* src/tests/man-6: Rename to ...
* src/tests/man-missing-locales: ... this.
* src/tests/man-7: Rename to ...
* src/tests/man-invalid-db-entry: ... this.
* src/tests/man-8: Rename to ...
* src/tests/man-language-specific-requests: ... this.
* src/tests/man-9: Rename to ...
* src/tests/man-override-dir: ... this.
* src/tests/manconv-1: Rename to ...
* src/tests/manconv-coding-tags: ... this.
* src/tests/manconv-2: Rename to ...
* src/tests/manconv-odd-combinations: ... this.
* src/tests/manconv-3: Rename to ...
* src/tests/manconv-incomplete-char-at-eof: ... this.
* src/tests/mandb-1: Rename to ...
* src/tests/mandb-basic: ... this.
* src/tests/mandb-2: Rename to ...
* src/tests/mandb-regular-file-symlink-changes: ... this.
* src/tests/mandb-3: Rename to ...
* src/tests/mandb-whatis-broken-link-changes: ... this.
* src/tests/mandb-4: Rename to ...
* src/tests/mandb-symlink-beats-whatis-ref: ... this.
* src/tests/mandb-5: Rename to ...
* src/tests/mandb-empty-page: ... this.
* src/tests/mandb-6: Rename to ...
* src/tests/mandb-bogus-symlink: ... this.
* src/tests/mandb-7: Rename to ...
* src/tests/mandb-cachedir-tag: ... this.
* src/tests/whatis-1: Rename to ...
* src/tests/whatis-path-to-executable: ... this.
* src/tests/zsoelim-1: Rename to ...
* src/tests/zsoelim-so-includes: ... this.
* src/tests/Makefile.am (ALL_TESTS): Update.
2019-09-01 Colin Watson <cjwatson@debian.org>
Remove unnecessary PP_COOKIE conditionals
PP_COOKIE is always defined, so there's no need for #ifdefs.
* lib/encodings.c (check_preprocessor_encoding): Remove PP_COOKIE
conditional.
* src/man.c (get_preprocessors_from_file): Likewise.
* src/zsoelim.l (zsoelim_parse_file): Likewise.
2019-08-31 Colin Watson <cjwatson@debian.org>
Remove ability to undefine COMP_SRC
This was a minor optimisation that wasn't worth the extra code
complexity.
* configure.ac (COMP_SRC): Remove.
* include/comp_src.h.in: Remove COMP_SRC conditional. comp_list will
simply contain only the terminal entry if no compressors are configured.
* include/manconfig.h.in: Remove COMP_SRC conditional and comment.
* manual/comp.me (Compressed manual pages): Remove documentation of
COMP_SRC; explain that support depends on the decompressors available at
configure time.
* src/compression.c: Remove COMP_SRC conditional.
(comp_info): Only do the HP-UX check if gunzip is available.
* src/filenames.c (make_filename): Remove parenthetical comment about
COMP_SRC.
(filename_info): Remove COMP_SRC conditionals.
* src/man.c (convert_name): Likewise.
* src/straycats.c (check_for_stray): Likewise.
* src/ult_src.c (ult_src): Likewise.
* NEWS: Document this.
2019-08-31 Colin Watson <cjwatson@debian.org>
Improve list iteration helper
* lib/glcontainers.h (GL_LIST_FOREACH_START): Capture the gl_list_node_t
in each loop iteration.
* src/descriptions_store.c (store_descriptions): Simplify detection of
the last loop iteration.
* src/manconv.c (manconv): Likewise.
* src/manconv_client.c (add_manconv): Likewise.
* src/manp.c (create_pathlist): Simplify manual loop iteration that can
now be expressed using GL_LIST_FOREACH_START/GL_LIST_FOREACH_END.
Simplify detection of the first loop iteration when emitting the final
search path as debugging information.
2019-08-30 Colin Watson <cjwatson@debian.org>
Improve data types in manconv
* src/manconv.c (try_iconv): Change "last" parameter type to bool.
Change types of "to_utf8" and "ignore_errors" to bool.
(manconv): Convert "from" to gl_list.
* src/manconv.h (manconv): Update prototype.
* src/manconv_client.h (struct manconv_codes): Convert "from" to
gl_list.
(free_manconv_codes, add_manconv): Convert "codes->from" to gl_list.
* src/manconv_main.c (from_code, split_codes, parse_opt, main): Convert
to gl_list.
2019-08-26 Colin Watson <cjwatson@debian.org>
Release man-db 2.8.7
2019-08-26 Takeshi Hamasaki <hmatrjp@users.sourceforge.jp>
Update Japanese translation
* po/ja.po: Update from Translation Project.
* man/THANKS: Add translator credit.
2019-08-26 Colin Watson <cjwatson@debian.org>
Order results manually for NDBM as well as GDBM
Commit 3a753221a3dddaf4870a86a4dca4771ed2cd80b3 in 2003 (!) worked
around the fact that GDBM's firstkey/nextkey interface doesn't return
ordered results. However, at least when using GDBM's NDBM compatibility
interface, this may be true for NDBM too. Extend the manual result
ordering code to cover both of these backends.
* libdb/db_gdbm.c (parent_keys, datum_compare, datum_equals, datum_hash,
datum_free, empty_datum, man_gdbm_firstkey, man_gdbm_nextkey,
man_gdbm_close): Move to ...
* libdb/db_xdbm.c (parent_keys, datum_compare, datum_equals, datum_hash,
datum_free, empty_datum, man_xdbm_firstkey, man_xdbm_nextkey,
man_xdbm_close): ... here (new file).
* libdb/db_xdbm.h: New file.
* libdb/db_gdbm.c (unsorted_firstkey, unsorted_nextkey, raw_close): New
functions, wrapping gdbm_firstkey, gdbm_nextkey, and gdbm_close
respectively.
(man_gdbm_firstkey, man_gdbm_nextkey, man_gdbm_close): Add GDBM-specific
wrappers for the generic man_xdbm_* functions.
* libdb/db_ndbm.c (man_ndbm_close): Move NDBM-specific code ...
(raw_close): ... here.
(unsorted_firstkey, unsorted_nextkey): New functions, wrapping
dbm_firstkey and dbm_nextkey respectively.
(man_ndbm_close, man_ndbm_firstkey, man_ndbm_nextkey): Add NDBM-specific
wrappers for the generic man_xdbm_* functions.
* libdb/mydbm.h (man_ndbm_firstkey, man_ndbm_nextkey): Add prototypes.
(MYDBM_FIRSTKEY) [NDBM]: Rewrite in terms of man_ndbm_firstkey.
(MYDBM_NEXTKEY) [NDBM]: Rewrite in terms of man_ndbm_nextkey.
* libdb/Makefile.am (libmandb_la_SOURCES): Add db_xdbm.c and db_xdbm.h.
* NEWS: Document this.
2019-08-25 Colin Watson <cjwatson@debian.org>
Enable many more GCC warnings
* bootstrap.conf (gnulib_modules): Add manywarnings.
* configure.ac: Add gl_MANYWARN_ALL_GCC, with some refinements to
disable -Wsystem-headers and -Wmissing-field-initializers. Define
GNULIB_NO_VLA=1 to avoid tripping over -Wvla.
* src/accessdb.c (help_filter): Disable -Wformat-nonliteral around this
function.
* src/man.c (help_filter): Likewise.
* src/check_mandirs.c (gripe_rwopen_failed, update_db_time): Factor out
EAGAIN || EWOULDBLOCK check to ...
(is_eagain): ... here, with -Wlogical-op disabled.
* src/lexgrog.l, src/zsoelim.l: Disable -Wsuggest-attribute=malloc,
-Wsuggest-attribute=pure, and -Wunused-macros.
2019-08-25 Colin Watson <cjwatson@debian.org>
Pacify gcc -Wnull-dereference
* src/accessdb.c (main): Add an assertion to help the compiler prove
that dbf is non-NULL. (It doesn't know that error (FATAL, ...) is
non-returning.)
2019-08-25 Colin Watson <cjwatson@debian.org>
Add several function attributes suggested by GCC
* lib/debug.c (vdebug): Mark first argument as a printf format string.
* lib/encodings.c (get_page_encoding): Mark as malloc-like.
(is_roff_device, get_output_encoding, get_less_charset,
get_jless_charset): Mark as pure.
* lib/glcontainers.c (string_equals, string_hash): Mark as pure.
* lib/security.c (running_setuid): Mark as pure.
* lib/util.c (trim_spaces): Mark as malloc-like.
* libdb/db_lookup.c (dash_if_unset): Mark as const.
* libdb/db_store.c (compare_ids): Mark as const.
* src/whatis.c (match): Mark as pure.
2019-08-25 Colin Watson <cjwatson@debian.org>
Fix some printf formats
* libdb/db_lookup.c (list_extensions): Format the return value of
gl_list_size using %zu, not %zd.
* src/catman.c (add_arg): Format the return values of MYDBM_DSIZE and
strlen using %zu, not %zd.
(parse_for_sec): Format ARG_MAX - arg_size using %zu, not %zd.
* src/man.c (main): Format ruid and euid using %lu, not %d (cast to
unsigned long since POSIX only says that uid_t is an integer type).
* src/manp.c (describe_flag): Format flag using %u, not %d.
2019-08-25 Colin Watson <cjwatson@debian.org>
Remove several unused macros
* libdb/db_store.c (_): Remove.
* src/compression.c (_): Likewise.
* src/globbing_test.c (_): Likewise.
* src/zsoelim_main.c (_): Likewise.
2019-08-25 Colin Watson <cjwatson@debian.org>
Make a couple of functions static
* lib/orderfiles.c (compare_physical_offsets): Make static.
* src/descriptions.c (page_description_free): Likewise.
2019-08-25 Colin Watson <cjwatson@debian.org>
Move declaration of _nl_msg_cat_cntr to top level
gcc -Wnested-externs warns when it encounters this declaration within a
function.
* include/manconfig.h.in (locale_changed): Move _nl_msg_cat_cntr
declaration to the top level.
2019-08-25 Colin Watson <cjwatson@debian.org>
Add some missing includes
* lib/linelength.c: Include "linelength.h".
* lib/orderfiles.c: Include "orderfiles.h".
2019-08-23 Colin Watson <cjwatson@debian.org>
Simplify some GCC attribute handling
* lib/orderfiles.c (order_files) [!HAVE_LINUX_FIEMAP_H &&
!HAVE_POSIX_FADVISE]: Use _GL_UNUSED rather than ATTRIBUTE_UNUSED.
* lib/sandbox.c (_sandbox_load) [!HAVE_LIBSECCOMP]: Likewise.
* lib/security.c (drop_privs): Likewise.
* src/accessdb.c (help_filter): Likewise.
* src/check_mandirs.c (chown_if_possible): Likewise.
* src/decompress.c (decompress_zlib): Likewise.
* src/lexgrog_test.c (help_filter): Likewise.
* src/man.c (help_filter, squeeze_blank_lines, disable_hyphenation,
disable_justification): Likewise.
* src/manconv.c (manconv): Likewise.
* src/manp.c (free_config_file): Likewise.
* src/tests/fspause.c (main): Likewise.
* src/whatis.c (help_filter): Likewise.
* src/zsoelim_main.c (parse_opt): Likewise.
* include/manconfig.h.in (ATTRIBUTE_UNUSED): Remove in favour of the
shorter _GL_UNUSED.
(ATTRIBUTE_MALLOC): Remove; it was unused.
2019-08-23 Colin Watson <cjwatson@debian.org>
Use C11/Gnulib's _Noreturn
* lib/cleanup.c (sighandler): Declare as _Noreturn.
* src/man.c (gripe_converting_name): Use _Noreturn rather than
ATTRIBUTE_NORETURN.
* include/manconfig.h.in (ATTRIBUTE_NORETURN): Remove.
2019-08-23 Colin Watson <cjwatson@debian.org>
Update to Gnulib 20190821
2019-08-23 Colin Watson <cjwatson@debian.org>
Pass database file name in function parameters
Storing it in a global variable with an unresolved symbol from libmandb
was never very clean, and caused linking complications on some
platforms.
Fixes Savannah bug #56734.
* libdb/mydbm.h (database): Remove external symbol.
* src/accessdb.c: Remove obsolete comment.
* src/catman.c (database): Remove global variable.
(parse_for_sec): Add database parameter. Update all callers.
(main): Declare database locally.
* src/check_mandirs.c (gripe_rwopen_failed, testmandirs, update_db_time,
create_db, update_db, purge_missing): Add database parameter. Update
all callers.
* src/check_mandirs.h (create_db, update_db, purge_missing): Update
prototypes.
* src/mandb.c (database): Remove global variable.
(update_one_file, update_db_wrapper): Add database parameter. Update
all callers.
(mandb, process_manpath): Declare database locally.
* src/straycats.c (straycats): Add database parameter. Update all
callers.
* src/whatis.c (database): Remove global variable.
(search): Declare database locally.
* include/manconfig.h.in (straycats): Update prototype.
* NEWS: Document this.
2019-08-23 Colin Watson <cjwatson@debian.org>
Use MYDBM_FILE->name for error messages
We previously used the global "database" variable, but we were either
also passing a MYDBM_FILE around already or could easily do so, and it's
cleaner to get the file name from there now that it's consistently
available on all backends.
* libdb/db_lookup.c (gripe_corrupt_data): Add dbf parameter. Get file
name from dbf->name rather than from the global database variable.
Update all callers.
(gripe_replace_key, split_data, split_content): Add dbf parameter.
Update all callers.
(dblookup_pattern): Get file name from dbf->name rather than from the
global database variable.
* libdb/db_ver.c (dbver_rd, dbver_wr): Get file name from dbfile->name
rather than from the global database variable.
* libdb/db_storage.h (split_content, gripe_corrupt_data,
gripe_replace_key): Update prototypes.
* src/check_mandirs.c (sanity_check_db): Get file name from dbf->name
rather than from the global database variable.
* src/whatis.c (do_apropos): Likewise.
2019-08-23 Colin Watson <cjwatson@debian.org>
Store database file name alongside its handle
The GDBM backend already did things this way, but it's convenient to do
it the same way for all backends.
Rename libmandb's various backend-specific functions to be uniformly
man_<backend>_<operation>. In the cases of btree and ndbm there was
already no clash with the libraries they depend on, but this makes them
match the gdbm backend.
* libdb/db_btree.c (btree_close): Rename to ...
(man_btree_close): ... this.
(btree_flopen): Rename to ...
(man_btree_open): ... this. Wrap the returned file handle in a
man_btree_wrapper structure that remembers the file name.
(btree_replace): Rename to ...
(man_btree_replace): ... this.
(btree_insert): Rename to ...
(man_btree_insert): ... this.
(btree_fetch): Rename to ...
(man_btree_fetch): ... this.
(btree_exists): Rename to ...
(man_btree_exists): ... this.
(btree_findkey): Rename to ...
(man_btree_findkey): ... this.
(btree_firstkey): Rename to ...
(man_btree_firstkey): ... this.
(btree_nextkey): Rename to ...
(man_btree_nextkey): ... this.
(btree_nextkeydata): Rename to ...
(man_btree_nextkeydata): ... this.
(btree_get_time): Rename to ...
(man_btree_get_time): ... this.
(btree_set_time): Rename to ...
(man_btree_set_time): ... this.
Update all prototypes and callers for all renames.
(man_btree_close, man_btree_replace, man_btree_insert, man_btree_fetch,
man_btree_exists, man_btree_findkey, man_btree_firstkey,
man_btree_nextkey, man_btree_nextkeydata, man_btree_get_time,
man_btree_set_time): Take man_btree_wrapper parameter rather than DB *.
Update all callers.
* libdb/db_ndbm.c (ndbm_flclose): Rename to ...
(man_ndbm_close): ... this.
(ndbm_flopen): Rename to ...
(man_ndbm_open): ... this. Copy the given file name before passing it
to dbm_open, since at least GDBM's compatibility implementation declares
that parameter as non-const. Wrap the returned file handle in a
man_ndbm_wrapper structure that remembers the file name.
(ndbm_get_time): Rename to ...
(man_ndbm_get_time): ... this.
(ndbm_set_time): Rename to ...
(man_ndbm_set_time): ... this.
Update all prototypes and callers for all renames.
(man_ndbm_close, man_ndbm_get_time, man_ndbm_set_time): Take
man_ndbm_wrapper parameter rather than DBM *. Update all callers.
* libdb/mydbm.h (man_ndbm_wrapper): New structure.
(MYDBM_FILE) [NDBM]: Change to man_ndbm_wrapper.
(man_btree_wrapper): New structure.
(MYDBM_FILE) [BTREE]: Change to man_btree_wrapper.
* libdb/db_lookup.c (gripe_lock): Constify filename parameter.
* libdb/db_storage.h (gripe_lock): Update prototype.
2019-08-23 Colin Watson <cjwatson@debian.org>
Recognise eo/ta/uk translations of the NAME section
(Esperanto, Tamil, and Ukrainian.)
* src/lexgrog.l (eo_name, ta_name, uk_name): Add.
* NEWS: Document this.
2019-08-23 Colin Watson <cjwatson@debian.org>
Remove unused sandbox variables
We no longer need these, having moved decompression code out of libman.
* src/accessdb.c, src/catman.c, src/globbing_test.c, src/manpath.c:
Remove "sandbox" global variables.
2019-08-22 Colin Watson <cjwatson@debian.org>
Remove unused linkage from whatis
* src/Makefile.am (whatis_SOURCES): Remove manconv.c and manconv.h.
2019-08-22 Colin Watson <cjwatson@debian.org>
Move decompression code out of libman
Fixes Savannah bug #56734.
* configure.ac: Remove incorrect Darwin workaround.
* lib/decompress.c: Move to ...
* src/decompress.c: ... here.
* lib/decompress.h: Move to ...
* src/decompress.h: ... here.
* lib/Makefile.am (libman_la_SOURCES): Remove decompress.c and
decompress.h.
(libman_la_LIBADD): Remove $(LIBCOMPRESS).
* lib/README: Remove decompress.*.
* lib/encodings.c: Remove unused #include "decompress.h".
* src/Makefile.am (lexgrog_LDADD, man_LDADD, manconv_LDADD, mandb_LDADD,
zsoelim_LDADD): Add $(LIBCOMPRESS).
(lexgrog_SOURCES, man_SOURCES, manconv_SOURCES, mandb_SOURCES,
zsoelim_SOURCES): Add decompress.c and decompress.h.
* NEWS: Document this.
2019-08-22 Colin Watson <cjwatson@debian.org>
Squash warning in order_files stub
* lib/orderfiles.c [!HAVE_LINUX_FIEMAP_H && !HAVE_POSIX_FADVISE]: Mark
dir and basenamesp arguments as unused.
2019-08-22 Colin Watson <cjwatson@debian.org>
Don't save cat pages if --nh/--nj is used
Fixes Savannah bug #55731.
* src/man.c (display): Disable cat pages if --no-hyphenation or
--no-justification is used, in effect defining those not to be part of
the canonical state.
* NEWS: Document this.
2019-08-21 Colin Watson <cjwatson@debian.org>
sandbox: Allow getrandom, used by Hardened Malloc
Fixes Savannah bug #56767.
* lib/sandbox.c (make_seccomp_filter): Allow getrandom.
* NEWS: Document this.
2019-08-21 Colin Watson <cjwatson@debian.org>
NEWS: Document EPERM change
* NEWS: Document change from raising SIGSYS to returning EPERM.
2019-08-21 Colin Watson <cjwatson@debian.org>
sandbox: Reorganise using @system-service set
systemd defines a @system-service set now which covers some of the ones
that were previously isolated here, so reorganise to take account of
that. No functional change.
* lib/sandbox.c (make_seccomp_filter): Reorganise using systemd's new
@system-service set.
2019-08-21 Colin Watson <cjwatson@debian.org>
sandbox: Set default action to EPERM, not TRAP
Returning EPERM rather than raising SIGSYS is no less secure, and it's
more likely that code injected via LD_PRELOAD will be able to recover
from this somehow.
* lib/sandbox.c (make_seccomp_filter): Set default action to
SCMP_ACT_ERRNO (EPERM), not SCMP_ACT_TRAP.
2019-08-14 Colin Watson <cjwatson@debian.org>
sandbox: Allow sendmsg in the ESET case
* lib/sandbox.c (make_seccomp_filter): If libesets_pac.so is preloaded,
then allow sendmsg.
* NEWS: Document this.
2019-08-05 Colin Watson <cjwatson@debian.org>
* Version: 2.8.6.1.
2019-08-04 Colin Watson <cjwatson@debian.org>
Fix missing memory copies in ult_src
Fixes Debian bug #933802.
* src/ult_src.c (ult_src): Copy strings before adding them to trace.
2019-08-03 Colin Watson <cjwatson@debian.org>
* Version: 2.8.6.
2019-08-03 Colin Watson <cjwatson@debian.org>
Update syscall lists from systemd bca5a0eacc
* lib/sandbox.c (make_seccomp_filter): Add rseq (see
https://github.com/systemd/systemd/issues/12127).
2019-05-02 Colin Watson <cjwatson@debian.org>
Improve manual build portability slightly
* manual/Makefile.am ($(MANUAL).pp, .pp.dvi, .pp.ps, .pp.tdvi,
.tdvi.tps, .pp.cat, .pp.html): Use "mv -f" rather than just "mv", since
Automake seems to prefer that for its own rules.
2019-05-02 Colin Watson <cjwatson@debian.org>
Make manual build more robust against failures
Fixes Savannah bug #56254.
* manual/Makefile.am ($(MANUAL).pp, .pp.dvi, .pp.ps, .pp.tdvi,
.tdvi.tps, .pp.cat, .pp.html): Write output to *.new files and rename
into place, so that failures are properly retried in future runs.
2019-03-03 Colin Watson <cjwatson@debian.org>
Avoid configure error message if nroff is broken
* m4/man-gnu-nroff.m4 (MAN_PROG_GNU_NROFF): Adjust test arguments
slightly to avoid a spurious error message if nroff is sufficiently
broken that it doesn't produce numeric output for "\n(.g".
2019-03-03 Colin Watson <cjwatson@debian.org>
Fix warnings when configuring --without-libseccomp
* lib/sandbox.c (_sandbox_load): Mark sandbox and permissive parameters
unused when HAVE_LIBSECCOMP is undefined, to avoid warnings from "gcc
-Wunused-parameter".
2019-03-03 Colin Watson <cjwatson@debian.org>
Add configure option to disable building manual
* m4/man-arg-manual.m4: New file.
* configure.ac: Add MAN_ARG_MANUAL.
* manual/Makefile.am: Perform most rules only if BUILD_MANUAL is true.
* manual/intro.me (Arguments to configure): Add --disable-manual.
* README (Non-generic arguments to configure): Update.
* NEWS: Document this.
2019-03-03 Colin Watson <cjwatson@debian.org>
* NEWS: Document container type changes.
2019-02-05 Colin Watson <cjwatson@debian.org>
Add some missing entries to lib/README
* lib/README: Add glcontainers.*, orderfiles.*, and sandbox.*.
2019-02-05 Colin Watson <cjwatson@debian.org>
Remove pipeline.* from lib/README
It's been a separate library since 2010.
* lib/README: Remove pipeline.*.
2019-02-05 Colin Watson <cjwatson@debian.org>
Inline lower into name_to_key
With only one remaining user, it wasn't pulling its weight.
* libdb/db_lookup.c (name_to_key): Inline the implementation of lower.
* lib/Makefile.am (libman_la_SOURCES): Remove lower.c and lower.h.
* lib/README: Remove lower.*.
* lib/lower.c, lib/lower.h: Remove.
2019-02-05 Colin Watson <cjwatson@debian.org>
Simplify case-insensitivity in word_fnmatch
Using FNM_CASEFOLD saves us from having to lower-case the pattern
manually, and it also fixes the behaviour of "apropos -w" when given a
non-lower-case pattern.
* lib/wordfnmatch.c (word_fnmatch): Use isalpha and FNM_CASEFOLD rather
than manually lower-casing string or expecting pattern to have already
been lower-cased.
* NEWS: Document this.
2019-02-05 Colin Watson <cjwatson@debian.org>
Simplify case-insensitive comparisons in whatis
We can just use strcasecmp and similar functions rather than
lower-casing comparands manually.
In some corner cases this may result in matches that would not
previously have been returned (e.g. "whatis -w" with a non-lower-case
pattern).
* src/whatis.c (parse_name): Use strcasecmp and FNM_CASEFOLD rather than
manually lower-casing dbname or expecting pages to have already been
lower-cased.
(match): Use strcasestr and isalpha rather than manually lower-casing
whatis or expecting page to have already been lower-cased.
(parse_whatis): Remove lowpages parameter; pass pages directly to match
instead.
(do_apropos): Remove lowpages; parse_name and parse_whatis no longer
need it.
2019-02-04 Colin Watson <cjwatson@debian.org>
Import Gnulib's strcase module
We're already using strcasecmp and strncasecmp.
* bootstrap.conf (gnulib_modules): Add strcase.
2019-02-04 Colin Watson <cjwatson@debian.org>
Add missing #include
* src/straycats.c: Include <stdbool.h>.
2019-02-04 Colin Watson <cjwatson@debian.org>
Use bool for boolean command-line options
* include/manconfig.h.in (debug_level): Change type to bool. Update all
definitions and users.
* lib/encodings.c (get_roff_encoding): Change type of "found" to bool.
* libdb/db_lookup.c (dblookup_all, dblookup_exact): Change "match_case"
parameter type to bool. Update all callers.
(dblookup_pattern): Change "match_case", "pattern_regex", and
"try_descriptions" parameter types to bool. Update all callers.
* libdb/db_storage.h (dblookup_all, dblookup_exact, dblookup_pattern):
Update prototypes.
* src/descriptions_store.c (store_descriptions): Change types of
"found_real_page" and "found_external" to bool.
* src/lexgrog_test.c (main): Change types of "some_failed" and "found"
to bool.
* src/man.c (parse_opt): Change types of "apropos" and "whatis" to bool.
(add_roff_line_length): Change "save_cat_p" parameter type to bool *.
Update all callers.
(make_browser): Change "found_percent_s" type to bool.
(display): Change "display_to_stdout" type to bool.
(try_db): Change "found_stale" type to bool.
(local_man_loop): Change "local_mf" type to bool.
(main): Change "found_subpage" type to bool.
* src/manp.c (read_config_file): Change "optional" parameter type to
bool. Update all callers.
* src/manp.h (read_config_file): Update prototype.
* src/check_mandirs.c (opt_test, force_rescan): Change types to bool.
Update all users.
* src/globbing_test.c (match_case, regex_opt, wildcard): Likewise.
* src/lexgrog_test.c (parse_man, parse_cat, show_whatis, show_filters):
Likewise.
* src/man.c (disable_cache, troff, global_apropos, print_where,
print_where_cat, catman, local_man_file, findall, update, match_case,
regex_opt, wildcard, names_only, no_hyphenation, no_justification,
subpages, ascii, save_cat, ditroff, htmlout): Likewise.
* src/mandb.c (opt_test, force_rescan, check_for_strays, purge, user,
create): Likewise.
* src/manp.c (disable_cache): Likewise.
* src/manpath.c (cat, global): Likewise.
* src/whatis.c (am_apropos, regex_opt, exact, wildcard, require_all,
long_output): Likewise.
2019-02-04 Colin Watson <cjwatson@debian.org>
Port roff_warnings to gl_list
* src/man.c (struct string_llist): Remove.
(parse_opt, make_roff_command): Convert roff_warnings to gl_list.
(main): Initialise roff_warnings.
2019-02-04 Colin Watson <cjwatson@debian.org>
Port parse_descriptions to gl_list
* src/descriptions.c (free_descriptions): Rename to ...
(page_description_free): ... this. Adjust for gl_list's expected
interface.
(parse_descriptions): Convert to gl_list. Return a zero-length list if
whatis is NULL, where previously we returned NULL.
* src/descriptions_store.c (store_descriptions): Convert descs to
gl_list.
* src/descriptions.h (struct page_description): Remove next member.
(parse_descriptions, store_descriptions): Update prototypes.
(free_descriptions): Remove prototype.
* src/lexgrog_test.c (main): Convert descs to gl_list.
* src/straycats.c (check_for_stray): Likewise. Remove conditional,
since parse_descriptions now never returns NULL.
2019-02-04 Colin Watson <cjwatson@debian.org>
Improve sandbox_free
* lib/sandbox.c (sandbox_free): Free sandbox->permissive_ctx too.
2019-02-04 Colin Watson <cjwatson@debian.org>
Free seccomp sandbox before normal exit
This makes valgrind slightly happier.
* src/lexgrog_test.c (main): Call seccomp_free before exiting.
* src/man.c (main): Likewise.
* src/manconv_main.c (main): Likewise.
* src/mandb.c (main): Likewise.
* src/whatis.c (main): Likewise.
* src/zsoelim_main.c (main): Likewise.
2019-02-04 Colin Watson <cjwatson@debian.org>
Port dblookup to gl_list
* libdb/db_lookup.c (free_mandata_struct): Only free a single structure,
rather than following list pointers.
(split_content): Stop initialising pinfo->next.
(dblookup, dblookup_pattern): Convert to gl_list. Return a zero-length
list to indicate no matches, where previously we returned NULL.
(dblookup_exact): Adjust for changes in dblookup. This function
continues to return a single element rather than a list, since that's
all that its callers need.
* libdb/db_storage.h (struct mandata): Remove next member.
(dblookup_all, dblookup_pattern): Update prototypes.
* src/man.c (db_map_value_free): New function.
(try_db): Convert dblookup_pattern/dblookup_all cache to store gl_lists
or NULL. NULL now means a database open failure and a zero-length list
means no matches in an existing database, rather than vice versa.
* src/whatis.c (do_whatis_section): Convert to gl_list.
2019-02-03 Colin Watson <cjwatson@debian.org>
Eliminate #ifdef in straycats.c
* src/straycats.c (check_for_stray): Replace hand-rolled
FAVOUR_STRAYCATS conditional with an equivalent compare_ids call.
2019-02-03 Colin Watson <cjwatson@debian.org>
Add helper functions for common container cases
* lib/glcontainers.c (new_string_list, new_string_map, new_string_set):
New functions.
* lib/glcontainers.h (new_string_list, new_string_map, new_string_set):
Add prototypes.
* lib/orderfiles.c (order_files): Use new_string_list.
* src/check_mandirs.c (test_manfile, add_dir_entries): Likewise.
* src/globbing.c (look_for_file, expand_path): Likewise.
* src/man.c (get_section_list): Likewise.
* src/manp.c (get_scetions, get_manpath_from_path, create_pathlist):
Likewise.
* src/straycats.c (check_for_stray): Likewise.
* libdb/db_gdbm.c (man_gdbm_firstkey): Use new_string_map.
* src/check_mandirs.c (test_manfile): Likewise.
* src/globbing.c (update_directory_cache): Likewise.
* src/man.c (try_db): Likewise.
* src/mandb.c (main): Likewise.
* libdb/db_btree.c (btree_findkey): Use new_string_set.
* src/whatis.c (main): Likewise.
2019-02-03 Colin Watson <cjwatson@debian.org>
Replace hashtable with Gnulib containers
Since we're using Gnulib's container types anyway, we might as well
reduce the maintenance burden of local code, especially since the result
tends to be more concise.
* bootstrap.conf (gnulib_modules): Add hash-map, hash-set, xmap, and
xset.
* lib/glcontainers.h (GL_MAP_FOREACH_START, GL_MAP_FOREACH_END): New
macros.
* lib/orderfiles.c (compare_physical_offsets, order_files): Convert
physical_offsets from a hashtable to a gl_map.
* libdb/db_btree.c (loop_check_hash): Rename to ...
(loop_check): ... this.
(btree_findkey): Convert loop_check from a hashtable to a gl_set.
* libdb/db_gdbm.c (parent_sortkey_hash): Rename to ...
(parent_keys: ... this.
(struct sortkey, parent_sortkey_hashtable_free): Remove.
(sortkey_hashtable_free): Rename to ...
(datum_free): ... this. Adjust for gl_list's expected interface.
(sortkey_compare): Rename to ...
(datum_compare): ... this. Adjust for gl_list's expected interface.
(datum_equals, datum_hash): New functions.
(man_gdbm_firstkey, man_gdbm_nextkey, man_gdbm_close): Convert
parent_keys from a hashtable to a gl_map, and convert its values from
hashtables with manual linking to gl_lists using a hash for fast lookup
by key.
* src/check_mandirs.c (whatis_hash): Rename to ...
(whatis_map): ... this.
(struct whatis_hashent): Rename to ...
(struct whatis): ... this.
(whatis_hashtable_free): Rename to ...
(whatis_free): ... this. Adjust for gl_map's expected interface.
(test_manfile): Convert whatis_map from a hashtable to a gl_map.
* src/globbing.c (struct dirent_hashent): Rename to ...
(struct dirent_names): ... this.
(dirent_hashtable_free): Rename to ...
(dirent_names_free): ... this. Adjust for gl_map's expected interface.
(dirent_hash): Rename to ...
(dirent_map): ... this.
(update_directory_cache): Convert dirent_map from a hashtable to a
gl_map.
* src/man.c (db_hash): Rename to ...
(db_map): ... this.
(db_hashtable_free): Remove.
(try_db, main): Convert db_map from a hashtable to a gl_map.
* src/mandb.c (process_manpath, tried_catdirs_free, purge_catdir,
purge_catdirs, main): Convert tried_catdirs from a hashtable to a
gl_map.
* src/whatis.c (display, main): Convert display_seen from a hashtable to
a gl_set.
* lib/Makefile.am (libman_la_SOURCES): Remove hashtable.c and
hashtable.h.
* lib/README: Remove hashtable.*.
* lib/hashtable.c, lib/hashtable.h: Remove.
2019-02-01 Colin Watson <cjwatson@debian.org>
Port list_extensions to gl_list
* libdb/db_lookup.c (name_ext_equals): New function.
(list_extensions, dblookup): Convert to gl_list.
* libdb/db_storage.h (struct name_ext): New structure.
(list_extensions): Update prototype.
* libdb/db_delete.c (dbdelete): Convert to gl_list.
2019-01-31 Colin Watson <cjwatson@debian.org>
Port ult_src tracing to gl_list
* src/ult_src.c (ult_trace, free_ult_trace): Remove.
(ult_src): Convert trace handling to gl_list.
* src/ult_src.h (struct ult_trace): Remove.
(ult_src): Update prototype.
(free_ult_trace): Remove.
* src/descriptions_store.c (store_descriptions): Convert to gl_list.
* src/descriptions.h (store_descriptions): Update prototype.
* src/check_mandirs.c (struct whatis_hashent): Change type of trace to
gl_list_t.
(whatis_hashtable_free, test_manfile): Convert to gl_list.
2019-01-30 Colin Watson <cjwatson@debian.org>
Use bool in more places in whatis
* src/whatis.c (use_grep, do_whatis, do_apropos): Change "found"
parameter type to bool *. Update all callers.
(any_set, all_set): Change "found_here" parameter type to bool *.
Update all callers.
(parse_name, parse_whatis): Change "found" and "found_here" parameter
types to bool *. Update all callers.
2019-01-30 Colin Watson <cjwatson@debian.org>
Port get_sections to gl_list
* src/manp.c (get_sections): Convert to gl_list.
* src/manp.h (get_sections): Update prototype.
* src/man.c (is_section, compare_candidates, do_global_apropos, man,
get_section_list): Convert to gl_list.
(compare_candidates): Sort sections missing from section_list to the
end.
(main): Free section_list.
2019-01-30 Colin Watson <cjwatson@debian.org>
Use HTTPS URL for libpipeline
* NEWS, docs/INSTALL.quick: Update libpipeline URL to
https://nongnu.org/libpipeline/.
2019-01-29 Colin Watson <cjwatson@debian.org>
Port expand_path to gl_list
* src/globbing.c (expand_path): Convert to gl_list.
* src/globbing.h (expand_path): Update prototype.
* src/manp.c (def_path, add_dir_to_list, add_dir_to_path_list): Convert
to gl_list.
* src/ult_src.c (find_include): Likewise.
2019-01-29 Colin Watson <cjwatson@debian.org>
Fix failure to link libman using the Darwin linker
Thanks to George Plymale II and John Gardner.
* configure.ac: Add "-Wl,-flat_namespace,-undefined,suppress" to CFLAGS
on Darwin.
* NEWS: Document this.
2019-01-29 Colin Watson <cjwatson@debian.org>
Port order_files and look_for_file to gl_list
This gets rid of some particularly awful allocation spaghetti in
src/globbing.c.
* bootstrap.conf (gnulib_modules): Add rbtree-list.
* lib/orderfiles.c (compare_physical_offsets): Expect arguments to be
const char * rather than const char **.
(order_files): Convert to taking a gl_list_t as an input/output argument
rather than an array. In the HAVE_LINUX_FIEMAP_H case, we produce a new
sorted list.
* lib/orderfiles.h (order_files): Update prototype.
* src/globbing.c (clear_glob): Remove.
(match_in_directory): Convert to gl_list. Remove inter-call allocation
and cleanup machinery.
(look_for_file): Convert to gl_list. Remove glob_t cleanup machinery;
the caller is now responsible for freeing the returned list.
* src/globbing.h (look_for_file): Update prototype.
* src/check_mandirs.c (add_dir_entries, count_glob_matches,
purge_normal): Convert to gl_list.
* src/straycats.c (check_for_stray): Likewise.
* src/check_mandirs.c (purge_whatis, purge_missing): Convert to gl_list.
Free list returned by look_for_file.
* src/globbing_test.c (main): Likewise.
* src/man.c (try_section, do_global_apropos_section): Likewise.
* src/zsoelim.l (zsoelim_open_file): Likewise.
2019-01-29 Colin Watson <cjwatson@debian.org>
Default to --without-systemd* on non-Linux systems
systemd is unapologetically Linux-specific, so let's not require
non-Linux packages to explicitly turn this off.
* m4/man-arg-systemdsystemunitdir (MAN_ARG_SYSTEMDSYSTEMUNITDIR):
Default to with_systemdsystemunitdir=no on non-Linux systems.
* m4/man-arg-systemdtmpfilesdir (MAN_ARG_SYSTEMDTMPFILESDIR): Default to
with_systemdtmpfilesdir=no on non-Linux systems.
2019-01-27 Colin Watson <cjwatson@debian.org>
Add --quiet to systemd mandb invocation
Fixes Debian bug #920628.
* init/systemd/man-db.service.in (ExecStart): Run mandb with --quiet.
* NEWS: Document this.
2019-01-27 Colin Watson <cjwatson@debian.org>
Use macros for common cases of list iteration
* lib/glcontainers.h (GL_LIST_FOREACH_START, GL_LIST_FOREACH_END): New
macros.
* src/catman.c (main): Replace manual list iteration with equivalent
macros.
* src/man.c (do_global_apropos, locate_page_in_manpath): Likewise.
* src/mandb.c (main): Likewise.
* src/manp.c (get_config, print_list, get_sections, def_path,
get_manpath_from_path, create_pathlist, get_mandb_manpath, get_catpath,
is_global_mandir): Likewise.
* src/whatis.c (search): Likewise.
* src/zsoelim.l (zsoelim_open_file): Likewise.
2019-01-27 Colin Watson <cjwatson@debian.org>
Rename gl-container-helpers to glcontainers
This is less annoying to type.
* lib/gl-container-helpers.c: Rename to ...
* lib/glcontainers.c: ... this.
* lib/gl-container-helpers.h: Rename to ...
* lib/glcontainers.h: ... this.
* lib/Makefile.am (libman_la_SOURCES): Replace gl-container-helpers.c
and gl-container-helpers.h with glcontainers.c and glcontainers.h.
* src/manp.c: Update include.
2019-01-27 Colin Watson <cjwatson@debian.org>
Move Gnulib container helpers into common code
* src/manp.c (string_equals, string_hash, string_free): Move to ...
* lib/gl-container-helpers.c (string_equals, string_hash, plain_free):
... here (new file).
* lib/gl-container-helpers.h: New file.
* lib/Makefile.am (libman_la_SOURCES): Add gl-container-helpers.c and
gl-container-helpers.h.
2019-01-26 Colin Watson <cjwatson@debian.org>
Turn config flags into an enum
* src/manp.c (enum config_flag): New enumeration.
(struct config_item, def_path, add_config, get_config, get_sections,
def_path): Use enum config_flag.
(describe_flag): New function.
(print_list): Describe flags rather than printing their integer value.
(add_def): Remove flag parameter; expect caller to pass the correct
config_def value instead. Make thing and config_def const.
(add_mandb_map): Remove flag parameter; expect caller to pass the
correct catdir value instead.
(add_to_dirlist): Update calls to add_mandb_map and add_def.
2019-01-26 Colin Watson <cjwatson@debian.org>
Port internal configuration storage to gl_list
* bootstrap.conf (gnulib_modules): Add array-list.
* src/manp.c (struct list): Remove.
(struct config_item): New structure.
(config_item_free): New function.
(add_to_list): Rename to ...
(add_config): ... this. Convert to gl_list. Update all callers.
(get_from_list): Rename to ...
(get_config): ... this. Convert to gl_list. Update all callers.
(iterate_over_list): Remove.
(print_list, get_sections, free_config_file, def_path,
get_manpath_from_path, get_mandb_manpath, get_catpath,
is_global_mandir): Port config list handling to gl_list.
(add_to_dirlist): Rename config parameter to config_file.
(read_config_file): Create empty config list. Rename previous local
config variable to config_file.
2019-01-26 Colin Watson <cjwatson@debian.org>
Use Gnulib's lchown function
Also remove lib/xchown.*; with only one call site, they don't pull their
weight over equivalent inline code.
* bootstrap.conf (gnulib_modules): Add lchown.
* configure.ac (AC_CHECK_FUNCS): Remove check for lchown.
* lib/Makefile.am (libman_la_SOURCES): Remove xchown.c and xchown.h.
* src/check_mandirs.c (chown_if_possible): Always use lchown rather than
chown, and inline the error check.
* po/POTFILES.in: Remove lib/xchown.c.
* po/man-db.pot, po/*.po: Update.
2019-01-26 Colin Watson <cjwatson@debian.org>
Simplify includes using Gnulib's fcntl module
* bootstrap.conf (gnulib_modules): Add fcntl.
* configure.ac (AC_CHECK_HEADERS): Remove check for fcntl.h.
* libdb/db_btree.c, libdb/db_ndbm.c, libdb/mydbm.h, src/man.c: Include
<fcntl.h> unconditionally.
* src/man.c: Remove conditional definitions of R_OK and X_OK; Gnulib's
<unistd.h> handles these.
2019-01-26 Colin Watson <cjwatson@debian.org>
Replace check_standard_fds with Gnulib's xstdopen
* bootstrap.conf (gnulib_modules): Add xstdopen.
* src/man.c (check_standard_fds): Remove.
(main): Call xstdopen rather than check_standard_fds.
2019-01-26 Colin Watson <cjwatson@debian.org>
Update to Gnulib 20190124
2019-01-26 Colin Watson <cjwatson@debian.org>
Use bool type where appropriate
Now that we're using <stdbool.h> anyway due to gl_list (with Gnulib
providing <stdbool.h> if necessary), it makes sense to use it for our
own functions that have essentially boolean semantics.
* lib/encodings.c (compatible_encodings, is_roff_device): Return bool.
* lib/pathsearch.c (pathsearch, pathsearch_executable,
directory_on_path): Likewise.
* lib/sandbox.c (search_ld_preload, can_load_seccomp): Likewise.
* lib/security.c (running_setuid): Likewise.
* lib/wordfnmatch.c (word_fnmatch): Likewise. Update all callers.
* src/check_mandirs.c (sanity_check_db): Likewise.
* src/man.c (duplicate_candidates): Likewise.
* src/manp.c (is_global_mandir): Likewise. Update all callers.
* src/whatis.c (suitable_manpath, match): Likewise.
(any_set, all_set): Likewise. Update all callers.
* lib/encodings.h (is_roff_device): Update prototype.
* lib/pathsearch.h (pathsearch_executable, directory_on_path): Likewise.
* lib/security.h (running_setuid): Likewise.
* lib/wordfnmatch.h (word_fnmatch): Likewise.
* src/manp.h (is_global_mandir): Likewise.
* src/mandb.c (mandb, process_manpath): Change global_manpath parameter
type to bool.
2019-01-26 Colin Watson <cjwatson@debian.org>
Note that some C99 runtime facilities may be used
* docs/HACKING (Facilities and portability): Note that C99 runtime
facilities that are provided by Gnulib are OK.
2019-01-26 Colin Watson <cjwatson@debian.org>
Remove arbitrary limit on manpath size
Fixes Savannah bug #50324.
* bootstrap.conf (gnulib_modules): Add hash-pjw-bare, linkedhash-list,
stdbool, and xlist.
* include/manconfig.h.in (MAXDIRS): Remove.
* src/manp.c (tmplist): Remove.
(string_equals, string_hash, string_free): New functions.
(gripe_overlong_list): Remove.
(insert_override_dir, get_manpath_from_path, add_expanded_dir_to_list,
add_dir_to_list, add_man_subdirs, add_dir_to_path_list, create_pathlist,
free_pathlist): Port manpath list handling to gl_list_t.
* src/catman.c (main): Likewise.
* src/man.c (do_global_apropos, local_man_loop, locate_page_in_manpath,
main): Likewise.
* src/mandb.c (main): Likewise.
* src/whatis.c (suitable_manpath, search, main): Likewise.
* src/zsoelim.l (<<EOF>>, zsoelim_parse_file, zsoelim_open_file,
zsoelim_stdin, zsoelim_stdin_data_new): Likewise.
* src/zsoelim_main.c (main): Likewise.
* src/manp.h (create_pathlist, free_pathlist): Update prototypes.
* src/zsoelim.h (zsoelim_open_file, zsoelim_parse_file,
zsoelim_stdin_data_new): Likewise.
* NEWS: Document this.
2019-01-26 Colin Watson <cjwatson@debian.org>
* NEWS: Document previous commit.
2019-01-26 Colin Watson <cjwatson@debian.org>
Automatically add more man directories to manpath
Will Starms reported that, if both ../man and ../share/man directories
(for example) exist relative to a directory on $PATH, then only the
first was considered.
* src/manp.c (has_mandir): Rename to ...
(add_man_subdirs): ... this. Insert directories as they are found
rather than returning them, and continue even if some have been found.
(get_manpath_from_path): Update call to add_man_subdirs.
2019-01-08 Colin Watson <cjwatson@debian.org>
Recommend a distribution-independent bug tracker
* README: Link to https://savannah.nongnu.org/bugs/?group=man-db for bug
reporting.
2019-01-05 Colin Watson <cjwatson@debian.org>
* Version: 2.8.5.
2019-01-05 Colin Watson <cjwatson@debian.org>
Upgrade to Gnulib 20190105
In line with Gnulib, we now require Autoconf 2.63 and Automake 1.11.2.
* bootstrap: Sync to Gnulib d271f868a8df9bbec29049d01e056481b7a1a263.
* bootstrap.conf (GNULIB_REVISION): Set to
d271f868a8df9bbec29049d01e056481b7a1a263.
(buildreq): Bump required autoconf version to 2.63 and required automake
version to 1.11.2.
* configure.ac (AM_SILENT_RULES, AM_PROG_AR): Remove conditionals, which
were there for Automake 1.10 support.
(AC_PREREQ): Bump to 2.63.
* NEWS: Document this.
2019-01-05 Colin Watson <cjwatson@debian.org>
Use tar --sort=name if available
* m4/man-tar-sort-name.m4: New file.
* configure.ac: Call MAN_TAR_SORT_NAME.
2019-01-05 Colin Watson <cjwatson@debian.org>
Fix distcheck following addition of systemd timer
* Makefile.am (AM_DISTCHECK_CONFIGURE_FLAGS): Add
--with-systemdsystemunitdir=\$${prefix}/lib/systemd/system.
2019-01-05 Colin Watson <cjwatson@debian.org>
Fix distribution of man-db.timer
Automake's "_DATA" primary defaults to "nodist_", not "dist_".
* init/systemd/Makefile.am (systemdsystemunit_DATA): Rename to ...
(dist_systemdsystemunit_DATA): ... this.
(nodist_systemdsystemunit_DATA): Rename to ...
(systemdsystemunit_DATA): ... this.
(EXTRA_DIST): Add man-db.timer if INSTALL_SYSTEMD_TIMER is false.
2019-01-05 Colin Watson <cjwatson@debian.org>
sandbox: Work around Microsoft SCEP
This is a proprietary antivirus program and I've only been able to guess
at how to handle it. Note that it is no longer supported by Microsoft
and so users should probably replace it with something else, but I still
want to minimise the number of support requests I get related to it.
* lib/sandbox.c (make_seccomp_filter): If libscep_pac.so is preloaded,
then allow some system calls related to sockets and System V message
queues.
* NEWS: Document this.
2018-12-24 Colin Watson <cjwatson@debian.org>
Use (void *) 0 as a variadic sentinel
NULL is formally incorrect here since the standard allows it to be an
integer constant expression.
* lib/decompress.c (decompress_open, decompress_fdopen): Use (void *)
rather than NULL as a sentinel for variadic functions.
* libdb/db_delete.c (dbdelete): Likewise.
* src/catman.c (catman, parse_for_sec, main): Likewise.
* src/check_mandirs.c (add_dir_entries): Likewise.
* src/compression.c (comp_file): Likewise.
* src/filenames.c (make_filename): Likewise.
* src/globbing.c (look_for_file): Likewise.
* src/lexgrog.l (find_name): Likewise.
* src/man.c (do_extern, run_mandb, make_roff_command, make_browser,
setenv_less, add_output_iconv, make_display_command, tmp_cat_filename,
format_display_and_save, format_display, display_catman, display,
local_man_loop): Likewise.
* src/manconv_client.c (add_manconv): Likewise.
* src/manconv_main.c (parse_opt): Likewise.
* src/manp.c (pathappend, add_nls_manpaths, add_system_manpath,
add_dir_to_path_list, get_catpath): Likewise.
* src/straycats.c (check_for_stray, open_catdir, straycats): Likewise.
* src/whatis.c (use_grep, display): Likewise.
2018-12-06 Colin Watson <cjwatson@debian.org>
Honour --enable-cache-owner in systemd timer
* init/systemd/Makefile.am (man-db.service): Substitute
@cache_top_owner@.
* init/systemd/man-db.service.in (ExecStart, User): Use
@cache_top_owner@ rather than hardcoding "man".
2018-12-06 Colin Watson <cjwatson@debian.org>
Improve systemd unit commentary
* init/systemd/man-db.service.in (ExecStart): Add comment.
2018-12-06 Colin Watson <cjwatson@debian.org>
Allow disabling installation of systemd components
* m4/man-arg-systemdtmpfilesdir.m4: Define an INSTALL_SYSTEMD_TMPFILES
Automake conditional (true unless --with-systemdtmpfilesdir=no).
* m4/man-arg-systemdsystemunitdir.m4: Define an INSTALL_SYSTEMD_TIMER
Automake conditional (true unless --with-systemdsystemunitdir=no).
* init/systemd/Makefile.am: Honour INSTALL_SYSTEMD_TMPFILES and
INSTALL_SYSTEMD_TIMER.
2018-12-06 Colin Watson <cjwatson@debian.org>
Ship a systemd timer for daily DB maintenance
Thanks to Christian Göttsche. Fixes Debian bug #858022.
* m4/man-arg-systemdsystemunitdir.m4: New file.
* configure.ac: Accept --with-systemdsystemunitdir option.
* init/systemd/Makefile.am (EXTRA_DIST): Add man-db.service.in.
(CLEANFILES): Add man-db.service.
(systemdsystemunit_DATA): Install man-db.timer.
(nodist_systemdsystemunit_DATA): Install man-db.service.
(man-db.service): New rule.
* init/systemd/man-db.service.in, init/systemd/man-db.timer: New files.
* .gitignore: Add init/systemd/man-db.service.
* NEWS: Document this.
2018-11-14 Colin Watson <cjwatson@debian.org>
Fix incorrect error message
Reported by Julian Gilbey. Fixes Debian bug #913721.
* src/man.c (check_standard_fds): Correct error message if stdout is not
open for writing (not "for reading", as previously claimed).
2018-11-09 Colin Watson <cjwatson@debian.org>
release.sh: Simplify Lex handling
release.sh had a hack to ensure that flex-generated scanners are fresh
in release tarballs. This is more easily achieved by configuring with
--enable-maintainer-mode, which causes Automake to enable the Lex
rebuild rule.
* release.sh: Configure with --enable-maintainer-mode; drop conditional
removals of src/lexgrog.c and src/zsoelim.c.
2018-11-09 Colin Watson <cjwatson@debian.org>
lexgrog: Fix handling of \- in RHS of NAME section
Fixes Debian bug #913351.
* src/lexgrog.l (MAN_NAME): Split into MAN_NAME (left-hand side) and
MAN_DESC (right-hand side). Most rules remain as before, except that \-
and similar are only handled specially in MAN_NAME and transition to
MAN_DESC, and rules that add a 0x11 marker (indicating the start of a
new whatis definition) transition to MAN_NAME.
(MAN_NAME_AT, MAN_NAME_BSX, MAN_NAME_BX, MAN_NAME_BX_RELEASE,
MAN_NAME_DQ, MAN_NAME_FX, MAN_NAME_NX, MAN_NAME_OX): Rename to
MAN_DESC_*.
(mdoc_text): Transition to MAN_DESC rather than MAN_NAME.
(newline_found): If adding 0x11, transition to MAN_NAME.
* src/tests/lexgrog-3: New file.
* src/tests/Makefile.am (ALL_TESTS): Add lexgrog-3.
* NEWS: Document this.
2018-11-09 Colin Watson <cjwatson@debian.org>
* NEWS: Document changes since 2.8.4.
2018-11-09 Colin Watson <cjwatson@debian.org>
lexgrog: Add test for multiple whatis definitions
* src/tests/lexgrog-2: New file.
* src/tests/Makefile.am (ALL_TESTS): Add lexgrog-2.
2018-11-09 Colin Watson <cjwatson@debian.org>
lexgrog: Tidy up rules section
No functional change.
* src/lexgrog.l: Make more use of start condition scopes. Reindent
rules somewhat to make better use of vertical space.
2018-11-03 Nikola Forró <nforro@redhat.com>
Fix several resource and memory leaks
* lib/decompress.c (decompress_zlib): Fix fd leak if gzdopen fails.
* lib/encodings.c (find_charset_locale): Free locale if setlocale fails.
* src/man.c (make_roff_command): Free fmt_prog.
* src/mandb.c (process_manpath): Free catpath if manpath is not a
directory.
* src/whatis.c (do_apropos): Free found_here.
2018-10-27 enolp <enolp@softastur.org>
Add Asturian translation
* po/ast.po: New from Translation Project.
* po/LINGUAS: Add ast.
* man/THANKS: Add translator credit.
2018-10-27 Pedro Albuquerque <palbuquerque73@gmail.com>
Update Portuguese manual page translation
* man/po4a/po/pt.po: Update from Translation Project.
2018-10-21 Colin Watson <cjwatson@debian.org>
Add Portuguese manual page translation
* man/po4a/po/pt.po: New from Translation Project (thanks, Pedro
Albuquerque).
* configure.ac (AC_CONFIG_FILES): Add man/pt/Makefile.
* man/LINGUAS.po4a: Add pt.
* man/Makefile.am (DIST_SUBDIRS): Add pt.
* man/pt/Makefile.am, man/pt/translator.add: New files.
* man/po4a/Makefile.am (POFILES): Add po/pt.po.
* man/po4a/po4a.cfg (po4a_langs): Add pt.
* man/THANKS: Add translator credit.
* .gitignore: Add man/pt/man1, man/pt/man5, and man/pt/man8.
2018-10-21 Colin Watson <cjwatson@debian.org>
Switch more language lists to one-per-line format
* man/LINGUAS.po4a: Switch to one language code per line, so that we
have better diffs in future.
* man/Makefile.am (DIST_SUBDIRS): Likewise.
* man/po4a/cfg (po4a_langs): Likewise.
2018-10-21 Pedro Albuquerque <palbuquerque73@gmail.com>
Add Portuguese translation
* po/pt.po: New from Translation Project.
* po/LINGUAS: Add pt.
* man/THANKS: Add translator credit.
2018-10-21 Colin Watson <cjwatson@debian.org>
Switch po/LINGUAS to one-per-line format
* po/LINGUAS: Switch to one language code per line, so that we have
better diffs in future.
2018-10-21 Chen Qi <Qi.Chen@windriver.com>
man-arg-config-file: fix to use config_file
* m4/man-arg-config-file.m4: Compute config_file_basename based on
config_file, not withval.
2018-08-20 Colin Watson <cjwatson@debian.org>
Fail to configure if flex is needed but missing
Fixes Savannah bug #54541.
* configure.ac: Issue an error if AC_PROG_LEX didn't find a lexer
generator and either src/lexgrog.c or src/zsoelim.c is missing (as may
be the case when building from a git clone rather than a released
tarball).
2018-08-02 Colin Watson <cjwatson@debian.org>
Fix warning from gcc -Wcast-function-type
This exposed the fact that errors from unlink in the cleanup path were
previously ignored. We now issue a warning in the same way that
commit_tmp_cat does.
* src/man.c (cleanup_unlink): New function.
(open_cat_stream, close_cat_stream, display_catman): Use cleanup_unlink
rather than an incorrect cast of unlink.
2018-08-02 Colin Watson <cjwatson@debian.org>
Fix build with Berkeley DB
Fixes Savannah bug #54425.
* libdb/db_btree.c: Include <stdlib.h> for free.
2018-07-27 Colin Watson <cjwatson@debian.org>
Update advertised file size
* docs/man-db.lsm (Primary-site): Update file size.
2018-07-27 Colin Watson <cjwatson@debian.org>
* Version: 2.8.4.
2018-07-27 Colin Watson <cjwatson@debian.org>
Work around Gnulib/gettext mismatch
The versions of gettext infrastructure files installed by gnulib-tool
don't necessarily match our configured AM_GNU_GETTEXT_VERSION, so we
need to fix things up in bootstrap.
* bootstrap.conf (gnulib_tool_option_extras): Set --po-base to gl/ref-po
rather than gnulib/po.
(bootstrap_post_import_hook): Merge temporary gl/ref-po directory into
gl/po.
2018-07-27 Colin Watson <cjwatson@debian.org>
Upgrade to Gnulib 20180726
* bootstrap: Sync to Gnulib 900ca5c0b092e50f9f17329feea3fbfe2b6e2139.
* bootstrap.conf (GNULIB_REVISION): Set to
900ca5c0b092e50f9f17329feea3fbfe2b6e2139.
2018-07-18 Colin Watson <cjwatson@debian.org>
Distribute man/es/translator.add
* man/es/Makefile.am (EXTRA_DIST): Add translator.add.
2018-07-16 Colin Watson <cjwatson@debian.org>
sandbox: Improve ESET compatibility further
* lib/sandbox.c (make_seccomp_filter): If libesets_pac.so is preloaded,
then allow msgset (second argument 0) and msgsnd.
* NEWS: Document this.
2018-07-15 Colin Watson <cjwatson@debian.org>
sandbox: Allow some shared memory operations
These were previously only allowed when ESET File Security is in use,
but the Astrill VPN seems to require something similar, there are
doubtless other such preload hacks, and they're relatively harmless.
* lib/sandbox.c (make_seccomp_filter): Allow shmat (third argument
SHM_RDONLY), shmctl (second argument IPC_STAT), shmdt, and shmget
regardless of preloads.
* NEWS: Document this.
2018-06-08 Colin Watson <cjwatson@debian.org>
Check for external formatter in correct directory
Check for mandb_nfmt and mandb_tfmt in the manual page hierarchy as
documented, not in the current directory. This was broken by the
working-directory-handling changes in 2.8.3.
Reported by Josh Triplett. Fixes Debian bug #901007.
* src/man.c (NFMT_PROG, TFMT_PROG): Remove leading "./".
(make_roff_command): Refactor confusing #ifdef forest. Prefix dir to
TFMT_PROG/NFMT_PROG rather than looking in the current directory. Don't
look for an external formatter at all if dir is NULL.
* NEWS: Document this.
2018-06-08 Colin Watson <cjwatson@debian.org>
Define an access(2) wrapper with clearer semantics
As usual for system calls, access(2) returns zero on success. However,
I generally think of it as "can we access this file in this way", where
boolean semantics would be more convenient, and find it too easy to
invert logic by accident when using the system call directly. Define a
CAN_ACCESS wrapper with boolean semantics.
* include/manconfig.h.in (CAN_ACCESS): New macro.
* lib/tempfile.c (path_search): Use CAN_ACCESS.
* src/catman.c (check_access): Likewise.
* src/filenames.c (make_filename): Likewise.
* src/man.c (make_roff_command, display): Likewise.
* src/ult_src.c (find_include): Likewise.
* src/whatis.c (use_grep): Likewise.
2018-06-07 Felipe Castro <fefcas@gmail.com>
Update Esperanto translation
* po/eo.po: Update from Translation Project.
2018-06-01 Francisco Javier F. Serrador <fserrador@gmail.com>
Update Spanish manual page translation
* man/po4a/po/es.po: Update from Translation Project.
* man/THANKS: Update translator credit.
2018-05-29 Colin Watson <cjwatson@debian.org>
Add po4a-based Spanish manual page translation
This supersedes the previous whole-file translations, which had not been
properly updated in many years.
* man/po4a/po/es.po: New from Translation Project (thanks, Francisco
Javier Serrador).
* man/LINGUAS: Remove es.
* man/LINGUAS.po4a: Add es.
* man/es/Makefile.am (PO4A_LINGUA): Set to yes.
(man1_MANS): Add man1/lexgrog.1 and man1/manconv.1.
(man8_MANS): Add man8/accessdb.8.
* man/es/man1/apropos.man1, man/es/man1/man.man1,
man/es/man1/manpath.man1, man/es/man1/whatis.man1,
man/es/man1/zsoelim.man1, man/es/man5/manpath.man5,
man/es/man8/catman.man8, man/es/man8/mandb.man8: Remove.
* man/es/translator.add: New file.
* man/po4a/Makefile.am (POFILES): Add po/es.po.
* man/po4a/po4a.cfg (po4a_langs): Add es.
* man/THANKS: Update translator credit.
* .gitignore: Add man/es/man1, man/es/man5, and man/es/man8.
2018-05-29 Colin Watson <cjwatson@debian.org>
Remove useless if-before-free tests
* lib/hashtable.c (plain_hashtable_free): Remove; this is precisely
equivalent to free.
* lib/hashtable.h (plain_hashtable_free): Remove.
* lib/orderfiles.c (order_files): Use free rather than
plain_hashtable_free.
* libdb/db_btree.c (btree_findkey): Likewise.
* lib/pathsearch.c (pathsearch, directory_on_path): Remove useless
if-before-free.
* libdb/db_lookup.c (free_mandata_elements): Likewise.
* src/check_mandirs.c (test_manfile, count_glob_matches): Likewise.
* src/descriptions.c (free_descriptions): Likewise.
* src/lexgrog_test.c (main): Likewise.
* src/man.c (display_filesystem, display_database, get_section_list):
Likewise.
* src/manp.c (add_system_manpath): Likewise.
* src/straycats.c (check_for_stray, straycats): Likewise.
* src/ult_src.c (ult_src): Likewise.
2018-05-29 Colin Watson <cjwatson@debian.org>
Use Gnulib progname module
This lets us produce more accurate error messages when programs are
invoked with an absolute path.
* bootstrap.conf (gnulib_modules): Add progname.
* include/manconfig.h.in (program_name): Remove.
* src/accessdb.c (main): Call set_program_name rather than similar
hand-rolled code.
* src/catman.c (main): Likewise. Don't free program_name.
* src/globbing_test.c (main): Likewise.
* src/lexgrog_test.c (main): Likewise.
* src/man.c (main): Likewise. Don't free program_name.
* src/manconv_main.c (main): Likewise.
* src/mandb.c (main): Likewise. Don't free program_name.
* src/manpath.c (main): Likewise.
* src/tests/fspause.c (main): Likewise.
* src/whatis.c (main): Likewise.
* src/zsoelim_main.c (main): Likewise.
* src/man.c (manopt_to_env): Run program_name through base_name, since
that's no longer necessarily done up-front.
* src/whatis.c (main): Run program_name through base_name before
comparing it to APROPOS_NAME, since that's no longer necessarily done
up-front.
2018-05-29 Colin Watson <cjwatson@debian.org>
Upgrade to Gnulib 20180527
* bootstrap.conf (GNULIB_URL): Remove.
(GNULIB_REVISION): Set to 90f289f249a266b1afb9c63e182f5d979d17df5f.
(gnulib_modules): Replace gettext with gettext-h.
(gnulib_tool_option_extras): Remove --no-cache-modules (accidental
leftover from earlier testing).
(local_gl_dir): Set to 'gnulib-local' to avoid confusion with 'gl' as
the local output directory. Remove 'rm -rf gl' hack, now superseded.
(buildreq): Bump minimum autopoint and gettext versions to 0.18.3,
matching previous change to configure.ac.
* configure.ac (AM_PROG_AR, LT_INIT): Move below gl_EARLY.
* patches/argp-domain.patch: Rebase.
* src/tests/Makefile.am (TESTS_ENVIRONMENT): Remove use of
@LOCALCHARSET_TESTS_ENVIRONMENT@, which is no longer needed by Gnulib.
2018-05-28 Colin Watson <cjwatson@debian.org>
Switch to bootstrap
We no longer keep autogenerated files in git.
* .gitignore: Add **/Makefile, **/Makefile.in, /ABOUT-NLS, /aclocal.m4,
/build-aux, /config.h.in, /configure, /gl, /gnulib,
docs/INSTALL.autoconf, po/Makefile.in.in, po/Makevars, po/Rules-quot,
po/boldquot.sed, po/en@boldquot.header, po/en@quot.header,
po/insert-header.sin, po/quot.sed, and po/remove-potcdate.sin. Remove
docs/Makefile, gnulib/*, init/Makefile, init/systemd/Makefile,
lib/Makefile, libdb/Makefile, man/Makefile, man/*/Makefile,
manual/Makefile, po/Makefile, po/Makefile.in, src/Makefile,
src/tests/Makefile, and tools/Makefile.
* ABOUT-NLS, Makefile.in, aclocal.m4, autogen.sh, build-aux,
config.h.in, configure, docs/INSTALL.autoconf, docs/Makefile.in, gnulib,
init/Makefile.in, init/systemd/Makefile.in, lib/Makefile.in,
libdb/Makefile.in, man/Makefile.in, man/da/Makefile.in,
man/de/Makefile.in, man/es/Makefile.in, man/fr/Makefile.in,
man/id/Makefile.in, man/it/Makefile.in, man/ja/Makefile.in,
man/nl/Makefile.in, man/pl/Makefile.in, man/po4a/Makefile.in,
man/pt_BR/Makefile.in, man/ru/Makefile.in, man/sr/Makefile.in,
man/sv/Makefile.in, man/tr/Makefile.in, man/zh_CN/Makefile.in,
manual/Makefile.in, po/Makefile.in.in, po/Makevars, po/Rules-quot,
po/boldquot.sed, po/en@boldquot.header, po/en@quot.header,
po/insert-header.sin, po/quot.sed, po/remove-potcdate.sin,
src/Makefile.in, src/tests/Makefile.in, tools/Makefile.in: Remove.
* bootstrap, bootstrap.conf: New files.
* Makefile.am (GNULIB_PO, SUBDIRS, EXTRA_DIST, ACLOCAL_AMFLAGS): Refer
to gl/ rather than gnulib/ (gnulib/ now contains pristine source).
(EXTRA_DIST): Replace autogen.sh with bootstrap and bootstrap.conf.
Replace gnulib/argp-domain.patch with patches/argp-domain.patch. Add
patches/fdutimens-hurd.patch. Remove gnulib/m4/gnulib-cache.m4 and
gnulib/m4/gnulib-tool.m4.
* gnulib/argp-domain.patch: Rename to ...
* patches/argp-domain.patch: ... this. Update target paths.
* gnulib/fdutimens-hurd.patch: Rename to ...
* patches/fdutimens-hurd.patch: ... this. Update target paths.
* configure.ac (AM_GNU_GETTEXT_VERSION): Upgrade to 0.18.3, for
compatibility with current Automake.
(HAVE_GNULIB_PO, AC_CONFIG_FILES): Refer to gl/ rather than gnulib/.
* lib/Makefile.am (libman_la_CPPFLAGS, libman_la_LIBADD): Likewise.
* libdb/Makefile.am (libmandb_la_CPPFLAGS): Likewise.
* src/Makefile.am (AM_CPPFLAGS, LIBMAN): Likewise.
* src/tests/Makefile.am (AM_CPPFLAGS, fspause_LDADD): Likewise.
* docs/HACKING: Describe new policy.
* release.sh: Call ./bootstrap rather than ./autogen.sh.
2018-05-17 pan93412 <pan93412@gmail.com>
Add Traditional Chinese translation
* po/zh_TW.po: New from Translation Project.
* po/LINGUAS: Add zh_TW.
* man/THANKS: Add translator credit.
2018-04-22 Colin Watson <cjwatson@debian.org>
sandbox: Allow sched_getaffinity
This is used by xz-utils >= 5.2.3 if the --threads=0 option is in use
(perhaps via XZ_DEFAULTS or XZ_OPT).
Reported by Axel Rohde.
* lib/sandbox.c (make_seccomp_filter): Allow sched_getaffinity.
* NEWS: Document this.
2018-04-06 Colin Watson <cjwatson@debian.org>
Fix invalid man-db.conf with --disable-cache-owner
Fixes Savannah bug #53575.
* m4/man-arg-cache-owner.m4: Set and substitute cache_top_owner.
* init/systemd/man-db.conf.in: Substitute cache_top_owner rather than
man_owner.
* init/systemd/Makefile.am (man-db.conf): Likewise.
* NEWS: Document this.
2018-04-06 Colin Watson <cjwatson@debian.org>
Remove redundant debugging information
* lib/decompress.c (decompress_open): Remove filename from
decompress_zlib command name. pipeline_dump already includes this
information from want_infile.
2018-04-06 Colin Watson <cjwatson@debian.org>
Rely on decompressors reading from stdin
This works better with downstream AppArmor confinement of decompressors.
* lib/decompress.c (decompress_open): Don't pass filename on
decompressor command lines.
* NEWS: Document this.
2018-04-05 Colin Watson <cjwatson@debian.org>
* Version: 2.8.3.
2018-04-05 Colin Watson <cjwatson@debian.org>
Suppress spurious gettext headers in --help output
Some of man-db's commands have post-options help text but no pre-options
help text. Unfortunately, the way this works in argp (separating the
two sections using a '\v' character) means that this results in argp
trying to translate the empty string, which produces gettext catalog
headers. The easiest way to suppress this odd behaviour seems to be to
use a help filter function, so do that.
Reported by Rafael Fontenelle.
* src/accessdb.c (help_filter): Return NULL for ARGP_KEY_HELP_PRE_DOC.
* src/lexgrog_text.c (help_filter): New function.
(argp): Add help_filter.
* src/whatis.c (help_filter): New function.
(apropos_argp): Add help_filter.
* NEWS: Document this.
2018-04-05 Colin Watson <cjwatson@debian.org>
Fix compiler warnings on x32
tv_nsec is __syscall_slong_t == long long there, so we need a cast.
* libdb/db_lookup.c (dbprintf): Cast tv_nsec to long for %ld format.
* libdb/db_store.c (make_content): Likewise.
* src/check_mandirs.c (testmandirs, update_db): Likewise.
* src/man.c (maybe_update_file): Likewise.
2018-04-04 Colin Watson <cjwatson@debian.org>
Fix broken test
* src/tests/man-8: Fix expected output to account for recent change to
locale_macros.
2018-04-04 Colin Watson <cjwatson@debian.org>
man: Only change directory in child processes
This avoids failures due to being unable to change back to the original
working directory.
Fixes Debian bug #894792.
* gnulib/m4/gnulib-cache.m4 (gl_MODULES): Remove save-cwd.
* src/man.c (make_display_command): Remove now-unnecessary code to run
the pager in the original working directory.
(chdir_commands): New function.
(format_display): Change directory just for format_cmd and disp_cmd
rather than in-process.
(display): Change directory just for format_cmd rather than in-process.
(main): Remove now-unnecessary code to save and restore the current
working directory.
* NEWS: Document this.
2018-04-04 Colin Watson <cjwatson@debian.org>
Upgrade config.guess/config.sub
* build-aux/config.guess: Upgrade to 2018-02-24.
* build-aux/config.sub: Upgrade to 2018-02-22.
2018-04-01 Colin Watson <cjwatson@debian.org>
Fix locale_macros version check for groff RCs
Thanks to Werner LEMBERG.
* src/man.c (locale_macros): Tolerate groff release candidates.
* NEWS: Document this.
2018-03-30 Colin Watson <cjwatson@debian.org>
sandbox: Allow sibling architectures on x86 etc.
Fixes Debian bug #891267.
* lib/sandbox.c (make_seccomp_filter): Allow sibling architectures on
x86/x86_64/x32.
* NEWS: Document this.
2018-03-17 Colin Watson <cjwatson@debian.org>
sandbox: Tighten up storage classes
* lib/sandbox.c (make_seccomp_filter, _sandbox_load): Declare as static.
2018-03-17 Colin Watson <cjwatson@debian.org>
sandbox: Allow kill and tgkill outright
This is unfortunate but unavoidable: groff uses kill to explicitly pass
on SIGPIPE to its child processes, and we can't do any more
sophisticated filtering in seccomp.
Based on a patch by Paul Wise. Fixes Debian bug #892309.
* lib/sandbox.c (make_seccomp_filter): Allow kill and tgkill
unconditionally.
(adjust_seccomp_filter): Remove.
(_sandbox_load): Remove call to adjust_seccomp_filter.
* NEWS: Document this.
2018-03-17 Colin Watson <cjwatson@debian.org>
sandbox: Allow madvise
Reported by Tobias Klausmann.
* lib/sandbox.c (make_seccomp_filter): Allow madvise.
* NEWS: Document this.
2018-03-02 Francisco Javier Serrador <fserrador@gmail.com>
Update Spanish translation
* po/es.po: Update from Translation Project.
* man/THANKS: Add translator credit.
2018-02-28 Colin Watson <cjwatson@debian.org>
* Version: 2.8.2.
2018-02-28 Colin Watson <cjwatson@debian.org>
sandbox: Handle qemu-user returning EFAULT
Fixes Debian bug #891109.
* lib/sandbox.c (_sandbox_load): Interpret EFAULT from seccomp_load as
meaning that seccomp is unavailable, since this can be returned by some
versions of qemu-user.
* NEWS: Document this.
2018-02-28 Colin Watson <cjwatson@debian.org>
sandbox: Add some more ESET affordances
* lib/sandbox.c (make_seccomp_filter): If libesets_pac.so is preloaded,
then allow some shared memory calls and checking for the existence of
other processes.
2018-02-25 Colin Watson <cjwatson@debian.org>
sandbox: Work around snoopy
Fixes Debian bug #890861.
* lib/sandbox.c (search_ld_preload): Cache /etc/ld.so.preload contents
between calls.
(make_seccomp_filter): Allow some socket-related system calls if
libsnoopy.so is preloaded.
2018-02-25 Colin Watson <cjwatson@debian.org>
sandbox: Generalise libesets_pac.so check slightly
* lib/sandbox.c (make_seccomp_filter): LD_PRELOAD or /etc/ld.so.preload
can just contain "libesets_pac.so" without an explicit path, so make the
search slightly more permissive.
2018-02-20 Colin Watson <cjwatson@debian.org>
sandbox: Handle /etc/ld.so.preload
At least ESET File Security may be configured using /etc/ld.so.preload
rather than the LD_PRELOAD environment variable, so unfortunately we
need to check that too.
* lib/sandbox.c (search_ld_preload): New function, handling both
LD_PRELOAD and /etc/ld.so.preload.
(can_load_seccomp, make_seccomp_filter): Use search_ld_preload.
2018-02-19 Colin Watson <cjwatson@debian.org>
sandbox: Work around ESET File Security
This is a proprietary antivirus program, so this is only a best guess
from strace output. The choices are to disable the sandbox entirely or
to allow a few socket-related system calls if this antivirus program is
detected, and the latter is probably slightly better.
Reported by John Sivak.
* lib/sandbox.c (make_seccomp_filter): If LD_PRELOAD contains the
substring "/libesets_pac.so", then allow some socket-related system
calls so that the preload wrapper can talk to its daemon.
* NEWS: Document this.
2018-02-19 Colin Watson <cjwatson@debian.org>
sandbox: Allow ioctl(fd, TIOCGWINSZ)
Patch from the anonymous reporter of
https://savannah.nongnu.org/bugs/?53183 (though I think is obvious for
copyright purposes given knowledge of the failing system call).
Fixes Savannah bug #53183 (maybe).
* lib/sandbox.c (make_seccomp_filter): Allow ioctl(fd, TIOCGWINSZ).
* NEWS: Document this.
2018-02-14 Colin Watson <cjwatson@debian.org>
sandbox: Allow kill/tgkill for current process
xz is multithreaded, so the threading library may need to use tgkill to
pass signals between threads, for example when it receives SIGPIPE.
Fixes Savannah bug #53143.
* lib/sandbox.c (SC_ALLOW, SC_ALLOW_ARG_1, SC_ALLOW_ARG_2): Move macro
definitions out of make_seccomp_filter.
(adjust_seccomp_filter): New function.
(sandbox_load): Call adjust_seccomp_filter.
* NEWS: Document this.
2018-02-09 Colin Watson <cjwatson@debian.org>
* Version: 2.8.1.
2018-02-09 Colin Watson <cjwatson@debian.org>
Use HTTPS URLs where possible
* Makefile.am, NEWS, README, docs/HACKING, docs/INSTALL.quick,
lib/sandbox.c, manual/misc.me, src/check_mandirs.c, src/man.c,
src/manconv.c, src/tests/man-1, src/tests/man-2, src/tests/mandb-2,
src/tests/mandb-4, src/tests/mandb-5, src/tests/zsoelim-1: Replace
http:// links with https:// equivalents.
* docs/HACKING: Replace git:// link with an https:// equivalent.
2018-02-09 Colin Watson <cjwatson@debian.org>
Chase some redirects
* NEWS: Link to https://bazaar.canonical.com/ rather than
http://bazaar-vcs.org/.
* man/fr/translator.add: Link to https://po4a.org/ rather than
http://po4a.alioth.debian.org/.
2018-02-08 Colin Watson <cjwatson@debian.org>
sandbox: Allow mremap
* lib/sandbox.c (make_seccomp_filter): Allow mremap, which may be used
by iconv when reading files, depending on libc configuration.
* NEWS: Document this.
2018-02-07 Lars Wendler <polynomial-c@gentoo.org>
Change libseccomp logic to not be automagic only
Introduce --without-libseccomp configure option so that users can
disable seccomp even if libseccomp is available on the system.
The default is unchanged from before this patch. If no
--with(out)-libseccomp has been given on the command line, the macro
looks for presence of libseccomp and uses that if found.
* m4/man-libseccomp.m4: Guard pkg-config test with a command-line
option.
2018-02-07 Colin Watson <cjwatson@debian.org>
* NEWS: Document changes since 2.8.0.
2018-02-07 Colin Watson <cjwatson@debian.org>
Reduce number of MAN_OWNER ifdefs
* lib/security.c (init_security, running_setuid): Define
unconditionally, with stub behaviour if MAN_OWNER is undefined.
* lib/security.h (get_man_owner): Only declare prototype if MAN_OWNER is
defined.
* src/check_mandirs.c (chown_if_possible) [!MAN_OWNER]: Mark path
argument as unused.
* src/lexgrog_test.c (main): Call init_security unconditionally.
* src/man.c (main): Likewise.
* src/manconv_client.c (manconv_pre_exec): Define unconditionally.
(add_manconv): Simplify, since running_setuid is now always defined.
* src/mandb.c (main): Call init_security unconditionally. Use
get_man_owner rather than equivalent inline code.
* src/manp.c (get_def): Define unconditionally.
* src/manp.h (get_def): Drop macro alternative.
2018-02-07 Colin Watson <cjwatson@debian.org>
Fix manconv under seccomp when man is setuid
We must drop privileges before loading the sandbox.
Reported by Lars Wendler.
* src/manconv_client.c (manconv_pre_exec): New function.
(manconv_stdin): Move setuid hack to ...
(add_manconv): ... here, now implemented using a custom pre-exec hook.
We no longer have a fall-through if dropping privileges fails, since
that's now harder to do and wasn't really necessary in the first place.
2018-02-07 Colin Watson <cjwatson@debian.org>
Refactor do_system_drop_privs
Now that we have pipecmd_pre_exec, this can be simplified quite a bit.
* lib/security.c (drop_privs): New function.
(do_system_drop_privs_child, do_system_drop_privs): Remove.
* lib/security.h (drop_privs): Add prototype.
(do_system_drop_privs): Remove prototype.
* src/man.c (make_browser): Add drop_privs pre-exec hook to browser
command.
(format_display): Call browser using pipeline_run rather than
do_system_drop_privs, since it now has a pre-exec hook to drop
privileges.
2018-02-07 Colin Watson <cjwatson@debian.org>
Refactor sandbox attachment to be more composable
The sandbox interface now exposes the necessary load/free primitives,
and callers use them directly with pipecmd_pre_exec. This allows the
sandbox to be composed with other pre-exec hooks.
* lib/sandbox.c (man_sandbox_op, sandbox_attach,
sandbox_attach_permissive): Remove.
(sandbox_load): Rename to ...
(_sandbox_load): ... this.
(sandbox_load, sandbox_load_permissive): New functions.
(sandbox_free): Expect a man_sandbox * rather than a man_sandbox_op *.
* lib/sandbox.h: Update prototypes.
* lib/decompress.c (decompress_open, decompress_fdopen): Update sandbox
attachment calls.
* src/lexgrog.l (find_name): Likewise.
* src/man.c (add_col, make_roff_command, add_output_iconv,
make_display_command, open_cat_stream, display_catman): Likewise.
* src/manconv_client.c (add_manconv): Likewise.
* src/straycats.c (check_for_stray): Likewise.
* src/whatis.c (use_grep): Likewise.
2018-02-07 Colin Watson <cjwatson@debian.org>
* NEWS: Fix typo in 2.6.5 notes
2018-02-05 Colin Watson <cjwatson@debian.org>
Fix seccomp sandbox build on Linux/POWER
* lib/sandbox.c [HAVE_LIBSECCOMP]: Include <termios.h>, since some
architectures need this for TCGETS as well as <sys/ioctl.h>.
2018-02-04 Colin Watson <cjwatson@debian.org>
* Version: 2.8.0.
2018-02-04 Colin Watson <cjwatson@debian.org>
Allow ioctl (..., TCGETS, ...)
* lib/sandbox.c (make_seccomp_filter): Allow ioctl (..., TCGETS, ...) in
non-permissive mode (ioctl in general is already allowed in permissive
mode).
2018-02-04 Mario Blättermann <mario.blaettermann@gmail.com>
Update German manual page translation
* man/po4a/po/de.po: Update from Translation Project.
2018-02-03 Rafael Fontenelle <rafaelff@gnome.org>
Update Brazilian Portuguese translations
* po/pt_BR.po, man/po4a/po/pt_BR.po: Update from Translation Project.
* man/THANKS: Update translator email address.
2018-01-27 Joe Hansen <joedalton2@yahoo.dk>
Update Danish manual page translation
* man/po4a/po/da.po: Update from Translation Project.
2018-01-25 Mario Blättermann <mario.blaettermann@gmail.com>
Update German manual page translation
* man/po4a/po/de.po: Update from Translation Project.
2018-01-23 Yuri Kozlov <yuray@komyakino.ru>
Update Russian translations
* po/ru.po, man/po4a/po/ru.po: Update from Translation Project.
2018-01-23 Boyuan Yang <073plan@gmail.com>
Update Simplified Chinese manual page translation
* man/po4a/po/zh_CN.po: Update from Translation Project.
2018-01-23 Sebastian Rasmussen <sebras@gmail.com>
Update Swedish manual page translation
* man/po4a/po/sv.po: Update from Translation Project.
2018-01-23 Rafael Fontenelle <rffontenelle@gmail.com>
Update Brazilian Portuguese manual page translation
* man/po4a/po/pt_BR.po: Update from Translation Project.
2018-01-22 Colin Watson <cjwatson@debian.org>
* Version: 2.8.0-pre2.
* man/po4a/po/man-db-manpages.pot, man/po4a/po/*.po: Update.
2018-01-21 Colin Watson <cjwatson@debian.org>
* Version: 2.8.0-pre1.
2018-01-16 Colin Watson <cjwatson@debian.org>
Minor style cleanups
* src/man.c (sh_lang_first_word, main): Minor style cleanups.
2018-01-16 Colin Watson <cjwatson@debian.org>
NEWS: Document previous commit.
2018-01-16 Neven Sajko <nsajko@gmail.com>
Add fallback pager if the compile-time default is not executable
A problem with man-db's man is that in the case of the user giving no
configuration via conf files, argv, or environment variables; man
defaults to less as pager (PAGER); but less may not be present on the
system. Sure, other pagers may be selected in aforementioned ways, but
then the defaults are overridden, making that unsuitable for
install-time configuration.
This patch makes man check (if that becomes relevant) if PAGER is
executable, further defaulting to cat (which is basically ubiquitous,
being in original Unix, POSIX, and GNU Coreutils) if it is not. Thus
the poor beginner Unix users without less installed will be able to
get man pages.
* src/man.c (sh_lang_first_word): New function.
(main): Skip configured pager if it is not executable.
* man/man1/man.man1 (Controlling formatted output, ENVIRONMENT):
Document fallback to cat.
* man/replace.sin.in: Substitute %cat%.
2018-01-16 Colin Watson <cjwatson@debian.org>
Fix a segfault in 'man -D --help'
Reported by Jiri Kucera.
* src/man.c (init_html_pager): New function.
(parse_opt): Call init_html_pager rather than setting html_pager to
NULL.
(help_filter): Assert that browser is non-NULL.
(main): Call init_html_pager rather than doing the same thing directly.
* NEWS: Document this.
2018-01-03 Colin Watson <cjwatson@debian.org>
Update Simplified Chinese manual page translation
* man/po4a/po/zh_CN.po: Update from Translation Project (trivial).
2018-01-03 Colin Watson <cjwatson@debian.org>
Upgrade config.guess/config.sub
* build-aux/config.guess: Upgrade to 2017-11-07.
* build-aux/config.sub: Upgrade to 2017-11-23.
2018-01-03 Colin Watson <cjwatson@debian.org>
sandbox: Cope with missing CONFIG_SECCOMP_FILTER
* lib/sandbox.c (gripe_seccomp_filter_unavailable): New function.
(can_load_seccomp): Return early if seccomp filtering has already been
detected as unavailable.
(sandbox_load): If seccomp_load returns an EINVAL error, assume that the
running kernel doesn't support seccomp filtering and emit a debugging
message rather than failing.
2018-01-03 Colin Watson <cjwatson@debian.org>
Allow sync_file_range2 syscall
* lib/sandbox.c (make_seccomp_filter): Add sync_file_range2.
2018-01-03 Colin Watson <cjwatson@debian.org>
Fix seccomp sandbox on Linux/ARM
* lib/sandbox.c (make_seccomp_filter): Add arm_fadvise64_64 and
arm_sync_file_range.
2017-12-03 Colin Watson <cjwatson@debian.org>
Use more conventional bullets in documentation
* docs/INSTALL.quick, NEWS, README: Use "*" for bullet points instead of
"o".
2017-12-03 Colin Watson <cjwatson@debian.org>
Confine most untrusted data handling using seccomp
Fixes Debian bug #877199.
* configure.ac: Require libpipeline >= 1.5.0. Call MAN_LIBSECCOMP.
* docs/INSTALL.quick: Bump minimum libpipeline version to 1.5.0. List
libseccomp as recommended.
* lib/Makefile.am (libman_la_CPPFLAGS): Add $(libseccomp_CFLAGS).
(libman_la_SOURCES): Add sandbox.c and sandbox.h.
(libman_la_LDFLAGS): Add $(libseccomp_LIBS).
* lib/sandbox.c: New file.
* lib/sandbox.h: New file.
* m4/man-libseccomp.m4: New file.
* src/man.c (set_term): Check that process ID matches original before
calling tcsetattr.
(get_term): Record original process ID to work around an arguable bug in
pipecmd_exec.
* src/lexgrog_test.c (main), src/man.c (main), src/manconv_main.c
(main), src/mandb.c (main), src/zsoelim_main.c (main): Initialise
sandbox.
* lib/decompress.c (decompress_open, decompress_fdopen): Attach sandbox
to decompression commands.
* src/lexgrog.l (find_name): Attach sandbox to 'col'.
* src/man.c (add_col): Attach sandbox to 'col'.
(make_roff_command): Attach sandbox to 'zsoelim' and to groff-related
programs.
(add_output_iconv): Attach sandbox to 'iconv'.
(make_display_command): Attach sandbox to 'tr'.
(open_cat_stream, display_catman): Attach sandbox to compression
commands.
* src/manconv_client.c (add_manconv): Attach sandbox to manconv_stdin.
* src/straycats.c (check_for_stray): Attach sandbox to 'col'.
* src/whatis.c (use_grep): Attach sandbox to 'grep'.
* src/accessdb.c, src/catman.c, src/globbing_test.c, src/manpath.c:
Define stub sandbox variable.
* docs/NEWS: Document this.
2017-12-02 Colin Watson <cjwatson@debian.org>
Document more installation requirements
* docs/INSTALL.quick: List a database library as required, and zlib as
recommended.
2017-11-22 Colin Watson <cjwatson@debian.org>
Remove Easter egg entirely
Six years is a reasonable shelf life for a joke, but I think its time
has passed now.
* src/man.c (main): Remove Easter egg.
2017-11-21 Philipp Gesang <phg@phi-gamma.net>
Add section 0 to defaults
m4/man-arg-sections.m4: Add 0 (zero) to the default list of sections as
advertised in ``configure --help``.
Cf. commit f3739b9bbde27c702c911ce8a511a499705a25f7
2017-11-21 Colin Watson <cjwatson@debian.org>
Stop Easter egg interfering with non-error cases
* src/man.c (main): Restrict Easter egg to the case where 'man' is run
without any options or arguments at all (which isn't useful for anything
else), not 'man -w' (which is).
https://unix.stackexchange.com/questions/405783/why-does-man-print-gimme-gimme-gimme-at-0030
2017-11-21 Colin Watson <cjwatson@debian.org>
Fix formatting error in Simplified Chinese translation
* man/po4a/po/zh_CN.po: Correct formatting of exit(3tcl) references.
2017-11-16 Boyuan Yang <073plan@gmail.com>
Update Simplified Chinese translations
* po/zh_CN.po, man/po4a/po/zh_CN.po: Update from Translation Project.
* man/THANKS: Add translator credit.
2017-11-13 Colin Watson <cjwatson@debian.org>
Fix docs for minimum libpipeline requirement
* docs/INSTALL.quick: Bump minimum libpipeline version to 1.4.0.
2017-07-17 Colin Watson <cjwatson@debian.org>
Fix formatting error in Turkish translation
* man/po4a/po/tr.po: Translate "\\e-" as itself rather than as "\\(e-".
2017-07-16 Colin Watson <cjwatson@debian.org>
Improve --with-systemdtmpfilesdir default
* m4/man-arg-systemdtmpfilesdir.m4: Get tmpfiles directory location from
pkg-config.
* configure.ac: Call PKG_PROG_PKG_CONFIG early to avoid problems with
conditional use of PKG_* macros.
2017-07-11 Colin Watson <cjwatson@debian.org>
Add Turkish manual page translation
* man/po4a/po/tr.po: New from Translation Project (thanks, Volkan Gezer
and Mesutcan Kurt).
* configure.ac (AC_CONFIG_FILES): Add man/tr/Makefile.
* man/LINGUAS.po4a: Add tr.
* man/Makefile.am (DIST_SUBDIRS): Add tr.
* man/tr/Makefile.am, man/tr/translator.add: New files.
* man/po4a/Makefile.am (POFILES): Add po/tr.po.
* man/po4a/po4a.cfg (po4a_langs): Add tr.
* man/THANKS: Add translator credit.
* .gitignore: Add man/tr/man1, man/tr/man5, and man/tr/man8.
2017-07-10 Colin Watson <cjwatson@debian.org>
* NEWS: Document changes since 2.7.6.1.
2017-07-10 Colin Watson <cjwatson@debian.org>
gnulib: Import memmem module
Needed to make the previous commit portable.
2017-07-10 Colin Watson <cjwatson@debian.org>
Fix preprocessor handling after insertions
If man has added prefixes to a page to handle such things as disabling
hyphenation, then it also needs to take account of that when looking for
a preprocessor line at the start of the page.
Reported by Bjarni Ingi Gislason. Fixes Debian bug #867857.
* src/man.c (get_preprocessors_from_file): Skip over as many blocks
ending with an .lf macro as there are prefixes.
(get_preprocessors): Pass the number of prefixes through to
get_preprocessors_from_file.
(make_roff_command): Take pp_string as an argument rather than
dbfilters; callers should now call get_preprocessors themselves.
(display): Rename seq_ncmds to prefixes. Call get_preprocessors before
calling make_roff_command.
2017-07-10 Colin Watson <cjwatson@debian.org>
Upgrade to Automake 1.15.1.
2017-07-10 Colin Watson <cjwatson@debian.org>
Handle \(en escapes in NAME section
* src/lexgrog.l (MAN_NAME): Treat "\(en" as another synonym for "\-",
and thus as a separator.
2017-04-08 Volkan Gezer <volkangezer@gmail.com>
Update Turkish translation
* po/tr.po: Update from Translation Project.
2017-04-04 Volkan Gezer <volkangezer@gmail.com>
Add Turkish translation
* po/tr.po: New from Translation Project.
* po/LINGUAS: Add tr.
* man/THANKS: Add translator credit.
2017-01-29 Felipe Castro <fefcas@gmail.com>
Update Esperanto translation
* po/eo.po: Update from Translation Project.
2017-01-07 Sebastian Rasmussen <sebras@gmail.com>
Update Swedish translation
* po/sv.po: Update from Translation Project.
2017-01-04 Colin Watson <cjwatson@debian.org>
Add Brazilian Portuguese manual page translation
* man/po4a/po/pt_BR.po: New from Translation Project (thanks, Rafael
Fontenelle).
* configure.ac (AC_CONFIG_FILES): Add man/pt_BR/Makefile.
* man/LINGUAS.po4a: Add pt_BR.
* man/Makefile.am (DIST_SUBDIRS): Add pt_BR.
* man/pt_BR/Makefile.am, man/pt_BR/translator.add: New files.
* man/po4a/Makefile.am (POFILES): Add po/pt_BR.po.
* man/po4a/po4a.cfg (po4a_langs): Add pt_BR.
* man/THANKS: Add translator credit.
* .gitignore: Add man/pt_BR/man1, man/pt_BR/man5, and man/pt_BR/man8.
2016-12-28 Sebastian Rasmussen <sebras@gmail.com>
Update Swedish manual page translation
* man/po4a/po/sv.po: Update from Translation Project.
2016-12-23 David Prévot <david@tilapin.org>
Update French manual page translation
* man/po4a/po/fr.po: Update from Translation Project.
2016-12-23 David Prévot <david@tilapin.org>
Update French translation
* po/fr.po: Update from Translation Project.
2016-12-22 Robert Luberda <robert@debian.org>
Update Polish manual page translation
* man/po4a/po/pl.po: Update from Translation Project.
2016-12-22 Robert Luberda <robert@debian.org>
Update Polish translation
* po/pl.po: Update from Translation Project.
2016-12-19 Colin Watson <cjwatson@debian.org>
Add Serbian manual page translation
* man/po4a/po/sr.po: New from Translation Project (thanks, Мирослав
Николић).
* configure.ac (AC_CONFIG_FILES): Add man/sr/Makefile.
* man/LINGUAS.po4a: Add sr.
* man/Makefile.am (DIST_SUBDIRS): Add sr.
* man/sr/Makefile.am, man/sr/translator.add: New files.
* man/po4a/Makefile.am (POFILES): Add po/sr.po.
* man/po4a/po4a.cfg (po4a_langs): Add sr.
* man/THANKS: Add translator credit.
* .gitignore: Add man/sr/man1, man/sr/man5, and man/sr/man8.
2016-12-19 Мирослав Николић <miroslavnikolic@rocketmail.com>
Update Serbian translation
* po/sr.po: Update from Translation Project.
2016-12-13 Joe Hansen <joedalton2@yahoo.dk>
Update Danish manual page translation
* man/po4a/po/da.po: Update from Translation Project.
2016-12-13 Colin Watson <cjwatson@debian.org>
Generate tmpfiles snippet based on cache owner
man-db.conf should honour --enable-cache-owner rather than hardcoding
"man".
* init/systemd/man-db.conf: Rename to ...
* init/systemd/man-db.conf.in: ... this. Replace "man" with
"@man_owner@".
* init/systemd/Makefile.am: Generate man-db.conf at build time.
* .gitignore: Add init/systemd/man-db.conf.
2016-12-13 Colin Watson <cjwatson@debian.org>
Fix locale macro loading for Chinese
The intent was always that we should load the macro file corresponding
to just the language part of the page's locale, and the debug output
agreed with this, but the actual implementation did not. Fix this.
See: https://savannah.gnu.org/bugs/?44941
* src/man.c (display): Pass bits.language rather than page_lang to
locale_macros. Adjust memory allocation.
2016-12-13 Colin Watson <cjwatson@debian.org>
Rename SECURE_MAN_UID to MAN_OWNER
The latter had always been defined to the former anyway, and now that
the cache owner can be changed without actually installing setuid the
latter is more descriptive.
* m4/man-arg-cache-owner.m4: Define MAN_OWNER rather than
SECURE_MAN_UID. Update all users.
* include/manconfig.h.in (MAN_OWNER): Remove definition.
2016-12-13 Colin Watson <cjwatson@debian.org>
Mark some parts of .TH sections as untranslatable
* man/po4a/Locale/Po4a/Manext.pm (translate): Don't translate anything
matching /^%.*%$/ or /^[A-Z]+$/ in .TH sections.
* man/po4a/po/man-db-manpages.pot, man/po4a/po/*.po: Update.
2016-12-13 Tianze Wang <zwpwjwtz@126.com>
Update Simplified Chinese manual page translation
* man/po4a/po/zh_CN.po: Update from Translation Project.
* man/THANKS: Update.
2016-12-13 Trần Ngọc Quân <vnwildman@gmail.com>
Update Vietnamese translation
* po/vi.po: Update from Translation Project.
2016-12-13 Colin Watson <cjwatson@debian.org>
Correct syntax of Danish manual page translation
* man/po4a/po/da.po: Fix a couple of font specifications.
2016-12-13 Rafael Fontenelle <rffontenelle@gmail.com>
Update Brazilian Portuguese translation
* po/pt_BR.po: Update from Translation Project.
* man/THANKS: Update.
2016-12-13 Joe Hansen <joedalton2@yahoo.dk>
Update Danish manual page translation
* man/po4a/po/da.po: Update from Translation Project.
2016-12-12 Joe Hansen <joedalton2@yahoo.dk>
Update Danish translation
* po/da.po: Update from Translation Project.
2016-12-12 Mario Blättermann <mario.blaettermann@gmail.com>
Update German manual page translation
* man/po4a/po/de.po: Update from Translation Project.
2016-12-12 Mario Blättermann <mario.blaettermann@gmail.com>
Update German translation
* po/de.po: Update from Translation Project.
* man/THANKS: Update.
2016-12-12 Colin Watson <cjwatson@debian.org>
* Version: 2.7.6.1.
2016-12-12 Colin Watson <cjwatson@debian.org>
Correct installation of Swedish manual pages
* man/sv/Makefile.am (LINGUA): Set to sv, not nl.
* NEWS: Document this.
2016-12-12 Colin Watson <cjwatson@debian.org>
* NEWS: Document previous change.
2016-12-12 Colin Watson <cjwatson@debian.org>
Don't chmod CACHEDIR.TAG if it doesn't exist
The containing directory might reasonably not exist. Fixes Debian
bug #847810.
* src/mandb.c (mandb): Only chown/chmod CACHEDIR.TAG if it exists.
2016-12-11 Colin Watson <cjwatson@debian.org>
* Version: 2.7.6.
2016-12-11 Colin Watson <cjwatson@debian.org>
Fix systemd tmpfiles group/perms of /var/cache/man
* init/systemd/man-db.conf: Change mode to 0755 and group to man.
2016-12-11 Colin Watson <cjwatson@debian.org>
Fix Polish mandb(8) "cannot adjust line" warnings
* man/man8/mandb.man8 (DATABASE CACHES): Set a width of 20em for the
"Type" column.
2016-12-11 Colin Watson <cjwatson@debian.org>
Drop documentation of gdbm < 1.6
gdbm 1.6 was released in 1993; it's no longer necessary to document
mandb's behaviour with older versions.
* man/man8/mandb.man8 (DATABASE CACHES): Remove "GNU gdbm v < 1.6" row.
Simplify "GNU gdbm v >= 1.6" to "GNU gdbm". Update all translations.
2016-12-11 Colin Watson <cjwatson@debian.org>
Fix table rendering with po4a 0.47
* man/po4a/Locale/Po4a/Manext.pm (initialize): Drop unused assignment.
(shiftline, pushline): Pass through to superclass if po4a version >=
0.47.
(translate): With po4a >= 0.47, don't process text blocks since po4a now
does that, but handle @-separation of columns and remove trailing
newlines from translatable strings.
* man/po4a/po/man-db-manpages.pot, man/po4a/po/*.po: Update (line
numbers only).
* NEWS: Document this.
2016-12-11 Colin Watson <cjwatson@debian.org>
Fix distcheck following cache-owner/setuid changes
We previously ignored chown failures on "make install", but that's not
really correct. Instead, configure with --disable-setuid during
distcheck.
* Makefile.am (AM_DISTCHECK_CONFIGURE_FLAGS): Add --disable-setuid.
2016-12-11 Colin Watson <cjwatson@debian.org>
Update translation files
* po/man-db.pot, po/*.po: Update.
* man/po4a/po/man-db-manpages.pot, man/po4a/po/*.po: Update.
2016-12-11 Colin Watson <cjwatson@debian.org>
* NEWS: Document changes since 2.7.5.
2016-12-11 Mihail Konev <k.mvc@ya.ru>
src/tests: Use /tmp for temporary directories
Reduces disk reads/writes made by 'make check -C src'.
Fall back to ./tmp-* if 'mktemp -d' fails.
2016-12-10 Colin Watson <cjwatson@debian.org>
Eliminate dangerous setgid-root directories
man-db has created its cache directories as setgid root for nearly 20
years. This seems to have originated in https://bugs.debian.org/26002.
However, this has some dangerous consequences, such as:
http://www.halfdog.net/Security/2015/SetgidDirectoryPrivilegeEscalation/
It seems best to arrange for cache files and directories to be man:man
rather than man:root. To do this reliably, as well as adjusting various
chown and chmod calls, we make man and mandb be setgid man as well as
setuid man (except in the --disable-setuid case). This is a much
simpler and safer solution to the original problem, and doesn't
introduce any interesting new privilege since the man group's only real
purpose is to be the man user's primary group and nothing in cache
directories is group-writeable.
* configure.ac (AC_CHECK_FUNCS): Add lchown.
* lib/security.c (init_security): Record initial real and effective
group IDs as well as user IDs.
(drop_effective_privs, regain_effective_privs): Update gid.
* lib/xchown.c (xlchown) [HAVE_LCHOWN]: New function.
* lib/xchown.c (xlchown) [HAVE_LCHOWN]: Add prototype.
* m4/man-arg-setuid.m4: Set man_mode to 6755 rather than 4755 in the
--enable-setuid case.
* src/Makefile.am (install-exec-hook): Check for man_mode being 6755
rather than 4755. Set the group of man and mandb as well as their
owner.
* src/check_mandirs.c (chown_if_possible): New function. This is
somewhat more careful than previous implementations, changes the group
as well as the user if possible, and prefers lchown if it is available.
(mkcatdirs): Drop S_ISGID from cat directories. Use chown_if_possible.
(fix_permissions, fix_permissions_tree): New functions to remove setgid
bit from existing cat directories.
(testmandirs): Call fix_permissions_tree.
* src/check_mandirs.h (chown_if_possible): Add prototype.
* src/man.c (commit_tmp_cat): Set cat file group as well as owner.
* src/mandb.c (check_chown): Remove.
(do_chown): Stop taking a uid parameter. Use chown_if_possible.
(mandb): Use chown_if_possible for CACHEDIR.TAG. Set ownership and
permissions of CACHEDIR.TAG even if it already exists.
(process_manpath): Set ownership of database files even if they have not
been changed.
2016-12-10 Colin Watson <cjwatson@debian.org>
Make --disable-cache-owner imply --disable-setuid
* m4/man-arg-setuid.m4: Set man_mode="755" if --disable-cache-owner was
given and neither --enable-setuid nor --disable-setuid was given.
2016-12-10 Colin Watson <cjwatson@debian.org>
Update manual for cache-owner/setuid changes
* manual/intro.me (Arguments to configure): Add --enable-cache-owner and
--disable-cache-owner. Remove --enable-setuid[=ARG]. Adjust
description of --disable-setuid.
* manual/misc.me (Modes of operation): Add --disable-cache-owner to the
non-setuid modes. Mention --enable-setuid rather than
--enable-setuid=USER.
* README (Non-generic arguments to configure): Update.
2016-12-10 Colin Watson <cjwatson@debian.org>
Allocate dbpaths on the heap rather than the stack
process_manpath's stack may have gone out of scope by the time cleanup
functions are called.
* src/mandb.c (cleanup): Free dbpaths.
(process_manpath): Allocate dbpaths on the heap.
2016-12-10 Colin Watson <cjwatson@debian.org>
Handle cleanup stack more safely
If push_cleanup was called unexpectedly between a
push_cleanup/pop_cleanup pair, then the pop_cleanup would remove the
wrong cleanup function and chaos could ensue. Avoid this by being more
precise about which cleanup function should be popped.
* lib/cleanup.c (pop_cleanup): Take "fun" and "arg" arguments. Pop the
topmost matching function from the stack, rather than just the topmost
function. Update all callers and prototypes.
2016-12-09 Colin Watson <cjwatson@debian.org>
Upgrade config.guess/config.sub
* build-aux/config.guess: Upgrade to 2016-10-02.
* build-aux/config.sub: Upgrade to 2016-11-04.
2016-12-09 Colin Watson <cjwatson@debian.org>
Separate cache owner from --enable-setuid option
It's useful to have a notion of the cache owner even when man is not
installed setuid. --enable-setuid no longer takes an argument, and the
owner is now set by the --enable-cache-owner option instead.
* m4/man-arg-cache-owner.m4: New file.
* m4/man-arg-setuid.m4: Stop accepting an argument. Only set man_mode,
not man_owner.
* configure.ac: Call MAN_ARG_CACHE_OWNER.
* src/Makefile.am (install-exec-hook): Only chown man and mandb if
man_mode is 4755 (as well as the existing test for man_owner being
non-empty).
2016-11-21 Colin Watson <cjwatson@debian.org>
Restore ylwrap to distribution
* Makefile.in (am__DIST_COMMON): Regenerate to add build-aux/ylwrap back
again, since it mysteriously went missing in the last regeneration.
2016-11-21 Colin Watson <cjwatson@debian.org>
Update translation files
* po/man-db.pot, po/*.po: Update.
2016-11-21 Colin Watson <cjwatson@debian.org>
Upgrade to Libtool 2.4.6-2 (from Debian)
2016-11-21 Colin Watson <cjwatson@debian.org>
Upgrade config.guess/config.sub
* build-aux/config.guess: Upgrade to 2016-04-02.
* build-aux/config.sub: Upgrade to 2016-03-30.
2016-11-20 Mihail Konev <k.mvc@ya.ru>
src/tests: Fix testsuite
* src/tests/man-9: Set MANPATH.
2016-11-20 Mihail Konev <k.mvc@ya.ru>
man(1): Fix gcc warnings
* lib/xchown.c: New file.
* lib/xchown.h: New file.
* lib/Makefile.am (libman_la_SOURCES): Add xchown.c and xchown.h.
* po/POTFILES.in: Add lib/xchown.c.
* src/check_mandirs.c (mkcatdirs): Call xchown instead of chown.
* src/man.c (format_display): Ignore errors from chdir ("/").
2016-11-20 Colin Watson <cjwatson@debian.org>
Make split_page_name allocate its own memory
* src/man.c (split_page_name): Allocate *ret_name and *ret_section here.
Simplify using xstrdup and xstrndup.
(man): Remove allocation of page_name and page_section.
2016-11-20 Mihail Konev <k.mvc@ya.ru>
man(1): add .N names
`man chmod.2` is now the same as `man 2 chmod`
* src/man.c (split_page_name): New function.
(locate_page_in_manpath): New function.
(man): Factor out common locate_page loop into locate_page_in_manpath.
Add name/section splitting logic.
* src/tests/man-11: New file.
* src/tests/Makefile.am (ALL_TESTS): Add man-11.
* man/man1/man.man1 (SYNOPSIS): Document <page>.<section> form.
(EXAMPLES): Likewise.
2016-10-04 Colin Watson <cjwatson@debian.org>
Fix formatting error in Swedish translation
* man/po4a/po/sv.po: Translate "\\(rq" as itself rather than as "\\(".
2016-10-04 Colin Watson <cjwatson@debian.org>
Rename some anomalous x* functions
The usual (though not universal) pattern in gnulib is for xfoo to mean
"foo or exit". Rename x* to check_* so that they don't conflict with
this.
* src/mandb.c (xremove): Rename to ...
(check_remove): ... this.
(xrename): Rename to ...
(check_rename): ... this.
(xchmod): Rename to ...
(check_chmod): ... this.
(xchown): Rename to ...
(check_chown): ... this.
2016-05-16 Colin Watson <cjwatson@debian.org>
man(1): Fix incorrect font
* man/man1/man.man1 (SYNOPSIS): Make "--regex" bold. Thanks to Paul
Townsend.
* man/po4a/po/man-db-manpages.pot, man/po4a/po/*.po: Update; unfuzzy all
translations.
2016-05-16 Colin Watson <cjwatson@debian.org>
* man/po4a/po/man-db-manpages.pot, man/po4a/po/*.po: Update.
2016-02-04 Colin Watson <cjwatson@debian.org>
Note caveat with "man -K"
* man/man1/man.man1 (Main modes of operation): Note that -K searches
page source. Fixes Debian bug #813665.
2016-01-02 Sebastian Rasmussen <sebras@gmail.com>
* po/sv.po: Add missing translator credit comment.
2016-01-02 Colin Watson <cjwatson@debian.org>
Fix warnings with Perl 5.22
* man/po4a/Locale/Po4a/Manext.pm (shiftline, translate): Escape braces
in regular expressions.
2016-01-02 Colin Watson <cjwatson@debian.org>
Add Swedish manual page translation
* man/po4a/po/sv.po: New from Translation Project (thanks, Sebastian
Rasmussen).
* configure.ac (AC_CONFIG_FILES): Add man/sv/Makefile.
* man/LINGUAS.po4a: Add sv.
* man/Makefile.am (DIST_SUBDIRS): Add sv.
* man/sv/Makefile.am, man/sv/translator.add: New files.
* man/po4a/Makefile.am (POFILES): Add po/sv.po.
* man/po4a/po4a.cfg (po4a_langs): Add sv.
* man/THANKS: Add translator credit.
* .gitignore: Add man/sv/man1, man/sv/man5, and man/sv/man8.
2015-12-31 Colin Watson <cjwatson@debian.org>
Upgrade to pkg-config 0.29.
2015-12-26 Sebastian Rasmussen <sebras@gmail.com>
Update Swedish translation
* po/sv.po: Update from Translation Project.
* man/THANKS: Add translator credit.
2015-12-07 Colin Watson <cjwatson@debian.org>
Simplify database path handling in mandb
* src/mandb.c (struct dbpaths): Unconstify xtmpfile.
(finish_up): Free dbpaths->xtmpfile.
(cleanup): Update header comment. Remove unnecessary checks before
frees. Free all database paths for all database types, not just
GDBM. Free dbpaths->xtmpfile.
(mandb): Copy content of database to dbpaths->xtmpfile rather than
just copying the pointer.
2015-12-07 Colin Watson <cjwatson@debian.org>
Move some database paths out of global variables
* src/mandb.c (struct dbpaths): New structure.
(finish_up, do_chown, cleanup_sigsafe, cleanup, mandb): Take dbpaths
argument.
(process_manpath): Allocate dbpaths on the stack, zero it, and pass
it to functions that need it.
2015-12-07 Colin Watson <cjwatson@debian.org>
Remove lots of unnecessary inline qualifiers
It's 2015. The compiler almost certainly knows better than we do.
* lib/security.c (gripe_set_euid): Remove inline qualifier.
* libdb/db_btree.c (btree_findkey): Likewise.
* libdb/mydbm.h (gdbm_exists): Likewise.
* src/catman.c (catman): Remove obsolete comment.
(add_arg, check_access): Remove inline qualifier.
* src/check_mandirs.c (add_dir_entries): Likewise.
* src/man.c (gripe_system, gripe_no_man, manopt_to_env, escape_less,
is_section, do_prompt, gripe_converting_name): Likewise.
* src/mandb.c (xremove, xrename, xchmod, finish_up, xchown,
do_chown, update_db_wrapper): Likewise.
* src/manp.c (gripe_reading_mp_config, gripe_stat_file,
gripe_not_directory, has_mandir, fsstnd): Likewise.
* src/whatis.c (do_whatis_section): Likewise.
2015-11-06 Colin Watson <cjwatson@debian.org>
Belatedly update NEWS date.
* Version: 2.7.5.
* NEWS: Document changes since 2.7.4.
2015-11-06 Colin Watson <cjwatson@debian.org>
Build text manual with LC_ALL=C
nroff's UTF-8 output is a bit wonky in this case, but ASCII will do
fine.
* manual/Makefile.am (.pp.cat): Set LC_ALL=C.
2015-11-05 Colin Watson <cjwatson@debian.org>
Disable roff input insertion with --recode
Reported by Bjarni Ingi Gislason. Fixes Debian bug #751795.
* src/man.c (display): Don't insert roff input for --no-hyphenation,
--no-justification, or locale macros when the --recode option is used.
2015-11-05 Colin Watson <cjwatson@debian.org>
Adjust line number when inserting extra roff input
Reported by Bjarni Ingi Gislason. Fixes Debian bug #789219.
* src/man.c (heirloom_line_length, disable_hyphenation,
disable_justification, locale_macros): Emit ".lf 1" after inserted roff
input.
* src/zsoelim.l: Accept .lf without a file name argument.
2015-10-19 Colin Watson <cjwatson@debian.org>
Make a mandb error message clearer
* src/mandb.c (xcopy): Say which file name we failed to fopen.
2015-10-08 Colin Watson <cjwatson@debian.org>
Fix Plural-Forms header in Catalan translation
* po/ca.po (Plural-Forms): Add missing semicolon.
2015-10-08 Colin Watson <cjwatson@debian.org>
* Version: 2.7.4.
2015-10-08 Colin Watson <cjwatson@debian.org>
man: Honour MANWIDTH in conjunction with -Z
* src/man.c (get_roff_line_length): Also consider line_length if
ditroff is set.
(make_roff_command): Try add_roff_line_length regardless of troff.
The line length is passed to the macro package, not to the output
device, although get_roff_line_length will still sometimes not use
it (e.g. if using the "ps" device). Fixes Debian bug #801241.
* NEWS: Document this.
2015-10-08 Colin Watson <cjwatson@debian.org>
man: Exit 3 if formatter exits non-zero
* src/man.c (format_display): Keep track of exit statuses from both
format_cmd and disp_cmd, and exit CHILD_FAIL if either is non-zero
and non-SIGPIPE. Fixes Debian bug #801261.
* NEWS: Document this.
2015-09-22 Colin Watson <cjwatson@debian.org>
Fix replace.sed prerequisite syntax
Suffix rules may not have prerequisites. Thanks to Nikola Forró; fixes
Fedora bug #1263930.
* man/Rules.man: Declare dependency of $(MANS) on replace.sed
separately rather than trying to do so in suffix rules.
* NEWS: Document this.
2015-09-22 Colin Watson <cjwatson@debian.org>
Fix crash in manpath deduplication
* src/manp.c (create_pathlist): Handle NULL return from
canonicalize_file_name.
* NEWS: Document this.
2015-09-22 Colin Watson <cjwatson@debian.org>
Upgrade config.guess/config.sub
* build-aux/config.guess, build-aux/config.sub: Upgrade to
2015-08-20.
2015-09-21 Nikola Forró <nforro@redhat.com>
Fix typos in italian manpath man page
2015-09-16 zwpwjwtz <zwpwjwtz@126.com>
Update Simplified Chinese manual page translation
* man/po4a/po/zh_CN.po: Update from Translation Project.
* man/THANKS: Add translator credit.
2015-09-09 Colin Watson <cjwatson@debian.org>
* Version: 2.7.3.
2015-09-09 Colin Watson <cjwatson@debian.org>
Pacify gcc -Wlogical-not-parentheses
* src/man.c (find_cat_file): Add extra parentheses around
logical-not on the LHS of a comparison.
* lib/util.c (is_changed): Likewise in header comment.
2015-09-09 OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Restore the ability to use 'man -a' noninteractively
Fixes Debian bug #798094.
* src/man.c (do_prompt): Return 0 immediately (i.e. view) if neither
stdin nor stdout is a tty.
* NEWS: Document this.
2015-09-09 Mike Frysinger <vapier@gentoo.org>
Fix crash when current directory is unreadable
Fixes Savannah bug #45861.
* src/man.c (make_display_command): Check have_cwd before trying to
use cwd.
* NEWS: Document this.
2015-09-09 Colin Watson <cjwatson@debian.org>
Document squeeze-blank-lines fix
* NEWS: Document Rafael's squeeze-blank-lines fix.
2015-09-09 Colin Watson <cjwatson@debian.org>
Fix use-after-free in ult_src
Reported by Hanno Boeck. Fixes Savannah bug #45854.
* src/ult_src.c (ult_src): Take a copy of base when recursing rather
than passing it directly as the new name argument, since it may be
freed by the recursive call.
* NEWS: Document this.
2015-09-09 Colin Watson <cjwatson@debian.org>
Remove unnecessary check before free
* src/ult_src.c (ult_src): Don't check whether base is non-NULL
before freeing it.
2015-08-30 Rafael Kitover <rkitover@gmail.com>
Squeeze blank lines internally instead of pager -s
Add a pipecmd in make_display_command to combine multiple blank lines in
the output into one, which is what e.g. less -s does.
Stop automatically appending -s to pager command in configure.
Fixes Debian bug #796584.
* configure.ac: Stop automatically appending -s to pager command.
* src/man.c (squeeze_blank_lines): New function.
(make_display_command): Add squeeze_blank_lines to display pipeline.
2015-08-29 Colin Watson <cjwatson@debian.org>
Make sure CACHEDIR.TAG has correct ownership
* src/mandb.c (mandb): Change CACHEDIR.TAG's owner to
man_owner->pw_uid when running as root in global manpaths.
(process_manpath): Pass global_manpath to mandb.
2015-08-29 Colin Watson <cjwatson@debian.org>
Rewrite CACHEDIR.TAG and databases if they cannot be read
Fixes Debian bug #797019.
* src/mandb.c (mandb): Rewrite CACHEDIR.TAG and databases if they
cannot be read (probably due to incorrect ownership).
* NEWS: Document this.
2015-08-22 Colin Watson <cjwatson@debian.org>
Try to get terminal width from /dev/tty
If man is running within something like lesspipe, then there may be
a current tty that neither stdin nor stdout points to. Try to get
hold of it using /dev/tty. Fixes Fedora bug #1255930.
* lib/linelength.c (get_line_length): Try /dev/tty before either
stdout or stdin.
* NEWS: Document this.
2015-08-16 Colin Watson <cjwatson@debian.org>
* Version: 2.7.2.
2015-08-16 Jordi Mallach <jordi@gnu.org>
* po/ca.po: Update from Translation Project.
2015-08-16 Colin Watson <cjwatson@debian.org>
Upgrade to Automake 1:1.15-3 (from Debian).
* NEWS: Document a couple more changes since 2.7.1.
2015-08-02 Colin Watson <cjwatson@debian.org>
Upgrade to Automake 1.15.
2015-08-02 Colin Watson <cjwatson@debian.org>
Fix inaccurate description of "man -f"
It's equivalent to "whatis", not "whatis -r". Fixes Fedora
bug #1249377.
* man/man1/man.man1 (EXAMPLES): "man -k" and "man -f" are equivalent to
"apropos" and "whatis" respectively, not "apropos -r" and "whatis -r".
* man/po4a/po/man-db-manpages.pot, man/po4a/po/*.po: Update; unfuzzy all
translations.
2015-08-02 Lauri Nurmi <lanurmi@iki.fi>
* po/fi.po: Update from Translation Project.
2015-04-08 Colin Watson <cjwatson@debian.org>
Allow using GDBM's NDBM compatibility layer
This isn't very useful in practice since anyone using this could just
use GDBM directly instead, but it's helpful for testing.
* configure.ac: Check for gdbm-ndbm.h and libgdbm_compat.
2015-04-08 Colin Watson <cjwatson@debian.org>
Clean up freeing of datum structures
* libdb/mydbm.h (MYDBM_FREE): Remove.
(MYDBM_FREE_DPTR): New macro. This zeros the data pointer to avoid
double-free problems.
* libdb/db_delete.c (dbdelete): Use MYDBM_FREE_DPTR.
* libdb/db_gdbm.c (man_gdbm_open_wrapper, sortkey_hashtable_free):
Likewise.
* libdb/db_lookup.c (dblookup, dblookup_pattern): Likewise.
* libdb/db_store.c (dbstore): Likewise.
* libdb/db_ver.c (dbver_rd, dbver_wr): Likewise.
* src/accessdb.c (main): Likewise.
* src/catman.c (parse_for_sec): Likewise.
* src/check_mandirs.c (sanity_check_db, purge_pointers, purge_missing):
Likewise.
* src/whatis.c (do_apropos): Likewise.
2015-04-08 Colin Watson <cjwatson@debian.org>
Stop storing the database handle in a global variable
Fixes Ubuntu bug #1304261.
* libdb/db_delete.c (dbdelete): Take a dbf parameter. Update all
callers and prototypes.
* libdb/db_lookup.c (dblookup, dblookup_all, dblookup_exact,
dblookup_pattern): Likewise.
* libdb/db_store.c (replace_if_necessary, dbstore): Likewise.
* src/check_mandirs.c (test_manfile, add_dir_entries, sanity_check_db,
purge_pointers, purge_normal, purge_whatis): Likewise.
* src/descriptions_store.c (store_descriptions): Likewise.
* src/straycats.c (check_for_stray, open_catdir): Likewise.
* src/whatis.c (resolve_pointers, display, do_whatis_section, do_whatis,
do_apropos): Likewise.
* src/accessdb.c (main): Declare dbf here rather than at file scope.
* src/catman.c (parse_for_sec): Likewise.
* src/check_mandirs.c (testmandirs, update_db_time, update_db,
purge_missing): Likewise.
* src/man.c (dbdelete_wrapper, try_db): Likewise.
* src/mandb.c (update_one_file): Likewise.
* src/straycats.c (straycats): Likewise.
* src/whatis.c (search): Likewise.
* libdb/mydbm.h (dbf): Remove.
* src/catman.c (dbf): Rename to ...
(dbf_close_post_fork): ... this.
(rdopen_db): Merge into ...
(parse_for_sec): ... here.
2015-03-05 Colin Watson <cjwatson@debian.org>
man: Avoid dubious use of freopen to reopen base streams
freopen doesn't actually work properly when base streams have been
closed (at least with glibc), and it seems better to simply refuse to
operate in such a non-conforming environment.
* src/man.c (check_standard_fds): New function.
(main): Call it rather than using freopen.
2014-11-16 Colin Watson <cjwatson@debian.org>
Allow building from git without gnulib-tool
Since we don't want to keep Gnulib translations in revision control,
we need gnulib-tool on $PATH when generating the build system in
order to fetch them, but it's unnecessarily awkward to require
everyone to have this just in order to build man-db from git. Allow
building without this, although it is still required for "make
dist".
* configure.ac: No longer issue an error if gnulib/po/Makefile.in.in
is missing. Instead, set the Automake conditional HAVE_GNULIB_PO to
true if and only if gnulib/po/POTFILES.in exists, and only create
gnulib/po/Makefile.in if gnulib/po/Makefile.in.in exists.
* Makefile.am (SUBDIRS): Only include gnulib/po if HAVE_GNULIB_PO is
true.
2014-11-14 Colin Watson <cjwatson@debian.org>
apropos/whatis: Don't truncate names if long output was requested
* src/whatis.c (display): Leave page_name intact if long_output is
true. Reported by Calle Erlandsson.
2014-11-11 David Prévot <david@tilapin.org>
* man/po4a/po/fr.po: Update from Translation Project.
2014-11-08 Colin Watson <cjwatson@debian.org>
Pass -l through to apropos/whatis
Fixes Fedora bug #1161747.
* src/man.c (do_extern): Pass the -l option through.
2014-11-07 Colin Watson <cjwatson@debian.org>
* Version: 2.7.1.
2014-10-27 Colin Watson <cjwatson@debian.org>
Send 'man -a' prompts to /dev/tty
Fixes Debian bug #766113.
* src/man.c (locale_macros): Write prompts to and read replies from
/dev/tty, rather than stderr and stdin respectively.
* NEWS: Document this.
2014-10-27 Colin Watson <cjwatson@debian.org>
Make man run correctly from a deleted directory
Fixes Debian bug #764384.
* gnulib: Import save-cwd module.
* src/man.c (make_display_command): Use pipecmd_fchdir rather than
pipecmd_chdir if the working directory was saved using a file
descriptor.
(format_display, main): Save current working directory using
save_cwd rather than xgetcwd.
(format_display, local_man_loop, main): Restore previous working
directory using restore_cwd rather than chdir.
* src/tests/man-10: New file.
* src/tests/Makefile.am (TESTS_ENVIRONMENT): Insert the parent
directory into $PATH using an absolute path rather than a relative
one. Export abs_top_builddir rather than top_builddir.
(ALL_TESTS): Add man-10.
* src/tests/testlib.sh (init): Set abstmpdir. Adjust tests to use
this where applicable.
(run): Call libtool using an absolute path.
(skip): Remove abstmpdir.
(finish): Remove abstmpdir rather than tmpdir.
* configure.ac: Require libpipeline >= 1.4.0.
* NEWS: Document this.
2014-10-22 Colin Watson <cjwatson@debian.org>
NEWS: Document recent Solaris portability changes
2014-10-22 Colin Watson <cjwatson@debian.org>
Fix linking of fspause on Solaris
* src/tests/fspause.c (main): Set program_name. Patch by Peter Bray.
2014-10-22 Colin Watson <cjwatson@debian.org>
autogen.sh: Avoid "export VARIABLE=value" syntax
Older Solaris shells do not support this. Patch by Peter Bray.
2014-10-22 Colin Watson <cjwatson@debian.org>
gnulib: Import strcasestr module.
Suggested by Peter Bray.
2014-10-05 Joe Hansen <joedalton2@yahoo.dk>
* man/po4a/po/da.po: Update from Translation Project.
2014-09-27 Colin Watson <cjwatson@debian.org>
* Version: 2.7.0.2.
2014-09-27 Colin Watson <cjwatson@debian.org>
Work around lack of UTIME_* on GNU/Hurd
* gnulib/fdutimens-hurd.patch: New file.
* autogen.sh: Apply gnulib/fdutimens-hurd.patch.
* NEWS: Document this.
2014-09-27 Colin Watson <cjwatson@debian.org>
Avoid using or double-closing closed database handles
Thanks to Andreas Radke and Bruce Dubbs for reporting, and to
Andreas Radke for testing.
* src/check_mandirs.c (testmandirs): Close dbf if necessary before
(re-)opening it. Zero out dbf after closing it.
(update_db_time, purge_missing): Zero out dbf after closing it.
* src/man.c (dbdelete_wrapper, try_db): Likewise.
* src/mandb.c (update_one_file): Likewise.
* src/straycats.c (straycats): Likewise.
* src/whatis.c (search): Likewise.
* NEWS: Document this.
2014-09-24 Colin Watson <cjwatson@debian.org>
* Version: 2.7.0.1.
* Makefile.am (EXTRA_DIST): Add gnulib/m4/sockpfaf.m4.
2014-09-23 Colin Watson <cjwatson@debian.org>
Fix tests when build fs does not support high-precision timestamps
* gnulib: Import nanosleep module.
* configure.ac: Remove STAT_HAS_NSEC substitution.
* src/tests/Makefile.am (TESTS_ENVIRONMENT): Stop exporting
STAT_HAS_NSEC.
(AM_CPPFLAGS, AM_CFLAGS, check_PROGRAMS, fspause_SOURCES,
fspause_LDADD): Add.
* src/tests/fspause.c: New file.
* src/tests/mandb-2, src/tests/mandb-3, src/tests/mandb-4,
src/tests/mandb-5: Call ./fspause rather than next_second.
* src/tests/testlib.sh (next_second): Remove.
* .gitignore: Add src/tests/.deps and src/tests/fspause.
* NEWS: Document this.
2014-09-22 Colin Watson <cjwatson@debian.org>
* Version: 2.7.0.
2014-09-19 Yuri Kozlov <yuray@komyakino.ru>
* man/po4a/po/ru.po: Update from Translation Project.
2014-09-18 Mario Blättermann <mario.blaettermann@gmail.com>
* man/po4a/po/de.po: Update from Translation Project.
2014-09-18 Robert Luberda <robert@debian.org>
* man/po4a/po/pl.po: Update from Translation Project.
2014-09-18 Colin Watson <cjwatson@debian.org>
Move zsoelim to pkglibexecdir
This avoids clashes with other packages; for example, Slackware's groff
package installs zsoelim as a symlink to soelim.
* src/Makefile.am (bin_PROGRAMS): Move zsoelim to ...
(pkglibexec_PROGRAMS): ... here.
(AM_CPPFLAGS): Adjust ZSOELIM definition to match.
* NEWS: Document this.
2014-09-18 Colin Watson <cjwatson@debian.org>
Rename SOELIM definition to ZSOELIM for clarity
* src/Makefile.am (AM_CPPFLAGS): Define ZSOELIM rather than SOELIM.
* src/man.c (make_roff_command): Use ZSOELIM rather than SOELIM.
2014-09-17 Colin Watson <cjwatson@debian.org>
Make sure that generated shared libraries have no undefined symbols
Based on a change found in
https://github.com/Alexpux/MSYS2-packages/tree/master/man-db.
* lib/Makefile.am (libman_la_LDFLAGS): Add -no-undefined.
* libdb/Makefile.am (libmandb_la_LDFLAGS): Add -no-undefined.
2014-09-17 Colin Watson <cjwatson@debian.org>
Correct a couple of comments in m4/man-arg-*.m4
* m4/man-arg-automatic-update.m4: Correct header comment.
* m4/man-arg-systemdtmpfilesdir.m4: Likewise.
2014-09-17 Colin Watson <cjwatson@debian.org>
Fix "cannot adjust line" warning when formatting db.me
* manual/db.me (Contents of an index database): Insert several
zero-width break points in descriptions of entry formats.
2014-09-17 Colin Watson <cjwatson@debian.org>
Show a better error message if no browser is configured
Fixes Savannah bug #37814.
* src/man.c (format_display): Adjust error message if html_pager is
NULL or the empty string.
* NEWS: Document this.
2014-09-17 Colin Watson <cjwatson@debian.org>
Don't store canonicalised versions of manpath elements
We still compare canonicalised versions, but don't store them.
Storing them results in looking up the wrong catpath in the case
where one of the configured MANDB_MAP entries is a symlink.
Broken by commit 01e5a4febfc7b6cd53991455315ae7744c8f31dd; fixes
Fedora bug #1043401.
* src/manp.c (create_pathlist): Compare canonicalised versions of
manpath elements, but don't store them.
* NEWS: Document this.
2014-09-16 Colin Watson <cjwatson@debian.org>
Don't use pointed-to name as title for database-located pages
For a pointer record, the pointed-from name is a legitimate alias
for the located page, and is likely to be closer to the name that
the user requested.
Fixes Debian bug #709405.
* src/man.c (display_database): Don't use the pointed-to name to
construct the title for display.
2014-09-16 Colin Watson <cjwatson@debian.org>
* Version: 2.7.0-pre1.
2014-09-16 Colin Watson <cjwatson@debian.org>
Fix distcheck following addition of systemd tmpfiles snippet
* Makefile.am (AM_DISTCHECK_CONFIGURE_FLAGS): Add
--with-systemdtmpfilesdir=\$${prefix}/lib/tmpfiles.d.
2014-09-16 Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Formatting improvements to man(1)
Fixes Debian bug #726266.
* man/man1/man.man1: Protect "." at beginning or end of strings with
"\&". Start sentences on new lines. Insert italic corrections
between adjacent italic and roman characters. Use double quotation
marks around arguments rather than placing "\ " between strings.
* man/po4a/po/man-db-manpages.pot, man/po4a/po/*.po: Update.
2014-09-16 Colin Watson <cjwatson@debian.org>
Prioritise COLUMNS above TIOCGWINSZ
Fixes Ubuntu bug #1315282.
* lib/linelength.c (get_line_length): Prioritise COLUMNS above
TIOCGWINSZ.
* man/man1/apropos.man1 (DESCRIPTION): Describe new terminal width
priorities.
* man/man1/man.man1 (DESCRIPTION): Likewise.
* man/man1/whatis.man1 (DESCRIPTION): Likewise.
* man/po4a/po/man-db-manpages.pot, man/po4a/po/*.po: Update.
* NEWS: Document this.
2014-09-16 Colin Watson <cjwatson@debian.org>
Use xnrealloc rather than xrealloc in a few more places
* src/catman.c (parse_opt): Use xnrealloc rather than xrealloc.
* src/globbing.c (update_directory_cache): Likewise.
* src/ult_src.c (ult_trace): Likewise.
2014-09-16 Colin Watson <cjwatson@debian.org>
Order files by first physical extent before reading
Inspired by a similar change in dpkg. This takes 'mandb -c' from
104 to 32 seconds in a test installation, and 'man -K' from 74 to 38
seconds. On non-Linux systems where FIEMAP is not available, use
posix_fadvise instead to preload files.
Fixes Debian bug #574410.
* gnulib: Import nonblocking and openat modules.
* configure.ac: Check for <linux/fiemap.h> and posix_fadvise.
* lib/orderfiles.c: New file.
* lib/orderfiles.h: New file.
* lib/Makefile.am (libman_la_SOURCES): Add orderfiles.c and
orderfiles.h.
* src/check_mandirs.c (add_dir_entries): Order files before reading
them.
* src/man.c (try_section, do_global_apropos_section): Likewise.
* src/straycats.c (check_for_stray): Likewise.
* NEWS: Document this.
2014-09-16 Colin Watson <cjwatson@debian.org>
* NEWS: Document a couple more changes since 2.6.7.1.
2014-09-15 Colin Watson <cjwatson@debian.org>
Merge convert_name into man.c
* src/convert_name.c (gripe_converting_name): Move to ...
* src/man.c (gripe_converting_name): ... here.
* src/convert_name.c (convert_name): Move to ...
* src/man.c (convert_name): ... here. Make static.
* src/convert_name.h: Remove.
* src/Makefile.am (man_SOURCES): Remove convert_name.c and
convert_name.h.
* po/POTFILES.in: Remove src/convert_name.c.
* po/man-db.pot, po/*.po: Update.
2014-09-15 Colin Watson <cjwatson@debian.org>
* tools/README: Update heading to reflect moves to build-aux.
2014-09-15 Colin Watson <cjwatson@debian.org>
Make a few libdb functions static
* libdb/db_lookup.c (copy_if_set, split_data): Make static.
(make_content): Move to ...
* libdb/db_store.c (make_content): ... here. Make static.
* libdb/db_storage.h (split_data, make_content, copy_if_set): Remove
prototypes.
2014-09-15 Colin Watson <cjwatson@debian.org>
Make various functions static
These functions are only used within the same compilation unit, so
have no need for external linkage.
* src/check_mandirs.c (sanity_check_db): Make static.
* src/mandb.c (is_lang_dir, tried_catdirs_free, purge_catdir,
purge_catsubdirs, purge_catdirs): Likewise.
* src/zsoelim.l (try_compressed): Likewise.
2014-09-15 Colin Watson <cjwatson@debian.org>
Remove unused code in lexgrog
* src/lexgrog.l (rule_profile): Remove unused function and
associated global declarations.
2014-09-15 Colin Watson <cjwatson@debian.org>
Reorder functions in man to remove need for header file
man.h was only needed because of some poor function ordering in man.c.
Reorder functions so that definition comes before use, except in one
case of mutual recursion.
* src/man.c (main): Move to end of file.
(local_man_loop): Move to immediately before man.
(man): Add a prototype declaration just before local_man_loop, to
cope with mutual recursion.
(do_prompt): Move to immediately above display.
* src/man.h: Remove.
* src/Makefile.am (man_SOURCES): Remove man.h.
2014-09-15 Colin Watson <cjwatson@debian.org>
Move argument handling out of configure to new MAN_ARG_* macros
* m4/man-arg-automatic-create.m4, m4/man-arg-automatic-update.m4,
m4/man-arg-cats.m4, m4/man-arg-config-file.m4, m4/man-arg-db.m4,
m4/man-arg-device.m4, m4/man-arg-mandirs.m4,
m4/man-arg-override-dir.m4, m4/man-arg-sections.m4,
m4/man-arg-setuid.m4, m4/man-arg-systemdtmpfilesdir.m4,
m4/man-arg-undoc.m4: New files.
* configure.ac: Call new macros rather than inlining argument
handling.
2014-09-15 Colin Watson <cjwatson@debian.org>
* build-aux/config.sub: Upgrade to 2014-09-11.
2014-09-12 Colin Watson <cjwatson@debian.org>
Simplify <dirent.h> handling using Gnulib
* gnulib: Import dirent module.
* configure.ac: Remove obsolescent AC_HEADER_DIRENT macro.
* src/check_mandirs.c: Simplify a large conditional block to
"#include <dirent.h>".
* src/straycats.c: Likewise.
* src/ult_src.c: Likewise.
2014-09-12 Colin Watson <cjwatson@debian.org>
Remove old and broken FAST_BTREE code
This was marked as experimental and broken when I took over man-db
13 years ago, and I've hardly touched it. There's no point in
keeping it around.
* include/manconfig.h.in (FAST_BTREE): Remove commented definition.
* libdb/db_btree.c (test_insert, gripe_get, dbstore, dblookup):
Remove.
(btree_flopen): Expand B_FLAGS macro.
(btree_replace): Remove FAST_BTREE case.
* libdb/db_lookup.c (dblookup): Define unconditionally.
* libdb/db_store.c (dbstore): Likewise.
2014-09-11 Colin Watson <cjwatson@debian.org>
Speed up the test suite if we have high-precision file timestamps
* configure.ac: Substitute STAT_HAS_NSEC as "yes" or "no" depending
on whether high-precision file timestamps are available.
* src/tests/Makefile.am (TESTS_ENVIRONMENT): Export STAT_HAS_NSEC to
tests.
* src/tests/testlib.sh (next_second): Do nothing if STAT_HAS_NSEC is
"yes".
2014-09-11 Colin Watson <cjwatson@debian.org>
Use high-precision timestamps for manual pages
* lib/util.c (is_changed): Compare high-precision timestamps.
* libdb/db_storage.h (FIELDS): Increment to 10.
(struct mandata): Change "time_t _st_mtime" to "struct timespec
mtime".
* libdb/db_lookup.c (dbprintf): Update mtime display.
(split_content): Store two fields for the mtime (seconds and
nanoseconds).
(make_content): Expect two fields for the mtime.
* libdb/db_store.c (replace_if_necessary): Compare high-precision
timestamps.
* src/check_mandirs.c (test_manfile): Likewise.
* src/man.c (maybe_update_file): Likewise.
* src/straycats.c (check_for_stray): Update initialisation of struct
mandata.
* src/tests/testlib.sh (accessdb_filter): Adjust for new format.
* manual/db.me (Contents of an index database): Describe new format.
(Example database): Update example output.
* NEWS: Document this.
2014-09-10 Colin Watson <cjwatson@debian.org>
Move database mtime out of the database into file metadata
This makes the database reproducible between installations, as long
as the underlying database has predictable behaviour and the set of
installed manual pages (including their timestamps) remains
identical. As a bonus, we now use high-precision times in several
places.
Fixes Debian bug #760895.
* gnulib: Import futimens and timespec modules.
* libdb/db_btree.c (btree_get_time, btree_set_time): New functions.
* libdb/db_gdbm.c (man_gdbm_get_time, man_gdbm_set_time): New
functions.
* libdb/db_ndbm.c (ndbm_get_time, ndbm_set_time): New functions.
* libdb/mydbm.h (man_gdbm_get_time, man_gdbm_set_time,
ndbm_get_time, ndbm_set_time, btree_get_time, btree_set_time): Add
prototypes.
(MYDBM_GET_TIME, MYDBM_SET_TIME): New macros.
* src/check_mandirs.c (testmandirs, create_db, count_glob_matches,
purge_normal, purge_whatis, purge_missing): Use high-precision
times.
(update_db_time): Set file modification times rather than updating a
database row.
(create_db, purge_missing): Get database file modification times
rather than fetching a database row.
(purge_missing): If the new will_run_mandb argument is true, reset
the database mtime to its value before purging; this ensures that
mandb will still run as expected afterwards.
* src/check_mandirs.h (purge_missing): Update prototype.
* src/mandb.c (xcopy): Copy access and modification times.
(process_manpath): Work out in advance of purging whether we will
need to run mandb, and pass that to purge_missing.
* include/manconfig.h.in (VER_ID): Bump to 2.5.0.
(KEY): Remove.
* man/man8/accessdb.man8 (DESCRIPTION), man/it/man8/accessdb.man8
(DESCRIZIONE): Remove sample output, as it is of limited usefulness
compared to how awkward it is to maintain, especially in text
intended for translation.
* man/po4a/po/man-db-manpages.pot, man/po4a/po/*.po: Update.
* manual/db.me (Contents of an index database): Remove mention of
$mtime$.
(Example database): Remove $mtime$. Update $version.
* NEWS: Document this. Bump version to 2.7.0 to correspond to the
database version change.
2014-09-09 Colin Watson <cjwatson@debian.org>
Make update_db_time static
* src/check_mandirs.c (update_db_time): Make this static; its only
uses are within the same file.
* src/check_mandirs.h (update_db_time): Remove prototype.
2014-09-09 Colin Watson <cjwatson@debian.org>
Remove unused reset_db_mtime function
* src/check_mandirs.c (reset_db_mtime): Remove. This function has
been unused since man-db 2.4.2.
* src/check_mandirs.h (reset_db_mtime): Remove prototype.
* src/man.c: Stop including "check_mandirs.h".
2014-09-09 Colin Watson <cjwatson@debian.org>
Don't purge entries from databases that fail sanity checks
* src/check_mandirs.c (purge_missing): Return early if
sanity_check_db fails, for instance in the case of a version
mismatch.
2014-09-09 Colin Watson <cjwatson@debian.org>
Switch away from obsolescent utime function
POSIX.1-2008 marks utime as obsolescent. Switch to variants of the
futimens/utimensat family instead, via Gnulib. Use higher-precision
times for cat pages.
* gnulib: Import stat-time and utimens modules.
* src/man.c (man_modtime): Change type to struct timespec.
(commit_tmp_cat): Use utimens rather than utime.
(display): Store a higher-precision modification timestamp for
man_file.
2014-09-09 Colin Watson <cjwatson@debian.org>
catman: Honour program name transformations
* src/catman.c (parse_for_sec): Execute MAN rather than "man".
2014-09-08 Colin Watson <cjwatson@debian.org>
* man/po4a/po/da.po: Fix po4a syntax error.
2014-09-08 Colin Watson <cjwatson@debian.org>
Various autotools upgrades
* aclocal.m4: Upgrade to pkg-config 0.28.
* build-aux/config.guess: Upgrade to 2014-03-23.
* build-aux/config.sub: Upgrade to 2014-05-01.
* build-aux/ltmain.sh: Upgrade to Libtool 2.4.2-1.10 (from Debian).
2014-08-30 Joe Hansen <joedalton2@yahoo.dk>
* man/po4a/po/da.po: Update from Translation Project.
2014-08-12 Arif E. Nugroho <arif_endro@yahoo.com>
* man/po4a/po/id.po: Update from Translation Project.
2014-08-11 Arif E. Nugroho <arif_endro@yahoo.com>
* po/id.po: Update from Translation Project.
2014-06-18 Colin Watson <cjwatson@debian.org>
Fix cat page parsing (Debian bug #751934)
* src/lexgrog.l (find_name): Run "col -b -p -x" over cat pages if
possible before parsing them.
2014-06-17 Colin Watson <cjwatson@debian.org>
Add systemd tmpfiles snippet to clean up old cat files after a week
Fixes Fedora bug #1110274.
* configure.ac: Accept --with-systemdtmpfilesdir option.
(AC_CONFIG_FILES): Add init/Makefile and init/systemd/Makefile.
* Makefile.am (SUBDIRS): Add init.
* init/Makefile.am: New file.
* init/systemd/Makefile.am: New file.
* init/systemd/man-db.conf: New file.
* .gitignore: Add init/Makefile and init/systemd/Makefile.
2014-06-17 Colin Watson <cjwatson@debian.org>
Squash false positive from -Wmaybe-uninitialized
* src/globbing.c: Initialise pattern_start.
2014-04-10 Colin Watson <cjwatson@debian.org>
* Version: 2.6.7.1.
2014-04-10 Colin Watson <cjwatson@debian.org>
Remove test suite dependency on realpath(1)
* src/tests/mandb-7: Prepend "$(pwd -P)/" to $tmpdir in
configuration files rather than calling realpath.
* NEWS: Document this.
2014-04-10 Colin Watson <cjwatson@debian.org>
* Version: 2.6.7.
* Makefile.am (EXTRA_DIST): Add gnulib/argp-domain.patch.
2014-04-10 Peter Schiffer <pschiffe@redhat.com>
Only create a cache directory tag if catpath != manpath
* src/mandb.c (mandb): Don't create CACHEDIR.TAG if the catpath is
equal to the manpath.
* src/tests/mandb-7: New file.
* src/tests/Makefile.am (ALL_TESTS): Add mandb-7.
* NEWS: Document this.
2014-04-10 Colin Watson <cjwatson@debian.org>
Make cache directory tag creation more readable
* src/mandb.c (mandb): Move cache directory tag string to ...
(CACHEDIR_TAG): ... here (new macro).
2014-03-26 Colin Watson <cjwatson@debian.org>
Run the pager in man's original working directory
Reported by Peng Yu.
* src/man.c (make_display_command): Set pager_cmd's working
directory to man's original working directory.
* configure.ac: Require libpipeline >= 1.3.0.
* NEWS: Document this.
2014-03-26 Colin Watson <cjwatson@debian.org>
Upgrade to Automake 1:1.14.1-3 (from Debian).
2014-03-20 Mario Blättermann <mario.blaettermann@gmail.com>
Update German manual page translation
* man/po4a/po/de.po: Update from Translation Project.
* man/THANKS: Add translator credit.
2014-03-17 Robert Luberda <robert@debian.org>
* man/po4a/po/pl.po: Update from Translation Project.
2014-02-20 Colin Watson <cjwatson@debian.org>
Move Autotools auxiliary build files from tools to build-aux.
This keeps man-db's own tools separate, reducing confusion, and
"build-aux" is a more conventional location for the Autotools files.
2014-02-18 Colin Watson <cjwatson@debian.org>
Upgrade to Gnulib 20140202 and Libtool 2.4.2-1.7 (from Debian).
* lib/appendstr.c (appendstr): Use size_t type for string lengths.
2014-01-23 Colin Watson <cjwatson@debian.org>
Improve compatibility with archaic shells
* src/tests/man-5: Assign and export shell variables in two steps,
for improved compatibility with some archaic shells.
* src/tests/man-7: Likewise.
* src/tests/man-8: Likewise.
* src/tests/zsoelim-1: Likewise.
2014-01-23 Colin Watson <cjwatson@debian.org>
Fix test failure with --enable-undoc
* src/man.c (gripe_no_man): Don't print "See ... for help" message
when MAN_TEST_DISABLE_UNDOCUMENTED is set in the environment.
* src/tests/man-7: Export MAN_TEST_DISABLE_UNDOCUMENTED=1.
* NEWS: Document this.
2014-01-23 Colin Watson <cjwatson@debian.org>
* Version: 2.6.6.
* man/po4a/Makefile.am (all-local): Make staging files writeable.
* README: Update copyright to 2014.
2014-01-23 Colin Watson <cjwatson@debian.org>
Tidy up override directory support slightly
* src/manp.c (insert_override_dir): Drop braces.
(get_manpath_from_path): Standardise whitespace.
* src/tests/Makefile.am (TESTS_ENVIRONMENT): Use Automake-generated
substitution rather than substituting @override_dir@ again.
2014-01-23 Peter Schiffer <pschiffe@redhat.com>
Add support for override directory in search path
* configure.ac: Add --with-override-dir option.
* include/manconfig.h.in (OVERRIDE_DIR): New definition.
* src/manp.c (insert_override_dir): New function.
(get_manpath_from_path): Call it before add_dir_to_list.
* src/tests/man-9: New file.
* src/tests/Makefile.am (TESTS_ENVIRONMENT): Set and export
OVERRIDE_DIR.
(ALL_TESTS): Add man-9.
* NEWS: Document this.
2014-01-23 Colin Watson <cjwatson@debian.org>
Upgrade to Automake 1.14.1 and Libtool 2.4.2-1.6 (from Debian).
2014-01-19 Akihiro Sagawa <sagawa.aki@gmail.com>
Fix macro and hyphenation language handling
* src/man.c (display): Don't free page_lang if it's going to be used
by locale_macros.
* src/tests/man-8: New file.
* src/tests/Makefile.am (ALL_TESTS): Add man-8.
* NEWS: Document this.
2014-01-19 David Prévot <david@tilapin.org>
* man/po4a/po/fr.po: Update from Translation Project.
2014-01-18 Joe Hansen <joedalton2@yahoo.dk>
* man/po4a/po/da.po: Update from Translation Project.
2014-01-16 Yuri Kozlov <yuray@komyakino.ru>
* man/po4a/po/ru.po: Update from Translation Project.
2014-01-16 Colin Watson <cjwatson@debian.org>
* Version: 2.6.6-pre2.
2014-01-16 Мирослав Николић <miroslavnikolic@rocketmail.com>
Add Serbian translation
* po/sr.po: New from Translation Project.
* po/LINGUAS: Add sr.
* man/THANKS: Add translator credit.
2014-01-15 Colin Watson <cjwatson@debian.org>
* man/po4a/po: Update.
2014-01-15 Peter Schiffer <pschiffe@redhat.com>
Synchronise manual pages with usage messages
* man/man1/apropos.man1 (SYNOPSIS): Replace -h with -?.
(OPTIONS): Likewise. Add --usage.
* man/man1/lexgrog.man1 (SYNOPSIS): Add -d. Replace -h with -?.
(OPTIONS): Likewise. Add --usage.
* man/man1/man.man1 (SYNOPSIS): Replace -h with -?.
(OPTIONS): Likewise. Add --path (alias for -w). Add --usage.
* man/man1/manpath.man1 (SYNOPSIS): Replace -h with -?.
(OPTIONS): Likewise. Add --usage.
* man/man1/whatis.man1 (SYNOPSIS): Replace -h with -?.
(OPTIONS): Likewise. Add --usage.
* man/man8/accessdb.man8 (SYNOPSIS): Add -d. Replace -h with -?.
(OPTIONS): Likewise. Add --usage.
* man/man8/catman.man8 (SYNOPSIS): Replace -h with -?.
(OPTIONS): Likewise. Add --usage.
* man/man8/mandb.man8 (SYNOPSIS): Replace -h with -?.
(OPTIONS): Likewise. Add --usage.
2014-01-15 Colin Watson <cjwatson@debian.org>
Fix memory leaks related to make_filename
* src/check_mandirs.c (test_manfile): Remove now-redundant stat.
Free abs_filename.
* src/man.c (display_filesystem): Consolidate return paths.
Consistently free filename.
(display_database): Free file after using it.
(maybe_update_file): Likewise.
2014-01-15 Peter Schiffer <pschiffe@redhat.com>
Silence error messages for stale database entries (Fedora bug #841431)
* src/filenames.c (make_filename): Return NULL if the resulting file
is not readable. Update all callers to handle NULL returns.
* src/tests/man-7: New file.
* src/tests/Makefile.am (ALL_TESTS): Add man-7.
* NEWS: Document this.
2014-01-15 Colin Watson <cjwatson@debian.org>
* src/tests/man-5, src/tests/man-6: Mark executable.
2014-01-13 Robert Luberda <robert@debian.org>
* man/po4a/po/pl.po: Update from Translation Project.
2014-01-13 Colin Watson <cjwatson@debian.org>
Fix domain handling in argp
* gnulib/argp-domain.patch: New file.
* autogen.sh: Apply gnulib/argp-domain.patch.
* NEWS: Document this.
2014-01-12 Trần Ngọc Quân <vnwildman@gmail.com>
* po/vi.po: Update from Translation Project.
2014-01-11 David Prévot <david@tilapin.org>
* man/po4a/po/fr.po: Update from Translation Project.
2014-01-11 Yuri Kozlov <yuray@komyakino.ru>
* man/po4a/po/ru.po: Update from Translation Project.
2014-01-10 Colin Watson <cjwatson@debian.org>
* Version: 2.6.6-pre1.
2014-01-10 Colin Watson <cjwatson@debian.org>
Don't update man/po4a/po/ when nothing has changed
* man/po4a/Makefile.am (DOMAIN): New variable.
(EXTRA_DIST): Use $(DOMAIN).
(STAGING): New variable.
(PO4A_ARGS): Set new "podir" variable.
(RUN_PO4A): New variable.
(all-local): Abbreviate using RUN_PO4A. Copy POT/PO files to
$(STAGING) before running po4a, to avoid updating the master files.
(update-po): Move to ...
(update-po-real): ... here. Abbreviate using RUN_PO4A. Add
--force, since this target is only called when we really want to
update. Copy POT/PO files to $(STAGING) before running po4a, and
only copy them back if the POT file has changed by more than just
the POT-Creation-Date.
(update-po): New rule. Call update-po-real if and only if srcdir =
builddir.
(clean-local): New rule. Remove $(STAGING).
* man/po4a/po4a.cfg (po4a_paths): Refer to $(podir) rather than
$(srcdir)/po4a/po.
* release.sh: Stop removing man/po4a/po/man-db-manpages.pot; this
should no longer be necessary.
2014-01-03 victory <victory.deb@gmail.com>
* po/ja.po: Update from Translation Project.
2013-12-09 Colin Watson <cjwatson@debian.org>
Make it easier to prove that catman option parsing is safe
* src/catman.c (parse_opt): Check sections before assigning to
sections[i]. (Already always safe, but this makes it easier to
prove.)
2013-12-09 Colin Watson <cjwatson@debian.org>
Update documentation for git.
* docs/HACKING (Sending patches): Suggest 'git diff'.
(Revision control): Update for git. Remove comment about
ChangeLog handling for branches.
* NEWS: Document switch to git.
2013-12-09 Colin Watson <cjwatson@debian.org>
gnulib: Import gnupload module.
2013-12-09 Colin Watson <cjwatson@debian.org>
Automatically generate ChangeLog from git
* ChangeLog: Move to ...
* ChangeLog-2013: ... here.
* Makefile.am (EXTRA_DIST): Add ChangeLog-2013.
(dist-hook): Add gen-ChangeLog.
(gen-ChangeLog): New rule, based on that in coreutils.
* gnulib: Import gitlog-to-changelog module.
|