Fix build with libc++ by doing the sorting explicitly. Bump revision.diff -r1.43 -r1.44 pkgsrc/archivers/dar/Makefile
(joerg)
@@ -1,16 +1,17 @@ | @@ -1,16 +1,17 @@ | |||
1 | # $NetBSD: Makefile,v 1.43 2013/06/28 15:03:55 ryoon Exp $ | 1 | # $NetBSD: Makefile,v 1.44 2014/01/20 19:29:34 joerg Exp $ | |
2 | 2 | |||
3 | DISTNAME= dar-2.4.10 | 3 | DISTNAME= dar-2.4.10 | |
4 | PKGREVISION= 1 | |||
4 | CATEGORIES= archivers sysutils | 5 | CATEGORIES= archivers sysutils | |
5 | MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=dar/} | 6 | MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=dar/} | |
6 | 7 | |||
7 | MAINTAINER= pkgsrc-users@NetBSD.org | 8 | MAINTAINER= pkgsrc-users@NetBSD.org | |
8 | HOMEPAGE= http://dar.linux.free.fr/ | 9 | HOMEPAGE= http://dar.linux.free.fr/ | |
9 | COMMENT= Disk archiver | 10 | COMMENT= Disk archiver | |
10 | LICENSE= gnu-gpl-v2 | 11 | LICENSE= gnu-gpl-v2 | |
11 | 12 | |||
12 | PKG_INSTALLATION_TYPES= overwrite pkgviews | 13 | PKG_INSTALLATION_TYPES= overwrite pkgviews | |
13 | 14 | |||
14 | USE_LANGUAGES= c c++ | 15 | USE_LANGUAGES= c c++ | |
15 | USE_LIBTOOL= yes | 16 | USE_LIBTOOL= yes | |
16 | USE_PKGLOCALEDIR= yes | 17 | USE_PKGLOCALEDIR= yes |
@@ -1,27 +1,28 @@ | @@ -1,27 +1,28 @@ | |||
1 | $NetBSD: distinfo,v 1.28 2013/06/28 15:03:55 ryoon Exp $ | 1 | $NetBSD: distinfo,v 1.29 2014/01/20 19:29:34 joerg Exp $ | |
2 | 2 | |||
3 | SHA1 (dar-2.4.10.tar.gz) = bf02ba10bfcd2ad959017706f167fc390aafe932 | 3 | SHA1 (dar-2.4.10.tar.gz) = bf02ba10bfcd2ad959017706f167fc390aafe932 | |
4 | RMD160 (dar-2.4.10.tar.gz) = 26161a09a60e36a3094f94d8831a157b7c3e4d0a | 4 | RMD160 (dar-2.4.10.tar.gz) = 26161a09a60e36a3094f94d8831a157b7c3e4d0a | |
5 | Size (dar-2.4.10.tar.gz) = 1760827 bytes | 5 | Size (dar-2.4.10.tar.gz) = 1760827 bytes | |
6 | SHA1 (patch-aa) = 734ec162dbc339b2015a169bb9fe723e45d0a29b | 6 | SHA1 (patch-aa) = 734ec162dbc339b2015a169bb9fe723e45d0a29b | |
7 | SHA1 (patch-ab) = f07d55861f21545b0ae8ac6b187a94526e44e345 | 7 | SHA1 (patch-ab) = f07d55861f21545b0ae8ac6b187a94526e44e345 | |
8 | SHA1 (patch-ac) = dcbf4e31071c83a167a60a20e4980b35f055a46e | 8 | SHA1 (patch-ac) = dcbf4e31071c83a167a60a20e4980b35f055a46e | |
9 | SHA1 (patch-ad) = df21f72b12ab19123f1c61e8e1645519c43d7f7b | 9 | SHA1 (patch-ad) = e32c33d5670f39a04f8ceef94d6e9d5a6b524016 | |
10 | SHA1 (patch-ae) = 54220384bf2031df64c38f5abea038382ca37e8e | 10 | SHA1 (patch-ae) = 54220384bf2031df64c38f5abea038382ca37e8e | |
11 | SHA1 (patch-af) = 414e58277c946b59f57352e260ac5d49673ef008 | 11 | SHA1 (patch-af) = 414e58277c946b59f57352e260ac5d49673ef008 | |
12 | SHA1 (patch-src_dar__suite_command__line.cpp) = 63d3004bf7d49277c1508fe5d9ac52ec0d5bf11f | 12 | SHA1 (patch-src_dar__suite_command__line.cpp) = 63d3004bf7d49277c1508fe5d9ac52ec0d5bf11f | |
13 | SHA1 (patch-src_dar__suite_crit__action__cmd__line.cpp) = bc9484e836fbde98f682f6031aaadd99cc8eb479 | 13 | SHA1 (patch-src_dar__suite_crit__action__cmd__line.cpp) = bc9484e836fbde98f682f6031aaadd99cc8eb479 | |
14 | SHA1 (patch-src_dar__suite_dar__manager.cpp) = 2ed9008b5e7629ef8e279b7d1218a4fae5101df1 | 14 | SHA1 (patch-src_dar__suite_dar__manager.cpp) = 2ed9008b5e7629ef8e279b7d1218a4fae5101df1 | |
15 | SHA1 (patch-src_dar__suite_dar__xform.cpp) = 929e7cbb933a8d58bd1b79ecb50404f5dbbfddfe | 15 | SHA1 (patch-src_dar__suite_dar__xform.cpp) = 929e7cbb933a8d58bd1b79ecb50404f5dbbfddfe | |
16 | SHA1 (patch-src_dar__suite_line__tools.cpp) = 076c5213aaa3e6dfa471322b6597c0ce8ccfd2a8 | 16 | SHA1 (patch-src_dar__suite_line__tools.cpp) = 076c5213aaa3e6dfa471322b6597c0ce8ccfd2a8 | |
17 | SHA1 (patch-src_examples_factoriel.cpp) = 6c9e038b7a3bbfdc96dbbdf1b7e100c159353f87 | 17 | SHA1 (patch-src_examples_factoriel.cpp) = 6c9e038b7a3bbfdc96dbbdf1b7e100c159353f87 | |
18 | SHA1 (patch-src_examples_formula.cpp) = 583ceeba0a232e657ab0696711f630476ec2e495 | 18 | SHA1 (patch-src_examples_formula.cpp) = 583ceeba0a232e657ab0696711f630476ec2e495 | |
19 | SHA1 (patch-src_examples_prime.cpp) = 09fc3b96642945042a2d13bb4c1995546cdb7607 | 19 | SHA1 (patch-src_examples_prime.cpp) = 09fc3b96642945042a2d13bb4c1995546cdb7607 | |
20 | SHA1 (patch-src_libdar_mask__list.hpp) = b16686706cb7ad7065467decfd93271f01d9c663 | 20 | SHA1 (patch-src_libdar_mask__list.hpp) = b3b6eaa36875784432e53d5dfbfb33d7623054a3 | |
21 | SHA1 (patch-src_libdar_secu__string.hpp) = 6793cb79bf5f8c4d3ac83ba4f2cd2fd9f452afb1 | 21 | SHA1 (patch-src_libdar_secu__string.hpp) = 6793cb79bf5f8c4d3ac83ba4f2cd2fd9f452afb1 | |
22 | SHA1 (patch-src_testing_Makefile.in) = e8d48b5fa9fcdd2f5bef3fca240850c0787f6647 | |||
22 | SHA1 (patch-src_testing_test__catalogue.cpp) = 2d1a8299f01776e3fa9996819aa8be523b73b4cc | 23 | SHA1 (patch-src_testing_test__catalogue.cpp) = 2d1a8299f01776e3fa9996819aa8be523b73b4cc | |
23 | SHA1 (patch-src_testing_test__deci.cpp) = 053e2123a5219dc0cb827743e348f9463ce84615 | 24 | SHA1 (patch-src_testing_test__deci.cpp) = 053e2123a5219dc0cb827743e348f9463ce84615 | |
24 | SHA1 (patch-src_testing_test__escape.cpp) = b7959b2e5e3675d2e64f232face3b18384f8e3da | 25 | SHA1 (patch-src_testing_test__escape.cpp) = b7959b2e5e3675d2e64f232face3b18384f8e3da | |
25 | SHA1 (patch-src_testing_test__infinint.cpp) = 5ee29a1881b05881bb334f1cd7bfd30ea21baf7f | 26 | SHA1 (patch-src_testing_test__infinint.cpp) = 5ee29a1881b05881bb334f1cd7bfd30ea21baf7f | |
26 | SHA1 (patch-src_testing_test__terminateur.cpp) = 79d4efadfc4528d6def28985228a0d25d1fc6e78 | 27 | SHA1 (patch-src_testing_test__terminateur.cpp) = 79d4efadfc4528d6def28985228a0d25d1fc6e78 | |
27 | SHA1 (patch-src_testing_testtools.cpp) = 4cdd4a6fde69f40463464f6ead1d208a685a516b | 28 | SHA1 (patch-src_testing_testtools.cpp) = 4cdd4a6fde69f40463464f6ead1d208a685a516b |
@@ -1,18 +1,134 @@ | @@ -1,18 +1,134 @@ | |||
1 | $NetBSD: patch-ad,v 1.6 2011/08/20 16:02:23 cheusov Exp $ | 1 | $NetBSD: patch-ad,v 1.7 2014/01/20 19:29:34 joerg Exp $ | |
2 | 2 | |||
3 | On Solaris 10 with SunPro, vector<> does not have a method assign(). | 3 | On Solaris 10 with SunPro, vector<> does not have a method assign(). | |
4 | 4 | |||
5 | --- src/libdar/mask_list.cpp.orig 2011-02-11 20:23:42.000000000 +0000 | 5 | --- src/libdar/mask_list.cpp.orig 2011-02-11 20:23:42.000000000 +0000 | |
6 | +++ src/libdar/mask_list.cpp | 6 | +++ src/libdar/mask_list.cpp | |
7 | @@ -200,7 +200,10 @@ namespace libdar | 7 | @@ -55,6 +55,21 @@ using namespace std; | |
8 | my_tmp.unique(); // remove duplicates | 8 | namespace libdar | |
9 | { | |||
10 | ||||
11 | +static bool cmp_strings(const std::string &x, const std::string &y) | |||
12 | +{ | |||
13 | + size_t i; | |||
14 | + for (i = 0; i < x.size(); ++i) { | |||
15 | + if (x[i] == y[i]) | |||
16 | + continue; | |||
17 | + if(x[i] == '/') | |||
18 | + return true; | |||
19 | + if(y[i] == '/') | |||
20 | + return false; | |||
21 | + return x[i] < y[i]; | |||
22 | + } | |||
23 | + return false; | |||
24 | +} | |||
25 | + | |||
26 | mask_list::mask_list(const string & filename_list_st, bool case_sensit, const path & prefix_t, bool include) | |||
27 | { | |||
28 | NLS_SWAP_IN; | |||
29 | @@ -194,12 +209,14 @@ namespace libdar | |||
30 | ||||
31 | // we use a temporary list of string of my_chart to use | |||
32 | // the lexicographic sorting with having the / as the lowest character | |||
33 | - list<basic_string<my_char> > my_tmp = convert_list_string_char(tmp); | |||
34 | - my_tmp.sort(); // sort the list ( using the string's < operator over "my_char" ) | |||
35 | - my_tmp.unique(); // remove duplicates | |||
36 | + tmp.sort(cmp_strings); | |||
37 | + tmp.unique(); | |||
9 | 38 | |||
10 | // converting the sorted list to vector, to get the indexing feature of this type | 39 | // converting the sorted list to vector, to get the indexing feature of this type | |
11 | - contenu.assign(my_tmp.begin(), my_tmp.end()); | 40 | - contenu.assign(my_tmp.begin(), my_tmp.end()); | |
12 | + contenu.clear(); | 41 | + contenu.clear(); | |
13 | + for (list< basic_string<my_char> >::const_iterator it = my_tmp.begin(); it != my_tmp.end(); it++) | 42 | + for (list< string >::const_iterator it = tmp.begin(); it != tmp.end(); it++) | |
14 | + contenu.push_back(*it); | 43 | + contenu.push_back(*it); | |
15 | + | 44 | + | |
16 | taille = contenu.size(); | 45 | taille = contenu.size(); | |
17 | if(taille < contenu.size()) | 46 | if(taille < contenu.size()) | |
18 | throw Erange("mask_list::mask_list", tools_printf(gettext("Too much line in file %S (integer overflow)"), &filename_list_st)); | 47 | throw Erange("mask_list::mask_list", tools_printf(gettext("Too much line in file %S (integer overflow)"), &filename_list_st)); | |
48 | @@ -218,23 +235,23 @@ namespace libdar | |||
49 | return false; | |||
50 | ||||
51 | U_I min = 0, max = taille-1, tmp; | |||
52 | - basic_string<my_char> target; | |||
53 | + string target; | |||
54 | bool ret; | |||
55 | ||||
56 | if(case_s) | |||
57 | - target = convert_string_char(expression); | |||
58 | + target = expression; | |||
59 | else | |||
60 | { | |||
61 | string hidden = expression; | |||
62 | tools_to_upper(hidden); | |||
63 | - target = convert_string_char(hidden); | |||
64 | + target = hidden; | |||
65 | } | |||
66 | ||||
67 | // divide & conquer algorithm on a sorted list (aka binary search) | |||
68 | while(max - min > 1) | |||
69 | { | |||
70 | tmp = (min + max)/2; | |||
71 | - if(contenu[tmp] < target) | |||
72 | + if(cmp_strings(contenu[tmp], target)) | |||
73 | min = tmp; | |||
74 | else | |||
75 | if(contenu[tmp] == target) | |||
76 | @@ -246,57 +263,11 @@ namespace libdar | |||
77 | ret = contenu[max] == target || contenu[min] == target; | |||
78 | if(including && !ret) // if including files, we must also include directories leading to a listed file | |||
79 | { | |||
80 | - string c_max = convert_string_my_char(contenu[max]); | |||
81 | + string c_max = contenu[max]; | |||
82 | ret = path(c_max).is_subdir_of(expression, case_s); | |||
83 | } | |||
84 | ||||
85 | return ret; | |||
86 | } | |||
87 | ||||
88 | - | |||
89 | - //////// private routines implementation | |||
90 | - | |||
91 | - | |||
92 | - list<basic_string<mask_list::my_char> > mask_list::convert_list_string_char(const list<string> & src) | |||
93 | - { | |||
94 | - list<basic_string<my_char> > ret; | |||
95 | - list<string>::const_iterator it = src.begin(); | |||
96 | - | |||
97 | - while(it != src.end()) | |||
98 | - { | |||
99 | - ret.push_back(convert_string_char(*it)); | |||
100 | - ++it; | |||
101 | - } | |||
102 | - return ret; | |||
103 | - } | |||
104 | - | |||
105 | - basic_string<mask_list::my_char> mask_list::convert_string_char(const string & src) | |||
106 | - { | |||
107 | - basic_string<my_char> ret; | |||
108 | - | |||
109 | - string::const_iterator ut = src.begin(); | |||
110 | - while(ut != src.end()) | |||
111 | - { | |||
112 | - ret += my_char(*ut); | |||
113 | - ++ut; | |||
114 | - } | |||
115 | - | |||
116 | - return ret; | |||
117 | - } | |||
118 | - | |||
119 | - string mask_list::convert_string_my_char(const basic_string<mask_list::my_char> & src) | |||
120 | - { | |||
121 | - string ret; | |||
122 | - | |||
123 | - basic_string<my_char>::const_iterator ut = src.begin(); | |||
124 | - while(ut != src.end()) | |||
125 | - { | |||
126 | - ret += char(*ut); | |||
127 | - ++ut; | |||
128 | - } | |||
129 | - | |||
130 | - return ret; | |||
131 | - } | |||
132 | - | |||
133 | - | |||
134 | } // end of namespace |
@@ -1,13 +1,52 @@ | @@ -1,13 +1,52 @@ | |||
1 | $NetBSD: patch-src_libdar_mask__list.hpp,v 1.1 2013/06/26 15:49:31 joerg Exp $ | 1 | $NetBSD: patch-src_libdar_mask__list.hpp,v 1.2 2014/01/20 19:29:34 joerg Exp $ | |
2 | 2 | |||
3 | --- src/libdar/mask_list.hpp.orig 2013-06-20 19:11:02.000000000 +0000 | 3 | --- src/libdar/mask_list.hpp.orig 2012-11-30 20:51:11.000000000 +0000 | |
4 | +++ src/libdar/mask_list.hpp | 4 | +++ src/libdar/mask_list.hpp | |
5 | @@ -80,7 +80,7 @@ namespace libdar | 5 | @@ -70,46 +70,10 @@ namespace libdar | |
6 | class my_char | 6 | ||
7 | { | 7 | private: | |
8 | public: | 8 | ||
9 | - // we need to change to lexicographical order relationship for the '/' character be the most lower of all. This way | |||
10 | - // the first entry listed from a set a file sharing the same first characters will be the one corresponding | |||
11 | - // to the directory with this common prefix. | |||
12 | - | |||
13 | - class my_char | |||
14 | - { | |||
15 | - public: | |||
9 | - my_char() { val = 0; }; | 16 | - my_char() { val = 0; }; | |
10 | + my_char() = default; | 17 | - my_char(const char x) : val(x) {}; | |
11 | my_char(const char x) : val(x) {}; | 18 | - bool operator < (const my_char & x) const | |
12 | bool operator < (const my_char & x) const | 19 | - { | |
13 | { | 20 | - if(val == '/') | |
21 | - if(x.val == '/') | |||
22 | - return false; | |||
23 | - else | |||
24 | - return true; | |||
25 | - else | |||
26 | - if(x.val == '/') | |||
27 | - return false; | |||
28 | - else | |||
29 | - return val < x.val; | |||
30 | - }; | |||
31 | - | |||
32 | - operator char() const | |||
33 | - { | |||
34 | - return val; | |||
35 | - }; | |||
36 | - | |||
37 | - private: | |||
38 | - char val; | |||
39 | - }; | |||
40 | - | |||
41 | - std::vector <std::basic_string<my_char> > contenu; | |||
42 | + std::vector <std::string > contenu; | |||
43 | U_I taille; | |||
44 | bool case_s; | |||
45 | bool including; // mask is used for including files (not for excluding files) | |||
46 | - | |||
47 | - static std::list<std::basic_string<my_char> > convert_list_string_char(const std::list<std::string> & src); | |||
48 | - static std::basic_string<my_char> convert_string_char(const std::string & src); | |||
49 | - static std::string convert_string_my_char(const std::basic_string<my_char> & src); | |||
50 | }; | |||
51 | ||||
52 | /// @} |