summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/apt/_metadata/conflicts1
l---------data/apt/_metadata/curl.dep1
l---------data/apt/_metadata/diffutils.dep1
-rw-r--r--data/apt/_metadata/priority2
l---------data/apt/_metadata/sed.dep1
-rw-r--r--data/apt/_metadata/version2
-rw-r--r--data/apt/apt_0.6.46.4-0.1.tar.gzbin1797866 -> 0 bytes
-rw-r--r--data/apt/apt_0.7.20.2.tar.gzbin0 -> 2032040 bytes
-rw-r--r--data/apt/cfnetwork.diff59
-rw-r--r--data/apt/dylib.diff55
-rw-r--r--data/apt/iconv.diff23
-rw-r--r--data/apt/make.sh2
-rw-r--r--data/apt/mdns.diff432
-rw-r--r--data/apt/memrchr.c161
-rw-r--r--data/apt/memrchr.diff195
-rw-r--r--data/apt/ostable.diff12
-rw-r--r--data/apt/port.diff304
-rw-r--r--data/apt/textdomain.diff72
-rw-r--r--data/apt/timestamp.diff98
19 files changed, 637 insertions, 784 deletions
diff --git a/data/apt/_metadata/conflicts b/data/apt/_metadata/conflicts
new file mode 100644
index 000000000..26617d002
--- /dev/null
+++ b/data/apt/_metadata/conflicts
@@ -0,0 +1 @@
+cydia (<< 1.0.2821-1)
diff --git a/data/apt/_metadata/curl.dep b/data/apt/_metadata/curl.dep
new file mode 120000
index 000000000..9c4438112
--- /dev/null
+++ b/data/apt/_metadata/curl.dep
@@ -0,0 +1 @@
+../../curl \ No newline at end of file
diff --git a/data/apt/_metadata/diffutils.dep b/data/apt/_metadata/diffutils.dep
deleted file mode 120000
index db7eb546c..000000000
--- a/data/apt/_metadata/diffutils.dep
+++ /dev/null
@@ -1 +0,0 @@
-../../diffutils \ No newline at end of file
diff --git a/data/apt/_metadata/priority b/data/apt/_metadata/priority
index fad9e164a..d0b3ce728 100644
--- a/data/apt/_metadata/priority
+++ b/data/apt/_metadata/priority
@@ -1 +1 @@
-required
++required
diff --git a/data/apt/_metadata/sed.dep b/data/apt/_metadata/sed.dep
new file mode 120000
index 000000000..315b5c89c
--- /dev/null
+++ b/data/apt/_metadata/sed.dep
@@ -0,0 +1 @@
+../../sed \ No newline at end of file
diff --git a/data/apt/_metadata/version b/data/apt/_metadata/version
index f44089729..015cc16c2 100644
--- a/data/apt/_metadata/version
+++ b/data/apt/_metadata/version
@@ -1 +1 @@
-0.6.46.4-0.1
+0.7.20.2
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
deleted file mode 100644
index 99840a4ee..000000000
--- a/data/apt/apt_0.6.46.4-0.1.tar.gz
+++ /dev/null
Binary files differ
diff --git a/data/apt/apt_0.7.20.2.tar.gz b/data/apt/apt_0.7.20.2.tar.gz
new file mode 100644
index 000000000..52d2429ee
--- /dev/null
+++ b/data/apt/apt_0.7.20.2.tar.gz
Binary files differ
diff --git a/data/apt/cfnetwork.diff b/data/apt/cfnetwork.diff
index 525a559d5..1639ab7c7 100644
--- a/data/apt/cfnetwork.diff
+++ b/data/apt/cfnetwork.diff
@@ -1,7 +1,7 @@
-diff -ru apt-0.6.46.4.1/methods/http.cc apt-0.6.46.4.1+iPhone/methods/http.cc
---- apt-0.6.46.4.1/methods/http.cc 2006-12-04 14:37:36.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/methods/http.cc 2009-01-21 10:11:37.000000000 +0000
-@@ -30,6 +36,7 @@
+diff -ru apt-0.7.20.2/methods/http.cc apt-0.7.20.2+iPhone/methods/http.cc
+--- apt-0.7.20.2/methods/http.cc 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/methods/http.cc 2009-04-14 16:34:31.000000000 +0000
+@@ -30,6 +30,7 @@
#include <apt-pkg/error.h>
#include <apt-pkg/hashes.h>
@@ -9,7 +9,7 @@ diff -ru apt-0.6.46.4.1/methods/http.cc apt-0.6.46.4.1+iPhone/methods/http.cc
#include <sys/stat.h>
#include <sys/time.h>
#include <utime.h>
-@@ -40,9 +47,16 @@
+@@ -40,9 +41,16 @@
#include <string.h>
#include <iostream>
#include <apti18n.h>
@@ -24,9 +24,9 @@ diff -ru apt-0.6.46.4.1/methods/http.cc apt-0.6.46.4.1+iPhone/methods/http.cc
+#include <CoreServices/CoreServices.h>
+#include <SystemConfiguration/SystemConfiguration.h>
+ #include "config.h"
#include "connect.h"
- #include "rfc2553emu.h"
-@@ -51,6 +65,51 @@
+@@ -52,6 +60,51 @@
/*}}}*/
using namespace std;
@@ -78,7 +78,7 @@ diff -ru apt-0.6.46.4.1/methods/http.cc apt-0.6.46.4.1+iPhone/methods/http.cc
string HttpMethod::FailFile;
int HttpMethod::FailFd = -1;
time_t HttpMethod::FailTime = 0;
-@@ -630,6 +689,51 @@
+@@ -632,6 +685,51 @@
}
/*}}}*/
@@ -130,7 +130,7 @@ diff -ru apt-0.6.46.4.1/methods/http.cc apt-0.6.46.4.1+iPhone/methods/http.cc
// HttpMethod::SendReq - Send the HTTP request /*{{{*/
// ---------------------------------------------------------------------
/* This places the http request in the outbound buffer */
-@@ -1043,6 +1147,8 @@
+@@ -1043,6 +1141,8 @@
signal(SIGINT,SigTerm);
Server = 0;
@@ -139,18 +139,16 @@ diff -ru apt-0.6.46.4.1/methods/http.cc apt-0.6.46.4.1+iPhone/methods/http.cc
int FailCounter = 0;
while (1)
-@@ -1062,159 +1168,314 @@
-
+@@ -1063,173 +1163,313 @@
if (Queue == 0)
continue;
--
+
- // Connect to the server
- if (Server == 0 || Server->Comp(Queue->Uri) == false)
- {
- delete Server;
- Server = new ServerState(Queue->Uri,this);
- }
--
- /* If the server has explicitly said this is the last connection
- then we pre-emptively shut down the pipeline and tear down
- the connection. This will speed up HTTP/1.0 servers a tad
@@ -171,6 +169,7 @@ diff -ru apt-0.6.46.4.1/methods/http.cc apt-0.6.46.4.1+iPhone/methods/http.cc
- Server = 0;
- continue;
- }
++ CFStringEncoding se = kCFStringEncodingUTF8;
- // Fill the pipeline.
- Fetch(0);
@@ -209,8 +208,6 @@ diff -ru apt-0.6.46.4.1/methods/http.cc apt-0.6.46.4.1+iPhone/methods/http.cc
- continue;
- }
- };
-+ CFStringEncoding se = kCFStringEncodingUTF8;
-+
+ char *url = strdup(Queue->Uri.c_str());
+ url:
+ URI uri = std::string(url);
@@ -511,8 +508,24 @@ diff -ru apt-0.6.46.4.1/methods/http.cc apt-0.6.46.4.1+iPhone/methods/http.cc
- URIDone(Res);
- }
- else
-- Fail(true);
--
+- {
+- if (Server->ServerFd == -1)
+- {
+- FailCounter++;
+- _error->Discard();
+- Server->Close();
+-
+- if (FailCounter >= 2)
+- {
+- Fail(_("Connection failed"),true);
+- FailCounter = 0;
+- }
+-
+- QueueBack = Queue;
+- }
+- else
+- Fail(true);
+- }
- break;
- }
-
@@ -593,7 +606,7 @@ diff -ru apt-0.6.46.4.1/methods/http.cc apt-0.6.46.4.1+iPhone/methods/http.cc
FailCounter = 0;
}
-@@ -1224,6 +1484,34 @@
+@@ -1242,6 +1482,34 @@
setlocale(LC_ALL, "");
HttpMethod Mth;
@@ -628,15 +641,15 @@ diff -ru apt-0.6.46.4.1/methods/http.cc apt-0.6.46.4.1+iPhone/methods/http.cc
return Mth.Loop();
}
-diff -ru apt-0.6.46.4.1/methods/makefile apt-0.6.46.4.1+iPhone/methods/makefile
---- apt-0.6.46.4.1/methods/makefile 2006-12-04 14:37:36.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/methods/makefile 2008-05-11 06:32:33.000000000 +0000
+diff -ru apt-0.7.20.2/methods/makefile apt-0.7.20.2+iPhone/methods/makefile
+--- apt-0.7.20.2/methods/makefile 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/methods/makefile 2009-04-14 16:18:18.000000000 +0000
@@ -47,7 +47,7 @@
# The http method
PROGRAM=http
--SLIBS = -lapt-pkg $(SOCKETLIBS)
-+SLIBS = -lapt-pkg $(SOCKETLIBS) -framework CoreFoundation -framework CFNetwork -framework SystemConfiguration -framework IOKit -llockdown
+-SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS)
++SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS) -framework CoreFoundation -framework CFNetwork -framework SystemConfiguration -framework IOKit -llockdown
LIB_MAKES = apt-pkg/makefile
SOURCE = http.cc rfc2553emu.cc connect.cc
include $(PROGRAM_H)
diff --git a/data/apt/dylib.diff b/data/apt/dylib.diff
deleted file mode 100644
index b9b87d3a7..000000000
--- a/data/apt/dylib.diff
+++ /dev/null
@@ -1,55 +0,0 @@
-diff -ru apt-0.6.46.4.1/buildlib/library.mak apt-0.6.46.4.1+iPhone/buildlib/library.mak
---- apt-0.6.46.4.1/buildlib/library.mak 2006-12-04 14:37:35.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/buildlib/library.mak 2008-01-30 17:05:02.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 $@ -Wl,-dylib_install_name,$(patsubst $(LIB)/%,/usr/lib/%,$@) -dynamiclib \
- $(filter %.opic,$^) \
- $($(@F)-SLIBS)
-
diff --git a/data/apt/iconv.diff b/data/apt/iconv.diff
new file mode 100644
index 000000000..f6808de2b
--- /dev/null
+++ b/data/apt/iconv.diff
@@ -0,0 +1,23 @@
+diff -ru apt-0.7.20.2/apt-pkg/makefile apt-0.7.20.2+iPhone/apt-pkg/makefile
+--- apt-0.7.20.2/apt-pkg/makefile 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/makefile 2009-04-15 19:36:09.000000000 +0000
+@@ -15,7 +15,7 @@
+ LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
+ MAJOR=4.6
+ MINOR=0
+-SLIBS=$(PTHREADLIB) $(INTLLIBS) -lutil
++SLIBS=$(PTHREADLIB) $(INTLLIBS) -lutil $(LIBICONV)
+ APT_DOMAIN:=libapt-pkg$(MAJOR)
+
+ # Source code for the contributed non-core things
+diff -ru apt-0.7.20.2/buildlib/environment.mak.in apt-0.7.20.2+iPhone/buildlib/environment.mak.in
+--- apt-0.7.20.2/buildlib/environment.mak.in 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/buildlib/environment.mak.in 2009-04-15 19:36:23.000000000 +0000
+@@ -55,6 +55,7 @@
+ PYTHONINCLUDE = @PYTHONINCLUDE@
+ BDBLIB = @BDBLIB@
+ INTLLIBS = @INTLLIBS@
++LIBICONV = @LIBICONV@
+
+ # Shim Headerfile control
+ HAVE_C9X = @HAVE_C9X@
diff --git a/data/apt/make.sh b/data/apt/make.sh
index 8e73d3ab4..48647de72 100644
--- a/data/apt/make.sh
+++ b/data/apt/make.sh
@@ -1,6 +1,6 @@
pkg:setup
autoconf
-pkg:configure --disable-nls
+DPKG_ARCH=$(ls -d $(PKG_WORK_ dpkg)/dpkg-*/scripts) pkg:configure --disable-nls
make
pkg: mkdir -p /etc/apt/sources.list.d
diff --git a/data/apt/mdns.diff b/data/apt/mdns.diff
deleted file mode 100644
index 4c4b0846b..000000000
--- a/data/apt/mdns.diff
+++ /dev/null
@@ -1,432 +0,0 @@
-diff -ru apt-0.6.46.4.1/cmdline/apt-cache.cc apt-0.6.46.4.1+iPhone/cmdline/apt-cache.cc
---- apt-0.6.46.4.1/cmdline/apt-cache.cc 2008-01-12 09:13:08.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/cmdline/apt-cache.cc 2008-01-27 10:11:38.000000000 +0000
-@@ -1,3 +1,7 @@
-+extern "C" {
-+ #include <mach-o/nlist.h>
-+}
-+
- // -*- mode: cpp; mode: fold -*-
- // Description /*{{{*/
- // $Id: apt-cache.cc,v 1.72 2004/04/30 04:34:03 mdz Exp $
-@@ -1706,6 +1710,15 @@
-
- int main(int argc,const char *argv[])
- {
-+#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200
-+ struct nlist nl[2];
-+ memset(nl, 0, sizeof(nl));
-+ nl[0].n_un.n_name = (char *) "_useMDNSResponder";
-+ nlist("/usr/lib/libc.dylib", nl);
-+ if (nl[0].n_type != N_UNDF)
-+ *(int *) nl[0].n_value = 0;
-+#endif
-+
- CommandLine::Args Args[] = {
- {'h',"help","help",0},
- {'v',"version","version",0},
-diff -ru apt-0.6.46.4.1/cmdline/apt-cdrom.cc apt-0.6.46.4.1+iPhone/cmdline/apt-cdrom.cc
---- apt-0.6.46.4.1/cmdline/apt-cdrom.cc 2008-01-12 09:13:08.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/cmdline/apt-cdrom.cc 2008-01-27 10:11:50.000000000 +0000
-@@ -1,3 +1,7 @@
-+extern "C" {
-+ #include <mach-o/nlist.h>
-+}
-+
- // -*- mode: cpp; mode: fold -*-
- // Description /*{{{*/
- // $Id: apt-cdrom.cc,v 1.45 2003/11/19 23:50:51 mdz Exp $
-@@ -167,6 +171,15 @@
-
- int main(int argc,const char *argv[])
- {
-+#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200
-+ struct nlist nl[2];
-+ memset(nl, 0, sizeof(nl));
-+ nl[0].n_un.n_name = (char *) "_useMDNSResponder";
-+ nlist("/usr/lib/libc.dylib", nl);
-+ if (nl[0].n_type != N_UNDF)
-+ *(int *) nl[0].n_value = 0;
-+#endif
-+
- CommandLine::Args Args[] = {
- {'h',"help","help",0},
- {'v',"version","version",0},
-diff -ru apt-0.6.46.4.1/cmdline/apt-config.cc apt-0.6.46.4.1+iPhone/cmdline/apt-config.cc
---- apt-0.6.46.4.1/cmdline/apt-config.cc 2008-01-12 09:13:08.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/cmdline/apt-config.cc 2008-01-27 10:11:59.000000000 +0000
-@@ -1,3 +1,7 @@
-+extern "C" {
-+ #include <mach-o/nlist.h>
-+}
-+
- // -*- mode: cpp; mode: fold -*-
- // Description /*{{{*/
- // $Id: apt-config.cc,v 1.11 2003/01/11 07:18:44 jgg Exp $
-@@ -91,6 +95,15 @@
-
- int main(int argc,const char *argv[])
- {
-+#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200
-+ struct nlist nl[2];
-+ memset(nl, 0, sizeof(nl));
-+ nl[0].n_un.n_name = (char *) "_useMDNSResponder";
-+ nlist("/usr/lib/libc.dylib", nl);
-+ if (nl[0].n_type != N_UNDF)
-+ *(int *) nl[0].n_value = 0;
-+#endif
-+
- CommandLine::Args Args[] = {
- {'h',"help","help",0},
- {'v',"version","version",0},
-diff -ru apt-0.6.46.4.1/cmdline/apt-extracttemplates.cc apt-0.6.46.4.1+iPhone/cmdline/apt-extracttemplates.cc
---- apt-0.6.46.4.1/cmdline/apt-extracttemplates.cc 2008-01-12 09:13:08.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/cmdline/apt-extracttemplates.cc 2008-01-27 10:12:06.000000000 +0000
-@@ -1,3 +1,7 @@
-+extern "C" {
-+ #include <mach-o/nlist.h>
-+}
-+
- // -*- mode: cpp; mode: fold -*-
- // Description /*{{{*/
- // $Id: apt-extracttemplates.cc,v 1.15 2003/07/26 00:00:11 mdz Exp $
-@@ -351,6 +355,15 @@
-
- int main(int argc, const char **argv)
- {
-+#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200
-+ struct nlist nl[2];
-+ memset(nl, 0, sizeof(nl));
-+ nl[0].n_un.n_name = (char *) "_useMDNSResponder";
-+ nlist("/usr/lib/libc.dylib", nl);
-+ if (nl[0].n_type != N_UNDF)
-+ *(int *) nl[0].n_value = 0;
-+#endif
-+
- CommandLine::Args Args[] = {
- {'h',"help","help",0},
- {'v',"version","version",0},
-diff -ru apt-0.6.46.4.1/cmdline/apt-get.cc apt-0.6.46.4.1+iPhone/cmdline/apt-get.cc
---- apt-0.6.46.4.1/cmdline/apt-get.cc 2008-01-12 09:13:08.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/cmdline/apt-get.cc 2008-01-27 10:12:11.000000000 +0000
-@@ -1,3 +1,7 @@
-+extern "C" {
-+ #include <mach-o/nlist.h>
-+}
-+
- // -*- mode: cpp; mode: fold -*-
- // Description /*{{{*/
- // $Id: apt-get.cc,v 1.156 2004/08/28 01:05:16 mdz Exp $
-@@ -2504,6 +2508,15 @@
-
- int main(int argc,const char *argv[])
- {
-+#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200
-+ struct nlist nl[2];
-+ memset(nl, 0, sizeof(nl));
-+ nl[0].n_un.n_name = (char *) "_useMDNSResponder";
-+ nlist("/usr/lib/libc.dylib", nl);
-+ if (nl[0].n_type != N_UNDF)
-+ *(int *) nl[0].n_value = 0;
-+#endif
-+
- CommandLine::Args Args[] = {
- {'h',"help","help",0},
- {'v',"version","version",0},
-diff -ru apt-0.6.46.4.1/cmdline/apt-sortpkgs.cc apt-0.6.46.4.1+iPhone/cmdline/apt-sortpkgs.cc
---- apt-0.6.46.4.1/cmdline/apt-sortpkgs.cc 2008-01-12 09:13:08.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/cmdline/apt-sortpkgs.cc 2008-01-27 10:12:27.000000000 +0000
-@@ -1,3 +1,7 @@
-+extern "C" {
-+ #include <mach-o/nlist.h>
-+}
-+
- // -*- mode: cpp; mode: fold -*-
- // Description /*{{{*/
- // $Id: apt-sortpkgs.cc,v 1.5 2003/01/11 07:18:44 jgg Exp $
-@@ -164,6 +168,15 @@
-
- int main(unsigned int argc,const char *argv[])
- {
-+#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200
-+ struct nlist nl[2];
-+ memset(nl, 0, sizeof(nl));
-+ nl[0].n_un.n_name = (char *) "_useMDNSResponder";
-+ nlist("/usr/lib/libc.dylib", nl);
-+ if (nl[0].n_type != N_UNDF)
-+ *(int *) nl[0].n_value = 0;
-+#endif
-+
- CommandLine::Args Args[] = {
- {'h',"help","help",0},
- {'v',"version","version",0},
-diff -ru apt-0.6.46.4.1/ftparchive/apt-ftparchive.cc apt-0.6.46.4.1+iPhone/ftparchive/apt-ftparchive.cc
---- apt-0.6.46.4.1/ftparchive/apt-ftparchive.cc 2006-12-04 14:37:36.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/ftparchive/apt-ftparchive.cc 2008-01-27 10:12:31.000000000 +0000
-@@ -1,3 +1,7 @@
-+extern "C" {
-+ #include <mach-o/nlist.h>
-+}
-+
- // -*- mode: cpp; mode: fold -*-
- // Description /*{{{*/
- // $Id: apt-ftparchive.cc,v 1.8.2.3 2004/01/02 22:01:48 mdz Exp $
-@@ -901,6 +905,15 @@
-
- int main(int argc, const char *argv[])
- {
-+#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200
-+ struct nlist nl[2];
-+ memset(nl, 0, sizeof(nl));
-+ nl[0].n_un.n_name = (char *) "_useMDNSResponder";
-+ nlist("/usr/lib/libc.dylib", nl);
-+ if (nl[0].n_type != N_UNDF)
-+ *(int *) nl[0].n_value = 0;
-+#endif
-+
- CommandLine::Args Args[] = {
- {'h',"help","help",0},
- {0,"md5","APT::FTPArchive::MD5",0},
-diff -ru apt-0.6.46.4.1/methods/cdrom.cc apt-0.6.46.4.1+iPhone/methods/cdrom.cc
---- apt-0.6.46.4.1/methods/cdrom.cc 2006-12-04 14:37:36.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/methods/cdrom.cc 2008-01-27 10:12:45.000000000 +0000
-@@ -1,3 +1,7 @@
-+extern "C" {
-+ #include <mach-o/nlist.h>
-+}
-+
- // -*- mode: cpp; mode: fold -*-
- // Description /*{{{*/
- // $Id: cdrom.cc,v 1.20.2.1 2004/01/16 18:58:50 mdz Exp $
-@@ -193,6 +197,15 @@
-
- int main()
- {
-+#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200
-+ struct nlist nl[2];
-+ memset(nl, 0, sizeof(nl));
-+ nl[0].n_un.n_name = (char *) "_useMDNSResponder";
-+ nlist("/usr/lib/libc.dylib", nl);
-+ if (nl[0].n_type != N_UNDF)
-+ *(int *) nl[0].n_value = 0;
-+#endif
-+
- setlocale(LC_ALL, "");
-
- CDROMMethod Mth;
-diff -ru apt-0.6.46.4.1/methods/copy.cc apt-0.6.46.4.1+iPhone/methods/copy.cc
---- apt-0.6.46.4.1/methods/copy.cc 2006-12-04 14:37:36.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/methods/copy.cc 2008-01-27 10:12:50.000000000 +0000
-@@ -1,3 +1,7 @@
-+extern "C" {
-+ #include <mach-o/nlist.h>
-+}
-+
- // -*- mode: cpp; mode: fold -*-
- // Description /*{{{*/
- // $Id: copy.cc,v 1.7.2.1 2004/01/16 18:58:50 mdz Exp $
-@@ -86,6 +90,15 @@
-
- int main()
- {
-+#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200
-+ struct nlist nl[2];
-+ memset(nl, 0, sizeof(nl));
-+ nl[0].n_un.n_name = (char *) "_useMDNSResponder";
-+ nlist("/usr/lib/libc.dylib", nl);
-+ if (nl[0].n_type != N_UNDF)
-+ *(int *) nl[0].n_value = 0;
-+#endif
-+
- setlocale(LC_ALL, "");
-
- CopyMethod Mth;
-diff -ru apt-0.6.46.4.1/methods/file.cc apt-0.6.46.4.1+iPhone/methods/file.cc
---- apt-0.6.46.4.1/methods/file.cc 2006-12-04 14:37:36.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/methods/file.cc 2008-01-27 10:12:56.000000000 +0000
-@@ -1,3 +1,7 @@
-+extern "C" {
-+ #include <mach-o/nlist.h>
-+}
-+
- // -*- mode: cpp; mode: fold -*-
- // Description /*{{{*/
- // $Id: file.cc,v 1.9.2.1 2004/01/16 18:58:50 mdz Exp $
-@@ -89,6 +93,15 @@
-
- int main()
- {
-+#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200
-+ struct nlist nl[2];
-+ memset(nl, 0, sizeof(nl));
-+ nl[0].n_un.n_name = (char *) "_useMDNSResponder";
-+ nlist("/usr/lib/libc.dylib", nl);
-+ if (nl[0].n_type != N_UNDF)
-+ *(int *) nl[0].n_value = 0;
-+#endif
-+
- setlocale(LC_ALL, "");
-
- FileMethod Mth;
-diff -ru apt-0.6.46.4.1/methods/ftp.cc apt-0.6.46.4.1+iPhone/methods/ftp.cc
---- apt-0.6.46.4.1/methods/ftp.cc 2006-12-04 14:37:36.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/methods/ftp.cc 2008-01-27 10:13:01.000000000 +0000
-@@ -1,3 +1,7 @@
-+extern "C" {
-+ #include <mach-o/nlist.h>
-+}
-+
- // -*- mode: cpp; mode: fold -*-
- // Description /*{{{*/
- // $Id: ftp.cc,v 1.31.2.1 2004/01/16 18:58:50 mdz Exp $
-@@ -1086,6 +1090,15 @@
-
- int main(int argc,const char *argv[])
- {
-+#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200
-+ struct nlist nl[2];
-+ memset(nl, 0, sizeof(nl));
-+ nl[0].n_un.n_name = (char *) "_useMDNSResponder";
-+ nlist("/usr/lib/libc.dylib", nl);
-+ if (nl[0].n_type != N_UNDF)
-+ *(int *) nl[0].n_value = 0;
-+#endif
-+
- setlocale(LC_ALL, "");
-
- /* See if we should be come the http client - we do this for http
-diff -ru apt-0.6.46.4.1/methods/gpgv.cc apt-0.6.46.4.1+iPhone/methods/gpgv.cc
---- apt-0.6.46.4.1/methods/gpgv.cc 2006-12-04 14:37:36.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/methods/gpgv.cc 2008-01-27 10:13:06.000000000 +0000
-@@ -1,3 +1,7 @@
-+extern "C" {
-+ #include <mach-o/nlist.h>
-+}
-+
- #include <apt-pkg/error.h>
- #include <apt-pkg/acquire-method.h>
- #include <apt-pkg/strutl.h>
-@@ -302,6 +306,15 @@
-
- int main()
- {
-+#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200
-+ struct nlist nl[2];
-+ memset(nl, 0, sizeof(nl));
-+ nl[0].n_un.n_name = (char *) "_useMDNSResponder";
-+ nlist("/usr/lib/libc.dylib", nl);
-+ if (nl[0].n_type != N_UNDF)
-+ *(int *) nl[0].n_value = 0;
-+#endif
-+
- setlocale(LC_ALL, "");
-
- GPGVMethod Mth;
-diff -ru apt-0.6.46.4.1/methods/gzip.cc apt-0.6.46.4.1+iPhone/methods/gzip.cc
---- apt-0.6.46.4.1/methods/gzip.cc 2006-12-04 14:37:36.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/methods/gzip.cc 2008-01-27 10:13:10.000000000 +0000
-@@ -1,3 +1,7 @@
-+extern "C" {
-+ #include <mach-o/nlist.h>
-+}
-+
- // -*- mode: cpp; mode: fold -*-
- // Description /*{{{*/
- // $Id: gzip.cc,v 1.17.2.1 2004/01/16 18:58:50 mdz Exp $
-@@ -162,6 +166,15 @@
-
- int main(int argc, char *argv[])
- {
-+#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200
-+ struct nlist nl[2];
-+ memset(nl, 0, sizeof(nl));
-+ nl[0].n_un.n_name = (char *) "_useMDNSResponder";
-+ nlist("/usr/lib/libc.dylib", nl);
-+ if (nl[0].n_type != N_UNDF)
-+ *(int *) nl[0].n_value = 0;
-+#endif
-+
- setlocale(LC_ALL, "");
-
- GzipMethod Mth;
-diff -ru apt-0.6.46.4.1/methods/http.cc apt-0.6.46.4.1+iPhone/methods/http.cc
---- apt-0.6.46.4.1/methods/http.cc 2006-12-04 14:37:36.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/methods/http.cc 2008-01-27 10:13:27.000000000 +0000
-@@ -1,3 +1,7 @@
-+extern "C" {
-+ #include <mach-o/nlist.h>
-+}
-+
- // -*- mode: cpp; mode: fold -*-
- // Description /*{{{*/
- // $Id: http.cc,v 1.59 2004/05/08 19:42:35 mdz Exp $
-@@ -1224,6 +1228,15 @@
-
- int main()
- {
-+#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200
-+ struct nlist nl[2];
-+ memset(nl, 0, sizeof(nl));
-+ nl[0].n_un.n_name = (char *) "_useMDNSResponder";
-+ nlist("/usr/lib/libc.dylib", nl);
-+ if (nl[0].n_type != N_UNDF)
-+ *(int *) nl[0].n_value = 0;
-+#endif
-+
- setlocale(LC_ALL, "");
-
- HttpMethod Mth;
-diff -ru apt-0.6.46.4.1/methods/rred.cc apt-0.6.46.4.1+iPhone/methods/rred.cc
---- apt-0.6.46.4.1/methods/rred.cc 2006-12-04 14:37:36.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/methods/rred.cc 2008-01-27 10:13:41.000000000 +0000
-@@ -1,3 +1,7 @@
-+extern "C" {
-+ #include <mach-o/nlist.h>
-+}
-+
- #include <apt-pkg/fileutl.h>
- #include <apt-pkg/error.h>
- #include <apt-pkg/acquire-method.h>
-@@ -253,6 +257,15 @@
-
- int main(int argc, char *argv[])
- {
-+#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200
-+ struct nlist nl[2];
-+ memset(nl, 0, sizeof(nl));
-+ nl[0].n_un.n_name = (char *) "_useMDNSResponder";
-+ nlist("/usr/lib/libc.dylib", nl);
-+ if (nl[0].n_type != N_UNDF)
-+ *(int *) nl[0].n_value = 0;
-+#endif
-+
- RredMethod Mth;
-
- Prog = strrchr(argv[0],'/');
-diff -ru apt-0.6.46.4.1/methods/rsh.cc apt-0.6.46.4.1+iPhone/methods/rsh.cc
---- apt-0.6.46.4.1/methods/rsh.cc 2006-12-04 14:37:36.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/methods/rsh.cc 2008-01-27 10:13:45.000000000 +0000
-@@ -1,3 +1,7 @@
-+extern "C" {
-+ #include <mach-o/nlist.h>
-+}
-+
- // -*- mode: cpp; mode: fold -*-
- // Description /*{{{*/
- // $Id: rsh.cc,v 1.6.2.1 2004/01/16 18:58:50 mdz Exp $
-@@ -511,6 +515,15 @@
-
- int main(int argc, const char *argv[])
- {
-+#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200
-+ struct nlist nl[2];
-+ memset(nl, 0, sizeof(nl));
-+ nl[0].n_un.n_name = (char *) "_useMDNSResponder";
-+ nlist("/usr/lib/libc.dylib", nl);
-+ if (nl[0].n_type != N_UNDF)
-+ *(int *) nl[0].n_value = 0;
-+#endif
-+
- setlocale(LC_ALL, "");
-
- RSHMethod Mth;
diff --git a/data/apt/memrchr.c b/data/apt/memrchr.c
new file mode 100644
index 000000000..da93ca0ba
--- /dev/null
+++ b/data/apt/memrchr.c
@@ -0,0 +1,161 @@
+/* memrchr -- find the last occurrence of a byte in a memory block
+
+ Copyright (C) 1991, 1993, 1996, 1997, 1999, 2000, 2003, 2004, 2005,
+ 2006, 2007, 2008 Free Software Foundation, Inc.
+
+ Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
+ with help from Dan Sahlin (dan@sics.se) and
+ commentary by Jim Blandy (jimb@ai.mit.edu);
+ adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu),
+ and implemented by Roland McGrath (roland@ai.mit.edu).
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#if defined _LIBC
+# include <memcopy.h>
+#else
+# include <config.h>
+# define reg_char char
+#endif
+
+#include <string.h>
+#include <limits.h>
+
+#undef __memrchr
+#ifdef _LIBC
+# undef memrchr
+#endif
+
+#ifndef weak_alias
+# define __memrchr memrchr
+#endif
+
+/* Search no more than N bytes of S for C. */
+void *
+__memrchr (void const *s, int c_in, size_t n)
+{
+ /* On 32-bit hardware, choosing longword to be a 32-bit unsigned
+ long instead of a 64-bit uintmax_t tends to give better
+ performance. On 64-bit hardware, unsigned long is generally 64
+ bits already. Change this typedef to experiment with
+ performance. */
+ typedef unsigned long int longword;
+
+ const unsigned char *char_ptr;
+ const longword *longword_ptr;
+ longword repeated_one;
+ longword repeated_c;
+ unsigned reg_char c;
+
+ c = (unsigned char) c_in;
+
+ /* Handle the last few bytes by reading one byte at a time.
+ Do this until CHAR_PTR is aligned on a longword boundary. */
+ for (char_ptr = (const unsigned char *) s + n;
+ n > 0 && (size_t) char_ptr % sizeof (longword) != 0;
+ --n)
+ if (*--char_ptr == c)
+ return (void *) char_ptr;
+
+ longword_ptr = (const longword *) char_ptr;
+
+ /* All these elucidatory comments refer to 4-byte longwords,
+ but the theory applies equally well to any size longwords. */
+
+ /* Compute auxiliary longword values:
+ repeated_one is a value which has a 1 in every byte.
+ repeated_c has c in every byte. */
+ repeated_one = 0x01010101;
+ repeated_c = c | (c << 8);
+ repeated_c |= repeated_c << 16;
+ if (0xffffffffU < (longword) -1)
+ {
+ repeated_one |= repeated_one << 31 << 1;
+ repeated_c |= repeated_c << 31 << 1;
+ if (8 < sizeof (longword))
+ {
+ size_t i;
+
+ for (i = 64; i < sizeof (longword) * 8; i *= 2)
+ {
+ repeated_one |= repeated_one << i;
+ repeated_c |= repeated_c << i;
+ }
+ }
+ }
+
+ /* Instead of the traditional loop which tests each byte, we will test a
+ longword at a time. The tricky part is testing if *any of the four*
+ bytes in the longword in question are equal to c. We first use an xor
+ with repeated_c. This reduces the task to testing whether *any of the
+ four* bytes in longword1 is zero.
+
+ We compute tmp =
+ ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7).
+ That is, we perform the following operations:
+ 1. Subtract repeated_one.
+ 2. & ~longword1.
+ 3. & a mask consisting of 0x80 in every byte.
+ Consider what happens in each byte:
+ - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff,
+ and step 3 transforms it into 0x80. A carry can also be propagated
+ to more significant bytes.
+ - If a byte of longword1 is nonzero, let its lowest 1 bit be at
+ position k (0 <= k <= 7); so the lowest k bits are 0. After step 1,
+ the byte ends in a single bit of value 0 and k bits of value 1.
+ After step 2, the result is just k bits of value 1: 2^k - 1. After
+ step 3, the result is 0. And no carry is produced.
+ So, if longword1 has only non-zero bytes, tmp is zero.
+ Whereas if longword1 has a zero byte, call j the position of the least
+ significant zero byte. Then the result has a zero at positions 0, ...,
+ j-1 and a 0x80 at position j. We cannot predict the result at the more
+ significant bytes (positions j+1..3), but it does not matter since we
+ already have a non-zero bit at position 8*j+7.
+
+ So, the test whether any byte in longword1 is zero is equivalent to
+ testing whether tmp is nonzero. */
+
+ while (n >= sizeof (longword))
+ {
+ longword longword1 = *--longword_ptr ^ repeated_c;
+
+ if ((((longword1 - repeated_one) & ~longword1)
+ & (repeated_one << 7)) != 0)
+ {
+ longword_ptr++;
+ break;
+ }
+ n -= sizeof (longword);
+ }
+
+ char_ptr = (const unsigned char *) longword_ptr;
+
+ /* At this point, we know that either n < sizeof (longword), or one of the
+ sizeof (longword) bytes starting at char_ptr is == c. On little-endian
+ machines, we could determine the first such byte without any further
+ memory accesses, just by looking at the tmp result from the last loop
+ iteration. But this does not work on big-endian machines. Choose code
+ that works in both cases. */
+
+ while (n-- > 0)
+ {
+ if (*--char_ptr == c)
+ return (void *) char_ptr;
+ }
+
+ return NULL;
+}
+#ifdef weak_alias
+weak_alias (__memrchr, memrchr)
+#endif
diff --git a/data/apt/memrchr.diff b/data/apt/memrchr.diff
new file mode 100644
index 000000000..8913e1816
--- /dev/null
+++ b/data/apt/memrchr.diff
@@ -0,0 +1,195 @@
+diff -ru apt-0.7.20.2/ftparchive/cachedb.cc apt-0.7.20.2+iPhone/ftparchive/cachedb.cc
+--- apt-0.7.20.2/ftparchive/cachedb.cc 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/ftparchive/cachedb.cc 2009-04-14 16:10:02.000000000 +0000
+@@ -315,6 +315,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 -ru apt-0.7.20.2/apt-pkg/deb/dpkgpm.cc apt-0.7.20.2+iPhone/apt-pkg/deb/dpkgpm.cc
+--- apt-0.7.20.2/apt-pkg/deb/dpkgpm.cc 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/deb/dpkgpm.cc 2009-04-15 19:25:04.000000000 +0000
+@@ -501,6 +501,7 @@
+
+ // now move the unprocessed bits (after the final \n that is now a 0x0)
+ // to the start and update dpkgbuf_pos
++ void *memrchr(void const *, int, size_t);
+ p = (char*)memrchr(dpkgbuf, 0, dpkgbuf_pos);
+ if(p == NULL)
+ return;
+@@ -974,3 +975,165 @@
+ List.erase(List.begin(),List.end());
+ }
+ /*}}}*/
++
++/* memrchr -- find the last occurrence of a byte in a memory block
++
++ Copyright (C) 1991, 1993, 1996, 1997, 1999, 2000, 2003, 2004, 2005,
++ 2006, 2007, 2008 Free Software Foundation, Inc.
++
++ Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
++ with help from Dan Sahlin (dan@sics.se) and
++ commentary by Jim Blandy (jimb@ai.mit.edu);
++ adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu),
++ and implemented by Roland McGrath (roland@ai.mit.edu).
++
++ This program is free software: you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>. */
++
++#if defined _LIBC
++# include <memcopy.h>
++#else
++# include <config.h>
++# define reg_char char
++#endif
++
++#include <string.h>
++#include <limits.h>
++
++#undef __memrchr
++#ifdef _LIBC
++# undef memrchr
++#endif
++
++#ifndef weak_alias
++# define __memrchr memrchr
++#endif
++
++/* Search no more than N bytes of S for C. */
++void *
++__memrchr (void const *s, int c_in, size_t n)
++{
++ /* On 32-bit hardware, choosing longword to be a 32-bit unsigned
++ long instead of a 64-bit uintmax_t tends to give better
++ performance. On 64-bit hardware, unsigned long is generally 64
++ bits already. Change this typedef to experiment with
++ performance. */
++ typedef unsigned long int longword;
++
++ const unsigned char *char_ptr;
++ const longword *longword_ptr;
++ longword repeated_one;
++ longword repeated_c;
++ unsigned reg_char c;
++
++ c = (unsigned char) c_in;
++
++ /* Handle the last few bytes by reading one byte at a time.
++ Do this until CHAR_PTR is aligned on a longword boundary. */
++ for (char_ptr = (const unsigned char *) s + n;
++ n > 0 && (size_t) char_ptr % sizeof (longword) != 0;
++ --n)
++ if (*--char_ptr == c)
++ return (void *) char_ptr;
++
++ longword_ptr = (const longword *) char_ptr;
++
++ /* All these elucidatory comments refer to 4-byte longwords,
++ but the theory applies equally well to any size longwords. */
++
++ /* Compute auxiliary longword values:
++ repeated_one is a value which has a 1 in every byte.
++ repeated_c has c in every byte. */
++ repeated_one = 0x01010101;
++ repeated_c = c | (c << 8);
++ repeated_c |= repeated_c << 16;
++ if (0xffffffffU < (longword) -1)
++ {
++ repeated_one |= repeated_one << 31 << 1;
++ repeated_c |= repeated_c << 31 << 1;
++ if (8 < sizeof (longword))
++ {
++ size_t i;
++
++ for (i = 64; i < sizeof (longword) * 8; i *= 2)
++ {
++ repeated_one |= repeated_one << i;
++ repeated_c |= repeated_c << i;
++ }
++ }
++ }
++
++ /* Instead of the traditional loop which tests each byte, we will test a
++ longword at a time. The tricky part is testing if *any of the four*
++ bytes in the longword in question are equal to c. We first use an xor
++ with repeated_c. This reduces the task to testing whether *any of the
++ four* bytes in longword1 is zero.
++
++ We compute tmp =
++ ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7).
++ That is, we perform the following operations:
++ 1. Subtract repeated_one.
++ 2. & ~longword1.
++ 3. & a mask consisting of 0x80 in every byte.
++ Consider what happens in each byte:
++ - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff,
++ and step 3 transforms it into 0x80. A carry can also be propagated
++ to more significant bytes.
++ - If a byte of longword1 is nonzero, let its lowest 1 bit be at
++ position k (0 <= k <= 7); so the lowest k bits are 0. After step 1,
++ the byte ends in a single bit of value 0 and k bits of value 1.
++ After step 2, the result is just k bits of value 1: 2^k - 1. After
++ step 3, the result is 0. And no carry is produced.
++ So, if longword1 has only non-zero bytes, tmp is zero.
++ Whereas if longword1 has a zero byte, call j the position of the least
++ significant zero byte. Then the result has a zero at positions 0, ...,
++ j-1 and a 0x80 at position j. We cannot predict the result at the more
++ significant bytes (positions j+1..3), but it does not matter since we
++ already have a non-zero bit at position 8*j+7.
++
++ So, the test whether any byte in longword1 is zero is equivalent to
++ testing whether tmp is nonzero. */
++
++ while (n >= sizeof (longword))
++ {
++ longword longword1 = *--longword_ptr ^ repeated_c;
++
++ if ((((longword1 - repeated_one) & ~longword1)
++ & (repeated_one << 7)) != 0)
++ {
++ longword_ptr++;
++ break;
++ }
++ n -= sizeof (longword);
++ }
++
++ char_ptr = (const unsigned char *) longword_ptr;
++
++ /* At this point, we know that either n < sizeof (longword), or one of the
++ sizeof (longword) bytes starting at char_ptr is == c. On little-endian
++ machines, we could determine the first such byte without any further
++ memory accesses, just by looking at the tmp result from the last loop
++ iteration. But this does not work on big-endian machines. Choose code
++ that works in both cases. */
++
++ while (n-- > 0)
++ {
++ if (*--char_ptr == c)
++ return (void *) char_ptr;
++ }
++
++ return NULL;
++}
++#ifdef weak_alias
++weak_alias (__memrchr, memrchr)
++#endif
diff --git a/data/apt/ostable.diff b/data/apt/ostable.diff
deleted file mode 100644
index 18211fc7d..000000000
--- a/data/apt/ostable.diff
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ru apt-0.6.46.4.1/buildlib/ostable apt-0.6.46.4.1+iPhone/buildlib/ostable
---- apt-0.6.46.4.1/buildlib/ostable 2006-12-04 14:37:35.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/buildlib/ostable 2008-04-13 06:09:10.000000000 +0000
-@@ -11,6 +11,8 @@
- [^-]*-kfreebsd.*-gnu kfreebsd
- [^-]*-knetbsd.*-gnu knetbsd
- [^-]*-gnu[^-]* hurd
-+[^-]*-darwin9 iphoneos
-+[^-]*-darwin darwin
-
- # These are samples.
- hp-hpux[^-]* hp-ux
diff --git a/data/apt/port.diff b/data/apt/port.diff
index 46584b41a..af30d7269 100644
--- a/data/apt/port.diff
+++ b/data/apt/port.diff
@@ -1,7 +1,7 @@
-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 @@
+diff -ru apt-0.7.20.2/apt-inst/deb/dpkgdb.cc apt-0.7.20.2+iPhone/apt-inst/deb/dpkgdb.cc
+--- apt-0.7.20.2/apt-inst/deb/dpkgdb.cc 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-inst/deb/dpkgdb.cc 2009-04-14 16:10:02.000000000 +0000
+@@ -22,6 +22,7 @@
#include <stdio.h>
#include <errno.h>
@@ -9,29 +9,9 @@ diff -ru apt-0.6.46.4.1/apt-inst/deb/dpkgdb.cc apt-0.6.46.4.1+iPhone/apt-inst/de
#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
+diff -ru apt-0.7.20.2/apt-inst/makefile apt-0.7.20.2+iPhone/apt-inst/makefile
+--- apt-0.7.20.2/apt-inst/makefile 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-inst/makefile 2009-04-14 16:10:02.000000000 +0000
@@ -11,7 +11,8 @@
# The library name
@@ -42,10 +22,10 @@ diff -r -u apt-0.6.46.4/apt-inst/makefile apt-0.6.46.4.1+iPhone/apt-inst/makefil
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 @@
+diff -ru apt-0.7.20.2/apt-pkg/deb/dpkgpm.cc apt-0.7.20.2+iPhone/apt-pkg/deb/dpkgpm.cc
+--- apt-0.7.20.2/apt-pkg/deb/dpkgpm.cc 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/deb/dpkgpm.cc 2009-04-14 16:10:02.000000000 +0000
+@@ -766,6 +766,8 @@
clog << flush;
cerr << flush;
@@ -54,27 +34,9 @@ diff -r -u apt-0.6.46.4/apt-pkg/deb/dpkgpm.cc apt-0.6.46.4.1+iPhone/apt-pkg/deb/
/* 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
+diff -ru apt-0.7.20.2/apt-pkg/makefile apt-0.7.20.2+iPhone/apt-pkg/makefile
+--- apt-0.7.20.2/apt-pkg/makefile 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/makefile 2009-04-14 16:16:15.000000000 +0000
@@ -12,7 +12,8 @@
# The library name, don't forget to update init.h and the copy in
# methods/makefile - FIXME
@@ -82,12 +44,86 @@ diff -r -u apt-0.6.46.4/apt-pkg/makefile apt-0.6.46.4.1+iPhone/apt-pkg/makefile
-LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
+LIBEXT=
+#$(GLIBC_VER)$(LIBSTDCPP_VER)
- MAJOR=3.11
+ MAJOR=4.6
MINOR=0
- SLIBS=$(PTHREADLIB) $(INTLLIBS)
-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
+ SLIBS=$(PTHREADLIB) $(INTLLIBS) -lutil
+diff -ru apt-0.7.20.2/buildlib/environment.mak.in apt-0.7.20.2+iPhone/buildlib/environment.mak.in
+--- apt-0.7.20.2/buildlib/environment.mak.in 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/buildlib/environment.mak.in 2009-04-14 16:11:50.000000000 +0000
+@@ -67,8 +67,14 @@
+ ifneq ($(words $(filter gnu% linux-gnu% kfreebsd-gnu% %-gnu,$(HOST_OS))),0)
+ SONAME_MAGIC=-Wl,-soname -Wl,
+ LFLAGS_SO=
++ SOEXT=so
++else
++ifneq ($(words $(filter darwin%,$(HOST_OS))),0)
++ SONAME_MAGIC=-Wl,-dylib_install_name,
++ LFLAGS_SO=
++ SOEXT=dylib
+ else
+ # Do not know how to create shared libraries here.
+ ONLYSTATICLIBS = yes
+ endif
+-
++endif
+diff -ru apt-0.7.20.2/buildlib/library.mak apt-0.7.20.2+iPhone/buildlib/library.mak
+--- apt-0.7.20.2/buildlib/library.mak 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/buildlib/library.mak 2009-04-14 16:14:05.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).$(SOEXT).$(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).$(SOEXT).$(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).$(SOEXT) $(LIB)/lib$(LIBRARY)$(LIBEXT).$(SOEXT).$(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)*.$(SOEXT)*
+
+ # 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).$(SOEXT).$(MAJOR) $(LIB)/lib$(LIBRARY).$(SOEXT)
++$(LIB)/lib$(LIBRARY)$(LIBEXT).$(SOEXT).$(MAJOR): $(LIB)/lib$(LIBRARY)$(LIBEXT).$(SOEXT).$(MAJOR).$(MINOR)
+ ln -sf $(<F) $@
+-$(LIB)/lib$(LIBRARY).so: $(LIB)/lib$(LIBRARY)$(LIBEXT).so.$(MAJOR).$(MINOR)
++$(LIB)/lib$(LIBRARY).$(SOEXT): $(LIB)/lib$(LIBRARY)$(LIBEXT).$(SOEXT).$(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).$(SOEXT).$(MAJOR).$(MINOR): $($(LOCAL)-HEADERS) $($(LOCAL)-OBJS)
++ -rm -f $(LIB)/lib$($(@F)-LIBRARY)*.$(SOEXT)* 2> /dev/null
+ echo Building shared library $@
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(PICFLAGS) $(LFLAGS) $(LFLAGS_SO)\
+- -o $@ $(SONAME_MAGIC)$($(@F)-SONAME) -shared \
++ -o $@ $(SONAME_MAGIC)$(patsubst $(LIB)/%,/usr/lib/%,$@) -dynamiclib \
+ $(filter %.opic,$^) \
+ $($(@F)-SLIBS)
+
+diff -ru apt-0.7.20.2/buildlib/podomain.mak apt-0.7.20.2+iPhone/buildlib/podomain.mak
+--- apt-0.7.20.2/buildlib/podomain.mak 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/buildlib/podomain.mak 2009-04-14 16:10:02.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
@@ -98,9 +134,9 @@ diff -r -u apt-0.6.46.4/buildlib/podomain.mak apt-0.6.46.4.1+iPhone/buildlib/pod
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
+diff -ru apt-0.7.20.2/buildlib/program.mak apt-0.7.20.2+iPhone/buildlib/program.mak
+--- apt-0.7.20.2/buildlib/program.mak 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/buildlib/program.mak 2009-04-14 16:10:02.000000000 +0000
@@ -44,6 +44,7 @@
# The binary build rule
$($(LOCAL)-BIN): $($(LOCAL)-OBJS) $($(LOCAL)-MKS)
@@ -109,60 +145,22 @@ diff -r -u apt-0.6.46.4/buildlib/program.mak apt-0.6.46.4.1+iPhone/buildlib/prog
$(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
-@@ -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
-@@ -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
-@@ -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
-@@ -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>
- /*}}}*/
+diff -ru apt-0.7.20.2/cmdline/apt-get.cc apt-0.7.20.2+iPhone/cmdline/apt-get.cc
+--- apt-0.7.20.2/cmdline/apt-get.cc 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/cmdline/apt-get.cc 2009-04-15 19:38:48.000000000 +0000
+@@ -53,7 +53,8 @@
+ #include <termios.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
+-#include <sys/statfs.h>
++#include <sys/param.h>
++#include <sys/mount.h>
+ #include <sys/statvfs.h>
+ #include <signal.h>
+ #include <unistd.h>
+@@ -66,12 +66,13 @@
+
+ #define RAMFS_MAGIC 0x858458f6
+#define _trace() printf("_trace(%s:%d)\n", __FILE__, __LINE__)
+
@@ -175,16 +173,7 @@ diff -r -u apt-0.6.46.4/cmdline/apt-get.cc apt-0.6.46.4.1+iPhone/cmdline/apt-get
unsigned int ScreenWidth = 80 - 1; /* - 1 for the cursor */
// class CacheFile - Cover class for some dependency cache functions /*{{{*/
-@@ -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,9 @@
+@@ -2786,6 +2787,9 @@
if (!isatty(STDOUT_FILENO) && _config->FindI("quiet",0) < 1)
_config->Set("quiet","1");
@@ -194,39 +183,9 @@ diff -r -u apt-0.6.46.4/cmdline/apt-get.cc apt-0.6.46.4.1+iPhone/cmdline/apt-get
// 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
-@@ -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
+diff -ru apt-0.7.20.2/ftparchive/contents.cc apt-0.7.20.2+iPhone/ftparchive/contents.cc
+--- apt-0.7.20.2/ftparchive/contents.cc 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/ftparchive/contents.cc 2009-04-14 16:10:02.000000000 +0000
@@ -41,7 +41,7 @@
#include <stdio.h>
#include <stdlib.h>
@@ -236,9 +195,9 @@ diff -r -u apt-0.6.46.4/ftparchive/contents.cc apt-0.6.46.4.1+iPhone/ftparchive/
/*}}}*/
// 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
+diff -ru apt-0.7.20.2/Makefile apt-0.7.20.2+iPhone/Makefile
+--- apt-0.7.20.2/Makefile 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/Makefile 2009-04-14 16:10:02.000000000 +0000
@@ -18,7 +18,6 @@
$(MAKE) -C ftparchive $@
$(MAKE) -C dselect $@
@@ -247,3 +206,28 @@ diff -r -u apt-0.6.46.4/Makefile apt-0.6.46.4.1+iPhone/Makefile
# Some very common aliases
.PHONY: maintainer-clean dist-clean distclean pristine sanity
+diff -ru apt-0.7.20.2/configure.in apt-0.7.20.2+iPhone/configure.in
+--- apt-0.7.20.2/configure.in 2009-02-07 15:10:44.000000000 +0000
++++ apt-0.7.20.2+iPhone/configure.in 2009-04-15 18:58:36.000000000 +0000
+@@ -88,7 +88,7 @@
+ dnl First check against the full canonical canoncial-system-type in $target
+ dnl and if that fails, just look for the cpu
+ AC_MSG_CHECKING(debian architecture)
+-archset="`dpkg-architecture -qDEB_HOST_ARCH`"
++archset="`cd "$DPKG_ARCH"; PERL5LIB=$(pwd) ./dpkg-architecture -qDEB_HOST_ARCH -t$host`"
+ if test "x$archset" = "x"; then
+ AC_MSG_ERROR([failed: use --host= or output from dpkg-architecture])
+ fi
+diff -ru apt-0.7.20.2/apt-pkg/deb/dpkgpm.cc apt-0.7.20.2+iPhone/apt-pkg/deb/dpkgpm.cc
+--- apt-0.7.20.2/apt-pkg/deb/dpkgpm.cc 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/deb/dpkgpm.cc 2009-04-15 19:25:41.000000000 +0000
+@@ -33,7 +33,8 @@
+ #include <termios.h>
+ #include <unistd.h>
+ #include <sys/ioctl.h>
+-#include <pty.h>
++#include <sys/stat.h>
++#include <util.h>
+
+ #include <config.h>
+ #include <apti18n.h>
diff --git a/data/apt/textdomain.diff b/data/apt/textdomain.diff
new file mode 100644
index 000000000..6ef3853e5
--- /dev/null
+++ b/data/apt/textdomain.diff
@@ -0,0 +1,72 @@
+diff -ru apt-0.7.20.2/cmdline/apt-cache.cc apt-0.7.20.2+iPhone/cmdline/apt-cache.cc
+--- apt-0.7.20.2/cmdline/apt-cache.cc 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/cmdline/apt-cache.cc 2009-04-14 16:10:02.000000000 +0000
+@@ -1810,7 +1810,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 -ru apt-0.7.20.2/cmdline/apt-cdrom.cc apt-0.7.20.2+iPhone/cmdline/apt-cdrom.cc
+--- apt-0.7.20.2/cmdline/apt-cdrom.cc 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/cmdline/apt-cdrom.cc 2009-04-14 16:10:02.000000000 +0000
+@@ -188,7 +188,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 -ru apt-0.7.20.2/cmdline/apt-config.cc apt-0.7.20.2+iPhone/cmdline/apt-config.cc
+--- apt-0.7.20.2/cmdline/apt-config.cc 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/cmdline/apt-config.cc 2009-04-14 16:10:02.000000000 +0000
+@@ -103,7 +103,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 -ru apt-0.7.20.2/cmdline/apt-extracttemplates.cc apt-0.7.20.2+iPhone/cmdline/apt-extracttemplates.cc
+--- apt-0.7.20.2/cmdline/apt-extracttemplates.cc 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/cmdline/apt-extracttemplates.cc 2009-04-14 16:10:02.000000000 +0000
+@@ -361,7 +361,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 -ru apt-0.7.20.2/cmdline/apt-get.cc apt-0.7.20.2+iPhone/cmdline/apt-get.cc
+--- apt-0.7.20.2/cmdline/apt-get.cc 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/cmdline/apt-get.cc 2009-04-15 19:38:48.000000000 +0000
+@@ -2758,7 +2759,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 -ru apt-0.7.20.2/cmdline/apt-sortpkgs.cc apt-0.7.20.2+iPhone/cmdline/apt-sortpkgs.cc
+--- apt-0.7.20.2/cmdline/apt-sortpkgs.cc 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/cmdline/apt-sortpkgs.cc 2009-04-14 16:10:02.000000000 +0000
+@@ -174,7 +174,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 --git a/data/apt/timestamp.diff b/data/apt/timestamp.diff
index bedb9cadf..e69de29bb 100644
--- a/data/apt/timestamp.diff
+++ b/data/apt/timestamp.diff
@@ -1,98 +0,0 @@
-diff -ru apt-0.6.46.4.1/cmdline/apt-cache.cc apt-0.6.46.4.1+iPhone/cmdline/apt-cache.cc
---- apt-0.6.46.4.1/cmdline/apt-cache.cc 2006-12-04 14:37:35.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/cmdline/apt-cache.cc 2008-06-16 19:48:11.000000000 +0000
-@@ -1649,8 +1649,8 @@
- /* */
- bool ShowHelp(CommandLine &Cmd)
- {
-- ioprintf(cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION,
-- COMMON_OS,COMMON_CPU,__DATE__,__TIME__);
-+ ioprintf(cout,_("%s %s for %s %s\n"),PACKAGE,VERSION,
-+ COMMON_OS,COMMON_CPU);
-
- if (_config->FindB("version") == true)
- return true;
-diff -ru apt-0.6.46.4.1/cmdline/apt-cdrom.cc apt-0.6.46.4.1+iPhone/cmdline/apt-cdrom.cc
---- apt-0.6.46.4.1/cmdline/apt-cdrom.cc 2006-12-04 14:37:35.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/cmdline/apt-cdrom.cc 2008-06-16 19:47:49.000000000 +0000
-@@ -135,8 +135,8 @@
- /* */
- int ShowHelp()
- {
-- ioprintf(cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION,
-- COMMON_OS,COMMON_CPU,__DATE__,__TIME__);
-+ ioprintf(cout,_("%s %s for %s %s\n"),PACKAGE,VERSION,
-+ COMMON_OS,COMMON_CPU);
- if (_config->FindB("version") == true)
- return 0;
-
-diff -ru apt-0.6.46.4.1/cmdline/apt-config.cc apt-0.6.46.4.1+iPhone/cmdline/apt-config.cc
---- apt-0.6.46.4.1/cmdline/apt-config.cc 2006-12-04 14:37:35.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/cmdline/apt-config.cc 2008-06-16 19:47:55.000000000 +0000
-@@ -67,8 +67,8 @@
- /* */
- int ShowHelp()
- {
-- ioprintf(cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION,
-- COMMON_OS,COMMON_CPU,__DATE__,__TIME__);
-+ ioprintf(cout,_("%s %s for %s %s\n"),PACKAGE,VERSION,
-+ COMMON_OS,COMMON_CPU);
- if (_config->FindB("version") == true)
- return 0;
-
-diff -ru apt-0.6.46.4.1/cmdline/apt-extracttemplates.cc apt-0.6.46.4.1+iPhone/cmdline/apt-extracttemplates.cc
---- apt-0.6.46.4.1/cmdline/apt-extracttemplates.cc 2006-12-04 14:37:35.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/cmdline/apt-extracttemplates.cc 2008-06-16 19:48:06.000000000 +0000
-@@ -222,8 +222,8 @@
- /* */
- int ShowHelp(void)
- {
-- ioprintf(cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION,
-- COMMON_OS,COMMON_CPU,__DATE__,__TIME__);
-+ ioprintf(cout,_("%s %s for %s %s\n"),PACKAGE,VERSION,
-+ COMMON_OS,COMMON_CPU);
-
- if (_config->FindB("version") == true)
- return 0;
-diff -ru apt-0.6.46.4.1/cmdline/apt-get.cc apt-0.6.46.4.1+iPhone/cmdline/apt-get.cc
---- apt-0.6.46.4.1/cmdline/apt-get.cc 2006-12-04 14:37:35.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/cmdline/apt-get.cc 2008-06-16 19:47:43.000000000 +0000
-@@ -2384,8 +2384,8 @@
- /* */
- bool ShowHelp(CommandLine &CmdL)
- {
-- ioprintf(cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION,
-- COMMON_OS,COMMON_CPU,__DATE__,__TIME__);
-+ ioprintf(cout,_("%s %s for %s %s\n"),PACKAGE,VERSION,
-+ COMMON_OS,COMMON_CPU);
-
- if (_config->FindB("version") == true)
- {
-diff -ru apt-0.6.46.4.1/cmdline/apt-sortpkgs.cc apt-0.6.46.4.1+iPhone/cmdline/apt-sortpkgs.cc
---- apt-0.6.46.4.1/cmdline/apt-sortpkgs.cc 2006-12-04 14:37:35.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/cmdline/apt-sortpkgs.cc 2008-06-16 19:48:00.000000000 +0000
-@@ -141,8 +141,8 @@
- /* */
- int ShowHelp()
- {
-- ioprintf(cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION,
-- COMMON_OS,COMMON_CPU,__DATE__,__TIME__);
-+ ioprintf(cout,_("%s %s for %s %s\n"),PACKAGE,VERSION,
-+ COMMON_OS,COMMON_CPU);
- if (_config->FindB("version") == true)
- return 0;
-
-diff -ru apt-0.6.46.4.1/ftparchive/apt-ftparchive.cc apt-0.6.46.4.1+iPhone/ftparchive/apt-ftparchive.cc
---- apt-0.6.46.4.1/ftparchive/apt-ftparchive.cc 2006-12-04 14:37:36.000000000 +0000
-+++ apt-0.6.46.4.1+iPhone/ftparchive/apt-ftparchive.cc 2008-06-16 19:48:17.000000000 +0000
-@@ -547,8 +547,8 @@
- /* */
- bool ShowHelp(CommandLine &CmdL)
- {
-- ioprintf(cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION,
-- COMMON_OS,COMMON_CPU,__DATE__,__TIME__);
-+ ioprintf(cout,_("%s %s for %s %s\n"),PACKAGE,VERSION,
-+ COMMON_OS,COMMON_CPU);
- if (_config->FindB("version") == true)
- return true;
-