|
1 # Copied over from the desktop consolidation, not for upstream |
|
2 |
|
3 diff -ru /home/ml40262/gparted/gparted-0.4.5/compose/ucompose.hpp ./compose/ucompose.hpp |
|
4 --- /home/ml40262/gparted/gparted-0.4.5/compose/ucompose.hpp 2009-04-18 13:38:05.000000000 -0700 |
|
5 +++ ./compose/ucompose.hpp 2009-10-16 15:33:54.265337000 -0700 |
|
6 @@ -127,7 +127,11 @@ |
|
7 |
|
8 return Glib::convert(std::string(reinterpret_cast<const char *>(str.data()), |
|
9 str.size() * sizeof(wchar_t)), |
|
10 +#ifdef __sun |
|
11 + "UTF-8", "UCS-4LE"); |
|
12 +#else |
|
13 "UTF-8", "WCHAR_T"); |
|
14 +#endif |
|
15 } |
|
16 |
|
17 // specialisations for the common string types |
|
18 diff -ru /home/ml40262/gparted/gparted-0.4.5/configure ./configure |
|
19 --- /home/ml40262/gparted/gparted-0.4.5/configure 2009-05-08 09:05:43.000000000 -0700 |
|
20 +++ ./configure 2009-10-16 15:33:54.304150000 -0700 |
|
21 @@ -22031,6 +22031,10 @@ |
|
22 #include <stdio.h> |
|
23 #include <parted/parted.h> |
|
24 |
|
25 +#ifdef __sun |
|
26 +char *program_name = "test"; |
|
27 +#endif |
|
28 + |
|
29 int main () |
|
30 { |
|
31 int min_major ; |
|
32 diff -ru /home/ml40262/gparted/gparted-0.4.5/configure.in ./configure.in |
|
33 --- /home/ml40262/gparted/gparted-0.4.5/configure.in 2009-05-08 08:50:41.000000000 -0700 |
|
34 +++ ./configure.in 2009-10-16 15:33:54.313587000 -0700 |
|
35 @@ -49,6 +49,10 @@ |
|
36 #include <stdio.h> |
|
37 #include <parted/parted.h> |
|
38 |
|
39 +#ifdef __sun |
|
40 +char *program_name = "test"; |
|
41 +#endif |
|
42 + |
|
43 int main () |
|
44 { |
|
45 int min_major ; |
|
46 diff -ru /home/ml40262/gparted/gparted-0.4.5/gparted.desktop.in.in ./gparted.desktop.in.in |
|
47 --- /home/ml40262/gparted/gparted-0.4.5/gparted.desktop.in.in 2009-05-08 09:05:53.000000000 -0700 |
|
48 +++ ./gparted.desktop.in.in 2009-10-16 15:36:22.402991000 -0700 |
|
49 @@ -1,7 +1,7 @@ |
|
50 [Desktop Entry] |
|
51 _Name=GParted Partition Editor |
|
52 _Comment=Create, reorganize, and delete partitions |
|
53 -Exec=@gksuprog@ @installdir@/gparted %f |
|
54 +Exec=/usr/sbin/gparted %f |
|
55 Icon=gparted |
|
56 Terminal=false |
|
57 Type=Application |
|
58 diff -ru /home/ml40262/gparted/gparted-0.4.5/include/Utils.h ./include/Utils.h |
|
59 --- /home/ml40262/gparted/gparted-0.4.5/include/Utils.h 2009-04-19 11:05:13.000000000 -0700 |
|
60 +++ ./include/Utils.h 2009-10-21 13:40:34.747259000 -0700 |
|
61 @@ -71,7 +71,8 @@ |
|
62 |
|
63 FS_BTRFS = 20, /* FIXME: Move this higher up list when full support added */ |
|
64 FS_LVM2 = 21, |
|
65 - FS_LUKS = 22 |
|
66 + FS_LUKS = 22, |
|
67 + FS_SOLARIS = 23 |
|
68 } ; |
|
69 |
|
70 enum SIZE_UNIT |
|
71 diff -ru /home/ml40262/gparted/gparted-0.4.5/src/GParted_Core.cc ./src/GParted_Core.cc |
|
72 --- /home/ml40262/gparted/gparted-0.4.5/src/GParted_Core.cc 2009-05-02 09:59:49.000000000 -0700 |
|
73 +++ ./src/GParted_Core.cc 2009-10-21 15:10:07.784757000 -0700 |
|
74 @@ -847,7 +847,11 @@ |
|
75 strncpy(magic, buf+0, 6) ; magic[6] = '\0' ; //set and terminate string |
|
76 ped_device_close( lp_device ); |
|
77 |
|
78 +#ifdef __sun |
|
79 + if (strncmp("LUKS\xBA\xBE", magic, 6) == 0) |
|
80 +#else |
|
81 if ( Glib::ustring( magic ) == "LUKS\xBA\xBE" ) |
|
82 +#endif |
|
83 { |
|
84 temp = _( "Linux Unified Key Setup encryption is not yet supported." ) ; |
|
85 temp += "\n" ; |
|
86 @@ -900,6 +904,8 @@ |
|
87 return GParted::FS_HFSPLUS ; |
|
88 else if ( Glib::ustring( lp_partition ->fs_type ->name ) == "ufs" ) |
|
89 return GParted::FS_UFS ; |
|
90 + else if ( Glib::ustring( lp_partition ->fs_type ->name ) == "solaris" ) |
|
91 + return GParted::FS_SOLARIS ; |
|
92 } |
|
93 |
|
94 |
|
95 @@ -911,7 +917,16 @@ |
|
96 ped_geometry_read( & lp_partition ->geom, buf, 128, 1 ) ; |
|
97 ped_device_close( lp_device ); |
|
98 |
|
99 +#ifdef __sun |
|
100 + /* |
|
101 + * On Solaris, the Glib::ustring causes this message: |
|
102 + * GLib-CRITICAL **: file gconvert.c: |
|
103 + * line 734: assertion `str != NULL' failed |
|
104 + */ |
|
105 + if (strncmp("ReIsEr4", buf, 7) == 0) |
|
106 +#else |
|
107 if ( Glib::ustring( buf ) == "ReIsEr4" ) |
|
108 +#endif |
|
109 return GParted::FS_REISER4 ; |
|
110 |
|
111 //lvm2 |
|
112 @@ -925,8 +940,13 @@ |
|
113 strncpy(magic2, buf+24, 4) ; magic2[4] = '\0' ; //set and terminate string |
|
114 ped_device_close( lp_device ); |
|
115 |
|
116 +#ifdef __sun |
|
117 + if (strncmp("LABELONE", magic1, 8) == 0 |
|
118 + && strncmp("LVM2", magic2, 4) == 0) |
|
119 +#else |
|
120 if ( Glib::ustring( magic1 ) == "LABELONE" |
|
121 && Glib::ustring( magic2 ) == "LVM2" ) |
|
122 +#endif |
|
123 { |
|
124 temp = _( "Logical Volume Management is not yet supported." ) ; |
|
125 temp += "\n" ; |
|
126 @@ -949,7 +969,11 @@ |
|
127 strncpy(magic, buf_btrfs+64, BTRFS_SIGNATURE .size()) ; magic[BTRFS_SIGNATURE .size()] = '\0' ; //set and terminate string |
|
128 ped_device_close( lp_device ) ; |
|
129 |
|
130 +#ifdef __sun |
|
131 + if (strncmp("_BHRfS_M", magic, 8) == 0) |
|
132 +#else |
|
133 if ( magic == BTRFS_SIGNATURE ) |
|
134 +#endif |
|
135 { |
|
136 temp = _( "BTRFS is not yet supported." ) ; |
|
137 temp += "\n" ; |
|
138 diff -ru /home/ml40262/gparted/gparted-0.4.5/src/Utils.cc ./src/Utils.cc |
|
139 --- /home/ml40262/gparted/gparted-0.4.5/src/Utils.cc 2009-04-19 11:05:13.000000000 -0700 |
|
140 +++ ./src/Utils.cc 2009-10-21 14:20:52.259713000 -0700 |
|
141 @@ -19,6 +19,7 @@ |
|
142 |
|
143 #include <sstream> |
|
144 #include <iomanip> |
|
145 +#include <unistd.h> |
|
146 #include <regex.h> |
|
147 #include <locale.h> |
|
148 |
|
149 @@ -87,6 +88,7 @@ |
|
150 case FS_HFS : return "#E0B6AF" ; //red hilight |
|
151 case FS_HFSPLUS : return "#C0A39E" ; // ~ serene red |
|
152 case FS_UFS : return "#D1940C" ; //accent yellow dark |
|
153 + case FS_SOLARIS : return "#9933FF" ; //sun purple |
|
154 case FS_USED : return "#F8F8BA" ; // ~ light tan yellow |
|
155 case FS_UNUSED : return "#FFFFFF" ; //white |
|
156 case FS_LVM2 : return "#CC9966" ; // ~ medium brown |
|
157 @@ -135,6 +137,7 @@ |
|
158 case FS_HFS : return "hfs" ; |
|
159 case FS_HFSPLUS : return "hfs+" ; |
|
160 case FS_UFS : return "ufs" ; |
|
161 + case FS_SOLARIS : return "solaris" ; |
|
162 case FS_USED : return _("used") ; |
|
163 case FS_UNUSED : return _("unused") ; |
|
164 case FS_LVM2 : return "lvm2" ; |
|
165 diff -ru /home/ml40262/gparted/gparted-0.4.5/src/Win_GParted.cc ./src/Win_GParted.cc |
|
166 --- /home/ml40262/gparted/gparted-0.4.5/src/Win_GParted.cc 2009-04-19 11:05:13.000000000 -0700 |
|
167 +++ ./src/Win_GParted.cc 2009-10-16 15:33:54.349055000 -0700 |
|
168 @@ -1690,9 +1690,14 @@ |
|
169 |
|
170 *succes = true ; |
|
171 for ( unsigned int t = 0 ; t < selected_partition .get_mountpoints() .size() ; t++ ) |
|
172 - if ( std::count( mountpoints .begin(), |
|
173 + { |
|
174 + size_t n = 0; |
|
175 + |
|
176 + std::count( mountpoints .begin(), |
|
177 mountpoints .end(), |
|
178 - selected_partition .get_mountpoints()[ t ] ) <= 1 ) |
|
179 + selected_partition .get_mountpoints()[ t ], |
|
180 + n ); |
|
181 + if ( n <= 1 ) |
|
182 { |
|
183 if ( Utils::execute_command( "umount -v \"" + selected_partition .get_mountpoints()[ t ] + "\"", |
|
184 dummy, |
|
185 @@ -1704,6 +1709,7 @@ |
|
186 } |
|
187 else |
|
188 failed_mountpoints .push_back( selected_partition .get_mountpoints()[ t ] ) ; |
|
189 + } |
|
190 |
|
191 |
|
192 if ( *succes && failed_mountpoints .size() ) |
|
193 diff -ru /home/ml40262/gparted/gparted-0.4.5/src/ext2.cc ./src/ext2.cc |
|
194 --- /home/ml40262/gparted/gparted-0.4.5/src/ext2.cc 2009-04-18 13:38:05.000000000 -0700 |
|
195 +++ ./src/ext2.cc 2009-10-16 15:33:54.360072000 -0700 |
|
196 @@ -62,12 +62,12 @@ |
|
197 { |
|
198 index = output .find( "Free blocks:" ) ; |
|
199 if ( index >= output .length() || |
|
200 - sscanf( output.substr( index ) .c_str(), "Free blocks: %Ld", &N ) != 1 ) |
|
201 + sscanf( output.substr( index ) .c_str(), "Free blocks: %lld", &N ) != 1 ) |
|
202 N = -1 ; |
|
203 |
|
204 index = output .find( "Block size:" ) ; |
|
205 if ( index >= output.length() || |
|
206 - sscanf( output.substr( index ) .c_str(), "Block size: %Ld", &S ) != 1 ) |
|
207 + sscanf( output.substr( index ) .c_str(), "Block size: %lld", &S ) != 1 ) |
|
208 S = -1 ; |
|
209 |
|
210 if ( N > -1 && S > -1 ) |
|
211 diff -ru /home/ml40262/gparted/gparted-0.4.5/src/ext3.cc ./src/ext3.cc |
|
212 --- /home/ml40262/gparted/gparted-0.4.5/src/ext3.cc 2009-04-18 13:38:05.000000000 -0700 |
|
213 +++ ./src/ext3.cc 2009-10-16 15:33:54.368076000 -0700 |
|
214 @@ -63,12 +63,12 @@ |
|
215 { |
|
216 index = output .find( "Free blocks:" ) ; |
|
217 if ( index >= output .length() || |
|
218 - sscanf( output.substr( index ) .c_str(), "Free blocks: %Ld", &N ) != 1 ) |
|
219 + sscanf( output.substr( index ) .c_str(), "Free blocks: %lld", &N ) != 1 ) |
|
220 N = -1 ; |
|
221 |
|
222 index = output .find( "Block size:" ) ; |
|
223 if ( index >= output.length() || |
|
224 - sscanf( output.substr( index ) .c_str(), "Block size: %Ld", &S ) != 1 ) |
|
225 + sscanf( output.substr( index ) .c_str(), "Block size: %lld", &S ) != 1 ) |
|
226 S = -1 ; |
|
227 |
|
228 if ( N > -1 && S > -1 ) |
|
229 diff -ru /home/ml40262/gparted/gparted-0.4.5/src/ext4.cc ./src/ext4.cc |
|
230 --- /home/ml40262/gparted/gparted-0.4.5/src/ext4.cc 2009-04-19 11:05:13.000000000 -0700 |
|
231 +++ ./src/ext4.cc 2009-10-16 15:33:54.375586000 -0700 |
|
232 @@ -67,12 +67,12 @@ |
|
233 { |
|
234 index = output .find( "Free blocks:" ) ; |
|
235 if ( index >= output .length() || |
|
236 - sscanf( output.substr( index ) .c_str(), "Free blocks: %Ld", &N ) != 1 ) |
|
237 + sscanf( output.substr( index ) .c_str(), "Free blocks: %lld", &N ) != 1 ) |
|
238 N = -1 ; |
|
239 |
|
240 index = output .find( "Block size:" ) ; |
|
241 if ( index >= output.length() || |
|
242 - sscanf( output.substr( index ) .c_str(), "Block size: %Ld", &S ) != 1 ) |
|
243 + sscanf( output.substr( index ) .c_str(), "Block size: %lld", &S ) != 1 ) |
|
244 S = -1 ; |
|
245 |
|
246 if ( N > -1 && S > -1 ) |
|
247 diff -ru /home/ml40262/gparted/gparted-0.4.5/src/fat16.cc ./src/fat16.cc |
|
248 --- /home/ml40262/gparted/gparted-0.4.5/src/fat16.cc 2009-04-18 13:38:05.000000000 -0700 |
|
249 +++ ./src/fat16.cc 2009-10-16 15:33:54.382437000 -0700 |
|
250 @@ -68,14 +68,14 @@ |
|
251 { |
|
252 //free clusters |
|
253 index = output .find( ",", output .find( partition .get_path() ) + partition .get_path() .length() ) +1 ; |
|
254 - if ( index < output .length() && sscanf( output .substr( index ) .c_str(), "%Ld/%Ld", &S, &N ) == 2 ) |
|
255 + if ( index < output .length() && sscanf( output .substr( index ) .c_str(), "%lld/%lld", &S, &N ) == 2 ) |
|
256 N -= S ; |
|
257 else |
|
258 N = -1 ; |
|
259 |
|
260 //bytes per cluster |
|
261 index = output .rfind( "\n", output .find( "bytes per cluster" ) ) +1 ; |
|
262 - if ( index >= output .length() || sscanf( output .substr( index ) .c_str(), "%Ld", &S ) != 1 ) |
|
263 + if ( index >= output .length() || sscanf( output .substr( index ) .c_str(), "%lld", &S ) != 1 ) |
|
264 S = -1 ; |
|
265 |
|
266 if ( N > -1 && S > -1 ) |
|
267 diff -ru /home/ml40262/gparted/gparted-0.4.5/src/fat32.cc ./src/fat32.cc |
|
268 --- /home/ml40262/gparted/gparted-0.4.5/src/fat32.cc 2009-04-18 13:38:05.000000000 -0700 |
|
269 +++ ./src/fat32.cc 2009-10-16 15:33:54.389232000 -0700 |
|
270 @@ -68,14 +68,14 @@ |
|
271 { |
|
272 //free clusters |
|
273 index = output .find( ",", output .find( partition .get_path() ) + partition .get_path() .length() ) +1 ; |
|
274 - if ( index < output .length() && sscanf( output .substr( index ) .c_str(), "%Ld/%Ld", &S, &N ) == 2 ) |
|
275 + if ( index < output .length() && sscanf( output .substr( index ) .c_str(), "%lld/%lld", &S, &N ) == 2 ) |
|
276 N -= S ; |
|
277 else |
|
278 N = -1 ; |
|
279 |
|
280 //bytes per cluster |
|
281 index = output .rfind( "\n", output .find( "bytes per cluster" ) ) +1 ; |
|
282 - if ( index >= output .length() || sscanf( output .substr( index ) .c_str(), "%Ld", &S ) != 1 ) |
|
283 + if ( index >= output .length() || sscanf( output .substr( index ) .c_str(), "%lld", &S ) != 1 ) |
|
284 S = -1 ; |
|
285 |
|
286 if ( N > -1 && S > -1 ) |
|
287 diff -ru /home/ml40262/gparted/gparted-0.4.5/src/jfs.cc ./src/jfs.cc |
|
288 --- /home/ml40262/gparted/gparted-0.4.5/src/jfs.cc 2009-04-18 13:38:05.000000000 -0700 |
|
289 +++ ./src/jfs.cc 2009-10-16 15:33:54.396315000 -0700 |
|
290 @@ -82,13 +82,13 @@ |
|
291 //blocksize |
|
292 index = output .find( "Block Size:" ) ; |
|
293 if ( index >= output .length() || |
|
294 - sscanf( output .substr( index ) .c_str(), "Block Size: %Ld", &S ) != 1 ) |
|
295 + sscanf( output .substr( index ) .c_str(), "Block Size: %lld", &S ) != 1 ) |
|
296 S = -1 ; |
|
297 |
|
298 //free blocks |
|
299 index = output .find( "dn_nfree:" ) ; |
|
300 if ( index >= output .length() || |
|
301 - sscanf( output .substr( index ) .c_str(), "dn_nfree: %Lx", &N ) != 1 ) |
|
302 + sscanf( output .substr( index ) .c_str(), "dn_nfree: %llx", &N ) != 1 ) |
|
303 N = -1 ; |
|
304 |
|
305 if ( S > -1 && N > -1 ) |
|
306 diff -ru /home/ml40262/gparted/gparted-0.4.5/src/main.cc ./src/main.cc |
|
307 --- /home/ml40262/gparted/gparted-0.4.5/src/main.cc 2009-04-18 13:38:05.000000000 -0700 |
|
308 +++ ./src/main.cc 2009-10-16 15:33:54.403171000 -0700 |
|
309 @@ -20,8 +20,16 @@ |
|
310 #include <gtkmm/messagedialog.h> |
|
311 #include <gtkmm/main.h> |
|
312 |
|
313 +#ifdef __sun |
|
314 +char *program_name; |
|
315 +#endif |
|
316 + |
|
317 int main( int argc, char *argv[] ) |
|
318 { |
|
319 +#ifdef __sun |
|
320 + program_name = argv[0]; |
|
321 +#endif |
|
322 + |
|
323 //initialize thread system |
|
324 Glib::thread_init() ; |
|
325 |
|
326 diff -ru /home/ml40262/gparted/gparted-0.4.5/src/ntfs.cc ./src/ntfs.cc |
|
327 --- /home/ml40262/gparted/gparted-0.4.5/src/ntfs.cc 2009-04-19 11:05:13.000000000 -0700 |
|
328 +++ ./src/ntfs.cc 2009-10-16 15:33:54.410077000 -0700 |
|
329 @@ -66,9 +66,8 @@ |
|
330 { |
|
331 index = output .find( "resize at" ) ; |
|
332 if ( index >= output .length() || |
|
333 - sscanf( output .substr( index ) .c_str(), "resize at %Ld", &N ) != 1 ) |
|
334 + sscanf( output .substr( index ) .c_str(), "resize at %lld", &N ) != 1 ) |
|
335 N = -1 ; |
|
336 - |
|
337 if ( N > -1 ) |
|
338 partition .set_used( Utils::round( N / 512.0 ) ) ; |
|
339 } |
|
340 diff -ru /home/ml40262/gparted/gparted-0.4.5/src/reiser4.cc ./src/reiser4.cc |
|
341 --- /home/ml40262/gparted/gparted-0.4.5/src/reiser4.cc 2009-04-18 13:38:05.000000000 -0700 |
|
342 +++ ./src/reiser4.cc 2009-10-16 15:33:54.416591000 -0700 |
|
343 @@ -59,12 +59,12 @@ |
|
344 { |
|
345 index = output .find( "free blocks" ) ; |
|
346 if ( index >= output .length() || |
|
347 - sscanf( output.substr( index ) .c_str(), "free blocks: %Ld", &N ) != 1 ) |
|
348 + sscanf( output.substr( index ) .c_str(), "free blocks: %lld", &N ) != 1 ) |
|
349 N = -1 ; |
|
350 |
|
351 index = output .find( "blksize" ) ; |
|
352 if ( index >= output.length() || |
|
353 - sscanf( output.substr( index ) .c_str(), "blksize: %Ld", &S ) != 1 ) |
|
354 + sscanf( output.substr( index ) .c_str(), "blksize: %lld", &S ) != 1 ) |
|
355 S = -1 ; |
|
356 |
|
357 if ( N > -1 && S > -1 ) |
|
358 diff -ru /home/ml40262/gparted/gparted-0.4.5/src/reiserfs.cc ./src/reiserfs.cc |
|
359 --- /home/ml40262/gparted/gparted-0.4.5/src/reiserfs.cc 2009-04-18 13:38:05.000000000 -0700 |
|
360 +++ ./src/reiserfs.cc 2009-10-16 15:33:54.423380000 -0700 |
|
361 @@ -67,12 +67,12 @@ |
|
362 { |
|
363 index = output .find( "Blocksize" ) ; |
|
364 if ( index >= output .length() || |
|
365 - sscanf( output .substr( index ) .c_str(), "Blocksize: %Ld", &S ) != 1 ) |
|
366 + sscanf( output .substr( index ) .c_str(), "Blocksize: %lld", &S ) != 1 ) |
|
367 S = -1 ; |
|
368 |
|
369 index = output .find( ":", output .find( "Free blocks" ) ) +1 ; |
|
370 if ( index >= output .length() || |
|
371 - sscanf( output .substr( index ) .c_str(), "%Ld", &N ) != 1 ) |
|
372 + sscanf( output .substr( index ) .c_str(), "%lld", &N ) != 1 ) |
|
373 N = -1 ; |
|
374 |
|
375 if ( N > -1 && S > -1 ) |
|
376 diff -ru /home/ml40262/gparted/gparted-0.4.5/src/xfs.cc ./src/xfs.cc |
|
377 --- /home/ml40262/gparted/gparted-0.4.5/src/xfs.cc 2009-04-18 13:38:05.000000000 -0700 |
|
378 +++ ./src/xfs.cc 2009-10-16 15:33:54.431044000 -0700 |
|
379 @@ -85,13 +85,13 @@ |
|
380 true ) ) |
|
381 { |
|
382 //blocksize |
|
383 - if ( sscanf( output .c_str(), "blocksize = %Ld", &S ) != 1 ) |
|
384 + if ( sscanf( output .c_str(), "blocksize = %lld", &S ) != 1 ) |
|
385 S = -1 ; |
|
386 |
|
387 //free blocks |
|
388 index = output .find( "fdblocks" ) ; |
|
389 if ( index > output .length() || |
|
390 - sscanf( output .substr( index ) .c_str(), "fdblocks = %Ld", &N ) != 1 ) |
|
391 + sscanf( output .substr( index ) .c_str(), "fdblocks = %lld", &N ) != 1 ) |
|
392 N = -1 ; |
|
393 |
|
394 if ( N > -1 && S > -1 ) |