author | Michael Krelin <hacker@klever.net> | 2007-02-21 00:54:53 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-02-21 00:54:53 (UTC) |
commit | 7232b0256da0c1b1577ce3bf55868d74f36f4dd4 (patch) (unidiff) | |
tree | 11324c1b2f045a39594c757845389d9808608115 | |
parent | a76fc1c7bbf5bc64dbb377752c98414b62af8353 (diff) | |
download | misc-7232b0256da0c1b1577ce3bf55868d74f36f4dd4.zip misc-7232b0256da0c1b1577ce3bf55868d74f36f4dd4.tar.gz misc-7232b0256da0c1b1577ce3bf55868d74f36f4dd4.tar.bz2 |
mergelog: added splitlog patch
-rw-r--r-- | profiles/arch.list | 3 | ||||
-rw-r--r-- | profiles/thirdpartymirrors | 2 | ||||
-rw-r--r-- | profiles/use.local.desc | 1 | ||||
-rw-r--r-- | www-misc/mergelog/Manifest | 12 | ||||
-rw-r--r-- | www-misc/mergelog/files/mergelog-split.patch | 516 | ||||
-rw-r--r-- | www-misc/mergelog/mergelog-4.5.ebuild | 21 |
6 files changed, 547 insertions, 8 deletions
diff --git a/profiles/arch.list b/profiles/arch.list new file mode 100644 index 0000000..7dc6bdd --- a/dev/null +++ b/profiles/arch.list | |||
@@ -0,0 +1,3 @@ | |||
1 | amd64 | ||
2 | ppc | ||
3 | x86 | ||
diff --git a/profiles/thirdpartymirrors b/profiles/thirdpartymirrors new file mode 100644 index 0000000..469f52f --- a/dev/null +++ b/profiles/thirdpartymirrors | |||
@@ -0,0 +1,2 @@ | |||
1 | sourceforgehttp://osdn.dl.sourceforge.net/sourceforge http://easynews.dl.sourceforge.net/sourceforge http://heanet.dl.sourceforge.net/sourceforge http://jaist.dl.sourceforge.net/sourceforge http://keihanna.dl.sourceforge.net/sourceforge http://kent.dl.sourceforge.net/sourceforge http://mesh.dl.sourceforge.net/sourceforge http://nchc.dl.sourceforge.net/sourceforge http://ovh.dl.sourceforge.net/sourceforge http://surfnet.dl.sourceforge.net/sourceforge http://switch.dl.sourceforge.net/sourceforge http://ufpr.dl.sourceforge.net/sourceforge | ||
2 | |||
diff --git a/profiles/use.local.desc b/profiles/use.local.desc new file mode 100644 index 0000000..d2b5d86 --- a/dev/null +++ b/profiles/use.local.desc | |||
@@ -0,0 +1 @@ | |||
www-misc/mergelog:splitlog - Enable splitlog functionality | |||
diff --git a/www-misc/mergelog/Manifest b/www-misc/mergelog/Manifest index 52c5c07..569a966 100644 --- a/www-misc/mergelog/Manifest +++ b/www-misc/mergelog/Manifest | |||
@@ -1,11 +1,15 @@ | |||
1 | AUX mergelog-split.patch 16343 RMD160 314dc54a99913b0b35689732a92654c019ff76e1 SHA1 97bbaeeaf44126645fdad339aa4d20aa7589f5ed SHA256 cf1a462e63899bb42eedd5b83c50affb20a929ab22b927620da8abbc30d62fc0 | ||
2 | MD5 e4b9af887aa72b82cfd3e694765ceeae files/mergelog-split.patch 16343 | ||
3 | RMD160 314dc54a99913b0b35689732a92654c019ff76e1 files/mergelog-split.patch 16343 | ||
4 | SHA256 cf1a462e63899bb42eedd5b83c50affb20a929ab22b927620da8abbc30d62fc0 files/mergelog-split.patch 16343 | ||
1 | DIST mergelog-4.5.tar.gz 39407 RMD160 19e7d067816ebab79da30ab326aa7aa49c3f6ab0 SHA1 bc9bdfddc561301e417a2de949ce3c4203b54c94 SHA256 fd97c5b9ae88fbbf57d3be8d81c479e0df081ed9c4a0ada48b1ab8248a82676d | 5 | DIST mergelog-4.5.tar.gz 39407 RMD160 19e7d067816ebab79da30ab326aa7aa49c3f6ab0 SHA1 bc9bdfddc561301e417a2de949ce3c4203b54c94 SHA256 fd97c5b9ae88fbbf57d3be8d81c479e0df081ed9c4a0ada48b1ab8248a82676d |
2 | EBUILD mergelog-4.5.ebuild 666 RMD160 6d79bcd4ae13f0c328ee17ce37da851c885b9f93 SHA1 40ebadea358b67e7db2b1a5241c8c71a08066d9c SHA256 e2e4cc8e923cad0b5f304914cd06c83d3a7854dc66af1cb767a7bf6d5ba7cb2d | 6 | EBUILD mergelog-4.5.ebuild 746 RMD160 87f2f0c281171b45d3d93c51f4ba2d62fd43f7b1 SHA1 f34d5ce5522da2068fd3c78e46622f57b9d5f811 SHA256 36b07d8603b5d0d424147d04f2d9b414c16f7523d873d58d6f44145b66e8c642 |
3 | MD5 0b44f7aa04e447cca91625c55fa948c1 mergelog-4.5.ebuild 666 | 7 | MD5 fc60ae699248054729710d1d476f9c7b mergelog-4.5.ebuild 746 |
4 | RMD160 6d79bcd4ae13f0c328ee17ce37da851c885b9f93 mergelog-4.5.ebuild 666 | 8 | RMD160 87f2f0c281171b45d3d93c51f4ba2d62fd43f7b1 mergelog-4.5.ebuild 746 |
5 | SHA256 e2e4cc8e923cad0b5f304914cd06c83d3a7854dc66af1cb767a7bf6d5ba7cb2d mergelog-4.5.ebuild 666 | 9 | SHA256 36b07d8603b5d0d424147d04f2d9b414c16f7523d873d58d6f44145b66e8c642 mergelog-4.5.ebuild 746 |
6 | MISC ChangeLog 1074 RMD160 f99b633203753c1b928ae114e9e592bcf1fc4bf4 SHA1 1bebcfefa6f9646ef135cda9da8938cc0679d98f SHA256 3cb577c0cab0ba6cea0d038fd1400d122948b2c64e06694bf2b460047b8c15ea | 10 | MISC ChangeLog 1074 RMD160 f99b633203753c1b928ae114e9e592bcf1fc4bf4 SHA1 1bebcfefa6f9646ef135cda9da8938cc0679d98f SHA256 3cb577c0cab0ba6cea0d038fd1400d122948b2c64e06694bf2b460047b8c15ea |
7 | MD5 21aa020bc18331c4d91c20bc03be1208 ChangeLog 1074 | 11 | MD5 21aa020bc18331c4d91c20bc03be1208 ChangeLog 1074 |
8 | RMD160 f99b633203753c1b928ae114e9e592bcf1fc4bf4 ChangeLog 1074 | 12 | RMD160 f99b633203753c1b928ae114e9e592bcf1fc4bf4 ChangeLog 1074 |
9 | SHA256 3cb577c0cab0ba6cea0d038fd1400d122948b2c64e06694bf2b460047b8c15ea ChangeLog 1074 | 13 | SHA256 3cb577c0cab0ba6cea0d038fd1400d122948b2c64e06694bf2b460047b8c15ea ChangeLog 1074 |
10 | MISC metadata.xml 501 RMD160 79f77bdfc5f207f47a3e1d77b571eed20f1cc162 SHA1 55327763075528fc1854719cd85a10db3c29735d SHA256 4c9a94dc644d343e5283715a8d5fbaa4bb4aa93b34e759c90da14cae3d9e7730 | 14 | MISC metadata.xml 501 RMD160 79f77bdfc5f207f47a3e1d77b571eed20f1cc162 SHA1 55327763075528fc1854719cd85a10db3c29735d SHA256 4c9a94dc644d343e5283715a8d5fbaa4bb4aa93b34e759c90da14cae3d9e7730 |
11 | MD5 5b6dd438f81019e56fa641841c0c13fe metadata.xml 501 | 15 | MD5 5b6dd438f81019e56fa641841c0c13fe metadata.xml 501 |
diff --git a/www-misc/mergelog/files/mergelog-split.patch b/www-misc/mergelog/files/mergelog-split.patch new file mode 100644 index 0000000..e542107 --- a/dev/null +++ b/www-misc/mergelog/files/mergelog-split.patch | |||
@@ -0,0 +1,516 @@ | |||
1 | diff -car mergelog-4.5.orig/configure.in mergelog-4.5/configure.in | ||
2 | *** mergelog-4.5.orig/configure.inWed Apr 11 13:55:58 2001 | ||
3 | --- mergelog-4.5/configure.inFri Jun 22 18:17:12 2001 | ||
4 | *************** | ||
5 | *** 2,8 **** | ||
6 | AC_INIT(src/mergelog.c) | ||
7 | |||
8 | PACKAGE=mergelog | ||
9 | ! VERSION=4.5 | ||
10 | AM_INIT_AUTOMAKE($PACKAGE,$VERSION,nosubst) | ||
11 | |||
12 | AC_ARG_PROGRAM | ||
13 | --- 2,8 ---- | ||
14 | AC_INIT(src/mergelog.c) | ||
15 | |||
16 | PACKAGE=mergelog | ||
17 | ! VERSION=4.5-split | ||
18 | AM_INIT_AUTOMAKE($PACKAGE,$VERSION,nosubst) | ||
19 | |||
20 | AC_ARG_PROGRAM | ||
21 | diff -car mergelog-4.5.orig/man/mergelog.1 mergelog-4.5/man/mergelog.1 | ||
22 | *** mergelog-4.5.orig/man/mergelog.1Mon Mar 5 12:45:30 2001 | ||
23 | --- mergelog-4.5/man/mergelog.1Wed Jun 20 22:16:20 2001 | ||
24 | *************** | ||
25 | *** 1,8 **** | ||
26 | ! .TH MERGELOG 1 "22 Jan 2001" | ||
27 | .SH NAME | ||
28 | mergelog \- a fast tool to merge http log files by date | ||
29 | .SH SYNOPSIS | ||
30 | .B mergelog | ||
31 | .IR logfile1 | ||
32 | .IR logfile2 \ ... | ||
33 | .SH DESCRIPTION | ||
34 | --- 1,9 ---- | ||
35 | ! .TH MERGELOG 1 "20 Jun 2001" | ||
36 | .SH NAME | ||
37 | mergelog \- a fast tool to merge http log files by date | ||
38 | .SH SYNOPSIS | ||
39 | .B mergelog | ||
40 | + .IR [-vh]\ [-o\ outfmt] | ||
41 | .IR logfile1 | ||
42 | .IR logfile2 \ ... | ||
43 | .SH DESCRIPTION | ||
44 | diff -car mergelog-4.5.orig/man/zmergelog.1 mergelog-4.5/man/zmergelog.1 | ||
45 | *** mergelog-4.5.orig/man/zmergelog.1Mon Mar 5 12:45:42 2001 | ||
46 | --- mergelog-4.5/man/zmergelog.1Wed Jun 20 22:16:13 2001 | ||
47 | *************** | ||
48 | *** 1,8 **** | ||
49 | ! .TH ZMERGELOG 1 "22 Jan 2001" | ||
50 | .SH NAME | ||
51 | zmergelog \- a fast tool to merge gzipped http log files by date | ||
52 | .SH SYNOPSIS | ||
53 | .B zmergelog | ||
54 | .IR logfile1 | ||
55 | .IR logfile2 \ ... | ||
56 | .SH DESCRIPTION | ||
57 | --- 1,9 ---- | ||
58 | ! .TH ZMERGELOG 1 "20 Jun 2001" | ||
59 | .SH NAME | ||
60 | zmergelog \- a fast tool to merge gzipped http log files by date | ||
61 | .SH SYNOPSIS | ||
62 | .B zmergelog | ||
63 | + .IR [-vh]\ [-o\ outfmt] | ||
64 | .IR logfile1 | ||
65 | .IR logfile2 \ ... | ||
66 | .SH DESCRIPTION | ||
67 | diff -car mergelog-4.5.orig/src/mergelog.c mergelog-4.5/src/mergelog.c | ||
68 | *** mergelog-4.5.orig/src/mergelog.cWed Apr 11 13:54:53 2001 | ||
69 | --- mergelog-4.5/src/mergelog.cFri Jun 22 17:16:05 2001 | ||
70 | *************** | ||
71 | *** 45,56 **** | ||
72 | --- 45,60 ---- | ||
73 | #define mygets(a,b,c,d) fast_gzgets(a,b,c,d) | ||
74 | #define myrewind gzrewind | ||
75 | #define myclose gzclose | ||
76 | + #define mywrite(f,b,l) gzwrite((f),(b),(l)) | ||
77 | + #define MYSUFFIX ".gz" | ||
78 | #else | ||
79 | #define myFH FILE | ||
80 | #define myopen fopen | ||
81 | #define mygets(a,b,c,d) fgets(a,b,c) | ||
82 | #define myrewind rewind | ||
83 | #define myclose fclose | ||
84 | + #define mywrite(f,b,l) fwrite((b),1,(l),(f)) | ||
85 | + #define MYSUFFIX | ||
86 | #endif | ||
87 | |||
88 | |||
89 | *************** | ||
90 | *** 112,131 **** | ||
91 | char *trans_digits[60]; | ||
92 | char *trans_year[200]; | ||
93 | char months[24]="anebarprayunulugepctovec"; | ||
94 | |||
95 | ! /* | ||
96 | ! print usage if necessary | ||
97 | ! */ | ||
98 | ! if (argc == 1) { | ||
99 | ! fprintf(stderr,"usage: %s logfile1 logfile2 ...\nmergelog %s Copyright (C) 2000-2001 Bertrand Demiddelaer\n",argv[0],VERSION); | ||
100 | exit(1); | ||
101 | } | ||
102 | |||
103 | #ifdef USE_ZLIB | ||
104 | /* | ||
105 | check if there are enough gunzip buffers | ||
106 | */ | ||
107 | ! if(argc>MAX_FILES) { | ||
108 | fputs("too many gzipped log files, aborting\n",stderr); | ||
109 | exit(1); | ||
110 | } | ||
111 | --- 116,256 ---- | ||
112 | char *trans_digits[60]; | ||
113 | char *trans_year[200]; | ||
114 | char months[24]="anebarprayunulugepctovec"; | ||
115 | + int goc; | ||
116 | + int goUsage = 0, goVerbose = 0; | ||
117 | + const char* goOutput = NULL; | ||
118 | + const char* argv0 = *argv; | ||
119 | + struct tm gotmFlags; | ||
120 | + const char* goOutPtr; | ||
121 | + myFH *outFile = NULL; | ||
122 | + char outFileName[512]; | ||
123 | + struct tm outFileTM; | ||
124 | + char outFileNewName[512]; | ||
125 | + size_t outBytes; | ||
126 | + | ||
127 | + while((goc=getopt(argc,argv,"vho:"))!=-1) { | ||
128 | + switch(goc) { | ||
129 | + case 'h': /* -h print usage */ | ||
130 | + goUsage++; | ||
131 | + break; | ||
132 | + case 'v': /* -v verbose */ | ||
133 | + goVerbose++; | ||
134 | + break; | ||
135 | + case 'o': /* -o fmt output specification */ | ||
136 | + goOutput = optarg; | ||
137 | + break; | ||
138 | + default: /* whatever.. but we better print out usage */ | ||
139 | + goUsage++; | ||
140 | + break; | ||
141 | + } | ||
142 | + } | ||
143 | + argv = &argv[optind]; | ||
144 | + argc -= optind; | ||
145 | |||
146 | ! if(argc<1) | ||
147 | ! goUsage++; | ||
148 | ! if(goUsage) { | ||
149 | ! printf( | ||
150 | ! "mergelog " VERSION " Copyright (c) 2000-2001 Bertrand Demiddelaer\n\n" | ||
151 | ! "I have at least %d reason(s) for lending you a helping hand on using the program.\n\n" | ||
152 | ! "Usage: %s [-vh] [-o fmt] logfile1 logfile2 ..\n\n" | ||
153 | ! " -h Print this message\n" | ||
154 | ! " -v Increase verbosity\n" | ||
155 | ! " -o Give template for output file name to write log to\n" | ||
156 | ! " instead of standard output in strftime(3) form.\n" | ||
157 | ! " ( eg. -o %%Y-%%m-%%d-access.log" MYSUFFIX ")\n", | ||
158 | ! goUsage,argv0); | ||
159 | exit(1); | ||
160 | } | ||
161 | |||
162 | + /* Analyze output format if given. It's better than trying to | ||
163 | + * regenerate file name and compare it to the filename currently being | ||
164 | + * written each time we want to dump one line. */ | ||
165 | + if(goOutput) { | ||
166 | + memset(&gotmFlags,0,sizeof(gotmFlags)); | ||
167 | + for(goOutPtr=goOutput;*goOutPtr;goOutPtr++) { | ||
168 | + if( (*goOutPtr=='%') && goOutPtr[1]) { | ||
169 | + switch(*(++goOutPtr)) { | ||
170 | + case 'a': /* abbreviated weekday */ | ||
171 | + case 'A': /* full weekday */ | ||
172 | + case 'u': /* day of week number */ | ||
173 | + case 'w': /* zerobased weekday number */ | ||
174 | + gotmFlags.tm_wday = 1; | ||
175 | + break; | ||
176 | + case 'b': /* abbreviated month */ | ||
177 | + case 'h': /* %b */ | ||
178 | + case 'B': /* full month */ | ||
179 | + case 'm': /* month number */ | ||
180 | + gotmFlags.tm_mon = 1; | ||
181 | + break; | ||
182 | + case 'C': /* century */ | ||
183 | + case 'y': /* centuryless year */ | ||
184 | + case 'Y': /* year with a century */ | ||
185 | + gotmFlags.tm_year = 1; | ||
186 | + break; | ||
187 | + case 'd': /* day of month */ | ||
188 | + case 'e': /* day of month space padded */ | ||
189 | + gotmFlags.tm_mday = 1; | ||
190 | + break; | ||
191 | + case 'D': /* %m/%d/%y americanism */ | ||
192 | + gotmFlags.tm_mon = gotmFlags.tm_mday = gotmFlags.tm_year = 1; | ||
193 | + break; | ||
194 | + case 'G': /* ISO 8601 year repsesentation. depends on week */ | ||
195 | + case 'g': /* ISO 8601 year repsesentation without century. depends on week */ | ||
196 | + case 'U': /* sunday-based week number */ | ||
197 | + case 'V': /* ISO 8601 week number */ | ||
198 | + case 'W': /* monday-based week number */ | ||
199 | + case 'x': /* preferred date representation for locale without the time */ | ||
200 | + gotmFlags.tm_yday = gotmFlags.tm_year = 1; | ||
201 | + break; | ||
202 | + case 'H': /* 24h format hour */ | ||
203 | + case 'I': /* 12h format hour */ | ||
204 | + case 'k': /* 24h format hour space padded */ | ||
205 | + case 'l': /* 12h format hour space padded */ | ||
206 | + case 'p': /* AM/PM indicator */ | ||
207 | + case 'P': /* am/pm indicator */ | ||
208 | + gotmFlags.tm_hour = 1; | ||
209 | + break; | ||
210 | + case 'j': /* day of year */ | ||
211 | + gotmFlags.tm_yday = 1; | ||
212 | + break; | ||
213 | + case 'M': /* minute */ | ||
214 | + gotmFlags.tm_min = 1; | ||
215 | + break; | ||
216 | + case 'n': /* newline character */ | ||
217 | + case 't': /* tab character */ | ||
218 | + case 'z': /* time zone as an offset from GMT */ | ||
219 | + case 'Z': /* timezone name or abbreviation */ | ||
220 | + case '%': /* % character */ | ||
221 | + break; | ||
222 | + case 'r': /* %I:%M:%S %p time in am/pm notation*/ | ||
223 | + case 'T': /* %H:%M:%S time in 24h notation */ | ||
224 | + case 'X': /* preferred time representation for locale without the date */ | ||
225 | + gotmFlags.tm_hour = gotmFlags.tm_min = gotmFlags.tm_sec = 1; | ||
226 | + break; | ||
227 | + case 'R': /* %H:%M time in 24h notation without seconds */ | ||
228 | + gotmFlags.tm_hour = gotmFlags.tm_min = 1; | ||
229 | + break; | ||
230 | + case 'S': /* second */ | ||
231 | + gotmFlags.tm_sec = 1; | ||
232 | + break; | ||
233 | + case 'c': /* preferred date and time representation for locale */ | ||
234 | + case 'E': /* weird modifier */ | ||
235 | + case 'O': /* weird modifier */ | ||
236 | + case 's': /* number of seconds since epoch */ | ||
237 | + case '+': /* date and time in date(1) format */ | ||
238 | + memset(&gotmFlags,0xFF,sizeof(gotmFlags)); | ||
239 | + break; | ||
240 | + } | ||
241 | + } | ||
242 | + } | ||
243 | + } | ||
244 | + | ||
245 | #ifdef USE_ZLIB | ||
246 | /* | ||
247 | check if there are enough gunzip buffers | ||
248 | */ | ||
249 | ! if(argc>=MAX_FILES) { | ||
250 | fputs("too many gzipped log files, aborting\n",stderr); | ||
251 | exit(1); | ||
252 | } | ||
253 | *************** | ||
254 | *** 134,142 **** | ||
255 | /* | ||
256 | open log files | ||
257 | */ | ||
258 | ! for (i=1;i<argc;i++) { | ||
259 | ! log_file[i-1]=myopen(argv[i],"r"); | ||
260 | ! if (log_file[i-1] == NULL) { | ||
261 | fprintf(stderr,"can't open %s, aborting\n",argv[i]); | ||
262 | exit(1); | ||
263 | } | ||
264 | --- 259,267 ---- | ||
265 | /* | ||
266 | open log files | ||
267 | */ | ||
268 | ! for (i=0;i<argc;i++) { | ||
269 | ! log_file[i]=myopen(argv[i],"r"); | ||
270 | ! if (log_file[i] == NULL) { | ||
271 | fprintf(stderr,"can't open %s, aborting\n",argv[i]); | ||
272 | exit(1); | ||
273 | } | ||
274 | *************** | ||
275 | *** 174,181 **** | ||
276 | /* | ||
277 | init things for each log file and get the older date to start with | ||
278 | */ | ||
279 | ! nb_files=argc-1; | ||
280 | ! for (i=0;i<argc-1;i++) { | ||
281 | |||
282 | #ifdef USE_ZLIB | ||
283 | /* | ||
284 | --- 299,306 ---- | ||
285 | /* | ||
286 | init things for each log file and get the older date to start with | ||
287 | */ | ||
288 | ! nb_files=argc; | ||
289 | ! for (i=0;i<argc;i++) { | ||
290 | |||
291 | #ifdef USE_ZLIB | ||
292 | /* | ||
293 | *************** | ||
294 | *** 230,236 **** | ||
295 | */ | ||
296 | log_date=memchr(log_scan[i],'[',SCAN_SIZE); | ||
297 | if (log_date == NULL) { | ||
298 | ! fprintf(stderr,"abort due to a problem with %s:\n%s\n",argv[i+1],log_buffer[i]); | ||
299 | exit(1); | ||
300 | } | ||
301 | |||
302 | --- 355,361 ---- | ||
303 | */ | ||
304 | log_date=memchr(log_scan[i],'[',SCAN_SIZE); | ||
305 | if (log_date == NULL) { | ||
306 | ! fprintf(stderr,"abort due to a problem with %s:\n%s\n",argv[i],log_buffer[i]); | ||
307 | exit(1); | ||
308 | } | ||
309 | |||
310 | *************** | ||
311 | *** 239,245 **** | ||
312 | */ | ||
313 | for (j=0;((j == 12)&&(memcmp(months+2*j,log_date+5,2) != 0));j++); | ||
314 | if (j == 12) { | ||
315 | ! fprintf(stderr,"abort due to a problem with %s:\n%s\n",argv[i+1],log_buffer[i]); | ||
316 | exit(1); | ||
317 | } | ||
318 | memcpy(log_month[i],trans_digits[j],2); | ||
319 | --- 364,370 ---- | ||
320 | */ | ||
321 | for (j=0;((j == 12)&&(memcmp(months+2*j,log_date+5,2) != 0));j++); | ||
322 | if (j == 12) { | ||
323 | ! fprintf(stderr,"abort due to a problem with %s:\n%s\n",argv[i],log_buffer[i]); | ||
324 | exit(1); | ||
325 | } | ||
326 | memcpy(log_month[i],trans_digits[j],2); | ||
327 | *************** | ||
328 | *** 255,261 **** | ||
329 | extract the date of this first line | ||
330 | */ | ||
331 | if (sscanf(log_date+1,"%d/%3c/%d:%d:%d:%d",&day,month,&year,&hour,&minut,&second) < 6) { | ||
332 | ! fprintf(stderr,"abort due to a problem with %s:\n%s\n",argv[i+1],log_buffer[i]); | ||
333 | exit(1); | ||
334 | } | ||
335 | |||
336 | --- 380,386 ---- | ||
337 | extract the date of this first line | ||
338 | */ | ||
339 | if (sscanf(log_date+1,"%d/%3c/%d:%d:%d:%d",&day,month,&year,&hour,&minut,&second) < 6) { | ||
340 | ! fprintf(stderr,"abort due to a problem with %s:\n%s\n",argv[i],log_buffer[i]); | ||
341 | exit(1); | ||
342 | } | ||
343 | |||
344 | *************** | ||
345 | *** 270,276 **** | ||
346 | date->tm_isdst=-1; | ||
347 | for (j=0;((j<12)&&(memcmp(months+2*j,month+1,2) != 0));j++); | ||
348 | if (j == 12) { | ||
349 | ! fprintf(stderr,"abort due to a problem with %s:\n%s\n",argv[i+1],log_buffer[i]); | ||
350 | exit(1); | ||
351 | } | ||
352 | date->tm_mon=j; | ||
353 | --- 395,401 ---- | ||
354 | date->tm_isdst=-1; | ||
355 | for (j=0;((j<12)&&(memcmp(months+2*j,month+1,2) != 0));j++); | ||
356 | if (j == 12) { | ||
357 | ! fprintf(stderr,"abort due to a problem with %s:\n%s\n",argv[i],log_buffer[i]); | ||
358 | exit(1); | ||
359 | } | ||
360 | date->tm_mon=j; | ||
361 | *************** | ||
362 | *** 303,308 **** | ||
363 | --- 428,435 ---- | ||
364 | exit if we have only empty files | ||
365 | */ | ||
366 | if (nb_files == 0) { | ||
367 | + if(outFile) | ||
368 | + myclose(outFile); | ||
369 | exit(0); | ||
370 | } | ||
371 | |||
372 | *************** | ||
373 | *** 323,329 **** | ||
374 | /* | ||
375 | start to compute since this date | ||
376 | */ | ||
377 | ! nb_files_orig=argc-1; | ||
378 | for(;;) { | ||
379 | |||
380 | /* | ||
381 | --- 450,456 ---- | ||
382 | /* | ||
383 | start to compute since this date | ||
384 | */ | ||
385 | ! nb_files_orig=argc; | ||
386 | for(;;) { | ||
387 | |||
388 | /* | ||
389 | *************** | ||
390 | *** 377,383 **** | ||
391 | write the log line | ||
392 | faster than a puts and we are sure to find a '\0' in log_buffer[i] | ||
393 | */ | ||
394 | ! write(1,log_buffer[i],(size_t)((char *)memchr(log_buffer[i],0,BUFFER_SIZE)-log_buffer[i])); | ||
395 | |||
396 | /* | ||
397 | is it an end of file ? | ||
398 | --- 504,558 ---- | ||
399 | write the log line | ||
400 | faster than a puts and we are sure to find a '\0' in log_buffer[i] | ||
401 | */ | ||
402 | ! if(goOutput) { | ||
403 | ! /* Check whether any of the date/time components concerned | ||
404 | ! * have changes or if we have no output file opened. It | ||
405 | ! * doesn't make much sense to do all the comparinsons in case | ||
406 | ! * we have no output file opened, but it makes even less sense | ||
407 | ! * to check for file handle each time we evaluate date. */ | ||
408 | ! if( | ||
409 | ! # define TMCOMPARE(tmpart) ( gotmFlags.tm_##tmpart && (outFileTM.tm_##tmpart!=date->tm_##tmpart) ) | ||
410 | ! TMCOMPARE(sec) || TMCOMPARE(min) || TMCOMPARE(hour) | ||
411 | ! || TMCOMPARE(mday) || TMCOMPARE(mon) || TMCOMPARE(year) | ||
412 | ! || TMCOMPARE(wday) || TMCOMPARE(yday) | ||
413 | ! || !outFile | ||
414 | ! # undef TMCOMPARE | ||
415 | ! ) { | ||
416 | ! if(!strftime(outFileNewName,sizeof(outFileNewName)-1,goOutput,date)) { | ||
417 | ! fprintf(stderr,"abort due to a failed attempt to generate output file name\n"); | ||
418 | ! if(outFile) | ||
419 | ! myclose(outFile); | ||
420 | ! exit(1); | ||
421 | ! } | ||
422 | ! if( (!outFile) || strcmp(outFileName,outFileNewName) ) { | ||
423 | ! /* okay, we're about to change output file or start | ||
424 | ! * writing first file */ | ||
425 | ! if(outFile) { | ||
426 | ! myclose(outFile); | ||
427 | ! } | ||
428 | ! if(goVerbose) | ||
429 | ! fprintf(stderr, "Writing to \"%s\"..\n",outFileNewName); | ||
430 | ! outFile = myopen(outFileNewName,"a"); | ||
431 | ! if(!outFile) { | ||
432 | ! fprintf(stderr, "abort due to a failed attempt to open/create output file %s: %m\n",outFileNewName); | ||
433 | ! exit(1); | ||
434 | ! } | ||
435 | ! memmove(outFileName,outFileNewName,sizeof(outFileName)); | ||
436 | ! memmove(&outFileTM,date,sizeof(outFileTM)); | ||
437 | ! } | ||
438 | ! } | ||
439 | ! /* %Y-%m-%d_%H-%M-%S-access.log */ | ||
440 | ! outBytes = (size_t)((char *)memchr(log_buffer[i],0,BUFFER_SIZE)-log_buffer[i]); | ||
441 | ! if( mywrite(outFile,log_buffer[i],outBytes) != outBytes) { | ||
442 | ! fprintf(stderr,"abort due to a failed write operation on output file %s: %m\n",outFileName); | ||
443 | ! if(outFile) | ||
444 | ! myclose(outFile); | ||
445 | ! exit(1); | ||
446 | ! } | ||
447 | ! }else{ | ||
448 | ! /* do it the way we would do without */ | ||
449 | ! write(1,log_buffer[i],(size_t)((char *)memchr(log_buffer[i],0,BUFFER_SIZE)-log_buffer[i])); | ||
450 | ! } | ||
451 | |||
452 | /* | ||
453 | is it an end of file ? | ||
454 | *************** | ||
455 | *** 388,394 **** | ||
456 | close all log files and exit if all end of files are reached | ||
457 | */ | ||
458 | if (--nb_files == 0) { | ||
459 | ! for (j=0;j<argc-1;j++) { | ||
460 | myclose(log_file[j]); | ||
461 | } | ||
462 | exit(0); | ||
463 | --- 563,571 ---- | ||
464 | close all log files and exit if all end of files are reached | ||
465 | */ | ||
466 | if (--nb_files == 0) { | ||
467 | ! if(outFile) | ||
468 | ! myclose(outFile); | ||
469 | ! for (j=0;j<argc;j++) { | ||
470 | myclose(log_file[j]); | ||
471 | } | ||
472 | exit(0); | ||
473 | *************** | ||
474 | *** 425,431 **** | ||
475 | } else { | ||
476 | for (j=0;((j<12)&&(memcmp(months+2*j,log_date+5,2) != 0));j++); | ||
477 | if (j == 12) { | ||
478 | ! fprintf(stderr,"problem with %s:\n%s\ncontinuing...\n",argv[i+1],log_buffer[i]); | ||
479 | } else { | ||
480 | memcpy(log_month[i],trans_digits[j],2); | ||
481 | memcpy(log_month[i]+2,months+2*j,2); | ||
482 | --- 602,608 ---- | ||
483 | } else { | ||
484 | for (j=0;((j<12)&&(memcmp(months+2*j,log_date+5,2) != 0));j++); | ||
485 | if (j == 12) { | ||
486 | ! fprintf(stderr,"problem with %s:\n%s\ncontinuing...\n",argv[i],log_buffer[i]); | ||
487 | } else { | ||
488 | memcpy(log_month[i],trans_digits[j],2); | ||
489 | memcpy(log_month[i]+2,months+2*j,2); | ||
490 | *************** | ||
491 | *** 439,445 **** | ||
492 | } | ||
493 | } | ||
494 | } else { | ||
495 | ! fprintf(stderr,"problem with %s:\n%s\ncontinuing...\n",argv[i+1],log_buffer[i]); | ||
496 | } | ||
497 | } | ||
498 | } | ||
499 | --- 616,622 ---- | ||
500 | } | ||
501 | } | ||
502 | } else { | ||
503 | ! fprintf(stderr,"problem with %s:\n%s\ncontinuing...\n",argv[i],log_buffer[i]); | ||
504 | } | ||
505 | } | ||
506 | } | ||
507 | *************** | ||
508 | *** 451,453 **** | ||
509 | --- 628,634 ---- | ||
510 | */ | ||
511 | exit(1); | ||
512 | } | ||
513 | + /* vim:set textwidth=72: */ | ||
514 | + /* vim:set cindent smartindent: */ | ||
515 | + /* vim:set formatoptions-=t formatoptions+=croql:*/ | ||
516 | + /* vim:set expandtab shiftwidth=2: */ | ||
diff --git a/www-misc/mergelog/mergelog-4.5.ebuild b/www-misc/mergelog/mergelog-4.5.ebuild index 3944793..e3c14e7 100644 --- a/www-misc/mergelog/mergelog-4.5.ebuild +++ b/www-misc/mergelog/mergelog-4.5.ebuild | |||
@@ -1,21 +1,34 @@ | |||
1 | # Copyright 1999-2006 Gentoo Foundation | 1 | # Copyright 1999-2006 Gentoo Foundation |
2 | # Distributed under the terms of the GNU General Public License v2 | 2 | # Distributed under the terms of the GNU General Public License v2 |
3 | # $Header: /var/cvsroot/gentoo-x86/www-misc/mergelog/mergelog-4.5.ebuild,v 1.3 2006/10/28 11:03:32 tomk Exp $ | 3 | # $Header: $ |
4 | |||
5 | inherit eutils autotools | ||
4 | 6 | ||
5 | DESCRIPTION="A utility to merge apache logs in chronological order" | 7 | DESCRIPTION="A utility to merge apache logs in chronological order" |
6 | SRC_URI="mirror://sourceforge/mergelog/${P}.tar.gz" | 8 | SRC_URI="mirror://sourceforge/mergelog/${P}.tar.gz" |
7 | HOMEPAGE="http://mergelog.sourceforge.net" | 9 | HOMEPAGE="http://mergelog.sourceforge.net" |
8 | 10 | ||
9 | IUSE="" | 11 | IUSE="splitlog" |
10 | SLOT="0" | 12 | SLOT="0" |
11 | LICENSE="GPL-2" | 13 | LICENSE="GPL-2" |
12 | KEYWORDS="~x86 ppc ~amd64" | 14 | KEYWORDS="~x86 ppc ~amd64" |
13 | 15 | ||
14 | DEPEND="virtual/libc" | 16 | DEPEND=" |
15 | RDEPEND="" | 17 | virtual/libc |
18 | splitlog? ( sys-devel/autoconf ) | ||
19 | " | ||
20 | |||
21 | src_unpack() { | ||
22 | unpack $A | ||
23 | cd $S | ||
24 | if use splitlog ; then | ||
25 | epatch ${FILESDIR}/${PN}-split.patch | ||
26 | eautoreconf | ||
27 | fi | ||
28 | } | ||
16 | 29 | ||
17 | src_compile() { | 30 | src_compile() { |
18 | econf || die "configure failed" | 31 | econf || die "configure failed" |
19 | emake || die "make failed" | 32 | emake || die "make failed" |
20 | } | 33 | } |
21 | 34 | ||