summaryrefslogtreecommitdiff
path: root/data/apt
diff options
context:
space:
mode:
authorJay Freeman <saurik@saurik.com>2008-01-01 05:58:43 +0000
committerJay Freeman <saurik@saurik.com>2008-01-01 05:58:43 +0000
commitea2670c18699e514ee1d65dfd35ad22c296a74e7 (patch)
tree6826a5266d78c22210c194772a8daed06ef0a19c /data/apt
parenta45e85d54e8df7a333946cc52fec519fc6aa4d87 (diff)
Initial commit.
git-svn-id: http://svn.telesphoreo.org/trunk@2 514c082c-b64e-11dc-b46d-3d985efe055d
Diffstat (limited to 'data/apt')
-rw-r--r--data/apt/_metadata/description2
l---------data/apt/_metadata/dpkg.dep1
-rw-r--r--data/apt/_metadata/license142
l---------data/apt/_metadata/maintainer1
-rw-r--r--data/apt/_metadata/priority1
-rw-r--r--data/apt/_metadata/section1
-rw-r--r--data/apt/_metadata/version1
-rw-r--r--data/apt/apt_0.6.46.4-0.1.tar.gzbin0 -> 1797866 bytes
-rw-r--r--data/apt/make.sh16
-rw-r--r--data/apt/port.diff525
10 files changed, 690 insertions, 0 deletions
diff --git a/data/apt/_metadata/description b/data/apt/_metadata/description
new file mode 100644
index 000000000..005d9a0c9
--- /dev/null
+++ b/data/apt/_metadata/description
@@ -0,0 +1,2 @@
+this package isn't described yet
+This package, which I'm certain is incredibly interesting, has yet to be described. This is probably because Jay has spent days getting all kinds of bookkeeping issues, like copyright notifications, all in their correct places, and descriptions just aren't the most important thing he could be working on. If this is a problem, please come back later.
diff --git a/data/apt/_metadata/dpkg.dep b/data/apt/_metadata/dpkg.dep
new file mode 120000
index 000000000..3e57eea03
--- /dev/null
+++ b/data/apt/_metadata/dpkg.dep
@@ -0,0 +1 @@
+../../dpkg \ No newline at end of file
diff --git a/data/apt/_metadata/license b/data/apt/_metadata/license
new file mode 100644
index 000000000..9e277e57d
--- /dev/null
+++ b/data/apt/_metadata/license
@@ -0,0 +1,142 @@
+Apt is copyright 1997, 1998, 1999 Jason Gunthorpe and others.
+
+Apt is licened under the terms of the GNU General Public License (GPL),
+version 2.0 or later, as published by the Free Software Foundation. See
+the file COPYING.GPL [included], /usr/share/common-licenses/GPL, or
+<http://www.gnu.org/copyleft/gpl.txt> for the terms of the latest version
+of the GNU General Public License.
+
+In addition, prior to November 15th, 2000, apt may be distributed under
+terms identical to the above with the following addition:
+
+Works using apt may link against the GUI library "libqt", copyright by
+Troll Tech AS, Norway, provided that:
+
+1. The version of "libqt" is licensed under the terms of the "Qt Free Edition
+ License" published by Troll Tech AS. The license terms identified as
+ the Qt Free Edition License below are the only such terms under which
+ distribution of works derived from both apt and "libqt" are permitted;
+
+and
+
+2. The source code of the version of "libqt" used is
+
+ a) Distributed with the binary version;
+
+ or
+
+ b) Downloadable by anyone, without fee, using a publicly-announced
+ URL on the Internet, for a duration of at least three years
+ starting with distribution of the binary version.
+
+On and after November 15th, 2000, the above additional terms lose all
+force, and apt will be licensed only under the terms of the GNU General
+Public License, version 2.0 or later.
+
+ _______________________________________________________________
+
+The following text, up to the text of the Qt Free Edition License, is
+informational and not part of the license terms on apt.
+
+Modifications to apt in either source or compiled form must be licensed
+under the terms of the GNU General Public License, version 2.0 (or later),
+but need not include the above clause permitting usage of the "libqt"
+library under the Qt Free Edition License. Note that removal of this
+clause will result in software which is not licensed for binary
+redistribution linked against software governed by the Qt Free Edition
+License. In the event that a version of "libqt" is released that is
+licensed under terms that do not conflict with the GPL, the additional
+clause above is not required to grant permission for distribution of works
+that are derived from both apt and "libqt".
+
+No part of apt is licensed under the Qt Free Edition License. The terms
+below are provided to help identify the circumstances under which the
+"libqt" library may be used with apt (or a work derived from both). The
+terms below are copied from the LICENSE file of the qt-1.44 distribution,
+as of November 10th, 1999.
+
+ _______________________________________________________________
+
+ QT FREE EDITION LICENSE
+
+Copyright (C) 1992-1999 Troll Tech AS. All rights reserved.
+
+This is the license for Qt Free Edition version 1.44; it covers private use,
+use of third-party application programs based on Qt, and development of
+free software for the free software community.
+
+
+ COPYRIGHT AND RESTRICTIONS
+
+The Qt toolkit is a product of Troll Tech AS. The Qt Free Edition is limited
+to use with the X Window System.
+
+You may copy this version of the Qt Free Edition provided that the entire
+archive is distributed unchanged and as a whole, including this notice.
+
+You may use this version of the Qt Free Edition to compile, link and run
+application programs legally developed by third parties.
+
+You may use the Qt Free Edition to create application programs
+provided that:
+
+ You accept this license.
+ Your software does not require modifications to Qt Free Edition.
+ You satisfy ONE of the following three requirements
+ EITHER
+ Users of your software can freely obtain source code for the
+ software, freely modify the source code (possibly with
+ restrictions on copyright notices, attributions and legal
+ responsibility), and freely redistribute original or modified
+ versions of the software.
+ OR
+ Your software is distributed under the GNU GENERAL
+ PUBLIC LICENSE, version 2 or later, as defined by the
+ Free Software Foundation.
+ OR
+ Your software is distributed under the GNU LIBRARY
+ GENERAL PUBLIC LICENSE, version 2 or later, as
+ defined by the Free Software Foundation.
+
+If you are paid to develop something with Qt Free Edition or it is a part of
+your job the following conditions also apply:
+
+ Your software must not require libraries, programs, data or
+ documentation that are not available outside your organization in
+ order to compile or use.
+ If and when your organization starts using the software, you must
+ notify Troll Tech AS of the following:
+ Your organization's name and purpose.
+ The software's name and purpose.
+ The software's license.
+ That your organization considers the software to be free
+ software.
+
+You may also use the Qt Free Edition to create reusable components
+(such as libraries) provided that you accept the terms above, and in
+addition that:
+
+ Your components' license includes the following text:
+
+ [Your package] requires the Qt library, which is
+ copyright Troll Tech AS. Freely distributable
+ programs may generally use Qt Free Edition free of
+ charge, see [README.QT] for details.
+
+ README.QT is distributed along with your components.
+ Qt Free Edition is not distributed as an integral part of your
+ components.
+
+ LIMITATIONS OF LIABILITY
+
+Troll Tech AS makes no obligation under this license to support or
+upgrade Qt Free Edition, or assist in the use of Qt Free Edition.
+
+In no event shall Troll Tech AS be liable for any lost revenue or profits or
+other direct, indirect, special, incidental or consequential damages, even
+if Troll Tech has been advised of the possibility of such damages.
+
+QT FREE EDITION IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND,
+INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE.
+ _______________________________________________________________
diff --git a/data/apt/_metadata/maintainer b/data/apt/_metadata/maintainer
new file mode 120000
index 000000000..0fa66e077
--- /dev/null
+++ b/data/apt/_metadata/maintainer
@@ -0,0 +1 @@
+../../../people/saurik \ No newline at end of file
diff --git a/data/apt/_metadata/priority b/data/apt/_metadata/priority
new file mode 100644
index 000000000..fad9e164a
--- /dev/null
+++ b/data/apt/_metadata/priority
@@ -0,0 +1 @@
+required
diff --git a/data/apt/_metadata/section b/data/apt/_metadata/section
new file mode 100644
index 000000000..7fbe952b7
--- /dev/null
+++ b/data/apt/_metadata/section
@@ -0,0 +1 @@
+admin
diff --git a/data/apt/_metadata/version b/data/apt/_metadata/version
new file mode 100644
index 000000000..f44089729
--- /dev/null
+++ b/data/apt/_metadata/version
@@ -0,0 +1 @@
+0.6.46.4-0.1
diff --git a/data/apt/apt_0.6.46.4-0.1.tar.gz b/data/apt/apt_0.6.46.4-0.1.tar.gz
new file mode 100644
index 000000000..99840a4ee
--- /dev/null
+++ b/data/apt/apt_0.6.46.4-0.1.tar.gz
Binary files differ
diff --git a/data/apt/make.sh b/data/apt/make.sh
new file mode 100644
index 000000000..83831e6ae
--- /dev/null
+++ b/data/apt/make.sh
@@ -0,0 +1,16 @@
+tar -zxvf "${PKG_DATA}/apt_0.6.46.4-0.1.tar.gz"
+cd apt-0.6.46.4.1
+pkg:patch
+autoconf
+pkg:configure
+make
+pkg:mkdir /etc/apt/sources.list.d
+pkg:mkdir /var/cache/apt/archives/partial
+pkg:mkdir /var/lib/apt/lists/partial
+pkg:mkdir /var/lib/apt/periodic
+pkg: mkdir -p /usr/bin /usr/lib/apt
+pkg: cp -a bin/apt-* /usr/bin
+pkg: cp -a bin/libapt-* /usr/lib
+pkg: cp -a bin/methods /usr/lib/apt
+pkg:mkdir /usr/lib/dpkg/methods
+cp -a scripts/dselect "${PKG_DEST}/usr/lib/dpkg/methods/apt"
diff --git a/data/apt/port.diff b/data/apt/port.diff
new file mode 100644
index 000000000..3ac2c0c6f
--- /dev/null
+++ b/data/apt/port.diff
@@ -0,0 +1,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, "");
+