summaryrefslogtreecommitdiff
path: root/data/apt/port.diff
blob: 3ac2c0c6f936ab530eae1a30b459021be07efaa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
diff -ru apt-0.6.46.4.1/apt-inst/deb/dpkgdb.cc apt-0.6.46.4.1+iPhone/apt-inst/deb/dpkgdb.cc
--- apt-0.6.46.4.1/apt-inst/deb/dpkgdb.cc	2006-12-04 14:37:34.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/apt-inst/deb/dpkgdb.cc	2007-12-31 01:46:53.000000000 +0000
@@ -26,6 +26,7 @@
 
 #include <stdio.h>
 #include <errno.h>
+#include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/mman.h>
 #include <fcntl.h>
diff -ru apt-0.6.46.4.1/buildlib/environment.mak.in apt-0.6.46.4.1+iPhone/buildlib/environment.mak.in
--- apt-0.6.46.4.1/buildlib/environment.mak.in	2006-12-04 14:37:35.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/buildlib/environment.mak.in	2007-12-29 10:58:41.000000000 +0000
@@ -62,11 +62,11 @@
 
 # Shared library things
 HOST_OS = @host_os@
-ifneq ($(words $(filter linux-gnu gnu% %gnu,$(HOST_OS))),0)
-   SONAME_MAGIC=-Wl,-soname -Wl,
+#ifneq ($(words $(filter linux-gnu gnu% %gnu,$(HOST_OS))),0)
+   SONAME_MAGIC=
    LFLAGS_SO=
-else
+#else
    # Do not know how to create shared libraries here.
-   ONLYSTATICLIBS = yes
-endif
+#   ONLYSTATICLIBS = yes
+#endif
 	
diff -r -u apt-0.6.46.4/apt-inst/makefile apt-0.6.46.4.1+iPhone/apt-inst/makefile
--- apt-0.6.46.4/apt-inst/makefile	2006-12-04 14:37:34.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/apt-inst/makefile	2007-12-25 06:42:18.000000000 +0000
@@ -11,7 +11,8 @@
 
 # The library name
 LIBRARY=apt-inst
-LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
+LIBEXT=
+#$(GLIBC_VER)$(LIBSTDCPP_VER)
 MAJOR=1.1
 MINOR=0
 SLIBS=$(PTHREADLIB) -lapt-pkg
diff -r -u apt-0.6.46.4/apt-pkg/deb/dpkgpm.cc apt-0.6.46.4.1+iPhone/apt-pkg/deb/dpkgpm.cc
--- apt-0.6.46.4/apt-pkg/deb/dpkgpm.cc	2006-12-04 16:33:53.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/apt-pkg/deb/dpkgpm.cc	2007-12-24 11:22:47.000000000 +0000
@@ -511,6 +511,8 @@
       clog << flush;
       cerr << flush;
 
+      typedef void (*sighandler_t)(int);
+
       /* Mask off sig int/quit. We do this because dpkg also does when 
          it forks scripts. What happens is that when you hit ctrl-c it sends
 	 it to all processes in the group. Since dpkg ignores the signal 
diff -r -u apt-0.6.46.4/apt-pkg/init.cc apt-0.6.46.4.1+iPhone/apt-pkg/init.cc
--- apt-0.6.46.4/apt-pkg/init.cc	2006-12-04 14:37:34.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/apt-pkg/init.cc	2007-12-25 05:36:40.000000000 +0000
@@ -95,14 +95,6 @@
    if (Cnf.FindB("Debug::pkgInitConfig",false) == true)
       Cnf.Dump();
    
-#ifdef APT_DOMAIN
-   if (Cnf.Exists("Dir::Locale"))
-   {  
-      bindtextdomain(APT_DOMAIN,Cnf.FindDir("Dir::Locale").c_str());
-      bindtextdomain(textdomain(0),Cnf.FindDir("Dir::Locale").c_str());
-   }
-#endif
-   
    return true;
 }
 									/*}}}*/
diff -r -u apt-0.6.46.4/apt-pkg/makefile apt-0.6.46.4.1+iPhone/apt-pkg/makefile
--- apt-0.6.46.4/apt-pkg/makefile	2006-12-04 14:37:34.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/apt-pkg/makefile	2007-12-25 06:42:27.000000000 +0000
@@ -12,7 +12,8 @@
 # The library name, don't forget to update init.h and the copy in 
 # methods/makefile - FIXME
 LIBRARY=apt-pkg
-LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
+LIBEXT=
+#$(GLIBC_VER)$(LIBSTDCPP_VER)
 MAJOR=3.11
 MINOR=0
 SLIBS=$(PTHREADLIB) $(INTLLIBS)
diff -r -u apt-0.6.46.4/buildlib/library.mak apt-0.6.46.4.1+iPhone/buildlib/library.mak
--- apt-0.6.46.4/buildlib/library.mak	2006-12-04 14:37:35.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/buildlib/library.mak	2007-12-25 05:46:57.000000000 +0000
@@ -16,11 +16,11 @@
 # See defaults.mak for information about LOCAL
 
 # Some local definitions
-LOCAL := lib$(LIBRARY)$(LIBEXT).so.$(MAJOR).$(MINOR)
+LOCAL := lib$(LIBRARY)$(LIBEXT).dylib.$(MAJOR).$(MINOR)
 $(LOCAL)-OBJS := $(addprefix $(OBJ)/,$(addsuffix .opic,$(notdir $(basename $(SOURCE)))))
 $(LOCAL)-DEP := $(addprefix $(DEP)/,$(addsuffix .opic.d,$(notdir $(basename $(SOURCE)))))
 $(LOCAL)-HEADERS := $(addprefix $(INCLUDE)/,$(HEADERS))
-$(LOCAL)-SONAME := lib$(LIBRARY)$(LIBEXT).so.$(MAJOR)
+$(LOCAL)-SONAME := lib$(LIBRARY)$(LIBEXT).dylib.$(MAJOR)
 $(LOCAL)-SLIBS := $(SLIBS)
 $(LOCAL)-LIBRARY := $(LIBRARY)
 
@@ -29,7 +29,7 @@
 
 # Install the command hooks
 headers: $($(LOCAL)-HEADERS)
-library: $(LIB)/lib$(LIBRARY).so $(LIB)/lib$(LIBRARY)$(LIBEXT).so.$(MAJOR)
+library: $(LIB)/lib$(LIBRARY).dylib $(LIB)/lib$(LIBRARY)$(LIBEXT).dylib.$(MAJOR)
 clean: clean/$(LOCAL)
 veryclean: veryclean/$(LOCAL)
 
@@ -41,21 +41,21 @@
 clean/$(LOCAL):
 	-rm -f $($(@F)-OBJS) $($(@F)-DEP)
 veryclean/$(LOCAL): clean/$(LOCAL)
-	-rm -f $($(@F)-HEADERS) $(LIB)/lib$($(@F)-LIBRARY)*.so*
+	-rm -f $($(@F)-HEADERS) $(LIB)/lib$($(@F)-LIBRARY)*.dylib*
 
 # Build rules for the two symlinks
-.PHONY: $(LIB)/lib$(LIBRARY)$(LIBEXT).so.$(MAJOR) $(LIB)/lib$(LIBRARY).so
-$(LIB)/lib$(LIBRARY)$(LIBEXT).so.$(MAJOR): $(LIB)/lib$(LIBRARY)$(LIBEXT).so.$(MAJOR).$(MINOR)
+.PHONY: $(LIB)/lib$(LIBRARY)$(LIBEXT).dylib.$(MAJOR) $(LIB)/lib$(LIBRARY).dylib
+$(LIB)/lib$(LIBRARY)$(LIBEXT).dylib.$(MAJOR): $(LIB)/lib$(LIBRARY)$(LIBEXT).dylib.$(MAJOR).$(MINOR)
 	ln -sf $(<F) $@
-$(LIB)/lib$(LIBRARY).so: $(LIB)/lib$(LIBRARY)$(LIBEXT).so.$(MAJOR).$(MINOR)
+$(LIB)/lib$(LIBRARY).dylib: $(LIB)/lib$(LIBRARY)$(LIBEXT).dylib.$(MAJOR).$(MINOR)
 	ln -sf $(<F) $@
 
 # The binary build rule
-$(LIB)/lib$(LIBRARY)$(LIBEXT).so.$(MAJOR).$(MINOR): $($(LOCAL)-HEADERS) $($(LOCAL)-OBJS)
-	-rm -f $(LIB)/lib$($(@F)-LIBRARY)*.so* 2> /dev/null
+$(LIB)/lib$(LIBRARY)$(LIBEXT).dylib.$(MAJOR).$(MINOR): $($(LOCAL)-HEADERS) $($(LOCAL)-OBJS)
+	-rm -f $(LIB)/lib$($(@F)-LIBRARY)*.dylib* 2> /dev/null
 	echo Building shared library $@
 	$(CXX) $(CXXFLAGS) $(LDFLAGS) $(PICFLAGS) $(LFLAGS) $(LFLAGS_SO)\
-	   -o $@ $(SONAME_MAGIC)$($(@F)-SONAME) -shared \
+	   -o $@ -dynamiclib \
 	   $(filter %.opic,$^) \
 	   $($(@F)-SLIBS) 
 
diff -r -u apt-0.6.46.4/buildlib/podomain.mak apt-0.6.46.4.1+iPhone/buildlib/podomain.mak
--- apt-0.6.46.4/buildlib/podomain.mak	2006-12-04 14:37:35.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/buildlib/podomain.mak	2007-12-25 06:41:16.000000000 +0000
@@ -14,7 +14,8 @@
 $(PO_DOMAINS)/$(MY_DOMAIN)/$(LOCAL).$(TYPE)list: SRC := $(addprefix $(SUBDIR)/,$(SOURCE))
 $(PO_DOMAINS)/$(MY_DOMAIN)/$(LOCAL).$(TYPE)list: makefile
 	(echo $(SRC) | xargs -n1 echo) > $@
-binary program clean: $(PO_DOMAINS)/$(MY_DOMAIN)/$(LOCAL).$(TYPE)list
+binary program clean:
+#$(PO_DOMAINS)/$(MY_DOMAIN)/$(LOCAL).$(TYPE)list
 
 veryclean: veryclean/$(LOCAL)
 veryclean/po/$(LOCAL): LIST := $(PO_DOMAINS)/$(MY_DOMAIN)/$(LOCAL).$(TYPE)list
diff -r -u apt-0.6.46.4/buildlib/program.mak apt-0.6.46.4.1+iPhone/buildlib/program.mak
--- apt-0.6.46.4/buildlib/program.mak	2006-12-04 14:37:35.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/buildlib/program.mak	2007-12-25 05:26:04.000000000 +0000
@@ -44,6 +44,7 @@
 # The binary build rule
 $($(LOCAL)-BIN): $($(LOCAL)-OBJS) $($(LOCAL)-MKS)
 	echo Building program $@
+	echo $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LFLAGS) -o $@ $(filter %.o,$^) $($(@F)-SLIBS) $(LEFLAGS)
 	$(CXX) $(CXXFLAGS) $(LDFLAGS) $(LFLAGS) -o $@ $(filter %.o,$^) $($(@F)-SLIBS) $(LEFLAGS)
 
 # Compilation rules
diff -r -u apt-0.6.46.4/cmdline/apt-cache.cc apt-0.6.46.4.1+iPhone/cmdline/apt-cache.cc
--- apt-0.6.46.4/cmdline/apt-cache.cc	2006-12-04 14:37:35.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/cmdline/apt-cache.cc	2007-12-25 03:50:15.000000000 +0000
@@ -1704,7 +1704,11 @@
 }
 									/*}}}*/
 
-int main(int argc,const char *argv[])
+int main_(int argc,const char *argv[]);
+int main(int argc,const char *argv[]) {
+    _exit(main_(argc, argv));
+}
+int main_(int argc,const char *argv[])
 {
    CommandLine::Args Args[] = {
       {'h',"help","help",0},
@@ -1748,7 +1752,7 @@
 
    // Set up gettext support
    setlocale(LC_ALL,"");
-   textdomain(PACKAGE);
+   //textdomain(PACKAGE);
 
    // Parse the command line and initialize the package library
    CommandLine CmdL(Args,_config);
diff -r -u apt-0.6.46.4/cmdline/apt-cdrom.cc apt-0.6.46.4.1+iPhone/cmdline/apt-cdrom.cc
--- apt-0.6.46.4/cmdline/apt-cdrom.cc	2006-12-04 14:37:35.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/cmdline/apt-cdrom.cc	2007-12-25 03:50:24.000000000 +0000
@@ -165,7 +165,11 @@
 }
 									/*}}}*/
 
-int main(int argc,const char *argv[])
+int main_(int argc,const char *argv[]);
+int main(int argc,const char *argv[]) {
+    _exit(main_(argc, argv));
+}
+int main_(int argc,const char *argv[])
 {
    CommandLine::Args Args[] = {
       {'h',"help","help",0},
@@ -188,7 +192,7 @@
 
    // Set up gettext support
    setlocale(LC_ALL,"");
-   textdomain(PACKAGE);
+   //textdomain(PACKAGE);
 
    // Parse the command line and initialize the package library
    CommandLine CmdL(Args,_config);
diff -r -u apt-0.6.46.4/cmdline/apt-config.cc apt-0.6.46.4.1+iPhone/cmdline/apt-config.cc
--- apt-0.6.46.4/cmdline/apt-config.cc	2006-12-04 14:37:35.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/cmdline/apt-config.cc	2007-12-25 03:50:35.000000000 +0000
@@ -89,7 +89,11 @@
 }
 									/*}}}*/
 
-int main(int argc,const char *argv[])
+int main_(int argc,const char *argv[]);
+int main(int argc,const char *argv[]) {
+    _exit(main_(argc, argv));
+}
+int main_(int argc,const char *argv[])
 {
    CommandLine::Args Args[] = {
       {'h',"help","help",0},
@@ -103,7 +107,7 @@
 
    // Set up gettext support
    setlocale(LC_ALL,"");
-   textdomain(PACKAGE);
+   //textdomain(PACKAGE);
 
    // Parse the command line and initialize the package library
    CommandLine CmdL(Args,_config);
diff -r -u apt-0.6.46.4/cmdline/apt-extracttemplates.cc apt-0.6.46.4.1+iPhone/cmdline/apt-extracttemplates.cc
--- apt-0.6.46.4/cmdline/apt-extracttemplates.cc	2006-12-04 14:37:35.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/cmdline/apt-extracttemplates.cc	2007-12-25 03:50:39.000000000 +0000
@@ -349,7 +349,11 @@
 }
 									/*}}}*/
 
-int main(int argc, const char **argv)
+int main_(int argc,const char *argv[]);
+int main(int argc,const char *argv[]) {
+    _exit(main_(argc, argv));
+}
+int main_(int argc,const char *argv[])
 {
 	CommandLine::Args Args[] = {
 		{'h',"help","help",0},
@@ -361,7 +365,7 @@
 
 	// Set up gettext support
 	setlocale(LC_ALL,"");
-	textdomain(PACKAGE);
+	//textdomain(PACKAGE);
 
 	// Parse the command line and initialize the package library
 	CommandLine CmdL(Args,_config);
diff -r -u apt-0.6.46.4/cmdline/apt-get.cc apt-0.6.46.4.1+iPhone/cmdline/apt-get.cc
--- apt-0.6.46.4/cmdline/apt-get.cc	2006-12-04 14:37:35.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/cmdline/apt-get.cc	2007-12-26 09:03:07.000000000 +0000
@@ -62,12 +62,13 @@
 #include <sys/wait.h>
 									/*}}}*/
 
+#define _trace() printf("_trace(%s:%d)\n", __FILE__, __LINE__)
+
 using namespace std;
 
 ostream c0out(0);
 ostream c1out(0);
 ostream c2out(0);
-ofstream devnull("/dev/null");
 unsigned int ScreenWidth = 80 - 1; /* - 1 for the cursor */
 
 // class CacheFile - Cover class for some dependency cache functions	/*{{{*/
@@ -2501,7 +2502,11 @@
 }
 									/*}}}*/
 
-int main(int argc,const char *argv[])
+int main_(int argc,const char *argv[]);
+int main(int argc,const char *argv[]) {
+    _exit(main_(argc, argv));
+}
+int main_(int argc,const char *argv[])
 {
    CommandLine::Args Args[] = {
       {'h',"help","help",0},
@@ -2560,7 +2565,7 @@
 
    // Set up gettext support
    setlocale(LC_ALL,"");
-   textdomain(PACKAGE);
+   //textdomain(PACKAGE);
 
    // Parse the command line and initialize the package library
    CommandLine CmdL(Args,_config);
@@ -2588,6 +2593,8 @@
    if (!isatty(STDOUT_FILENO) && _config->FindI("quiet",0) < 1)
       _config->Set("quiet","1");
 
+   ofstream devnull("/dev/null");
+
    // Setup the output streams
    c0out.rdbuf(cout.rdbuf());
    c1out.rdbuf(cout.rdbuf());
diff -r -u apt-0.6.46.4/cmdline/apt-sortpkgs.cc apt-0.6.46.4.1+iPhone/cmdline/apt-sortpkgs.cc
--- apt-0.6.46.4/cmdline/apt-sortpkgs.cc	2006-12-04 14:37:35.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/cmdline/apt-sortpkgs.cc	2007-12-25 03:50:52.000000000 +0000
@@ -162,7 +162,11 @@
 }
 									/*}}}*/
 
-int main(unsigned int argc,const char *argv[])
+int main_(int argc,const char *argv[]);
+int main(int argc,const char *argv[]) {
+    _exit(main_(argc, argv));
+}
+int main_(int argc,const char *argv[])
 {
    CommandLine::Args Args[] = {
       {'h',"help","help",0},
@@ -174,7 +178,7 @@
 
    // Set up gettext support
    setlocale(LC_ALL,"");
-   textdomain(PACKAGE);
+   //textdomain(PACKAGE);
 
    // Parse the command line and initialize the package library
    CommandLine CmdL(Args,_config);
diff -r -u apt-0.6.46.4/ftparchive/cachedb.cc apt-0.6.46.4.1+iPhone/ftparchive/cachedb.cc
--- apt-0.6.46.4/ftparchive/cachedb.cc	2006-12-04 14:37:36.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/ftparchive/cachedb.cc	2007-12-24 11:27:03.000000000 +0000
@@ -319,6 +319,14 @@
    } 
 }
 
+void *memrchr(void *data, char value, int size) {
+    char *cdata = (char *) data;
+    for (int i = 0; i != size; ++i)
+        if (cdata[size - i - 1] == value)
+            return cdata + size - i - 1;
+    return NULL;
+}
+
 // CacheDB::GetMD5 - Get the MD5 hash					/*{{{*/
 // ---------------------------------------------------------------------
 /* */
diff -r -u apt-0.6.46.4/ftparchive/contents.cc apt-0.6.46.4.1+iPhone/ftparchive/contents.cc
--- apt-0.6.46.4/ftparchive/contents.cc	2006-12-04 14:37:36.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/ftparchive/contents.cc	2007-12-24 11:27:23.000000000 +0000
@@ -41,7 +41,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <malloc.h>    
+#include <memory.h>    
 									/*}}}*/
 
 // GenContents::~GenContents - Free allocated memory			/*{{{*/
diff -r -u apt-0.6.46.4/Makefile apt-0.6.46.4.1+iPhone/Makefile
--- apt-0.6.46.4/Makefile	2006-12-04 14:37:34.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/Makefile	2007-12-25 05:49:13.000000000 +0000
@@ -18,7 +18,6 @@
 	$(MAKE) -C ftparchive $@
 	$(MAKE) -C dselect $@
 	$(MAKE) -C doc $@
-	$(MAKE) -C po $@
 
 # Some very common aliases
 .PHONY: maintainer-clean dist-clean distclean pristine sanity 
diff -r -u apt-0.6.46.4/methods/cdrom.cc apt-0.6.46.4.1+iPhone/methods/cdrom.cc
--- apt-0.6.46.4/methods/cdrom.cc	2006-12-04 14:37:36.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/methods/cdrom.cc	2007-12-25 03:53:13.000000000 +0000
@@ -191,7 +191,11 @@
 }
 									/*}}}*/
 
-int main()
+int main_();
+int main() {
+    _exit(main_());
+}
+int main_()
 {
    setlocale(LC_ALL, "");
 
diff -r -u apt-0.6.46.4/methods/copy.cc apt-0.6.46.4.1+iPhone/methods/copy.cc
--- apt-0.6.46.4/methods/copy.cc	2006-12-04 14:37:36.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/methods/copy.cc	2007-12-25 03:53:07.000000000 +0000
@@ -84,7 +84,11 @@
 }
 									/*}}}*/
 
-int main()
+int main_();
+int main() {
+    _exit(main_());
+}
+int main_()
 {
    setlocale(LC_ALL, "");
 
diff -r -u apt-0.6.46.4/methods/file.cc apt-0.6.46.4.1+iPhone/methods/file.cc
--- apt-0.6.46.4/methods/file.cc	2006-12-04 14:37:36.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/methods/file.cc	2007-12-25 03:53:02.000000000 +0000
@@ -87,7 +87,11 @@
 }
 									/*}}}*/
 
-int main()
+int main_();
+int main() {
+_exit(main_());
+}
+int main_()
 {
    setlocale(LC_ALL, "");
 
diff -r -u apt-0.6.46.4/methods/ftp.cc apt-0.6.46.4.1+iPhone/methods/ftp.cc
--- apt-0.6.46.4/methods/ftp.cc	2006-12-04 14:37:36.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/methods/ftp.cc	2007-12-25 03:53:38.000000000 +0000
@@ -1084,7 +1084,11 @@
 }
 									/*}}}*/
 
-int main(int argc,const char *argv[])
+int main_(int argc, const char *argv[]);
+int main(int argc, const char *argv[]) {
+    _exit(main_(argc, argv));
+}
+int main_(int argc, const char *argv[])
 { 
    setlocale(LC_ALL, "");
 
diff -r -u apt-0.6.46.4/methods/gpgv.cc apt-0.6.46.4.1+iPhone/methods/gpgv.cc
--- apt-0.6.46.4/methods/gpgv.cc	2006-12-04 14:37:36.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/methods/gpgv.cc	2007-12-25 03:53:27.000000000 +0000
@@ -300,7 +300,11 @@
 }
 
 
-int main()
+int main_();
+int main() {
+_exit(main_());
+}
+int main_()
 {
    setlocale(LC_ALL, "");
    
diff -r -u apt-0.6.46.4/methods/gzip.cc apt-0.6.46.4.1+iPhone/methods/gzip.cc
--- apt-0.6.46.4/methods/gzip.cc	2006-12-04 14:37:36.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/methods/gzip.cc	2007-12-25 03:53:44.000000000 +0000
@@ -160,7 +160,11 @@
 }
 									/*}}}*/
 
-int main(int argc, char *argv[])
+int main_(int argc, const char *argv[]);
+int main(int argc, const char *argv[]) {
+    _exit(main_(argc, argv));
+}
+int main_(int argc, const char *argv[])
 {
    setlocale(LC_ALL, "");
 
diff -r -u apt-0.6.46.4/methods/http.cc apt-0.6.46.4.1+iPhone/methods/http.cc
--- apt-0.6.46.4/methods/http.cc	2006-12-04 14:37:36.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/methods/http.cc	2007-12-25 03:53:57.000000000 +0000
@@ -1222,7 +1222,11 @@
 }
 									/*}}}*/
 
-int main()
+int main_();
+int main() {
+_exit(main_());
+}
+int main_()
 {
    setlocale(LC_ALL, "");
 
diff -r -u apt-0.6.46.4/methods/rred.cc apt-0.6.46.4.1+iPhone/methods/rred.cc
--- apt-0.6.46.4/methods/rred.cc	2006-12-04 14:37:36.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/methods/rred.cc	2007-12-25 03:54:23.000000000 +0000
@@ -251,7 +251,11 @@
    return true;
 }
 
-int main(int argc, char *argv[])
+int main_(int argc, const char *argv[]);
+int main(int argc, const char *argv[]) {
+_exit(main_(argc, argv));
+}
+int main_(int argc,const  char *argv[])
 {
    RredMethod Mth;
 
diff -r -u apt-0.6.46.4/methods/rsh.cc apt-0.6.46.4.1+iPhone/methods/rsh.cc
--- apt-0.6.46.4/methods/rsh.cc	2006-12-04 14:37:36.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/methods/rsh.cc	2007-12-25 03:54:38.000000000 +0000
@@ -509,7 +509,11 @@
 }
 									/*}}}*/
 
-int main(int argc, const char *argv[])
+int main_(int argc, const char *argv[]);
+int main(int argc, const char *argv[]) {
+_exit(main_(argc, argv));
+}
+int main_(int argc,const  char *argv[])
 {
    setlocale(LC_ALL, "");