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
|
2004-05-10 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* configure.ac: Fixed prerequisite headers for sys/buf.h
(needed on FreeBSD)
* src/system.h: Likewise.
* tests/after (compare): Fixed argument quoting under eval
* tests/before: Quote TAR_ARCHIVE_FORMATS
2004-05-10 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* NEWS: Updated
* README: Updated
* PORTS: Updated
* configure.ac: Call gl_AC_TYPE_INTMAX_T. Document
DEFAULT_.* variables. Use DEFAULT_RMT_COMMAND to set
the pathname of the rmt utility.
New option --enable-backup-scripts.
* doc/tar.texi: Updated
* scripts/Makefile.am: Install the scripts only if requested
by the configure.
* scripts/backup.in: Fixed --version output.
Fixed initialization of the listing files and printing
the time of the last previous level dump.
* scripts/restore.in: Fixed --version output.
* src/Makefile.am (localedir.h rule): Generate correct
DEFAULT_RMT_COMMAND variable.
* src/common.h (rmt_command_option): New variable.
* src/list.c (read_and): Print block number before
issuing 'Skipping to next header' diagnostics, if
requested by block_number_option.
* src/rtapelib.c: Use rmt_command_option instead of
hardcoded "/etc/rmt".
* src/tar.c: New option --rmt-command.
(decode_options): Handle --rmt-command. Initialize
rmt_command_option to DEFAULT_RMT_COMMAND.
2004-05-09 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* doc/tar.texi: Further update.
2004-05-08 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* configure.ac: Minor fix
* scripts/Makefile.am: Updated
* scripts/backup-specs: Updated
* scripts/backup.in: Minor fixes
* scripts/backup.sh: Removed
* scripts/backup.sh.in: New file. Source for backup.sh
* scripts/restore.in: New file
* scripts/.cvsignore: Updated
* scripts/WARNING: Removed
* doc/tar.texi: Updated
* NEWS: Updated
2004-05-07 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/names.c (name_gather): Bugfix: Honor single -C with
--same-order.
* tests/same-order01.sh: New file
* tests/same-order02.sh: New file
* tests/Makefile.am: Updated
* tests/append.sh: Added copyleft header
* tests/delete01.sh: Likewise
* tests/delete02.sh: Likewise
* tests/delete04.sh: Likewise
* tests/extrac01.sh: Likewise
* tests/extrac02.sh: Likewise
* tests/extrac03.sh: Likewise
* tests/extrac04.sh: Likewise
* tests/gzip.sh: Likewise
* tests/ignfail.sh: Likewise
* tests/incremen.sh: Likewise
* tests/multiv01.sh: Likewise
* tests/old.sh: Likewise
* tests/options.sh: Likewise
* tests/recurse.sh: Likewise
* tests/version.sh: Likewise
* tests/volume.sh: Likewise
* tests/star/gtarfail.sh: Likewise
* tests/star/gtarfail2.sh: Likewise
* tests/star/multi-fail.sh: Likewise
* tests/star/pax-big-10g.sh: Likewise
* tests/star/qucktest.sh: Likewise
* tests/star/ustar-big-2g.sh: Likewise
* tests/star/ustar-big-8g.sh: Likewise
* doc/.cvsignore: Updated
2004-05-06 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* configure.ac: Check whether date accepts +format argument
(for backup scripts).
* scripts/level-0: Removed
* scripts/level-1: Removed
* scripts/weekly.new: Removed
* scripts/dump-remind: Removed
* scripts/backup.in: New file
* scripts/backup.sh: New file
* scripts/dump-remind.in: New file
* scripts/backup-specs: Updated
* scripts/Makefile.am: Updated for new directory contents.
* scripts/.cvsignore: Updated
2004-05-05 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* TODO: Updated
* doc/tar.texi: Updated
* src/tar.c: --utc implies -vv
2004-04-28 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/utf8.c: Make sure ICONV_CONST is defined. AM_ICONV
does not define it if it fails to find iconv.h.
2004-04-26 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* bootstrap: Use gnulib-tool to generate lib/Makefile.am
and parts of configure.ac
* configure.ac: Invoke tar_GNULIB to configure gnulib stuff.
* lib/Makefile.am: Removed
* lib/Makefile.tmpl: New file.
* lib/.cvsignore: Updated
* m4/.cvsignore: Updated
* src/xheader.c: Include stpcpy.h
* src/create.c: Produce an error, not warning, if the
filename is too long.
* tests/longv7.sh: Synchronized with the recent changes.
2004-04-20 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* configure.ac: Fixed test for iconv_t
* src/rmt.h: Bugfix by Jrgen Weigert
* THANKS: Add Jrgen Weigert
* tests/star/README: Fixed typo
2004-04-04 Paul Eggert <eggert@twinsun.com>
Merge getdate documentation changes from coreutils.
* doc/getdate.texi: Update from coreutils CVS.
* doc/tar.texi: Fix getdate menu to match getdate.texi's.
Merge recent gnulib changes, and remove some lint.
Improve support for nanosecond-resolution time stamps.
* bootstrap: Add gettime, timespec modules.
* configure.ac (gl_GETTIME, gl_TIMESPEC): Add.
* lib/.cvsignore (getopt_int.h, gettime.c, gettimeofday.c,
timespec.h): Add.
* lib/Makefile.am (libtar_a_SOURCES): Add gettime.c, timespec.h.
* m4/.cvsignore: Add clock_time.m4, gettime.m4, gettimeofday.m4,
st_mtim.m4, timespec.m4. Remove malloc.m4, realloc.m4.
* src/common.h (newer_mtime_option): Now a struct timespec, not
time_t. All uses changed.
(NEWER_OPTION_INITIALIZED, OLDER_STAT_MTIME): New macros.
* src/create.c (dump_file0): Use OLDER_STAT_TIME to compare times.
* src/incremen.c (scan_path): Likewise.
* src/list.c (read_and): Likewise.
* src/list.c (read_and): Use NEWER_OPTION_INITIALIZED to decide
whether newer_mtime_option is initialized.
* src/tar.c (decode_options): Likewise.
* src/tar.c (decode_options): Adjust to new signature for get_date.
* src/buffer.c (short_read, flush_read): Use size_t, not ssize_t, for
result of safe_read, full_write, and similar functions.
Detect safe_read error by comparing to SAFE_READ_ERROR;
detect full_write error by comparing to 0.
All uses changed.
* src/common.h (write_error_details, sys_write_archive_buffer):
Likewise.
* src/misc.c (write_error_details): Likewise.
* src/rmt.c (main): Likewise.
* src/rmt.h (rmt_read__, rmt_write__): Likewise.
* src/rtapelib.c (rmt_read__, rmt_write__, rmt_ioctl__): Likewise.
* src/sparse.c (sparse_scan_file, sparse_dump_region,
check_sparse_region, check_data_region): Likewise.
* src/system.c (sys_write_archive_buffer, sys_drain_input_pipe,
sys_child_open_for_compress, sys_child_open_for_uncompress): Likewise.
* src/update.c (append_file): Likewise.
* src/buffer.c (clear_read_error_count): Use explicit (void)
to indicate a function with no arguments.
* src/create.c (check_links): Likewise.
* src/system.c (sys_get_archive_stat, sys_save_archive_dev_ino,
sys_detect_dev_null_output, sys_drain_input_pipe, sys_spawn_shell,
sys_reset_uid_gid, sys_get_archive_stat, sys_save_archive_dev_ino,
sys_detect_dev_null_output, sys_drain_input_pipe, sys_spawn_shell):
Likewise.
* src/utf8.c (get_input_charset): Likewise.
* src/xheader.c (xheader_ghdr_name, xheader_write_global,
xheader_decode_global, extended_header_init): Likewise.
* tests/mksparse.c (usage): Likewise.
* src/buffer.c (new_volume): Rename local variables to avoid
shadowing warnings.
* src/common.h (file_dumpable_p, sys_stat_nanoseconds,
sparse_file_p, sparse_member_p, sparse_fixup_header,
sparse_dump_file, sparce_extract_file, sparse_skip_file,
sparse_diff_file): Likewise.
* src/compare.c (diff_archive): Likewise.
* src/create.c (file_dumpable_p, dump_regular_file, dump_dir0,
dump_dir, dump_hard_link, file_count_links, dump_file0, dump_file):
Likewise.
* src/extract.c (repair_delayed_set_stat): Likewise.
* src/misc.c (maybe_backup_file, add_hierarchy_to_namelist):
Likewise.
* src/sparse.c (struct tar_sparse_optab, tar_sparse_dump_region,
tar_sparse_extract_region, sparse_dump_region, sparse_extract_region,
sparse_dump_file, sparse_file_p, sparse_member_p,
sparse_fixup_header, sparse_extract_file, sparse_skip_file,
check_data_region, sparse_diff_file): Likewise.
* src/system.c (sys_stat_nanoseconds): Likewise.
* src/xheader.c (xheader_format_name): Likewise.
* src/common.h (enum old_files): Remove comma before }; not portable.
* src/common.h (read_fatal_details): Add __attribute__ ((noreturn)).
* src/rmt.c (usage): Likewise.
* src/xheader.c (xheader_set_single_keyword): Likewise.
* tests/genfile.c (usage): Likewise.
* tests/mksparse.c (die, usage): Likewise. Also add printf attribute
to die.
* src/common.h (gname_to_gid, uname_to_uid): Add const to avoid
some gcc warnings.
* src/names.c (uname_to_uid, gname_to_gid): Likewise.
* src/utf8.c (struct langtab.lang, struct langtab.terr, struct
langtab.charset, charset_lookup): Likewise.
* src/common.h (name_init): Remove unused args. All callers changed.
* src/names.c (name_init): Likewise.
* src/common.h (usage, xheader_write, xheader_write_global,
sys_reset_uid_gid): New decls.
* src/compare.c (report_difference, process_noop): Add
__attribute__ ((unused)) for unused attributes.
* src/sparse.c (oldgnu_sparse_member_p, star_sparse_member_p):
Likewise.
* src/xheader.c (dummy_coder, dummy_decoder, atime_coder,
gid_coder, gname_coder, linkpath_coder, ctime_coder, mtime_coder,
path_coder, size_coder, uid_coder, uname_coder,
sparse_numblocks_coder): Likewise.
* src/create.c (dump_regular_finish, dump_dir0, dump_dir,
dump_file0): Now static.
* src/utf8.c (charset_lookup): Likewise.
* src/xheader.c (xheader_protected_pattern_p,
xheader_protected_keyword_p, xheader_set_single_keyword,
xheader_keyword_deleted_p, xheader_keyword_override_p,
xheader_list_append, xheader_list_destroy, xheader_set_keyword_equal):
Likewise.
* tests/genfile.c (usage): Likewise.
* tests/mksparse.c (die, mkhole, mksparse, usage, xlat_suffix):
Likewise.
* src/create.c (hash_link): Rewrite to avoid cast.
* src/extract.c (file_newer_p): Use parameter, not global var.
* src/misc.c (write_error_details): Likewise.
* src/extract.c (prepare_to_extract): Remove directory arg; not
used. All callers changed.
* src/misc.c (close_fatal): Remove; not used.
* src/system.c (sys_utimes): Likewise.
* src/rmt.c (get_string): Avoid buffer overrun (off by 1 error).
* src/rmt.c (main): Update copyright date to 2004.
* src/tar.c (decode_options): Likewise.
* src/rtapelib.c (get_status_string): Don't lose errno when
skipping the error messages.
(get_status): Report an error if atol returns a negative number.
* src/utf8.c (struct langtab, langtab, charset_lookup,
get_input_charset) [!defined HAVE_LIBCONV]: Omit unused
definitions.
(iconv_open, iconv, iconv_close) [!defined HAVE_LIBCONV]:
Use macros, not definitions, to avoid type clashes with system
headers.
(charset_lookup): Local var is now auto, not static.
(utf8_convert): Use ICONV_CONST instead of const, to avoid
type clashes.
* src/utf8.c (langtab): Initialize all elements of struct, to
avoid gcc warning.
* src/xheader.c (xhdr_tab): Likewise.
* src/xheader.c: Include fnmatch.h, since we use fnmatch.
* tests/mksparse.c (mkhole): Fix typo: bool was assigned to off_t.
2004-04-04 Sergey Poznyakoff <gray@Noldor.runasimi.org>
* NEWS: Updated
* configure.ac: Raised version number to 1.13.94
* src/system.h: Protect inclusion of <sys/time.h>
by ifdef.
Declare time() if HAVE_DECL_TIME is 0
* tests/.cvsignore: Added mksparse
* tests/sparse01.sh: New file
* tests/multiv02.sh: New file
* tests/Makefile.am: Add sparse01.sh and multiv02.sh
* tests/longv7.sh: Added missing call to 'after'
* src/common.h: Added missing prototypes
* src/compare.c (diff_archive): Use is_sparse member
instead of GNUTYPE_SPARSE.
* src/create.c: Removed unused variables
* src/extract.c (extract_archive): Use sparse_member_p instead
of GNUTYPE_SPARSE.
Removed unused variables
* src/list.c (decode_header): Use sparse_fixup_header to correct
the st_size value.
(print_header): Do not rely on GNUTYPE_SPARSE type.
Use st->stat.st_size to print real file size.
(skip_member): Assign stat_info.file_name to save_name. This fixes
bug reported by Mads Martin Joergensen <mmj@suse.de>
Use sparse_skip_file() to skip sparse members.
* src/rtapelib.c: include "common.h"
* src/sparse.c (struct tar_sparse_optab.sparse_member_p)
(struct tar_sparse_optab.fixup_header): New member
(tar_sparse_member_p): New function.
(tar_sparse_init): Return true if decode_header is not provided
(tar_sparse_fixup_header)
(sparse_member_p,sparse_fixup_header)
(sparse_skip_file)
(oldgnu_sparse_member_p,oldgnu_fixup_header,star_sparse_member_p)
(star_fixup_header, pax_sparse_member_p): New function
(pax_decode_header): Remove
* src/system.h: Include <sys/time.h> and <utime.h> when available
* src/tar.c (usage): Prototype moved to common.h
* src/tar.h (struct tar_stat_info.is_sparse): New member
* src/utf8.c (utf8_convert): Changed prototype
(get_input_charset): Removed unused variable
* src/xheader.c: include <fnmatch.h>
(size_decoder): Assign to both st->archive_file_size and
st->stat.st_size.
(st->stat.st_size): Assign to st->stat.st_size
(sparse_numbytes_decoder): Removed unused variable
* src/.cvsignore: Added .gdbinit
* THANKS: Added Mads Martin Joergensen
2004-03-26 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/create.c (write_long_name): Do not allow more than
NAME_FIELD_SIZE-1 characters in a file name for V7 format
archives.
* tests/longv7.sh: New file.
* tests/Makefile.am: Add longv7.sh
2004-03-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/buffer.c (open_archive): Clear read_full_records_option
if reading from a pipe.
(short_read): Display warning about the deduced record size
if version > 1
* tests/star/pax-big-10g.sh: Updated to match the above changes.
* tests/star/ustar-big-2g.sh: Likewise.
* tests/star/ustar-big-8g.sh: Likewise.
* configure.ac: Added gl_FUNC_STRTOULL
* src/create.c (start_header): Check for GNU_FORMAT
if incremental_option is set.
* src/xheader.c (to_decimal): New function.
(xheader_format_name): Use to_decimal() instead of snprintf.
* tests/listed01.sh: Use genfile instead of dd
* tests/multiv01.sh: Likewise.
2004-03-12 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/list.c (read_and): Stop processing the archive after
encountering a single zero record. Many old archives contain
arbitrary garbage after it.
The warning is issued anyway.
2004-03-02 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/rtapelib.c (rmt_lseek__,rmt_ioctl__): Bugfix. The
conversion buffer was not null terminated. Fix provided
by Leland Lucius <llucius@tiny.net>
* THANKS: Added Leland Lucius
* src/utf8.c (utf8_convert): Indentation fix.
2004-02-29 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/buffer.c (flush_read): Bugfix: the
condition at line 714 included
|| (status > 0 && !read_full_records_option)
which is grossly wrong, since even if new_volume() below succeeds,
the subsequent call to rmtread will overwrite the chunk of data
already read in the buffer and thus spoil everything.
* src/system.c (sys_child_open_for_uncompress): Minor stylistic
fix.
* tests/star/multi-fail.sh: New test.
* tests/Makefile.am: Added multi-fail.sh
* tests/star/README: Updated
2004-02-29 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* NEWS: Updated
* configure.ac: Removed spurious AC_CHECK_LIB(iconv)
* src/common.h (utc_option): new global
(enum old_files.KEEP_NEWER_FILES): New element
* src/extract.c: Handle --keep-newer-files option
* src/list.c (tartime): Print UTC if --utc was given.
* src/tar.c: New options: --utc and keep-newer-files
* tests/Makefile.am: Added new tests
* tests/after: Rewritten
* tests/before: Rewritten
* tests/preset.in: Rewritten
* tests/delete03.sh: Accomodate for the new testsuite logic
* tests/gzip.sh: Likewise
* tests/incremen.sh: Likewise
* tests/listed01.sh: Likewise
* tests/multiv01.sh: Likewise
* tests/old.sh: Likewise
* tests/options.sh: Likewise
* tests/version.sh: Likewise
* tests/volume.sh: Likewise
* tests/star: New directory
* tests/star/README: New file
* tests/star/gtarfail.sh: New file
* tests/star/gtarfail2.sh: New file
* tests/star/pax-big-10g.sh: New file
* tests/star/qucktest.sh: New file
* tests/star/ustar-big-2g.sh: New file
* tests/star/ustar-big-8g.sh: New file
2004-02-26 Paul Eggert <eggert@twinsun.com>
* doc/tar.texi (dircategory Individual utilities): Append period,
as suggested by Karl Berry.
2004-02-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/list.c (decode_header): Call xheader_decode before
the assignment to current_stat_info.archive_file_size.
2004-02-23 Paul Eggert <eggert@twinsun.com>
* configure.ac: Invoke AM_ICONV, to define ICONV_CONST if needed.
2004-02-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1.13.93 released.
* NEWS: Updated
* tests/before: Move testing of the prerequisite archive formats
to the separate function 'prereq'. Do not expect any arguments
* tests/delete03.sh: Use prereq() instead of passing arguments
to 'before'.
* tests/incremen.sh: Likewise.
* tests/listed01.sh: Likewise.
* tests/multiv01.sh: Likewise.
2004-02-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
Added UTF-8 support. Finished global extended header
support.
* NEWS: Minor fix
* configure.ac: Detect libiconv
* src/utf8.c: New file. Conversions to and from utf-8.
* src/Makefile.am: Added utf8.c
* src/create.c (write_header_name) In pax format, use
"path" keyword if the file name is not ASCII
(start_header): Likewise for uname and gname.
* src/list.c: Decode encountered global headers.
* src/xheader.c: Use keywords from the global
headers.
Correctly handle UTF-8 conversions.
(xheader_list_destroy): New function.
(xheader_set_single_keyword,xheader_set_keyword_equal): Added
missing gettext markers
(decode_record): Rewritten using caller-provided handler and
data closure.
* tests/listed01.sh: Give credit to Andreas Schuldei.
2004-02-21 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/create.c (dump_file0): The conditional at line
1296 prevented incremental backups on individual files
from working, as reported by Andreas Schuldei
<andreas@schuldei.org>.
This is due to the condition
(0 < top_level || !incremental_option)
Removing it makes incremental backups work for individual
files as well as for directories. On the other hand, it does
not affect other functionality, as shown by the reasoning below:
To begin with, the two parts of this condition are mutually
superfluous, because
1) when top_level < 0, incremental_option == 1
so the condition yields false
2) when top_level >= 0, incremental_option == 0
so the condition yields true.
In other words, it is completely equivalent to
(!incremental_option)
Now, let's consider the effect of its removal. There are two cases:
1) when incremental_option==1
This means incremental backup in progress. In this case dump_file
is invoked only for directories or for files marked with 'Y' by
get_directory_contents. The latter are those that did not meet the
condition in incremen.c:242, which is exactly the same condition
as this at create.c:1296. So, for these files the check
(!incremental_option) is useless, since the rest of the
conditional will yield false anyway. On the other hand, if
dump_file is invoked on a directory, the conditional will yield
false due to !S_ISDIR assertion, so these will be processed as usual.
Thus, for this case the extra condition (!incremental_option) is
irrelevant, and its removal won't alter the behavior of tar,
*except* that it will enable incremental backups on individual
files, which is the wanted effect.
2) when incremental_option==0
In this case the condition yields true and its removal does not
affect the functionality.
* THANKS: Updated
* configure.ac: Raised patchlevel to 93
* src/incremen.c: Minor stylistic fixes.
* tests/listed01.sh: New test. Check listed incremental
backups on individual files.
* tests/Makefile.am: Added listed01.sh
2004-02-20 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/common.h (simple_finish_header,start_private_header): New
declarations
(xheader_ghdr_name): Changed declaration
* src/create.c (start_private_header): Removed static qualifier.
(write_extended): Removed superfluous last argument. Use
xheader_write()
(simple_finish_header): New function.
(finish_header): Use simple_finish_header() to break recursive
dependency between this function and write_extended().
* src/tar.c (assert_format): Do not bail out if several
--format arguments are given. This is a common case when
TAR_OPTIONS are used.
(decode_options): New option --show-defaults displays the
compiled-in defaults.
Use POSIX format if no --format option was given and
--pax-option was specified.
Do not allow to use --pax-option unless the archive format is
set to POSIX (or reading subcommand is requested).
* src/update.c (update_archive): Write global extended header if
constructed.
* src/xheader.c (xheader_format_name): Bugfix.
(xheader_xhdr_name): Changed the default extended header name
to '%d/PaxHeaders.%p/%f', as POSIX requires.
(xheader_ghdr_name): Removed unused argument.
(xheader_write,xheader_write_global): New function.
(xheader_decode): Modified to honor overrides whatever
the current archive format is.
* src/delete.c (delete_archive_members): Call xheader_decode
unconditionally.
* src/list.c (decode_header): Likewise.
* src/incremen.c (sort_obstack): Fixed typo in the comment
* doc/tar.texi: Document new default for extended
header names.
* tests/before: Accept an optional list of allowed archive
formats. Exit with the status 77 if the current archive
format does not match any of them.
* tests/delete03.sh: Require gnu, oldgnu or posix format
* tests/incremen.sh: Require gnu or oldgnu format
* tests/multiv01.sh: Likewise
2004-02-20 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* doc/tar.texi (Option Summary): Documented --pax-option
* src/tar.c: Likewise.
* NEWS: Likewise.
* src/create.c (to_chars): Added a comment.
* src/tar.h: Comment to GNU_FORMAT
2004-02-18 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* README: Updated
* configure.ac: Added stpcpy
* bootstrap: Likewise
* lib/Makefile.am: Likewise
* src/common.h (xheader_xhdr_name,xheader_ghdr_name): New
functions
* src/create.c (write_extended): Call xheader_xhdr_name
instead of using hardcoded "././@PaxHeader" name.
* src/tar.c: New option --pax-option (equivalent to -o option
of pax).
* src/xheader.c: Implement pax -o option. Fixed misleading
heading comment (introduced 2003-09-02).
* src/incremen.c: Minor fixes
* m4/.cvsignore: Updated
2004-02-17 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/incremen.c: Removed accumulator stuff in favor of obstack.
(get_directory_contents): Split into two functions
* src/update.c: Minor changes
* doc/tar.texi: Fixed typo
2004-02-15 Paul Eggert <eggert@twinsun.com>
Fix Debian bug 230872, originally reported by Jeff King in
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=230872>.
* doc/tar.texi (posix compliance): Remove. The whole section
was a misunderstanding of what POSIXLY_CORRECT is supposed to
mean. The GNU Coding Standards says that POSIXLY_CORRECT
is for disabling extensions that are incompatible with POSIX:
it is not for disabling compatible extensions. All references
to this section removed.
(posix): This format is created only if the posix format is
specified; it is no longer created if gnu format is specified
and POSIXLY_CORRECT is set.
* src/tar.c (decode_options): Ignore POSIXLY_CORRECT.
POSIX does not specify the behavior of tar, so we should
not worry about POSIXLY_CORRECT here.
2004-01-21 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* Makefile.am: Removed m4
* configure.ac: Require automake-1.8/autoconf-2.59. Removed
m4/Makefile.
* README-alpha: Updated
* bootstrap: Updated TP URL, improved help output. Default
to :ext:anoncvs and set CVS_RSH, unless already set.
* m4/Makefile.am: Removed
2004-01-21 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* bootstrap: Bugfix by Marco Gerards <metgerards@student.han.nl>:
Use $option instead of $1 so all options will be parsed.
2004-01-04 Sergey Poznyakoff <gray@Mirddin.farlep.net>
Started rewriting buffer.c ...
* bootstrap: New option --no-po
* src/buffer.c (new_volume,check_label_pattern): Changed return type.
(time_to_start_writing): Changed data type
(file_to_switch_to): Removed. Variable never assigned to.
(open_archive) Moved option compatibility checks to tar.c
Other minor changes.
* src/common.h (maybe_backup_file): Changed return type
* src/misc.c: Likewise.
* src/create.c: Updated invocations of safer_name_suffix
* src/extract.c: Likewise
* src/delete.c: Updated assignment to write_archive_to_stdout
* src/tar.c (decode_options): More option compatibility checks
(moved from buffer.c)
* src/update.c (time_to_start_writing): Changed data type.
* tests/recurse.sh: New test case.
* tests/mksparse.c: New file.
* tests/Makefile.am: Added recurse.sh and mksparse.c
2004-01-02 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/sparse.c (sparse_diff_file): Bugfix. Thanks
Martin Simmons for the patch.
* src/create.c (dump_dir0): Bugfix. Thanks Piotr Czerwinski
<pius@pld-linux.org> for the patch.
2003-12-26 Paul Eggert <eggert@twinsun.com>
Synchronize with Gettext 0.13.1, Automake 1.8, Autoconf 2.59,
and translation website.
* bootstrap: Don't bother skipping codeset.m4, glibc21.m4,
intdiv0.m4, inttypes_h.m4, inttypes.m4, inttypes-pri.m4,
isc-posix.m4, and lcmessage.m4 from gnulib. This list of files is
a bit obsolete anyway, now that gettext 0.13.1 is out. Also, the
files are replaced by autoreconf. Also, there seems to be a bug
in gettext/autoconf/automake if we try to omit these files after
autoreconf has replaced them, even though the gettext manual says
they're optional. So give up and just include them for now, even
though they make 'configure' longer and slower.
Change translation URL from
<http://www.iro.umontreal.ca/contrib/po/maint/tar/> to
<http://www2.iro.umontreal.ca/~gnutra/po/maint/tar/> to
accommodate translator website revamp.
Fail if autoreconf fails.
* m4/.cvsignore: Add intmax.m4, longdouble.m4, printf-posix.m4,
signed.m4, size_max.m4, wchar_t.m4, wint_t.m4, xsize.m4, to
ignore files now supplied by gettext 0.13.1.
2003-12-25 Sergey Poznyakoff <gray@Mirddin.farlep.net>
Synchronized with the backup repository on Mirddin
2003-12-19 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* configure.ac: Check for varios members of struct stat
that may represent file modification times with a subsecond
precision.
Check for utimes (for future use)
* src/buffer.c (short_read): Issue a warning on short reads.
* src/common.h (sys_stat_nanoseconds): New function
* src/create.c (dump_file0): Use sys_stat_nanoseconds().
* src/list.c (read_and): Treat only two successive zero
filled blocks as an EOF indicator. Issue a warning if
a single one is encountered.
* src/system.c (sys_stat_nanoseconds): New function
* src/tar.h (tar_stat_info.atime_nsec,mtime_nsec,ctime_nsec): New
members.
* src/xheader.c (code_time,decode_time): Support for subsecond
precision.
(atime_coder,atime_decoder,ctime_coder,ctime_decoder)
(mtime_coder,mtime_decoder): Update invocations of code_time and
decode_time.
(gid_decoder,size_decoder,uid_decoder,sparse_size_decoder)
(sparse_numblocks_decoder,sparse_offset_decoder)
(sparse_numbytes_decoder): Updated
2003-12-18 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/names.c (safer_name_suffix): Reverted change made
2003-11-14. Reason: Discussion with Paul Eggert and
Jean-Louis Martineau. See also ChangeLog entry from
1999-08-14.
* tests/delete03.sh: Likewise.
* tests/extrac04.sh: Likewise.
* tests/multiv01.sh: Likewise.
2003-12-12 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/incremen.c (write_directory_file): Use sys_truncate
* src/list.c (print_header): Use archive_file_size member
when printing real file size.
* src/sparse.c (sparse_scan_file): Correctly handle files with
a hole at the end.
(sparse_dump_region,sparse_extract_region): Allow for zero size
trailing blocks
2003-12-12 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* configure.ac: Raised version number to 1.13.92
* src/list.c (decode_header): Discern between pax and ustar
formats
Initialize current_stat_info.archive_file_size.
NOTE: Modifications from this date on are temporarily
stored on local CVS on mirddin. This repository will
be synchronized with Savannah as soon as the latter
becomes operational again.
2003-12-01 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* TODO: Updated
* src/sparse.c: Initial implementation of GNU/pax sparse
file format.
* src/common.h (xheader_store): Changed prototype.
* src/create.c: Update calls to xheader_store
* src/extract.c (extract_archive): Check reported size vs.
archive file size to determine if we have to do with a
sparse file.
* src/tar.c (usage): Cleaned up the sample argument to --newer
option.
(decode_options): Allow --sparse for POSIX_FORMAT archives.
* src/xheader.c (struct xhdr_tab.coder; all coder function): Added
extra argument
Implemented GNU.sparse.* keywords.
2003-11-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* configure.ac: Check for setlocale. Thanks Bruno Haible for
reporting.
2003-11-25 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/create.c (write_gnu_long_link): Use oldgnu
magic with @LongLink blocks.
2003-11-17 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/tar.h: Support for star sparse format.
* src/sparse.c: Likewise.
2003-11-17 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/sparse.c (sparse_diff_file): New function
* src/common.h (sys_compare_uid,sys_compare_gid): New functions
(sys_compare_uid_gid): Removed.
(sys_compare_links,report_difference): Changed prototype
(sparse_diff_file): New function
* src/system.c (sys_compare_uid,sys_compare_gid): New functions
(sys_compare_uid_gid): Removed.
(sys_compare_links): Changed declaration
* src/compare.c (diff_archive): Use sparse_diff_file.
2003-11-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
Rewritten sparse file handling.
* src/sparse.c: New file. Provides a universal framework
for various methods for sparse files handling.
* src/Makefile.am: Added sparse.c
* src/common.h (struct sp_array,sparsearray,sp_array_size)
(init_sparsearray,fill_in_sparse_array): Removed
(enum dump_status): New data type
(pad_archive,close_diag,open_diag,read_diag_details)
(readlink_diag,savedir_diag,seek_diag_details,stat_diag): New
functions.
(sparse_file_p,sparse_dump_file,sparse_extract_file): New
functions.
(print_header): Changed prototype declaration.
* src/tar.h (struct sp_array): Declaration from common.h
(struct tar_stat_info): New members archive_file_size,
sparse_map_avail,sparse_map.
* src/create.c: Major rewrite.
* src/extract.c: Use new sparse file interface.
* src/compare.c (diff_sparse_files): Temporary placeholder.
* src/buffer.c: Minor changes
* src/tar.c: Likewise.
* src/list.c: Likewise.
* src/misc.c (close_diag,open_diag,read_diag_details)
(readlink_diag,savedir_diag,seek_diag_details,stat_diag): New
diagnostics functions.
* src/incremen.c: Use new diagnostics functions.
* src/names.c: Likewise.
2003-11-14 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* configure.ac: Fixed check for setsockopt
* src/create.c: Do not zero-terminate name field if
the name is exactly 100 characters long.
(write_ustar_long_name): Fixed cheking for unsplittable
names.
2003-11-14 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/create.c (start_header): Removed debugging hook
(dump_file): Fixed handling of linkname field.
* src/names.c (safer_name_suffix): If the input
file name ends with a slash, output one should do so
as well.
* doc/tar.texi: Documented --format=ustar
2003-11-14 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/tar.h (archive_format): USTAR_FORMAT: New type.
* src/create.c: Added POSIX.1-1988 support.
* src/names.c (safer_name_suffix): Skip leading ./
* src/tar.c: New option --format=ustar forces
POSIX.1-1988 archive format.
* tests/delete03.sh: Updated.
* tests/extrac04.sh: Updated.
* tests/multiv01.sh: Updated.
2003-11-13 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/list.c (read_and): Initialize current_stat_info
and extended_header at the start of the loop.
* src/names.c (all_names_found): Check if the argument
contains valid filename. Fixes coredump on `not_a_tar_file'
* src/xheader.c (atime_decoder,gid_decoder,ctime_decoder)
(mtime_decoder,size_decoder,uid_decoder): Use xstrtoumax.
Fixes `pax-big-10g' bug.
2003-11-12 Paul Eggert <eggert@twinsun.com>
Fix some C compatibility bugs reported by Joerg Schilling.
* src/common.h (stripped_prefix_len): Fix misspelling
"stripped_path_len" in declaration.
* src/rmt.c (main): Use "return FOO;" rather than
"exit (FOO);"; we no longer have to worry about
pre-ANSI hosts that mishandled returned values from "main".
* src/tar.c (main): Likewise. This avoids warnings on some
compilers.
* src/system.c: Include signal.h, for 'kill'.
* src/system.h (DEV_BSIZE): Remove.
(DEFAULT_ST_BLKSIZE): New macro.
(ST_BLKSIZE): Use it, instead of DEV_BSIZE.
* src/tar.c (enum): Remove comma just before }.
2003-11-12 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/list.c (decode_header): Initialize st_atime and
st_ctime.
2003-11-11 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* configure.ac (tar_save_LIBS): Bugfix. Thanks Adrian
Bunk <bunk@fs.tum.de> for reporting.
* doc/tar.texi: Fixed spelling. Thanks Martin Buchholz
<martin@xemacs.org> for spotting.
2003-11-04 Paul Eggert <eggert@twinsun.com>
* src/xheader.c (xhdr_tab): Make it extern, not static, as C89 and
C99 require this.
2003-10-26 Paul Eggert <eggert@twinsun.com>
* src/system.c (sys_spawn_shell): Cast trailing null to (char *).
Bug reported by Christian Weisgerber.
2003-10-19 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* AUTHORS: Updated
* NEWS: Updated
* src/tar.c (decode_options): Removed superfluous archive format
check
* doc/tar.texi: Documented new features.
2003-10-08 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* NEWS: Updated
* THANKS: Added Wojciech Polak
* configure.ac: Added checks for missing functions. Raised
version number to indicate alpha release.
* lib/Makefile.am: Added missing headers
* lib/waitpid.c: Added missing includes.
* src/extract.c: Likewise.
* src/names.c: Removed spurious includes.
* src/xheader.c: Likewise.
* src/system.h [MSDOS]: Fixed spelling of EACCES. Added
macro overriding broken mkdir prototypes.
2003-10-04 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* configure.ac: Check for dev_t and ino_t.
* m4/Makefile.am: Added missing files.
* src/system.c: New file.
* src/Makefile.am: Added system.c
* src/common.h: Prototypes for functions from system.c
* src/system.h (SET_BINARY_MODE, ERRNO_IS_EACCESS): New defines
* src/buffer.c: Moved system dependencies to system.c
* src/compare.c: Likewise.
* src/create.c: Likewise.
* src/delete.c: Likewise.
* src/extract.c: Likewise.
* src/rtapelib.c: Likewise.
2003-10-04 Sergey Poznyakoff <gray@Mirddin.farlep.net>
Implemented --occurrence option.
* NEWS: Updated.
* src/tar.c: New option --occurrence.
* src/common.h (occurrence_option): New global
(struct name): Changed `found' member to `uintmax_t
found_count'.
(names_done): Removed
(all_names_found): Changed prototype.
(ISFOUND,WASFOUND): New macros
* src/delete.c (delete_archive_members): Honor --occurrence
option.
* src/list.c (read_and): Likewise.
* src/names.c: Count number of occurrences of each name in the
archive.
(name_match): Honor --occurrence option.
(names_done): Removed
(all_names_found,names_notfound): Rewritten.
2003-10-02 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/tar.c: Removed extra precaution regarding
subcommand_option == CAT_SUBCOMMAND
* lib/Makefile.am: Updated
2003-10-02 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/common.h (names_done): New function.
* src/names.c: Likewise.
* src/list.c (read_and): Use all_names_found() as `while'
condition.
* src/tar.c: New option --first-copy
* NEWS: Updated
2003-09-24 Paul Eggert <eggert@twinsun.com>
* src/rmt.c (main): Don't translate Copyright string; international
law says the word "Copyright" should be in English.
* src/tar.c (decode_options): Likewise.
2003-09-22 Paul Eggert <eggert@twinsun.com>
* doc/tar.texi (extracting untrusted archives): New section.
* src/common.h (stripped_path_len): Renamed from cut_path_elements.
Return size_t, not pointer, so that we don't have to worry about
violating the C standard by converting char const * to char *.
All callers changed.
* src/names.c (stripped_path_len): Likewise. Strip file system
prefix, too. Count adjacent slashes as if they were one slash;
that is the POSIX standard.
2003-09-17 Paul Eggert <eggert@twinsun.com>
* README-alpha: Document maintainer tool assumptions a bit. GNU
'sed' is no longer required. For GNU m4 1.4, suggest the patch in
Debian bug 211447. Fix minor misspellings/whitespace nits.
* configure.ac (AC_AIX, AC_MINIX): Remove; subsumed by
gl_USE_SYSTEM_EXTENSIONS.
* lib/.cvsignore: Add exit.h, time_r.c, time_r.h.
* m4/.cvsignore: Add restrict.m4, time_r.m4.
2003-09-17 Paul Eggert <eggert@twinsun.com>
* bootstrap: Don't use "for option; do";
Solaris 8 /bin/sh doesn't like that.
2003-09-17 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* README-alpha: Updated
* bootstrap: Updated
2003-09-17 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* README-alpha: Updated
* bootstrap: Updated
* po/POTFILES.in: Added src/xheader.c
* src/common.h (cut_path_elements): Added proto.
2003-09-05 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/buffer.c: Use ngettext where appropriate.
* src/compare.c: Likewise.
* src/create.c: Likewise.
* src/misc.c: Likewise.
* src/tar.c: Likewise.
* src/update.c: Likewise.
2003-09-04 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* .cvsignore: Added *.shar.gz
* NEWS: Updated
* TODO: Updated
* src/common.h (strip_path_elements): New variable.
* src/extract.c (extract_archive): Implemented --strip-path
* src/names.c (cut_path_elements): New functon.
* src/tar.c: New option --strip-path=NUM.
(decode_options) Assign boolean values to bool variables.
2003-09-04 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/delete.c: Fixed deletion from the POSIX archives.
* src/list.c (read_header): Minor change.
* src/tar.c (main): Do not check for volume_label_option
if subcommand_option is not CREATE_SUBCOMMAND.
* src/xheader.c (xheader_decode): Store the header as
well (for eventual delete).
* tests/incremen.sh: Explicitly request GNU format. This will
disappear when GNU extended header keywords are working.
* tests/multiv01.sh: Likewise
* tests/volume.sh: Likewise
2003-09-04 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/create.c: Support for "linkpath" extended keyword.
* src/xheader.c (decode_record): Reversed the return
condition.
2003-09-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* configure.ac: Allow to redefine the default output format.
* src/tar.c: Use DEFAULT_ARCHIVE_FORMAT macro
(archive_format_string): New function.
(usage): Updated help output.
* README: Updated.
* NEWS: Updated.
* TODO: Updated.
2003-09-02 Paul Eggert <eggert@twinsun.com>
* src/common.h (destroy_stat, xheader_decode, xheader_store,
xheader_read, xheader_finish, xheader_destroy): Add decls;
C99 requires this.
* src/create.c (write_extended): Remove unused local 'bufsize'.
* src/delete.c (delete_archive_members): Handle case of
HEADER_SUCCESS_EXTENDED followed by HEADER_FAILURE.
* src/list.c (read_and): Abort if HEADER_SUCCESS_EXTENDED
occurs, as it's not possible.
* src/update.c (update_archive): Likewise.
Use "const" when possible in new code.
* src/tar.c (struct fmttab.name): Now char const *. All uses changed.
(fmttab): Now const. All uses changed.
* src/xheader.c (struct xhdr_tab.keyword): Now pointer to const.
(struct xhdr_tab.coder, struct xhdr_tab.decoder, locate_handler,
decode_record, xheader_store, xheader_print, code_string, code_time,
code_num, dummy_coder, dummy_decoder, atime_coder, atime_decoder,
gid_coder, gid_decoder, gname_coder, gname_decoder, linkpath_coder,
linkpath_decoder, ctime_coder, ctime_decoder, mtime_coder,
mtime_decoder, path_coder, path_decoder, size_coder, size_decoder,
uid_coder, uid_decoder, uname_coder, uname_decoder):
Use pointers to const when possible.
(xhdr_tab): Now const.
* src/tar.c (fmttab): Avoid GCC warning by not eliding initializers.
(set_archive_format): Report an error if no format name matches,
instead of returning an undefined value.
* src/xheader.c (struct xhdr_tab.decoder, dummy_decoder,
atime_decoder, gid_decoder, gname_decoder, linkpath_decoder,
ctime_decoder, mtime_decoder, path_decoder, size_decoder,
uid_decoder, uname_decoder): Remove unused keyword arg.
All uses changed.
* src/tar.c (set_archive_format): Now static.
* src/xheader.c (xhdr_tab, format_uintmax): Now static.
* src/xheader.c (dummy_coder, dummy_decoder, atime_coder,
atime_decoder, gid_coder, gid_decoder, gname_coder, gname_decoder,
linkpath_coder, linkpath_decoder, mtime_coder, mtime_decoder,
ctime_coder, ctime_decoder, path_coder, path_decoder, size_coder,
size_decoder, uid_coder, uid_decoder, uname_coder, uname_decoder):
Remove forward decls; no longer needed.
(xhdr_tab): Move to end, so that the forward decls aren't needed.
Add a forward declaration.
Use 'bool' in new code, when appropriate.
* src/xheader.c (decode_record): Return bool, not int.
* src/common.h (read_header): Since it accepts bool, change
all callers to use false and true rather than 0 and 1.
* src/xheader.c (decode_record): Fix misspelling in diagnostic
"extended headed" -> "extended header".
GNU coding style fixes.
* src/xheader.c (decode_record, xheader_decode):
Do not use decls like "char *p, *q;".
Minor style fixes.
(xheader_store): Avoid parentheses around object operand of sizeof.
2003-09-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/create.c (start_header): Store long file names
in "path" keyword of an extended header if in POSIX
mode.
(finish_header): print header before calling write_extended().
* src/list.c (list_archive): Always decode the header. This
is necessary so the extended header is processed and the correct
filename is printed no matter what the state of verbose_option.
* src/xheader.c (xhdr_tab): Reserved GNU keywords (commented out
for the time being).
2003-09-01 Paul Eggert <eggert@twinsun.com>
Update from gnulib, and correct fnmatch to fnmatch-gnu.
* bootstrap (gnulib_modules): Change fnmatch to fnmatch-gnu.
Sort.
* configure.ac (gl_USE_SYSTEM_EXTENSIONS): Use this instead
of AC_GNU_SOURCE.
* lib/.cvsignore: Add alloca.h, stdbool.h. Sort. Append newline.
* lib/Makefile.am (lib_OBJECTS): New macro, for convenience when
copying rules from gnulib module descriptions.
(BUILT_SOURCES, EXTRA_DIST, all-local, alloca.h):
Update from gnulib modules alloca, fnmatch, getline, stdbool.
* m4/.cvsignore: Add utimes-null.m4. Sort.
2003-09-01 Sergey Poznyakoff
Added initial support for creating POSIX headers.
* src/common.h (MAXOCTAL11,MAXOCTAL7): New defines
(string_to_chars): New functions
(struct xheader): Changed structure
(gid_to_gname,gname_to_gid,uid_to_uname,uname_to_uid): Changed
prototypes.
* src/create.c (string_to_chars): New function.
(write_extended): New function
(start_header): Create extended POSIX headers if necessary.
(finish_header): Likewise.
* src/list.c (print_header): Take user/group from
current_stat_info.
* src/names.c (gid_to_gname,gname_to_gid)
(uid_to_uname,uname_to_uid): Changed prototypes.
* src/tar.c: New option --format.
* src/tar.h (OLDGNU_COMPATIBILITY): Removed
(struct extra_header): Removed unused structure.
(union block.extra_header): Removed unused member.
* src/xheader.c: Implemented coder functions.
* bootstrap: Added obstack.
* lib/.cvsignore: Likewise.
* configure.ac: Added 'gl_OBSTACK'
* m4/Makefile.am: Added new files.
* m4/.cvsignore: Likewise.
* TODO: Minor formatting change
2003-08-31 Sergey Poznyakoff
Added initial support for POSIX extended and STAR headers
(only for listing/extracting).
* src/xheader.c: New file.
* src/Makefile.am: Added xheader.c
* src/tar.h (struct star_header): New datatype
(XHDTYPE,XGLTYPE): New defines
(enum archive_format:STAR_FORMAT): New member
(struct tar_stat_info): New datatype.
(union block.star_header): New member.
* src/common.h (orig_file_name,current_file_name)
(current_trailing_slash,current_link_name): Removed variables.
(current_stat_info): New variable
(current_stat): Removed
(extended_header): New variable
(decode_header): Changed prototype.
* src/list.c (decode_header): Added initial support for POSIX extended
and STAR headers.
(skip_member): Check oldgnu_header only if current_format is set
to OLDGNU_FORMAT.
* src/buffer.c: Use current_stat_info
* src/compare.c: Likewise.
* src/create.c: Likewise.
* src/delete.c: Likewise.
* src/incremen.c: Likewise.
* src/mangle.c: Likewise.
* src/update.c: Likewise.
* src/extract.c: Likewise.
(make_directories): Improved check for the existence of the directory
* src/tar.c (destroy_stat): New function.
2003-08-29 Paul Eggert <eggert@twinsun.com>
* NEWS, bootstrap: Drop en_GB locale; it was more trouble than it
was worth (e.g., different users in en_GB disagree about -ize
versus -ise).
* po/en_GB.po: Remove.
2003-07-28 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* TODO: Updated
* NEWS: Updated
* src/tar.c: Removed support for the obsolete command line
options.
* doc/tar.texi: Removed references to the obsolete command
line options.
2003-07-27 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* TODO: Updated
* NEWS: Updated
* doc/tar.texi: Updated
* src/common.h (check_links_option): New variable
(orig_file_name): New variable
(check_links): New proto.
* src/create.c (struct link.nlink): New member
(link_table): Static for the module.
(dump_file): Update `link' member when adding new links
to the link_table.
(check_links): New function.
* src/list.c (print_header): Use orig_file_name.
* src/tar.c: New option --check-links. Changed semantics of
-o to comply to UNIX98 when extracting and to its previous
semantics otherwise.
(main): Call check_links if --check-links. was given.
2003-07-25 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/list.c (print_header): Revised
* NEWS: Started the entry for 1.13.26
* doc/Makefile.am (tar.dvi): Fixed TEXINPUTS value.
2003-07-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* .cvsignore: Added to the repository.
* doc/.cvsignore: Likewise.
* lib/.cvsignore: Likewise.
* m4/.cvsignore: Likewise.
* po/.cvsignore: Likewise.
* scripts/.cvsignore: Likewise.
* src/.cvsignore: Likewise.
* tests/.cvsignore: Likewise.
* lib/Makefile.am: Added exitfail.[hc]
* src/misc.c (chdir_do): Fixed call to restore_cwd
* src/buffer.c (flush_read): Fixed behavior on short
reads right after opening the new archive (multiv01.sh test).
(new_volume): Special handling for "-".
* src/list.c (print_header): Print trailing slash if
current_trailing_slash was set (extrac03.sh,extrac04.sh tests).
* tests/multiv01.sh: Minor changes.
* m4/Makefile.am: Added missing files.
2003-07-05 Paul Eggert <eggert@twinsun.com>
Finish the checkin begin yesterday.
* NEWS: Document the user-visible changes installed in the last
two days.
* TODO: New file (actually, resurrected; but with new contents).
* src/list.c (read_and): Give full type for procedure arg.
(read_header): Strip trailing slashes, setting current_trailing_slash.
(tartime): Avoid int overflow when printing year (!).
(print_header): New arg specifying block ordinal. All uses changed.
Print link as 'h' type. Give labels for long links and names.
* src/misc.c (contains_dot_dot): Moved to names.c
(must_be_dot_or_slash): New function.
(safer_rmdir): Use it.
(remove_any_file): Now takes enum as option, not boolean.
Check for (Linux) EISDIR as well as (POSIX) EPERM when attempting
to unlink a directory.
(deref_stat): Accept bool, not int.
* src/names.c (namelist_match): Allow partial matches only if
recursive.
(hash_string_hasher): Renamed from hash_avoided_name.
(hash_string_compare): Renamed from compare_avoided_anames.
(hash_string_insert, hash_string_lookup): New functions.
(add_avoided_name, is_avoided_name): Use them.
(safer_name_suffix): New function.
(contains_dot_dot): Moved here from misc.c. Now returns bool, not int.
* src/rmt.c: Don't include print-copyr.h.
(prepare_input_buffer): New arg FD.
Do not read more than INT_MAX bytes at once,
since it breaks on some brain damaged Tru64 hosts.
Divide size by two
when retrying instead of subtracting 1024; for speed.
(main): Use gettext to translate (C), not print_copyright.
* src/system.h: Include <alloca.h> and <stdbool.h> unconditionally,
now that gnulib handles this.
Include <stddef.h> and <limits.h> unconditionally, now that we assume
C89 or better.
Assume that offsetof is defined in stddef.h.
Do not include <sys/param.h>.
(realloc, lseek): Do not declare.
(HAVE_DECL_VALLOC): Renamed from HAVE_VALLOC.
(CHAR_BIT, CHAR_MAX, UCHAR_MAX, LONG_MAX): Remove
declarations, since we now assume C89 or better.
(PARAMS): Remove, as we now assume C89. All uses changed.
(bindtextdomain, textdomain): Include <gettext.h> to define.
Include <unlocked-io.h>.
(valloc): Define if not defined, and if valloc is not declared.
(xstrdup): Remove decl.
* src/tar.c: Do not include <print-copyr.h>.
Include <getdate.h>.
(get_date): Remove decl.
(ATIME_PRESERVE_OPTION, CHECKPOINT_OPTION, FORCE_LOCAL_OPTION,
IGNORE_FAILED_READ_OPTION, INDEX_FILE_OPTION, NO_OVERWRITE_DIR_OPTION,
NUMERIC_OWNER_OPTION, RECURSIVE_UNLINK_OPTION, REMOVE_FILES_OPTION,
SHOW_OMITTED_DIRS_OPTION, TOTALS_OPTION): New constants.
(long_options, decode_options): Use them.
(OVERWRITE_DIR_OPTION): Remove.
(long_options): New options --index-file, --no-overwrite-dir.
Remove --overwrite-dir option.
(usage): Use PACKAGE_BUGREPORT.
(decode_options): Terminate new argv properly.
Use PACKAGE_NAME, PACKAGE_VERSION.
If verbose, report how we grokked any textual date option.
(main): Add support for index-file.
* tests/Makefile.am: Convert to UTF-8.
(AUTOMAKE_OPTIONS): Remove.
(TESTS): Add delete04.sh, multiv01.sh, options.sh.
(INCLUDES): Remove ../intl.
(LDADD): Don't link libtar.a twice.
* tests/genfile.c: Convert to UTF-8.
Don't include <print-copyr.h>.
(DEFAULT_PATTERN): Renamed from DEFAULT.
(ZEROS_PATTERN): Renamed from ZEROS.
(main): Use gettext to translate (C), not print_copyright.
2003-07-04 Paul Eggert <eggert@twinsun.com>
Revamp to meet current standards of autoconf, automake,
gettext, and gnulib, and incorporate new translations.
* config/config.guess, config/config.sub, config/depcomp,
config/install-sh, config/mdate-sh, config/missing,
config/mkinstalldirs, config/texinfo.texi:
Moved here from parent directory, or from doc.
* config.hin: Renamed from config.h.in.
* config/config.rpath: New file.
* intl: Remove this subdirectory.
* lib/fnmatch_.h: Renamed from lib/fnmatch.hin.
* lib/getstr.c, lib/getstr.h, lib/msleep.c, lib/print-copyr.c,
lib/print-copyr.h, lib/readutmp.c, lib/rename.c, lib/stpcpy.c,
lib/strstr.c, lib/strtoimax.c, lib/strtoll.c, lib/strtoull.c,
lib/strtoumax.c, lib/unicodeio.c, lib/unicodeio.h,
lib/xstrtoimax.c, m4/c-bs-a.m4, m4/ccstdc.m4, m4/check-decl.m4,
m4/decl.m4, m4/jm-mktime.m4, m4/prereq.m4, m4/xstrtoimax.m4,
stamp-h.in: Remove.
* lib/alloca_.h, lib/fnmatch_loop.c, lib/gettext.h, lib/pathmax.h,
lib/safe-write.c, lib/safe-write.h, lib/stdbool_.h, lib/strcase.h,
lib/stripslash.c, lib/unlocked-io.h, lib/xgetcwd.h, m4/alloca.m4,
m4/backupfile.m4, m4/bison.m4, m4/chown.m4, m4/dirname.m4,
m4/dos.m4, m4/exclude.m4, m4/fileblocks.m4, m4/ftruncate.m4,
m4/getdate.m4, m4/getopt.m4, m4/hash.m4, m4/human.m4,
m4/intdiv0.m4, m4/intmax_t.m4, m4/inttypes-pri.m4,
m4/inttypes_h.m4, m4/isc-posix.m4, m4/lchown.m4, m4/lib-ld.m4,
m4/lib-link.m4, m4/lib-prefix.m4, m4/memset.m4, m4/mktime.m4,
m4/modechange.m4, m4/nls.m4, m4/onceonly.m4, m4/pathmax.m4,
m4/po.m4, m4/quote.m4, m4/quotearg.m4, m4/rmdir.m4,
m4/safe-read.m4, m4/safe-write.m4, m4/save-cwd.m4, m4/savedir.m4,
m4/ssize_t.m4, m4/stdbool.m4, m4/stdint_h.m4, m4/strcase.m4,
m4/strtoimax.m4, m4/strtol.m4, m4/strtoll.m4, m4/strtoul.m4,
m4/strtoull.m4, m4/strtoumax.m4, m4/tm_gmtoff.m4, m4/uintmax_t.m4,
m4/unlocked-io.m4, m4/xalloc.m4, m4/xgetcwd.m4, m4/xstrtol.m4,
po/LINGUAS, po/Makevars, po/Rules-quot, po/boldquot.sed,
po/en@boldquot.header, po/en@quot.header, po/en_GB.po,
po/insert-header.sin, po/remove-potcdate.sin, po/stamp-po: New files.
* ABOUT-NLS, INSTALL, lib/addext.c, lib/alloca.c, lib/argmatch.c,
lib/argmatch.h, lib/backupfile.c, lib/backupfile.h, lib/dirname.c,
lib/dirname.h, lib/error.c, lib/exclude.c, lib/exclude.h,
lib/fnmatch.h, lib/full-write.c, lib/full-write.h, lib/getdate.h,
lib/getdate.y, lib/getline.c, lib/getline.h, lib/getopt.c,
lib/getopt.h, lib/getopt1.c, lib/hash.c, lib/hash.h, lib/human.c,
lib/human.h, lib/lchown.c, lib/malloc.c, lib/mktime.c,
lib/modechange.c, lib/modechange.h, lib/quote.c, lib/quote.h,
lib/quotearg.c, lib/quotearg.h, lib/realloc.c, lib/safe-read.c,
lib/safe-read.h, lib/save-cwd.c, lib/save-cwd.h, lib/savedir.c,
lib/savedir.h, lib/strcasecmp.c, lib/utime.c, lib/xalloc.h,
lib/xgetcwd.c, lib/xmalloc.c, lib/xstrdup.c, lib/xstrtol.c,
lib/xstrtol.h, lib/xstrtoumax.c, m4/codeset.m4, m4/d-ino.m4,
m4/error.m4, m4/fnmatch.m4, m4/getcwd.m4, m4/getline.m4, m4/gettext.m4,
m4/glibc21.m4, m4/iconv.m4, m4/inttypes.m4, m4/lcmessage.m4,
m4/longlong.m4, m4/malloc.m4, m4/mbrtowc.m4, m4/mbstate_t.m4,
m4/progtest.m4, m4/realloc.m4, m4/strerror_r.m4, m4/ulonglong.m4,
m4/utimbuf.m4, m4/utime.m4, m4/utimes.m4, m4/xstrtoumax.m4,
po/Makefile.in.in:
Upgrade to latest version from external source. The file "bootstrap"
now grabs these automatically, so we needn't keep track of them
in this change long any longer.
* Makefile.am (AUTOMAKE_OPTIONS): Remove. Now done by configure.ac.
(SUBDIRS): Remove intl.
* PORTS: Update for star, Macintosh.
* README, README-alpha: Suggest Autoconf 2.57, Automake 1.7.5,
Bison 1.875, gettext 0.12.1.
* THANKS: Add Bernhard Rosenkraenzer, Solar Designer.
* configure.ac (AC_INIT, AM_INIT_AUTOMAKE): Convert to modern form.
(AC_CONFIG_AUX_DIR): New.
(AC_CONFIG_HEADERS): Rename config.h.in to config.hin, to be more
like coreutils.
(AC_PREREQ): Bump from 2.52 to 2.57.
(AC_GNU_SOURCE): New.
(AC_PROG_GCC_TRADITIONAL, AM_C_PROTOTYPES, AC_C_CONST): Remove;
we no longer support K&R C.
(YACC): Remove.
(AC_CHECK_HEADERS): Remove limits.h, poll.h, stdbool.h, stropts.h,
sys/ioccom.h, sys/param.h, sys/time.h, sys/timeb.h, wchar.h, wctype.h.
(AC_MBSTATE_T): Remove.
(HAVE_UTIME_H, HAVE_DECL_FREE, HAVE_DECL_GETGRGID, HAVE_DECL_GETPWUID,
HAVE_DECL_GETENV, HAVE_DECL_MALLOC, HAVE_DECL_STRTOUL,
HAVE_DECL_STRTOULL, HAVE_MKNOD): Remove our special code.
(AM_STDBOOL_H): Add.
(AC_HEADER_TIME, AC_STRUCT_TIMEZONE,
jm_CHECK_TYPE_STRUCT_DIRENT_D_INO): Remove.
(AC_CHECK_TYPE): Remove ssize_t.
(gt_TYPE_SSIZE_T): Add.
(jm_AC_PREREQ_XSTRTOUMAX, jm_PREREQ_ADDEXT, jm_PREREQ_ERROR,
jm_PREREQ_HUMAN, jm_PREREQ_QUOTEARG, jm_PREREQ_XGETCWD,
AC_FUNC_ALLOCA, AC_FUNC_CLOSEDIR_VOID, AC_FUNC_STRERROR_R,
AC_FUNC_FNMATCH, AC_FUNC_VPRINTF, AM_FUNC_GETLINE, jm_FUNC_MALLOC,
jm_FUNC_MKTIME, jm_FUNC_REALLOC):
Remove. Switch to gnulib macros like gl_BACKUPFILE instead.
(tar_LDADD): Rename to LIB_CLOCK_GETTIME. All uses changed.
(rmt_LDADD): Rename to LIB_SETSOCKOPT. All uses changed.
(AC_CHECK_FUNCS): Remove fchdir, ftime, getcwd, isascii, nap,
napms, poll, select, strstr, usleep.
(AC_REPLACE_FUNCS): Remove ftruncate, lchown, memset, rename,
rmdir, strcasecmp, strncasecmp, strtol, strtoul.
(AM_GNU_GETTEXT): Use external and need-ngettext options.
(AM_GNU_GETTEXT_VERSION): New.
(AC_OUTPUT): Remove intl/Makefile.
* doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
($(srcdir)/tar.info, tar.dvi): Remove obsolete warnings.
* doc/fdl.texi: Update to current GNU version.
* doc/gettext.texi: Update to current coreutils version,
plus a copyright notice.
* doc/tar.texi: Switch to new method for doing copyright notices.
Use @acronym instead of @sc where appropriate.
Remove empty examples. Give a few more examples.
* lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
(EXTRA_DIST, libtar_a_SOURCES): Switch to gnulib, so that they
are built up in pieces with +=.
(noinst_HEADERS, INCLUDES): Remove.
(BUILT_SOURCES, MAINTAINERCLEANFILES, MOSTLYCLEANFILES): New.
(libtar_a_LIBADD): Use $ rather than @.
(all-local, alloca.h, fnmatch.h, stdbool.h): New rules, from gnulib.
* m4/Makefile.am (EXTRA_DIST): Add alloca.m4, backupfile.m4,
bison.m4, chown.m4, dirname.m4, dos.m4, exclude.m4, fileblocks.m4,
ftruncate.m4, getdate.m4, getopt.m4, hash.m4, human.m4,
intdiv0.m4, intmax_t.m4, inttypes_h.m4, inttypes-pri.m4,
isc-posix.m4, lcown.m4, lib-ld.m4, lib-link.m4, lib-prefix.m4,
memset.m4, mktime.m4, modechange.m4, nls.m4, onceonly.m4,
pathmax.m4, po.m4, quotearg.m4, quote.m4, rmdir.m4, safe-read.m4,
safe-write.m4, save-cwd.m4, savedir.m4, ssize_t.m4, stdbool.m4,
stdint_h.m4, strcase.m4, strtoimax.m4, strtoll.m4, strtol.m4,
strtoull.m4, strtoul.m4, strtoumax.m4, tm_gmtoff.m4, uintmax_t.m4,
unlocked-io.m4, xalloc.m4, xgetcwd.m4, xstrtol.m4.
Remove c-bs-a.m4, ccstdc.m4, check-decl.m4, decl.m4, jm-mktime.m4,
prereq.m4, xstrtoimax.m4.
* po/POTFILES.in: Remove tests/genfile.c; it doesn't need to
be translated, since it's not a user-visible tool.
* scripts/Makefile.am (AUTOMAKE_OPTIONS): Remove.
* src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
(INCLUDES): Remove ../intl. Put top-srcdir before ., for
consistency with coreutils.
(LDADD): Link LIBINTL after libtar.a, since
it's now external and should stand by itself.
* src/buffer.c (print_total_written): Adjust to new human.h
interface.
(child_open_for_compress): Do not increase size to BLOCKSIZE.
(open_archive): Open index file name.
Strip trailing slahes from file names.
(flush_write): Set size to 0 if not saving names.
(flush_write, flush_read): Use safer_name_suffix rather than
inline code.
* src/common.h: Include <quote.h>.
(absolute_names_option, atime_preserve_option, backup_option,
block_number_option, checkpoint_option, dereference_option,
force_local_option, ignore_failed_read_option, ignore_zeros_option,
incremental_option, interactive_option, multi_volume_option,
numeric_owner_option, one_file_system_option, recursive_unlink_option,
read_full_records_option, remove_files_option, same_order_option,
show_omitted_dirs_option, sparse_option, starting_file_option,
to_stdout_option, totals_option, touch_option, verify_option,
dev_null_output, now_verifying, we_are_root): Now bool, not int.
(current_trailing_slash, index_file_name, recent_long_name_blocks,
recent_long_link_blocks): New vars.
(NO_OVERWRITE_DIR_OLD_FILES): New constant.
(OVERWRITE_OLD_DIRS): Remove.
(enum remove_option): New enum.
(remove_any_file): Use it as option arg, not int.
(is_avoided_name, contains_dot_dot): Return bool, not int.
(safer_name_suffix): New decl.
* src/compare.c (now_verifying): Now bool, not int.
(fill_in_sparse_array): Move to extract.c. Now returns bool;
all callers changed to test for failure.
(diff_sparse_files): Take size from current_stat, not from param.
(diff_archive): Do not count trailing slashes in archives.
(verify_volume): Test for header failure after loop, not before.
* src/create.c (relativize): Remove; replaced by safer_name_suffix.
All callers changed.
(start_header): Clear devmajor and devminor fields, too.
(finish_header): New arg block_ordinal.
(init_sparsearray): Now extern. Set sp_array_size to
SPARSES_IN_OLDGNU_HEADER if it is zero.
(dump_file): Keep link table as a hash.
Do not count "file changed as we read it" as a failure.
* src/delete.c (recent_long_name_blocks, recent_long_link_blocks):
Move extern decl to common.h.
* src/extract.c (we_are_root): Now bool, not int.
(check_time): Warn about implausibly old time stamps.
(set_stat): Use utimbuf, not stat_info.
(prepare_to_extract): New arg DIRECTORY.
(fill_in_sparse_array): Moved here from compare.c.
(extract_sparse_file): Now returns off_t, giving size left.
Truncate file at end.
(extract_archive): Use safer_name_suffix rather than rolling our own.
Use fill_in_sparse_array rather than rolling our own.
Strip trailing slashes more effectively.
Check for unsafe names.
* src/incremen.c (struct directory): nfs and found are now of type
bool, not int.
(gnu_restore): Now takes directory name as argument, not offset
of directory name in a global. All uses changed.
(CURRENT_FILE_NAME): Remove.
New tests.
* tests/delete04.sh, tests/multiv01.sh, tests/options.sh: New
files.
2002-09-30 Paul Eggert <eggert@twinsun.com>
* src/rmt.c (prepare_input_buffer): Renamed form
prepare_record_buffer. All uses changed. Do not assume that
size_t is the same width as int.
2002-03-29 Paul Eggert <eggert@twinsun.com>
* src/incremen.c (get_directory_contents):
If ignore_failed_read_option, only warn about
get_directory_contents failures. Fix suggested by
Mark Costlow.
2002-01-31 Mark W. Eichin <eichin@thok.org>
* src/buffer.c (child_open_for_compress): Don't try to read
past the end of the buffer.
2001-10-11 Jim Meyering <meyering@lucent.com>
* argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
and quote_n (1, ... to avoid clobbering a buffer.
2001-09-26 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 1.13.25.
* src/buffer.c (flush_read): Don't diagnose partial blocks before
end of file; just ignore them silently.
* src/list.c (read_header): Don't keep around extended name
and link info indefinitely; keep it only for the next file.
This fixes a bug introduced in 1.13.24, and removes the need
for some static variables. Set recent_long_name and
recent_long_link to zero if there were no long links; this
avoids a violation of ANSI C rules for pointers in delete.c.
* THANKS: Add Christian Laubscher.
2001-09-26 Jim Meyering <meyering@lucent.com>
* doc/tar.texi (Remote Tape Server): is know -> is known
2001-09-25 Paul Eggert <eggert@twinsun.com>
* lib/unicodeio.c (EILSEQ): Include <iconv.h> first, since
<iconv.h> may define EILSEQ (e.g. libiconv). Define a
replacement EILSEQ to be ENOENT, not EINVAL, since callers may
want to distinguish EINVAL and EILSEQ.
2001-09-24 Christophe Kalt <Christophe.Kalt@kbcfp.com>
* src/extract.c (maybe_recoverable):
Treat OVERWRITE_OLD_DIRS like DEFAULT_OLD_FILES.
2001-09-22 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 1.13.24.
* ABOUT-NLS, intl/*: Update to gettext-0.10.40, replacing LGPL
with GPL.
* INSTALL, mkinstalldirs: Update to autoconf 2.52 version.
* PORTS: Add copyright notice, 'star' reference.
* README-alpha: Add copyright notice, autoconf 2.52 patch.
* THANKS: Add Christophe Kalt.
* config.sub: Upgrade to 2001-09-14 version.
* configure.ac (ALL_LINGUAS): Add ko.
* po/ko.po: Resurrected file.
* doc/convtexi.pl: Add coding advice for Emacs.
* doc/getdate.texi: Add copyright notice.
* doc/mdate-sh: Upgrade to automake 1.5 version.
* doc/tar.texi (extracting files): Mention --to-stdout.
(Option Summary, Dealing with Old Files): New option --overwrite-dir.
(Overwrite Old Files): Likewise.
* lib/Makefile.am (noinst_HEADERS):
Remove copysym.h. Add print-copyr.h, unicodeio.h.
(libtar_a_SOURCES): Remove copysym.c, Add print-copyr.c, unicodeio.c.
* lib/copysym.c, lib/copysym.h: Remove.
* lib/print-copyr.c, lib/print-copyr.h, lib/unicodeio.c,
lib/unicodeio.h: New files.
* lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
lib/mktime.c, lib/strtoll.c: Switch from LGPL to GPL.
* lib/quotearg.c (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
(mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
* m4/Makefile.am (EXTRA_DIST): Remove isc-posix.m4.
* m4/isc-posix.m4: Remove.
* m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit.
* po/POTFILES.in: Add copyright notice.
* src/Makefile.am (LDADD): Like libtar.a before @INTLLIBS@ as
well as after.
* tests/Makefile.am (LDADD): Likewise.
* src/buffer.c (write_archive_buffer, close_archive):
If an archive is a socket, treat it like a FIFO.
(records_read, records_written): New vars.
(write_archive_to_stdout): Now bool, not int.
(open_archive, flush_write, flush_read): Keep records_read and
records_written up to date.
* src/common.h (enum old_files): New value OVERWRITE_OLD_DIRS.
(write_archive_to_stdout): Now bool, not int.
(enum read_header): New value HEADER_SUCCESS_EXTENDED.
(read_header): Now takes bool arg. Existing callers modified
to pass 0, unless otherwise specified.
* src/delete.c (records_read): Remove; now a global.
(acting_as_filter): Now bool, not int.
(recent_long_name, recent_long_link, recent_long_name_blocks,
recent_long_link_blocks, records_read, records_written): New decls.
(records_skipped): New var.
(move_archive): Don't divide by zero if arg is 0.
Use the above vars to compute how far to move.
(write_recent_blocks): New function.
(delete_archive_member): Pass 1 to read_header, so that it doesn't
read more than 1 block. Handle resulting HEADER_SUCCESS_EXTENDED code.
Keep track of how many records have been skipped.
Let the buffer code count records.
When copying a header, copy any extended headers that came before it.
* src/extract.c (extract_archive): When marking a directory to be
updated after symlinks, stat all directories after it in the
delayed-set-stat list too, since they will be checked after
symlinks. Add support for --overwrite-dir.
* src/list.c (recent_long_name, recent_long_link,
recent_long_name_blocks, recent_long_link_blocks): New vars.
(read_and): Pass 0 to read_header.
(read_header): New arg RAW_EXTENDED_HEADERS. Store away extended
headers into new vars. Null-terminate incoming symbolic links.
* src/rmt.c: Include print-copyr.h, not copysym.h.
(main): Use print_copyright, not copyright_symbol.
* src/tar.c (decode_options): Likewise.
(OVERWRITE_DIR_OPTION): New constant.
(long_options, usage, decode_options): Add --overwrite-dir.
* src/tar.h: Put copyright notice into documentation.
* tests/Makefile.am (TESTS): Add delete03.sh.
* tests/delete03.sh: New file.
* tests/genfile.c: Include print-copyr.h, not copysym.h.
(main): Use print_copyright, not copyright_symbol.
Include <argmatch.h>.
(pattern_strings): Remove.
(pattern_args, pattern_types): New constants.
(main): Use XARGMATCH, not argmatch.
2001-09-20 Jim Meyering <meyering@lucent.com>
* lib/xstrtol.c (strtoimax): Guard declaration with
`#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
have their own, conflicting declaration of strtoimax in sys/inttypes.h.
(strtoumax): Likewise, for completeness (it wasn't necessary).
* m4/xstrtoimax.m4 (jm_AC_PREREQ_XSTRTOIMAX):
Check for declaration of strtoimax.
* m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX):
Check for declaration of strtoumax.
2001-09-16 Paul Eggert <eggert@twinsun.com>
* fnmatch.m4 (jm_FUNC_FNMATCH): Fix typo in previous patch: yes -> no.
2001-09-14 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.23.
* README-alpha: Describe automake patch.
* configure.ac (LIBOBJS):
Remove automake 1.4 workaround, as we're using 1.5 now.
(USE_INCLUDED_LIBINTL): New AC_DEFINE.
* lib/copysym.c: Include stddef.h, for size_t.
Include langinfo.h if needed.
Use locale_charset only if USE_INCLUDED_LIBINTL;
if not, use nl_langinfo (CODESET) if available.
2001-09-13 Paul Eggert <eggert@twinsun.com>
* config.guess, config.sub: Sync with canonical versions.
* configure.ac (jm_PREREQ_XGETCWD): Add.
* lib/Makefile.am (noinst_HEADERS): Add copysym.h.
(libtar_a_SOURCES): Add copysym.c.
* copysym.c, copysym.h: New files.
* lib/error.c: Sync with fileutils version.
* m4/Makefile.am (EXTRA_DIST): Add getcwd.m4; remove uintmax_t.m4.
* m4/getcwd.m4: New file.
* m4/uintmax_t.m4: Remove.
* m4/gettext.m4 (AM_WITH_NLS):
Fix bug with calculating version of Bison 1.29.
Reported by Karl Berry.
* src/Makefile.am (datadir): Remove.
* src/rmt.c: Include copysym.h.
(main): Use copyright_symbol to translate copyright notice,
instead of gettext.
* src/tar.c: Likewise.
* tests/genfile.c: Likewise.
* src/system.h (MB_LEN_MAX): New symbol.
2001-09-11 Paul Eggert <eggert@twinsun.com>
* src/extract.c (struct delayed_set_stat): New member
'after_symlinks'.
(delay_set_stat): Initialize it to 0.
(set_mode): New arg current_stat_info. Use it (if nonnull) to avoid
taking an extra stat ourselves. All callers changed.
(set_stat): Likewise.
(apply_nonancestor_delayed_set_stat): New arg 'after_symlinks'.
If false, stop when encountering a struct whose 'after_symlinks'
member is true. Otherwise, go through all structures but check
them more carefully. All callers changed.
(extract_archive): When extracting a deferred symlink, if its parent
directory's status needs fixing, then mark the directory as needing
to be fixed after symlinks.
(extract_finish): Fix status of ordinary directories, then apply
delayed symlinks, then fix the status of directories that are
ancestors of delayed symlinks.
* src/rtapelib.c (rexec):
Remove declaration; it ran afoul of prototypes on Crays.
Reported by Wendy Palm of Cray.
2001-09-06 Paul Eggert <eggert@twinsun.com>
* lib/strtoimax.c (HAVE_LONG_LONG):
Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
(strtoimax): Use sizeof (long), not
sizeof strtol (ptr, endptr, base),
to work around bug in IBM C compiler.
2001-09-04 Paul Eggert <eggert@twinsun.com>
* lib/xgetcwd.c: Include "xalloc.h".
(xgetcwd): Do not return NULL when memory is exhausted; instead,
report an error and exit.
* m4/prereq.m4 (jm_PREREQ_XREADLINK): New macro.
(jm_PREREQ): Use it.
2001-09-03 Paul Eggert <eggert@twinsun.com>
* m4/prereq.m4 (jm_PREREQ): Add jm_PREREQ_XGETCWD.
(jm_PREREQ_XGETCWD): New macro.
* lib/exclude.c (fnmatch_no_wildcards):
Fix typo that caused us to do case-folding
search even when that was not desired. This occurred only in the
no-wildcard case.
* lib/xgetcwd.c: Include pathmax.h if not HAVE_GETCWD.
Do not include xalloc.h.
(INITIAL_BUFFER_SIZE): New symbol.
Do not use xmalloc / xrealloc, since the caller is responsible for
handling errors. Preserve errno around `free' during failure.
Do not overrun buffer when using getwd.
* lib/xgetcwd.c (xgetcwd):
Use HAVE_GETCWD_NULL, not defined __GLIBC__ && __GLIBC__ >= 2,
to decide whether to use getcwd (NULL, 0).
2001-09-02 Paul Eggert <eggert@twinsun.com>
* lib/xgetcwd.c: Fix typo in local var; from Jim Meyering.
2001-09-01 Jim Meyering <meyering@lucent.com>
* exclude.c: Use `""', not `<>' to #include non-system header files.
(fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
and strncasecmp as r-values. Unixware didn't have declarations.
2001-08-31 Jim Meyering <meyering@lucent.com>
* lib/xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
Use an initial, malloc'd, buffer of length 128 rather than
a statically allocated one of length 1024.
2001-08-30 Paul Eggert <eggert@twinsun.com>
* lib/utime.c: Include full-write.h.
* lib/xstrtol.c (strtoimax): New decl.
2001-08-29 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.22.
* src/create.c (dump_file): Relativize link names before dumping.
This fixes a bug reported by Jose Pedro Oliveira.
* src/create.c (dump_file): Use offsetof when computing sizes for
struct hack; this avoids wasted space in some cases.
* src/incremen.c (note_directory, find_directory): Likewise.
* src/names.c (name_gather, addname): Likewise.
* src/extract.c (extract_archive): Use strcpy, not memcpy,
for consistency with other code that does similar things.
* src/names.c (name_gather): Likewise.
* src/names.c (read_name_from_file, name_next, name_gather,
add_hierarchy_to_namelist): Avoid quadratic behavior when
reallocating buffers. Check for buffer size overflow.
(addname): Avoid unnecessary clearing of memory.
2001-08-29 "Jan D." <Jan.Djarv@mbox200.swipnet.se>
* src/extract.c (delay_set_stat): Fix off-by-one error in file
name size allocation that caused core dumps.
2001-08-28 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.21.
* configure.ac (GNU_SOURCE): Define to 1, not /**/.
(major_t, minor_t, ssize_t): Use new-style AC_CHECK_TYPE.
(daddr_t): Remove; no longer used.
(jm_PREREQ_HUMAN): Add.
* acconfig.h: Remove; no longer needed.
* config.guess, config.sub:
New files, from automake 1.5. Gettext 0.10.39 needs them.
* depcomp, missing, mkinstalldirs: Upgrade to automake 1.5.
* Makefile.am (AUTOMAKE_OPTIONS): Add dist-bzip2.
(SUBDIRS): Put intl before lib, as gettext requires.
* ABOUT-NLS: Upgrade to gettext 0.10.39.
* intl: Upgrade entire directory to gettext 0.10.39.
* m4/codeset.m4, m4/glibc21.m4, m4/iconv.m4:
New files, from gettext 0.10.39.
* m4/gettext.m4, m4/isc-posix.m4, m4/lcmessage.m4, m4/progtest.m4,
Upgrade to gettext 0.10.39,
* po/Makefile.in.in: Likewise, except fix a typo in its copying
permissions.
* po/cat-id-tbl.c, po/stamp-cat-id:
Remove; no longer used by gettext 0.10.39.
* po/ChangeLog: New file.
* doc/Makefile.am (EXTRA_DIST): Add freemanuals.texi.
$(srcdir)/tar.texi: Likewise.
* doc/freemanuals.texi: New file.
* doc/tar.texi (Free Software Needs Free Documentation): New appendix.
`fileds' -> `fields'
* doc/texinfo.tex: Upgrade to version 2001-07-25.07.
* lib/Makefile.am (EXTRA_DIST): Add strtoll.c, strtoimax.c.
(noinst_HEADERS): Add quote.h.
(libtar_a_SOURCES): Add quote.c, xstrtoimax.c.
* lib/exclude.c: Fix typo in '#include <stdint.h>' directive.
* lib/full-write.c, lib/savedir.c: Comment fix.
* lib/pathmax.h: Remove.
* lib/quote.c, lib/quote.h: New files.
* lib/xgetcwd.c: Don't include pathmax.h.
Include stdlib.h and unistd.h if available.
Include xalloc.h.
(xmalloc, xstrdup, free): Remove decls.
(xgetcwd): Don't assume sizes fit in unsigned.
Check for overflow when computing sizes.
Simplify reallocation code.
* lib/xmalloc.c: Quote failure tests.
* lib/strtoumax.c, lib/xstrtoimax.c: New files.
* lib/strtoimax.c: Renamed from strtouxmax.c. Make it more
similar to strtol.c.
(UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.
(verify): New macro.
(strtoumax, uintmax_t, strtoull, strtol): Remove.
(intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
(strtoimax): Renamed from strtoumax. All uses of unsigned values
changed to signed values. Check sizes at compile-time, not
run-time. Prefer strtol to strtoll if both work.
(main): Remove.
* lib/xstrtol.h (xstrtoimax): New decl.
* m4/Makefile.am (EXTRA_DIST):
Add codeset.m4, glibc21.m4, iconv.m4, inttypes.m4,
longlong.m4, xstrtoimax.m4.
* m4/inttypes.m4 (jm_AC_HEADER_INTTYPES_H):
Remove; now done by autoconf.
(jm_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T): Replace with
Use AC_CHECK_TYPE instead of merely looking for the header.
* m4/uintmax_t.m4: Use shorter comment.
* m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX):
Quote first arg of AC_DEFUN.
Require jm_AC_TYPE_INTMAX_T and jm_AC_TYPE_LONG_LONG since they
is needed to parse the include file.
Simplify logic behind the args to AC_REPLACE.
* src/Makefile.am (OMIT_DEPENDENCIES): Remove.
* src/ansi2knr.1, src/ansi2knr.c: Remove; wasn't being used.
* src/rmt.c (main):
Use "Copyright %d" to simplify the translator's job in the future.
Advise translator about circle-C.
* src/tar.c: (decode_options): Likewise.
* tests/genfile.c (main): Likewise.
2001-08-28 Jim Meyering <meyering@lucent.com>
* lib/argmatch.c: Include "quote.h".
(argmatch_invalid): Quote the context.
* lib/dirname.c (dir_name): Fix typo on PC platforms.
* lib/backupfile.c, lib/basename.c, lib/dirname.c, lib/strtoul.c:
Use single-quote for local .h files.
* lib/error.h (__attribute__): Don't depend on __STRICT_ANSI__.
* lib/getopt.c, lib/getopt.h, lib/getopt1.c: Upgrade to recent
glibc versions.
* lib/getdate.y (get_date): Initialize tm_isdst to -1 before
invoking mktime the last time.
* lib/pathmax.h: Use #if rather than #ifdef for HAVE_UNISTD_H.
* lib/rename.c: Major rewrite by Volker Borchert to use system
rename function, but to work around problems with trailing
slashes.
* lib/strtoll.c: New file, from glibc.
* lib/strtoul.c: Update from glibc.
* lib/strtouxmax.c: Renamed from lib/strtoumax.c.
Add support for signed numbers, too.
(strtoul, strtoull): Do not declare if STRTOUXMAX_UNSIGNED
is not defined.
(strtol, strtoll): Declare as needed, if STRTOUXMAX_UNSIGNED is
not defined.
(strtoumax, uintmax_t, strtoull, strtoul): New macros.
(main): Use generic names in debugging output.
* lib/strtoimax.c: Plus add the following changes of my own:
(main): Use accurate names in debugging output.
* lib/xgetcwd.c (xgetcwd): Use getcwd if glibc 2 or later.
Don't use PATH_MAX.
* m4/c-bs-a.m4, m4/check-decl.m4, m4/d-ino.m4, m4/error.m4,
m4/getline.m4, m4/jm-mktime.m4, m4/malloc.m4, m4/mbrtowc.m4,
m4/mbstate_t.m4, m4/realloc.m4, m4/uintmax_t.m4, m4/utimbuf.m4,
m4/utime.m4, m4/utimes.m4:
Quote the first argument in each use of AC_DEFUN.
* m4/getline.m4: Don't use string.h.
* m4/inttypes.m4, m4/longlong.m4, m4/xstrtoimax.m4: New files.
* m4/mbrtowc.m4 (jm_FUNC_MBRTOWC): @%:@ -> #.
2001-08-27 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.20.
The biggest change is the new --exclude semantics and options.
The basic idea was suggested by Gerhard Poul; thanks!
* NEWS: Describe new --exclude semantics and options, and bug fixes.
* README: ignfail.sh fails on some NFS hosts.
* NEWS, README, lib/xstrtol.h: Add copyright notice.
* Makefile.am (ACLOCAL_AMFLAGS): Add -I m4.
(M4DIR, ACINCLUDE_INPUTS, $(srcdir)/acinclude.m4):
Remove; the automake bug has been fixed.
* acinclude.m4: Remove.
* configure.ac: Renamed from configure.in.
(AC_PREREQ): Bump from 2.13 to 2.52.
(ALL_LINGUAS): Add id, tr. Remove ko, as po/ko.po (dated
1997-05-30) has an encoding error.
(jm_AC_HEADER_INTTYPES_H): Remove; now done by autoconf.
(AC_FUNC_FNMATCH): Use AC_CONFIG_LINKS, not AC_LINK_FILES.
* doc/fdl.texi: Update to current GNU version.
* doc/tar.texi: Put leading '*' in direntry.
Accommodate new gfdl sectioning.
New option --recursion (the default) that is the inverse of
--no-recursion.
New options --anchored, --ignore-case, --wildcards,
--wildcards-match-slash, and their negations (e.g., --no-anchored).
Along with --recursion and --no-recursion, these control how exclude
patterns are interpreted. The default interpretation of exclude
patterns is now --no-anchored --no-ignore-case --recursion
--wildcards --wildcards-match-slash.
* lib/Makefile.am (OMIT_DEPENDENCIES): Remove.
* lib/exclude.c (bool): Declare, perhaps by including stdbool.h.
(<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
(<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
Include if available.
(<xalloc.h>): Include
(SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
(verify): New macro. Use it to verify that EXCLUDE macros do not
collide with FNM macros.
(struct patopts): New struct.
(struct exclude): Use it, as exclude patterns now come with options.
(new_exclude): Support above changes.
(new_exclude, add_exclude_file):
Initial size must now be a power of two to simplify overflow checking.
(free_exclude, fnmatch_no_wildcards): New function.
(excluded_filename): No longer requires options arg, as the options
are determined by add_exclude. Now returns bool, not int.
(excluded_filename, add_exclude):
Add support for the fancy new exclusion options.
(add_exclude, add_exclude_file): Now takes int options arg.
Check for arithmetic overflow when computing sizes.
(add_exclude_file): xrealloc might modify errno, so don't
realloc until after errno might be used.
* lib/exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
New macros.
(free_exclude): New decl.
(add_exclude, add_exclude_file): Now takes int options arg.
(excluded_filename): No longer requires options arg, as the options
are determined by add_exclude. Now returns bool, not int.
* lib/prepargs.c: Include <string.h>; required for C99 since
we use strlen.
* lib/quotearg.c:
BSD/OS 4.1 wchar.h requires FILE and struct tm to be declared.
* lib/xstrtol.h (_DECLARE_XSTRTOL): Improve quality of
diagnostic for LONGINT_INVALID_SUFFIX_CHAR.
* m4/Makefile.am (EXTRA_DIST): Add check-decl.m4, mbrtowc.m4.
Remove inttypes_h.m4, largefile.m4, mktime.m4.
* m4/inttypes_h.m4, m4/largefile.m4, m4/mktime.m4: Remove;
subsumed by Autoconf 2.50.
* m4/error.m4: Upgrade to serial 2.
* m4/fnmatch.m4 (jm_FUNC_FNMATCH): Upgrade to serial 4, but
remove test for GNU C library. It's not correct, as some
older glibcs are buggy.
* m4/getline.m4, m4/malloc.m4: Upgrade to serial 4.
* m4/prereq.m4: Upgrade to serial 20, but then:
(jm_PREREQ): Add jm_PREREQ_EXCLUDE.
(jm_PREREQ_EXCLUDE): New macro.
(jm_PREREQ_HUMAN): Remove jm_AC_HEADER_INTTYPES_H, as it is subsumed
by autoconf 2.5x.
* m4/realloc.m4: Upgrade to serial 4.
* m4/strerror_r.m4: Revert to serial 1002.
* m4/uintmax_t.m4: Upgrade to autoconf 2.5x.
* m4/utimes.m4: Upgrade to latest version (still "serial 3").
* m4/xstrtoumax.m4: Upgrade to serial 3, but then:
(jm_AC_PREREQ_XSTRTOUMAX): Remove jm_AC_HEADER_INTTYPES_H, as
it is now subsumed by autoconf. Add inttypes.h.
* po/cs.po, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
po/it.po, po/pl.po, po/sl.po, po/sv.po: Sync with translation project.
* src/buffer.c (new_volume): Stop if the script exits with an error.
* src/common.h (excluded_with_slash, excluded_without_slash):
Remove, replacing by:
(excluded): New decl.
(link_error): New decl.
(excluded_name): Now returns bool.
* src/extract.c:
(struct delayed_symlinks, extract_archive, apply_delayed_symlinks):
Support hard links to symbolic links.
(struct delayed_symlink): Remove 'names' member, replacing it with
'sources' and 'target' member. All uses changed.
(struct string_list): New type.
(delayed_set_stat, extract_archive): Use offsetof when computing sizes
for struct hack; this avoids wasted space in some cases.
(extract_archive): Fix test for absolute pathnames and/or "..".
Use link_error to report errors for links.
Remove redundant trailing '/' at "really_dir", for all uses, not
just before invoking mkdir.
If overwriting old files, do not worry so much about existing
directories.
Fix mode computation in the case where the directory exists.
(apply_delayed_symlinks): If we can't make a hard link to a symbolic
link, make a copy of the symbolic link.
* src/incremen.c (get_directory_contents):
If ignore_failed_read_option, only warn about
stat failures.
* src/list.c (from_header): Do not issue a diagnostic if TYPE is zero.
However, check for error even for '-' or '+' case.
(print_header): Try parsing uids and gids as unsigned integers first,
and as a uid_t or gid_t only if that fails. This adds support for
listing positive uids and gids that are greater than UID_MAX and
GID_MAX.
* src/misc.c (link_error): New function.
* src/names.c (collect_and_sort_names):
If ignore_failed_read_option, only warn about
stat errors.
(excluded_name): Now returns bool. Simplify, as the fancy
features are now all in excluded_filename.
* src/rtapelib.c (base_name): Remove decl, as system.h now
declares it.
* src/system.h: Include stddef.h if available.
(offsetof): Declare if stddef.h doesn't.
Include <dirname.h>.
(FILESYSTEM_PREFIX_LEN, ISSLASH): Remove; now defined by dirname.h.
* src/tar.c (ANCHORED_OPTION, IGNORE_CASE_OPTION,
NO_ANCHORED_OPTION, NO_IGNORE_CASE_OPTION, NO_WILDCARDS_OPTION,
NO_WILDCARDS_MATCH_SLASH_OPTION, WILDCARDS_OPTION,
WILDCARDS_MATCH_SLASH_OPTION):
New enum values.
(long_options, usage, decode_options): Add support for --anchored,
--ignore-case, --no-anchored, --no-ignore-case, --no-wildcards,
--no-wildcards-match-slash, --recursion, --wildcards,
--wildcards-match-slash.
(decode_options): Implement the new way of interpreting exclude
patterns.
(usage): --newer-mtime takes a DATE operand. DATE may be a file name.
(OPTION_STRING, decode_options): Add -I, -y. Currently these options
just print error messages suggesting alternatives.
(add_filtered_exclude): Remove.
* tests/Makefile.am (TESTS): Alphabetize, except put version.sh first.
* tests/extrac04.sh (out): Remove
directory/subdirectory/file1, as the new semantics for
--exclude exclude it.
* tests/genfile.c (main): Don't use non-ASCII char in msgid.
2001-08-12 Paul Eggert <eggert@twinsun.com>
* lib/addext.c (<errno.h>): Include.
(errno): Declare if not defined.
(addext): Work correctly on the Hurd, where pathconf returns -1 and
leaves errno alone, because there is no limit. Also, work even if
size_t is narrower than long.
2001-07-08 Paul Eggert <eggert@twinsun.com>
* lib/alloca.c (alloca): Arg is of type size_t, not unsigned.
2001-05-10 Paul Eggert <eggert@twinsun.com>
* lib/addext.c (ISSLASH, base_name): Remove decls; now in dirname.h.
Include <backupfile.h> and <dirname.h> after size_t is defined.
(addext): Use base_len to trim redundant trailing slashes instead of
doing it ourselves.
* lib/backupfile.c (ISSLASH, base_name):
Remove decls; now in dirname.h.
Include <argmatch.h>, <backupfile.h>, <dirname.h> after size_t
is defined.
(find_backup_file_name): Rename locals to avoid new functions.
Use base_len instead of rolling it ourselves.
Work even if dirlen is 0.
Use a dir of '.' if given the empty string.
* lib/basename.c:
Do not include <stdio.h>, <assert.h>; no longer needed.
(FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Remove; now in dirname.h.
Include <string.h>, <dirname.h>.
(base_name): Allow file names ending in slashes, other than names
that are all slashes. In this case, return the basename followed
by the slashes.
* lib/dirname.c: Include <string.h> instead of <stdlib.h>.
(FILESYSTEM_PREFIX_LEN, ISSLASH): Remove; now in dirname.h.
(dir_len): Renamed from dirlen.
All callers changed.
* lib/dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
New macros.
(base_name, base_len, dir_len, strip_trailing_slashes): New decls.
2001-02-16 Paul Eggert <eggert@twinsun.com>
* lib/quotearg.c (mbrtowc, mbrtowc, mbsinit):
Do not declare or define if HAVE_MBRTOWC,
since the test for HAVE_MBRTOWC now requires proper declarations.
* lib/alloca.c (malloc): Undef before defining.
2001-02-13 Paul Eggert <eggert@twinsun.com>
* src/compare.c (read_and_process): Use off_t for size.
From Maciej W. Rozycki.
2001-01-26 Paul Eggert <eggert@twinsun.com>
* lib/quotearg.c: Include stddef.h. From Jim Meyering.
2001-01-12 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.19.
* lib/savedir.h (savedir): Remove size arg.
* doc/tar.texi: Add @setchapternewpage odd.
Remove -I as an alias for -T, for now.
Add @dircategory.
Update copyright. Remove "Published by".
Dates beginning with / or . are taken to be file names.
* src/tar.c (<time.h>): Do not include;
(time): Do not declare.
(usage): Remove -I as an alias for -T.
(OPTION_STRING): Remove -I.
(decode_options): Dates that look like an absolute path name,
or that start with '.', are presumed to be file names whose
dates are taken.
Remove 'I' as an aliase for 'T'.
Update copyright.
* src/extract.c (<time.h>): Do not include; system.h now does this.
(make_directories): Skip filesystem prefixes.
Don't assume '/' is the only separator.
(extract_sparse_file): Use new full_write semantics.
On write error, return instead of invoking skip_file.
Do not free sparsearray; caller does this now.
(apply_nonancestor_delayed_set_stat): Do not assume '/' is the only
separator.
(extract_archive): Don't assume file name lengths fit in int.
Report what got stripped from member name; it might be more than '/'.
Use new full_write semantics.
Do not pass redundant trailing "/" to mkdir, as POSIX does not allow
mkdir to ignore it.
Do not report mkdir error if old_files_option == KEEP_OLD_FILES.
* src/buffer.c (<time.h>): Do not include; system.h now does this.
(time): Remove decl; likewise.
(child_open_for_uncompress): Use new full_write semantics.
(flush_write): Use ISSLASH instead of testing for '/'.
(flush_read): Likewise.
* src/rmt.h (_remdev): Look for / anywhere in Path.
* src/misc.c (contains_dot_dot): Skip filesystem prefix.
Don't assume '/' is the only separator.
(safer_rmdir): Don't assume '/' is the only separator.
* src/compare.c (diff_archive): Don't assume '/' is the only separator.
* lib/dirname.h (dirlen): New decl.
* src/incremen.c (get_directory_contents):
Remove path_size arg; all callers changed.
Don't assume '/' is the only directory separator.
(gnu_restore): Work even if file name length doesn't fit in int.
* lib/addext.c (ISSLASH): New macro.
(addext): Trim any redundant trailing slashes.
* src/names.c (name_next):
Don't assume '/' is the only directory separator.
(namelist_match): Likewise.
(add_hierarchy_to_namelist): Remove dirsize arg.
Do not assume '/' is the only directory separator.
(new_name): Likewise.
* lib/Makefile.am (noinst_HEADERS): Add dirname.h, full-write.h.
(libtar_a_SOURCES): Add dirname.c.
* src/create.c (relativize):
New function, with much of old start_header's guts.
Handle filesystem prefixes.
(start_header): Use this new function.
(init_sparsearray): Don't bother to zero out the new array;
it's not needed.
(deal_with_sparse): Fix array allocation bug.
(create_archive): Don't assume '/' is the only separator.
(dump_file): Likewise.
Don't worry about leading / in symlink targets.
* lib/savedir.c (savedir):
Remove size arg; it wasn't portable. All callers changed.
* lib/utime.c (utime_null): Adjust to new full_write convention.
* configure.in (YACC): Avoid portability problem with Ultrix sh.
* lib/backupfile.c: Include <dirname.h>.
(ISSLASH): New macro.
(find_backup_file_name): Use dirlen to calculate directory lengths.
(max_backup_version): Strip redundant trailing slashes.
* src/common.h: Include <full-write.h>.
(get_directory_contents): No longer has size arg.
(gnu_restore): Arg is size_t, not int.
* src/system.h: Include <time.h>.
(time): Declare if not defined.
* lib/full-write.c: Include full-write.h, not safe-read.h.
full_write returns size_t, with short writes meaning failure.
All callers changed.
* src/rtapelib.c: Include full-write.h.
* src/rmt.c: Include full-write.h.
(main): Update copyright.
* doc/getdate.texi: Mention that only English is supported.
Show how to use "date" so that the output is acceptable to getdate.
Mention Z as an abbreviation for UTC.
* lib/full-write.h: New file.
* src/list.c: system.h now does time.h stuff.
* lib/dirname.c:
Use HAVE_STDLIB_H, not STDC_HEADERS, to decide whether to include
stdlib.h.
Do not include string.h, strings.h, or assert.h; no longer needed.
(strrchr, memrchr, malloc): Remove decls; no longer needed.
Include <xalloc.h>.
(base_name): New decl.
(BACKSLASH_IS_PATH_SEPARATOR): Remove.
(dir_name_r): Remove.
(dirlen): New function.
(dir_name): Use dirlen instead of dir_name_r.
(<string.h>, <strings.h>): Include only if test program.
(main): Use "return 0", not "exit (0)".
2000-12-08 Paul Eggert <eggert@twinsun.com>
* lib/dirname.h: New file.
2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
* lib/fnmatch.c: Do not comment out all the code if we are using
the GNU C library, because in some cases we are replacing buggy
code in the GNU C library itself.
2000-10-30 Paul Eggert <eggert@twinsun.com>
* lib/fnmatch.c (FOLD): Do not assume that characters are unsigned.
2000-10-29 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.18.
* src/tar.c: Include <fnmatch.h>, for FNM_LEADING_DIR.
2000-10-28 Paul Eggert <eggert@twinsun.com>
* doc/tar.texi: --no-recursion now applies to extraction, too.
* src/create.c (dump_file): no_recurse_option -> ! recursion_option
* src/names.c (namelist_match, excluded_name):
Do not match subfiles of a directory
if --no-recursion is specified.
* src/tar.c (NO_RECURSE_OPTION): Remove.
(long_options): Have getopt set the --no-recursion flag.
(decode_options): Initialize recursion_option to FNM_LEADING_DIR.
Remove case for NO_RECURSE_OPTION.
* src/common.h (recursion_option):
Renamed from no_recurse_option, with sense
negated, and with FNM_LEADING_DIR being the nonzero value.
* names.c (namelist_match): New function.
(name_match, name_scan): Use it to eliminate duplicate code.
(names_notfound): Remove special case for Amiga.
2000-10-27 Paul Eggert <eggert@twinsun.com>
* src/misc.c (read_error_details, read_warn_details,
read_fatal_details): Don't assume size_t is unsigned long.
* src/buffer.c (flush_read): If read_full_records_option, try to
fill the input buffer, as --delete -f - needs this.
2000-10-24 Paul Eggert <eggert@twinsun.com>
* m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Port to autoconf 2.13.
* src/buffer.c (check_label_pattern):
Make sure header name is a string before
passing it to fnmatch.
(init_volume_number): Check for global_volno overflow.
(new_volume): Check for global_volno overflow.
* src/tar.c (decode_options):
Check that volume label is not too long to overflow
name in tar header block.
* Makefile.am (EXTRA_DIST): Remove rebox.el.
* configure.in (HAVE_DECL_STRERROR_R): Remove our handwritten code.
(AC_FUNC_STRERROR_R): Use this instead.
2000-10-23 Paul Eggert <eggert@twinsun.com>
* src/extract.c: Include <time.h>, since we invoke "time".
* lib/prepargs.c (prepend_default_options):
Don't use NULL, for portability.
* m4/fnmatch.m4: Add "working" to message.
* src/names.c: (_GNU_SOURCE): Remove; autoconf now does this.
Include <hash.h>.
(getpwuid, getgrgid): Declare only if system headers don't.
(gid_to_gname): Don't invoke setgrent.
(namelist): Now static, not global.
(nametail): New var. All uses of namelast changed to use
nametail, with one extra level of indirection.
(name_gather): Use memcpy instead of strncpy + assignment of NUL.
(name_match): Set nametail too, when setting namelist to null.
(add_hierarchy_to_namelist): Change type of dir arg from char * to
struct name *, so that we don't have to look up the name again
here. Get change_dir from dir rather than as a separate arg. Add
dirsize arg, and pass it along to get_directory_contents. Remove
unnecessary check of directory type.
(new_name): Do not append a slash if PATH already ends in one.
(avoided_names, struct avoided_name): Remove.
(avoided_name_table): New var, replacing avoided_names.
(hash_avoided_name, compare_avoided_names): New function.
(add_avoided_name, is_avoided_name): Use hash table rather than
linked list.
* src/buffer.c (_GNU_SOURCE): Remove; autoconf now does this.
(child_open_for_compress, child_open_for_uncompress,
close_archive): Propagate any failure of the compression process
back to "tar".
(open_archive, flush_write, flush_read, close_archive): Do not
allocate an array of size PATH_MAX, as PATH_MAX might be (size_t)
-1. Instead, allocate an array with the size that's needed.
(open_archive): Don't bother checking S_ISCHR of /dev/null.
(backspace_output): Don't try to backspace past start of archive.
(close_archive): Remove special case for DELETE_SUBCOMMAND.
* acconfig.h (_GNU_SOURCE, DEFAULT_ARCHIVE, DEFAULT_BLOCKING,
DENSITY_LETTER, DEVICE_PREFIX, EMUL_OPEN3, HAVE_GETGRGID,
HAVE_GETPWUID, HAVE_MKNOD, HAVE_RTAPELIB, HAVE_ST_FSTYPE_STRING,
HAVE_UNION_WAIT, HAVE_UTIME_H, HAVE_VALLOC, MTIO_CHECK_FIELD, PACKAGE,
PROTOTYPES, REMOTE_SHELL, STD_INC_PATH, VERSION, WITH_CATALOGS,
WITH_DMALLOC, WITH_REGEX):
Remove; now generated automatically.
* configure.in (_GNU_SOURCE): Define to empty, not 1, for
compatibility for glibc fragments.
(_GNU_SOURCE, HAVE_UTIME_H, MTIO_CHECK_FIELD,
HAVE_ST_FSTYPE_STRING, HAVE_MKNOD, REMOTE_SHELL, DENSITY_LETTER,
DEVICE_PREFIX, DEFAULT_ARCHIVE, DEFAULT_BLOCKING): Add comment so
that we needn't put an entry into acconfig.h.
(ALL_LINGUAS): Add da.
(AC_C_BACKSLASH_A): Remove; jm_PREREQ_QUOTEARG now does this.
(AC_CHECK_HEADERS): Add stdbool.h (for hash.h users), wctype.h
(for strtol.c).
(AC_MBSTATE_T): Add.
(RMT): Append $(EXEEXT).
(HAVE_GETGRGID, HAVE_GETPWUID, pe_AC_TYPE_SIGNED_CHAR): Remove.
(HAVE_DECL_FREE, HAVE_DECL_GETGRGID, HAVE_DECL_GETPWUID,
HAVE_DECL_GETENV, HAVE_DECL_MALLOC, HAVE_DECL_STRTOUL,
HAVE_DECL_STRTOULL, HAVE_DECL_STRERROR_R): New macros.
(jm_PREREQ_ADDEXT, jm_PREREQ_ERROR, jm_PREREQ_QUOTEARG): Add.
(AC_REPLACE_FUNCS): Remove execlp; no longer needed.
(AC_CHECK_FUNCS): Add clock_gettime; AC_SEARCH_LIBS wasn't enough.
Remove mbrtowc; jm_PREREQ_QUOTEARG now does this.
(EMUL_OPEN3): Remove; no longer needed.
(DENSITY_LETTER, DEVICE_PREFIX): Simplify m4 quoting.
* m4/fnmatch.m4 (AC_FUNC_FNMATCH): Detect d*/*1 vs d/s/1 bug.
* src/common.h: Do not include basename.h.
* src/rtapelib.c (base_name): Do not include basename.h;
declare base_name instead.
* lib/basename.h, lib/execlp.c, lib/getpagesize.h, lib/mkdir.c:
Remove these files.
* lib/getstr.c, lib/getstr.h, lib/hash.h, lib/hash.h, lib/prepargs.c,
lib/prepargs.h, lib/savedir.c, lib/savedir.h: New files.
* lib/Makefile.am (EXTRA_DIST, noinst_HEADERS, libtar_a_SOURCES):
Adjust to the above changes.
* lib/Makefile.am (AUTOMAKE_OPTIONS): Remove ../src/ansi2knr.
* src/open3.c: Remove.
* src/Makefile.am (AUTOMAKE_OPTIONS): Remove ansi2knr.
(tar_SOURCES): Remove open3.c.
(INCLUDES): Remove -I.., as automake does that.
(OMIT_DEPENDENCIES): ../lib/fnmatch.h -> fnmatch.h. Add localedir.h.
The following changes are to put LOCALEDIR into localedir.h instead
of passing it on the command line.
(DEFS): Remove.
(DISTCLEANFILES): New macro.
(localedir.h): New rule.
(rmt.o tar.o): Now depend on localedir.h.
* tests/delete02.sh, tests/extrac04.sh: New files.
* tests/Makefile.am (AUTOMAKE_OPTIONS): Remove ansi2knr.
(TESTS): Add extrac04.sh, and restore delete02.sh.
(DEFS): Remove; LOCALEDIR is now done via localedir.h.
(INCLUDES): Remove -I.. as automake does this now.
* src/rtapelib.c (rexec): Don't declare unless using it.
(do_command): Simplify signal-handling code slightly.
* src/delete.c (blocks_needed): Remove. All uses changed to use
blocking_factor - new_blocks.
(acting_as_filter): New var.
(write_record, delete_archive_members): Use acting_as_filter
rather than archive == STDIN_FILENO to detect whether we're acting
as a filter, as open can return STDIN_FILENO in some cases.
(delete_archive_members): Ignore zero blocks if
ignore_zeros_option is nonzero. Fix bug that messed up last
output block: write_eot can't be used here, as it gets confused
when the input is at end of file.
* src/compare.c (diff_archive): Do not impose an arbitrary limit on
symbolic link contents length. Pass directory size to
get_directory_contents.
* m4/decl.m4, m4/error.m4, m4/mbstate_t.m4, m4/prereq.m4,
m4/strerror_r.m4: New files.
* m4/signedchar.m4: Remove this file.
* Makefile.am (ACINCLUDE_INPUTS): Adjust to above changes.
* m4/Makefile.am (EXTRA_DIST): Likewise.
* Makefile.am (DISTCLEANFILES): Add intl/libintl.h.
* po/da.po: New translation file.
* src/mangle.c (extract_mangle):
Fix diagnostic with wrong number of %s'es.
* lib/fnmatch.c (fnmatch):
Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
* lib/full-write.c (full_write): Some buggy drivers return 0 when you
fall off a device's end. Detect this.
* src/system.h (IN_CTYPE_DOMAIN): Renamed from CTYPE_DOMAIN. All
uses changed.
(open): Remove macro; we no longer support EMUL_OPEN3. Do not
include <pathmax.h> and directory include files like <dirent.h>;
no longer used. Include <savedir.h> instead.
(closedir, signed_char): remove macro; no longer used.
(bool, false, true): Include <stdbool.h> if you have the include
file, otherwise define.
* src/misc.c:
(is_dot_or_dotdot, closedir_error, closedir_warn, opendir_error,
opendir_warn, readdir_error): Remove; no longer needed.
(safer_rmdir): Strip leading ./ (or .// or ./// or ././ or etc.)
before deciding whether we're trying to remove ".".
(remove_any_file): Try unlink first if we are not root. Use
savedir when recursively removing directories, to avoid exhausting
file descriptors.
(savedir_error, savedir_warn, symlink_error): New functions.
* src/list.c: (read_and): Do not invoke
apply_nonancestor_delayed_set_stat; DO_SOMETHING is now
responsible for that. Do not invoke apply_delayed_set_stat; our
caller is now responsible for that.
(read_header): Use signed char instead of signed_char. Prevent
later references to current_header from mistakenly treating it as
an old GNU header.
(from_header): Quote invalid base-64 strings in diagnostics.
(time_from_header): Do not warn about future timestamps in
archive; check_time now does that.
(print_header): Quote unknown file types.
(skip_member): New function, replacing skip_extended_headers and
now skipping the whole member instead of just the extended
headers. All callers changed. This makes the code handle
extended headers uniformly, and fixes some bugs.
* src/update.c (update_archive): Use skip_member.
* src/extract.c (we_are_root): Now global.
(struct delayed_symlink): New type.
(delayed_symlink_head): New var.
(extr_init, fatal_exit): Invoke extract_finish on fatal errors,
not apply_delayed_set_stat.
(set_mode, set_stat): Pointer args are now const pointers.
(check_time): New function.
(set_stat): Warn if setting a file's timestamp to be the future.
(make_directories): Do not save and restore errno.
(maybe_recoverable): Set errno to ENOENT if we cannot make missing
intermediate directories.
(extract_archive): Invoke apply_nonancestor_delayed_set_stat here,
not in caller. Extract potentially dangerous symbolic links more
carefully, deferring their creation until the end, and using a
regular file placeholder in the meantime. Do not remove trailing
/ and /. from file names. Do not bother checking for ".." when
checking whether a directory loops back on itself, as loopbacks
can occur with symlinks too. Also, in that case, do not bother
saving and restoring errno; just set it to EEXIST.
(apply_nonancestor_delayed_set_stat): A prefix is a potential
ancestor if it ends in slash too (as well as ending in a char just
before slash).
(apply_delayed_set_stat): Remove.
(apply_delayed_symlinks, extract_finish): New functions.
* doc/fdl.texi: New file.
* doc/Makefile.am (EXTRA_DIST): Add fdl.texi.
($(srcdir)/tar.info): Add fdl.texi. Invoke makeinfo with --no-split.
* doc/tar.texi: Add Free Documentation License. New section
"Overwrite Old Files", and revamp that section to make it easier to
follow. "tar" -> "GNU tar" where appropriate. Migrate getdate
documentation into getdate.texi. Fix several minor typos. Describe
TAR_OPTIONS. Describe incompatibility between incremental backups and
--atime-preserve. Describe incompatibility between --verify and other
options. Mention that tar normally removes symbolic links rather than
following them, when extracting a file of the same name.
* THANKS: Add gpoul. Change skip's address.
* po/POTFILES.in: Add lib/human.c.
* src/common.h (namelist, namelast): Remove decls.
(we_are_root, extract_finish, skip_member, savedir_error,
savedir_warn, symlink_error, gnu_list_name): New decls.
(apply_delayed_set_stat, apply_nonancestor_delayed_set_stat,
skip_extended_headers, is_dot_or_dotdot, closedir_error,
closedir_warn, opendir_error, opendir_warn, readdir_error,
readdir_warn): Remove decls.
(get_directory_contents): New off_t arg.
(addname): Now returns struct name *.
* src/tar.h, tests/genfile.c: Fix comments.
* src/create.c: Include hash.h.
(gnu_list_name): Remove decl.
(struct link): Remove "next" member.
(linklist): Remove.
(start_header): Say "leading `FOO'" rather than "`FOO' prefix" for
consistency with other diagnostics.
(deal_with_sparse): Check for I/O error when closing the file.
(create_archive): Do not allocate an array of size PATH_MAX, as
PATH_MAX might be (size_t) -1. Instead, allocate an array with
the size that's needed.
(hash_link, compare_links): New functions.
(dump_file): Do not exhaust open file descriptors when descending
deeply into a directory, by using savedir rather than
opendir/readdir. Do not zero-fill the name buffer unnecessarily.
Hash the set of links already created, instead of using a linked
list. Fix some bugs in outputting sparse files which caused the
sparse tables to be incorrect. When a file unexpectedly shrinks,
output zeros rather than garbage. Do not allocate an array of
size PATH_MAX, as PATH_MAX might be (size_t) -1. Instead,
allocate an array with the size that's needed.
* src/incremen.c: Include hash.h.
(struct directory): Remove "next", "dir_text". Change "name" to
be char[1] with struct hack, not const char *. Add "found".
(directory_list): Remove. Replaced by directory_table.
(directory_table): New var.
(nfs_string): Renamed from nfs.
(hash_directory, compare_directories): New functions.
(note_directory): Now returns struct directory *. First arg is
now const pointer. struct stat arg is now dev_t, ino_t, nfs.
Remove text arg. New "found" arg, basically corresponding to the
old text arg not being null. All callers changed.
(note_directory, find_directory): Use hash table rather than
linked list.
(get_directory_contents): New arg "device". Use savedir to do the
hard work. Save the nfs-ness of stat_data, since it might change
under us. Use note_directory instead of find_directory to save
some work. When adding an "A" record, do it with
add_to_accumulator instead of cheating with strcat.
(read_directory_file): Use "+" flag before device to indicate
whether it was NFS. Fix typo in checking for strtoul error.
(write_directory_file_entry): New function.
(write_directory_file): Use it, and use the hash routines to
traverse the directory table.
(gnu_restore): Use savedir rather than opendir/readdir.
* src/tar.c: Include localedir.h, prepargs.h.
(long_options): Now static.
(long_options, usage, decode_options): -j is now short for
--bzip2, and -I is now an alias for -T.
(decode_options, main): argv is not const pointer now.
(decode_options): Invoke prepend_default_options to support
TAR_OPTIONS. In diagnostic, mention the string that was the
invalid blocking factor, tape length, group, owner, or record
size. --delete is no longer incompatible with -f -, undoing
2000-01-07 change.
(main): Invoke extract_finish at end of extraction.
* src/rmt.c: Include localedir.h.
(main): Update copyright date to 2000.
* doc/getdate.texi: New file, taken from fileutils 4.0.27, with the
following changes: Use @sc where appropriate. Document the ranges of
supported times more precisely. Add Eggert to getdate authors.
Document old Latin 12m/12pm tradition. Remove list of alphabetic time
zone names, as it wasn't correct and people shouldn't be relying on it
anyway. Relative items also account for non-DST adjustments. Fix
some misspellings.
* lib/prepargs.c, lib/prepargs.h, tests/extrac04.sh: New file.
* tests/ignfail.sh: opendir -> savedir in diagnostics.
* tests/preset.in: Set LANGUAGE to the empty string, for some
brain damaged host.
2000-10-20 Paul Eggert <eggert@twinsun.com>
* m4/fnmatch.m4: Mention the GNU C library.
2000-10-19 Paul Eggert <eggert@twinsun.com>
* m4/fnmatch.m4: Add a couple more test cases to catch bugs in
glibc 2.1.95.
2000-10-17 Paul Eggert <eggert@twinsun.com>
* lib/human.c (<limits.h>): Do not include; human.h does it if needed.
(CHAR_BIT): Remove.
* lib/human.h (<limits.h>): Include if HAVE_LIMITS_H.
(CHAR_BIT): Define if not defined.
2000-09-09 Paul Eggert <eggert@twinsun.com>
* lib/quotearg.c: From fileutils: rename ISASCII to IN_CTYPE_DOMAIN.
2000-08-07 Paul Eggert <eggert@twinsun.com>
* lib/xmalloc.c: Memory exhausted -> memory exhausted
* lib/xalloc.h (xalloc_msg_memory_exhausted):
change to array from char *.
2000-08-06 Paul Eggert <eggert@twinsun.com>
* m4/mbstate_t.m4: Define mbstate_t to be int, not char, for
compatibility with glibc 2.1.3 strftime.c.
2000-07-31 Paul Eggert <eggert@twinsun.com>
* lib/quotearg.c (quotearg_n_options):
Don't make the initial slot vector a constant,
since it might get modified.
* lib/quotearg.c: Add support for more than one preallocated slot.
2000-07-30 Paul Eggert <eggert@twinsun.com>
* lib/quotearg.c (quotearg_n_options):
Preallocate a slot 0 buffer, so that the caller
can always quote one small component of a "memory exhausted" message
in slot 0.
2000-07-23 Paul Eggert <eggert@twinsun.com>
* lib/quotearg.c:
Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX), so that
mbstate_t is always defined.
Do not inspect MB_LEN_MAX, since it's incorrectly defined to be 1 in
some GCC installations, and this configuration error is likely to be
common.
2000-07-22 Paul Eggert <eggert@twinsun.com>
* lib/quotearg.c:
When the system forces us to redefine mbstate_t, shadow its mbsinit
function. From Bruno Haible.
2000-07-14 Paul Eggert <eggert@twinsun.com>
* lib/xmalloc.c: Simplify exhausted message.
* lib/quotearg.h: Update copyright date; from Jim Meyering.
2000-07-13 Paul Eggert <eggert@twinsun.com>
* lib/quotearg.h (enum quoting style):
New constant clocale_quoting_style.
* lib/quotearg.c:
(quoting_style_args, quoting_style_vals, quotearg_buffer_restyled):
Add support for clocale_quoting_style, undoing previous change to
locale_quoting_style.
2000-07-10 Paul Eggert <eggert@twinsun.com>
* lib/quotearg.c:
<wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX,
since otherwise we don't need it.
(MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
since we don't do multibytes in that case.
(quotearg_buffer_restyled): If a unibyte locale, don't bother to
invoke multibyte primitives.
* m4/mbstate_t.m4 (AC_MBSTATE_T):
Renamed from AC_MBSTATE_T_OBJECT. All uses changed.
Change from a two-part test, which defines both HAVE_MBSTATE_T_OBJECT
and mbstate_t, to a single-part test that simply defines mbstate_t.
* lib/quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
to decide whether to define the BeOS workaround macro;
this adjusts to the change to AC_MBSTATE_T.
* m4/strerror_r.m4: New file.
2000-07-05 Paul Eggert <eggert@twinsun.com>
* lib/quotearg.c: Use double-quote to quote.
* lib/quotearg.c (N_): New macro.
(gettext_default): New function.
(quotearg_buffer_restyled): Use gettext_default ("{LEFT QUOTATION MARK}",
"\"") for left quote, and gettext_default ("{RIGHT QUOTATION MARK}", "\"")
for right quote.
* lib/quotearg.c (struct quoting_options):
Simplify quote_these_too dimension.
From Bruno Haible <haible@clisp.cons.org>.
* m4/mbstate_t.m4 (AC_MBSTATE_T_OBJECT):
Test for mbstate_t only if the test
for an object-type mbstate_t fails.
* lib/quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
2000-07-03 Paul Eggert <eggert@twinsun.com>
* m4/mbstate_t.m4 (AC_MBSTATE_T_OBJECT): Port to autoconf 2.13.
Add AC_CHECK_HEADERS(stdlib.h), since we use HAVE_STDLIB_H.
* lib/quotearg.c (mbrtowc):
Assign to *pwc, and return 1 only if result is nonzero.
(iswprint): Define to ISPRINT if we are substituting our own mbrtowc.
2000-07-02 Paul Eggert <eggert@twinsun.com>
* lib/quotearg.c (mbstate_t):
Do not define; it should be defined with AC_CHECK_TYPE.
2000-06-26 Paul Eggert <eggert@twinsun.com>
* m4/mbstate_t.m4: Include stdio.h before wchar.h, to work around
a bug in glibc 2.1.3.
* lib/xmalloc.c: Fix inaccorate comment for xrealloc.
2000-06-19 Paul Eggert <eggert@twinsun.com>
* lib/quotearg.c (ISASCII): Add #undef and move definition to follow
inclusion of wctype.h to work around solaris2.6 namespace pollution.
(ISPRINT): Likewise.
Reported by Tom Tromey.
2000-06-15 Paul Eggert <eggert@twinsun.com>
* lib/human.c (adjust_value): New function.
(human_readable_inexact): Apply rounding style even when printing
approximate values.
* lib/human.c: Avoid shadowing warnings.
From Jim Meyering.
2000-06-14 Paul Eggert <eggert@twinsun.com>
* lib/human.c (human_readable_inexact): Allow an input block size
that is not a multiple of the output block size, and vice versa.
* lib/getdate.y (get_date): Apply relative times after time zone
indicator, not before.
2000-05-31 Paul Eggert <eggert@twinsun.com>
* m4/largefile.m4: Rewrite so that we don't need to run getconf,
and thus don't need AC_CANONICAL_HOST.
(AC_SYS_LARGEFILE_FLAGS, AC_SYS_LARGEFILE_SPACE_APPEND): Remove.
(AC_SYS_LARGEFILE_TEST_INCLUDES): New macro.
(AC_SYS_LARGEFILE_MACRO_VALUE): Change arguments from
CODE-TO-SET-DEFAULT to VALUE, INCLUDES, FUNCTION-BODY. All uses
changed. Instead of inspecting the output of getconf, try to
compile the test program without and with the macro definition.
(AC_SYS_LARGEFILE): Do not require AC_CANONICAL_HOST or check for
getconf. Instead, check for the needed flags by compiling test
programs.
* configure.in (AC_CANONICAL_HOST): Remove; the largefile stuff no
longer needs it.
* config.guess, config.sub: Remove these files, for similar reasons.
2000-05-03 Paul Eggert <eggert@twinsun.com>
* m4/largefile.m4 (AC_SYS_LARGEFILE): Define _XOPEN_SOURCE to be
500, instead of _GNU_SOURCE to be 1, to work around glibc 2.1.3
bug. This avoids a clash when files like regex.c that define
_GNU_SOURCE.
2000-05-02 Paul Eggert <eggert@twinsun.com>
* m4/largefile.m4 (AC_SYS_LARGEFILE):
Define _GNU_SOURCE if this is needed to make
ftello visible (e.g. glibc 2.1.3). Use compile-time test, rather than
inspecting host and OS, to decide whether to define _LARGEFILE_SOURCE.
* lib/quotearg.c (mbrtowc, mbstat_t):
Add definitions if !HAVE_MBSTATE_T_OBJECT.
(<wctype.h>): Include if HAVE_WCTYPE_H.
(iswprint): Define to 1 if we lack it
2000-04-18 Paul Eggert <eggert@twinsun.com>
* m4/mbstate_t.m4: New file.
2000-04-17 Bruno Haible <haible@clisp.cons.org>
* tests/ignfail.sh: Test for uid 0 along with user "root".
2000-04-05 Paul Eggert <eggert@twinsun.com>
* m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS):
Don't use -n32 on IRIX if the installer said
otherwise.
2000-02-28 Paul Eggert <eggert@twinsun.com>
* lib/quotearg.c (ALERT_CHAR): New macro.
(quotearg_buffer_restyled): Use it.
2000-02-23 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* src/list.c (tartime): Fix off-by-one error when copying year if
OLD_CTIME.
2000-02-18 Paul Eggert <eggert@twinsun.com>
* lib/getdate.y: Handle two-digit years with leading zeros correctly.
(textint): New typedef.
(parser_control): Changed from struct parser_control to typedef
(for consistency). Member year changed from int to textint. All
uses changed.
(YYSTYPE): Removed; replaced by %union with int and textint
members.
(tID): Removed; not used.
(tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE,
tMERIDIAN, tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER,
tUNUMBER, tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
(tSNUMBER, tUNUMBER): Now of type <textintval>.
(date, number, to_year): Use width of number in digits, not its
value, to determine whether it's a 2-digit year, or a 2-digit
time.
(yylex): Store number of digits of numeric tokens. Return '?' for
unknown identifiers, rather than (unused) tID.
2000-01-16 Paul Eggert <eggert@twinsun.com>
* lib/quotearg.c (quotearg_buffer_restyled):
Do not quote alert, backslash, formfeed,
and vertical tab unnecessarily in shell quoting style.
2000-01-15 Paul Eggert <eggert@twinsun.com>
* m4/c-bs-a.m4:
Change quoting to be compatible with future autoconf versions.
2000-01-11 Paul Eggert <eggert@twinsun.com>
* lib/exclude.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove unused macros.
2000-01-07 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.17.
Fix bug with fnmatch.h dependency, as follows:
* src/Makefile.am (OMIT_DEPENDENCIES): New macro.
* lib/Makefile.am (OMIT_DEPENDENCIES): New macro.
* src/common.h (apply_nonancestor_delayed_set_stat):
Renamed from apply_delayed_set_stat.
(apply_delayed_set_stat, decode_mode, chmod_error_details,
chown_error_details, close_warn, closedir_warn, mkdir_error,
read_error_details, read_fatal_details, read_warn_details,
seek_error_details, seek_warn_details, utime_error,
write_error_details, write_fatal_details): New decls.
Make diagnostic messages more regular.
* src/create.c (dump_file): Quote file names with colons if possible.
* src/compare.c (diff_archive): Likewise.
* src/extract.c (repair_delayed_set_stat, extract_archive): Likewise.
* src/incremen.c (get_directory_contents, gnu_restore): Likewise.
* src/mangle.c (extract_mangle): Likewise.
* src/misc.c (call_arg_error, call_arg_fatal, call_arg_warn):
Likewise.
* src/buffer.c (archive_write_error, flush_archive, close_archive,
new_volume, xclose):
Use error message functions to report errors consistently.
* src/compare.c (diff_sparse_files, diff_archive): Likewise.
* src/create.c (finish_sparse_file, dump_file): Likewise.
* src/extract.c (set_mode, set_stat, extract_sparse_file,
extract_archive): Likewise.
* src/list.c (list_archive): Likewise.
* src/update.c (append_file): Likewise.
* src/compare.c (diff_init, diff_sparse_files):
Use xalloc_die to report memory exhaustion.
* src/incremen.c (gnu_restore): Likewise.
* src/list.c (read_header): Likewise.
* src/mangle.c (extract_mangle): Likewise.
* src/misc.c (maybe_backup_file): Likewise.
* src/tar.c (decode_options): Likewise.
* src/compare.c (read_and_process, fill_in_sparse_array,
diff_sparse_files):
Use consistent terminology for unexpected-EOF message.
* src/extract.c (extract_sparse_file, extract_archive): Likewise.
* src/list.c (list_archive, read_header, skip_file,
skip_extended_headers): Likewise.
* src/buffer.c (archive_write_error): Add noreturn attribute to decl.
(xdup2): Regularize messages with rest of tar.
* src/buffer.c (flush_read): Don't read past EOF.
* src/extract.c (extr_init):
If we run out of memory, invoke apply_delayed_set_stat.
(prepare_to_extract): Don't complain if we can't remove ".".
(apply_delayed_set_stat): New function.
(apply_nonancestor_delayed_set_stat):
Renamed from apply_delayed_set_stat. All uses changed.
Don't remove head if it doesn't apply.
* src/create.c (find_new_file_size):
Return size instead of storing through pointer.
All callers changed.
(deal_with_sparse): Don't keep reading after read errors.
(finish_sparse_file): Just abort if there is an internal error.
(dump_file): Fix typo: stat_warn and stat_error were interchanged.
Don't restore access times on directories during incremental dumps
until after dealing with the directory.
If ignoring failed reads, count closedir, read, and unknown
file errors as warnings, not errors.
Fix buffer overrun problem when dumping sparse files.
* src/list.c (read_and):
Invoke apply_nonancestor_delayed_set_stat on file names
after handling them.
(decode_mode): Remove; moved to misc.c.
* src/misc.c (safer_rmdir): New function.
(remove_any_file): Use it to avoid problems with rmdir(".").
(maybe_backup_file): Regularize diagnostics.
(undo_backup_file): Likewise.
(decode_mode): Moved here from list.c.
(chmod_error_details, chown_error_details, close_fatal,
close_warn, closedir_warn, mkdir_error, read_error_details,
read_warn_details, read_fatal_details, seek_error_details,
seek_warn_details, utime_error, write_error_details,
write_fatal_details): New functions.
* src/delete.c (save_record): Remove static variable (now local).
(move_archive): Don't position before start of archive.
(write_record): Abort if count is zero at inopportune time.
Plug memory leak.
* src/tar.c (decode_options): --delete and -f - are now
incompatible, since we didn't have time to fix their bugs.
* tests/Makefile.am (TESTS): Remove delete02.sh.
* tests/ignfail.sh: Adjust to new quoting scheme again.
2000-01-06 Paul Eggert <eggert@twinsun.com>
* lib/getdate.y: Sync tm_diff with the GNU C Library.
(TM_YEAR_BASE): Renamed from TM_YEAR_ORIGIN. All uses changed.
(tm_diff): Renamed from difftm. All uses changed.
Replace body with that taken from GNU C Library 2.1.3pre1.
(get_date): Prefer tm_gmtoff to tm_diff if available.
1999-12-29 "Melissa O'Neill" <oneill@cs.sfu.ca>
* tests/incremen.sh: Invoke stat on newly created file so that its
ctime is updated on Nextstep.
1999-12-21 Machael Stone <mstone@cs.loyola.edu>
* lib/getdate.y (get_date):
Fix typo when checking for time_t overflow in time zone calculations.
1999-12-13 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.16.
* README-alpha: New file.
* README: New sections for gzip and bzip2, Solaris.
Remove mention of BACKLOG.
* configure.in (AC_C_BACKSLASH_A): Add.
(AC_CHECK_HEADERS): Add wchar.h.
(AC_CHECK_FUNCS): Add mbrtowc.
(AC_FUNC_CLOSEDIR_VOID): Add.
* tests/Makefile.am (TESTS): Add delete02.sh.
(POSTPONED_TESTS): Remove.
(EXTRA_DIST): Remove $(POSTPONED_TESTS).
* tests/preset.in:
Set LC_ALL rather than LANGUAGE, LANG, and LC_MESSAGES.
* tests/ignfail.sh (err): Adjust to new quoting scheme.
* tests/delete02.sh: Fix typo: need to list archive2, not archive.
* tests/extrac03.sh: Use -P option, so that .. doesn't get diagnosed.
* src/tar.c ("quotearg.h"): New include.
(usage): Now has __attribute__ ((noreturn)).
(confirm): Report errno if we can't open tty.
(confirm, decode_options):
Quote arbitrary strings in diagnostics.
(OVERWRITE_OPTION): New constant.
(long_options, usage, decode_options): New --overwrite option.
(decode_options): --keep-old-files, --overwrite, and --unlink-first
are now mutually exclusive.
Don't assume that gettext preserves errno.
(main): Set default quoting style to escape_quoting_style.
* src/update.c (<quotearg.h>): New include.
(append_file):
Don't assume that gettext preserves errno.
Quote arbitrary strings in diagnostics.
Check for close error.
* src/names.c (<quotearg.h>): New include.
(name_init, name_next, name_close, names_notfound,
collect_and_sort_names): Don't assume that gettext preserves
errno. Quote arbitrary strings in diagnostics.
(excluded_name): Fix typo that caused empty patterns to be
mishandled.
* src/misc.c (<quotearg.h>): New include.
(quote_copy_string): Quote only newline and backslash; the output is no
longer meant for humans, and is locale-independent.
(contains_dot_dot): New function.
(remove_any_file): Don't use lstat; just rmdir the file and then use
unlink if the rmdir fails because the file isn't a directory.
Check for readdir and closedir errors.
(maybe_backup_file): Report "stat" for stat errors.
(maybe_backup_file, chdir_do):
Quote arbitrary strings in diagnostics.
(maybe_backup_file, undo_last_backup):
Don't assume that gettext preserves errno.
(call_arg_error, call_arg_fatal, call_arg_warn,
chdir_fatal, close_error, closedir_error, exec_fatal, mkfifo_error,
mknod_error, open_error, open_fatal, open_warn, opendir_error,
opendir_warn, read_error, read_fatal, readdir_error, readdir_warn,
readlink_error, readlink_warn, seek_error, seek_warn, stat_error,
stat_warn, truncate_error, truncate_warn, unlink_error, waitpid_error,
write_error, write_fatal, xfork, xpipe, quote_n, quote): New functions.
* src/system.h (__attribute__): New macro.
(O_NDELAY, O_NONBLOCK, O_APPEND): Remove.
(S_ISDOOR): New macro.
(closedir): New macro, if CLOSEDIR_VOID.
* src/rmt.c, src/rtapelib.c (decode_oflag):
O_APPEND might not be defined.
* src/list.c: (read_and, list_archive):
Quote arbitrary strings in diagnostics.
(from_header): Use locale_quoting_style to quote diagnostics.
(print_header, print_for_mkdir): Quote with quotearg, not quote_copy_string.
* src/rmt.h (REM_BIAS): Increase from 128 to (1 << 30).
* src/Makefile.am: Use ## for copyright comments.
* src/extract.c (<quotearg.h>): New include.
(enum permstatus): New enum.
(struct delayed_set_stat): file_name is now at end of buffer, to avoid
two mallocs. New members file_name_len, invert_permissions, permstatus.
(extr_init): Remove hack that silently adjusted newdir_umask.
(set_mode, set_stat): New args invert_permissions, permstatus, typeflag.
Use these args to decide whether and how to set modes.
(set_mode, set_stat, prepare_to_extract, extract_sparse_file, extract_archive):
Don't assume that gettext preserves errno.
(set_stat): Remove arg symlink_flag; subsumed by typeflag.
(delay_set_stat, repair_delayed_set_stat): New functions.
(make_directories): Avoid mkdir where last part of path is "..".
Create a struct delayed_set_stat for each directory made.
(prepare_to_extract): Renamed from unlink_destination, and
return 0 immediately if to_stdout_option; all callers changed.
(maybe_recoverable): New parameter interdir_made.
Add support for --overwrite.
(extract_sparse_file, extract_archive):
Quote arbitrary strings in diagnostics.
(extract_archive): By default, warn about ".." in member names, and skip them.
Don't open files with O_NONBLOCK or O_APPEND.
Open with O_TRUNC only if --overwrite; otherwise, use O_EXCL to avoid
overwriting them. Pass only rwxrwxrwx permissions to `open' and `mkdir',
minus the current umask. Keep track of intermediate directories made,
to avoid looping when making x/../x when x doesn't exist; the
earlier code solved this in a different way that didn't fit well
into the new scheme. Don't extract permissions onto existing
directories unless --overwrite is given. Do not add -wx------
permissions to new directories permanently; just do it temporarily.
Remove no-longer-needed hack with MSDOS and directory time stamps.
(apply_delayed_set_stat): New argument specifies which directories to
fix statuses of. Do not wait until the end of extraction to fix
statuses; instead, fix a directory's status once we exit that directory.
This requires less memory and does the right thing in some cases
where the old method didn't.
(fatal_exit): New function.
* src/incremen.c (<quotearg.h>): New include.
(get_directory_contents, gnu_restore):
Check for readdir and closedir errors.
(get_directory_contents, read_directory_file, gnu_restore):
Quote arbitrary strings in diagnostics.
(get_directory_contents, read_directory_file, write_directory_file):
Don't assume that gettext preserves errno.
* src/create.c (<quotearg.h>): New include.
(start_header): Use `member names' to refer to archive member names, not
`archive names'. Warn about `..' in member names.
(finish_sparse_file, dump_file):
Quote arbitrary strings in diagnostics.
(finish_sparse_file, dump_file):
Don't assume that gettext preserves errno.
(dump_file): Don't use `access' to determine whether a directory is readable;
this isn't reliable if tar is setuid. Use `opendir' instead.
Check for readdir and closedir failures.
Don't dump sockets as if they were fifos; just warn and skip.
* src/delete.c (move_archive):
Don't report fatal error merely because sizes don't fit
into struct mtop values; fall back on lseek instead.
Say `Cannot' uniformly, instead of `Could not' sometimes and `Cannot' others.
Say `reposition' instead of `re-position'.
(delete_archive_members):
Set archive to STDOUT_FILENO before outputting trailing buffer.
* src/compare.c (<quotearg.h>): New include.
(diff_init): Use `Cannot' uniformly, instead of `Could not' sometimes
and `Cannot' others.
(report_difference, diff_archive):
Quote arbitrary strings in diagnostics.
(process_rawdata, diff_sparse_files, get_stat_data, diff_archive, seek_warn):
Don't assume that gettext preserves errno.
(diff_archive): Don't open regular files with O_NONBLOCK.
Preserve access times of files if --atime.
* src/common.h (FATAL_ERROR): Use new fatal_exit function to exit.
(FATAL_ERROR, USAGE): Don't return 0.
(enum old files): New enum.
(old_files_option): New variable, replacing keep_old_files_option and
unlink_first_option.
(apply_delayed_set_stat): Now takes char const * param.
(fatal_exit, contains_dot_dot, chdir_fatal, close_error,
closedir_error, exec_fatal, mkfifo_error, mknod_error, open_error,
open_fatal, open_warn, opendir_error, opendir_warn, read_error,
read_fatal, readdir_error, readdir_warn, readlink_error,
readlink_warn, seek_error, seek_warn, stat_error, stat_warn,
truncate_error, truncate_warn, unlink_error, waitpid_error,
write_error, write_fatal, xfork, xpipe, quote, quote_n): New decls.
* src/buffer.c:
(xclose, xdup2, child_open_for_compress, child_open_for_uncompress,
archive_write_error, archive_read_error, flush_archive, close_archive,
init_volume_number, new_volume):
Don't assume that gettext preserves errno.
(xdup2): Don't report errno if dup returns an unexpected nonnegative value.
(open_archive): Reject multivolume verify attempts a bit earlier.
Rename local variable `access', in case it's defined by system header.
(open_archive, backspace_output): Use `Cannot' uniformly, instead of
`Could not' sometimes and `Cannot' others.
(open_archive, flush_read, flush_archive, close_archive, new_volume):
Quote arbitrary strings in diagnostics.
(read_error): Set archive to STDOUT_FILENO temporarily when writing
archive buffer.
(init_volume_number): Check for input and output errors in volno_file.
(new_volume): Use new fatal_exit function to exit, and new xfork
function to fork.
* m4/Makefile.am (EXTRA_DIST): Add c-bs-a.m4.
* Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/c-bs-a.m4.
* doc/tar.texi: Add --overwrite.
--absolute-names rejects ".." in names.
* lib/quotearg.c: Add support for multibyte characters.
(ISGRAPH): Remove.
(ISPRINT): New macro.
(<wchar.h>): Include if HAVE_MBRTOWC && HAVE_WCHAR_H.
(isprint, mbrtowc, mbsinit, mbstate_t): New macros,
defined if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
(quotearg_buffer_restyled): New function, with most of the old
quotearg_buffer's contents.
Major rewrite to support multibyte characters.
(quotearg_buffer): Now just calls quotearg_buffer_restyled.
* m4/c-bs-a.m4: New file.
* lib/Makefile.am: Use ## for copyright notice.
* scripts/Makefile.am: Use ## on copyright notice.
* doc/Makefile.am:
($(srcdir)/tar.info, tar.dvi): We now use texinfo 4.0.
1999-12-05 Paul Eggert <eggert@twinsun.com>
* doc/ChangeLog, lib/ChangeLog, scripts/ChangeLog,
src/ChangeLog, tests/ChangeLog: Remove these files.
* ChangeLog.1: New file, incorporating the above files, plus old
ChangeLog entries.
* Makefile.am (EXTRA_DIST): Add ChangeLog.1.
1999-12-05 Dale Worley <worley@ariadne.com>
* src/compare.c (<utime.h>, struct utimbuf): Add.
(diff_archive): Restore access times if --atime.
* doc/tar.texi: Explain that --atime also preserves modification time.
1999-12-04 Gerhard Poul <gpoul@gnu.org>
* ABOUT-NLS: Update to latest version from ftp.gnu.org.
* BACKLOG, TODO: Remove.
* Makefile.am (all-local, BABYL, dist-zoo, id, ID): Remove.
* README: Bring up to date.
1999-12-03 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.15.
* src/compare.c (diff_archive):
Do not set errno to EPIPE; we no longer use perror.
* src/create.c (dump_file):
If a parent directory said that a file should be there but it is
absent, diagnose it as being removed in the meantime.
Do not pass meaningless errno to ERROR when reporting that the
file changed as we read it.
Report that a file changed if its ctime changes; this is more
sensitive than mtime+size, and more accurate.
* src/incremen.c (enum children): New type.
(struct directory): Change old char allnew member to new enum children
children member.
All uses changed.
(get_directory_contents): When doing an incremental dump that does
not cross filesystem boundaries, dump the mount points, even though
they are in a different filesystem. This is for convenience when
restoring, and for consistency with non-incremental dumps.
This requires a 3-way flag for keeping track of which children we want,
so we use enum children rather than boolean.
* src/open3.c (modes): Remove.
(open3): Remove unportable assumptions about flag encodings.
Use `stat' instead of `access' for testing file existence,
to avoid problems with setuid programs.
* src/names.c (name_next): If file names are given both in the
command line (e.g. via -C) and in a file (via -T), do not
ignore the command-line names.
* m4/uintmax_t.m4: Backport to autoconf 2.13.
* doc/tar.texi: Clarify getdate authorship.
1999-11-23 Paul Eggert <eggert@twinsun.com>
* lib/Makefile.am (DISTCLEANFILES): New macro.
* configure.in (tar_fnmatch_hin):
Remove; it runs afoul of a bug in autoconf 2.13.
Instead, always link fnmatch.h to some file, even if it's a throwaway.
1999-11-19 Paul Eggert <eggert@twinsun.com>
* m4/largefile.m4: Update serial.
1999-11-18 Paul Eggert <eggert@twinsun.com>
* m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a bug in
the QNX shell, which doesn't propagate exit status of failed
commands inside shell assignments.
1999-11-07 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.14.
* configure.in (AC_PREREQ): Bump to 2.13.
(ALL_LINGUAS): Add pt_BR, ja.
(AC_FUNC_FNMATCH): Remove lib/funmatch.h before invoking, not after.
(tar_cv_path_RSH): Prefer a non-symlink rsh to a symlink one,
for AIX crossbuilds.
* doc/tar.texi: New node create options for --ignore-failed-read.
Remove unused version control symbols.
Modernize texinfo usage.
* src/tar.c (usage): Add examples.
* m4/fnmatch.m4 (AC_FUNC_FNMATCH):
Include fnmatch.h when testing fnmatch.
* src/common.h (collect_and_sort_names): New decl.
* src/list.c (from_header):
Handle 32-bit two's complement negative time stamps
even if the leading octal digit is 2 or 3.
* src/extract.c (set_stat): Remove duplicate code.
* src/create.c (to_chars): Remove trailing newline from warning.
(dump_file): Ignore doors.
(finish_header): Report block numbers with origin 0, not origin 1.
* src/rmt.c: Include getopt.h.
(long_opts): New constant.
(usage): New function.
(main): Implement --help and --version.
Output usage message if arguments are bad.
1999-10-10 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.13.
* README: Remove --with-dmalloc.
Add --disable-largefile.
Remove old NeXT dirent problems, or AIX valloc problems.
Remove old union wait advice, and old %lld advice.
Remove advice about FreeBSD 2.1.7, ISC 4.1mu, Ultrix `make'.
* doc/tar.texi: Clarify documentation for portable file names.
* configure.in (AM_WITH_DMALLOC): Remove.
(ALL_LINGUAS): Add ja.
* src/tar.c (decode_options):
Invalid dates are now treated as (time_t) -1.
Redo version message to conform to GNU standards.
* src/create.c (dump_file):
Fix typo: last two args to dump_file were interchanged.
* src/update.c (update_archive): Likewise.
* src/common.h (tartime): New decl.
* src/list.c (tartime): Now extern.
(read_and): Invalid headers cause errors, not warnings.
1999-10-03 Paul Eggert <eggert@twinsun.com>
* lib/getdate.y (__attribute__):
Don't use if GCC claims to be before 2.8; this is
needed for OPENStep 4.2 cc. Also, don't use if strict ANSI.
1999-09-25 Paul Eggert <eggert@twinsun.com>
* lib/fnmatch.c, lib/fnmatch.hin: Merge changes from latest glibc.
* lib/getopt.c, lib/getopt.h, lib/getopt1.c: Likewise.
* tests/incremen.sh: Add yet another sleep.
1999-09-24 Paul Eggert <eggert@twinsun.com>
* NEWS: A read error now causes a nonzero exit status.
* src/create.c (to_chars): Fix base-256 output.
* src/buffer.c (write_error):
Read error is an error, not just a warning.
1999-09-24 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.12.
* src/tar.c (<time.h>): Include.
(time): Declare if not defined.
(confirm): Don't read past EOF.
(long_options, usage): Add --no-same-owner, --no-same-permissions.
(main): Use clock_gettime if available.
* tests/Makefile.am (TESTS): Add incremen.sh
(INCLUDES): Add -I../lib, for fnmatch.h.
* src/update.c (update_archive):
Remove call to name_expand; had no effect.
Use chdir_do to change into directory.
Use deref_stat instead of stat.
Use add_avoided_name to mark names to be avoided; the old method of
setting a bit with the name caused all descendants of that name to
be avoided, in some circumstances.
* tests/incremen.sh: Remove unnecessary sleeps.
* src/names.c (name_next): Go back to using plain chdir.
(name_gather): Use chdir_arg to keep track of arguments to chdir.
(addname): Likewise.
(name_match): Use chdir_do to act on chdir args.
(merge_sort): Moved here from incremen.c.
(compare_names, add_hierarchy_to_namelist, collect_and_sort_names):
Likewise.
(name_expand): Remove.
(name_from_list): Skip fake names.
Use chdir_do to act on chdir args.
(struct avoided_name): New struct.
(avoided_names): New var.
(add_avoided_name, is_avoided_name): New functions.
* src/system.h (stat, lstat): Define in terms of statx on
STX_HIDDEN && !_LARGE_FILES /* AIX */ hosts.
(UCHAR_MAX): New macro.
(TYPE_MAXIMUM): Cast to arg type, for types narrow than int.
* m4/largefile.m4: Work around GCC 2.95.1 bug with HP-UX 10.20.
* src/incremen.c (<time.h>): Remove include; no longer used.
(time): Remove decl.
(time_now): Remove.
(get_directory_contents): Use deref_stat.
Consider a subdirectory to be all new only if
listed_incremental_option or if it its timestamp is newer than the
cutoff.
(add_hierarchy_to_namelist, merge_sort): Move to names.c.
(read_directory_file): Now extern. Do not set time_now.
(write_directory_file): Renamed from write_dir_file.
Use start_time instead of time_now.
(compare_names, collect_and_sort_names): Move to names.c.
* src/mangle.c (<time.h>): Remove; not used.
(time): Do not declare.
* src/misc.c (chdir_from_initial_wd): Remove.
(deref_stat): New function.
(struct wd): New struct.
(wd, wds, wd_alloc): New variables.
(chdir_arg, chdir_do): New function.
* src/compare.c (get_stat_data): Use deref_stat.
* src/common.h (name_expand): Remove.
* src/list.c (time): Declare if not defined.
(base_64_digits): Moved here from create.c.
(base64_map): Use UCHAR_MAX for size, not less-clear (unsigned char)
-1.
(read_and): Don't get time from header unless we need it now;
as getting time can cause duplicate diagnostics if bogus.
Remove "Hmm, " from diagnostic.
Use "Skipping to next header" uniformly.
(from_header): Renamed from from_chars. All uses changed.
Allow different forms for unportable 2's complement numbers.
Don't check for extended forms when parsing checksums.
Parse base-256 output.
(gid_from_header): Renamed from gid_from_chars. All uses changed.
(major_from_header): Renamed from major_from_chars. All uses changed.
(minor_from_header): Renamed from minor_from_chars. All uses changed.
(mode_from_header): Renamed from mode_from_chars. All uses changed.
(off_from_header): Renamed from off_from_chars. All uses changed.
(size_from_header): Renamed from size_from_chars. All uses changed.
(time_from_header): Renamed from time_from_chars. All uses changed.
Warn about future timestamps.
(uid_from_header): Renamed from uid_from_chars. All uses changed.
(uintmax_from_header): Renamed from uintmax_from_chars.
All uses changed.
(tartime): New function, incorporating isotime.
(isotime): Delete.
(print_header): Use tartime.
* src/create.c (to_chars): Fix typo in decl.
Don't assign through char const *.
Rename name_expand back to collect_and_sort_names.
* src/extract.c (<time.h>): No need to include.
(time): No need to declare.
(now): Remove variable.
(extr_init): Don't initialize `now'.
Increment same_permissions_option and same_owner_option if we_are_root
is nonzero; this supports the new --no-same-owner option.
(set_stat): Use start_time instead of `now'.
* src/create.c (struct link): Remove unused linkcount member.
(base_64_digits): Move to list.c.
(base_8_digits): Remove.
(to_octal): New function, with some of old contents of to_base.
(to_base): Remove.
(to_base256): New function.
(to_chars): Use base 256, not base 64, for huge values.
(mode_to_chars): Don't use two's complement in GNU format or POSIX
format.
(dump_file): Interchange last two arguments. If TOP_LEVEL is negative,
it means we have an incremental dump where we don't know whether this
is a top-level call.
Use deref_stat instead of statx / stat / lstat.
Cast result of alloca.
Check for dates if 0 < top_level, not if listed_incremental_option.
Move multiple-link check after directory check.
Do not dump avoided names.
Dump hard links to symbolic names as links, not as separate
symbolic links.
start_header cannot return a null pointer, so don't test for it.
Likewise for find_next_block.
* src/buffer.c, src/common.h (<human.h>): Include.
(read_error): Read error is an error, not just a warning.
(print_total_written): Also print human-readable byte count, and
bytes/s.
(open_archive, flush_write): Use start_time, not current time.
(flush_read): Report about garbage bytes ignored at end of archive,
but act on non-garbage bytes (instead of ignoring them).
(new_volume): Use WARN for warnings.
* doc/Makefile.am:
($(srcdir)/tar.info): Add -I$(srcdir) so that subdir builds work.
* Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/fnmatch.m4.
* m4/Makefile.am (EXTRA_DIST): Add fnmatch.m4.
* lib/Makefile.am (noinst_HEADERS):
Rename fnmatch.h to fnmatch.hin; add human.h.
(libtar_a_SOURCES): Add human.c, xstrtoul.c.
(INCLUDES): Remove -I.. -I$(srcdir) -- automake adds this for us.
* src/Makefile.am (rmt_LDADD, tar_LDADD): New macros.
* lib/fnmatch.c (strchrnul):
Define to __strchrnul if _LIBC, to our own replacement otherwise.
Do not define if !_LIBC and if it already exists.
(internal_fnmatch): Use it.
* configure.in (tar_LDADD): New variable, used only when linking tar.
(rmt_LDADD): Similarly, for rmt.
(AC_FUNC_FNMATCH): Link fnnmatch.hin to fnmatch.h if we're using our
fnmatch.c; otherwise, use the system fnmatch.h.
* doc/tar.texi: Add --no-same-owner, --no-same-permissions.
Modernize sample backup script.
* THANKS: Martin Goik's email address has changed.
* m4/fnmatch.m4: New file.
1999-09-03 Paul Eggert <eggert@twinsun.com>
* lib/lchown.h (ENOSYS): Don't use ENOMSG; it's not in NeXTStep3.3.
Use EINVAL instead.
1999-08-29 Paul Eggert <eggert@twinsun.com>
* lib/getdate.y (get_date):
Rename outermost local `probe' to `quarter'.
Rename latter local `tm' to probe_tm.
From: Jim Meyering <meyering@ascend.com>
Message-ID: <uryn1vafyyc.fsf@ixi.eng.ascend.com>
1999-08-28 Paul Eggert <eggert@twinsun.com>
* lib/getdate.y (PC): New macro; use it when possible.
(number): Handle `Nov 11 1996' example correctly.
See Risks Digest 20.55 (1999-08-27)
http://catless.ncl.ac.uk/Risks/20.55.html#subj18
1999-08-23 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.11.
Remove minor cases of lint from many source files: this includes
unnecessary casts, uses of NULL, etc.
* configure.in (AC_PROG_YACC): Remove.
(YACC): Always use bison.
(AC_STRUCT_TIMEZONE): Add.
(AC_REPLACE_FUNCS): Add strcasecmp, strncasecmp.
* doc/tar.texi: --bzip2 is now -I. Remove obsolete time zone info.
Fix spelling.
* lib/Makefile.am (EXTRA_DIST): Add strcasecmp.c, strncasecmp.c.
($(srcdir)/getdate.c): Rename y.tab.c to getdate.c only if successful.
* lib/strcasecmp.c, lib/strncasecmp.c: New files.
* src/common.h (merge_sort): Remove decl; no longer exported.
* src/system.h (voidstar): Remove.
(memcpy, memcmp): Cast args.
("xalloc.h"): Add include.
(xmalloc, xrealloc): Remove decl.
* src/mangle.c (time): Do not declare if defined.
(first_mangle, mangled_num): Remove.
* src/list.c (from_chars): Report out-of-range values more precisely.
(off_from_chars): Do not allow negative offsets.
(uid_from_chars): Allow negative uids.
* src/create.c (linklist): Now static.
(to_chars): Fix wording of message to match from_chars.
* src/misc.c (merge_sort): Move to incremen.c.
* src/incremen.c (merge_sort): Move here from misc.c; now static.
It's too painful to make it both generic and portable.
(read_directory_file): "timestamp" -> "time stamp" in messages.
* src/tar.c (long_options, usage, main): -y is now -I (for --bzip).
(usage): Fix misspelling.
(OPTION_STRING): -y is now -I.
(decode_options): Use -1, not EOF, for getopt_long result.
Fix typo when invoking xstrtoumax: look for LONGINT_OK, not LONG_MAX.
Handle operands after any "--" argument.
(main): Report any output errors.
* src/rmt.c (main): status is ssize_t, not long.
* src/names.c (name_gather): Handle trailing -C option correctly.
(addname): use memcpy, not strncpy, to copy a string of known length.
(name_match): Handle trailing -C option correctly.
Propagate -C option to following files.
(name_match, name_scan): Remove redundant matching code.
* src/buffer.c (open_archive): Use American spelling in diagnostic.
* lib/getdate.y: Major rewrite. Add copyright notice.
(<stdio.h>): Include only if testing.
(ISUPPER): Remove.
(ISLOWER): New macro.
(<string.h>): Include if HAVE_STRING_H, not USG.
(bcopy): Remove.
(yymaxdepth, ..., yycheck): Don't bother to redefine, since we assume
bison.
(EPOCH_YEAR): Renamed from EPOCH.
(table): Renamed from TABLE.
(meridian): Now an anonymous enum.
(struct parser_control): New type.
(YYLEX_PARAM, YYPARSE_PARAM, YYSTYPE): New macros.
(yyInput, ..., yyRelYear): Migrated into struct parser_control.
(%pure_parser): Added, so that the parser is pure.
(%union): Removed; the type is now just plain int.
All %type directives removed.
(tLOCAL_ZONE): New %token.
(month_day_table): Renamed from MonthDayTable.
(gmtime, localtime, mktime, time): Declare only if not defined.
(meridian_table): New table.
(dst_table): New table.
(units_table): renamed from UnitsTable.
(relative_time_table): Renamed from OtherTable.
(time_zone_table): Renamed from TimezoneTable. Modernized.
(military_table): Renamed from MilitaryTable.
(to_hour): Renamed from ToHour.
(to_year): Renamed from ToYear.
(lookup_zone): New function.
(LookupWord): Renamed from lookup_word. Use lookup_zone for time
zones.
(yylex): Now reentrant. All callers changed.
(get_date): Add support for local time zone abbreviations.
Make it reentrant.
1999-08-20 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.10.
* src/create.c (to_chars): Generate GNU base-64 representation
if we are generating an old or new GNU format tar file for a
number that can't be represented with the POSIX format.
* configure.in (AC_CHECK_FUNCS): Add fchdir.
(AM_FUNC_GETLINE): Add.
(LIBOBJS): Add getline.o to workaround comment.
* Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/getline.m4.
* m4/Makefile.am (EXTRA_DIST): Add getline.m4.
* lib/Makefile.am (noinst_HEADERS): Add getline.h, save-cwd.h.
(libtar_a_SOURCES): Add save-cwd.c, xgetcwd.c.
* lib/getline.c, lib/getline.h, lib/save-cwd.c,
lib/save-cwd.h, m4/getline.m4: New files.
* src/misc.c (<save-cwd.h>): Include.
(chdir_from_initial_wd): New function.
* src/names.c (name_next): Use chdir_from_initial_wd, not chdir.
(name_gather): Handle `-C x -C y' correctly.
Do not rely on addname to handle -C.
(addname): New CHANGE_DIR parameter. All callers changed.
Remove ugly calls to getcwd; no longer needed.
(name_match, name_from_list): Use chdir_from_initial_wd, not chdir.
* src/incremen.c (listed_incremental_stream): New var.
(read_directory_file): Remove arbitrary limits on file name length.
Do not attempt to get the working directory; we can bypass this
on fchdir hosts. Open the listed_incremental_option file for both
read and write instead of opening it twice. Check for I/O errors
when doing I/O to this file. Check for invalid data in the file,
and report line numbers of invalid data.
(write_dir_file): Likewise.
(collect_and_sort_names): Use chdir_from_initial_wd, not chdir.
Do not invoke write_dir_file; that's our caller's responsibility.
* src/list.c (max): New macro.
(isotime): Now takes time_t, not time_t *. Report the decimal values
of times that can't be broken down.
(print_header): Don't assume that major and minor device numbers can
fit into uintmax_t.
* src/common.h (struct name): change_dir is now char const *.
(write_directory_file): Remove unused decl.
(STRINGIFY_BIGINT): Assume b always points to UINTMAX_STRSIZE_BOUND
chars; the old `sizeof (b)' broke when b was a pointer not an array.
(chdir_from_initial_wd): New decl.
(addname): New 2nd arg.
* THANKS: Torsten Lull -> Catrin Urbanneck
1999-08-18 Paul Eggert <eggert@twinsun.com>
* configure.in (HAVE_GETHOSTENT, HAVE_SETSOCKOPT):
Don't depend on ac_cv_func variables.
From Albert Chin-A-Young <china@thewrittenword.com>.
1999-08-18 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.9
* m4/signedchar.m4: New file.
* configure.in (pe_AC_TYPE_SIGNED_CHAR): Add.
* src/system.h (signed_char): New macro.
* Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/signedchar.m4.
* m4/Makefile.am (EXTRA_DIST): Add signedchar.m4.
* src/create.c (write_eot): Write at least two zero blocks.
* src/extract.c (extract_archive): Fix sparse array bug:
we did not find end of array correctly.
* src/compare.c: (fill_in_sparse_array, diff_sparse_files):
Don't assume find_next_block yields nonnull.
* src/extract.c (extract_sparse_file, extract_archive): Likewise.
* src/list.c (skip_extended_headers): Likewise.
* src/list.c (read_and, list_archive): Simplify code.
(read_header): Fix computation of signed checksums on machines where
char is unsigned.
Do not consider a block to be zero unless all its bytes are zero,
even the checksum bytes. Do not attempt to parse the checksum of
a zero block. Fix memory leak with long names and links.
(from_chars): Accommodate a buggy tar that outputs leading NUL
if the previous field overflows.
* src/misc.c (quote_copy_string): Generate \177 for '\177', not
\?, for portability to non-ASCII hosts.
1999-08-16 Paul Eggert <eggert@twinsun.com>
* configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.8.
* src/extract.c (make_directories): Do not chown intermediate
directories, even if we are root.
* src/list.c (read_header): Fix bugs when interpreting
POSIX-compliant headers that do not contain null bytes in the
header or link names.
1999-08-14 Paul Eggert <eggert@twinsun.com>
* configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.7.
* configure.in (AC_CHECK_HEADERS): Remove sys/wait.h.
(AC_HEADER_SYS_WAIT): Add.
(AC_REPLACE_FUNCS): Add waitpid.
(tar_cv_header_union_wait, HAVE_UNION_WAIT): Remove.
* lib/waitpid.c: New file.
* lib/Makefile.am (EXTRA_DIST): Add waitpid.c.
* src/system.h (WCOREDUMP): Remove; no longer used.
(WIFSTOPPED): Likewise.
(WEXITSTATUS, WIFSIGNALED): Default to Solaris 7 versions.
* src/buffer.c (child_open_for_compress): Undo previous change.
(close_archive): Use waitpid, POSIX-style, instead of old BSD style.
(new_volume): Likewise.
* src/buffer.c, src/extract.c, src/incremen.c (time):
Don't declare if defined.
* src/extract.c (extr_init): Remove unneeded cast around 0 arg to time.
* src/incremen.c (read_directory_file):
Invoke `time' the same way everyone else does.
Check validity of --listed-incremental file contents a bit better.
Do not worry about --after-date-option; tar.c now checks this.
* src/list.c (isotime): Report ??? if localtime returns null.
Don't assume years fit into four digits.
Don't append trailing newline.
(print_header): Report ??? if localtime returns null;
Don't assume years fit into four digits.
* src/compare.c (diff_archive): Do not fall back on absolute name
when --absolute-names is not specified.
* src/create.c (start_header):
Include text of ignored filesystem prefix in warning.
(create_archive): Check for excluded names when doing incremental
pass through directory.
(dump_file): Do not dump old files explicitly given on command line
when using --listed-incremental. Do not strip ./ prefix from names.
* src/tar.c: -g now implies after_date_option = 1.
-g and -N are now incompatible options.
* doc/tar.texi: Explain --exclude better. Don't strip leading `./'.
1999-08-11 Jeff Dairiki <dairiki@dairiki.org>
* src/list.c (read_header): Don't parse OLDGNU_FORMAT
incremental headers as POSIX prefixes.
1999-08-11 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in: Version 1.13.6.
* configure.in (ALL_LINGUAS): Add pt_BR.
* po/pt_BR.po: New file.
* doc/Makefile.am ($(srcdir)/tar.info, $(srcdir)/header.texi):
Renamed from tar.info and header.texi; adjust actions so that
they work in other directories.
* doc/tar.texi: Add -y and --bzip2.
Patterns containing / now exclude only file names whose prefix match.
* lib/exclude.h (excluded_filename): New option parameter.
(add_exclude_file): New ADD_FUNC parameter.
(excluded_pathname): Remove decl.
* lib/exclude.c (_GNU_SOURCE):
Remove; no longer needed since we don't use FNM_ macros.
(excluded_filename): Renamed from excluded_filename_opts.
(excluded_filename, excluded_pathname): Remove.
(add_exclude_file): New ADD_FUNC parameter.
* po/POTFILES.in: Add lib/quotearg.c.
* src/buffer.c (_GNU_SOURCE): Define.
(<fnmatch.h>): Include unconditionally.
(child_open_for_compress): Dup after closing, to avoid possible file
descriptor exhaustion.
(flush_write): Use FILESYSTEM_PREFIX_LEN instead of MSDOS ifdef.
(flush_read): Likewise.
* src/common.h (LG_8, LG_64): New macros.
(excluded_with_slash, excluded_without_slash): New vars.
(excluded): Remove.
(base_64_digits): New decl.
(gid_to_chars, major_to_chars, minor_to_chars, mode_to_chars,
off_to_chars, size_to_chars, time_to_chars, uid_to_chars,
uintmax_to_chars,
GID_TO_CHARS, MAJOR_TO_CHARS, MINOR_TO_CHARS, MODE_TO_CHARS,
OFF_TO_CHARS, SIZE_TO_CHARS, TIME_TO_CHARS, UID_TO_CHARS,
UINTMAX_TO_CHARS):
Renamed from gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct,
off_to_oct, size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct,
GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT, MODE_TO_OCT, OFF_TO_OCT,
SIZE_TO_OCT, TIME_TO_OCT, UID_TO_OCT, UINTMAX_TO_OCT,
respectively. All definitions and uses changed.
(excluded_name): New decl.
* src/compare.c (diff_archive):
Open files with O_NONBLOCK instead of O_NDELAY.
* src/create.c (base_64_digits): New constant.
(base_8_digits): New macro.
(MAX_VAL_WITH_DIGITS): New macro.
(to_base): First half of old to_oct. Support base 64 too.
(to_chars): Other half of old to_oct, for 64-bit support.
(GID_NOBODY, UID_NOBODY): Don't define if the headers don't.
(gid_substitute, uid_substitute): Look up names dynamically if
GID_NOBODY and UID_NOBODY aren't defined; use -2 if all else fails.
(mode_to_chars): Renamed from mode_to_oct.
Support negative values in all the _to_chars functions.
(start_header): Use FILESYSTEM_PREFIX_LEN instead of MSDOS ifdef.
Abort if archive format is DEFAULT_FORMAT when it shouldn't be.
(dump_file): Inspect entire pathname, not just new file name
component, when deciding whether to exclude it.
* src/extract.c (extract_archive):
Open files with O_NONBLOCK instead of O_NDELAY.
* src/incremen.c (get_directory_contents):
Inspect entire pathname, not just new file name
component, when deciding whether to exclude it.
* src/list.c (<fnmatch.h>): Do not include.
(from_chars): Renamed from from_oct. New parameter specifying
the negative of the minimum allowed value. Support negative
and base-64 values.
(base64_map): New var.
(base64_init): New function.
(print_header): Output numeric uids and gids if numeric_owner_option.
* src/misc.c (quote_copy_string): Use LG_8 instead of constants.
* src/names.c (_GNU_SOURCE): Define.
(<fnmatch.h>): Include unconditionally.
(excluded_name): New function, taking over duties of excluded_pathname.
All uses changed.
* src/rmt.c (decode_oflag): New function.
(main): Use it to support symbolic open flags.
* src/rtapelib.c (encode_oflag): New function.
(rmt_open__): Do not allow newlines in the path.
Propagate errno correctly.
Decode symbolic open flags, if present.
* src/system.h (FILESYSTEM_PREFIX_LEN, ISSLASH, O_ACCMODE, O_NONBLOCK):
New macros.
* src/tar.c: (long_options, usage, OPTION_STRING, decode_options):
New -y or --bzip2 option.
(add_filtered_exclude): New function.
(decode_options): Put excluded patterns with / into
excluded_with_slash, and without / into excluded_without_slash.
Compare newer_mtime_option to its new initial value
TYPE_MINIMUM (time_t) when deciding whether more than one
threshold date was specified.
1999-07-20 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in: Version 1.13.5.
* src/common.h (FATAL_ERROR): Invoke apply_delayed_set_stat
before exiting.
* src/buffer.c (new_volume): Likewise.
* src/incremen.c (read_directory_file): Likewise.
* src/tar.c (decode_options):
ERROR ((TAREXIT_FAILURE, ... -> FATAL_ERROR ((0,
for consistency.
* NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.4.
* configure.in (AC_CHECK_FUNCS): Add lstat, readlink, symlink.
* src/system.h (lstat): Define only if !HAVE_LSTAT && !defined lstat.
(S_ISMPB, S_ISMPC, S_ISNWK): Remove unused macros.
(S_ISBLK, S_ISCHR, S_ISCTG, S_ISFIFO, S_ISLNK, S_ISSOCK):
Define to 0 if the corresponding S_IF* macro is not defined.
(mkfifo): Do not define if already defined, or if S_IFIFO
is not defined.
* src/compare.c (diff_archive): Use HAVE_READLINK, not
S_ISLNK, to determine whether to invoke readlink.
* src/create.c (dump_file): Likewise.
* src/extract.c (set_mode):
Do not chmod unless we are root or the -p option was given;
this matches historical practice.
(unlink_destination): New function, which checks for unlink failures.
(maybe_recoverable): Stay quiet if -U.
(extract_archive): Use O_EXCL if unlink_first_option.
Report unlink failures.
Use HAVE_SYMLINK, not S_ISLNK, to determine whether symlink exists.
Use HAVE_MKFIFO || defined mkfifo, not S_ISFIFO, to determine whether
mkfifo exists.
* src/incremen.c (get_directory_contents): Depend on
S_ISHIDDEN, not AIX, to determine whether to invoke S_ISHIDDEN.
* src/list.c: Remove S_IS* ifdefs.
* src/misc.c (maybe_backup_file): Likewise.
* src/misc.c (maybe_backup_file):
"Virtual memory exhausted" -> "Memory exhausted",
to conform to the other places this message is issued.
* src/mangle.c (extract_mangle):
Replace #ifdef S_ISLNK with #ifdef HAVE_SYMLINK.
* src/rtapelib.c (rmt_open__):
Remove typo that caused us to omit the first char
of the basename.
1999-07-16 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.13.3.
* doc/tar.texi: A path name is excluded if any of its file name
components matches an excluded pattern, even if the path name was
specified on the command line.
* src/create.c (create_archive): Likewise.
* src/list.c (read_and): Likewise.
* src/update.c (update_archive): Likewise.
* lib/exclude.h (excluded_pathname): New decl.
* lib/exclude.c (_GNU_SOURCE): Define.
(FILESYSTEM_PREFIX_LEN, ISSLASH): New macros.
(excluded_filename_opts): New function.
(excluded_pathname): New function.
* lib/Makefile.am (EXTRA_DIST):
xstrtol.c moved here from libtar_a_SOURCES.
(libtar_a_SOURCES): Move xstrtol.c to EXTRA_DIST.
Remove xstrtoul.c; no longer needed.
* lib/xstrtol.c: Remove.
* src/tar.c (decode_options):
Set newer_time_option to TYPE_MINIMUM, so that
negative timestamps are handled correctly.
Replace invocations of xstrtol and xstrtoul with xstrtoumax, for
uniformity (and so that we don't need to have the other fns).
(main): Remove call to init_total_written; no longer needed.
* configure.in (AC_CHECK_SIZEOF): Remove no-longer-needed
checks for unsigned long and long long.
* src/arith.c: Remove.
* src/Makefile.am (tar_SOURCES): Remove arith.c.
* po/POTFILES.in: Remove src/arith.c.
* src/arith.h: Use double, to simplify configuration gotchas.
(tarlong): Now double.
(TARLONG_FORMAT): New macro.
(BITS_PER_BYTE, BITS_PER_TARLONG, SUPERDIGIT, BITS_PER_SUPERDIGIT,
LONGS_PER_TARLONG, SIZEOF_TARLONG, struct tarlong,
zerop_tarlong_helper, lessp_tarlong_helper, clear_tarlong_helper,
add_to_tarlong_helper, mult_tarlong_helper, print_tarlong_helper,
zerop_tarlong, lessp_tarlong, clear_tarlong, add_to_tarlong,
mult_tarlong, print_tarlong): Remove. All callers replaced with
arithmetic ops.
* src/common.h (init_total_written): Remove decl.
* src/buffer.c (total_written):
Remove; replaced with prev_written + bytes_written.
(prev_written): New var.
(init_total_written): Remove.
(print_total_written): Use TARLONG_FORMAT instead of print_tarlong.
* m4/ulonglong.m4 (jm_AC_TYPE_UNSIGNED_LONG_LONG):
Make sure that we can shift, multiply
and divide unsigned long long values; Ultrix cc can't do it.
* lib/modechange.c (mode_compile): Use uintmax_t, not unsigned long.
Check for any unknown bits, not just unknown bits left of the leftmost
known bit.
* lib/quotearg.c (quotearg_buffer):
Don't quote spaces if C quoting style.
* src/list.c (from_oct):
Use C quoting style for error; omit trailing NULs.
1999-07-14 Paul Eggert <eggert@twinsun.com>
* configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.2.
* m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX): Check whether
<inttypes.h> defines strtoumax as a macro (and not as a function).
HP-UX 10.20 does this.
* src/tar.c (usage): tar-bugs@gnu.org -> bug-tar@gnu.org
* PORTS, README, TODO, doc/tar.texi: Likewise.
1999-07-12 Paul Eggert <eggert@twinsun.com>
* configure.in (AM_INIT_AUTOMAKE): Version 1.13.1.
(LIBOBJS): Add mktime.o to automake 1.4 bug workaround.
* src/list.c (decode_header):
Do not assume that S_IFBLK and S_IFCHR are defined.
* src/create.c (start_header): Do not assume S_IFMT is defined.
(dump_file): Remove unnecessary check for screwy apollo lossage.
Do not assume S_IFBLK and S_IFCHR are defined.
* src/extract.c (extract_archive):
Test whether S_IFCHR and S_IFBLK are nonzero,
not whether they are defined, for consistency with other tests.
* src/buffer.c (is_regular_file):
Don't succeed on files that we can't access due to
permissions problems.
(open_archive): Fix wording on fatal error message.
Don't bother to stat /dev/null if the archive is not a character
special device.
* src/compare.c (process_rawdata, diff_sparse_files, diff_archive):
Report an error, not a warning, for I/O errors.
(process_rawdata, process_dumpdir, diff_sparse_files):
Change ungrammatical "Data differs" to "Contents differ".
(get_stat_data): Find hidden files on AIX.
Accept file name as argument; all uses changed.
(get_stat_data, diff_archive): Use system error message for
nonexistent files rather than rolling our own.
(diff_archive): Unknown file types are errors, not warnings.
Normalize spelling of message to "File type differs".
Use get_stat_data to get link status, for consistency.
Do not inspect st_rdev for fifos.
Do not assume st_mode values contain only file types and mode bits.
Check for mode changes and device number changes separately.
* src/update.c (append_file):
Open the file before statting it, to avoid a race.
Complain about file shrinkage only when we reach EOF.
1999-07-08 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13 released.
* configure.in (AC_EXEEXT): Add.
* lib/Makefile.am (noinst_HEADERS):
Add basename.h, exclude.h. Remove full-write.h.
(libtar_a_SOURCES): Add exclude.c.
* lib/basename.h, lib/exclude.c, lib/exclude.h, lib/safe-read.h:
New files.
* lib/full-write.c: Include safe-read.h instead of full-write.h.
* lib/safe-read.h (safe_read): New decl.
* src/rmt.c: Include safe-read.h.
* src/rtapelib.c: Include basename.h, save-read.h.
(rmt_open__): Use base_name to compute base name.
* src/common.h:
Include basename.h, exclude.h; don't include full-write.h.
(exclude_option): Remove decl.
(excluded): New decl.
(add_exclude, add_exclude_file, check_exclude): Remove decls.
* src/list.c (read_and):
Use excluded_filename instead of check_exclude.
Check base name of incoming file name, not entire file name, when
deciding whether to exclude it.
* src/create.c (finish_sparse_file):
Use excluded_filename instead of check_exclude.
Don't bother to stat excluded file names.
* src/incremen.c (get_directory_contents): Likewise.
* src/names.c (exclude_pool, exclude_pool_size,
allocated_exclude_pool_size, simple_exclude_array,
simple_excludes, allocated_simple_excludes,
pattern_exclude_array, pattern_excludes,
allocated_pattern_excludes, add_exclude, add_exclude_file,
check_exclude):
Remove; now done in ../lib/exclude.c.
* src/tar.c (decode_options): Initialize `excluded'.
Use new add_exclude_file and add_exclude functions.
1999-07-05 Paul Eggert <eggert@twinsun.com>
* m4/gettext.m4: Use changequote rather than [[ ]].
* lib/safe-read.c: Renamed from lib/full-read.c.
(safe_read): Renamed from full_read. All uses changed.
* lib/safe-read.h, lib/full-write.h: New files.
* lib/Makefile.am (noinst_HEADERS): Add full-write.h, safe-read.h.
(libtar_a_SOURCES): Rename full-read.c to safe-read.c.
* lib/full-write.c: Include full-write.h.
* src/common.h: Include full-write.h, safe-read.h.
* src/system.h: (full_read, full_write): Remove decls.
* src/Makefile.am (datadir): New var; needed for Solaris gettext.
* src/system.h (bindtextdomain, textdomain): undef before
defining, to avoid preprocessor warnings with --disable-nls
on hosts whose locale.h includes libintl.h.
* lib/xstrtol.c (__strtol): Remove decl; it doesn't work if __strtol
expands to a macro, which occurs in HP-UX 10.20 with strtoumax.
(strtol, strtoul): New decls (for pre-ANSI hosts), to replace
the above decl.
1999-07-02 Paul Eggert <eggert@twinsun.com>
* Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/mktime.m4.
* m4/mktime.m4: New file.
* m4/Makefile.am.in, m4/README: Remove these files.
* m4/Makefile.am (EXTRA_DIST): Add mktime.m4;
remove README, Makefile.am.in.
(Makefile.am): Remove rule; it didn't work in BSD/OS 4.0.
* m4/jm-mktime.m4 (jm_FUNC_MKTIME): Invoke AC_FUNC_MKTIME,
not AM_FUNC_MKTIME.
* src/tar.c: Include signal.h.
(SIGCHLD): Define to SIGCLD if SIGCLD is defined but SIGCHLD is not.
(main): Ensure SIGCHLD is not ignored.
(BACKUP_OPTION, DELETE_OPTION, EXCLUDE_OPTION, GROUP_OPTION,
MODE_OPTION, NEWER_MTIME_OPTION, NO_RECURSE_OPTION, NULL_OPTION,
OWNER_OPTION, POSIX_OPTION, PRESERVE_OPTION, RECORD_SIZE_OPTION,
RSH_COMMAND_OPTION, SUFFIX_OPTION, USE_COMPRESS_PROGRAM_OPTION,
VOLNO_FILE_OPTION, OBSOLETE_ABSOLUTE_NAMES,
OBSOLETE_BLOCK_COMPRESS, OBSOLETE_BLOCKING_FACTOR,
OBSOLETE_BLOCK_NUMBER, OBSOLETE_READ_FULL_RECORDS, OBSOLETE_TOUCH,
OBSOLETE_VERSION_CONTROL): Make sure they can't be valid chars, so
they don't overlap with char codes. Use an enum instead of a lot
of #defines.
* src/system.h (ISASCII): Remove.
(CTYPE_DOMAIN, ISDIGIT, ISODIGIT, ISPRINT, ISSPACE, S_ISUID,
S_ISGID, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP,
S_IROTH, S_IWOTH, S_IXOTH, MODE_WXUSR, MODE_R, MODE_RW,
MODE_RWX, MODE_ALL, SEEK_SET, SEEK_CUR, SEEK_END, CHAR_MAX,
LONG_MAX): New macros.
* src/incremen.c (ISDIGIT, ISSPACE): Remove; now in system.h.
(read_directory_file): Cast ISSPACE arg to unsigned char.
* src/misc.c (ISPRINT): Remove; now in system.h.
(remove_any_file): Add brackets to pacify gcc -Wall.
* src/list.c: Don't include <ctype.h>; system.h already does this.
(ISODIGIT, ISSPACE): Remove; now in system.h.
(decode_header): No need to AND mode with 07777; MODE_FROM_OCT
does this now.
(from_oct): Cast ISSPACE arg to unsigned char.
* src/create.c (mode_to_oct): Translate modes from internal to
external form.
* src/list.c (mode_from_oct): Translate modes from external to
internal form. Do not complain about unrecognized mode bits.
* src/common.h (TSUID, TSGID, TSVTX, TUREAD, TUWRITE, TUEXEC,
TGREAD, TGWRITE, TGEXEC, TOREAD, TOWRITE, TOEXEC): Remove undefs.
* src/extract.c: (extr_init, make_directories, extract_archive):
Do not assume mode bits have traditional Unix values.
* src/list.c (decode_mode): Likewise.
* src/create.c (start_header, dump_file): Likewise.
* src/buffer.c (child_open_for_compress,
child_open_for_uncompress, open_archive, (close_archive): Likewise.
* src/compare.c (diff_archive): Likewise.
* src/extract.c (set_mode): Use %04 not %0.4 format.
(extract_sparse_file): Do not use data_block uninitialized.
Check for lseek failures.
* src/rtapelib.c (rmt_lseek__):
Convert lseek whence values to portable integers on the wire.
* src/rmt.c (main): Likewise. Check for whence values out of range.
* src/create.c (finish_sparse_file): Use lseek whence macros
instead of integers.
* src/buffer.c (backspace_output): Likewise.
* src/compare.c (diff_archive, verify_volume): Likewise.
* src/delete.c (move_archive): Likewise.
* src/extract.c (extract_sparse_file): Likewise.
* src/create.c (dump_file): Do not invoke finish_sparse_file
on a negative file descriptor.
* src/buffer.c: Add braces to pacify gcc -Wall.
* src/compare.c (diff_sparse_files): Report lseek errors.
* configure.in (ALL_LINGUAS): Add cs, es, ru.
* PORTS, TODO: gnu.ai.mit.edu -> gnu.org
* src/arith.c, src/buffer.c (new_volume): Don't put ^G in
message to be internationalized; \a doesn't work with msgfmt.
* src/tar.c (long_options, main, usage, OPTION_STRING):
Remove -E or --ending-file.
* src/list.c (read_and): Likewise.
* src/common.h (ending_file_option): Likewise.
* src/buffer.c (close_archive): Likewise.
* tests/after: Don't run two commands together in a pipeline,
as some old shells mishandle pipeline exit status.
1999-06-28 Paul Eggert <eggert@twinsun.com>
* configure.in (AM_INIT_AUTOMAKE): version 1.12.64015.
* NEWS: Describe changes since 1.12.
* README: Update bug reporting address; move paxutils ref to NEWS.
Handle EINTR correctly.
* lib/Makefile.am (libtar_a_SOURCES): Add full-read.c, full-write.c.
* lib/full-read.c, lib/full-write.c: New files.
* src/buffer.c (child_open_for_compress, child_open_for_uncompress):
Prefer full_read to read and full_write to write.
* src/compare.c (process_rawdata, diff_sparse_files): Likewise.
* src/create.c (deal_with_sparse, finish_sparse_file, dump_file):
Likewise.
* src/extract.c (extract_sparse_file): Likewise.
* src/rmt.c (get_string, main, report_error_message,
report_numbered_error): Likewise.
* src/rmt.h (rmtread, rmtwrite): Likewise.
* src/rtapelib.c (do_command, get_status_string, rmt_read__,
rmt_write__, rmt_ioctl__): Likewise.
* src/update.c (append_file): Likewise.
* src/system.h (full_read, full_write): New decls.
* po/POTFILES.in: Add lib/argmatch.c, lib/error.c lib/getopt.c,
lib/xmalloc.c, src/arith.c, src/misc.c.
* src/system.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO):
New macros. All uses of STDIN and STDOUT changed.
* src/rmt.c (prepare_record_buffer, main): Use STDIN_FILENO
instead of 0 and STDOUT_FILENO instead of 1.
* src/rtapelib.c (_rmt_rexec): Use STDIN_FILENO and STDOUT_FILENO
instead of fileno (stdin) and fileno (stdout) or 0 and 1.
* src/rmt.c (private_strerror): Avoid const. Translate results.
* tests/Makefile.am (TESTS): Remove incremen.sh; it doesn't work
in the presence of NFS clock skew.
1999-06-25 Paul Eggert <eggert@twinsun.com>
* configure.in (AM_INIT_AUTOMAKE): version 1.12.64014.
* src/buffer.c (write_archive_buffer): New function.
(child_open_for_compress, flush_write, flush_read): Use it to write
buffers.
(open_archive): Report error if fstat of archive fails.
Improve efficiency of check for /dev/null.
Also, fix some corner cases with remote archives and /dev/null checking.
(close_archive): Test for input fifo only if not remote.
Truncate output archive only if it's not remote.
* src/misc.c (remove_any_file):
Don't terminate if you see . or ..; just skip them.
1999-06-18 Paul Eggert <eggert@twinsun.com>
* configure.in (AM_INIT_AUTOMAKE): version 1.12.64013.
Output sizes using a format that's more compatible with
traditional tar (and with GNU Emacs).
* src/common.h (GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT,
MODE_TO_OCT, SIZE_TO_OCT, UID_TO_OCT, UINTMAX_TO_OCT):
Don't subtract 1 from size.
* src/create.c (to_oct): Prepend leading zeros, not spaces.
Output a trailing NUL unless the value won't fit without it.
(finish_header): No need to append NUL to chksum, now that
to_oct is doing it.
1999-06-16 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64012.
* src/Makefile.am (LDADD): Link libtar.a after @INTLLIBS@, since
@INTLLIBS@ might invoke rpl_realloc.
* src/tar.c (backup_type): Remove decl; backupfile.h now has it.
(intconv): Remove; use xstrto* fns instead.
("xstrtol.h"): Include.
(check_decimal): Remove.
(long_options, usage, OPTION_STRING, decode_options):
Remove -y, --bzip2, --unbzip2.
(decode_options): Use xget_version instead of get_version.
Check for overflow with -b and -L and RECORD_SIZE_OPTION.
Replace invocations of check_decimal with xstrtoumax.
* tests/preset.in (echo_n, echo_c): Remove.
* tests/after: Don't rely on $echo_c and $echo_n.
* lib/addext.c, lib/dirname.c, lib/lchown.c, lib/lchown.h,
lib/malloc.c, lib/mktime.c, lib/realloc.c, lib/strtol.c, lib/strtoul.c,
lib/strtoull.c, lib/strtoumax.c, lib/utime.c, lib/xstrtol.c,
lib/xstrtol.h, lib/xstrtoul.c, lib/xstrtoumax.c,
m4/Makefile.am.in, m4/README, m4/ccstdc.m4, m4/d-ino.m4,
m4/gettext.m4, m4/inttypes_h.m4, m4/isc-posix.m4,
m4/jm-mktime.m4, m4/largefile.m4, m4/lcmessage.m4,
m4/malloc.m4, m4/progtest.m4, m4/realloc.m4, m4/uintmax_t.m4,
m4/ulonglong.m4, m4/utimbuf.m4, m4/utime.m4, m4/utimes.m4,
m4/xstrtoumax.m4: New files.
* configure.in(fp_PROG_ECHO): Remove; no longer needed.
(AC_SYS_LARGEFILE): Renamed from AC_LFS.
(jm_AC_HEADER_INTTYPES_H): Replaces inline code.
(jm_STRUCT_DIRENT_D_INO, jm_AC_TYPE_UINTMAX_T, jm_AC_PREREQ_XSTRTOUMAX): Add.
(AC_CHECK_FUNCS): Remove lchown.
(AC_REPLACE_FUNCS): Remove basename, dirname.
Add lchown, strtol, strtoul.
(jm_FUNC_MKTIME): Add.
(LIBOBJS): Replace .o with $U.o, so that the .o files in LIBOBJS
are also built via the ANSI2KNR-filtering rules.
Use a no-op line to work around bug in automake 1.4 with malloc and
realloc.
(AC_OUTPUT): Add m4/Makefile.
* lib/Makefile.am (EXTRA_DIST):
Add lchown.c, malloc.c, mktime.c, realloc.c,
strtol.c, strtoul.c, strtoull.c, strtoumax.c, utime.c.
(noinst_HEADERS): Add lchown.h, modechange.h, xstrtol.h.
(libtar_a_SOURCES): Add addext.c, basename.c, xstrtol.c,
xstrtoul.c, xstrtoumax.c. Remove getversion.c.
($(srcdir)/getdate.c:): Remove `expect conflicts' line.
* src/system.h (uintmax_t): Don't declare; configure now does this.
* src/common.h (backup_type): New decl.
* src/common.h, src/misc.c, src/tar.c:
Move include of backupfile.h to common.h.
* src/misc.c (maybe_backup_file):
Pass backup_type to find_backup_file_name.
* src/list.c (print_header): Change sizes of uform and gform from 11 to
UINTMAX_STRSIZE_BOUND.
* doc/tar.texi: Remove --bzip2.
Fix @xref typos reported by latest makeinfo.
* Makefile.am (ACLOCAL_AMFLAGS): New macro.
(SUBDIRS): Add m4.
(M4DIR, ACINCLUDE_INPUTS): New macros.
($(srcdir)/acinclude.m4): New rule.
* acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT,
HAVE_INTTYPES_H, HAVE_LC_MESSAGES, HAVE_STPCPY): Remve #undefs;
now generated automatically by autoconf.
1999-05-15 Paul Eggert <eggert@twinsun.com>
* doc/tar.texi: Remove -y.
1999-04-09 Paul Eggert <eggert@twinsun.com>
* src/system.h (INT_STRLEN_BOUND): Fix off-by-factor-of-10 typo
(we were allocating too much storage).
(uintmax_t): Don't declare; configure now does this.
* ABOUT-NLS: Update to gettext 0.10.35 edition.
1999-03-22 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64010
* acinclude.m4 (AC_LFS_FLAGS):
Don't use -mabi=n32 with GCC on IRIX 6.2; it's the default.
(AC_LFS): -n32, -o32, and -n64 are CPPFLAGS, not CFLAGS.
(jm_FUNC_MALLOC, jm_FUNC_REALLOC): New macros.
* configure.in (jm_FUNC_MALLOC, jm_FUNC_REALLOC):
New macros; needed for latest GNU xmalloc.c.
* Makefile.am (noinst_HEADERS): Add quotearg.h, xalloc.h.
(libtar_a_SOURCES): Add quotearg.c.
* list.c: Include <quotearg.h>.
(from_oct): Add forward decl.
(read_header): Return HEADER_FAILURE if we can't parse the checksum.
(from_oct): Report an error only if TYPE is nonzero.
Quote any funny characters in bad header.
1999-03-20 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64009
* acinclude.m4 (AC_LFS_FLAGS): Add support for IRIX 6.2 and later.
(AC_LFS_SPACE_APPEND): Assume $2 is quoted properly; all callers
changed.
(AC_LFS): Simplify AIX revision number test.
1999-03-17 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64008
* configure.in (AC_VALIDATE_CACHED_SYSTEM_TUPLE):
Remove; it doesn't work that well
with AC_CANONICAL_HOST.
(fp_WITH_INCLUDED_MALLOC): Remove; we'll just use the system malloc.
* Makefile.am (EXTRA_DIST): Remove AC-PATCHES, AM-PATCHES, BI-PATCHES.
* Makefile.am (EXTRA_DIST): Remove gmalloc.c.
* acinclude.m4 (fp_WITH_INCLUDED_MALLOC): Remove.
* tar.texi: Fix bug-report addr.
* README: Remove --with-included-malloc.
Upgrade version numbers of build software.
1999-03-07 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64007.
* acinclude.m4 (AM_WITH_NLS): Port to Solaris 2.5.1,
where bindtextdomain and gettext require -lintl.
(AC_LFS_FLAGS): Simplify so that it only gets the flags;
`no' means it failed.
(AC_LFS_SPACE_APPEND, AC_LFS_MACRO_VALUE): New macros.
(AC_LFS): Use them. Set _FILE_OFFSET_BITS, _LARGEFILE_SOURCE, and
_LARGE_FILES from LFS_CFLAGS, so that in the normal case we don't need
to add anything to the command line (it's all in config.h).
Put any extra -D and -I options into CPPFLAGS, the rest into CFLAGS.
1999-03-01 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64006.
* acinclude.m4 (AC_LFS_FLAGS): Port to AIX 4.2.
* src/list.c: (gid_from_oct, major_from_oct, minor_from_oct,
mode_from_oct, off_from_oct, size_from_oct, time_from_oct,
uid_from_oct, uintmax_from_oct): Use TYPE_MAXIMUM instead of macros
like OFF_MAX, which are not reliable
(e.g. OFF_MAX in AIX 4.2 is incorrect).
* src/system.h (GID_MAX, MAJOR_MAX, MINOR_MAX, MODE_MAX, OFF_MAX,
SIZE_MAX, TIME_MAX,UID_MAX, UINTMAX_MAX): Remove; no longer used.
* src/incremen.c (get_directory_contents):
Don't use statx if _LARGE_FILES; it doesn't work under AIX 4.2.
Have statx depend on STX_HIDDEN, not AIX.
* src/create.c (to_oct):
New parameter substitute, giving a substitute value to use
when the original value is out of range. Do not append a space to the
output; modern tars don't. When a value is out of range, specify the
maximum value, not the number of bits.
(GID_NOBODY, UID_NOBODY): New macros.
(gid_to_oct, uid_to_oct): Use them as substitutes.
(finish_header): Do not assume that UINTMAX_TO_OCT appends a space.
(dump_file): Check whether the file changed as we read it.
* src/rmt.c (main): Remove suspicious AIX/386 code.
1999-02-19 Paul Eggert <eggert@twinsun.com>
* intl/localealias.c (read_alias_file): Don't assume that memcpy
returns a type compatible with char *; it doesn't on SunOS
4.1.4 with Sun cc, since <string.h> doesn't declare memcpy.
* NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64005.
* src/tar.c (long_options, usage): Prefer --unbzip2 to --bunzip2.
* doc/tar.texi: Add --bzip2, --unbzip2 options.
* configure.in (AC_CANONICAL_HOST, AC_VALIDATE_CACHED_SYSTEM_TUPLE):
Add.
(AC_LINK_FILES): Omit; AM_GNU_GETTEXT now does this.
(AC_OUTPUT): Omit munging of po/Makefile; AM_GNU_GETTEXT now does this.
* acinclude.m4 (AM_WITH_NLS):
Update to latest gettext version (serial 5).
(AC_LFS_FLAGS): New macro
(AC_LFS): Use it. Append to CFLAGS, LDFLAGS, LDLIBS instead of
working only with unset variables. Append to CFLAGS, not CPPFLAGS.
Work properly in cross-compilation scenario, by checking for getconf
with AC_CHECK_TOOL and by ditching uname in favor of
AC_CANONICAL_HOST and $host_os. Add --disable-lfs option.
* lib/getdate.y: Update to fileutils 4.0 getdate.y, with one patch:
replace FORCE_ALLOCA_H with HAVE_ALLOCA_H.
* lib/Makefile.am (AUTOMAKE_OPTIONS): Append ../src/ansi2knr,
since getdate.y now uses ANSI code.
* config.guess, config.sub: New files; taken from automake 1.4.
* intl/Makefile.in, intl/VERSION, intl/bindtextdom.c,
intl/cat-compat.c, intl/dcgettext.c, intl/dgettext.c,
intl/explodename.c, intl/finddomain.c, intl/gettext.c,
intl/gettext.h, intl/gettextP.h, intl/hash-string.h,
intl/l10nflist.c, intl/libgettext.h, intl/loadinfo.h,
intl/loadmsgcat.c, intl/localealias.c, intl/textdomain.c:
Update to GNU gettext 0.10.35, with patches as per GCC snapshot 990109.
1999-02-01 Paul Eggert <eggert@twinsun.com>
* src/tar.c: Update copyright.
* NEWS: 1.12.64004
1999-02-01 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in: Version 1.12.64004
* configure.in (AC_LFS): Use this macro, instead of open-coding it.
* acinclude.m4 (AC_LFS, AM_PROG_CC_STDC): New macros.
* src/extract.c (extract_archive): Fix bug when extracting sparse
files: they were trashing the tar file header.
* src/tar.c: (long_options, usage, OPTION_STRING, decode_options):
Add -y or --bzip2 or --bunzip2 option.
1999-01-30 Paul Eggert <eggert@twinsun.com>
* src/names.c (cached_no_such_uname, cached_no_such_gname,
cached_no_such_uid, cached_no_such_gid): New vars.
(uid_to_uname, gid_to_gname, uname_to_uid, gname_to_gid):
Cache failures, too.
* src/tar.c (decode_options):
Don't pass names longer than UNAME_FIELD_SIZE to
uname_to_uid, as it messes up the cache. Similarly for gname_to_uid.
1999-01-27 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in: Version 1.12.64003
* src/buffer.c (backspace_output, close_archive): Cast
rmtlseek position arg to off_t, for benefit of K&R compilers
with long long.
* src/compare.c (verify_volume): Likewise.
* NEWS, configure.in: Version 1.12.64002
* src/create.c (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct,
off_to_oct, size_to_oct, time_to_oct, uid_to_oct):
Cast arg to uintmax_t for benefit of pre-ANSI compilers with long long.
* src/list.c: (gid_from_oct, major_from_oct, minor_from_oct,
mode_from_oct, off_from_oct, size_from_oct, time_from_oct,
uid_from_oct): Likewise.
1999-01-25 Paul Eggert <eggert@twinsun.com>
* incremen.sh: Fix timing bug in regression test.
1999-01-22 Paul Eggert <eggert@twinsun.com>
* NEWS, configure.in: Update version
* Makefile.am (localedir): Change to $(datadir)/locale.
(DEFS): New macro, defining LOCALEDIR.
(tar.o, tar._o, rmt.o, rmt._o): Remove.
(INCLUDES): Add -I..
* Makefile.am (localedir): Change to $(datadir)/locale.
1999-01-21 Paul Eggert <eggert@twinsun.com>
* NEWS, README, configure.in: Unofficial version 1.12.64001.
* tests/Makefile.am (localedir): Change to $(datadir)/locale.
* src/Makefile.am (localedir): Likewise.
(DEFS): New macro, defining LOCALEDIR.
(tar.o, tar._o, rmt.o, rmt._o): Remove.
(INCLUDES): Add `-I..'.
* tests/incremen.sh: Fix timing bug.
1999-01-20 Paul Eggert <eggert@twinsun.com>
* NEWS, README, configure.in: Unofficial version 1.12.64000.
`lfs.7' changed to `64000' in version number
to conform to gnits standards.
* COPYING, INSTALL, doc/texinfo.tex, install-sh, missing,
mkinstalldirs, ansi2knr.c: Update to latest public versions.
Rebuild with automake 1.4 and autoconf 2.13, to work around some
porting problems.
1998-12-07 Paul Eggert <eggert@twinsun.com>
* NEWS, README, configure.in: Unofficial version 1.12.lfs.6.
* src/list.c (read_header):
Accept file names as specified by POSIX.1-1996 section 10.1.1.
1998-11-30 Paul Eggert <eggert@twinsun.com>
* configure.in: Quote the output of uname.
* src/extract.c (set_stat): chmod after chown even when not root;
if we are using --same-owner this is needed e.g. on Solaris 2.5.1.
1998-11-15 Paul Eggert <eggert@twinsun.com>
* NEWS, README, configure.in: Unofficial version 1.12.lfs.5.
* configure.in (ac_test_CPPFLAGS, ac_test_LDFLAGS, ac_test_LIBS,
ac_getconfs, ac_result): Special case for HP-UX 10.20 or later.
1998-10-28 Paul Eggert <eggert@twinsun.com>
* NEWS, README, configure.in: Unofficial version 1.12.lfs.4.
* src/system.h (voidstar): Use void * if __STDC__ is defined,
not merely nonzero.
* src/rtapelib.c: Don't use rexec code unless compiled with WITH_REXEC.
On many installations, rexec is disabled.
1998-08-07 Paul Eggert <eggert@twinsun.com>
* NEWS, README, configure.in: Unofficial version 1.12.lfs.3.
* src/names.c (uid_to_uname, gid_to_gname): Don't used cached name
for nameless users and groups.
1998-02-17 Paul Eggert <eggert@twinsun.com>
* NEWS, README, configure.in: Unofficial version 1.12.lfs.2.
* NEWS, README: Add explanation of why this isn't an official version.
1998-02-02 Paul Eggert <eggert@twinsun.com>
* NEWS, README, configure.in: Unofficial version 1.12.lfs.1.
This is an unofficial version.
1997-12-17 Paul Eggert <eggert@twinsun.com>
* src/incremen.c (ST_DEV_MSB): New macro.
(NFS_FILE_STAT): Use most significant bit of st_dev,
even if it's unsigned.
1997-12-08 Paul Eggert <eggert@twinsun.com>
* src/system.h (ST_NBLOCKS): Fix typo in definition.
1997-11-19 Paul Eggert <eggert@twinsun.com>
* configure.in (HAVE_INTTYPES_H):
Don't ignore cache variable if it's already set.
1997-11-10 Paul Eggert <eggert@twinsun.com>
* src/rmt.c (main): Don't assume mt_count is of type daddr_t.
* src/delete.c (records_read): Now off_t.
(move_archive): Don't assume mt_count is of type daddr_t.
1997-10-30 Paul Eggert <eggert@twinsun.com>
* configure.in (CPPFLAGS, LDFLAGS, LIBS):
Set to appropriate values if large file support
needs explicit enabling.
(HAVE_INTTYPES_H, HAVE_ST_FSTYPE_STRING, daddr_t, major_t, minor_t,
ssize_t):
New macros to configure.
(AC_TYPE_MODE_T, AC_TYPE_PID_T, AC_TYPE_OFF_T): Add.
* acconfig.h (daddr_t, HAVE_INTTYPES_H, HAVE_ST_FSTYPE_STRING,
major_t, minor_t, ssize_t): New macros.
* src/arith.h (TARLONG_FORMAT):
Fix typo: %uld -> %lu. Use unsigned when long long
(%lld -> %llu).
(add_to_tarlong_helper, mult_tarlong_helper): 2nd arg is now unsigned long.
(add_to_tarlong, mult_tarlong): Cast 2nd arg to unsigned long.
* src/arith.c (add_to_tarlong_helper, mult_tarlong_helper):
2nd arg is now unsigned long.
* src/rmt.c (allocated_size): Now size_t, and now initialized to 0.
(prepare_record_buffer): Arg is now size_t.
Remove now-useless casts.
(main): Use `long' for status, so that it can store ssize_t.
Use daddr_t, mode_t, size_t, off_t when appropriate.
Convert daddr_t and off_t values ourselves, since they might be longer
than long. Convert other types using `long' primitives.
When processing MTIOCTOP, do not try to pass resulting
count back, since it won't work (it could be too large) and it's
not expected anyway.
* src/update.c:
(append_file) Use off_t, size_t, ssize_t when appropriate. Remove
now-useless casts. Use unsigned long to print *_t types, except use
STRINGIFY_BIGINT for off_t.
(update_archive): Cast -1 to dev_t when necessary.
* src/tar.c (check_decimal):
Now returns 1 if successful, 0 otherwise, and returns
uintmax_t value into new arg. Check for arithmetic overflow.
(decode_options): Avoid overflow if record_size fits in size_t but not int.
Check for overflow on user or group ids.
* src/compare.c (diff_init, process_rawdata, read_and_process,
diff_sparse_files, diff_archive):
Use off_t, pid_t, size_t, ssize_t when appropriate.
Remove now-useless casts. Use unsigned long to print *_t types,
except use STRINGIFY_BIGINT for off_t.
(process_noop, process_rawdata, process_dumpdir, read_and_process):
Size arg is now size_t.
(diff_sparse_files): Arg is now off_t. Check for size_t overflow
when allocating buffer.
* src/rtapelib.c:
(do_command, rmt_open__, rmt_read__, rmt_lseek__, rmt_ioctl__):
Use pid_t, size_t, ssize_t when appropriate. Remove now-useless casts.
Use unsigned long to print *_t types, except use STRINGIFY_BIGINT for
off_t.
(get_status_string, get_status_off): New function.
(get_status): Now returns long, so that it can store ssize_t.
Invoke get_status_string to do the real work.
(rmt_read__, rmt_write__): Now returns ssize_t. Size arg is now size_t.
(rmt_lseek__): Now returns off_t, using new get_status_off function.
(rmt_ioctl__): Convert mt_count by hand,
since it might be longer than long.
* src/mangle.c (extract_mangle):
Check for overflow when converting off_t to size_t.
Use off_t, size_t when appropriate. Remove now-useless casts.
* src/system.h (mode_t): Remove; now done by autoconf.
(ST_NBLOCKS): Do not overflow if st_size is near maximum.
Return number of ST_NBLOCKSIZE-byte blocks,
not number of 512-byte blocks;
this also helps to avoid overflow.
(st_blocks): Declare if needed.
(ST_NBLOCKSIZE): New macro.
(<limits.h>, <inttypes.h>): Include if available.
(CHAR_BIT): New macro.
(uintmax_t): New typedef.
(TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_STRLEN_BOUND,
UINTMAX_STRSIZE_BOUND, GID_MAX, MAJOR_MAX, MINOR_MAX, MODE_MAX,
OFF_MAX, SIZE_MAX, TIME_MAX, UID_MAX, UINTMAX_MAX): New macros.
* src/names.c (name_init):
Fix typo in error message: FILE* was passed, but char*
was wanted.
(read_name_from_file, name_gather, addname, name_match, name_scan,
add_exclude): Use size_t when appropriate. Remove now-useless casts.
(exclude_pool_size, allocated_exclude_pool_size): Now size_t.
* src/extract.c (newdir_umask, current_umask): Now mode_t.
(extract_sparse_file): Args now use off_t.
(set_mode, set_stat, make_directories, extract_sparse_file,
extract_archive): Use off_t, size_t, ssize_t when appropriate. Remove
now-useless casts. Use unsigned long to print *_t types, except use
STRINGIFY_BIGINT for off_t.
* src/misc.c (quote_copy_string):
Use size_t when appropriate. Remove now-useless casts.
* src/list.c (read_and, list_archive, read_header, decode_mode,
print_header, print_for_mkdir):
Use mode_t, off_t, size_t when appropriate. Remove
now-useless casts. Use unsigned long to print *_t types, except use
STRINGIFY_BIGINT for off_t.
(read_header): Check for overflow when converting header size.
(from_oct): Now static. Now returns uintmax_t. `where' arg is now
const char *. Size arg is now size_t. Now takes new type and maxval
args. Compute result using uintmax_t, not long. Report error if
field does not contain octal number in range.
(gid_from_oct, major_from_oct, minor_from_oct, mode_from_oct,
off_from_oct, size_from_oct, time_from_oct, uid_from_oct,
uintmax_from_oct): New functions.
(stringify_uintmax_t_backwards): New function.
(decode_mode, print_for_mkdir): Mode arg is now mode_t.
(skip_file): Offset arg is now off_t.
* src/buffer.c (record_start_block, save_totsize, save_sizeleft,
real_s_totsize, real_s_sizeleft, current_block_ordinal):
Now off_t.
(write_error): Arg is now ssize_t.
(child_pid): Now pid_t.
(available_space_after): Now size_t.
(child_open_for_compress, child_open_for_uncompress, flush_write,
open_archive, flush_write, write_error, flush_read, close_archive):
Use pid_t, ssize_t, size_t when appropriate. Remove now-useless
casts. Use unsigned long to print *_t types, except use
STRINGIFY_BIGINT for off_t.
* src/delete.c (records_read): Now daddr_t.
(move_archive): Arg is now daddr_t. Check for overflow when
computing offset.
(move_archive, delete_archive_members): Use daddr_t, off_t when
appropriate. Remove now-useless casts.
* src/rmt.h (rmt_read__, rmt_write__): Now returns ssize_t.
(rmt_lseek): Now returns off_t.
* src/create.c (to_oct):
Now static. Value arg is now uintmax_t. Accept new args
giving name of type of octal field, for error messages. Report an
error if the value is too large to fit in the field.
(gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct): New functions.
(write_eot, write_long, finish_header, deal_with_sparse,
finish_sparse_file, dump_file): Use dev_t, off_t, ssize_t, size_t when
appropriate. Remove now-useless casts. Use unsigned long to print
*_t types, except use STRINGIFY_BIGINT for off_t.
(find_new_file_size): 1st arg is now off_t*.
(finish_sparse_file): Args now use off_t, not long.
Check for lseek error.
(create_archive, dump_file): Cast -1 to dev_t when necessary.
(dump_file): Device arg is now dev_t.
Avoid overflow when testing whether file has holes
by using the new ST_NBLOCKSIZE macro.
* src/incremen.c (struct accumulator, add_to_accumulator,
get_directory_contents, add_hierarchy_to_namelist, gnu_restore):
Use size_t for sizes.
(struct directory, get_directory_contents, add_hierarchy_to_namelist):
Use dev_t, ino_t for devices and inodes.
(gnu_restore): Use off_t for file offsets.
(struct directory): Use char for flags. Add new flag `nfs'.
(nfs): New constant
(NFS_FILE_STAT): New macro.
(note_directory): Accept struct stat * instead of
device and inode number. All callers changed.
(note_directory, get_directory_contents):
Use NFS_FILE_STAT to determine whether directory is an NFS directory.
(write_dir_file): Cast time_t to unsigned long before printing as %lu.
* src/common.h (record_size, struct name, struct sp_array,
available_space_after):
Use size_t for sizes.
(save_sizeleft, save_totsize, current_block_ordinal, skip_file):
Use off_t for file offsets.
(struct name): dir_contents is now const char *, not char *.
(dump_file, get_directory_contents): Use dev_t for devices.
(to_oct): Remove decl.
(GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT, MODE_TO_OCT, SIZE_TO_OCT,
UID_TO_OCT, UINTMAX_TO_OCT, OFF_TO_OCT, TIME_TO_OCT, STRINGIFY_BIGINT,
GID_FROM_OCT, MAJOR_FROM_OCT, MINOR_FROM_OCT, MODE_FROM_OCT,
OFF_FROM_OCT, SIZE_FROM_OCT, TIME_FROM_OCT, UID_FROM_OCT,
UINTMAX_FROM_OCT): New macros.
(gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct,
stringify_uintmax_t_backwards, gid_from_oct, major_from_oct,
minor_from_oct, mode_from_oct, off_from_oct, size_from_oct,
time_from_oct, uid_from_oct, uintmax_from_oct): New decls.
(print_for_mkdir): 2nd arg is now mode_t.
See ChangeLog.1 for earlier changes.
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004 Free Software
Foundation, Inc.
This file is part of GNU tar.
GNU tar is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU tar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU tar; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
|