Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-projects commit in portage-utils: .depend main.c main.h porting.h
Date: Sun, 29 Sep 2013 22:42:41
Message-Id: 20130929224236.517F42004C@flycatcher.gentoo.org
1 vapier 13/09/29 22:42:36
2
3 Modified: .depend main.c main.h
4 Added: porting.h
5 Log:
6 move all headers includes and such to a single porting.h to avoid duplicating in tests/ #406393
7
8 Revision Changes Path
9 1.47 portage-utils/.depend
10
11 file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/.depend?rev=1.47&view=markup
12 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/.depend?rev=1.47&content-type=text/plain
13 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/.depend?r1=1.46&r2=1.47
14
15 Index: .depend
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo-projects/portage-utils/.depend,v
18 retrieving revision 1.46
19 retrieving revision 1.47
20 diff -u -r1.46 -r1.47
21 --- .depend 18 Dec 2011 01:17:14 -0000 1.46
22 +++ .depend 29 Sep 2013 22:42:36 -0000 1.47
23 @@ -1,5 +1,5 @@
24 -main.o: main.c main.h libq/libq.c libq/busybox.h libq/i18n.h libq/libq.h \
25 - libq/colors.c libq/xmalloc.c libq/xstrdup.c libq/xasprintf.c \
26 +main.o: main.c porting.h main.h libq/libq.c libq/busybox.h libq/i18n.h \
27 + libq/libq.h libq/colors.c libq/xmalloc.c libq/xstrdup.c libq/xasprintf.c \
28 libq/hash_fd.c libq/md5_sha1_sum.c libq/human_readable.c libq/rmspace.c \
29 libq/which.c libq/compat.c libq/copy_file.c libq/safe_io.c libq/xchdir.c \
30 libq/xgetcwd.c libq/xmkdir.c libq/xreadlink.c libq/xregex.c \
31
32
33
34 1.228 portage-utils/main.c
35
36 file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/main.c?rev=1.228&view=markup
37 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/main.c?rev=1.228&content-type=text/plain
38 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/main.c?r1=1.227&r2=1.228
39
40 Index: main.c
41 ===================================================================
42 RCS file: /var/cvsroot/gentoo-projects/portage-utils/main.c,v
43 retrieving revision 1.227
44 retrieving revision 1.228
45 diff -u -r1.227 -r1.228
46 --- main.c 23 May 2013 03:19:00 -0000 1.227
47 +++ main.c 29 Sep 2013 22:42:36 -0000 1.228
48 @@ -1,44 +1,13 @@
49 /*
50 - * Copyright 2005-2008 Gentoo Foundation
51 + * Copyright 2005-2013 Gentoo Foundation
52 * Distributed under the terms of the GNU General Public License v2
53 - * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.c,v 1.227 2013/05/23 03:19:00 vapier Exp $
54 + * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.c,v 1.228 2013/09/29 22:42:36 vapier Exp $
55 *
56 * Copyright 2005-2008 Ned Ludd - <solar@g.o>
57 - * Copyright 2005-2008 Mike Frysinger - <vapier@g.o>
58 + * Copyright 2005-2013 Mike Frysinger - <vapier@g.o>
59 */
60
61 -#ifdef HAVE_CONFIG_H
62 -# include "config.h" /* make sure we have EPREFIX, if set */
63 -#endif
64 -
65 -#ifndef _GNU_SOURCE
66 -#define _GNU_SOURCE
67 -#endif
68 -#ifndef _FILE_OFFSET_BITS
69 -#define _FILE_OFFSET_BITS 64 /* #471024 */
70 -#endif
71 -#ifdef _AIX
72 -#define _LINUX_SOURCE_COMPAT
73 -#endif
74 -
75 -#include <stdarg.h>
76 -#include <stdio.h>
77 -#include <stdlib.h>
78 -#include <stdbool.h>
79 -#include <sys/types.h>
80 -#include <string.h>
81 -#include <unistd.h>
82 -#include <sys/stat.h>
83 -#include <time.h>
84 -#include <sys/time.h>
85 -#include <ctype.h>
86 -#include <dirent.h>
87 -#include <getopt.h>
88 -#include <regex.h>
89 -#include <errno.h>
90 -#include <libgen.h>
91 -#include <limits.h>
92 -#include <assert.h>
93 +#include "porting.h"
94 #include "main.h"
95
96 /* prototypes and such */
97
98
99
100 1.16 portage-utils/main.h
101
102 file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/main.h?rev=1.16&view=markup
103 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/main.h?rev=1.16&content-type=text/plain
104 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/main.h?r1=1.15&r2=1.16
105
106 Index: main.h
107 ===================================================================
108 RCS file: /var/cvsroot/gentoo-projects/portage-utils/main.h,v
109 retrieving revision 1.15
110 retrieving revision 1.16
111 diff -u -r1.15 -r1.16
112 --- main.h 19 Dec 2011 20:27:36 -0000 1.15
113 +++ main.h 29 Sep 2013 22:42:36 -0000 1.16
114 @@ -1,7 +1,7 @@
115 /*
116 * Copyright 2005-2010 Gentoo Foundation
117 * Distributed under the terms of the GNU General Public License v2
118 - * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.h,v 1.15 2011/12/19 20:27:36 vapier Exp $
119 + * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.h,v 1.16 2013/09/29 22:42:36 vapier Exp $
120 *
121 * Copyright 2005-2010 Ned Ludd - <solar@g.o>
122 * Copyright 2005-2010 Mike Frysinger - <vapier@g.o>
123 @@ -53,10 +53,6 @@
124
125 #define _q_unused_ __attribute__((__unused__))
126
127 -#ifndef BUFSIZE
128 -# define BUFSIZE 8192
129 -#endif
130 -
131 #ifdef EBUG
132 # define DBG(fmt, args...) warnf(fmt , ## args)
133 # define IF_DEBUG(x) x
134 @@ -68,20 +64,4 @@
135 #define GETOPT_LONG(A, a, ex) \
136 getopt_long(argc, argv, ex A ## _FLAGS, a ## _long_opts, NULL)
137
138 -#ifndef MIN
139 -#define MIN(x, y) ((x) < (y) ? (x) : (y))
140 -#endif
141 -#ifndef MAX
142 -#define MAX(x, y) ((x) < (y) ? (y) : (x))
143 -#endif
144 -
145 #define a_argument required_argument
146 -
147 -/* Easy enough to glue to older versions */
148 -#ifndef O_CLOEXEC
149 -# define O_CLOEXEC 0
150 -#endif
151 -
152 -#ifndef CONFIG_EPREFIX
153 -#define CONFIG_EPREFIX "/"
154 -#endif
155
156
157
158 1.1 portage-utils/porting.h
159
160 file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/porting.h?rev=1.1&view=markup
161 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/porting.h?rev=1.1&content-type=text/plain
162
163 Index: porting.h
164 ===================================================================
165 /*
166 * Copyright 2005-2013 Gentoo Foundation
167 * Distributed under the terms of the GNU General Public License v2
168 * $Header: /var/cvsroot/gentoo-projects/portage-utils/porting.h,v 1.1 2013/09/29 22:42:36 vapier Exp $
169 *
170 * Copyright 2005-2008 Ned Ludd - <solar@g.o>
171 * Copyright 2005-2013 Mike Frysinger - <vapier@g.o>
172 *
173 * All the junk in one trunk!
174 */
175
176 #ifndef _PORTING_H
177 #define _PORTING_H
178
179 #ifdef HAVE_CONFIG_H
180 # include "config.h" /* make sure we have EPREFIX, if set */
181 #endif
182
183 #ifndef _GNU_SOURCE
184 #define _GNU_SOURCE
185 #endif
186 #ifndef _FILE_OFFSET_BITS
187 #define _FILE_OFFSET_BITS 64 /* #471024 */
188 #endif
189 #ifdef _AIX
190 #define _LINUX_SOURCE_COMPAT
191 #endif
192
193 #include <assert.h>
194 #include <ctype.h>
195 #include <dirent.h>
196 #include <errno.h>
197 #include <getopt.h>
198 #ifndef __INTERIX
199 #include <inttypes.h>
200 #endif
201 #include <libgen.h>
202 #include <limits.h>
203 #include <regex.h>
204 #include <stdarg.h>
205 #include <stdbool.h>
206 #include <stdio.h>
207 #include <stdlib.h>
208 #include <string.h>
209 #include <time.h>
210 #include <unistd.h>
211
212 #include <sys/stat.h>
213 #include <sys/time.h>
214 #include <sys/types.h>
215
216 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(*(arr)))
217
218 #ifndef BUFSIZE
219 # define BUFSIZE 8192
220 #endif
221
222 #ifndef MIN
223 #define MIN(x, y) ((x) < (y) ? (x) : (y))
224 #endif
225 #ifndef MAX
226 #define MAX(x, y) ((x) < (y) ? (y) : (x))
227 #endif
228
229 /* Easy enough to glue to older versions */
230 #ifndef O_CLOEXEC
231 #define O_CLOEXEC 0
232 #endif
233
234 #ifndef CONFIG_EPREFIX
235 #define CONFIG_EPREFIX "/"
236 #endif
237
238 #endif