1 |
commit: 9af9d28a46452e2c1a41544f97ea5bb51da4965d |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Aug 31 22:13:34 2015 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Aug 31 22:13:44 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9af9d28a |
7 |
|
8 |
sys-fs/e2tools: fix various build time warnings |
9 |
|
10 |
sys-fs/e2tools/e2tools-0.0.16.ebuild | 4 +- |
11 |
.../e2tools/files/e2tools-0.0.16-prototypes.patch | 167 +++++++++++++++++++++ |
12 |
.../e2tools/files/e2tools-0.0.16-qsort-const.patch | 102 +++++++++++++ |
13 |
3 files changed, 272 insertions(+), 1 deletion(-) |
14 |
|
15 |
diff --git a/sys-fs/e2tools/e2tools-0.0.16.ebuild b/sys-fs/e2tools/e2tools-0.0.16.ebuild |
16 |
index 052ef63..6bf35db 100644 |
17 |
--- a/sys-fs/e2tools/e2tools-0.0.16.ebuild |
18 |
+++ b/sys-fs/e2tools/e2tools-0.0.16.ebuild |
19 |
@@ -4,7 +4,7 @@ |
20 |
|
21 |
EAPI="5" |
22 |
|
23 |
-inherit toolchain-funcs |
24 |
+inherit toolchain-funcs eutils |
25 |
|
26 |
DESCRIPTION="utilities to read, write, and manipulate files in an ext2/ext3 filesystem" |
27 |
HOMEPAGE="http://home.earthlink.net/~k_sheff/sw/e2tools/" |
28 |
@@ -20,6 +20,8 @@ DEPEND="sys-fs/e2fsprogs |
29 |
RDEPEND="${DEPEND}" |
30 |
|
31 |
src_prepare() { |
32 |
+ epatch "${FILESDIR}"/${P}-prototypes.patch |
33 |
+ epatch "${FILESDIR}"/${P}-qsort-const.patch |
34 |
sed -i '/e2cp_LDADD/s:-L@[^@]*@::' Makefile.in || die |
35 |
} |
36 |
|
37 |
|
38 |
diff --git a/sys-fs/e2tools/files/e2tools-0.0.16-prototypes.patch b/sys-fs/e2tools/files/e2tools-0.0.16-prototypes.patch |
39 |
new file mode 100644 |
40 |
index 0000000..39a9ddb |
41 |
--- /dev/null |
42 |
+++ b/sys-fs/e2tools/files/e2tools-0.0.16-prototypes.patch |
43 |
@@ -0,0 +1,167 @@ |
44 |
+fix various missing prototype warnings |
45 |
+ |
46 |
+--- a/e2tools.h |
47 |
++++ b/e2tools.h |
48 |
+@@ -63,38 +63,33 @@ |
49 |
+ #define E2T_FORCE 1 |
50 |
+ #define E2T_DO_MV 2 |
51 |
+ |
52 |
+-#ifndef COPY_C |
53 |
++/* copy.c */ |
54 |
+ extern long copy(int argc, char *argv[]); |
55 |
+ extern int my_strcmp(const void *n1, const void *n2); |
56 |
+-#endif |
57 |
+ |
58 |
+-#ifdef LN_C |
59 |
++/* ln.c */ |
60 |
+ extern long do_ln(int argc, char *argv[]); |
61 |
+ |
62 |
+ extern long create_hard_link(ext2_filsys fs, ext2_ino_t cwd, ext2_ino_t |
63 |
+ new_file_ino, char *newfile, int ln_flags); |
64 |
+-#endif |
65 |
+ |
66 |
+-#ifndef LS_C |
67 |
++/* ls.c */ |
68 |
+ extern long do_list_dir(int argc, char *argv[]); |
69 |
+-#endif |
70 |
+ |
71 |
+-#ifndef MKDIR_C |
72 |
++/* mkdir.c */ |
73 |
+ extern long e2mkdir(int argc, char *argv[]); |
74 |
+ extern long create_dir(ext2_filsys fs, ext2_ino_t root, ext2_ino_t *cwd, |
75 |
+ char *dirname, struct stat *def_stat); |
76 |
+-#endif |
77 |
++extern long change_cwd(ext2_filsys fs, ext2_ino_t root, ext2_ino_t *cwd, |
78 |
++ char *dirname); |
79 |
+ |
80 |
+-#ifdef MV_C |
81 |
++/* mv.c */ |
82 |
+ extern long do_mv(int argc, char *argv[]); |
83 |
+ extern long get_file_parts(ext2_filsys fs, ext2_ino_t root, char *pathname, |
84 |
+ ext2_ino_t *dir_ino, char **dir_name, |
85 |
+ char **base_name); |
86 |
+ |
87 |
+-#endif |
88 |
+- |
89 |
+- |
90 |
+-#ifndef READ_C |
91 |
++/* read.c */ |
92 |
+ extern long get_file(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd, |
93 |
+ char *infile, char *outfile, int keep); |
94 |
+ extern long retrieve_data(ext2_filsys fs, ext2_ino_t src, int dest_fd, |
95 |
+@@ -102,17 +97,14 @@ extern long retrieve_data(ext2_filsys fs, ext2_ino_t src, int dest_fd, |
96 |
+ ext2_off_t *ret_pos); |
97 |
+ extern long read_to_eof(ext2_file_t infile, int dest_fd, ext2_off_t offset, |
98 |
+ ext2_off_t *ret_pos); |
99 |
+-#endif |
100 |
+ |
101 |
+-#ifndef RM_C |
102 |
++/* rm.c */ |
103 |
+ extern long e2rm(int argc, char *argv[]); |
104 |
+-#endif |
105 |
+ |
106 |
+-#ifndef TAIL_C |
107 |
++/* tail.c */ |
108 |
+ extern long do_tail(int argc, char *argv[]); |
109 |
+-#endif |
110 |
+ |
111 |
+-#ifndef UTIL_C |
112 |
++/* util.c */ |
113 |
+ extern mode_t ext2_mode_xlate(__u16 lmode); |
114 |
+ extern __u16 host_mode_xlate(mode_t hmode); |
115 |
+ extern long open_filesystem(char *name, ext2_filsys *fs, ext2_ino_t *root, int |
116 |
+@@ -125,13 +117,14 @@ extern long rm_file(ext2_filsys fs, ext2_ino_t cwd, char *outfile, ext2_ino_t |
117 |
+ delfile); |
118 |
+ extern long delete_file(ext2_filsys fs, ext2_ino_t inode); |
119 |
+ extern void init_stat_buf(struct stat *buf); |
120 |
+-#endif |
121 |
++#include <regex.h> |
122 |
++extern regex_t *make_regexp(char *shell); |
123 |
++extern int is_file_regexp(char *ptr); |
124 |
+ |
125 |
+-#ifndef WRITE_C |
126 |
++/* write.c */ |
127 |
+ extern long |
128 |
+ put_file(ext2_filsys fs, ext2_ino_t cwd, char *infile, char *outfile, |
129 |
+ ext2_ino_t *outfile_ino, int keep, struct stat *def_stat); |
130 |
+-#endif |
131 |
+ |
132 |
+ #endif |
133 |
+ |
134 |
+--- a/elist.c |
135 |
++++ b/elist.c |
136 |
+@@ -41,12 +41,9 @@ |
137 |
+ /* Feature Test Switches */ |
138 |
+ /* Headers */ |
139 |
+ #include <memory.h> |
140 |
++#include <stdlib.h> |
141 |
+ #include "elist.h" |
142 |
+ |
143 |
+-#ifndef NULL |
144 |
+-#define NULL ((void *)0) |
145 |
+-#endif |
146 |
+- |
147 |
+ elist_t * |
148 |
+ elist_new() |
149 |
+ { |
150 |
+--- a/ls.c |
151 |
++++ b/ls.c |
152 |
+@@ -703,7 +703,7 @@ void short_disp(ls_file_t *info, int *col, int options) |
153 |
+ char lbr, rbr; |
154 |
+ char tmp[300]; |
155 |
+ int thislen; |
156 |
+- static max_col_size = 0; |
157 |
++ static int max_col_size = 0; |
158 |
+ |
159 |
+ if (max_col_size == 0) |
160 |
+ { |
161 |
+--- a/mkdir.c |
162 |
++++ b/mkdir.c |
163 |
+@@ -357,7 +357,7 @@ create_dir(ext2_filsys fs, ext2_ino_t root, ext2_ino_t *cwd, |
164 |
+ def_stat))) |
165 |
+ { |
166 |
+ fprintf(stderr, |
167 |
+- "create_dir: error creating directory %s/%s:%d\n", |
168 |
++ "create_dir: error creating directory %s/%s:%ld\n", |
169 |
+ dirname, dname, retval); |
170 |
+ ext2fs_free_mem((void **) &buf); |
171 |
+ return(retval); |
172 |
+@@ -415,7 +415,7 @@ create_dir(ext2_filsys fs, ext2_ino_t root, ext2_ino_t *cwd, |
173 |
+ if ((retval = create_subdir(fs, root, cwd, dirname, def_stat))) |
174 |
+ { |
175 |
+ fprintf(stderr, |
176 |
+- "create_dir: error creating directory %s:%d\n", |
177 |
++ "create_dir: error creating directory %s:%ld\n", |
178 |
+ dirname, retval); |
179 |
+ return(retval); |
180 |
+ } |
181 |
+--- a/progress.c |
182 |
++++ b/progress.c |
183 |
+@@ -26,6 +26,8 @@ |
184 |
+ /* Feature Test Switches */ |
185 |
+ /* System Headers */ |
186 |
+ #include <stdio.h> |
187 |
++#include <stdlib.h> |
188 |
++#include <string.h> |
189 |
+ #include <unistd.h> |
190 |
+ #include <sys/stat.h> |
191 |
+ #include <sys/time.h> |
192 |
+@@ -154,7 +156,7 @@ void update_progress(unsigned long num_bytes) |
193 |
+ if (prog_sbuf != NULL && prog_time != tv.tv_sec) |
194 |
+ { |
195 |
+ prog_time = tv.tv_sec; |
196 |
+- fprintf(stderr, "%s %10d / %10d\r", prog_file, num_bytes, |
197 |
++ fprintf(stderr, "%s %10lu / %10jd\r", prog_file, num_bytes, |
198 |
+ prog_sbuf->st_size); |
199 |
+ fflush(stderr); |
200 |
+ } |
201 |
+--- a/rm.c |
202 |
++++ b/rm.c |
203 |
+@@ -244,7 +244,6 @@ e2rm(int argc, char *argv[]) |
204 |
+ retval = ext2fs_dir_iterate2(gbl_fs, curr_ino, |
205 |
+ DIRENT_FLAG_INCLUDE_EMPTY, 0, |
206 |
+ rm_dir_proc, |
207 |
+- (void *) |
208 |
+ (verbose) ? &verbose : NULL); |
209 |
+ } |
210 |
+ else |
211 |
|
212 |
diff --git a/sys-fs/e2tools/files/e2tools-0.0.16-qsort-const.patch b/sys-fs/e2tools/files/e2tools-0.0.16-qsort-const.patch |
213 |
new file mode 100644 |
214 |
index 0000000..532b8fb |
215 |
--- /dev/null |
216 |
+++ b/sys-fs/e2tools/files/e2tools-0.0.16-qsort-const.patch |
217 |
@@ -0,0 +1,102 @@ |
218 |
+the qsort func expects a callback with const pointers, so update all the |
219 |
+prototypes to match |
220 |
+ |
221 |
+--- a/elist.c |
222 |
++++ b/elist.c |
223 |
+@@ -136,7 +133,7 @@ elist_insert(elist_t *l, void *data) |
224 |
+ return(l); |
225 |
+ } |
226 |
+ |
227 |
+-void elist_sort(elist_t *l, int (sort_func)(void *, void *), int reverse) |
228 |
++void elist_sort(elist_t *l, int (sort_func)(const void *, const void *), int reverse) |
229 |
+ { |
230 |
+ int c=0; |
231 |
+ elist_t *tl; |
232 |
+--- a/elist.h |
233 |
++++ b/elist.h |
234 |
+@@ -33,7 +33,7 @@ extern void elist_free(elist_t *l, void (*data_free)(void *)); |
235 |
+ extern elist_t * elist_append(elist_t *l, void *data); |
236 |
+ extern elist_t * elist_insert(elist_t *l, void *data); |
237 |
+ extern void |
238 |
+-elist_sort(elist_t *l, int (sort_func)(void *, void *), int reverse); |
239 |
++elist_sort(elist_t *l, int (sort_func)(const void *, const void *), int reverse); |
240 |
+ #endif |
241 |
+ |
242 |
+ #endif |
243 |
+--- a/ls.c |
244 |
++++ b/ls.c |
245 |
+@@ -98,15 +98,15 @@ long_disp(ls_file_t *info, int *col, int options); |
246 |
+ void |
247 |
+ short_disp(ls_file_t *info, int *col, int options); |
248 |
+ int |
249 |
+-no_sort(void *n1, void *n2); |
250 |
++no_sort(const void *n1, const void *n2); |
251 |
+ int |
252 |
+-name_sort(void *n1, void *n2); |
253 |
++name_sort(const void *n1, const void *n2); |
254 |
+ int |
255 |
+-inode_sort(void *n1, void *n2); |
256 |
++inode_sort(const void *n1, const void *n2); |
257 |
+ int |
258 |
+-mod_time_sort(void *n1, void *n2); |
259 |
++mod_time_sort(const void *n1, const void *n2); |
260 |
+ int |
261 |
+-creat_time_sort(void *n1, void *n2); |
262 |
++creat_time_sort(const void *n1, const void *n2); |
263 |
+ long |
264 |
+ add_ls_file(char *name, int namelen, ext2_ino_t dir, ext2_ino_t ino, |
265 |
+ int entry, int type, struct list_dir_struct *ls); |
266 |
+@@ -331,7 +331,7 @@ do_list_dir(int argc, char *argv[]) |
267 |
+ char *dup_path = NULL; |
268 |
+ char *dir_name; |
269 |
+ char *base_name; |
270 |
+- int (*file_sort)(void *n1, void *n2) = name_sort; |
271 |
++ int (*file_sort)(const void *n1, const void *n2) = name_sort; |
272 |
+ void (*file_disp)(ls_file_t *n, int *col, int options) = short_disp; |
273 |
+ elist_t *files=NULL; |
274 |
+ int col=0; |
275 |
+@@ -791,7 +791,7 @@ void short_disp(ls_file_t *info, int *col, int options) |
276 |
+ * MM/DD/YY Name Description |
277 |
+ * |
278 |
+ */ |
279 |
+-int no_sort(void *n1, void *n2) |
280 |
++int no_sort(const void *n1, const void *n2) |
281 |
+ { |
282 |
+ ls_file_t *f1 = *((ls_file_t **) n1); |
283 |
+ ls_file_t *f2 = *((ls_file_t **) n2); |
284 |
+@@ -835,7 +835,7 @@ int no_sort(void *n1, void *n2) |
285 |
+ * MM/DD/YY Name Description |
286 |
+ * |
287 |
+ */ |
288 |
+-int name_sort(void *n1, void *n2) |
289 |
++int name_sort(const void *n1, const void *n2) |
290 |
+ { |
291 |
+ ls_file_t *f1 = *((ls_file_t **) n1); |
292 |
+ ls_file_t *f2 = *((ls_file_t **) n2); |
293 |
+@@ -880,7 +880,7 @@ int name_sort(void *n1, void *n2) |
294 |
+ * MM/DD/YY Name Description |
295 |
+ * |
296 |
+ */ |
297 |
+-int inode_sort(void *n1, void *n2) |
298 |
++int inode_sort(const void *n1, const void *n2) |
299 |
+ { |
300 |
+ ls_file_t *f1 = *((ls_file_t **) n1); |
301 |
+ ls_file_t *f2 = *((ls_file_t **) n2); |
302 |
+@@ -925,7 +925,7 @@ int inode_sort(void *n1, void *n2) |
303 |
+ * MM/DD/YY Name Description |
304 |
+ * |
305 |
+ */ |
306 |
+-int mod_time_sort(void *n1, void *n2) |
307 |
++int mod_time_sort(const void *n1, const void *n2) |
308 |
+ { |
309 |
+ ls_file_t *f1 = *((ls_file_t **) n1); |
310 |
+ ls_file_t *f2 = *((ls_file_t **) n2); |
311 |
+@@ -971,7 +971,7 @@ int mod_time_sort(void *n1, void *n2) |
312 |
+ * MM/DD/YY Name Description |
313 |
+ * |
314 |
+ */ |
315 |
+-int creat_time_sort(void *n1, void *n2) |
316 |
++int creat_time_sort(const void *n1, const void *n2) |
317 |
+ { |
318 |
+ ls_file_t *f1 = *((ls_file_t **) n1); |
319 |
+ ls_file_t *f2 = *((ls_file_t **) n2); |