summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorSam Bingner <sam@bingner.com>2018-12-07 13:01:05 -1000
committerSam Bingner <sam@bingner.com>2018-12-07 13:01:05 -1000
commitdabe8669a56fca398da9a7dd117eb74f874cddc0 (patch)
tree1e9f41f484e72a02652b600498a7b09aee62b7e6 /data
parentbae6eae573376ebc0e942e88c4f6eaea9b0f1574 (diff)
Update to use libapt instead of apt7-lib for apt1.4+ and add apt-rdepends
Diffstat (limited to 'data')
l---------data/_apt/_metadata/berkeleydb.dep1
l---------data/_apt/_metadata/bzip2.dep1
l---------data/_apt/_metadata/curl.dep1
l---------data/_apt/_metadata/dpkg.dep1
l---------data/_apt/_metadata/gnupg.dep1
l---------data/_apt/_metadata/gzip.dep1
-rw-r--r--data/_apt/_metadata/in.1443.00 (renamed from data/_apt7/_metadata/in.1443.00)0
-rw-r--r--data/_apt/_metadata/license142
l---------data/_apt/_metadata/lz4.dep (renamed from data/_apt7/_metadata/lz4.dep)0
l---------data/_apt/_metadata/lzma.dep1
l---------data/_apt/_metadata/maintainer1
-rw-r--r--data/_apt/_metadata/notes2
-rw-r--r--data/_apt/_metadata/section1
l---------data/_apt/_metadata/sed.dep1
-rw-r--r--data/_apt/_metadata/tags1
-rw-r--r--data/_apt/_metadata/version1
-rw-r--r--data/_apt/apt-nito.tgz (renamed from data/_apt7/apt-nito.tgz)bin38054572 -> 38054572 bytes
-rw-r--r--data/_apt/cftype.diff (renamed from data/_apt7/cftype.diff)0
-rw-r--r--data/_apt/date-errors.diff (renamed from data/_apt7/date-errors.diff)0
-rw-r--r--data/_apt/make.sh32
-rw-r--r--data/_apt/sandbox-errors.diff (renamed from data/_apt7/sandbox-errors.diff)0
-rw-r--r--data/_apt/sha1.diff (renamed from data/_apt7/sha1.diff)0
l---------data/_apt1.4/_metadata/berkeleydb.dep1
l---------data/_apt1.4/_metadata/bzip2.dep1
l---------data/_apt1.4/_metadata/curl.dep1
l---------data/_apt1.4/_metadata/dpkg.dep1
l---------data/_apt1.4/_metadata/gnupg.dep1
l---------data/_apt1.4/_metadata/gzip.dep1
-rw-r--r--data/_apt1.4/_metadata/in.1443.00 (renamed from data/apt7-key/_metadata/in.1443.00)0
-rw-r--r--data/_apt1.4/_metadata/license142
l---------data/_apt1.4/_metadata/lz4.dep (renamed from data/apt7-lib/_metadata/lz4.dep)0
l---------data/_apt1.4/_metadata/lzma.dep1
l---------data/_apt1.4/_metadata/maintainer1
-rw-r--r--data/_apt1.4/_metadata/notes2
-rw-r--r--data/_apt1.4/_metadata/section1
l---------data/_apt1.4/_metadata/sed.dep1
-rw-r--r--data/_apt1.4/_metadata/tags1
-rw-r--r--data/_apt1.4/_metadata/version1
-rw-r--r--data/_apt1.4/apt-nito.tgzbin0 -> 38054572 bytes
-rw-r--r--data/_apt1.4/cftype.diff11
-rw-r--r--data/_apt1.4/date-errors.diff12
-rw-r--r--data/_apt1.4/make.sh32
-rw-r--r--data/_apt1.4/sandbox-errors.diff10
-rw-r--r--data/_apt1.4/sha1.diff12
l---------data/_apt7/_metadata/maintainer2
-rw-r--r--data/_apt7/_metadata/version2
-rw-r--r--data/_apt7/abi-4.8.diff315
-rw-r--r--data/_apt7/apt-get.diff20
-rw-r--r--data/_apt7/apt_0.7.25.3.tar.gzbin0 -> 2646727 bytes
-rw-r--r--data/_apt7/aptbug545699.args1
-rw-r--r--data/_apt7/aptbug545699.diff71
-rw-r--r--data/_apt7/architecture.diff13
-rw-r--r--data/_apt7/cache-limit.diff21
-rw-r--r--data/_apt7/cfnetwork.diff703
-rw-r--r--data/_apt7/deblistparser.diff27
-rw-r--r--data/_apt7/deprecated.diff13
-rw-r--r--data/_apt7/display.diff125
-rw-r--r--data/_apt7/find.diff37
-rw-r--r--data/_apt7/finddesc.diff59
-rw-r--r--data/_apt7/hashtable.diff61
-rw-r--r--data/_apt7/iconv.diff23
-rw-r--r--data/_apt7/insensitive.diff12
-rw-r--r--data/_apt7/intl.diff12
-rw-r--r--data/_apt7/longdesc.diff17
-rw-r--r--data/_apt7/make.sh36
-rw-r--r--data/_apt7/map_anon.diff17
-rw-r--r--data/_apt7/memrchr.c161
-rw-r--r--data/_apt7/memrchr.diff195
-rw-r--r--data/_apt7/mmap.diff199
-rw-r--r--data/_apt7/parallel.diff33
-rw-r--r--data/_apt7/port.diff216
-rw-r--r--data/_apt7/printf.diff12
-rw-r--r--data/_apt7/public.diff15
-rw-r--r--data/_apt7/reinstreq.diff21
-rw-r--r--data/_apt7/strdupa.diff80
-rw-r--r--data/_apt7/tag.diff280
-rw-r--r--data/_apt7/timestamp.diff (renamed from data/apt7-lib/_metadata/in.1443.00)0
-rw-r--r--data/_apt7/tolerance.diff24
-rw-r--r--data/_apt7/tornado.diff719
-rw-r--r--data/_apt7/torque.diff147
-rw-r--r--data/_apt7/turbulence.diff64
l---------data/apt-key/_metadata/_apt1.4.dep1
-rw-r--r--data/apt-key/_metadata/breaks1
-rw-r--r--data/apt-key/_metadata/conflicts1
l---------data/apt-key/_metadata/coreutils.dep (renamed from data/apt7-key/_metadata/coreutils.dep)0
-rw-r--r--data/apt-key/_metadata/description1
-rw-r--r--data/apt-key/_metadata/in.1443.00 (renamed from data/apt7/_metadata/in.1443.00)0
l---------data/apt-key/_metadata/libapt.dep1
l---------data/apt-key/_metadata/license1
l---------data/apt-key/_metadata/maintainer1
-rw-r--r--data/apt-key/_metadata/name1
-rw-r--r--data/apt-key/_metadata/priority1
-rw-r--r--data/apt-key/_metadata/replaces1
-rw-r--r--data/apt-key/_metadata/role1
l---------data/apt-key/_metadata/section1
-rw-r--r--data/apt-key/_metadata/tags1
l---------data/apt-key/_metadata/version1
-rw-r--r--data/apt-key/make.sh2
-rw-r--r--data/apt-rdepends/_metadata/description1
-rw-r--r--data/apt-rdepends/_metadata/in.1443.000
-rw-r--r--data/apt-rdepends/_metadata/in.550.580
l---------data/apt-rdepends/_metadata/libapt-pkg-perl.dep1
l---------data/apt-rdepends/_metadata/license1
l---------data/apt-rdepends/_metadata/maintainer1
-rw-r--r--data/apt-rdepends/_metadata/priority1
-rw-r--r--data/apt-rdepends/_metadata/role1
-rw-r--r--data/apt-rdepends/_metadata/section1
-rw-r--r--data/apt-rdepends/_metadata/tags1
-rw-r--r--data/apt-rdepends/_metadata/version1
-rw-r--r--data/apt-rdepends/apt-rdepends-1.3.0.tar.bz2bin0 -> 13420 bytes
-rw-r--r--data/apt-rdepends/make.sh2
-rw-r--r--data/apt-rdepends/makefile.diff30
-rw-r--r--data/apt/_metadata/depends2
-rw-r--r--data/apt/_metadata/name2
l---------data/apt1.4/_metadata/_apt1.4.dep1
l---------data/apt1.4/_metadata/apt-key.dep1
l---------data/apt1.4/_metadata/berkeleydb.dep1
-rw-r--r--data/apt1.4/_metadata/conflicts1
-rw-r--r--data/apt1.4/_metadata/description1
-rw-r--r--data/apt1.4/_metadata/in.1443.000
l---------data/apt1.4/_metadata/libapt.dep1
l---------data/apt1.4/_metadata/libapt.ver.iphoneos-arm1
l---------data/apt1.4/_metadata/license1
l---------data/apt1.4/_metadata/maintainer1
-rw-r--r--data/apt1.4/_metadata/name1
-rw-r--r--data/apt1.4/_metadata/priority1
-rw-r--r--data/apt1.4/_metadata/role1
l---------data/apt1.4/_metadata/section1
-rw-r--r--data/apt1.4/_metadata/tags1
l---------data/apt1.4/_metadata/version1
-rw-r--r--data/apt1.4/make.sh4
-rw-r--r--data/apt7-lib/_metadata/priority2
-rw-r--r--data/apt7-lib/make.sh6
-rw-r--r--[l---------]data/apt7/_metadata/apt7-lib.ver.iphoneos-arm2
-rw-r--r--data/dpkg-perl/_metadata/in.550.580
-rw-r--r--data/libapt-pkg-dev/_metadata/description1
-rw-r--r--data/libapt-pkg-dev/_metadata/in.1443.000
l---------data/libapt-pkg-dev/_metadata/libapt-pkg5.0.dep1
l---------data/libapt-pkg-dev/_metadata/license1
l---------data/libapt-pkg-dev/_metadata/maintainer1
-rw-r--r--data/libapt-pkg-dev/_metadata/name1
-rw-r--r--data/libapt-pkg-dev/_metadata/priority1
-rw-r--r--data/libapt-pkg-dev/_metadata/provides1
-rw-r--r--data/libapt-pkg-dev/_metadata/role1
-rw-r--r--data/libapt-pkg-dev/_metadata/section1
-rw-r--r--data/libapt-pkg-dev/_metadata/tags1
l---------data/libapt-pkg-dev/_metadata/version1
-rw-r--r--data/libapt-pkg-dev/make.sh3
l---------data/libapt-pkg-perl/_metadata/_apt1.4.dep1
-rw-r--r--data/libapt-pkg-perl/_metadata/description1
-rw-r--r--data/libapt-pkg-perl/_metadata/in.1443.000
-rw-r--r--data/libapt-pkg-perl/_metadata/in.550.580
l---------data/libapt-pkg-perl/_metadata/libapt-pkg5.0.dep1
-rw-r--r--data/libapt-pkg-perl/_metadata/license248
l---------data/libapt-pkg-perl/_metadata/maintainer1
l---------data/libapt-pkg-perl/_metadata/perl.dep1
-rw-r--r--data/libapt-pkg-perl/_metadata/priority1
-rw-r--r--data/libapt-pkg-perl/_metadata/role1
-rw-r--r--data/libapt-pkg-perl/_metadata/section1
-rw-r--r--data/libapt-pkg-perl/_metadata/tags1
-rw-r--r--data/libapt-pkg-perl/_metadata/version1
-rw-r--r--data/libapt-pkg-perl/libapt-pkg-perl_0.1.34.tar.xzbin0 -> 42480 bytes
-rw-r--r--data/libapt-pkg-perl/make.sh8
l---------data/libapt-pkg5.0/_metadata/_apt1.4.dep1
l---------data/libapt-pkg5.0/_metadata/bzip2.dep1
-rw-r--r--data/libapt-pkg5.0/_metadata/conflicts1
-rw-r--r--data/libapt-pkg5.0/_metadata/description1
-rw-r--r--data/libapt-pkg5.0/_metadata/in.1443.000
-rw-r--r--data/libapt-pkg5.0/_metadata/in.550.580
l---------data/libapt-pkg5.0/_metadata/license1
l---------data/libapt-pkg5.0/_metadata/lz4.dep1
l---------data/libapt-pkg5.0/_metadata/lzma.dep1
l---------data/libapt-pkg5.0/_metadata/maintainer1
-rw-r--r--data/libapt-pkg5.0/_metadata/name1
-rw-r--r--data/libapt-pkg5.0/_metadata/priority1
-rw-r--r--data/libapt-pkg5.0/_metadata/provides1
-rw-r--r--data/libapt-pkg5.0/_metadata/role1
-rw-r--r--data/libapt-pkg5.0/_metadata/section1
-rw-r--r--data/libapt-pkg5.0/_metadata/tags1
l---------data/libapt-pkg5.0/_metadata/version1
l---------data/libapt-pkg5.0/_metadata/xz.dep (renamed from data/apt7-lib/_metadata/xz.dep)0
-rw-r--r--data/libapt-pkg5.0/make.sh2
l---------data/libapt/_metadata/_apt1.4.dep1
-rw-r--r--data/libapt/_metadata/breaks1
l---------data/libapt/_metadata/bzip2.dep1
-rw-r--r--data/libapt/_metadata/conflicts1
-rw-r--r--data/libapt/_metadata/depends1
-rw-r--r--data/libapt/_metadata/description1
l---------data/libapt/_metadata/dpkg.dep1
-rw-r--r--data/libapt/_metadata/dpkg.ver.iphoneos-arm1
l---------data/libapt/_metadata/gnupg.dep1
l---------data/libapt/_metadata/gzip.dep1
-rw-r--r--data/libapt/_metadata/in.1443.000
l---------data/libapt/_metadata/license1
l---------data/libapt/_metadata/lz4.dep1
l---------data/libapt/_metadata/lzma.dep1
l---------data/libapt/_metadata/maintainer1
-rw-r--r--data/libapt/_metadata/name1
-rw-r--r--data/libapt/_metadata/priority1
-rw-r--r--data/libapt/_metadata/role1
-rw-r--r--data/libapt/_metadata/section1
-rw-r--r--data/libapt/_metadata/tags1
l---------data/libapt/_metadata/version1
l---------data/libapt/_metadata/xz.dep1
l---------data/libapt/libapt1
-rw-r--r--data/libapt/make.sh11
-rw-r--r--data/libgmp10/make.sh6
-rw-r--r--data/libgpg-error/triplet.diff3
-rw-r--r--data/lz4/_metadata/in.550.580
-rw-r--r--data/openssl/iphoneos.diff8
-rw-r--r--data/openssl/make.sh4
211 files changed, 4576 insertions, 39 deletions
diff --git a/data/_apt/_metadata/berkeleydb.dep b/data/_apt/_metadata/berkeleydb.dep
new file mode 120000
index 000000000..f945cb1a2
--- /dev/null
+++ b/data/_apt/_metadata/berkeleydb.dep
@@ -0,0 +1 @@
+../../berkeleydb \ No newline at end of file
diff --git a/data/_apt/_metadata/bzip2.dep b/data/_apt/_metadata/bzip2.dep
new file mode 120000
index 000000000..15aa44a77
--- /dev/null
+++ b/data/_apt/_metadata/bzip2.dep
@@ -0,0 +1 @@
+../../bzip2 \ No newline at end of file
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/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/gnupg.dep b/data/_apt/_metadata/gnupg.dep
new file mode 120000
index 000000000..277e892bf
--- /dev/null
+++ b/data/_apt/_metadata/gnupg.dep
@@ -0,0 +1 @@
+../../gnupg \ No newline at end of file
diff --git a/data/_apt/_metadata/gzip.dep b/data/_apt/_metadata/gzip.dep
new file mode 120000
index 000000000..c6c801e81
--- /dev/null
+++ b/data/_apt/_metadata/gzip.dep
@@ -0,0 +1 @@
+../../gzip \ No newline at end of file
diff --git a/data/_apt7/_metadata/in.1443.00 b/data/_apt/_metadata/in.1443.00
index e69de29bb..e69de29bb 100644
--- a/data/_apt7/_metadata/in.1443.00
+++ b/data/_apt/_metadata/in.1443.00
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/_apt7/_metadata/lz4.dep b/data/_apt/_metadata/lz4.dep
index bccb2875c..bccb2875c 120000
--- a/data/_apt7/_metadata/lz4.dep
+++ b/data/_apt/_metadata/lz4.dep
diff --git a/data/_apt/_metadata/lzma.dep b/data/_apt/_metadata/lzma.dep
new file mode 120000
index 000000000..f84114cb9
--- /dev/null
+++ b/data/_apt/_metadata/lzma.dep
@@ -0,0 +1 @@
+../../lzma \ No newline at end of file
diff --git a/data/_apt/_metadata/maintainer b/data/_apt/_metadata/maintainer
new file mode 120000
index 000000000..573d7ebef
--- /dev/null
+++ b/data/_apt/_metadata/maintainer
@@ -0,0 +1 @@
+../../../people/sbingner \ No newline at end of file
diff --git a/data/_apt/_metadata/notes b/data/_apt/_metadata/notes
new file mode 100644
index 000000000..616ed7297
--- /dev/null
+++ b/data/_apt/_metadata/notes
@@ -0,0 +1,2 @@
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=146877
+pkgIndexFile::CheckLanguageCode doesn't handle the common cases
diff --git a/data/_apt/_metadata/section b/data/_apt/_metadata/section
new file mode 100644
index 000000000..702b7b8d3
--- /dev/null
+++ b/data/_apt/_metadata/section
@@ -0,0 +1 @@
+Packaging
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/tags b/data/_apt/_metadata/tags
new file mode 100644
index 000000000..b7fdc65c3
--- /dev/null
+++ b/data/_apt/_metadata/tags
@@ -0,0 +1 @@
+purpose::console, purpose::library
diff --git a/data/_apt/_metadata/version b/data/_apt/_metadata/version
new file mode 100644
index 000000000..b2e46d185
--- /dev/null
+++ b/data/_apt/_metadata/version
@@ -0,0 +1 @@
+1.4.8
diff --git a/data/_apt7/apt-nito.tgz b/data/_apt/apt-nito.tgz
index 8ebac625c..8ebac625c 100644
--- a/data/_apt7/apt-nito.tgz
+++ b/data/_apt/apt-nito.tgz
Binary files differ
diff --git a/data/_apt7/cftype.diff b/data/_apt/cftype.diff
index 2c21cba39..2c21cba39 100644
--- a/data/_apt7/cftype.diff
+++ b/data/_apt/cftype.diff
diff --git a/data/_apt7/date-errors.diff b/data/_apt/date-errors.diff
index 53ee7dd4b..53ee7dd4b 100644
--- a/data/_apt7/date-errors.diff
+++ b/data/_apt/date-errors.diff
diff --git a/data/_apt/make.sh b/data/_apt/make.sh
new file mode 100644
index 000000000..03f8b6868
--- /dev/null
+++ b/data/_apt/make.sh
@@ -0,0 +1,32 @@
+pkg:setup
+cat >iphoneos_toolchain.cmake <<EOF
+set(CMAKE_SYSTEM_NAME Darwin) # Tell CMake we're cross-compiling
+set(CMAKE_CROSSCOMPILING true)
+#include(CMakeForceCompiler)
+# Prefix detection only works with compiler id "GNU"
+# CMake will look for prefixed g++, cpp, ld, etc. automatically
+set(CMAKE_SYSTEM_PROCESSOR aarch64)
+set(triple ${PKG_TARG})
+set(CMAKE_FIND_ROOT_PATH $(echo ${PKG_PATH} | sed -e s/:/' '/g))
+set(CMAKE_LIBRARY_PATH $(echo ${LIBRARY_PATH} | sed -e s/:/' '/g))
+set(CMAKE_INCLUDE_PATH $(echo ${INCLUDE_PATH} | sed -e s/:/' '/g))
+set(CMAKE_C_COMPILER ${PKG_TARG}-gcc)
+set(CMAKE_CXX_COMPILER ${PKG_TARG}-g++)
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+EOF
+
+cmake -j8 -DCMAKE_TOOLCHAIN_FILE=iphoneos_toolchain.cmake -DCMAKE_LOCALSTATEDIR="/private/var" -DCMAKE_INSTALL_NAME_DIR="/usr/lib" -DCMAKE_INSTALL_RPATH="/usr/" -DCMAKE_OSX_SYSROOT="${PKG_ROOT}" -DCMAKE_INSTALL_PREFIX="/usr/" -DCMAKE_SHARED_LINKER_FLAGS="-lresolv" -DCURRENT_VENDOR=debian -DUSE_NLS=0 -DWITH_DOC=0 -DCOMMON_ARCH=${PKG_ARCH} .
+make -j16
+
+pkg: mkdir -p /etc/apt/apt.conf.d
+pkg: mkdir -p /etc/apt/preferences.d
+pkg: mkdir -p /etc/apt/sources.list.d
+pkg: mkdir -p /etc/apt/trusted.gpg.d
+pkg: mkdir -p /var/cache/apt/archives/partial
+pkg: mkdir -p /var/lib/apt/lists/partial
+pkg: mkdir -p /var/lib/apt/periodic
+pkg: mkdir -p /var/log/apt
+
+pkg:install
diff --git a/data/_apt7/sandbox-errors.diff b/data/_apt/sandbox-errors.diff
index 706aeb23c..706aeb23c 100644
--- a/data/_apt7/sandbox-errors.diff
+++ b/data/_apt/sandbox-errors.diff
diff --git a/data/_apt7/sha1.diff b/data/_apt/sha1.diff
index e681382ca..e681382ca 100644
--- a/data/_apt7/sha1.diff
+++ b/data/_apt/sha1.diff
diff --git a/data/_apt1.4/_metadata/berkeleydb.dep b/data/_apt1.4/_metadata/berkeleydb.dep
new file mode 120000
index 000000000..f945cb1a2
--- /dev/null
+++ b/data/_apt1.4/_metadata/berkeleydb.dep
@@ -0,0 +1 @@
+../../berkeleydb \ No newline at end of file
diff --git a/data/_apt1.4/_metadata/bzip2.dep b/data/_apt1.4/_metadata/bzip2.dep
new file mode 120000
index 000000000..15aa44a77
--- /dev/null
+++ b/data/_apt1.4/_metadata/bzip2.dep
@@ -0,0 +1 @@
+../../bzip2 \ No newline at end of file
diff --git a/data/_apt1.4/_metadata/curl.dep b/data/_apt1.4/_metadata/curl.dep
new file mode 120000
index 000000000..9c4438112
--- /dev/null
+++ b/data/_apt1.4/_metadata/curl.dep
@@ -0,0 +1 @@
+../../curl \ No newline at end of file
diff --git a/data/_apt1.4/_metadata/dpkg.dep b/data/_apt1.4/_metadata/dpkg.dep
new file mode 120000
index 000000000..3e57eea03
--- /dev/null
+++ b/data/_apt1.4/_metadata/dpkg.dep
@@ -0,0 +1 @@
+../../dpkg \ No newline at end of file
diff --git a/data/_apt1.4/_metadata/gnupg.dep b/data/_apt1.4/_metadata/gnupg.dep
new file mode 120000
index 000000000..277e892bf
--- /dev/null
+++ b/data/_apt1.4/_metadata/gnupg.dep
@@ -0,0 +1 @@
+../../gnupg \ No newline at end of file
diff --git a/data/_apt1.4/_metadata/gzip.dep b/data/_apt1.4/_metadata/gzip.dep
new file mode 120000
index 000000000..c6c801e81
--- /dev/null
+++ b/data/_apt1.4/_metadata/gzip.dep
@@ -0,0 +1 @@
+../../gzip \ No newline at end of file
diff --git a/data/apt7-key/_metadata/in.1443.00 b/data/_apt1.4/_metadata/in.1443.00
index e69de29bb..e69de29bb 100644
--- a/data/apt7-key/_metadata/in.1443.00
+++ b/data/_apt1.4/_metadata/in.1443.00
diff --git a/data/_apt1.4/_metadata/license b/data/_apt1.4/_metadata/license
new file mode 100644
index 000000000..9e277e57d
--- /dev/null
+++ b/data/_apt1.4/_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/apt7-lib/_metadata/lz4.dep b/data/_apt1.4/_metadata/lz4.dep
index bccb2875c..bccb2875c 120000
--- a/data/apt7-lib/_metadata/lz4.dep
+++ b/data/_apt1.4/_metadata/lz4.dep
diff --git a/data/_apt1.4/_metadata/lzma.dep b/data/_apt1.4/_metadata/lzma.dep
new file mode 120000
index 000000000..f84114cb9
--- /dev/null
+++ b/data/_apt1.4/_metadata/lzma.dep
@@ -0,0 +1 @@
+../../lzma \ No newline at end of file
diff --git a/data/_apt1.4/_metadata/maintainer b/data/_apt1.4/_metadata/maintainer
new file mode 120000
index 000000000..573d7ebef
--- /dev/null
+++ b/data/_apt1.4/_metadata/maintainer
@@ -0,0 +1 @@
+../../../people/sbingner \ No newline at end of file
diff --git a/data/_apt1.4/_metadata/notes b/data/_apt1.4/_metadata/notes
new file mode 100644
index 000000000..616ed7297
--- /dev/null
+++ b/data/_apt1.4/_metadata/notes
@@ -0,0 +1,2 @@
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=146877
+pkgIndexFile::CheckLanguageCode doesn't handle the common cases
diff --git a/data/_apt1.4/_metadata/section b/data/_apt1.4/_metadata/section
new file mode 100644
index 000000000..702b7b8d3
--- /dev/null
+++ b/data/_apt1.4/_metadata/section
@@ -0,0 +1 @@
+Packaging
diff --git a/data/_apt1.4/_metadata/sed.dep b/data/_apt1.4/_metadata/sed.dep
new file mode 120000
index 000000000..315b5c89c
--- /dev/null
+++ b/data/_apt1.4/_metadata/sed.dep
@@ -0,0 +1 @@
+../../sed \ No newline at end of file
diff --git a/data/_apt1.4/_metadata/tags b/data/_apt1.4/_metadata/tags
new file mode 100644
index 000000000..b7fdc65c3
--- /dev/null
+++ b/data/_apt1.4/_metadata/tags
@@ -0,0 +1 @@
+purpose::console, purpose::library
diff --git a/data/_apt1.4/_metadata/version b/data/_apt1.4/_metadata/version
new file mode 100644
index 000000000..b2e46d185
--- /dev/null
+++ b/data/_apt1.4/_metadata/version
@@ -0,0 +1 @@
+1.4.8
diff --git a/data/_apt1.4/apt-nito.tgz b/data/_apt1.4/apt-nito.tgz
new file mode 100644
index 000000000..8ebac625c
--- /dev/null
+++ b/data/_apt1.4/apt-nito.tgz
Binary files differ
diff --git a/data/_apt1.4/cftype.diff b/data/_apt1.4/cftype.diff
new file mode 100644
index 000000000..2c21cba39
--- /dev/null
+++ b/data/_apt1.4/cftype.diff
@@ -0,0 +1,11 @@
+--- apt/methods/http.cc 2018-07-30 21:45:07.000000000 -1000
++++ apt+iPhone/methods/http.cc 2018-07-30 23:55:04.000000000 -1000
+@@ -603,7 +603,7 @@
+
+ if (UniqueID_ == NULL)
+ if (void *lockdown = lockdown_connect()) {
+- UniqueID_ = lockdown_copy_value(lockdown, NULL, kLockdownUniqueDeviceIDKey);
++ UniqueID_ = (CFStringRef)lockdown_copy_value(lockdown, NULL, kLockdownUniqueDeviceIDKey);
+ lockdown_disconnect(lockdown);
+ }
+
diff --git a/data/_apt1.4/date-errors.diff b/data/_apt1.4/date-errors.diff
new file mode 100644
index 000000000..53ee7dd4b
--- /dev/null
+++ b/data/_apt1.4/date-errors.diff
@@ -0,0 +1,12 @@
+--- apt/apt-pkg/deb/debmetaindex.cc 2018-07-30 21:45:07.000000000 -1000
++++ apt+iPhone/apt-pkg/deb/debmetaindex.cc 2018-08-02 00:03:17.000000000 -1000
+@@ -458,9 +458,6 @@
+
+ if (CheckValidUntil == true)
+ {
+- if (Date == 0)
+- _error->Warning( _("Invalid '%s' entry in Release file %s"), "Date", Filename.c_str());
+-
+ std::string const Label = Section.FindS("Label");
+ std::string const StrValidUntil = Section.FindS("Valid-Until");
+
diff --git a/data/_apt1.4/make.sh b/data/_apt1.4/make.sh
new file mode 100644
index 000000000..03f8b6868
--- /dev/null
+++ b/data/_apt1.4/make.sh
@@ -0,0 +1,32 @@
+pkg:setup
+cat >iphoneos_toolchain.cmake <<EOF
+set(CMAKE_SYSTEM_NAME Darwin) # Tell CMake we're cross-compiling
+set(CMAKE_CROSSCOMPILING true)
+#include(CMakeForceCompiler)
+# Prefix detection only works with compiler id "GNU"
+# CMake will look for prefixed g++, cpp, ld, etc. automatically
+set(CMAKE_SYSTEM_PROCESSOR aarch64)
+set(triple ${PKG_TARG})
+set(CMAKE_FIND_ROOT_PATH $(echo ${PKG_PATH} | sed -e s/:/' '/g))
+set(CMAKE_LIBRARY_PATH $(echo ${LIBRARY_PATH} | sed -e s/:/' '/g))
+set(CMAKE_INCLUDE_PATH $(echo ${INCLUDE_PATH} | sed -e s/:/' '/g))
+set(CMAKE_C_COMPILER ${PKG_TARG}-gcc)
+set(CMAKE_CXX_COMPILER ${PKG_TARG}-g++)
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+EOF
+
+cmake -j8 -DCMAKE_TOOLCHAIN_FILE=iphoneos_toolchain.cmake -DCMAKE_LOCALSTATEDIR="/private/var" -DCMAKE_INSTALL_NAME_DIR="/usr/lib" -DCMAKE_INSTALL_RPATH="/usr/" -DCMAKE_OSX_SYSROOT="${PKG_ROOT}" -DCMAKE_INSTALL_PREFIX="/usr/" -DCMAKE_SHARED_LINKER_FLAGS="-lresolv" -DCURRENT_VENDOR=debian -DUSE_NLS=0 -DWITH_DOC=0 -DCOMMON_ARCH=${PKG_ARCH} .
+make -j16
+
+pkg: mkdir -p /etc/apt/apt.conf.d
+pkg: mkdir -p /etc/apt/preferences.d
+pkg: mkdir -p /etc/apt/sources.list.d
+pkg: mkdir -p /etc/apt/trusted.gpg.d
+pkg: mkdir -p /var/cache/apt/archives/partial
+pkg: mkdir -p /var/lib/apt/lists/partial
+pkg: mkdir -p /var/lib/apt/periodic
+pkg: mkdir -p /var/log/apt
+
+pkg:install
diff --git a/data/_apt1.4/sandbox-errors.diff b/data/_apt1.4/sandbox-errors.diff
new file mode 100644
index 000000000..706aeb23c
--- /dev/null
+++ b/data/_apt1.4/sandbox-errors.diff
@@ -0,0 +1,10 @@
+--- apt/apt-pkg/acquire.cc 2018-07-30 21:45:07.000000000 -1000
++++ apt+iPhone/apt-pkg/acquire.cc 2018-08-02 00:04:25.000000000 -1000
+@@ -603,7 +603,6 @@
+ struct passwd const * const pw = getpwnam(SandboxUser.c_str());
+ if (pw == NULL)
+ {
+- _error->Warning(_("No sandbox user '%s' on the system, can not drop privileges"), SandboxUser.c_str());
+ _config->Set("APT::Sandbox::User", "");
+ return;
+ }
diff --git a/data/_apt1.4/sha1.diff b/data/_apt1.4/sha1.diff
new file mode 100644
index 000000000..e681382ca
--- /dev/null
+++ b/data/_apt1.4/sha1.diff
@@ -0,0 +1,12 @@
+diff -ur apt/methods/gpgv.cc apt+iPhone/methods/gpgv.cc
+--- apt/methods/gpgv.cc 2018-07-30 21:45:07.000000000 -1000
++++ apt+iPhone/methods/gpgv.cc 2018-08-03 20:59:27.000000000 -1000
+@@ -67,7 +67,7 @@
+ static constexpr Digest Digests[] = {
+ {Digest::State::Untrusted, "Invalid digest"},
+ {Digest::State::Untrusted, "MD5"},
+- {Digest::State::Untrusted, "SHA1"},
++ {Digest::State::Trusted, "SHA1"},
+ {Digest::State::Untrusted, "RIPE-MD/160"},
+ {Digest::State::Trusted, "Reserved digest"},
+ {Digest::State::Trusted, "Reserved digest"},
diff --git a/data/_apt7/_metadata/maintainer b/data/_apt7/_metadata/maintainer
index 573d7ebef..0fa66e077 120000
--- a/data/_apt7/_metadata/maintainer
+++ b/data/_apt7/_metadata/maintainer
@@ -1 +1 @@
-../../../people/sbingner \ No newline at end of file
+../../../people/saurik \ No newline at end of file
diff --git a/data/_apt7/_metadata/version b/data/_apt7/_metadata/version
index b2e46d185..61c4e572d 100644
--- a/data/_apt7/_metadata/version
+++ b/data/_apt7/_metadata/version
@@ -1 +1 @@
-1.4.8
+0.7.25.3
diff --git a/data/_apt7/abi-4.8.diff b/data/_apt7/abi-4.8.diff
new file mode 100644
index 000000000..e2f2de96e
--- /dev/null
+++ b/data/_apt7/abi-4.8.diff
@@ -0,0 +1,315 @@
+diff -ru apt-0.7.25.3/apt-pkg/deb/deblistparser.cc apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.cc
+--- apt-0.7.25.3/apt-pkg/deb/deblistparser.cc 2010-02-22 18:42:49.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.cc 2010-02-22 19:48:19.000000000 +0000
+@@ -698,8 +698,6 @@
+ FileI->Version = WriteUniqString(Start,Stop - Start);
+ if (Section.Find("Origin",Start,Stop) == true)
+ FileI->Origin = WriteUniqString(Start,Stop - Start);
+- if (Section.Find("Codename",Start,Stop) == true)
+- FileI->Codename = WriteUniqString(Start,Stop - Start);
+ if (Section.Find("Label",Start,Stop) == true)
+ FileI->Label = WriteUniqString(Start,Stop - Start);
+ if (Section.Find("Architecture",Start,Stop) == true)
+diff -ru apt-0.7.25.3/apt-pkg/depcache.cc apt-0.7.25.3+iPhone/apt-pkg/depcache.cc
+--- apt-0.7.25.3/apt-pkg/depcache.cc 2010-02-01 19:44:40.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/depcache.cc 2010-02-22 19:38:27.000000000 +0000
+@@ -80,6 +80,9 @@
+ // DepCache::pkgDepCache - Constructors /*{{{*/
+ // ---------------------------------------------------------------------
+ /* */
++static bool DebugMarker;
++static bool DebugAutoInstall;
++
+ pkgDepCache::pkgDepCache(pkgCache *pCache,Policy *Plcy) :
+ group_level(0), Cache(pCache), PkgState(0), DepState(0)
+ {
+diff -ru apt-0.7.25.3/apt-pkg/depcache.h apt-0.7.25.3+iPhone/apt-pkg/depcache.h
+--- apt-0.7.25.3/apt-pkg/depcache.h 2010-02-01 19:44:40.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/depcache.h 2010-02-22 19:38:14.000000000 +0000
+@@ -295,9 +295,6 @@
+ unsigned long iPolicyBrokenCount;
+ unsigned long iBadCount;
+
+- bool DebugMarker;
+- bool DebugAutoInstall;
+-
+ Policy *delLocalPolicy; // For memory clean up..
+ Policy *LocalPolicy;
+
+@@ -420,7 +417,7 @@
+ * \param Depth recursive deep of this Marker call
+ * \param FromUser was the install requested by the user?
+ */
+- virtual bool IsInstallOk(const PkgIterator &Pkg,bool AutoInst = true,
++ bool IsInstallOk(const PkgIterator &Pkg,bool AutoInst = true,
+ unsigned long Depth = 0, bool FromUser = true);
+
+ /** \return \b true if it's OK for MarkDelete to remove
+@@ -439,7 +436,7 @@
+ * \param Depth recursive deep of this Marker call
+ * \param FromUser was the remove requested by the user?
+ */
+- virtual bool IsDeleteOk(const PkgIterator &Pkg,bool Purge = false,
++ bool IsDeleteOk(const PkgIterator &Pkg,bool Purge = false,
+ unsigned long Depth = 0, bool FromUser = true);
+
+ // This is for debuging
+diff -ru apt-0.7.25.3/apt-pkg/pkgcache.cc apt-0.7.25.3+iPhone/apt-pkg/pkgcache.cc
+--- apt-0.7.25.3/apt-pkg/pkgcache.cc 2010-02-22 18:42:49.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/pkgcache.cc 2010-02-22 19:49:45.000000000 +0000
+@@ -49,7 +49,7 @@
+
+ /* Whenever the structures change the major version should be bumped,
+ whenever the generator changes the minor version should be bumped. */
+- MajorVersion = 8;
++ MajorVersion = 7;
+ MinorVersion = 0;
+ Dirty = false;
+
+@@ -658,8 +658,6 @@
+ Res = Res + (Res.empty() == true?"o=":",o=") + Origin();
+ if (Archive() != 0)
+ Res = Res + (Res.empty() == true?"a=":",a=") + Archive();
+- if (Codename() != 0)
+- Res = Res + (Res.empty() == true?"n=":",n=") + Codename();
+ if (Label() != 0)
+ Res = Res + (Res.empty() == true?"l=":",l=") + Label();
+ if (Component() != 0)
+diff -ru apt-0.7.25.3/apt-pkg/pkgcache.h apt-0.7.25.3+iPhone/apt-pkg/pkgcache.h
+--- apt-0.7.25.3/apt-pkg/pkgcache.h 2010-02-22 18:42:49.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/pkgcache.h 2010-02-22 19:46:08.000000000 +0000
+@@ -222,16 +222,15 @@
+ unsigned char InstState; // Flags
+ unsigned char CurrentState; // State
+
+- unsigned int ID;
++ unsigned short ID;
+ unsigned long Flags;
+ };
+- /*}}}*/
+-struct pkgCache::PackageFile /*{{{*/
++
++struct pkgCache::PackageFile
+ {
+ // Names
+ map_ptrloc FileName; // Stringtable
+ map_ptrloc Archive; // Stringtable
+- map_ptrloc Codename; // Stringtable
+ map_ptrloc Component; // Stringtable
+ map_ptrloc Version; // Stringtable
+ map_ptrloc Origin; // Stringtable
+@@ -244,7 +243,7 @@
+
+ // Linked list
+ map_ptrloc NextFile; // PackageFile
+- unsigned int ID;
++ unsigned short ID;
+ time_t mtime; // Modification time for the file
+ };
+ /*}}}*/
+@@ -288,7 +287,7 @@
+ map_ptrloc Size; // These are the .deb size
+ map_ptrloc InstalledSize;
+ unsigned short Hash;
+- unsigned int ID;
++ unsigned short ID;
+ unsigned char Priority;
+ };
+ /*}}}*/
+@@ -305,7 +304,7 @@
+ map_ptrloc NextDesc; // Description
+ map_ptrloc ParentPkg; // Package
+
+- unsigned int ID;
++ unsigned short ID;
+ };
+ /*}}}*/
+ struct pkgCache::Dependency /*{{{*/
+diff -ru apt-0.7.25.3/apt-pkg/tagfile.h apt-0.7.25.3+iPhone/apt-pkg/tagfile.h
+--- apt-0.7.25.3/apt-pkg/tagfile.h 2010-02-22 18:42:49.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/tagfile.h 2010-02-22 19:41:05.000000000 +0000
+@@ -28,6 +28,7 @@
+ class pkgTagSection
+ {
+ const char *Section;
++ const char *Stop;
+
+ // We have a limit of 256 tags per section.
+ unsigned int Indexes[256];
+@@ -35,9 +36,6 @@
+
+ unsigned int TagCount;
+
+- protected:
+- const char *Stop;
+-
+ public:
+
+ inline bool operator ==(const pkgTagSection &rhs) {return Section == rhs.Section;};
+@@ -52,7 +50,7 @@
+ bool Scan(const char *Start,unsigned long MaxLength);
+ inline unsigned long size() const {return Stop - Section;};
+ void Trim();
+- virtual void TrimRecord(bool BeforeRecord, const char* &End);
++ void TrimRecord(bool BeforeRecord, const char* &End);
+
+ inline unsigned int Count() const {return TagCount;};
+ inline void Get(const char *&Start,const char *&Stop,unsigned int I) const
+diff -ru apt-0.7.25.3/apt-pkg/versionmatch.cc apt-0.7.25.3+iPhone/apt-pkg/versionmatch.cc
+--- apt-0.7.25.3/apt-pkg/versionmatch.cc 2010-02-01 19:44:40.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/versionmatch.cc 2010-02-22 19:51:20.000000000 +0000
+@@ -63,7 +63,7 @@
+ if (isdigit(Data[0]))
+ RelVerStr = Data;
+ else
+- RelRelease = Data;
++ RelArchive = Data;
+
+ if (RelVerStr.length() > 0 && RelVerStr.end()[-1] == '*')
+ {
+@@ -94,8 +94,6 @@
+ RelOrigin = Fragments[J]+2;
+ else if (stringcasecmp(Fragments[J],Fragments[J]+2,"a=") == 0)
+ RelArchive = Fragments[J]+2;
+- else if (stringcasecmp(Fragments[J],Fragments[J]+2,"n=") == 0)
+- RelCodename = Fragments[J]+2;
+ else if (stringcasecmp(Fragments[J],Fragments[J]+2,"l=") == 0)
+ RelLabel = Fragments[J]+2;
+ else if (stringcasecmp(Fragments[J],Fragments[J]+2,"c=") == 0)
+@@ -177,7 +175,6 @@
+
+ if (RelVerStr.empty() == true && RelOrigin.empty() == true &&
+ RelArchive.empty() == true && RelLabel.empty() == true &&
+- RelRelease.empty() == true && RelCodename.empty() == true &&
+ RelComponent.empty() == true)
+ return false;
+
+@@ -193,16 +190,6 @@
+ if (File->Archive == 0 ||
+ stringcasecmp(RelArchive,File.Archive()) != 0)
+ return false;
+- if (RelCodename.empty() == false)
+- if (File->Codename == 0 ||
+- stringcasecmp(RelCodename,File.Codename()) != 0)
+- return false;
+- if (RelRelease.empty() == false)
+- if ((File->Archive == 0 ||
+- stringcasecmp(RelRelease,File.Archive()) != 0) &&
+- (File->Codename == 0 ||
+- stringcasecmp(RelRelease,File.Codename()) != 0))
+- return false;
+ if (RelLabel.empty() == false)
+ if (File->Label == 0 ||
+ stringcasecmp(RelLabel,File.Label()) != 0)
+diff -ru apt-0.7.25.3/apt-pkg/versionmatch.h apt-0.7.25.3+iPhone/apt-pkg/versionmatch.h
+--- apt-0.7.25.3/apt-pkg/versionmatch.h 2010-02-01 19:44:40.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/versionmatch.h 2010-02-22 19:50:32.000000000 +0000
+@@ -50,8 +50,6 @@
+ string RelVerStr;
+ bool RelVerPrefixMatch;
+ string RelOrigin;
+- string RelRelease;
+- string RelCodename;
+ string RelArchive;
+ string RelLabel;
+ string RelComponent;
+diff -ru apt-0.7.25.3/cmdline/apt-get.cc apt-0.7.25.3+iPhone/cmdline/apt-get.cc
+--- apt-0.7.25.3/cmdline/apt-get.cc 2010-02-22 18:42:49.000000000 +0000
++++ apt-0.7.25.3+iPhone/cmdline/apt-get.cc 2010-02-22 19:51:54.000000000 +0000
+@@ -1296,8 +1296,7 @@
+
+ // or we match against a release
+ if(VerTag.empty() == false ||
+- (VF.File().Archive() != 0 && VF.File().Archive() == DefRel) ||
+- (VF.File().Codename() != 0 && VF.File().Codename() == DefRel))
++ (VF.File().Archive() != 0 && VF.File().Archive() == DefRel))
+ {
+ pkgRecords::Parser &Parse = Recs.Lookup(VF);
+ Src = Parse.SourcePkg();
+diff -ru apt-0.7.25.3/apt-pkg/depcache.cc apt-0.7.25.3+iPhone/apt-pkg/depcache.cc
+--- apt-0.7.25.3/apt-pkg/depcache.cc 2010-02-22 19:38:27.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/depcache.cc 2010-02-22 20:02:41.000000000 +0000
+@@ -774,6 +774,10 @@
+ // DepCache::MarkDelete - Put the package in the delete state /*{{{*/
+ // ---------------------------------------------------------------------
+ /* */
++void pkgDepCache::MarkDelete(PkgIterator const &Pkg, bool Purge) {
++ MarkDelete(Pkg, Purge, 0);
++}
++
+ void pkgDepCache::MarkDelete(PkgIterator const &Pkg, bool rPurge,
+ unsigned long Depth, bool FromUser)
+ {
+diff -ru apt-0.7.25.3/apt-pkg/depcache.h apt-0.7.25.3+iPhone/apt-pkg/depcache.h
+--- apt-0.7.25.3/apt-pkg/depcache.h 2010-02-22 19:38:14.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/depcache.h 2010-02-22 20:02:47.000000000 +0000
+@@ -388,10 +388,13 @@
+ /** \name State Manipulators
+ */
+ // @{
+- void MarkKeep(PkgIterator const &Pkg, bool Soft = false,
+- bool FromUser = true, unsigned long Depth = 0);
++ void MarkKeep(PkgIterator const &Pkg, bool Soft = false,
++ bool FromUser = true);
++ void MarkKeep(PkgIterator const &Pkg, bool Soft,
++ bool FromUser, unsigned long Depth);
+- void MarkDelete(PkgIterator const &Pkg, bool Purge = false,
+- unsigned long Depth = 0, bool FromUser = true);
++ void MarkDelete(PkgIterator const &Pkg,bool Purge = false);
++ void MarkDelete(PkgIterator const &Pkg, bool Purge,
++ unsigned long Depth, bool FromUser = true);
+ void MarkInstall(PkgIterator const &Pkg,bool AutoInst = true,
+ unsigned long Depth = 0, bool FromUser = true,
+ bool ForceImportantDeps = false);
+diff -ru apt-0.7.25.3/apt-pkg/cacheiterators.h apt-0.7.25.3+iPhone/apt-pkg/cacheiterators.h
+--- apt-0.7.25.3/apt-pkg/cacheiterators.h 2010-02-22 20:06:07.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/cacheiterators.h 2010-02-22 20:07:13.000000000 +0000
+@@ -387,7 +387,6 @@
+ inline const char *Component() const {return File->Component == 0?0:Owner->StrP + File->Component;};
+ inline const char *Version() const {return File->Version == 0?0:Owner->StrP + File->Version;};
+ inline const char *Origin() const {return File->Origin == 0?0:Owner->StrP + File->Origin;};
+- inline const char *Codename() const {return File->Codename ==0?0:Owner->StrP + File->Codename;};
+ inline const char *Label() const {return File->Label == 0?0:Owner->StrP + File->Label;};
+ inline const char *Site() const {return File->Site == 0?0:Owner->StrP + File->Site;};
+ inline const char *Architecture() const {return File->Architecture == 0?0:Owner->StrP + File->Architecture;};
+diff -ru apt-0.7.25.3/apt-pkg/tagfile.h apt-0.7.25.3+iPhone/apt-pkg/tagfile.h
+--- apt-0.7.25.3/apt-pkg/tagfile.h 2010-02-22 20:06:07.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/tagfile.h 2010-02-22 20:09:55.000000000 +0000
+@@ -28,8 +28,11 @@
+ class pkgTagSection
+ {
+ const char *Section;
++
++ protected:
+ const char *Stop;
+
++ private:
+ // We have a limit of 256 tags per section.
+ unsigned int Indexes[256];
+ unsigned int AlphaIndexes[0x100];
+diff -ru apt-0.7.25.3/apt-pkg/init.h apt-0.7.25.3+iPhone/apt-pkg/init.h
+--- apt-0.7.25.3/apt-pkg/init.h 2010-02-01 19:44:40.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/init.h 2010-02-22 20:34:49.000000000 +0000
+@@ -22,7 +22,7 @@
+ // Non-ABI-Breaks should only increase RELEASE number.
+ // See also buildlib/libversion.mak
+ #define APT_PKG_MAJOR 4
+-#define APT_PKG_MINOR 8
++#define APT_PKG_MINOR 6
+ #define APT_PKG_RELEASE 0
+
+ extern const char *pkgVersion;
+diff -ru apt-0.7.25.3/apt-pkg/depcache.cc apt-0.7.25.3+iPhone/apt-pkg/depcache.cc
+--- apt-0.7.25.3/apt-pkg/depcache.cc 2010-02-01 19:44:40.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/depcache.cc 2010-02-22 20:44:23.000000000 +0000
+@@ -707,6 +707,10 @@
+ // DepCache::MarkKeep - Put the package in the keep state /*{{{*/
+ // ---------------------------------------------------------------------
+ /* */
++void pkgDepCache::MarkKeep(PkgIterator const &Pkg, bool Soft, bool FromUser) {
++ MarkKeep(Pkg, Soft, FromUser, 0);
++}
++
+ void pkgDepCache::MarkKeep(PkgIterator const &Pkg, bool Soft, bool FromUser,
+ unsigned long Depth)
+ {
diff --git a/data/_apt7/apt-get.diff b/data/_apt7/apt-get.diff
new file mode 100644
index 000000000..6d5bacac9
--- /dev/null
+++ b/data/_apt7/apt-get.diff
@@ -0,0 +1,20 @@
+diff -ur apt-0.7.25.3/cmdline/apt-get.cc apt-0.7.25.3+iPhone/cmdline/apt-get.cc
+--- apt-0.7.25.3/cmdline/apt-get.cc 2018-12-03 13:17:35.000000000 -1000
++++ apt-0.7.25.3+iPhone/cmdline/apt-get.cc 2018-12-03 13:20:54.000000000 -1000
+@@ -1844,12 +1844,12 @@
+ if ((*Cache)[I].Install() == false)
+ continue;
+
+- const char **J;
+- for (J = CmdL.FileList + 1; *J != 0; J++)
+- if (strcmp(*J,I.Name()) == 0)
++ const char **K;
++ for (K = CmdL.FileList + 1; *K != 0; K++)
++ if (strcmp(*K,I.Name()) == 0)
+ break;
+
+- if (*J == 0) {
++ if (*K == 0) {
+ List += string(I.Name()) + " ";
+ VersionsList += string(Cache[I].CandVersion) + "\n";
+ }
diff --git a/data/_apt7/apt_0.7.25.3.tar.gz b/data/_apt7/apt_0.7.25.3.tar.gz
new file mode 100644
index 000000000..72b140be8
--- /dev/null
+++ b/data/_apt7/apt_0.7.25.3.tar.gz
Binary files differ
diff --git a/data/_apt7/aptbug545699.args b/data/_apt7/aptbug545699.args
new file mode 100644
index 000000000..4dd9cbd34
--- /dev/null
+++ b/data/_apt7/aptbug545699.args
@@ -0,0 +1 @@
+-p0
diff --git a/data/_apt7/aptbug545699.diff b/data/_apt7/aptbug545699.diff
new file mode 100644
index 000000000..336241f9b
--- /dev/null
+++ b/data/_apt7/aptbug545699.diff
@@ -0,0 +1,71 @@
+=== modified file 'apt-pkg/acquire-item.cc'
+--- apt-pkg/acquire-item.cc 2009-08-28 19:07:55 +0000
++++ apt-pkg/acquire-item.cc 2009-09-08 12:50:05 +0000
+@@ -274,7 +274,7 @@
+ if(last_space != string::npos)
+ Description.erase(last_space, Description.size()-last_space);
+ new pkgAcqIndexDiffs(Owner, RealURI, Description, Desc.ShortDesc,
+- ExpectedHash, available_patches);
++ ExpectedHash, ServerSha1, available_patches);
+ Complete = false;
+ Status = StatDone;
+ Dequeue();
+@@ -342,9 +342,10 @@
+ pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire *Owner,
+ string URI,string URIDesc,string ShortDesc,
+ HashString ExpectedHash,
++ string ServerSha1,
+ vector<DiffInfo> diffs)
+ : Item(Owner), RealURI(URI), ExpectedHash(ExpectedHash),
+- available_patches(diffs)
++ available_patches(diffs), ServerSha1(ServerSha1)
+ {
+
+ DestFile = _config->FindDir("Dir::State::lists") + "partial/";
+@@ -430,6 +431,13 @@
+ std::clog << "QueueNextDiff: "
+ << FinalFile << " (" << local_sha1 << ")"<<std::endl;
+
++ // final file reached before all patches are applied
++ if(local_sha1 == ServerSha1)
++ {
++ Finish(true);
++ return true;
++ }
++
+ // remove all patches until the next matching patch is found
+ // this requires the Index file to be ordered
+ for(vector<DiffInfo>::iterator I=available_patches.begin();
+@@ -527,7 +535,7 @@
+ // see if there is more to download
+ if(available_patches.size() > 0) {
+ new pkgAcqIndexDiffs(Owner, RealURI, Description, Desc.ShortDesc,
+- ExpectedHash, available_patches);
++ ExpectedHash, ServerSha1, available_patches);
+ return Finish();
+ } else
+ return Finish(true);
+
+=== modified file 'apt-pkg/acquire-item.h'
+--- apt-pkg/acquire-item.h 2009-08-11 22:52:26 +0000
++++ apt-pkg/acquire-item.h 2009-09-08 12:30:11 +0000
+@@ -422,6 +422,10 @@
+ * off the front?
+ */
+ vector<DiffInfo> available_patches;
++
++ /** Stop applying patches when reaching that sha1 */
++ string ServerSha1;
++
+ /** The current status of this patch. */
+ enum DiffState
+ {
+@@ -475,6 +479,7 @@
+ */
+ pkgAcqIndexDiffs(pkgAcquire *Owner,string URI,string URIDesc,
+ string ShortDesc, HashString ExpectedHash,
++ string ServerSha1,
+ vector<DiffInfo> diffs=vector<DiffInfo>());
+ };
+ /*}}}*/
+
diff --git a/data/_apt7/architecture.diff b/data/_apt7/architecture.diff
new file mode 100644
index 000000000..65533f6a6
--- /dev/null
+++ b/data/_apt7/architecture.diff
@@ -0,0 +1,13 @@
+diff -ru apt-0.7.25.3/apt-pkg/deb/deblistparser.cc apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.cc
+--- apt-0.7.25.3/apt-pkg/deb/deblistparser.cc 2010-02-01 19:44:40.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.cc 2011-05-27 05:46:33.000000000 +0000
+@@ -605,6 +605,9 @@
+ if (stringcmp(Start,Stop,"all") == 0)
+ return true;
+
++ if (stringcmp(Start,Stop,"cydia") == 0)
++ return true;
++
+ iOffset = Tags.Offset();
+ }
+ return false;
diff --git a/data/_apt7/cache-limit.diff b/data/_apt7/cache-limit.diff
new file mode 100644
index 000000000..01db636be
--- /dev/null
+++ b/data/_apt7/cache-limit.diff
@@ -0,0 +1,21 @@
+diff -ru apt-0.7.25.3/apt-pkg/pkgcachegen.cc apt-0.7.25.3+iPhone/apt-pkg/pkgcachegen.cc
+--- apt-0.7.25.3/apt-pkg/pkgcachegen.cc 2010-02-01 19:44:40.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/pkgcachegen.cc 2014-06-13 09:34:25.000000000 +0000
+@@ -827,7 +827,7 @@
+ MMap **OutMap,bool AllowMem)
+ {
+ bool const Debug = _config->FindB("Debug::pkgCacheGen", false);
+- unsigned long const MapSize = _config->FindI("APT::Cache-Limit",24*1024*1024);
++ unsigned long const MapSize = _config->FindI("APT::Cache-Limit",128*1024*1024);
+
+ vector<pkgIndexFile *> Files;
+ for (vector<metaIndex *>::const_iterator i = List.begin();
+@@ -992,7 +992,7 @@
+ /* */
+ bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap)
+ {
+- unsigned long MapSize = _config->FindI("APT::Cache-Limit",20*1024*1024);
++ unsigned long MapSize = _config->FindI("APT::Cache-Limit",128*1024*1024);
+ vector<pkgIndexFile *> Files;
+ unsigned long EndOfSource = Files.size();
+ if (_system->AddStatusFiles(Files) == false)
diff --git a/data/_apt7/cfnetwork.diff b/data/_apt7/cfnetwork.diff
new file mode 100644
index 000000000..f6d609521
--- /dev/null
+++ b/data/_apt7/cfnetwork.diff
@@ -0,0 +1,703 @@
+diff -ru apt-0.7.25.3/methods/http.cc apt-0.7.25.3+iPhone/methods/http.cc
+--- apt-0.7.25.3/methods/http.cc 2010-02-01 19:44:41.000000000 +0000
++++ apt-0.7.25.3+iPhone/methods/http.cc 2010-02-22 20:20:42.000000000 +0000
+@@ -31,6 +31,7 @@
+ #include <apt-pkg/hashes.h>
+ #include <apt-pkg/netrc.h>
+
++#include <sys/sysctl.h>
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include <utime.h>
+@@ -41,11 +42,20 @@
+ #include <string.h>
+ #include <iostream>
+ #include <map>
++#include <set>
+ #include <apti18n.h>
+
+
+ // Internet stuff
+ #include <netdb.h>
++#include <arpa/inet.h>
++
++#include <dlfcn.h>
++#include <lockdown.h>
++#include <CoreFoundation/CoreFoundation.h>
++#include <CoreServices/CoreServices.h>
++#include <CFNetwork/CFNetwork.h>
++#include <SystemConfiguration/SystemConfiguration.h>
+
+ #include "config.h"
+ #include "connect.h"
+@@ -54,6 +62,51 @@
+ /*}}}*/
+ using namespace std;
+
++CFStringRef Firmware_;
++const char *Machine_;
++CFStringRef UniqueID_;
++
++void CfrsError(const char *name, CFReadStreamRef rs) {
++ CFStreamError se = CFReadStreamGetError(rs);
++
++ if (se.domain == kCFStreamErrorDomainCustom) {
++ } else if (se.domain == kCFStreamErrorDomainPOSIX) {
++ _error->Error("POSIX: %s", strerror(se.error));
++ } else if (se.domain == kCFStreamErrorDomainMacOSStatus) {
++ _error->Error("MacOSStatus: %ld", se.error);
++ } else if (se.domain == kCFStreamErrorDomainNetDB) {
++ _error->Error("NetDB: %s %s", name, gai_strerror(se.error));
++ } else if (se.domain == kCFStreamErrorDomainMach) {
++ _error->Error("Mach: %ld", se.error);
++ } else if (se.domain == kCFStreamErrorDomainHTTP) {
++ switch (se.error) {
++ case kCFStreamErrorHTTPParseFailure:
++ _error->Error("Parse failure");
++ break;
++
++ case kCFStreamErrorHTTPRedirectionLoop:
++ _error->Error("Redirection loop");
++ break;
++
++ case kCFStreamErrorHTTPBadURL:
++ _error->Error("Bad URL");
++ break;
++
++ default:
++ _error->Error("Unknown HTTP error: %ld", se.error);
++ break;
++ }
++ } else if (se.domain == kCFStreamErrorDomainSOCKS) {
++ _error->Error("SOCKS: %ld", se.error);
++ } else if (se.domain == kCFStreamErrorDomainSystemConfiguration) {
++ _error->Error("SystemConfiguration: %ld", se.error);
++ } else if (se.domain == kCFStreamErrorDomainSSL) {
++ _error->Error("SSL: %ld", se.error);
++ } else {
++ _error->Error("Domain #%ld: %ld", se.domain, se.error);
++ }
++}
++
+ string HttpMethod::FailFile;
+ int HttpMethod::FailFd = -1;
+ time_t HttpMethod::FailTime = 0;
+@@ -646,6 +699,51 @@
+ }
+ /*}}}*/
+
++static const CFOptionFlags kNetworkEvents =
++ kCFStreamEventOpenCompleted |
++ kCFStreamEventHasBytesAvailable |
++ kCFStreamEventEndEncountered |
++ kCFStreamEventErrorOccurred |
++0;
++
++static void CFReadStreamCallback(CFReadStreamRef stream, CFStreamEventType event, void *arg) {
++ switch (event) {
++ case kCFStreamEventOpenCompleted:
++ break;
++
++ case kCFStreamEventHasBytesAvailable:
++ case kCFStreamEventEndEncountered:
++ *reinterpret_cast<int *>(arg) = 1;
++ CFRunLoopStop(CFRunLoopGetCurrent());
++ break;
++
++ case kCFStreamEventErrorOccurred:
++ *reinterpret_cast<int *>(arg) = -1;
++ CFRunLoopStop(CFRunLoopGetCurrent());
++ break;
++ }
++}
++
++/* http://lists.apple.com/archives/Macnetworkprog/2006/Apr/msg00014.html */
++int CFReadStreamOpen(CFReadStreamRef stream, double timeout) {
++ CFStreamClientContext context;
++ int value(0);
++
++ memset(&context, 0, sizeof(context));
++ context.info = &value;
++
++ if (CFReadStreamSetClient(stream, kNetworkEvents, CFReadStreamCallback, &context)) {
++ CFReadStreamScheduleWithRunLoop(stream, CFRunLoopGetCurrent(), kCFRunLoopCommonModes);
++ if (CFReadStreamOpen(stream))
++ CFRunLoopRunInMode(kCFRunLoopDefaultMode, timeout, false);
++ else
++ value = -1;
++ CFReadStreamSetClient(stream, kCFStreamEventNone, NULL, NULL);
++ }
++
++ return value;
++}
++
+ // HttpMethod::SendReq - Send the HTTP request /*{{{*/
+ // ---------------------------------------------------------------------
+ /* This places the http request in the outbound buffer */
+@@ -1088,6 +1186,8 @@
+ signal(SIGINT,SigTerm);
+
+ Server = 0;
++
++ std::set<std::string> cached;
+
+ int FailCounter = 0;
+ while (1)
+@@ -1107,214 +1207,314 @@
+
+ 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
+- since we don't have to wait for the close sequence to
+- complete */
+- if (Server->Persistent == false)
+- Server->Close();
+-
+- // Reset the pipeline
+- if (Server->ServerFd == -1)
+- QueueBack = Queue;
+-
+- // Connnect to the host
+- if (Server->Open() == false)
+- {
+- Fail(true);
+- delete Server;
+- Server = 0;
+- continue;
++
++ CFStringEncoding se = kCFStringEncodingUTF8;
++
++ char *url = strdup(Queue->Uri.c_str());
++ url:
++ URI uri = std::string(url);
++ std::string hs = uri.Host;
++
++ if (cached.find(hs) != cached.end()) {
++ _error->Error("Cached Failure");
++ Fail(true);
++ free(url);
++ FailCounter = 0;
++ continue;
++ }
++
++ std::string urs = uri;
++
++ for (;;) {
++ size_t bad = urs.find_first_of("+");
++ if (bad == std::string::npos)
++ break;
++ // XXX: generalize
++ urs = urs.substr(0, bad) + "%2b" + urs.substr(bad + 1);
+ }
+
+- // Fill the pipeline.
+- Fetch(0);
+-
+- // Fetch the next URL header data from the server.
+- switch (Server->RunHeaders())
+- {
+- case 0:
+- break;
+-
+- // The header data is bad
+- case 2:
+- {
+- _error->Error(_("Bad header data"));
+- Fail(true);
+- RotateDNS();
+- continue;
+- }
+-
+- // The server closed a connection during the header get..
+- default:
+- case 1:
+- {
+- FailCounter++;
+- _error->Discard();
+- Server->Close();
+- Server->Pipeline = false;
+-
+- if (FailCounter >= 2)
+- {
+- Fail(_("Connection failed"),true);
+- FailCounter = 0;
+- }
+-
+- RotateDNS();
+- continue;
+- }
+- };
++ CFStringRef sr = CFStringCreateWithCString(kCFAllocatorDefault, urs.c_str(), se);
++ CFURLRef ur = CFURLCreateWithString(kCFAllocatorDefault, sr, NULL);
++ CFRelease(sr);
++ CFHTTPMessageRef hm = CFHTTPMessageCreateRequest(kCFAllocatorDefault, CFSTR("GET"), ur, kCFHTTPVersion1_1);
++ CFRelease(ur);
++
++ struct stat SBuf;
++ if (stat(Queue->DestFile.c_str(), &SBuf) >= 0 && SBuf.st_size > 0) {
++ sr = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("bytes=%li-"), (long) SBuf.st_size - 1);
++ CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("Range"), sr);
++ CFRelease(sr);
++
++ sr = CFStringCreateWithCString(kCFAllocatorDefault, TimeRFC1123(SBuf.st_mtime).c_str(), se);
++ CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("If-Range"), sr);
++ CFRelease(sr);
++
++ CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("Cache-Control"), CFSTR("no-cache"));
++ } else if (Queue->LastModified != 0) {
++ sr = CFStringCreateWithCString(kCFAllocatorDefault, TimeRFC1123(Queue->LastModified).c_str(), se);
++ CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("If-Modified-Since"), sr);
++ CFRelease(sr);
++
++ CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("Cache-Control"), CFSTR("no-cache"));
++ } else
++ CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("Cache-Control"), CFSTR("max-age=0"));
++
++ if (Firmware_ != NULL)
++ CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("X-Firmware"), Firmware_);
++
++ sr = CFStringCreateWithCString(kCFAllocatorDefault, Machine_, se);
++ CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("X-Machine"), sr);
++ CFRelease(sr);
++
++ if (UniqueID_ != NULL)
++ CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("X-Unique-ID"), UniqueID_);
++
++ CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("User-Agent"), CFSTR("Telesphoreo APT-HTTP/1.0.592"));
++
++ CFReadStreamRef rs = CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault, hm);
++ CFRelease(hm);
++
++#define _kCFStreamPropertyReadTimeout CFSTR("_kCFStreamPropertyReadTimeout")
++#define _kCFStreamPropertyWriteTimeout CFSTR("_kCFStreamPropertyWriteTimeout")
++#define _kCFStreamPropertySocketImmediateBufferTimeOut CFSTR("_kCFStreamPropertySocketImmediateBufferTimeOut")
++
++ /*SInt32 to(TimeOut);
++ CFNumberRef nm(CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &to));*/
++ double to(TimeOut);
++ CFNumberRef nm(CFNumberCreate(kCFAllocatorDefault, kCFNumberDoubleType, &to));
++
++ CFReadStreamSetProperty(rs, _kCFStreamPropertyReadTimeout, nm);
++ CFReadStreamSetProperty(rs, _kCFStreamPropertyWriteTimeout, nm);
++ CFReadStreamSetProperty(rs, _kCFStreamPropertySocketImmediateBufferTimeOut, nm);
++ CFRelease(nm);
++
++ CFDictionaryRef dr = SCDynamicStoreCopyProxies(NULL);
++ CFReadStreamSetProperty(rs, kCFStreamPropertyHTTPProxy, dr);
++ CFRelease(dr);
++
++ //CFReadStreamSetProperty(rs, kCFStreamPropertyHTTPShouldAutoredirect, kCFBooleanTrue);
++ CFReadStreamSetProperty(rs, kCFStreamPropertyHTTPAttemptPersistentConnection, kCFBooleanTrue);
+
+- // Decide what to do.
+ FetchResult Res;
++ CFIndex rd;
++ UInt32 sc;
++
++ uint8_t data[10240];
++ size_t offset = 0;
++
++ Status("Connecting to %s", hs.c_str());
++
++ switch (CFReadStreamOpen(rs, to)) {
++ case -1:
++ CfrsError("Open", rs);
++ goto fail;
++
++ case 0:
++ _error->Error("Host Unreachable");
++ cached.insert(hs);
++ goto fail;
++
++ case 1:
++ /* success */
++ break;
++
++ fail:
++ Fail(true);
++ goto done;
++ }
++
++ rd = CFReadStreamRead(rs, data, sizeof(data));
++
++ if (rd == -1) {
++ CfrsError(uri.Host.c_str(), rs);
++ cached.insert(hs);
++ Fail(true);
++ goto done;
++ }
++
+ Res.Filename = Queue->DestFile;
+- switch (DealWithHeaders(Res,Server))
+- {
+- // Ok, the file is Open
+- case 0:
+- {
+- URIStart(Res);
+
+- // Run the data
+- bool Result = Server->RunData();
++ hm = (CFHTTPMessageRef) CFReadStreamCopyProperty(rs, kCFStreamPropertyHTTPResponseHeader);
++ sc = CFHTTPMessageGetResponseStatusCode(hm);
++
++ if (sc == 301 || sc == 302) {
++ sr = CFHTTPMessageCopyHeaderFieldValue(hm, CFSTR("Location"));
++ if (sr == NULL) {
++ Fail();
++ goto done_;
++ } else {
++ size_t ln = CFStringGetLength(sr) + 1;
++ free(url);
++ url = static_cast<char *>(malloc(ln));
++
++ if (!CFStringGetCString(sr, url, ln, se)) {
++ Fail();
++ goto done_;
++ }
++
++ CFRelease(sr);
++ goto url;
++ }
++ }
++
++ sr = CFHTTPMessageCopyHeaderFieldValue(hm, CFSTR("Content-Range"));
++ if (sr != NULL) {
++ size_t ln = CFStringGetLength(sr) + 1;
++ char cr[ln];
++
++ if (!CFStringGetCString(sr, cr, ln, se)) {
++ Fail();
++ goto done_;
++ }
++
++ CFRelease(sr);
++
++ if (sscanf(cr, "bytes %lu-%*u/%lu", &offset, &Res.Size) != 2) {
++ _error->Error(_("The HTTP server sent an invalid Content-Range header"));
++ Fail();
++ goto done_;
++ }
++
++ if (offset > Res.Size) {
++ _error->Error(_("This HTTP server has broken range support"));
++ Fail();
++ goto done_;
++ }
++ } else {
++ sr = CFHTTPMessageCopyHeaderFieldValue(hm, CFSTR("Content-Length"));
++ if (sr != NULL) {
++ Res.Size = CFStringGetIntValue(sr);
++ CFRelease(sr);
++ }
++ }
++
++ time(&Res.LastModified);
++
++ sr = CFHTTPMessageCopyHeaderFieldValue(hm, CFSTR("Last-Modified"));
++ if (sr != NULL) {
++ size_t ln = CFStringGetLength(sr) + 1;
++ char cr[ln];
++
++ if (!CFStringGetCString(sr, cr, ln, se)) {
++ Fail();
++ goto done_;
++ }
++
++ CFRelease(sr);
++
++ if (!StrToTime(cr, Res.LastModified)) {
++ _error->Error(_("Unknown date format"));
++ Fail();
++ goto done_;
++ }
++ }
++
++ if (sc < 200 || sc >= 300 && sc != 304) {
++ sr = CFHTTPMessageCopyResponseStatusLine(hm);
+
+- /* If the server is sending back sizeless responses then fill in
+- the size now */
++ size_t ln = CFStringGetLength(sr) + 1;
++ char cr[ln];
++
++ if (!CFStringGetCString(sr, cr, ln, se)) {
++ Fail();
++ goto done;
++ }
++
++ CFRelease(sr);
++
++ _error->Error("%s", cr);
++
++ Fail();
++ goto done_;
++ }
++
++ CFRelease(hm);
++
++ if (sc == 304) {
++ unlink(Queue->DestFile.c_str());
++ Res.IMSHit = true;
++ Res.LastModified = Queue->LastModified;
++ URIDone(Res);
++ } else {
++ Hashes hash;
++
++ File = new FileFd(Queue->DestFile, FileFd::WriteAny);
++ if (_error->PendingError() == true) {
++ delete File;
++ File = NULL;
++ Fail();
++ goto done;
++ }
++
++ FailFile = Queue->DestFile;
++ FailFile.c_str(); // Make sure we dont do a malloc in the signal handler
++ FailFd = File->Fd();
++ FailTime = Res.LastModified;
++
++ Res.ResumePoint = offset;
++ ftruncate(File->Fd(), offset);
++
++ if (offset != 0) {
++ lseek(File->Fd(), 0, SEEK_SET);
++ if (!hash.AddFD(File->Fd(), offset)) {
++ _error->Errno("read", _("Problem hashing file"));
++ delete File;
++ File = NULL;
++ Fail();
++ goto done;
++ }
++ }
++
++ lseek(File->Fd(), 0, SEEK_END);
++
++ URIStart(Res);
++
++ read: if (rd == -1) {
++ CfrsError("rd", rs);
++ Fail(true);
++ } else if (rd == 0) {
+ if (Res.Size == 0)
+ Res.Size = File->Size();
+-
+- // Close the file, destroy the FD object and timestamp it
+- FailFd = -1;
+- delete File;
+- File = 0;
+-
+- // Timestamp
++
+ struct utimbuf UBuf;
+ time(&UBuf.actime);
+- UBuf.actime = Server->Date;
+- UBuf.modtime = Server->Date;
+- utime(Queue->DestFile.c_str(),&UBuf);
++ UBuf.actime = Res.LastModified;
++ UBuf.modtime = Res.LastModified;
++ utime(Queue->DestFile.c_str(), &UBuf);
+
+- // Send status to APT
+- if (Result == true)
+- {
+- Res.TakeHashes(*Server->In.Hash);
+- URIDone(Res);
+- }
+- else
+- {
+- if (Server->ServerFd == -1)
+- {
+- FailCounter++;
+- _error->Discard();
+- Server->Close();
+-
+- if (FailCounter >= 2)
+- {
+- Fail(_("Connection failed"),true);
+- FailCounter = 0;
+- }
+-
+- QueueBack = Queue;
+- }
+- else
+- Fail(true);
+- }
+- break;
+- }
+-
+- // IMS hit
+- case 1:
+- {
++ Res.TakeHashes(hash);
+ URIDone(Res);
+- break;
+- }
+-
+- // Hard server error, not found or something
+- case 3:
+- {
+- Fail();
+- break;
+- }
+-
+- // Hard internal error, kill the connection and fail
+- case 5:
+- {
+- delete File;
+- File = 0;
++ } else {
++ hash.Add(data, rd);
+
+- Fail();
+- RotateDNS();
+- Server->Close();
+- break;
+- }
++ uint8_t *dt = data;
++ while (rd != 0) {
++ int sz = write(File->Fd(), dt, rd);
++
++ if (sz == -1) {
++ delete File;
++ File = NULL;
++ Fail();
++ goto done;
++ }
+
+- // We need to flush the data, the header is like a 404 w/ error text
+- case 4:
+- {
+- Fail();
+-
+- // Send to content to dev/null
+- File = new FileFd("/dev/null",FileFd::WriteExists);
+- Server->RunData();
+- delete File;
+- File = 0;
+- break;
+- }
+-
+- // Try again with a new URL
+- case 6:
+- {
+- // Clear rest of response if there is content
+- if (Server->HaveContent)
+- {
+- File = new FileFd("/dev/null",FileFd::WriteExists);
+- Server->RunData();
+- delete File;
+- File = 0;
++ dt += sz;
++ rd -= sz;
+ }
+
+- /* Detect redirect loops. No more redirects are allowed
+- after the same URI is seen twice in a queue item. */
+- StringVector &R = Redirected[Queue->DestFile];
+- bool StopRedirects = false;
+- if (R.size() == 0)
+- R.push_back(Queue->Uri);
+- else if (R[0] == "STOP" || R.size() > 10)
+- StopRedirects = true;
+- else
+- {
+- for (StringVectorIterator I = R.begin(); I != R.end(); I++)
+- if (Queue->Uri == *I)
+- {
+- R[0] = "STOP";
+- break;
+- }
+-
+- R.push_back(Queue->Uri);
+- }
+-
+- if (StopRedirects == false)
+- Redirect(NextURI);
+- else
+- Fail();
+-
+- break;
++ rd = CFReadStreamRead(rs, data, sizeof(data));
++ goto read;
+ }
+-
+- default:
+- Fail(_("Internal error"));
+- break;
+ }
+-
++
++ goto done;
++ done_:
++ CFRelease(hm);
++ done:
++ CFReadStreamClose(rs);
++ CFRelease(rs);
++ free(url);
++
+ FailCounter = 0;
+ }
+
+@@ -1330,6 +1530,41 @@
+ signal(SIGPIPE, SIG_IGN);
+
+ HttpMethod Mth;
++
++ size_t size;
++ sysctlbyname("hw.machine", NULL, &size, NULL, 0);
++ char *machine = new char[size];
++ sysctlbyname("hw.machine", machine, &size, NULL, 0);
++ Machine_ = machine;
++
++ const char *path = "/System/Library/CoreServices/SystemVersion.plist";
++ CFURLRef url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, (uint8_t *) path, strlen(path), false);
++
++ CFPropertyListRef plist; {
++ CFReadStreamRef stream = CFReadStreamCreateWithFile(kCFAllocatorDefault, url);
++ CFReadStreamOpen(stream);
++ plist = CFPropertyListCreateFromStream(kCFAllocatorDefault, stream, 0, kCFPropertyListImmutable, NULL, NULL);
++ CFReadStreamClose(stream);
++ }
++
++ CFRelease(url);
++
++ if (plist != NULL) {
++ Firmware_ = (CFStringRef) CFRetain(CFDictionaryGetValue((CFDictionaryRef) plist, CFSTR("ProductVersion")));
++ CFRelease(plist);
++ }
++
++ if (UniqueID_ == NULL)
++ if (void *libMobileGestalt = dlopen("/usr/lib/libMobileGestalt.dylib", RTLD_GLOBAL | RTLD_LAZY))
++ if (CFStringRef (*$MGCopyAnswer)(CFStringRef) = (CFStringRef (*)(CFStringRef)) dlsym(libMobileGestalt, "MGCopyAnswer"))
++ UniqueID_ = $MGCopyAnswer(CFSTR("UniqueDeviceID"));
++
++ if (UniqueID_ == NULL)
++ if (void *lockdown = lockdown_connect()) {
++ UniqueID_ = (CFStringRef)lockdown_copy_value(lockdown, NULL, kLockdownUniqueDeviceIDKey);
++ lockdown_disconnect(lockdown);
++ }
++
+ return Mth.Loop();
+ }
+
+diff -ru apt-0.7.25.3/methods/makefile apt-0.7.25.3+iPhone/methods/makefile
+--- apt-0.7.25.3/methods/makefile 2010-02-01 19:44:41.000000000 +0000
++++ apt-0.7.25.3+iPhone/methods/makefile 2010-02-22 20:14:29.000000000 +0000
+@@ -46,7 +46,7 @@
+
+ # The http method
+ PROGRAM=http
+-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/_apt7/deblistparser.diff b/data/_apt7/deblistparser.diff
new file mode 100644
index 000000000..2a0d6c9b0
--- /dev/null
+++ b/data/_apt7/deblistparser.diff
@@ -0,0 +1,27 @@
+diff -ur apt-0.7.25.3/apt-pkg/deb/deblistparser.cc apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.cc
+--- apt-0.7.25.3/apt-pkg/deb/deblistparser.cc 2018-12-03 12:52:15.000000000 -1000
++++ apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.cc 2018-12-03 12:53:11.000000000 -1000
+@@ -248,18 +248,18 @@
+ /* Strip out any spaces from the text, this undoes dpkgs reformatting
+ of certain fields. dpkg also has the rather interesting notion of
+ reformatting depends operators < -> <= */
+- char *I = S;
++ char *L = S;
+ for (; Start != End; Start++)
+ {
+ if (isspace(*Start) == 0)
+- *I++ = tolower_ascii(*Start);
++ *L++ = tolower_ascii(*Start);
+ if (*Start == '<' && Start[1] != '<' && Start[1] != '=')
+- *I++ = '=';
++ *L++ = '=';
+ if (*Start == '>' && Start[1] != '>' && Start[1] != '=')
+- *I++ = '=';
++ *L++ = '=';
+ }
+
+- Result = AddCRC16(Result,S,I - S);
++ Result = AddCRC16(Result,S,L - S);
+ }
+
+ return Result;
diff --git a/data/_apt7/deprecated.diff b/data/_apt7/deprecated.diff
new file mode 100644
index 000000000..737aed6f9
--- /dev/null
+++ b/data/_apt7/deprecated.diff
@@ -0,0 +1,13 @@
+diff -ru apt-0.7.25.3/apt-pkg/contrib/macros.h apt-0.7.25.3+iPhone/apt-pkg/contrib/macros.h
+--- apt-0.7.25.3/apt-pkg/contrib/macros.h 2010-02-22 18:11:17.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/contrib/macros.h 2010-02-01 19:44:40.000000000 +0000
+@@ -57,7 +57,9 @@
+ // some nice optional GNUC features
+ #if __GNUC__ >= 3
+ #define __must_check __attribute__ ((warn_unused_result))
++#ifndef __deprecated
+ #define __deprecated __attribute__ ((deprecated))
++#endif
+ /* likely() and unlikely() can be used to mark boolean expressions
+ as (not) likely true which will help the compiler to optimise */
+ #define likely(x) __builtin_expect (!!(x), 1)
diff --git a/data/_apt7/display.diff b/data/_apt7/display.diff
new file mode 100644
index 000000000..d4686ed59
--- /dev/null
+++ b/data/_apt7/display.diff
@@ -0,0 +1,125 @@
+diff -ru apt-0.7.25.3/apt-pkg/cacheiterators.h apt-0.7.25.3+iPhone/apt-pkg/cacheiterators.h
+--- apt-0.7.25.3/apt-pkg/cacheiterators.h 2010-02-23 20:58:32.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/cacheiterators.h 2010-02-23 20:59:22.000000000 +0000
+@@ -71,6 +71,7 @@
+ inline pkgCache *Cache() {return Owner;};
+
+ inline const char *Name() const {return Pkg->Name == 0?0:Owner->StrP + Pkg->Name;};
++ inline const char *Display() const {return Pkg->Display == 0?0:Owner->StrP + Pkg->Display;};
+ inline const char *Section() const {return Pkg->Section == 0?0:Owner->StrP + Pkg->Section;};
+ inline bool Purge() const {return Pkg->CurrentState == pkgCache::State::Purge ||
+ (Pkg->CurrentVer == 0 && Pkg->CurrentState == pkgCache::State::NotInstalled);};
+@@ -132,6 +133,7 @@
+ inline pkgCache *Cache() {return Owner;};
+
+ inline const char *VerStr() const {return Ver->VerStr == 0?0:Owner->StrP + Ver->VerStr;};
++ inline const char *Display() const {return Ver->Display == 0?0:Owner->StrP + Ver->Display;};
+ inline const char *Section() const {return Ver->Section == 0?0:Owner->StrP + Ver->Section;};
+ inline const char *Arch() const {return Ver->Arch == 0?0:Owner->StrP + Ver->Arch;};
+ inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + Ver->ParentPkg);};
+diff -ru apt-0.7.25.3/apt-pkg/deb/deblistparser.cc apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.cc
+--- apt-0.7.25.3/apt-pkg/deb/deblistparser.cc 2010-02-23 20:58:32.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.cc 2010-02-23 20:59:56.000000000 +0000
+@@ -39,6 +39,18 @@
+ // ListParser::UniqFindTagWrite - Find the tag and write a unq string /*{{{*/
+ // ---------------------------------------------------------------------
+ /* */
++unsigned long debListParser::FindTagWrite(const char *Tag)
++{
++ const char *Start;
++ const char *Stop;
++ if (Section.Find(Tag,Start,Stop) == false)
++ return 0;
++ return WriteString(Start,Stop - Start);
++}
++ /*}}}*/
++// ListParser::UniqFindTagWrite - Find the tag and write a unq string /*{{{*/
++// ---------------------------------------------------------------------
++/* */
+ unsigned long debListParser::UniqFindTagWrite(const char *Tag)
+ {
+ const char *Start;
+@@ -74,6 +86,10 @@
+ /* */
+ bool debListParser::NewVersion(pkgCache::VerIterator Ver)
+ {
++ Ver->Display = FindTagWrite("Name");
++ if (Ver->Display == 0)
++ Ver->Display = FindTagWrite("Maemo-Display-Name");
++
+ // Parse the section
+ Ver->Section = UniqFindTagWrite("Section");
+ Ver->Arch = UniqFindTagWrite("Architecture");
+@@ -170,6 +186,10 @@
+ bool debListParser::UsePackage(pkgCache::PkgIterator Pkg,
+ pkgCache::VerIterator Ver)
+ {
++ if (Pkg->Display == 0)
++ Pkg->Display = FindTagWrite("Name");
++ if (Pkg->Display == 0)
++ Pkg->Display = FindTagWrite("Maemo-Display-Name");
+ if (Pkg->Section == 0)
+ Pkg->Section = UniqFindTagWrite("Section");
+ if (Section.FindFlag("Essential",Pkg->Flags,pkgCache::Flag::Essential) == false)
+diff -ru apt-0.7.25.3/apt-pkg/deb/deblistparser.h apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.h
+--- apt-0.7.25.3/apt-pkg/deb/deblistparser.h 2010-02-23 20:58:32.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.h 2010-02-23 20:59:46.000000000 +0000
+@@ -33,6 +33,7 @@
+ unsigned long iOffset;
+ string Arch;
+
++ unsigned long FindTagWrite(const char *Tag);
+ unsigned long UniqFindTagWrite(const char *Tag);
+ bool ParseStatus(pkgCache::PkgIterator Pkg,pkgCache::VerIterator Ver);
+ bool ParseDepends(pkgCache::VerIterator Ver,const char *Tag,
+diff -ru apt-0.7.25.3/apt-pkg/deb/debrecords.cc apt-0.7.25.3+iPhone/apt-pkg/deb/debrecords.cc
+--- apt-0.7.25.3/apt-pkg/deb/debrecords.cc 2010-02-23 20:58:32.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/deb/debrecords.cc 2010-02-23 20:59:22.000000000 +0000
+@@ -51,6 +51,17 @@
+ return Section.FindS("Package");
+ }
+ /*}}}*/
++// RecordParser::Display - Return the package display name /*{{{*/
++// ---------------------------------------------------------------------
++/* */
++string debRecordParser::Display()
++{
++ string display(Section.FindS("Name"));
++ if (display.empty())
++ display = Section.FindS("Maemo-Display-Name");
++ return display;
++}
++ /*}}}*/
+ // RecordParser::Homepage - Return the package homepage /*{{{*/
+ // ---------------------------------------------------------------------
+ /* */
+diff -ru apt-0.7.25.3/apt-pkg/deb/debrecords.h apt-0.7.25.3+iPhone/apt-pkg/deb/debrecords.h
+--- apt-0.7.25.3/apt-pkg/deb/debrecords.h 2010-02-23 20:58:32.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/deb/debrecords.h 2010-02-23 20:59:22.000000000 +0000
+@@ -47,6 +47,7 @@
+ virtual string ShortDesc();
+ virtual string LongDesc();
+ virtual string Name();
++ virtual string Display();
+ virtual string Homepage();
+
+ virtual void GetRec(const char *&Start,const char *&Stop);
+diff -ru apt-0.7.25.3/apt-pkg/pkgcache.h apt-0.7.25.3+iPhone/apt-pkg/pkgcache.h
+--- apt-0.7.25.3/apt-pkg/pkgcache.h 2010-02-23 20:58:32.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/pkgcache.h 2010-02-23 20:59:22.000000000 +0000
+@@ -206,6 +206,7 @@
+ {
+ // Pointers
+ map_ptrloc Name; // Stringtable
++ map_ptrloc Display; // Stringtable
+ map_ptrloc VersionList; // Version
+ map_ptrloc CurrentVer; // Version
+ map_ptrloc Section; // StringTable (StringItem)
+@@ -271,6 +272,7 @@
+ struct pkgCache::Version /*{{{*/
+ {
+ map_ptrloc VerStr; // Stringtable
++ map_ptrloc Display; // Stringtable
+ map_ptrloc Section; // StringTable (StringItem)
+ map_ptrloc Arch; // StringTable
+
diff --git a/data/_apt7/find.diff b/data/_apt7/find.diff
new file mode 100644
index 000000000..56eb1e2ab
--- /dev/null
+++ b/data/_apt7/find.diff
@@ -0,0 +1,37 @@
+diff -ru apt-0.7.20.2/apt-pkg/deb/debrecords.cc apt-0.7.20.2+iPhone/apt-pkg/deb/debrecords.cc
+--- apt-0.7.20.2/apt-pkg/deb/debrecords.cc 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/deb/debrecords.cc 2009-04-19 03:41:21.000000000 +0000
+@@ -170,3 +170,11 @@
+ Section.GetSection(Start,Stop);
+ }
+ /*}}}*/
++// RecordParser::Find - Locate a tag /*{{{*/
++// ---------------------------------------------------------------------
++/* */
++bool debRecordParser::Find(const char *Tag,const char *&Start, const char *&End)
++{
++ return Section.Find(Tag,Start,End);
++}
++ /*}}}*/
+diff -ru apt-0.7.20.2/apt-pkg/deb/debrecords.h apt-0.7.20.2+iPhone/apt-pkg/deb/debrecords.h
+--- apt-0.7.20.2/apt-pkg/deb/debrecords.h 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/deb/debrecords.h 2009-04-19 03:46:48.000000000 +0000
+@@ -47,6 +47,7 @@
+ virtual string Homepage();
+
+ virtual void GetRec(const char *&Start,const char *&Stop);
++ virtual bool Find(const char *Tag,const char *&Start, const char *&End);
+
+ debRecordParser(string FileName,pkgCache &Cache);
+ };
+diff -ru apt-0.7.20.2/apt-pkg/pkgrecords.h apt-0.7.20.2+iPhone/apt-pkg/pkgrecords.h
+--- apt-0.7.20.2/apt-pkg/pkgrecords.h 2009-04-18 23:19:45.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/pkgrecords.h 2009-04-19 03:39:04.000000000 +0000
+@@ -70,6 +70,7 @@
+
+ // The record in binary form
+ virtual void GetRec(const char *&Start,const char *&Stop) {Start = Stop = 0;};
++ virtual bool Find(const char *Tag,const char *&Start, const char *&End) {Start = End = 0; return false;};
+
+ virtual ~Parser() {};
+ };
diff --git a/data/_apt7/finddesc.diff b/data/_apt7/finddesc.diff
new file mode 100644
index 000000000..15bba37e2
--- /dev/null
+++ b/data/_apt7/finddesc.diff
@@ -0,0 +1,59 @@
+diff -ru apt-0.7.20.2/apt-pkg/deb/debrecords.cc apt-0.7.20.2+iPhone/apt-pkg/deb/debrecords.cc
+--- apt-0.7.20.2/apt-pkg/deb/debrecords.cc 2009-04-20 08:54:09.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/deb/debrecords.cc 2009-04-20 17:26:22.000000000 +0000
+@@ -124,6 +134,29 @@
+ return orig;
+ }
+ /*}}}*/
++// RecordParser::ShortDesc - Return a 1 line description /*{{{*/
++// ---------------------------------------------------------------------
++/* */
++bool debRecordParser::ShortDesc(const char *&Start,const char *&End)
++{
++ if (!LongDesc(Start,End))
++ return false;
++ const char *Line = (const char *) memchr(Start, '\n', End - Start);
++ if (Line != NULL)
++ End = Line;
++ return true;
++}
++ /*}}}*/
++// RecordParser::LongDesc - Return a longer description /*{{{*/
++// ---------------------------------------------------------------------
++/* */
++bool debRecordParser::LongDesc(const char *&Start,const char *&End)
++{
++ if (!Section.Find("Description",Start,End))
++ return Section.Find(("Description-" + pkgIndexFile::LanguageCode()).c_str(),Start,End);
++ return true;
++}
++ /*}}}*/
+
+ static const char *SourceVerSeparators = " ()";
+
+diff -ru apt-0.7.20.2/apt-pkg/deb/debrecords.h apt-0.7.20.2+iPhone/apt-pkg/deb/debrecords.h
+--- apt-0.7.20.2/apt-pkg/deb/debrecords.h 2009-04-20 08:54:09.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/deb/debrecords.h 2009-04-20 17:20:31.000000000 +0000
+@@ -39,6 +39,9 @@
+ virtual string SourcePkg();
+ virtual string SourceVer();
+
++ virtual bool ShortDesc(const char *&Start,const char *&End);
++ virtual bool LongDesc(const char *&Start,const char *&End);
++
+ // These are some general stats about the package
+ virtual string Maintainer();
+ virtual string ShortDesc();
+diff -ru apt-0.7.20.2/apt-pkg/pkgrecords.h apt-0.7.20.2+iPhone/apt-pkg/pkgrecords.h
+--- apt-0.7.20.2/apt-pkg/pkgrecords.h 2009-04-20 19:56:46.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/pkgrecords.h 2009-04-20 19:55:58.000000000 +0000
+@@ -61,6 +61,9 @@
+ virtual string SourcePkg() {return string();};
+ virtual string SourceVer() {return string();};
+
++ virtual bool ShortDesc(const char *&Start,const char *&End) {return false;}
++ virtual bool LongDesc(const char *&Start,const char *&End) {return false;}
++
+ // These are some general stats about the package
+ virtual string Maintainer() {return string();};
+ virtual string ShortDesc() {return string();};
diff --git a/data/_apt7/hashtable.diff b/data/_apt7/hashtable.diff
new file mode 100644
index 000000000..fe5c046c8
--- /dev/null
+++ b/data/_apt7/hashtable.diff
@@ -0,0 +1,61 @@
+diff -ru apt-0.7.20.2/apt-pkg/tagfile.cc apt-0.7.20.2+iPhone/apt-pkg/tagfile.cc
+--- apt-0.7.20.2/apt-pkg/tagfile.cc 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/tagfile.cc 2009-04-19 02:42:49.000000000 +0000
+@@ -220,7 +220,10 @@
+ if (isspace(Stop[0]) == 0)
+ {
+ Indexes[TagCount++] = Stop - Section;
+- AlphaIndexes[AlphaHash(Stop,End)] = TagCount;
++ unsigned long hash(AlphaHash(Stop, End));
++ while (AlphaIndexes[hash] != 0)
++ hash = (hash + 1) % (sizeof(AlphaIndexes) / sizeof(AlphaIndexes[0]));
++ AlphaIndexes[hash] = TagCount;
+ }
+
+ Stop = (const char *)memchr(Stop,'\n',End - Stop);
+@@ -258,14 +261,16 @@
+ bool pkgTagSection::Find(const char *Tag,unsigned &Pos) const
+ {
+ unsigned int Length = strlen(Tag);
+- unsigned int I = AlphaIndexes[AlphaHash(Tag)];
+- if (I == 0)
+- return false;
+- I--;
++ unsigned int J = AlphaHash(Tag);
+
+- for (unsigned int Counter = 0; Counter != TagCount; Counter++,
+- I = (I+1)%TagCount)
++ for (unsigned int Counter = 0; Counter != TagCount; Counter++,
++ J = (J+1)%(sizeof(AlphaIndexes)/sizeof(AlphaIndexes[0])))
+ {
++ unsigned int I = AlphaIndexes[J];
++ if (I == 0)
++ return false;
++ I--;
++
+ const char *St;
+ St = Section + Indexes[I];
+ if (strncasecmp(Tag,St,Length) != 0)
+@@ -291,14 +296,16 @@
+ const char *&End) const
+ {
+ unsigned int Length = strlen(Tag);
+- unsigned int I = AlphaIndexes[AlphaHash(Tag)];
+- if (I == 0)
+- return false;
+- I--;
++ unsigned int J = AlphaHash(Tag);
+
+- for (unsigned int Counter = 0; Counter != TagCount; Counter++,
+- I = (I+1)%TagCount)
++ for (unsigned int Counter = 0; Counter != TagCount; Counter++,
++ J = (J+1)%(sizeof(AlphaIndexes)/sizeof(AlphaIndexes[0])))
+ {
++ unsigned int I = AlphaIndexes[J];
++ if (I == 0)
++ return false;
++ I--;
++
+ const char *St;
+ St = Section + Indexes[I];
+ if (strncasecmp(Tag,St,Length) != 0)
diff --git a/data/_apt7/iconv.diff b/data/_apt7/iconv.diff
new file mode 100644
index 000000000..d8887b1aa
--- /dev/null
+++ b/data/_apt7/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 @@
+ LIBRARY=apt-pkg
+ MAJOR=$(LIBAPTPKG_MAJOR)
+ MINOR=$(LIBAPTPKG_RELEASE)
+-SLIBS=$(PTHREADLIB) $(INTLLIBS) -lutil -ldl
++SLIBS=$(PTHREADLIB) $(INTLLIBS) -lutil -ldl $(LIBICONV)
+ APT_DOMAIN:=libapt-pkg$(LIBAPTPKG_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/_apt7/insensitive.diff b/data/_apt7/insensitive.diff
new file mode 100644
index 000000000..c9e4d3215
--- /dev/null
+++ b/data/_apt7/insensitive.diff
@@ -0,0 +1,12 @@
+diff -ru apt-0.7.25.3/apt-pkg/pkgcache.cc apt-0.7.25.3+iPhone/apt-pkg/pkgcache.cc
+--- apt-0.7.25.3/apt-pkg/pkgcache.cc 2010-02-01 19:44:40.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/pkgcache.cc 2011-03-11 01:33:44.000000000 +0000
+@@ -185,7 +185,7 @@
+ Package *Pkg = PkgP + HeaderP->HashTable[Hash(Name)];
+ for (; Pkg != PkgP; Pkg = PkgP + Pkg->NextPackage)
+ {
+- if (Pkg->Name != 0 && StrP[Pkg->Name] == Name[0] &&
++ if (Pkg->Name != 0 &&
+ stringcasecmp(Name,StrP + Pkg->Name) == 0)
+ return PkgIterator(*this,Pkg);
+ }
diff --git a/data/_apt7/intl.diff b/data/_apt7/intl.diff
new file mode 100644
index 000000000..f2f35eb6d
--- /dev/null
+++ b/data/_apt7/intl.diff
@@ -0,0 +1,12 @@
+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-16 01:54:17.000000000 +0000
+@@ -14,7 +14,7 @@
+ LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
+ MAJOR=1.1
+ MINOR=0
+-SLIBS=$(PTHREADLIB) -lapt-pkg
++SLIBS=$(PTHREADLIB) -lapt-pkg $(INTLLIBS)
+ APT_DOMAIN:=libapt-inst$(MAJOR)
+
+ # Source code for the contributed non-core things
diff --git a/data/_apt7/longdesc.diff b/data/_apt7/longdesc.diff
new file mode 100644
index 000000000..d2cd4bbbe
--- /dev/null
+++ b/data/_apt7/longdesc.diff
@@ -0,0 +1,17 @@
+diff -ru apt-0.7.20.2/apt-pkg/deb/debrecords.cc apt-0.7.20.2+iPhone/apt-pkg/deb/debrecords.cc
+--- apt-0.7.20.2/apt-pkg/deb/debrecords.cc 2009-04-20 08:54:09.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/deb/debrecords.cc 2009-04-20 17:26:22.000000000 +0000
+@@ -111,10 +122,9 @@
+ string orig, dest;
+ char *codeset = nl_langinfo(CODESET);
+
+- if (!Section.FindS("Description").empty())
+- orig = Section.FindS("Description").c_str();
+- else
+- orig = Section.FindS(("Description-" + pkgIndexFile::LanguageCode()).c_str()).c_str();
++ orig = Section.FindS("Description");
++ if (orig.empty())
++ orig = Section.FindS(("Description-" + pkgIndexFile::LanguageCode()).c_str());
+
+ if (strcmp(codeset,"UTF-8") != 0) {
+ UTF8ToCodeset(codeset, orig, &dest);
diff --git a/data/_apt7/make.sh b/data/_apt7/make.sh
index 03f8b6868..5ec612bc9 100644
--- a/data/_apt7/make.sh
+++ b/data/_apt7/make.sh
@@ -1,24 +1,9 @@
pkg:setup
-cat >iphoneos_toolchain.cmake <<EOF
-set(CMAKE_SYSTEM_NAME Darwin) # Tell CMake we're cross-compiling
-set(CMAKE_CROSSCOMPILING true)
-#include(CMakeForceCompiler)
-# Prefix detection only works with compiler id "GNU"
-# CMake will look for prefixed g++, cpp, ld, etc. automatically
-set(CMAKE_SYSTEM_PROCESSOR aarch64)
-set(triple ${PKG_TARG})
-set(CMAKE_FIND_ROOT_PATH $(echo ${PKG_PATH} | sed -e s/:/' '/g))
-set(CMAKE_LIBRARY_PATH $(echo ${LIBRARY_PATH} | sed -e s/:/' '/g))
-set(CMAKE_INCLUDE_PATH $(echo ${INCLUDE_PATH} | sed -e s/:/' '/g))
-set(CMAKE_C_COMPILER ${PKG_TARG}-gcc)
-set(CMAKE_CXX_COMPILER ${PKG_TARG}-g++)
-set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-EOF
-
-cmake -j8 -DCMAKE_TOOLCHAIN_FILE=iphoneos_toolchain.cmake -DCMAKE_LOCALSTATEDIR="/private/var" -DCMAKE_INSTALL_NAME_DIR="/usr/lib" -DCMAKE_INSTALL_RPATH="/usr/" -DCMAKE_OSX_SYSROOT="${PKG_ROOT}" -DCMAKE_INSTALL_PREFIX="/usr/" -DCMAKE_SHARED_LINKER_FLAGS="-lresolv" -DCURRENT_VENDOR=debian -DUSE_NLS=0 -DWITH_DOC=0 -DCOMMON_ARCH=${PKG_ARCH} .
-make -j16
+rm buildlib/config.sub
+cp ${PKG_BASE}/config.sub buildlib/
+autoconf
+DPKG_DATADIR=$(ls -d $(PKG_WORK_ _dpkg)/dpkg-*/data) DPKG_ARCH=$(ls -d $(PKG_WORK_ _dpkg)/dpkg-*/scripts) pkg:configure --disable-nls
+make
pkg: mkdir -p /etc/apt/apt.conf.d
pkg: mkdir -p /etc/apt/preferences.d
@@ -29,4 +14,13 @@ pkg: mkdir -p /var/lib/apt/lists/partial
pkg: mkdir -p /var/lib/apt/periodic
pkg: mkdir -p /var/log/apt
-pkg:install
+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 -p /usr/lib/dpkg/methods
+pkg: cp -a scripts/dselect /usr/lib/dpkg/methods/apt
+
+pkg: mkdir -p /usr/include
+pkg: cp -a include/apt-pkg /usr/include
diff --git a/data/_apt7/map_anon.diff b/data/_apt7/map_anon.diff
new file mode 100644
index 000000000..283d36d36
--- /dev/null
+++ b/data/_apt7/map_anon.diff
@@ -0,0 +1,17 @@
+diff -ru apt-0.7.25.3/apt-pkg/contrib/mmap.cc apt-0.7.25.3+iPhone/apt-pkg/contrib/mmap.cc
+--- apt-0.7.25.3/apt-pkg/contrib/mmap.cc 2010-02-22 18:15:52.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/contrib/mmap.cc 2010-02-22 18:14:42.000000000 +0000
+@@ -174,11 +174,11 @@
+ #ifdef _POSIX_MAPPED_FILES
+ // Set the permissions.
+ int Prot = PROT_READ;
+- int Map = MAP_PRIVATE | MAP_ANONYMOUS;
++ int Map = MAP_PRIVATE | MAP_ANON;
+ if ((Flags & ReadOnly) != ReadOnly)
+ Prot |= PROT_WRITE;
+ if ((Flags & Public) == Public)
+- Map = MAP_SHARED | MAP_ANONYMOUS;
++ Map = MAP_SHARED | MAP_ANON;
+
+ // use anonymous mmap() to get the memory
+ Base = (unsigned char*) mmap(0, WorkSpace, Prot, Map, -1, 0);
diff --git a/data/_apt7/memrchr.c b/data/_apt7/memrchr.c
new file mode 100644
index 000000000..da93ca0ba
--- /dev/null
+++ b/data/_apt7/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/_apt7/memrchr.diff b/data/_apt7/memrchr.diff
new file mode 100644
index 000000000..8913e1816
--- /dev/null
+++ b/data/_apt7/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/_apt7/mmap.diff b/data/_apt7/mmap.diff
new file mode 100644
index 000000000..1b745e8b5
--- /dev/null
+++ b/data/_apt7/mmap.diff
@@ -0,0 +1,199 @@
+diff -ru apt-0.7.20.2/apt-pkg/tagfile.cc apt-0.7.20.2+iPhone/apt-pkg/tagfile.cc
+--- apt-0.7.20.2/apt-pkg/tagfile.cc 2009-04-19 02:42:49.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/tagfile.cc 2009-04-19 03:28:33.000000000 +0000
+@@ -28,11 +28,12 @@
+ // ---------------------------------------------------------------------
+ /* */
+ pkgTagFile::pkgTagFile(FileFd *pFd,unsigned long Size) :
+- Fd(*pFd),
+- Size(Size)
++ Fd(*pFd)
+ {
+- if (Fd.IsOpen() == false)
++ if (Fd.IsOpen() == false || Fd.Size() == 0)
+ {
++ _error->Discard();
++ Map = NULL;
+ Buffer = 0;
+ Start = End = Buffer = 0;
+ Done = true;
+@@ -40,7 +40,8 @@
+ return;
+ }
+
+- Buffer = new char[Size];
++ Map = new MMap(*pFd, MMap::ReadOnly);
++ Buffer = reinterpret_cast<char *>(Map->Data());
+ Start = End = Buffer;
+ Done = false;
+ iOffset = 0;
+@@ -52,36 +53,9 @@
+ /* */
+ pkgTagFile::~pkgTagFile()
+ {
+- delete [] Buffer;
++ delete Map;
+ }
+ /*}}}*/
+-// TagFile::Resize - Resize the internal buffer /*{{{*/
+-// ---------------------------------------------------------------------
+-/* Resize the internal buffer (double it in size). Fail if a maximum size
+- * size is reached.
+- */
+-bool pkgTagFile::Resize()
+-{
+- char *tmp;
+- unsigned long EndSize = End - Start;
+-
+- // fail is the buffer grows too big
+- if(Size > 1024*1024+1)
+- return false;
+-
+- // get new buffer and use it
+- tmp = new char[2*Size];
+- memcpy(tmp, Buffer, Size);
+- Size = Size*2;
+- delete [] Buffer;
+- Buffer = tmp;
+-
+- // update the start/end pointers to the new buffer
+- Start = Buffer;
+- End = Start + EndSize;
+- return true;
+-}
+- /*}}}*/
+ // TagFile::Step - Advance to the next section /*{{{*/
+ // ---------------------------------------------------------------------
+ /* If the Section Scanner fails we refill the buffer and try again.
+@@ -90,15 +64,11 @@
+ */
+ bool pkgTagFile::Step(pkgTagSection &Tag)
+ {
+- while (Tag.Scan(Start,End - Start) == false)
++ if (Tag.Scan(Start,End - Start) == false)
+ {
+- if (Fill() == false)
+- return false;
+-
+- if(Tag.Scan(Start,End - Start))
+- break;
+-
+- if (Resize() == false)
++ if (Start == End)
++ return false;
++ else
+ return _error->Error(_("Unable to parse package file %s (1)"),
+ Fd.Name().c_str());
+ }
+@@ -115,41 +85,11 @@
+ then fills the rest from the file */
+ bool pkgTagFile::Fill()
+ {
+- unsigned long EndSize = End - Start;
+- unsigned long Actual = 0;
+-
+- memmove(Buffer,Start,EndSize);
+- Start = Buffer;
+- End = Buffer + EndSize;
+-
+- if (Done == false)
+- {
+- // See if only a bit of the file is left
+- if (Fd.Read(End,Size - (End - Buffer),&Actual) == false)
+- return false;
+- if (Actual != Size - (End - Buffer))
+- Done = true;
+- End += Actual;
+- }
+-
+- if (Done == true)
+- {
+- if (EndSize <= 3 && Actual == 0)
+- return false;
+- if (Size - (End - Buffer) < 4)
+- return true;
+-
+- // Append a double new line if one does not exist
+- unsigned int LineCount = 0;
+- for (const char *E = End - 1; E - End < 6 && (*E == '\n' || *E == '\r'); E--)
+- if (*E == '\n')
+- LineCount++;
+- for (; LineCount < 2; LineCount++)
+- *End++ = '\n';
+-
+- return true;
+- }
+-
++ unsigned int Size(Map->Size());
++ End = Buffer + Size;
++ if (iOffset >= Size)
++ return false;
++ Start = Buffer + iOffset;
+ return true;
+ }
+ /*}}}*/
+@@ -171,20 +111,11 @@
+ // Reposition and reload..
+ iOffset = Offset;
+ Done = false;
+- if (Fd.Seek(Offset) == false)
+- return false;
+ End = Start = Buffer;
+
+ if (Fill() == false)
+ return false;
+
+- if (Tag.Scan(Start,End - Start) == true)
+- return true;
+-
+- // This appends a double new line (for the real eof handling)
+- if (Fill() == false)
+- return false;
+-
+ if (Tag.Scan(Start,End - Start) == false)
+ return _error->Error(_("Unable to parse package file %s (2)"),Fd.Name().c_str());
+
+@@ -228,14 +161,16 @@
+
+ Stop = (const char *)memchr(Stop,'\n',End - Stop);
+
+- if (Stop == 0)
+- return false;
++ if (Stop == 0) {
++ Stop = End;
++ goto end;
++ }
+
+ for (; Stop+1 < End && Stop[1] == '\r'; Stop++);
+
+ // Double newline marks the end of the record
+- if (Stop+1 < End && Stop[1] == '\n')
+- {
++ if (Stop+1 == End || Stop[1] == '\n')
++ end: {
+ Indexes[TagCount] = Stop - Section;
+ TrimRecord(false,End);
+ return true;
+diff -ru apt-0.7.20.2/apt-pkg/tagfile.h apt-0.7.20.2+iPhone/apt-pkg/tagfile.h
+--- apt-0.7.20.2/apt-pkg/tagfile.h 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/tagfile.h 2009-04-19 03:04:07.000000000 +0000
+@@ -21,6 +21,7 @@
+ #define PKGLIB_TAGFILE_H
+
+
++#include <apt-pkg/mmap.h>
+ #include <apt-pkg/fileutl.h>
+ #include <stdio.h>
+
+@@ -71,10 +72,9 @@
+ char *End;
+ bool Done;
+ unsigned long iOffset;
+- unsigned long Size;
++ MMap *Map;
+
+ bool Fill();
+- bool Resize();
+
+ public:
+
diff --git a/data/_apt7/parallel.diff b/data/_apt7/parallel.diff
new file mode 100644
index 000000000..40d28fb3d
--- /dev/null
+++ b/data/_apt7/parallel.diff
@@ -0,0 +1,33 @@
+diff -ru apt-0.6.46.4.1/apt-pkg/acquire.cc apt-0.6.46.4.1+iPhone/apt-pkg/acquire.cc
+--- apt-0.6.46.4.1/apt-pkg/acquire.cc 2006-12-04 14:37:34.000000000 +0000
++++ apt-0.6.46.4.1+iPhone/apt-pkg/acquire.cc 2009-01-21 10:47:16.000000000 +0000
+@@ -238,9 +238,27 @@
+ /* Single-Instance methods get exactly one queue per URI. This is
+ also used for the Access queue method */
+ if (Config->SingleInstance == true || QueueMode == QueueAccess)
+- return U.Access;
++ return U.Access;
++ string name(U.Access + ':' + U.Host);
+
+- return U.Access + ':' + U.Host;
++ int parallel(_config->FindI("Acquire::"+U.Access+"::MaxParallel",8));
++ if (parallel <= 0)
++ return name;
++
++ typedef map<string, int> indexmap;
++ static indexmap indices;
++
++ pair<indexmap::iterator, bool> cache(indices.insert(indexmap::value_type(name, -1)));
++ if (cache.second || cache.first->second == -1) {
++ int &index(indices[U.Access]);
++ if (index >= parallel)
++ index = 0;
++ cache.first->second = index++;
++ }
++
++ ostringstream value;
++ value << U.Access << "::" << cache.first->second;
++ return value.str();
+ }
+ /*}}}*/
+ // Acquire::GetConfig - Fetch the configuration information /*{{{*/
diff --git a/data/_apt7/port.diff b/data/_apt7/port.diff
new file mode 100644
index 000000000..f2190eca7
--- /dev/null
+++ b/data/_apt7/port.diff
@@ -0,0 +1,216 @@
+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>
++#include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/mman.h>
+ #include <fcntl.h>
+diff -ru apt-0.7.25.3/buildlib/libversion.mak apt-0.7.25.3+iPhone/buildlib/libversion.mak
+--- apt-0.7.25.3/buildlib/libversion.mak 2010-02-01 19:44:40.000000000 +0000
++++ apt-0.7.25.3+iPhone/buildlib/libversion.mak 2010-02-22 18:03:29.000000000 +0000
+@@ -18,4 +18,4 @@
+ # want to drop this, but this a ABI break.
+ # And we don't want to do this now. So we hardcode a value here,
+ # and drop it later on (hopefully as fast as possible).
+-LIBEXT=-libc6.9-6
++LIBEXT=
+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;
+
++ 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 -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
+ (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 -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)
+ 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 -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__)
++
+ 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 /*{{{*/
+@@ -2786,6 +2787,9 @@
+ if (!isatty(STDOUT_FILENO) && _config->FindI("quiet",0) < 1)
+ _config->Set("quiet","1");
+
++ ofstream devnull;
++ devnull.open("/dev/null");
++
+ // Setup the output streams
+ c0out.rdbuf(cout.rdbuf());
+ c1out.rdbuf(cout.rdbuf());
+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>
+ #include <string.h>
+-#include <malloc.h>
++#include <memory.h>
+ /*}}}*/
+
+ // GenContents::~GenContents - Free allocated memory /*{{{*/
+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,5 @@
+ $(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 -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/_apt7/printf.diff b/data/_apt7/printf.diff
new file mode 100644
index 000000000..847758bf2
--- /dev/null
+++ b/data/_apt7/printf.diff
@@ -0,0 +1,12 @@
+diff -ru apt-0.7.20.2/ftparchive/writer.cc apt-0.7.20.2+iPhone/ftparchive/writer.cc
+--- apt-0.7.20.2/ftparchive/writer.cc 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/ftparchive/writer.cc 2009-04-20 17:53:48.000000000 +0000
+@@ -629,7 +629,7 @@
+
+ // Add the dsc to the files hash list
+ char Files[1000];
+- snprintf(Files,sizeof(Files),"\n %s %lu %s\n %s",
++ snprintf(Files,sizeof(Files),"\n %s %llu %s\n %s",
+ string(MD5.Result()).c_str(),St.st_size,
+ flNotDir(FileName).c_str(),
+ Tags.FindS("Files").c_str());
diff --git a/data/_apt7/public.diff b/data/_apt7/public.diff
new file mode 100644
index 000000000..04e5051f8
--- /dev/null
+++ b/data/_apt7/public.diff
@@ -0,0 +1,15 @@
+diff -ru apt-0.7.20.2/apt-pkg/deb/debindexfile.h apt-0.7.20.2+iPhone/apt-pkg/deb/debindexfile.h
+--- apt-0.7.20.2/apt-pkg/deb/debindexfile.h 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/deb/debindexfile.h 2009-04-19 04:12:51.000000000 +0000
+@@ -49,9 +49,10 @@
+
+ string Info(const char *Type) const;
+ string IndexFile(const char *Type) const;
+- string IndexURI(const char *Type) const;
+
+ public:
++
++ string IndexURI(const char *Type) const;
+
+ virtual const Type *GetType() const;
+
diff --git a/data/_apt7/reinstreq.diff b/data/_apt7/reinstreq.diff
new file mode 100644
index 000000000..7f34536e6
--- /dev/null
+++ b/data/_apt7/reinstreq.diff
@@ -0,0 +1,21 @@
+diff -ru apt-0.6.46.4.1/apt-pkg/deb/dpkgpm.cc apt-0.6.46.4.1+iPhone/apt-pkg/deb/dpkgpm.cc
+--- apt-0.6.46.4.1/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 2008-06-22 09:41:01.000000000 +0000
+@@ -451,6 +451,8 @@
+ case Item::Remove:
+ Args[n++] = "--force-depends";
+ Size += strlen(Args[n-1]);
++ Args[n++] = "--force-remove-reinstreq";
++ Size += strlen(Args[n-1]);
+ Args[n++] = "--force-remove-essential";
+ Size += strlen(Args[n-1]);
+ Args[n++] = "--remove";
+@@ -460,6 +462,8 @@
+ case Item::Purge:
+ Args[n++] = "--force-depends";
+ Size += strlen(Args[n-1]);
++ Args[n++] = "--force-remove-reinstreq";
++ Size += strlen(Args[n-1]);
+ Args[n++] = "--force-remove-essential";
+ Size += strlen(Args[n-1]);
+ Args[n++] = "--purge";
diff --git a/data/_apt7/strdupa.diff b/data/_apt7/strdupa.diff
new file mode 100644
index 000000000..03a179e01
--- /dev/null
+++ b/data/_apt7/strdupa.diff
@@ -0,0 +1,80 @@
+diff -ru apt-0.7.25.3/apt-pkg/contrib/netrc.cc apt-0.7.25.3+iPhone/apt-pkg/contrib/netrc.cc
+--- apt-0.7.25.3/apt-pkg/contrib/netrc.cc 2010-02-01 19:44:40.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/contrib/netrc.cc 2010-02-22 18:26:01.000000000 +0000
+@@ -40,13 +40,13 @@
+ #define NETRC DOT_CHAR "netrc"
+
+ /* returns -1 on failure, 0 if the host is found, 1 is the host isn't found */
+-int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL)
++int parsenetrc (const char *host, char *login, char *password, const char *netrcfile = NULL)
+ {
+ FILE *file;
+ int retcode = 1;
+ int specific_login = (login[0] != 0);
+ char *home = NULL;
+- bool netrc_alloc = false;
++ char *netrc_alloc = NULL;
+ int state = NOTHING;
+
+ char state_login = 0; /* Found a login keyword */
+@@ -67,11 +67,11 @@
+ if (!home)
+ return -1;
+
+- asprintf (&netrcfile, "%s%s%s", home, DIR_CHAR, NETRC);
+- if(!netrcfile)
++ asprintf (&netrc_alloc, "%s%s%s", home, DIR_CHAR, NETRC);
++ if(!netrc_alloc)
+ return -1;
+ else
+- netrc_alloc = true;
++ netrcfile = netrc_alloc;
+ }
+
+ file = fopen (netrcfile, "r");
+@@ -144,7 +144,7 @@
+ }
+
+ if (netrc_alloc)
+- free(netrcfile);
++ free(netrc_alloc);
+
+ return retcode;
+ }
+@@ -160,11 +160,11 @@
+ {
+ char login[64] = "";
+ char password[64] = "";
+- char *netrcfile = strdupa (NetRCFile.c_str ());
++ const char *netrcfile = NetRCFile.c_str ();
+
+ // first check for a generic host based netrc entry
+- char *host = strdupa (Uri.Host.c_str ());
+- if (host && parsenetrc (host, login, password, netrcfile) == 0)
++ const char *host = Uri.Host.c_str ();
++ if (parsenetrc (host, login, password, netrcfile) == 0)
+ {
+ if (_config->FindB("Debug::Acquire::netrc", false) == true)
+ std::clog << "host: " << host
+@@ -179,7 +179,8 @@
+ // if host did not work, try Host+Path next, this will trigger
+ // a lookup uri.startswith(host) in the netrc file parser (because
+ // of the "/"
+- char *hostpath = strdupa (string(Uri.Host+Uri.Path).c_str ());
++ std::string temp(Uri.Host+Uri.Path);
++ const char *hostpath = temp.c_str ();
+ if (hostpath && parsenetrc (hostpath, login, password, netrcfile) == 0)
+ {
+ if (_config->FindB("Debug::Acquire::netrc", false) == true)
+diff -ru apt-0.7.25.3/apt-pkg/contrib/netrc.h apt-0.7.25.3+iPhone/apt-pkg/contrib/netrc.h
+--- apt-0.7.25.3/apt-pkg/contrib/netrc.h 2010-02-01 19:44:40.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/contrib/netrc.h 2010-02-22 18:23:20.000000000 +0000
+@@ -23,7 +23,7 @@
+ // If login[0] = 0, search for login and password within a machine section
+ // in the netrc.
+ // If login[0] != 0, search for password within machine and login.
+-int parsenetrc (char *host, char *login, char *password, char *filename);
++int parsenetrc (const char *host, char *login, char *password, const char *filename);
+
+ void maybe_add_auth (URI &Uri, string NetRCFile);
+ #endif
diff --git a/data/_apt7/tag.diff b/data/_apt7/tag.diff
new file mode 100644
index 000000000..78ce39645
--- /dev/null
+++ b/data/_apt7/tag.diff
@@ -0,0 +1,280 @@
+diff -ru apt-0.7.20.2/apt-pkg/cacheiterators.h apt-0.7.20.2+iPhone/apt-pkg/cacheiterators.h
+--- apt-0.7.20.2/apt-pkg/cacheiterators.h 2009-04-20 16:50:43.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/cacheiterators.h 2009-04-20 18:27:20.000000000 +0000
+@@ -79,6 +79,7 @@
+ inline VerIterator CurrentVer() const;
+ inline DepIterator RevDependsList() const;
+ inline PrvIterator ProvidesList() const;
++ inline TagIterator TagList() const;
+ inline unsigned long Index() const {return Pkg - Owner->PkgP;};
+ OkState State() const;
+
+@@ -148,6 +150,48 @@
+ };
+ };
+ /*}}}*/
++// Tag Iterator /*{{{*/
++class pkgCache::TagIterator
++{
++ Tag *Tg;
++ pkgCache *Owner;
++
++ void _dummy();
++
++ public:
++
++ // Iteration
++ void operator ++(int) {if (Tg != Owner->TagP) Tg = Owner->TagP + Tg->NextTag;};
++ inline void operator ++() {operator ++(0);};
++ inline bool end() const {return Tg == Owner->TagP?true:false;};
++ inline void operator =(const TagIterator &B) {Tg = B.Tg; Owner = B.Owner;};
++
++ // Comparison
++ inline bool operator ==(const TagIterator &B) const {return Tg == B.Tg;};
++ inline bool operator !=(const TagIterator &B) const {return Tg != B.Tg;};
++ int CompareTag(const TagIterator &B) const;
++
++ // Accessors
++ inline Tag *operator ->() {return Tg;};
++ inline Tag const *operator ->() const {return Tg;};
++ inline Tag &operator *() {return *Tg;};
++ inline Tag const &operator *() const {return *Tg;};
++ inline operator Tag *() {return Tg == Owner->TagP?0:Tg;};
++ inline operator Tag const *() const {return Tg == Owner->TagP?0:Tg;};
++ inline pkgCache *Cache() {return Owner;};
++
++ inline const char *Name() const {return Owner->StrP + Tg->Name;};
++ inline unsigned long Index() const {return Tg - Owner->TagP;};
++
++ inline TagIterator() : Tg(0), Owner(0) {};
++ inline TagIterator(pkgCache &Owner,Tag *Trg = 0) : Tg(Trg),
++ Owner(&Owner)
++ {
++ if (Tg == 0)
++ Tg = Owner.TagP;
++ };
++};
++ /*}}}*/
+ // Description Iterator /*{{{*/
+ class pkgCache::DescIterator
+ {
+@@ -423,6 +467,8 @@
+ {return DepIterator(*Owner,Owner->DepP + Pkg->RevDepends,Pkg);};
+ inline pkgCache::PrvIterator pkgCache::PkgIterator::ProvidesList() const
+ {return PrvIterator(*Owner,Owner->ProvideP + Pkg->ProvidesList,Pkg);};
++inline pkgCache::TagIterator pkgCache::PkgIterator::TagList() const
++ {return TagIterator(*Owner,Owner->TagP + Pkg->TagList);};
+ inline pkgCache::DescIterator pkgCache::VerIterator::DescriptionList() const
+ {return DescIterator(*Owner,Owner->DescP + Ver->DescriptionList);};
+ inline pkgCache::PrvIterator pkgCache::VerIterator::ProvidesList() const
+diff -ru apt-0.7.20.2/apt-pkg/deb/deblistparser.cc apt-0.7.20.2+iPhone/apt-pkg/deb/deblistparser.cc
+--- apt-0.7.20.2/apt-pkg/deb/deblistparser.cc 2009-04-20 17:02:43.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/deb/deblistparser.cc 2009-04-20 19:27:47.000000000 +0000
+@@ -185,6 +189,11 @@
+
+ if (ParseStatus(Pkg,Ver) == false)
+ return false;
++
++ if (Pkg->TagList == 0)
++ if (ParseTag(Pkg) == false)
++ return false;
++
+ return true;
+ }
+ /*}}}*/
+@@ -570,6 +579,46 @@
+ return true;
+ }
+ /*}}}*/
++// ListParser::ParseTag - Parse the tag list /*{{{*/
++// ---------------------------------------------------------------------
++/* */
++bool debListParser::ParseTag(pkgCache::PkgIterator Pkg)
++{
++ const char *Start;
++ const char *Stop;
++ if (Section.Find("Tag",Start,Stop) == false)
++ return true;
++
++ while (1) {
++ while (1) {
++ if (Start == Stop)
++ return true;
++ if (Stop[-1] != ' ' && Stop[-1] != '\t')
++ break;
++ --Stop;
++ }
++
++ const char *Begin = Stop - 1;
++ while (Begin != Start && Begin[-1] != ' ' && Begin[-1] != ',')
++ --Begin;
++
++ if (NewTag(Pkg, Begin, Stop - Begin) == false)
++ return false;
++
++ while (1) {
++ if (Begin == Start)
++ return true;
++ if (Begin[-1] == ',')
++ break;
++ --Begin;
++ }
++
++ Stop = Begin - 1;
++ }
++
++ return true;
++}
++ /*}}}*/
+ // ListParser::GrabWord - Matches a word and returns /*{{{*/
+ // ---------------------------------------------------------------------
+ /* Looks for a word in a list of words - for ParseStatus */
+diff -ru apt-0.7.20.2/apt-pkg/deb/deblistparser.h apt-0.7.20.2+iPhone/apt-pkg/deb/deblistparser.h
+--- apt-0.7.20.2/apt-pkg/deb/deblistparser.h 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/deb/deblistparser.h 2009-04-20 18:29:09.000000000 +0000
+@@ -38,6 +38,7 @@
+ bool ParseDepends(pkgCache::VerIterator Ver,const char *Tag,
+ unsigned int Type);
+ bool ParseProvides(pkgCache::VerIterator Ver);
++ bool ParseTag(pkgCache::PkgIterator Pkg);
+ static bool GrabWord(string Word,WordList *List,unsigned char &Out);
+
+ public:
+diff -ru apt-0.7.20.2/apt-pkg/pkgcache.cc apt-0.7.20.2+iPhone/apt-pkg/pkgcache.cc
+--- apt-0.7.20.2/apt-pkg/pkgcache.cc 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/pkgcache.cc 2009-04-20 19:10:52.000000000 +0000
+@@ -124,6 +124,7 @@
+ VerP = (Version *)Map.Data();
+ DescP = (Description *)Map.Data();
+ ProvideP = (Provides *)Map.Data();
++ TagP = (Tag *)Map.Data();
+ DepP = (Dependency *)Map.Data();
+ StringItemP = (StringItem *)Map.Data();
+ StrP = (char *)Map.Data();
+diff -ru apt-0.7.20.2/apt-pkg/pkgcachegen.cc apt-0.7.20.2+iPhone/apt-pkg/pkgcachegen.cc
+--- apt-0.7.20.2/apt-pkg/pkgcachegen.cc 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/pkgcachegen.cc 2009-04-20 19:28:52.000000000 +0000
+@@ -570,6 +570,32 @@
+ return true;
+ }
+ /*}}}*/
++// ListParser::NewTag - Create a Tag element /*{{{*/
++// ---------------------------------------------------------------------
++/* */
++bool pkgCacheGenerator::ListParser::NewTag(pkgCache::PkgIterator Pkg,
++ const char *NameStart,
++ unsigned int NameSize)
++{
++ pkgCache &Cache = Owner->Cache;
++
++ // Get a structure
++ unsigned long Tagg = Owner->Map.Allocate(sizeof(pkgCache::Tag));
++ if (Tagg == 0)
++ return false;
++ Cache.HeaderP->TagCount++;
++
++ // Fill it in
++ pkgCache::TagIterator Tg(Cache,Cache.TagP + Tagg);
++ Tg->Name = WriteString(NameStart,NameSize);
++ if (Tg->Name == 0)
++ return false;
++ Tg->NextTag = Pkg->TagList;
++ Pkg->TagList = Tg.Index();
++
++ return true;
++}
++ /*}}}*/
+ // CacheGenerator::SelectFile - Select the current file being parsed /*{{{*/
+ // ---------------------------------------------------------------------
+ /* This is used to select which file is to be associated with all newly
+diff -ru apt-0.7.20.2/apt-pkg/pkgcachegen.h apt-0.7.20.2+iPhone/apt-pkg/pkgcachegen.h
+--- apt-0.7.20.2/apt-pkg/pkgcachegen.h 2009-02-07 15:09:35.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/pkgcachegen.h 2009-04-20 18:47:57.000000000 +0000
+@@ -101,6 +101,7 @@
+ unsigned int Type);
+ bool NewProvides(pkgCache::VerIterator Ver,const string &Package,
+ const string &Version);
++ bool NewTag(pkgCache::PkgIterator Pkg,const char *NameStart,unsigned int NameSize);
+
+ public:
+
+diff -ru apt-0.7.20.2/apt-pkg/pkgcache.h apt-0.7.20.2+iPhone/apt-pkg/pkgcache.h
+--- apt-0.7.20.2/apt-pkg/pkgcache.h 2009-04-20 16:49:55.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/pkgcache.h 2009-04-20 18:26:48.000000000 +0000
+@@ -41,6 +41,7 @@
+ struct StringItem;
+ struct VerFile;
+ struct DescFile;
++ struct Tag;
+
+ // Iterators
+ class PkgIterator;
+@@ -51,6 +52,7 @@
+ class PkgFileIterator;
+ class VerFileIterator;
+ class DescFileIterator;
++ class TagIterator;
+ friend class PkgIterator;
+ friend class VerIterator;
+ friend class DescInterator;
+@@ -59,6 +61,7 @@
+ friend class PkgFileIterator;
+ friend class VerFileIterator;
+ friend class DescFileIterator;
++ friend class TagIterator;
+
+ class Namespace;
+
+@@ -109,6 +112,7 @@
+ DescFile *DescFileP;
+ PackageFile *PkgFileP;
+ Version *VerP;
++ Tag *TagP;
+ Description *DescP;
+ Provides *ProvideP;
+ Dependency *DepP;
+@@ -161,6 +165,7 @@
+ unsigned short PackageSz;
+ unsigned short PackageFileSz;
+ unsigned short VersionSz;
++ unsigned short TagSz;
+ unsigned short DescriptionSz;
+ unsigned short DependencySz;
+ unsigned short ProvidesSz;
+@@ -170,6 +175,7 @@
+ // Structure counts
+ unsigned long PackageCount;
+ unsigned long VersionCount;
++ unsigned long TagCount;
+ unsigned long DescriptionCount;
+ unsigned long DependsCount;
+ unsigned long PackageFileCount;
+@@ -209,6 +215,7 @@
+ map_ptrloc NextPackage; // Package
+ map_ptrloc RevDepends; // Dependency
+ map_ptrloc ProvidesList; // Provides
++ map_ptrloc TagList; // Tag
+
+ // Install/Remove/Purge etc
+ unsigned char SelectedState; // What
+@@ -248,6 +255,12 @@
+ unsigned short Size;
+ };
+ /*}}}*/
++struct pkgCache::Tag /*{{{*/
++{
++ map_ptrloc Name; // Stringtable
++ map_ptrloc NextTag; // Tag
++};
++ /*}}}*/
+ struct pkgCache::DescFile /*{{{*/
+ {
+ map_ptrloc File; // PackageFile
+@@ -340,6 +354,7 @@
+
+ typedef pkgCache::PkgIterator PkgIterator;
+ typedef pkgCache::VerIterator VerIterator;
++ typedef pkgCache::TagIterator TagIterator;
+ typedef pkgCache::DescIterator DescIterator;
+ typedef pkgCache::DepIterator DepIterator;
+ typedef pkgCache::PrvIterator PrvIterator;
diff --git a/data/apt7-lib/_metadata/in.1443.00 b/data/_apt7/timestamp.diff
index e69de29bb..e69de29bb 100644
--- a/data/apt7-lib/_metadata/in.1443.00
+++ b/data/_apt7/timestamp.diff
diff --git a/data/_apt7/tolerance.diff b/data/_apt7/tolerance.diff
new file mode 100644
index 000000000..ce2ff0adb
--- /dev/null
+++ b/data/_apt7/tolerance.diff
@@ -0,0 +1,24 @@
+diff -ru apt-0.7.20.2/apt-pkg/deb/deblistparser.cc apt-0.7.20.2+iPhone/apt-pkg/deb/deblistparser.cc
+--- apt-0.7.20.2/apt-pkg/deb/deblistparser.cc 2010-02-22 08:57:37.000000000 +0000
++++ apt-0.7.20.2+iPhone/apt-pkg/deb/deblistparser.cc 2010-02-22 09:40:28.000000000 +0000
+@@ -643,11 +643,18 @@
+ iOffset = Tags.Offset();
+ while (Tags.Step(Section) == true)
+ {
++ const char *Start;
++ const char *Stop;
++
++ if (Section.Find("Package",Start,Stop) == false) {
++ _error->Warning("Encountered a section with no Package: header");
++ continue;
++ }
++
+ /* See if this is the correct Architecture, if it isn't then we
+ drop the whole section. A missing arch tag only happens (in theory)
+ inside the Status file, so that is a positive return */
+- const char *Start;
+- const char *Stop;
++
+ if (Section.Find("Architecture",Start,Stop) == false)
+ return true;
+
diff --git a/data/_apt7/tornado.diff b/data/_apt7/tornado.diff
new file mode 100644
index 000000000..e276f3356
--- /dev/null
+++ b/data/_apt7/tornado.diff
@@ -0,0 +1,719 @@
+diff -Nru apt-0.7.25.3/apt-pkg/contrib/md5.cc apt-0.7.25.3+iPhone/apt-pkg/contrib/md5.cc
+--- apt-0.7.25.3/apt-pkg/contrib/md5.cc 2010-02-01 19:44:40.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/contrib/md5.cc 2010-02-24 08:11:38.000000000 +0000
+@@ -173,6 +173,12 @@
+ memset(Sum,0,sizeof(Sum));
+ Set(Str);
+ }
++
++MD5SumValue::MD5SumValue(const srkString &Str)
++{
++ memset(Sum, 0, sizeof(Sum));
++ Set(Str);
++}
+ /*}}}*/
+ // MD5SumValue::MD5SumValue - Default constructor /*{{{*/
+ // ---------------------------------------------------------------------
+@@ -189,6 +195,11 @@
+ {
+ return Hex2Num(Str,Sum,sizeof(Sum));
+ }
++
++bool MD5SumValue::Set(const srkString &Str)
++{
++ return Hex2Num(Str,Sum,sizeof(Sum));
++}
+ /*}}}*/
+ // MD5SumValue::Value - Convert the number into a string /*{{{*/
+ // ---------------------------------------------------------------------
+diff -Nru apt-0.7.25.3/apt-pkg/contrib/md5.h apt-0.7.25.3+iPhone/apt-pkg/contrib/md5.h
+--- apt-0.7.25.3/apt-pkg/contrib/md5.h 2010-02-01 19:44:40.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/contrib/md5.h 2010-02-24 08:09:10.000000000 +0000
+@@ -29,6 +29,8 @@
+ #include <algorithm>
+ #include <stdint.h>
+
++#include <apt-pkg/srkstring.h>
++
+ using std::string;
+ using std::min;
+
+@@ -48,10 +50,12 @@
+ {for (int I = 0; I != sizeof(Sum); I++) S[I] = Sum[I];};
+ inline operator string() const {return Value();};
+ bool Set(string Str);
++ bool Set(const srkString &Str);
+ inline void Set(unsigned char S[16])
+ {for (int I = 0; I != sizeof(Sum); I++) Sum[I] = S[I];};
+
+ MD5SumValue(string Str);
++ MD5SumValue(const srkString &Str);
+ MD5SumValue();
+ };
+
+diff -Nru apt-0.7.25.3/apt-pkg/contrib/strutl.cc apt-0.7.25.3+iPhone/apt-pkg/contrib/strutl.cc
+--- apt-0.7.25.3/apt-pkg/contrib/strutl.cc 2010-02-01 19:44:40.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/contrib/strutl.cc 2010-02-24 08:13:39.000000000 +0000
+@@ -943,12 +943,17 @@
+ /* The length of the buffer must be exactly 1/2 the length of the string. */
+ bool Hex2Num(const string &Str,unsigned char *Num,unsigned int Length)
+ {
++ return Hex2Num(srkString(Str), Num, Length);
++}
++
++bool Hex2Num(const srkString &Str,unsigned char *Num,unsigned int Length)
++{
+ if (Str.length() != Length*2)
+ return false;
+
+ // Convert each digit. We store it in the same order as the string
+ int J = 0;
+- for (string::const_iterator I = Str.begin(); I != Str.end();J++, I += 2)
++ for (srkString::const_iterator I = Str.begin(); I != Str.end();J++, I += 2)
+ {
+ if (isxdigit(*I) == 0 || isxdigit(I[1]) == 0)
+ return false;
+diff -Nru apt-0.7.25.3/apt-pkg/contrib/strutl.h apt-0.7.25.3+iPhone/apt-pkg/contrib/strutl.h
+--- apt-0.7.25.3/apt-pkg/contrib/strutl.h 2010-02-01 19:44:40.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/contrib/strutl.h 2010-02-24 08:10:45.000000000 +0000
+@@ -25,6 +25,8 @@
+ #include <iostream>
+ #include <time.h>
+
++#include <apt-pkg/srkstring.h>
++
+ using std::string;
+ using std::vector;
+ using std::ostream;
+@@ -57,6 +59,7 @@
+ bool ReadMessages(int Fd, vector<string> &List);
+ bool StrToNum(const char *Str,unsigned long &Res,unsigned Len,unsigned Base = 0);
+ bool Hex2Num(const string &Str,unsigned char *Num,unsigned int Length);
++bool Hex2Num(const srkString &Str,unsigned char *Num,unsigned int Length);
+ bool TokSplitString(char Tok,char *Input,char **List,
+ unsigned long ListMax);
+ void ioprintf(ostream &out,const char *format,...) APT_FORMAT2;
+@@ -66,6 +69,7 @@
+ int tolower_ascii(int c);
+
+ #define APT_MKSTRCMP(name,func) \
++inline int name(const srkString &A,const char *B) {return func(A.Start,A.Start+A.Size,B,B+strlen(B));}; \
+ inline int name(const char *A,const char *B) {return func(A,A+strlen(A),B,B+strlen(B));}; \
+ inline int name(const char *A,const char *AEnd,const char *B) {return func(A,AEnd,B,B+strlen(B));}; \
+ inline int name(const string& A,const char *B) {return func(A.c_str(),A.c_str()+A.length(),B,B+strlen(B));}; \
+@@ -77,6 +77,7 @@
+ inline int name(const string& A,const char *B,const char *BEnd) {return func(A.c_str(),A.c_str()+A.length(),B,BEnd);};
+
+ #define APT_MKSTRCMP2(name,func) \
++inline int name(const srkString &A,const char *B) {return func(A.Start,A.Start+A.Size,B,B+strlen(B));}; \
+ inline int name(const char *A,const char *AEnd,const char *B) {return func(A,AEnd,B,B+strlen(B));}; \
+ inline int name(const string& A,const char *B) {return func(A.begin(),A.end(),B,B+strlen(B));}; \
+ inline int name(const string& A,const string& B) {return func(A.begin(),A.end(),B.begin(),B.end());}; \
+diff -Nru apt-0.7.25.3/apt-pkg/deb/deblistparser.cc apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.cc
+--- apt-0.7.25.3/apt-pkg/deb/deblistparser.cc 2010-02-24 08:53:52.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.cc 2010-02-24 08:51:50.000000000 +0000
+@@ -106,7 +106,7 @@
+ const char *Stop;
+ if (Section.Find("Priority",Start,Stop) == true)
+ {
+- if (GrabWord(string(Start,Stop-Start),PrioList,Ver->Priority) == false)
++ if (GrabWord(srkString(Start,Stop-Start),PrioList,Ver->Priority) == false)
+ Ver->Priority = pkgCache::State::Extra;
+ }
+
+@@ -144,10 +144,19 @@
+ only describe package properties */
+ string debListParser::Description()
+ {
+- if (DescriptionLanguage().empty())
+- return Section.FindS("Description");
+- else
+- return Section.FindS(("Description-" + pkgIndexFile::LanguageCode()).c_str());
++ srkString description;
++ Description(description);
++ return description;
++}
++
++void debListParser::Description(srkString &Str) {
++ const char *Start, *Stop;
++ if (!Section.Find("Description", Start, Stop))
++ if (!Section.Find(("Description-" + pkgIndexFile::LanguageCode()).c_str(), Start, Stop)) {
++ Start = NULL;
++ Stop = NULL;
++ }
++ Str.assign(Start, Stop);
+ }
+ /*}}}*/
+ // ListParser::DescriptionLanguage - Return the description lang string /*{{{*/
+@@ -157,7 +166,8 @@
+ assumed to describe original description. */
+ string debListParser::DescriptionLanguage()
+ {
+- return Section.FindS("Description").empty() ? pkgIndexFile::LanguageCode() : "";
++ const char *Start, *Stop;
++ return Section.Find("Description", Start, Stop) ? std::string() : pkgIndexFile::LanguageCode();
+ }
+ /*}}}*/
+ // ListParser::Description - Return the description_md5 MD5SumValue /*{{{*/
+@@ -168,15 +178,18 @@
+ */
+ MD5SumValue debListParser::Description_md5()
+ {
+- string value = Section.FindS("Description-md5");
+-
+- if (value.empty())
++ const char *Start;
++ const char *Stop;
++ if (!Section.Find("Description-md5", Start, Stop))
+ {
+ MD5Summation md5;
+- md5.Add((Description() + "\n").c_str());
++ srkString description;
++ Description(description);
++ md5.Add((const unsigned char *) description.Start, description.Size);
++ md5.Add("\n");
+ return md5.Result();
+ } else
+- return MD5SumValue(value);
++ return MD5SumValue(srkString(Start, Stop));
+ }
+ /*}}}*/
+ // ListParser::UsePackage - Update a package structure /*{{{*/
+@@ -286,7 +299,7 @@
+ {"deinstall",pkgCache::State::DeInstall},
+ {"purge",pkgCache::State::Purge},
+ {}};
+- if (GrabWord(string(Start,I-Start),WantList,Pkg->SelectedState) == false)
++ if (GrabWord(srkString(Start,I-Start),WantList,Pkg->SelectedState) == false)
+ return _error->Error("Malformed 1st word in the Status line");
+
+ // Isloate the next word
+@@ -302,7 +315,7 @@
+ {"hold",pkgCache::State::HoldInst},
+ {"hold-reinstreq",pkgCache::State::HoldReInstReq},
+ {}};
+- if (GrabWord(string(Start,I-Start),FlagList,Pkg->InstState) == false)
++ if (GrabWord(srkString(Start,I-Start),FlagList,Pkg->InstState) == false)
+ return _error->Error("Malformed 2nd word in the Status line");
+
+ // Isloate the last word
+@@ -324,7 +337,7 @@
+ {"post-inst-failed",pkgCache::State::HalfConfigured},
+ {"removal-failed",pkgCache::State::HalfInstalled},
+ {}};
+- if (GrabWord(string(Start,I-Start),StatusList,Pkg->CurrentState) == false)
++ if (GrabWord(srkString(Start,I-Start),StatusList,Pkg->CurrentState) == false)
+ return _error->Error("Malformed 3rd word in the Status line");
+
+ /* A Status line marks the package as indicating the current
+@@ -410,6 +423,17 @@
+ string &Package,string &Ver,
+ unsigned int &Op, bool ParseArchFlags)
+ {
++ srkString cPackage, cVer;
++ const char *Value = ParseDepends(Start, Stop, cPackage, cVer, Op, ParseArchFlags);
++ Package = cPackage;
++ Ver = cVer;
++ return Value;
++}
++
++const char *debListParser::ParseDepends(const char *Start,const char *Stop,
++ srkString &Package,srkString &Ver,
++ unsigned int &Op, bool ParseArchFlags)
++{
+ // Strip off leading space
+ for (;Start != Stop && isspace(*Start) != 0; Start++);
+
+@@ -509,7 +533,7 @@
+ Found = !Found;
+
+ if (Found == false)
+- Package = ""; /* not for this arch */
++ Package.clear(); /* not for this arch */
+ }
+
+ // Skip whitespace
+@@ -541,8 +565,8 @@
+ if (Section.Find(Tag,Start,Stop) == false)
+ return true;
+
+- string Package;
+- string Version;
++ srkString Package;
++ srkString Version;
+ unsigned int Op;
+
+ while (1)
+@@ -569,8 +593,8 @@
+ if (Section.Find("Provides",Start,Stop) == false)
+ return true;
+
+- string Package;
+- string Version;
++ srkString Package;
++ srkString Version;
+ unsigned int Op;
+
+ while (1)
+@@ -579,7 +603,7 @@
+ if (Start == 0)
+ return _error->Error("Problem parsing Provides line");
+ if (Op != pkgCache::Dep::NoOp) {
+- _error->Warning("Ignoring Provides line with DepCompareOp for package %s", Package.c_str());
++ _error->Warning("Ignoring Provides line with DepCompareOp for package %s", std::string(Package).c_str());
+ } else {
+ if (NewProvides(Ver,Package,Version) == false)
+ return false;
+@@ -637,9 +661,14 @@
+ /* Looks for a word in a list of words - for ParseStatus */
+ bool debListParser::GrabWord(string Word,WordList *List,unsigned char &Out)
+ {
++ return GrabWord(srkString(Word), List, Out);
++}
++
++bool debListParser::GrabWord(const srkString &Word,WordList *List,unsigned char &Out)
++{
+ for (unsigned int C = 0; List[C].Str != 0; C++)
+ {
+- if (strcasecmp(Word.c_str(),List[C].Str) == 0)
++ if (strncasecmp(Word.Start,List[C].Str,Word.Size) == 0)
+ {
+ Out = List[C].Val;
+ return true;
+diff -Nru apt-0.7.25.3/apt-pkg/deb/deblistparser.h apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.h
+--- apt-0.7.25.3/apt-pkg/deb/deblistparser.h 2010-02-24 08:53:52.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.h 2010-02-24 08:43:20.000000000 +0000
+@@ -41,9 +41,22 @@
+ bool ParseProvides(pkgCache::VerIterator Ver);
+ bool ParseTag(pkgCache::PkgIterator Pkg);
+ static bool GrabWord(string Word,WordList *List,unsigned char &Out);
++ static bool GrabWord(const srkString &Word,WordList *List,unsigned char &Out);
+
+ public:
+
++ srkString Find(const char *Tag) {
++ srkString S;
++ const char *Stop;
++ if (Section.Find(Tag, S.Start, Stop))
++ S.Size = Stop - S.Start;
++ else {
++ S.Start = NULL;
++ S.Size = 0;
++ }
++ return S;
++ }
++
+ static unsigned char GetPrio(string Str);
+
+ // These all operate against the current section
+@@ -51,6 +64,7 @@
+ virtual string Version();
+ virtual bool NewVersion(pkgCache::VerIterator Ver);
+ virtual string Description();
++ void Description(srkString &Str);
+ virtual string DescriptionLanguage();
+ virtual MD5SumValue Description_md5();
+ virtual unsigned short VersionHash();
+@@ -67,6 +81,9 @@
+ static const char *ParseDepends(const char *Start,const char *Stop,
+ string &Package,string &Ver,unsigned int &Op,
+ bool ParseArchFlags = false);
++ static const char *ParseDepends(const char *Start,const char *Stop,
++ srkString &Package,srkString &Ver,unsigned int &Op,
++ bool ParseArchFlags = false);
+ static const char *ConvertRelation(const char *I,unsigned int &Op);
+
+ debListParser(FileFd *File);
+diff -Nru apt-0.7.25.3/apt-pkg/makefile apt-0.7.25.3+iPhone/apt-pkg/makefile
+--- apt-0.7.25.3/apt-pkg/makefile 2010-02-24 08:53:52.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/makefile 2010-02-24 07:57:37.000000000 +0000
+@@ -42,7 +42,7 @@
+ acquire.h acquire-worker.h acquire-item.h acquire-method.h \
+ clean.h srcrecords.h cachefile.h versionmatch.h policy.h \
+ pkgsystem.h indexfile.h metaindex.h indexrecords.h vendor.h \
+- vendorlist.h cdrom.h indexcopy.h aptconfiguration.h
++ vendorlist.h cdrom.h indexcopy.h aptconfiguration.h srkstring.h
+
+ # Source code for the debian specific components
+ # In theory the deb headers do not need to be exported..
+diff -Nru apt-0.7.25.3/apt-pkg/pkgcache.cc apt-0.7.25.3+iPhone/apt-pkg/pkgcache.cc
+--- apt-0.7.25.3/apt-pkg/pkgcache.cc 2010-02-24 08:53:52.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/pkgcache.cc 2010-02-24 08:51:28.000000000 +0000
+@@ -176,12 +176,25 @@
+ return Hash % _count(HeaderP->HashTable);
+ }
+
++unsigned long pkgCache::sHash(const srkString &Str) const
++{
++ unsigned long Hash = 0;
++ for (const char *I = Str.Start, *E = I + Str.Size; I != E; I++)
++ Hash = 5*Hash + tolower_ascii(*I);
++ return Hash % _count(HeaderP->HashTable);
++}
++
+ /*}}}*/
+ // Cache::FindPkg - Locate a package by name /*{{{*/
+ // ---------------------------------------------------------------------
+ /* Returns 0 on error, pointer to the package otherwise */
+ pkgCache::PkgIterator pkgCache::FindPkg(const string &Name)
+ {
++ return FindPkg(srkString(Name));
++}
++
++pkgCache::PkgIterator pkgCache::FindPkg(const srkString &Name)
++{
+ // Look at the hash bucket
+ Package *Pkg = PkgP + HeaderP->HashTable[Hash(Name)];
+ for (; Pkg != PkgP; Pkg = PkgP + Pkg->NextPackage)
+diff -Nru apt-0.7.25.3/apt-pkg/pkgcachegen.cc apt-0.7.25.3+iPhone/apt-pkg/pkgcachegen.cc
+--- apt-0.7.25.3/apt-pkg/pkgcachegen.cc 2010-02-24 08:53:52.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/pkgcachegen.cc 2010-02-24 08:50:06.000000000 +0000
+@@ -33,6 +33,8 @@
+ #include <unistd.h>
+ #include <errno.h>
+ #include <stdio.h>
++
++#include <apt-pkg/deblistparser.h>
+ /*}}}*/
+ typedef vector<pkgIndexFile *>::iterator FileIterator;
+
+@@ -103,26 +105,37 @@
+ pkgCache::VerIterator *OutVer)
+ {
+ List.Owner = this;
++ debListParser *debian(dynamic_cast<debListParser *>(&List));
+
+ unsigned int Counter = 0;
+ while (List.Step() == true)
+ {
+ // Get a pointer to the package structure
+- string PackageName = List.Package();
++ srkString PackageName;
++ if (debian != NULL)
++ PackageName = debian->Find("Package");
++ else
++ PackageName = List.Package();
+ if (PackageName.empty() == true)
+ return false;
+
+ pkgCache::PkgIterator Pkg;
+ if (NewPackage(Pkg,PackageName) == false)
+- return _error->Error(_("Error occurred while processing %s (NewPackage)"),PackageName.c_str());
++ return _error->Error(_("Error occurred while processing %s (NewPackage)"),std::string(PackageName).c_str());
+ Counter++;
+ if (Counter % 100 == 0 && Progress != 0)
+ Progress->Progress(List.Offset());
+
++ string language(List.DescriptionLanguage());
++
+ /* Get a pointer to the version structure. We know the list is sorted
+ so we use that fact in the search. Insertion of new versions is
+ done with correct sorting */
+- string Version = List.Version();
++ srkString Version;
++ if (debian != NULL)
++ Version = debian->Find("Version");
++ else
++ Version = List.Version();
+ if (Version.empty() == true)
+ {
+ // we first process the package, then the descriptions
+@@ -130,7 +143,7 @@
+ // of MMap space)
+ if (List.UsePackage(Pkg,pkgCache::VerIterator(Cache)) == false)
+ return _error->Error(_("Error occurred while processing %s (UsePackage1)"),
+- PackageName.c_str());
++ std::string(PackageName).c_str());
+
+ // Find the right version to write the description
+ MD5SumValue CurMd5 = List.Description_md5();
+@@ -147,7 +160,7 @@
+ // md5 && language
+ for ( ; Desc.end() == false; Desc++)
+ if (MD5SumValue(Desc.md5()) == CurMd5 &&
+- Desc.LanguageCode() == List.DescriptionLanguage())
++ Desc.LanguageCode() == language)
+ duplicate=true;
+ if(duplicate)
+ continue;
+@@ -159,11 +172,11 @@
+ if (MD5SumValue(Desc.md5()) == CurMd5)
+ {
+ // Add new description
+- *LastDesc = NewDescription(Desc, List.DescriptionLanguage(), CurMd5, *LastDesc);
++ *LastDesc = NewDescription(Desc, language, CurMd5, *LastDesc);
+ Desc->ParentPkg = Pkg.Index();
+
+ if ((*LastDesc == 0 && _error->PendingError()) || NewFileDesc(Desc,List) == false)
+- return _error->Error(_("Error occurred while processing %s (NewFileDesc1)"),PackageName.c_str());
++ return _error->Error(_("Error occurred while processing %s (NewFileDesc1)"),std::string(PackageName).c_str());
+ break;
+ }
+ }
+@@ -189,11 +202,11 @@
+ {
+ if (List.UsePackage(Pkg,Ver) == false)
+ return _error->Error(_("Error occurred while processing %s (UsePackage2)"),
+- PackageName.c_str());
++ std::string(PackageName).c_str());
+
+ if (NewFileVer(Ver,List) == false)
+ return _error->Error(_("Error occurred while processing %s (NewFileVer1)"),
+- PackageName.c_str());
++ std::string(PackageName).c_str());
+
+ // Read only a single record and return
+ if (OutVer != 0)
+@@ -224,15 +237,15 @@
+
+ if ((*LastVer == 0 && _error->PendingError()) || List.NewVersion(Ver) == false)
+ return _error->Error(_("Error occurred while processing %s (NewVersion1)"),
+- PackageName.c_str());
++ std::string(PackageName).c_str());
+
+ if (List.UsePackage(Pkg,Ver) == false)
+ return _error->Error(_("Error occurred while processing %s (UsePackage3)"),
+- PackageName.c_str());
++ std::string(PackageName).c_str());
+
+ if (NewFileVer(Ver,List) == false)
+ return _error->Error(_("Error occurred while processing %s (NewVersion2)"),
+- PackageName.c_str());
++ std::string(PackageName).c_str());
+
+ // Read only a single record and return
+ if (OutVer != 0)
+@@ -251,11 +264,11 @@
+ for (; Desc.end() == false; LastDesc = &Desc->NextDesc, Desc++);
+
+ // Add new description
+- *LastDesc = NewDescription(Desc, List.DescriptionLanguage(), List.Description_md5(), *LastDesc);
++ *LastDesc = NewDescription(Desc, language, List.Description_md5(), *LastDesc);
+ Desc->ParentPkg = Pkg.Index();
+
+ if ((*LastDesc == 0 && _error->PendingError()) || NewFileDesc(Desc,List) == false)
+- return _error->Error(_("Error occurred while processing %s (NewFileDesc2)"),PackageName.c_str());
++ return _error->Error(_("Error occurred while processing %s (NewFileDesc2)"),std::string(PackageName).c_str());
+ }
+
+ FoundFileDeps |= List.HasFileDeps();
+@@ -328,6 +341,11 @@
+ /* This creates a new package structure and adds it to the hash table */
+ bool pkgCacheGenerator::NewPackage(pkgCache::PkgIterator &Pkg,const string &Name)
+ {
++ return NewPackage(Pkg, srkString(Name));
++}
++
++bool pkgCacheGenerator::NewPackage(pkgCache::PkgIterator &Pkg,const srkString &Name)
++{
+ Pkg = Cache.FindPkg(Name);
+ if (Pkg.end() == false)
+ return true;
+@@ -345,7 +363,7 @@
+ Cache.HeaderP->HashTable[Hash] = Package;
+
+ // Set the name and the ID
+- Pkg->Name = Map.WriteString(Name);
++ Pkg->Name = Map.WriteString(Name.Start,Name.Size);
+ if (Pkg->Name == 0)
+ return false;
+ Pkg->ID = Cache.HeaderP->PackageCount++;
+@@ -393,6 +411,13 @@
+ const string &VerStr,
+ unsigned long Next)
+ {
++ return NewVersion(Ver, srkString(VerStr), Next);
++}
++
++unsigned long pkgCacheGenerator::NewVersion(pkgCache::VerIterator &Ver,
++ const srkString &VerStr,
++ unsigned long Next)
++{
+ // Get a structure
+ unsigned long Version = Map.Allocate(sizeof(pkgCache::Version));
+ if (Version == 0)
+@@ -402,7 +427,7 @@
+ Ver = pkgCache::VerIterator(Cache,Cache.VerP + Version);
+ Ver->NextVer = Next;
+ Ver->ID = Cache.HeaderP->VersionCount++;
+- Ver->VerStr = Map.WriteString(VerStr);
++ Ver->VerStr = Map.WriteString(VerStr.Start, VerStr.Size);
+ if (Ver->VerStr == 0)
+ return 0;
+
+@@ -478,6 +503,15 @@
+ unsigned int Op,
+ unsigned int Type)
+ {
++ return NewDepends(Ver, srkString(PackageName), srkString(Version), Op, Type);
++}
++
++bool pkgCacheGenerator::ListParser::NewDepends(pkgCache::VerIterator Ver,
++ const srkString &PackageName,
++ const srkString &Version,
++ unsigned int Op,
++ unsigned int Type)
++{
+ pkgCache &Cache = Owner->Cache;
+
+ // Get a structure
+@@ -541,6 +575,13 @@
+ const string &PackageName,
+ const string &Version)
+ {
++ return NewProvides(Ver, srkString(PackageName), srkString(Version));
++}
++
++bool pkgCacheGenerator::ListParser::NewProvides(pkgCache::VerIterator Ver,
++ const srkString &PackageName,
++ const srkString &Version)
++{
+ pkgCache &Cache = Owner->Cache;
+
+ // We do not add self referencing provides
+diff -Nru apt-0.7.25.3/apt-pkg/pkgcachegen.h apt-0.7.25.3+iPhone/apt-pkg/pkgcachegen.h
+--- apt-0.7.25.3/apt-pkg/pkgcachegen.h 2010-02-24 08:53:52.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/pkgcachegen.h 2010-02-24 08:49:18.000000000 +0000
+@@ -52,9 +52,11 @@
+ bool FoundFileDeps;
+
+ bool NewPackage(pkgCache::PkgIterator &Pkg,const string &PkgName);
++ bool NewPackage(pkgCache::PkgIterator &Pkg,const srkString &PkgName);
+ bool NewFileVer(pkgCache::VerIterator &Ver,ListParser &List);
+ bool NewFileDesc(pkgCache::DescIterator &Desc,ListParser &List);
+ unsigned long NewVersion(pkgCache::VerIterator &Ver,const string &VerStr,unsigned long Next);
++ unsigned long NewVersion(pkgCache::VerIterator &Ver,const srkString &VerStr,unsigned long Next);
+ map_ptrloc NewDescription(pkgCache::DescIterator &Desc,const string &Lang,const MD5SumValue &md5sum,map_ptrloc Next);
+
+ public:
+@@ -96,11 +98,17 @@
+ inline unsigned long WriteUniqString(const char *S,unsigned int Size) {return Owner->WriteUniqString(S,Size);};
+ inline unsigned long WriteString(const string &S) {return Owner->Map.WriteString(S);};
+ inline unsigned long WriteString(const char *S,unsigned int Size) {return Owner->Map.WriteString(S,Size);};
++ inline unsigned long WriteString(const srkString &S) {return Owner->Map.WriteString(S.Start,S.Size);};
+ bool NewDepends(pkgCache::VerIterator Ver,const string &Package,
+ const string &Version,unsigned int Op,
+ unsigned int Type);
++ bool NewDepends(pkgCache::VerIterator Ver,const srkString &Package,
++ const srkString &Version,unsigned int Op,
++ unsigned int Type);
+ bool NewProvides(pkgCache::VerIterator Ver,const string &Package,
+ const string &Version);
++ bool NewProvides(pkgCache::VerIterator Ver,const srkString &Package,
++ const srkString &Version);
+ bool NewTag(pkgCache::PkgIterator Pkg,const char *NameStart,unsigned int NameSize);
+
+ public:
+diff -Nru apt-0.7.25.3/apt-pkg/pkgcache.h apt-0.7.25.3+iPhone/apt-pkg/pkgcache.h
+--- apt-0.7.25.3/apt-pkg/pkgcache.h 2010-02-24 08:53:52.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/pkgcache.h 2010-02-24 07:57:37.000000000 +0000
+@@ -23,9 +23,10 @@
+ #include <string>
+ #include <time.h>
+ #include <apt-pkg/mmap.h>
++#include <apt-pkg/srkstring.h>
+
+ using std::string;
+-
++
+ class pkgVersioningSystem;
+ class pkgCache /*{{{*/
+ {
+@@ -102,6 +103,7 @@
+
+ unsigned long sHash(const string &S) const;
+ unsigned long sHash(const char *S) const;
++ unsigned long sHash(const srkString &S) const;
+
+ public:
+
+@@ -127,12 +129,14 @@
+ // String hashing function (512 range)
+ inline unsigned long Hash(const string &S) const {return sHash(S);};
+ inline unsigned long Hash(const char *S) const {return sHash(S);};
++ inline unsigned long Hash(const srkString &S) const {return sHash(S);};
+
+ // Usefull transformation things
+ const char *Priority(unsigned char Priority);
+
+ // Accessors
+ PkgIterator FindPkg(const string &Name);
++ PkgIterator FindPkg(const srkString &Name);
+ Header &Head() {return *HeaderP;};
+ inline PkgIterator PkgBegin();
+ inline PkgIterator PkgEnd();
+diff -Nru apt-0.7.25.3/apt-pkg/srkstring.h apt-0.7.25.3+iPhone/apt-pkg/srkstring.h
+--- apt-0.7.25.3/apt-pkg/srkstring.h 1970-01-01 00:00:00.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/srkstring.h 2010-02-24 08:37:27.000000000 +0000
+@@ -0,0 +1,59 @@
++// -*- mode: cpp; mode: fold -*-
++// Description /*{{{*/
++// $Id: pkgcache.h,v 1.25 2001/07/01 22:28:24 jgg Exp $
++/* ######################################################################
++
++ Cache - Structure definitions for the cache file
++
++ Please see doc/apt-pkg/cache.sgml for a more detailed description of
++ this format. Also be sure to keep that file up-to-date!!
++
++ Clients should always use the CacheIterators classes for access to the
++ cache. They provide a simple STL-like method for traversing the links
++ of the datastructure.
++
++ See pkgcachegen.h for information about generating cache structures.
++
++ ##################################################################### */
++ /*}}}*/
++#ifndef PKGLIB_PKGSTRING_H
++#define PKGLIB_PKGSTRING_H
++
++#include <string>
++
++class srkString
++{
++ public:
++ const char *Start;
++ size_t Size;
++
++ srkString() : Start(NULL), Size(0) {}
++
++ srkString(const char *Start, size_t Size) : Start(Start), Size(Size) {}
++ srkString(const char *Start, const char *Stop) : Start(Start), Size(Stop - Start) {}
++ srkString(const std::string &string) : Start(string.c_str()), Size(string.size()) {}
++
++ bool empty() const { return Size == 0; }
++ void clear() { Start = NULL; Size = 0; }
++
++ void assign(const char *nStart, const char *nStop) { Start = nStart; Size = nStop - nStart; }
++ void assign(const char *nStart, size_t nSize) { Start = nStart; Size = nSize; }
++
++ size_t length() const { return Size; }
++ size_t size() const { return Size; }
++
++ typedef const char *const_iterator;
++ const char *begin() const { return Start; }
++ const char *end() const { return Start + Size; }
++
++ char operator [](size_t index) const { return Start[index]; }
++
++ operator std::string() { std::string Str; Str.assign(Start, Size); return Str; }
++};
++
++int stringcmp(const std::string &lhs, const char *rhsb, const char *rhse);
++inline bool operator ==(const std::string &lhs, const srkString &rhs) {
++ return stringcmp(lhs, rhs.begin(), rhs.end()) == 0;
++}
++
++#endif
+diff -Nru apt-0.7.25.3/apt-pkg/version.h apt-0.7.25.3+iPhone/apt-pkg/version.h
+--- apt-0.7.25.3/apt-pkg/version.h 2010-02-01 19:44:40.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/version.h 2010-02-24 07:57:37.000000000 +0000
+@@ -20,7 +20,7 @@
+ #ifndef PKGLIB_VERSION_H
+ #define PKGLIB_VERSION_H
+
+-
++#include <apt-pkg/srkstring.h>
+ #include <apt-pkg/strutl.h>
+ #include <string>
+
diff --git a/data/_apt7/torque.diff b/data/_apt7/torque.diff
new file mode 100644
index 000000000..e93870d64
--- /dev/null
+++ b/data/_apt7/torque.diff
@@ -0,0 +1,147 @@
+diff -ru apt-0.7.25.3/apt-pkg/deb/deblistparser.cc apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.cc
+--- apt-0.7.25.3/apt-pkg/deb/deblistparser.cc 2011-05-27 06:16:43.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.cc 2011-05-27 06:17:16.000000000 +0000
+@@ -572,8 +572,10 @@
+ while (1)
+ {
+ Start = ParseDepends(Start,Stop,Package,Version,Op);
+- if (Start == 0)
+- return _error->Error("Problem parsing dependency %s",Tag);
++ if (Start == 0) {
++ _error->Warning("Problem parsing dependency %s",Tag);
++ return false;
++ }
+
+ if (NewDepends(Ver,Package,Version,Op,Type) == false)
+ return false;
+@@ -600,8 +602,11 @@
+ while (1)
+ {
+ Start = ParseDepends(Start,Stop,Package,Version,Op);
+- if (Start == 0)
+- return _error->Error("Problem parsing Provides line");
++ if (Start == 0) {
++ _error->Warning("Problem parsing Provides line");
++ return false;
++ }
++
+ if (Op != pkgCache::Dep::NoOp) {
+ _error->Warning("Ignoring Provides line with DepCompareOp for package %s", std::string(Package).c_str());
+ } else {
+diff -ru apt-0.7.25.3/apt-pkg/pkgcachegen.cc apt-0.7.25.3+iPhone/apt-pkg/pkgcachegen.cc
+--- apt-0.7.25.3/apt-pkg/pkgcachegen.cc 2011-05-27 06:16:43.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/pkgcachegen.cc 2011-05-27 06:17:16.000000000 +0000
+@@ -108,6 +108,7 @@
+ debListParser *debian(dynamic_cast<debListParser *>(&List));
+
+ unsigned int Counter = 0;
++ step:
+ while (List.Step() == true)
+ {
+ // Get a pointer to the package structure
+@@ -120,8 +121,11 @@
+ return false;
+
+ pkgCache::PkgIterator Pkg;
+- if (NewPackage(Pkg,PackageName) == false)
+- return _error->Error(_("Error occurred while processing %s (NewPackage)"),std::string(PackageName).c_str());
++ if (NewPackage(Pkg,PackageName) == false) {
++ _error->Warning(_("Error occurred while processing %s (NewPackage)"),std::string(PackageName).c_str());
++ goto step;
++ }
++
+ Counter++;
+ if (Counter % 100 == 0 && Progress != 0)
+ Progress->Progress(List.Offset());
+@@ -141,9 +145,11 @@
+ // we first process the package, then the descriptions
+ // (this has the bonus that we get MMap error when we run out
+ // of MMap space)
+- if (List.UsePackage(Pkg,pkgCache::VerIterator(Cache)) == false)
+- return _error->Error(_("Error occurred while processing %s (UsePackage1)"),
++ if (List.UsePackage(Pkg,pkgCache::VerIterator(Cache)) == false) {
++ _error->Warning(_("Error occurred while processing %s (UsePackage1)"),
+ std::string(PackageName).c_str());
++ goto step;
++ }
+
+ // Find the right version to write the description
+ MD5SumValue CurMd5 = List.Description_md5();
+@@ -175,8 +181,10 @@
+ *LastDesc = NewDescription(Desc, language, CurMd5, *LastDesc);
+ Desc->ParentPkg = Pkg.Index();
+
+- if ((*LastDesc == 0 && _error->PendingError()) || NewFileDesc(Desc,List) == false)
+- return _error->Error(_("Error occurred while processing %s (NewFileDesc1)"),std::string(PackageName).c_str());
++ if ((*LastDesc == 0 && _error->PendingError()) || NewFileDesc(Desc,List) == false) {
++ _error->Warning(_("Error occurred while processing %s (NewFileDesc1)"),std::string(PackageName).c_str());
++ goto step;
++ }
+ break;
+ }
+ }
+@@ -200,13 +208,17 @@
+ unsigned long Hash = List.VersionHash();
+ if (Res == 0 && Ver->Hash == Hash)
+ {
+- if (List.UsePackage(Pkg,Ver) == false)
+- return _error->Error(_("Error occurred while processing %s (UsePackage2)"),
++ if (List.UsePackage(Pkg,Ver) == false) {
++ _error->Warning(_("Error occurred while processing %s (UsePackage2)"),
+ std::string(PackageName).c_str());
++ goto step;
++ }
+
+- if (NewFileVer(Ver,List) == false)
+- return _error->Error(_("Error occurred while processing %s (NewFileVer1)"),
++ if (NewFileVer(Ver,List) == false) {
++ _error->Warning(_("Error occurred while processing %s (NewFileVer1)"),
+ std::string(PackageName).c_str());
++ goto step;
++ }
+
+ // Read only a single record and return
+ if (OutVer != 0)
+@@ -235,17 +247,23 @@
+ Ver->ParentPkg = Pkg.Index();
+ Ver->Hash = Hash;
+
+- if ((*LastVer == 0 && _error->PendingError()) || List.NewVersion(Ver) == false)
+- return _error->Error(_("Error occurred while processing %s (NewVersion1)"),
++ if ((*LastVer == 0 && _error->PendingError()) || List.NewVersion(Ver) == false) {
++ _error->Warning(_("Error occurred while processing %s (NewVersion1)"),
+ std::string(PackageName).c_str());
++ goto step;
++ }
+
+- if (List.UsePackage(Pkg,Ver) == false)
+- return _error->Error(_("Error occurred while processing %s (UsePackage3)"),
++ if (List.UsePackage(Pkg,Ver) == false) {
++ _error->Warning(_("Error occurred while processing %s (UsePackage3)"),
+ std::string(PackageName).c_str());
++ goto step;
++ }
+
+- if (NewFileVer(Ver,List) == false)
+- return _error->Error(_("Error occurred while processing %s (NewVersion2)"),
++ if (NewFileVer(Ver,List) == false) {
++ _error->Warning(_("Error occurred while processing %s (NewVersion2)"),
+ std::string(PackageName).c_str());
++ goto step;
++ }
+
+ // Read only a single record and return
+ if (OutVer != 0)
+@@ -267,8 +285,10 @@
+ *LastDesc = NewDescription(Desc, language, List.Description_md5(), *LastDesc);
+ Desc->ParentPkg = Pkg.Index();
+
+- if ((*LastDesc == 0 && _error->PendingError()) || NewFileDesc(Desc,List) == false)
+- return _error->Error(_("Error occurred while processing %s (NewFileDesc2)"),std::string(PackageName).c_str());
++ if ((*LastDesc == 0 && _error->PendingError()) || NewFileDesc(Desc,List) == false) {
++ _error->Warning(_("Error occurred while processing %s (NewFileDesc2)"),std::string(PackageName).c_str());
++ goto step;
++ }
+ }
+
+ FoundFileDeps |= List.HasFileDeps();
diff --git a/data/_apt7/turbulence.diff b/data/_apt7/turbulence.diff
new file mode 100644
index 000000000..0f80e2bd1
--- /dev/null
+++ b/data/_apt7/turbulence.diff
@@ -0,0 +1,64 @@
+diff -ru apt-0.7.25.3/apt-pkg/pkgcachegen.cc apt-0.7.25.3+iPhone/apt-pkg/pkgcachegen.cc
+--- apt-0.7.25.3/apt-pkg/pkgcachegen.cc 2014-05-13 10:14:37.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/pkgcachegen.cc 2014-05-13 08:54:35.000000000 +0000
+@@ -296,7 +296,7 @@
+ if (Cache.HeaderP->PackageCount >= (1ULL<<sizeof(Cache.PkgP->ID)*8)-1)
+ return _error->Error(_("Wow, you exceeded the number of package "
+ "names this APT is capable of."));
+- if (Cache.HeaderP->VersionCount >= (1ULL<<(sizeof(Cache.VerP->ID)*8))-1)
++ if (Cache.HeaderP->VersionCount >= (1ULL<<(sizeof(Cache.VerP->ID1)*8+sizeof(Cache.VerP->ID2)*8))-1)
+ return _error->Error(_("Wow, you exceeded the number of versions "
+ "this APT is capable of."));
+ if (Cache.HeaderP->DescriptionCount >= (1ULL<<(sizeof(Cache.DescP->ID)*8))-1)
+@@ -446,7 +446,9 @@
+ // Fill it in
+ Ver = pkgCache::VerIterator(Cache,Cache.VerP + Version);
+ Ver->NextVer = Next;
+- Ver->ID = Cache.HeaderP->VersionCount++;
++ unsigned int ID = Cache.HeaderP->VersionCount++;
++ Ver->ID1 = ID & 0xffff;
++ Ver->ID2 = ID >> 16;
+ Ver->VerStr = Map.WriteString(VerStr.Start, VerStr.Size);
+ if (Ver->VerStr == 0)
+ return 0;
+diff -ru apt-0.7.25.3/apt-pkg/pkgcache.h apt-0.7.25.3+iPhone/apt-pkg/pkgcache.h
+--- apt-0.7.25.3/apt-pkg/pkgcache.h 2014-05-13 10:14:37.000000000 +0000
++++ apt-0.7.25.3+iPhone/apt-pkg/pkgcache.h 2014-05-13 10:17:33.000000000 +0000
+@@ -226,7 +226,7 @@
+ unsigned char InstState; // Flags
+ unsigned char CurrentState; // State
+
+- unsigned short ID;
++ unsigned int ID;
+ unsigned long Flags;
+ };
+
+@@ -247,7 +247,7 @@
+
+ // Linked list
+ map_ptrloc NextFile; // PackageFile
+- unsigned short ID;
++ unsigned int ID;
+ time_t mtime; // Modification time for the file
+ };
+ /*}}}*/
+@@ -291,8 +291,9 @@
+ map_ptrloc Size; // These are the .deb size
+ map_ptrloc InstalledSize;
+ unsigned short Hash;
+- unsigned short ID;
++ unsigned short ID1;
+ unsigned char Priority;
++ unsigned short ID2;
+ };
+ /*}}}*/
+ struct pkgCache::Description /*{{{*/
+@@ -308,7 +309,7 @@
+ map_ptrloc NextDesc; // Description
+ map_ptrloc ParentPkg; // Package
+
+- unsigned short ID;
++ unsigned int ID;
+ };
+ /*}}}*/
+ struct pkgCache::Dependency /*{{{*/
diff --git a/data/apt-key/_metadata/_apt1.4.dep b/data/apt-key/_metadata/_apt1.4.dep
new file mode 120000
index 000000000..902259693
--- /dev/null
+++ b/data/apt-key/_metadata/_apt1.4.dep
@@ -0,0 +1 @@
+../../_apt1.4 \ No newline at end of file
diff --git a/data/apt-key/_metadata/breaks b/data/apt-key/_metadata/breaks
new file mode 100644
index 000000000..9e36532b4
--- /dev/null
+++ b/data/apt-key/_metadata/breaks
@@ -0,0 +1 @@
+apt7-key
diff --git a/data/apt-key/_metadata/conflicts b/data/apt-key/_metadata/conflicts
new file mode 100644
index 000000000..9e36532b4
--- /dev/null
+++ b/data/apt-key/_metadata/conflicts
@@ -0,0 +1 @@
+apt7-key
diff --git a/data/apt7-key/_metadata/coreutils.dep b/data/apt-key/_metadata/coreutils.dep
index 5bd43c1eb..5bd43c1eb 120000
--- a/data/apt7-key/_metadata/coreutils.dep
+++ b/data/apt-key/_metadata/coreutils.dep
diff --git a/data/apt-key/_metadata/description b/data/apt-key/_metadata/description
new file mode 100644
index 000000000..7fffa142f
--- /dev/null
+++ b/data/apt-key/_metadata/description
@@ -0,0 +1 @@
+repository encryption key management tool
diff --git a/data/apt7/_metadata/in.1443.00 b/data/apt-key/_metadata/in.1443.00
index e69de29bb..e69de29bb 100644
--- a/data/apt7/_metadata/in.1443.00
+++ b/data/apt-key/_metadata/in.1443.00
diff --git a/data/apt-key/_metadata/libapt.dep b/data/apt-key/_metadata/libapt.dep
new file mode 120000
index 000000000..280bf477b
--- /dev/null
+++ b/data/apt-key/_metadata/libapt.dep
@@ -0,0 +1 @@
+../../libapt \ No newline at end of file
diff --git a/data/apt-key/_metadata/license b/data/apt-key/_metadata/license
new file mode 120000
index 000000000..4f7d70f3f
--- /dev/null
+++ b/data/apt-key/_metadata/license
@@ -0,0 +1 @@
+../../_apt1.4/_metadata/license \ No newline at end of file
diff --git a/data/apt-key/_metadata/maintainer b/data/apt-key/_metadata/maintainer
new file mode 120000
index 000000000..52845be09
--- /dev/null
+++ b/data/apt-key/_metadata/maintainer
@@ -0,0 +1 @@
+../../_apt1.4/_metadata/maintainer \ No newline at end of file
diff --git a/data/apt-key/_metadata/name b/data/apt-key/_metadata/name
new file mode 100644
index 000000000..1deb96958
--- /dev/null
+++ b/data/apt-key/_metadata/name
@@ -0,0 +1 @@
+APT (apt-key)
diff --git a/data/apt-key/_metadata/priority b/data/apt-key/_metadata/priority
new file mode 100644
index 000000000..a6a7b9cd7
--- /dev/null
+++ b/data/apt-key/_metadata/priority
@@ -0,0 +1 @@
+standard
diff --git a/data/apt-key/_metadata/replaces b/data/apt-key/_metadata/replaces
new file mode 100644
index 000000000..49716892b
--- /dev/null
+++ b/data/apt-key/_metadata/replaces
@@ -0,0 +1 @@
+apt (<< 1:0-1), apt7 (<< 0.7.20.2-4), apt7-key
diff --git a/data/apt-key/_metadata/role b/data/apt-key/_metadata/role
new file mode 100644
index 000000000..52b4d7301
--- /dev/null
+++ b/data/apt-key/_metadata/role
@@ -0,0 +1 @@
+hacker
diff --git a/data/apt-key/_metadata/section b/data/apt-key/_metadata/section
new file mode 120000
index 000000000..0c5fdc049
--- /dev/null
+++ b/data/apt-key/_metadata/section
@@ -0,0 +1 @@
+../../_apt1.4/_metadata/section \ No newline at end of file
diff --git a/data/apt-key/_metadata/tags b/data/apt-key/_metadata/tags
new file mode 100644
index 000000000..ad5d50831
--- /dev/null
+++ b/data/apt-key/_metadata/tags
@@ -0,0 +1 @@
+purpose::console
diff --git a/data/apt-key/_metadata/version b/data/apt-key/_metadata/version
new file mode 120000
index 000000000..06c5113b0
--- /dev/null
+++ b/data/apt-key/_metadata/version
@@ -0,0 +1 @@
+../../_apt1.4/_metadata/version \ No newline at end of file
diff --git a/data/apt-key/make.sh b/data/apt-key/make.sh
new file mode 100644
index 000000000..c280cbae8
--- /dev/null
+++ b/data/apt-key/make.sh
@@ -0,0 +1,2 @@
+pkg: mkdir -p /usr/bin
+cp -a "$(PKG_DEST_ _apt1.4)"/usr/bin/apt-key "${PKG_DEST}"/usr/bin
diff --git a/data/apt-rdepends/_metadata/description b/data/apt-rdepends/_metadata/description
new file mode 100644
index 000000000..2d41d5327
--- /dev/null
+++ b/data/apt-rdepends/_metadata/description
@@ -0,0 +1 @@
+a Perl script that hooks into APT and recursively finds dependencies.
diff --git a/data/apt-rdepends/_metadata/in.1443.00 b/data/apt-rdepends/_metadata/in.1443.00
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/data/apt-rdepends/_metadata/in.1443.00
diff --git a/data/apt-rdepends/_metadata/in.550.58 b/data/apt-rdepends/_metadata/in.550.58
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/data/apt-rdepends/_metadata/in.550.58
diff --git a/data/apt-rdepends/_metadata/libapt-pkg-perl.dep b/data/apt-rdepends/_metadata/libapt-pkg-perl.dep
new file mode 120000
index 000000000..db4b9514d
--- /dev/null
+++ b/data/apt-rdepends/_metadata/libapt-pkg-perl.dep
@@ -0,0 +1 @@
+../../libapt-pkg-perl \ No newline at end of file
diff --git a/data/apt-rdepends/_metadata/license b/data/apt-rdepends/_metadata/license
new file mode 120000
index 000000000..9c13a9a0f
--- /dev/null
+++ b/data/apt-rdepends/_metadata/license
@@ -0,0 +1 @@
+../../../licenses/gpl-2 \ No newline at end of file
diff --git a/data/apt-rdepends/_metadata/maintainer b/data/apt-rdepends/_metadata/maintainer
new file mode 120000
index 000000000..573d7ebef
--- /dev/null
+++ b/data/apt-rdepends/_metadata/maintainer
@@ -0,0 +1 @@
+../../../people/sbingner \ No newline at end of file
diff --git a/data/apt-rdepends/_metadata/priority b/data/apt-rdepends/_metadata/priority
new file mode 100644
index 000000000..134d9bc32
--- /dev/null
+++ b/data/apt-rdepends/_metadata/priority
@@ -0,0 +1 @@
+optional
diff --git a/data/apt-rdepends/_metadata/role b/data/apt-rdepends/_metadata/role
new file mode 100644
index 000000000..52b4d7301
--- /dev/null
+++ b/data/apt-rdepends/_metadata/role
@@ -0,0 +1 @@
+hacker
diff --git a/data/apt-rdepends/_metadata/section b/data/apt-rdepends/_metadata/section
new file mode 100644
index 000000000..ddc7f1fd8
--- /dev/null
+++ b/data/apt-rdepends/_metadata/section
@@ -0,0 +1 @@
+Scripting
diff --git a/data/apt-rdepends/_metadata/tags b/data/apt-rdepends/_metadata/tags
new file mode 100644
index 000000000..ad5d50831
--- /dev/null
+++ b/data/apt-rdepends/_metadata/tags
@@ -0,0 +1 @@
+purpose::console
diff --git a/data/apt-rdepends/_metadata/version b/data/apt-rdepends/_metadata/version
new file mode 100644
index 000000000..f0bb29e76
--- /dev/null
+++ b/data/apt-rdepends/_metadata/version
@@ -0,0 +1 @@
+1.3.0
diff --git a/data/apt-rdepends/apt-rdepends-1.3.0.tar.bz2 b/data/apt-rdepends/apt-rdepends-1.3.0.tar.bz2
new file mode 100644
index 000000000..968dca7bd
--- /dev/null
+++ b/data/apt-rdepends/apt-rdepends-1.3.0.tar.bz2
Binary files differ
diff --git a/data/apt-rdepends/make.sh b/data/apt-rdepends/make.sh
new file mode 100644
index 000000000..3294e99a9
--- /dev/null
+++ b/data/apt-rdepends/make.sh
@@ -0,0 +1,2 @@
+pkg:setup
+pkg:install
diff --git a/data/apt-rdepends/makefile.diff b/data/apt-rdepends/makefile.diff
new file mode 100644
index 000000000..731851ba2
--- /dev/null
+++ b/data/apt-rdepends/makefile.diff
@@ -0,0 +1,30 @@
+diff -ur apt-rdepends-1.3.0/Makefile apt-rdepends-1.3.0+iPhone/Makefile
+--- apt-rdepends-1.3.0/Makefile 2005-09-21 11:10:56.000000000 -1000
++++ apt-rdepends-1.3.0+iPhone/Makefile 2018-11-30 22:41:05.000000000 -1000
+@@ -21,7 +21,8 @@
+
+ SHELL = /bin/sh
+
+-prefix = /usr/local
++DESTDIR ?=
++prefix = /usr
+ exec_prefix = ${prefix}
+
+ bindir = ${exec_prefix}/bin
+@@ -36,12 +37,12 @@
+ pod2man --section=8 --release=${VERSION} --center=" " $< > $@
+
+ install :
+- mkdir -p ${bindir}; \
+- ${INSTALL} apt-rdepends ${bindir}; \
++ mkdir -p "${DESTDIR}/${bindir}"; \
++ ${INSTALL} apt-rdepends "${DESTDIR}/${bindir}"; \
+
+ install-man : all
+- mkdir -p ${mandir}/man8; \
+- ${INSTALL_DATA} apt-rdepends.8 ${mandir}/man8;
++ mkdir -p "${DESTDIR}/${mandir}/man8"; \
++ ${INSTALL_DATA} apt-rdepends.8 "${DESTDIR}/${mandir}/man8";
+
+ clean :
+ rm -f apt-rdepends.8
diff --git a/data/apt/_metadata/depends b/data/apt/_metadata/depends
index 4de6015e1..b8aab5a41 100644
--- a/data/apt/_metadata/depends
+++ b/data/apt/_metadata/depends
@@ -1 +1 @@
-apt7
+apt1.4
diff --git a/data/apt/_metadata/name b/data/apt/_metadata/name
index 2b0145427..e2367bda1 100644
--- a/data/apt/_metadata/name
+++ b/data/apt/_metadata/name
@@ -1 +1 @@
-APT 0.6 Transitional
+APT Command Line
diff --git a/data/apt1.4/_metadata/_apt1.4.dep b/data/apt1.4/_metadata/_apt1.4.dep
new file mode 120000
index 000000000..902259693
--- /dev/null
+++ b/data/apt1.4/_metadata/_apt1.4.dep
@@ -0,0 +1 @@
+../../_apt1.4 \ No newline at end of file
diff --git a/data/apt1.4/_metadata/apt-key.dep b/data/apt1.4/_metadata/apt-key.dep
new file mode 120000
index 000000000..67fe46032
--- /dev/null
+++ b/data/apt1.4/_metadata/apt-key.dep
@@ -0,0 +1 @@
+../../apt-key \ No newline at end of file
diff --git a/data/apt1.4/_metadata/berkeleydb.dep b/data/apt1.4/_metadata/berkeleydb.dep
new file mode 120000
index 000000000..f945cb1a2
--- /dev/null
+++ b/data/apt1.4/_metadata/berkeleydb.dep
@@ -0,0 +1 @@
+../../berkeleydb \ No newline at end of file
diff --git a/data/apt1.4/_metadata/conflicts b/data/apt1.4/_metadata/conflicts
new file mode 100644
index 000000000..a975dded1
--- /dev/null
+++ b/data/apt1.4/_metadata/conflicts
@@ -0,0 +1 @@
+apt7 (<<1:0)
diff --git a/data/apt1.4/_metadata/description b/data/apt1.4/_metadata/description
new file mode 100644
index 000000000..e60725012
--- /dev/null
+++ b/data/apt1.4/_metadata/description
@@ -0,0 +1 @@
+the advanced packaging tool from Debian
diff --git a/data/apt1.4/_metadata/in.1443.00 b/data/apt1.4/_metadata/in.1443.00
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/data/apt1.4/_metadata/in.1443.00
diff --git a/data/apt1.4/_metadata/libapt.dep b/data/apt1.4/_metadata/libapt.dep
new file mode 120000
index 000000000..280bf477b
--- /dev/null
+++ b/data/apt1.4/_metadata/libapt.dep
@@ -0,0 +1 @@
+../../libapt \ No newline at end of file
diff --git a/data/apt1.4/_metadata/libapt.ver.iphoneos-arm b/data/apt1.4/_metadata/libapt.ver.iphoneos-arm
new file mode 120000
index 000000000..06c5113b0
--- /dev/null
+++ b/data/apt1.4/_metadata/libapt.ver.iphoneos-arm
@@ -0,0 +1 @@
+../../_apt1.4/_metadata/version \ No newline at end of file
diff --git a/data/apt1.4/_metadata/license b/data/apt1.4/_metadata/license
new file mode 120000
index 000000000..4f7d70f3f
--- /dev/null
+++ b/data/apt1.4/_metadata/license
@@ -0,0 +1 @@
+../../_apt1.4/_metadata/license \ No newline at end of file
diff --git a/data/apt1.4/_metadata/maintainer b/data/apt1.4/_metadata/maintainer
new file mode 120000
index 000000000..52845be09
--- /dev/null
+++ b/data/apt1.4/_metadata/maintainer
@@ -0,0 +1 @@
+../../_apt1.4/_metadata/maintainer \ No newline at end of file
diff --git a/data/apt1.4/_metadata/name b/data/apt1.4/_metadata/name
new file mode 100644
index 000000000..092cf0cc3
--- /dev/null
+++ b/data/apt1.4/_metadata/name
@@ -0,0 +1 @@
+APT Strict
diff --git a/data/apt1.4/_metadata/priority b/data/apt1.4/_metadata/priority
new file mode 100644
index 000000000..a6a7b9cd7
--- /dev/null
+++ b/data/apt1.4/_metadata/priority
@@ -0,0 +1 @@
+standard
diff --git a/data/apt1.4/_metadata/role b/data/apt1.4/_metadata/role
new file mode 100644
index 000000000..52b4d7301
--- /dev/null
+++ b/data/apt1.4/_metadata/role
@@ -0,0 +1 @@
+hacker
diff --git a/data/apt1.4/_metadata/section b/data/apt1.4/_metadata/section
new file mode 120000
index 000000000..0c5fdc049
--- /dev/null
+++ b/data/apt1.4/_metadata/section
@@ -0,0 +1 @@
+../../_apt1.4/_metadata/section \ No newline at end of file
diff --git a/data/apt1.4/_metadata/tags b/data/apt1.4/_metadata/tags
new file mode 100644
index 000000000..ad5d50831
--- /dev/null
+++ b/data/apt1.4/_metadata/tags
@@ -0,0 +1 @@
+purpose::console
diff --git a/data/apt1.4/_metadata/version b/data/apt1.4/_metadata/version
new file mode 120000
index 000000000..06c5113b0
--- /dev/null
+++ b/data/apt1.4/_metadata/version
@@ -0,0 +1 @@
+../../_apt1.4/_metadata/version \ No newline at end of file
diff --git a/data/apt1.4/make.sh b/data/apt1.4/make.sh
new file mode 100644
index 000000000..2faa69113
--- /dev/null
+++ b/data/apt1.4/make.sh
@@ -0,0 +1,4 @@
+pkg: mkdir -p /usr
+cp -a "$(PKG_DEST_ _apt1.4)"/usr/bin "${PKG_DEST}"/usr
+cp -a "$(PKG_DEST_ _apt1.4)"/usr/include "${PKG_DEST}"/usr
+pkg: rm -f /usr/bin/apt-key
diff --git a/data/apt7-lib/_metadata/priority b/data/apt7-lib/_metadata/priority
index d0b3ce728..134d9bc32 100644
--- a/data/apt7-lib/_metadata/priority
+++ b/data/apt7-lib/_metadata/priority
@@ -1 +1 @@
-+required
+optional
diff --git a/data/apt7-lib/make.sh b/data/apt7-lib/make.sh
index bf5b34eaf..ca48d2df0 100644
--- a/data/apt7-lib/make.sh
+++ b/data/apt7-lib/make.sh
@@ -3,7 +3,5 @@ cp -a "$(PKG_DEST_ _apt7)"/var "${PKG_DEST}"
pkg: mkdir -p /usr
cp -a "$(PKG_DEST_ _apt7)"/usr/lib "${PKG_DEST}"/usr
-cp -a "$(PKG_DEST_ _apt7)"/usr/libexec "${PKG_DEST}"/usr
-pkg: ln -s ../libexec/apt /usr/lib/apt
-pkg: rm -f /usr/libexec/apt/methods/https
-pkg: ln -s http /usr/libexec/apt/methods/https
+pkg: rm -f /usr/lib/apt/methods/https
+pkg: ln -s http /usr/lib/apt/methods/https
diff --git a/data/apt7/_metadata/apt7-lib.ver.iphoneos-arm b/data/apt7/_metadata/apt7-lib.ver.iphoneos-arm
index ac4ae7e84..138a91ba8 120000..100644
--- a/data/apt7/_metadata/apt7-lib.ver.iphoneos-arm
+++ b/data/apt7/_metadata/apt7-lib.ver.iphoneos-arm
@@ -1 +1 @@
-../../_apt7/_metadata/version \ No newline at end of file
+0.7.25.3-7
diff --git a/data/dpkg-perl/_metadata/in.550.58 b/data/dpkg-perl/_metadata/in.550.58
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/data/dpkg-perl/_metadata/in.550.58
diff --git a/data/libapt-pkg-dev/_metadata/description b/data/libapt-pkg-dev/_metadata/description
new file mode 100644
index 000000000..6a395c66f
--- /dev/null
+++ b/data/libapt-pkg-dev/_metadata/description
@@ -0,0 +1 @@
+the advanced packaging library from Debian
diff --git a/data/libapt-pkg-dev/_metadata/in.1443.00 b/data/libapt-pkg-dev/_metadata/in.1443.00
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/data/libapt-pkg-dev/_metadata/in.1443.00
diff --git a/data/libapt-pkg-dev/_metadata/libapt-pkg5.0.dep b/data/libapt-pkg-dev/_metadata/libapt-pkg5.0.dep
new file mode 120000
index 000000000..616a9ad7f
--- /dev/null
+++ b/data/libapt-pkg-dev/_metadata/libapt-pkg5.0.dep
@@ -0,0 +1 @@
+../../libapt-pkg5.0 \ No newline at end of file
diff --git a/data/libapt-pkg-dev/_metadata/license b/data/libapt-pkg-dev/_metadata/license
new file mode 120000
index 000000000..4f7d70f3f
--- /dev/null
+++ b/data/libapt-pkg-dev/_metadata/license
@@ -0,0 +1 @@
+../../_apt1.4/_metadata/license \ No newline at end of file
diff --git a/data/libapt-pkg-dev/_metadata/maintainer b/data/libapt-pkg-dev/_metadata/maintainer
new file mode 120000
index 000000000..52845be09
--- /dev/null
+++ b/data/libapt-pkg-dev/_metadata/maintainer
@@ -0,0 +1 @@
+../../_apt1.4/_metadata/maintainer \ No newline at end of file
diff --git a/data/libapt-pkg-dev/_metadata/name b/data/libapt-pkg-dev/_metadata/name
new file mode 100644
index 000000000..04633ad5b
--- /dev/null
+++ b/data/libapt-pkg-dev/_metadata/name
@@ -0,0 +1 @@
+APT 1.4 Strict (libapt-pkg-dev)
diff --git a/data/libapt-pkg-dev/_metadata/priority b/data/libapt-pkg-dev/_metadata/priority
new file mode 100644
index 000000000..134d9bc32
--- /dev/null
+++ b/data/libapt-pkg-dev/_metadata/priority
@@ -0,0 +1 @@
+optional
diff --git a/data/libapt-pkg-dev/_metadata/provides b/data/libapt-pkg-dev/_metadata/provides
new file mode 100644
index 000000000..f4468b354
--- /dev/null
+++ b/data/libapt-pkg-dev/_metadata/provides
@@ -0,0 +1 @@
+libapt-pkg (=1.4.8)
diff --git a/data/libapt-pkg-dev/_metadata/role b/data/libapt-pkg-dev/_metadata/role
new file mode 100644
index 000000000..8d0320866
--- /dev/null
+++ b/data/libapt-pkg-dev/_metadata/role
@@ -0,0 +1 @@
+developer
diff --git a/data/libapt-pkg-dev/_metadata/section b/data/libapt-pkg-dev/_metadata/section
new file mode 100644
index 000000000..702b7b8d3
--- /dev/null
+++ b/data/libapt-pkg-dev/_metadata/section
@@ -0,0 +1 @@
+Packaging
diff --git a/data/libapt-pkg-dev/_metadata/tags b/data/libapt-pkg-dev/_metadata/tags
new file mode 100644
index 000000000..a8928cec8
--- /dev/null
+++ b/data/libapt-pkg-dev/_metadata/tags
@@ -0,0 +1 @@
+purpose::library
diff --git a/data/libapt-pkg-dev/_metadata/version b/data/libapt-pkg-dev/_metadata/version
new file mode 120000
index 000000000..06c5113b0
--- /dev/null
+++ b/data/libapt-pkg-dev/_metadata/version
@@ -0,0 +1 @@
+../../_apt1.4/_metadata/version \ No newline at end of file
diff --git a/data/libapt-pkg-dev/make.sh b/data/libapt-pkg-dev/make.sh
new file mode 100644
index 000000000..1054bd93d
--- /dev/null
+++ b/data/libapt-pkg-dev/make.sh
@@ -0,0 +1,3 @@
+pkg: mkdir -p /usr/lib /usr/include
+cp -a "$(PKG_DEST_ _apt1.4)"/usr/lib/libapt-pkg.dylib "${PKG_DEST}"/usr/lib/
+cp -a "$(PKG_DEST_ _apt1.4)"/usr/include/apt-pkg "${PKG_DEST}"/usr/include
diff --git a/data/libapt-pkg-perl/_metadata/_apt1.4.dep b/data/libapt-pkg-perl/_metadata/_apt1.4.dep
new file mode 120000
index 000000000..902259693
--- /dev/null
+++ b/data/libapt-pkg-perl/_metadata/_apt1.4.dep
@@ -0,0 +1 @@
+../../_apt1.4 \ No newline at end of file
diff --git a/data/libapt-pkg-perl/_metadata/description b/data/libapt-pkg-perl/_metadata/description
new file mode 100644
index 000000000..fa6d7daad
--- /dev/null
+++ b/data/libapt-pkg-perl/_metadata/description
@@ -0,0 +1 @@
+Perl interface to libapt-pkg
diff --git a/data/libapt-pkg-perl/_metadata/in.1443.00 b/data/libapt-pkg-perl/_metadata/in.1443.00
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/data/libapt-pkg-perl/_metadata/in.1443.00
diff --git a/data/libapt-pkg-perl/_metadata/in.550.58 b/data/libapt-pkg-perl/_metadata/in.550.58
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/data/libapt-pkg-perl/_metadata/in.550.58
diff --git a/data/libapt-pkg-perl/_metadata/libapt-pkg5.0.dep b/data/libapt-pkg-perl/_metadata/libapt-pkg5.0.dep
new file mode 120000
index 000000000..616a9ad7f
--- /dev/null
+++ b/data/libapt-pkg-perl/_metadata/libapt-pkg5.0.dep
@@ -0,0 +1 @@
+../../libapt-pkg5.0 \ No newline at end of file
diff --git a/data/libapt-pkg-perl/_metadata/license b/data/libapt-pkg-perl/_metadata/license
new file mode 100644
index 000000000..43cd72c3e
--- /dev/null
+++ b/data/libapt-pkg-perl/_metadata/license
@@ -0,0 +1,248 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 1, February 1989
+
+ Copyright (C) 1989 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The license agreements of most software companies try to keep users
+at the mercy of those companies. By contrast, our General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. The
+General Public License applies to the Free Software Foundation's
+software and to any other program whose authors commit to using it.
+You can use it for your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Specifically, the General Public License is designed to make
+sure that you have the freedom to give away or sell copies of free
+software, that you receive source code or can get it if you want it,
+that you can change the software or use pieces of it in new free
+programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of a such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must tell them their rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any program or other work which
+contains a notice placed by the copyright holder saying it may be
+distributed under the terms of this General Public License. The
+"Program", below, refers to any such program or work, and a "work based
+on the Program" means either the Program or any work containing the
+Program or a portion of it, either verbatim or with modifications. Each
+licensee is addressed as "you".
+
+ 1. You may copy and distribute verbatim copies of the Program's source
+code as you receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice and
+disclaimer of warranty; keep intact all the notices that refer to this
+General Public License and to the absence of any warranty; and give any
+other recipients of the Program a copy of this General Public License
+along with the Program. You may charge a fee for the physical act of
+transferring a copy.
+
+ 2. You may modify your copy or copies of the Program or any portion of
+it, and copy and distribute such modifications under the terms of Paragraph
+1 above, provided that you also do the following:
+
+ a) cause the modified files to carry prominent notices stating that
+ you changed the files and the date of any change; and
+
+ b) cause the whole of any work that you distribute or publish, that
+ in whole or in part contains the Program or any part thereof, either
+ with or without modifications, to be licensed at no charge to all
+ third parties under the terms of this General Public License (except
+ that you may choose to grant warranty protection to some or all
+ third parties, at your option).
+
+ c) If the modified program normally reads commands interactively when
+ run, you must cause it, when started running for such interactive use
+ in the simplest and most usual way, to print or display an
+ announcement including an appropriate copyright notice and a notice
+ that there is no warranty (or else, saying that you provide a
+ warranty) and that users may redistribute the program under these
+ conditions, and telling the user how to view a copy of this General
+ Public License.
+
+ d) You may charge a fee for the physical act of transferring a
+ copy, and you may at your option offer warranty protection in
+ exchange for a fee.
+
+Mere aggregation of another independent work with the Program (or its
+derivative) on a volume of a storage or distribution medium does not bring
+the other work under the scope of these terms.
+
+ 3. You may copy and distribute the Program (or a portion or derivative of
+it, under Paragraph 2) in object code or executable form under the terms of
+Paragraphs 1 and 2 above provided that you also do one of the following:
+
+ a) accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of
+ Paragraphs 1 and 2 above; or,
+
+ b) accompany it with a written offer, valid for at least three
+ years, to give any third party free (except for a nominal charge
+ for the cost of distribution) a complete machine-readable copy of the
+ corresponding source code, to be distributed under the terms of
+ Paragraphs 1 and 2 above; or,
+
+ c) accompany it with the information you received as to where the
+ corresponding source code may be obtained. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form alone.)
+
+Source code for a work means the preferred form of the work for making
+modifications to it. For an executable file, complete source code means
+all the source code for all modules it contains; but, as a special
+exception, it need not include source code for modules which are standard
+libraries that accompany the operating system on which the executable
+file runs, or for standard header files or definitions files that
+accompany that operating system.
+
+ 4. You may not copy, modify, sublicense, distribute or transfer the
+Program except as expressly provided under this General Public License.
+Any attempt otherwise to copy, modify, sublicense, distribute or transfer
+the Program is void, and will automatically terminate your rights to use
+the Program under this License. However, parties who have received
+copies, or rights to use copies, from you under this General Public
+License will not have their licenses terminated so long as such parties
+remain in full compliance.
+
+ 5. By copying, distributing or modifying the Program (or any work based
+on the Program) you indicate your acceptance of this license to do so,
+and all its terms and conditions.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the original
+licensor to copy, distribute or modify the Program subject to these
+terms and conditions. You may not impose any further restrictions on the
+recipients' exercise of the rights granted herein.
+
+ 7. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of the license which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+the license, you may choose any version ever published by the Free Software
+Foundation.
+
+ 8. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to humanity, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these
+terms.
+
+ To do so, attach the following notices to the program. It is safest to
+attach them to the start of each source file to most effectively convey
+the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ 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 1, 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, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19xx name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the
+appropriate parts of the General Public License. Of course, the
+commands you use may be called something other than `show w' and `show
+c'; they could even be mouse-clicks or menu items--whatever suits your
+program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ program `Gnomovision' (a program to direct compilers to make passes
+ at assemblers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/data/libapt-pkg-perl/_metadata/maintainer b/data/libapt-pkg-perl/_metadata/maintainer
new file mode 120000
index 000000000..573d7ebef
--- /dev/null
+++ b/data/libapt-pkg-perl/_metadata/maintainer
@@ -0,0 +1 @@
+../../../people/sbingner \ No newline at end of file
diff --git a/data/libapt-pkg-perl/_metadata/perl.dep b/data/libapt-pkg-perl/_metadata/perl.dep
new file mode 120000
index 000000000..899dc46ed
--- /dev/null
+++ b/data/libapt-pkg-perl/_metadata/perl.dep
@@ -0,0 +1 @@
+../../perl \ No newline at end of file
diff --git a/data/libapt-pkg-perl/_metadata/priority b/data/libapt-pkg-perl/_metadata/priority
new file mode 100644
index 000000000..134d9bc32
--- /dev/null
+++ b/data/libapt-pkg-perl/_metadata/priority
@@ -0,0 +1 @@
+optional
diff --git a/data/libapt-pkg-perl/_metadata/role b/data/libapt-pkg-perl/_metadata/role
new file mode 100644
index 000000000..52b4d7301
--- /dev/null
+++ b/data/libapt-pkg-perl/_metadata/role
@@ -0,0 +1 @@
+hacker
diff --git a/data/libapt-pkg-perl/_metadata/section b/data/libapt-pkg-perl/_metadata/section
new file mode 100644
index 000000000..ddc7f1fd8
--- /dev/null
+++ b/data/libapt-pkg-perl/_metadata/section
@@ -0,0 +1 @@
+Scripting
diff --git a/data/libapt-pkg-perl/_metadata/tags b/data/libapt-pkg-perl/_metadata/tags
new file mode 100644
index 000000000..ad5d50831
--- /dev/null
+++ b/data/libapt-pkg-perl/_metadata/tags
@@ -0,0 +1 @@
+purpose::console
diff --git a/data/libapt-pkg-perl/_metadata/version b/data/libapt-pkg-perl/_metadata/version
new file mode 100644
index 000000000..9dd179330
--- /dev/null
+++ b/data/libapt-pkg-perl/_metadata/version
@@ -0,0 +1 @@
+0.1.34
diff --git a/data/libapt-pkg-perl/libapt-pkg-perl_0.1.34.tar.xz b/data/libapt-pkg-perl/libapt-pkg-perl_0.1.34.tar.xz
new file mode 100644
index 000000000..7a9b2da60
--- /dev/null
+++ b/data/libapt-pkg-perl/libapt-pkg-perl_0.1.34.tar.xz
Binary files differ
diff --git a/data/libapt-pkg-perl/make.sh b/data/libapt-pkg-perl/make.sh
new file mode 100644
index 000000000..76479bc1a
--- /dev/null
+++ b/data/libapt-pkg-perl/make.sh
@@ -0,0 +1,8 @@
+pkg:setup
+echo 'INCLUDE = .' > config.in
+echo 'LIB = .' >> config.in
+export PERL_SRC="$(PKG_DEST_ perl)"
+$(PKG_WORK_ perl)/perl-5*/miniperl_top Makefile.PL
+env
+pkg:make CC="${PKG_TARG}-g++" CCFLAGS="-std=c++11 -stdlib=libc++" LD="${PKG_TARG}-g++" LDDLFLAGS="-shared -std=c++11 -stdlib=libc++"
+make pure_vendor_install DESTDIR="${PKG_DEST}"
diff --git a/data/libapt-pkg5.0/_metadata/_apt1.4.dep b/data/libapt-pkg5.0/_metadata/_apt1.4.dep
new file mode 120000
index 000000000..902259693
--- /dev/null
+++ b/data/libapt-pkg5.0/_metadata/_apt1.4.dep
@@ -0,0 +1 @@
+../../_apt1.4 \ No newline at end of file
diff --git a/data/libapt-pkg5.0/_metadata/bzip2.dep b/data/libapt-pkg5.0/_metadata/bzip2.dep
new file mode 120000
index 000000000..15aa44a77
--- /dev/null
+++ b/data/libapt-pkg5.0/_metadata/bzip2.dep
@@ -0,0 +1 @@
+../../bzip2 \ No newline at end of file
diff --git a/data/libapt-pkg5.0/_metadata/conflicts b/data/libapt-pkg5.0/_metadata/conflicts
new file mode 100644
index 000000000..d8164dce9
--- /dev/null
+++ b/data/libapt-pkg5.0/_metadata/conflicts
@@ -0,0 +1 @@
+apt7-lib (>=1.0)
diff --git a/data/libapt-pkg5.0/_metadata/description b/data/libapt-pkg5.0/_metadata/description
new file mode 100644
index 000000000..6a395c66f
--- /dev/null
+++ b/data/libapt-pkg5.0/_metadata/description
@@ -0,0 +1 @@
+the advanced packaging library from Debian
diff --git a/data/libapt-pkg5.0/_metadata/in.1443.00 b/data/libapt-pkg5.0/_metadata/in.1443.00
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/data/libapt-pkg5.0/_metadata/in.1443.00
diff --git a/data/libapt-pkg5.0/_metadata/in.550.58 b/data/libapt-pkg5.0/_metadata/in.550.58
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/data/libapt-pkg5.0/_metadata/in.550.58
diff --git a/data/libapt-pkg5.0/_metadata/license b/data/libapt-pkg5.0/_metadata/license
new file mode 120000
index 000000000..4f7d70f3f
--- /dev/null
+++ b/data/libapt-pkg5.0/_metadata/license
@@ -0,0 +1 @@
+../../_apt1.4/_metadata/license \ No newline at end of file
diff --git a/data/libapt-pkg5.0/_metadata/lz4.dep b/data/libapt-pkg5.0/_metadata/lz4.dep
new file mode 120000
index 000000000..bccb2875c
--- /dev/null
+++ b/data/libapt-pkg5.0/_metadata/lz4.dep
@@ -0,0 +1 @@
+../../lz4 \ No newline at end of file
diff --git a/data/libapt-pkg5.0/_metadata/lzma.dep b/data/libapt-pkg5.0/_metadata/lzma.dep
new file mode 120000
index 000000000..f84114cb9
--- /dev/null
+++ b/data/libapt-pkg5.0/_metadata/lzma.dep
@@ -0,0 +1 @@
+../../lzma \ No newline at end of file
diff --git a/data/libapt-pkg5.0/_metadata/maintainer b/data/libapt-pkg5.0/_metadata/maintainer
new file mode 120000
index 000000000..52845be09
--- /dev/null
+++ b/data/libapt-pkg5.0/_metadata/maintainer
@@ -0,0 +1 @@
+../../_apt1.4/_metadata/maintainer \ No newline at end of file
diff --git a/data/libapt-pkg5.0/_metadata/name b/data/libapt-pkg5.0/_metadata/name
new file mode 100644
index 000000000..285a10452
--- /dev/null
+++ b/data/libapt-pkg5.0/_metadata/name
@@ -0,0 +1 @@
+APT 1.4 Strict (libapt-pkg)
diff --git a/data/libapt-pkg5.0/_metadata/priority b/data/libapt-pkg5.0/_metadata/priority
new file mode 100644
index 000000000..fad9e164a
--- /dev/null
+++ b/data/libapt-pkg5.0/_metadata/priority
@@ -0,0 +1 @@
+required
diff --git a/data/libapt-pkg5.0/_metadata/provides b/data/libapt-pkg5.0/_metadata/provides
new file mode 100644
index 000000000..f4468b354
--- /dev/null
+++ b/data/libapt-pkg5.0/_metadata/provides
@@ -0,0 +1 @@
+libapt-pkg (=1.4.8)
diff --git a/data/libapt-pkg5.0/_metadata/role b/data/libapt-pkg5.0/_metadata/role
new file mode 100644
index 000000000..8d0320866
--- /dev/null
+++ b/data/libapt-pkg5.0/_metadata/role
@@ -0,0 +1 @@
+developer
diff --git a/data/libapt-pkg5.0/_metadata/section b/data/libapt-pkg5.0/_metadata/section
new file mode 100644
index 000000000..702b7b8d3
--- /dev/null
+++ b/data/libapt-pkg5.0/_metadata/section
@@ -0,0 +1 @@
+Packaging
diff --git a/data/libapt-pkg5.0/_metadata/tags b/data/libapt-pkg5.0/_metadata/tags
new file mode 100644
index 000000000..a8928cec8
--- /dev/null
+++ b/data/libapt-pkg5.0/_metadata/tags
@@ -0,0 +1 @@
+purpose::library
diff --git a/data/libapt-pkg5.0/_metadata/version b/data/libapt-pkg5.0/_metadata/version
new file mode 120000
index 000000000..06c5113b0
--- /dev/null
+++ b/data/libapt-pkg5.0/_metadata/version
@@ -0,0 +1 @@
+../../_apt1.4/_metadata/version \ No newline at end of file
diff --git a/data/apt7-lib/_metadata/xz.dep b/data/libapt-pkg5.0/_metadata/xz.dep
index d5eb7ae54..d5eb7ae54 120000
--- a/data/apt7-lib/_metadata/xz.dep
+++ b/data/libapt-pkg5.0/_metadata/xz.dep
diff --git a/data/libapt-pkg5.0/make.sh b/data/libapt-pkg5.0/make.sh
new file mode 100644
index 000000000..97f810f9b
--- /dev/null
+++ b/data/libapt-pkg5.0/make.sh
@@ -0,0 +1,2 @@
+pkg: mkdir -p /usr/lib
+cp -a "$(PKG_DEST_ _apt1.4)"/usr/lib/libapt-pkg.5.0* "${PKG_DEST}"/usr/lib/
diff --git a/data/libapt/_metadata/_apt1.4.dep b/data/libapt/_metadata/_apt1.4.dep
new file mode 120000
index 000000000..902259693
--- /dev/null
+++ b/data/libapt/_metadata/_apt1.4.dep
@@ -0,0 +1 @@
+../../_apt1.4 \ No newline at end of file
diff --git a/data/libapt/_metadata/breaks b/data/libapt/_metadata/breaks
new file mode 100644
index 000000000..425721f70
--- /dev/null
+++ b/data/libapt/_metadata/breaks
@@ -0,0 +1 @@
+cydia (<< 1.1.10), aptitude (<< 0.4.11.11-6), apt7-lib
diff --git a/data/libapt/_metadata/bzip2.dep b/data/libapt/_metadata/bzip2.dep
new file mode 120000
index 000000000..15aa44a77
--- /dev/null
+++ b/data/libapt/_metadata/bzip2.dep
@@ -0,0 +1 @@
+../../bzip2 \ No newline at end of file
diff --git a/data/libapt/_metadata/conflicts b/data/libapt/_metadata/conflicts
new file mode 100644
index 000000000..c299ef9e1
--- /dev/null
+++ b/data/libapt/_metadata/conflicts
@@ -0,0 +1 @@
+apt7-lib
diff --git a/data/libapt/_metadata/depends b/data/libapt/_metadata/depends
new file mode 100644
index 000000000..8313cb552
--- /dev/null
+++ b/data/libapt/_metadata/depends
@@ -0,0 +1 @@
+libapt-pkg (>=%MYVERSION%)
diff --git a/data/libapt/_metadata/description b/data/libapt/_metadata/description
new file mode 100644
index 000000000..6a395c66f
--- /dev/null
+++ b/data/libapt/_metadata/description
@@ -0,0 +1 @@
+the advanced packaging library from Debian
diff --git a/data/libapt/_metadata/dpkg.dep b/data/libapt/_metadata/dpkg.dep
new file mode 120000
index 000000000..3e57eea03
--- /dev/null
+++ b/data/libapt/_metadata/dpkg.dep
@@ -0,0 +1 @@
+../../dpkg \ No newline at end of file
diff --git a/data/libapt/_metadata/dpkg.ver.iphoneos-arm b/data/libapt/_metadata/dpkg.ver.iphoneos-arm
new file mode 100644
index 000000000..930ccbe2c
--- /dev/null
+++ b/data/libapt/_metadata/dpkg.ver.iphoneos-arm
@@ -0,0 +1 @@
+1.14.25-9
diff --git a/data/libapt/_metadata/gnupg.dep b/data/libapt/_metadata/gnupg.dep
new file mode 120000
index 000000000..277e892bf
--- /dev/null
+++ b/data/libapt/_metadata/gnupg.dep
@@ -0,0 +1 @@
+../../gnupg \ No newline at end of file
diff --git a/data/libapt/_metadata/gzip.dep b/data/libapt/_metadata/gzip.dep
new file mode 120000
index 000000000..c6c801e81
--- /dev/null
+++ b/data/libapt/_metadata/gzip.dep
@@ -0,0 +1 @@
+../../gzip \ No newline at end of file
diff --git a/data/libapt/_metadata/in.1443.00 b/data/libapt/_metadata/in.1443.00
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/data/libapt/_metadata/in.1443.00
diff --git a/data/libapt/_metadata/license b/data/libapt/_metadata/license
new file mode 120000
index 000000000..4f7d70f3f
--- /dev/null
+++ b/data/libapt/_metadata/license
@@ -0,0 +1 @@
+../../_apt1.4/_metadata/license \ No newline at end of file
diff --git a/data/libapt/_metadata/lz4.dep b/data/libapt/_metadata/lz4.dep
new file mode 120000
index 000000000..bccb2875c
--- /dev/null
+++ b/data/libapt/_metadata/lz4.dep
@@ -0,0 +1 @@
+../../lz4 \ No newline at end of file
diff --git a/data/libapt/_metadata/lzma.dep b/data/libapt/_metadata/lzma.dep
new file mode 120000
index 000000000..f84114cb9
--- /dev/null
+++ b/data/libapt/_metadata/lzma.dep
@@ -0,0 +1 @@
+../../lzma \ No newline at end of file
diff --git a/data/libapt/_metadata/maintainer b/data/libapt/_metadata/maintainer
new file mode 120000
index 000000000..52845be09
--- /dev/null
+++ b/data/libapt/_metadata/maintainer
@@ -0,0 +1 @@
+../../_apt1.4/_metadata/maintainer \ No newline at end of file
diff --git a/data/libapt/_metadata/name b/data/libapt/_metadata/name
new file mode 100644
index 000000000..4e97daa51
--- /dev/null
+++ b/data/libapt/_metadata/name
@@ -0,0 +1 @@
+APT Strict (lib)
diff --git a/data/libapt/_metadata/priority b/data/libapt/_metadata/priority
new file mode 100644
index 000000000..d0b3ce728
--- /dev/null
+++ b/data/libapt/_metadata/priority
@@ -0,0 +1 @@
++required
diff --git a/data/libapt/_metadata/role b/data/libapt/_metadata/role
new file mode 100644
index 000000000..8d0320866
--- /dev/null
+++ b/data/libapt/_metadata/role
@@ -0,0 +1 @@
+developer
diff --git a/data/libapt/_metadata/section b/data/libapt/_metadata/section
new file mode 100644
index 000000000..702b7b8d3
--- /dev/null
+++ b/data/libapt/_metadata/section
@@ -0,0 +1 @@
+Packaging
diff --git a/data/libapt/_metadata/tags b/data/libapt/_metadata/tags
new file mode 100644
index 000000000..a8928cec8
--- /dev/null
+++ b/data/libapt/_metadata/tags
@@ -0,0 +1 @@
+purpose::library
diff --git a/data/libapt/_metadata/version b/data/libapt/_metadata/version
new file mode 120000
index 000000000..06c5113b0
--- /dev/null
+++ b/data/libapt/_metadata/version
@@ -0,0 +1 @@
+../../_apt1.4/_metadata/version \ No newline at end of file
diff --git a/data/libapt/_metadata/xz.dep b/data/libapt/_metadata/xz.dep
new file mode 120000
index 000000000..d5eb7ae54
--- /dev/null
+++ b/data/libapt/_metadata/xz.dep
@@ -0,0 +1 @@
+../../xz \ No newline at end of file
diff --git a/data/libapt/libapt b/data/libapt/libapt
new file mode 120000
index 000000000..280bf477b
--- /dev/null
+++ b/data/libapt/libapt
@@ -0,0 +1 @@
+../../libapt \ No newline at end of file
diff --git a/data/libapt/make.sh b/data/libapt/make.sh
new file mode 100644
index 000000000..bfc52ca73
--- /dev/null
+++ b/data/libapt/make.sh
@@ -0,0 +1,11 @@
+cp -a "$(PKG_DEST_ _apt1.4)"/etc "${PKG_DEST}"
+cp -a "$(PKG_DEST_ _apt1.4)"/var "${PKG_DEST}"
+
+pkg: mkdir -p /usr
+cp -a "$(PKG_DEST_ _apt1.4)"/usr/lib "${PKG_DEST}"/usr
+cp -a "$(PKG_DEST_ _apt1.4)"/usr/libexec "${PKG_DEST}"/usr
+echo rm -f "${PKG_DEST}"/usr/lib/libapt-pkg.*
+rm -f "${PKG_DEST}"/usr/lib/libapt-pkg.*
+pkg: ln -s ../libexec/apt /usr/lib/apt
+pkg: rm -f /usr/libexec/apt/methods/https
+pkg: ln -s http /usr/libexec/apt/methods/https
diff --git a/data/libgmp10/make.sh b/data/libgmp10/make.sh
index 42c34de6b..3197d5831 100644
--- a/data/libgmp10/make.sh
+++ b/data/libgmp10/make.sh
@@ -1,4 +1,8 @@
pkg:setup
-pkg:configure --with-libgcrypt-prefix="$(PKG_DEST_ gcrypt)/usr"
+if [[ "${PKG_CFTARG}" == "1443.00" ]]; then
+ pkg:configure --with-libgcrypt-prefix="$(PKG_DEST_ gcrypt)/usr"
+else
+ pkg:configure --with-libgcrypt-prefix="$(PKG_DEST_ gcrypt)/usr" --disable-assembly
+fi
pkg:make -j8
pkg:install
diff --git a/data/libgpg-error/triplet.diff b/data/libgpg-error/triplet.diff
index b0efa85d3..42ecb5b9c 100644
--- a/data/libgpg-error/triplet.diff
+++ b/data/libgpg-error/triplet.diff
@@ -1,10 +1,11 @@
diff -ur libgpg-error-1.32/src/mkheader.c libgpg-error-1.32+iPhone/src/mkheader.c
--- libgpg-error-1.32/src/mkheader.c 2018-03-13 22:56:20.000000000 -1000
+++ libgpg-error-1.32+iPhone/src/mkheader.c 2018-08-01 15:13:26.000000000 -1000
-@@ -90,6 +90,8 @@
+@@ -90,6 +90,9 @@
{"powerpc-unknown-linux-gnuspe", "powerpc-unknown-linux-gnu" },
{"arm-unknown-linux-gnueabihf", "arm-unknown-linux-gnueabi" },
++ {"arm-apple-darwin11", "arm-apple-darwin" },
+ {"aarch64-apple-darwin14", "aarch64-apple-darwin" },
+ {"aarch64-apple-darwin17", "aarch64-apple-darwin" },
{"armv7-unknown-linux-gnueabihf" },
diff --git a/data/lz4/_metadata/in.550.58 b/data/lz4/_metadata/in.550.58
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/data/lz4/_metadata/in.550.58
diff --git a/data/openssl/iphoneos.diff b/data/openssl/iphoneos.diff
index 62b171cf4..3e22940fd 100644
--- a/data/openssl/iphoneos.diff
+++ b/data/openssl/iphoneos.diff
@@ -6,8 +6,8 @@ diff -ur openssl-1.0.2o/Configure openssl-1.0.2o+iPhone/Configure
"debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
# iPhoneOS/iOS
-"iphoneos-cross","llvm-gcc:-O3 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
-+"iphoneos-arm","arm-apple-darwin9-gcc:-O3 -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
-+"iphoneos-arm","aarch64-apple-darwin17-gcc:-O3 -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
++"arm-apple-darwin11","arm-apple-darwin11-gcc:-O3 -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
++"aarch64-apple-darwin17","aarch64-apple-darwin17-gcc:-O3 -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
##### A/UX
"aux3-gcc","gcc:-O2 -DTERMIO::(unknown):AUX:-lbsd:RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
@@ -21,9 +21,9 @@ diff -ur openssl-1.0.2o/config openssl-1.0.2o+iPhone/config
- *-*-iphoneos)
- options="$options -arch%20${MACHINE}"
- OUT="iphoneos-cross" ;;
-+ iphoneos-arm)
++ arm-apple-darwin11)
+ OUT="iphoneos-arm" ;;
-+ iphoneos-arm64)
++ aarch64-apple-darwin17)
+ OUT="iphoneos-arm" ;;
alpha-*-linux2)
ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo`
diff --git a/data/openssl/make.sh b/data/openssl/make.sh
index ba217e0e5..d83b0e547 100644
--- a/data/openssl/make.sh
+++ b/data/openssl/make.sh
@@ -1,6 +1,6 @@
pkg:setup
-echo ./Configure -D__DARWIN_UNIX03 "${PKG_ARCH}" --prefix=/usr --openssldir=/usr/lib/ssl shared
-./Configure -D__DARWIN_UNIX03 "${PKG_ARCH}" --prefix=/usr --openssldir=/usr/lib/ssl shared
+echo ./Configure -D__DARWIN_UNIX03 "${PKG_TARG}" --prefix=/usr --openssldir=/usr/lib/ssl shared
+./Configure -D__DARWIN_UNIX03 "${PKG_TARG}" --prefix=/usr --openssldir=/usr/lib/ssl shared
make AR="${PKG_TARG}-ar -r" -j8
make install INSTALL_PREFIX="${PKG_DEST}"
pkg: rm -rf /usr/lib/man /usr/lib/ssl/man