summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman <saurik@saurik.com>2010-02-22 20:57:01 +0000
committerJay Freeman <saurik@saurik.com>2010-02-22 20:57:01 +0000
commitb4eda46583b6a9c77b29e033dfdef83488f5546f (patch)
treebdad569c577d83ba7cd407b6e0bf04b67b0fe0fd
parent6c54e22d2c79a2f644f672ab06c29a060387443a (diff)
Ported to APT 0.7.25.3.
git-svn-id: http://svn.telesphoreo.org/trunk@700 514c082c-b64e-11dc-b46d-3d985efe055d
-rw-r--r--data/_apt7/_metadata/version2
-rw-r--r--data/_apt7/abi-4.8.diff315
-rw-r--r--data/_apt7/apt_0.7.20.2.tar.gzbin2032040 -> 0 bytes
-rw-r--r--data/_apt7/apt_0.7.25.3.tar.gzbin0 -> 2646727 bytes
-rw-r--r--data/_apt7/cfnetwork.diff170
-rw-r--r--data/_apt7/deprecated.diff13
-rw-r--r--data/_apt7/dllimit.diff12
-rw-r--r--data/_apt7/iconv.diff12
-rw-r--r--data/_apt7/make.sh1
-rw-r--r--data/_apt7/map_anon.diff17
-rw-r--r--data/_apt7/mmap.diff6
-rw-r--r--data/_apt7/port.diff37
-rw-r--r--data/_apt7/strdupa.diff80
-rw-r--r--data/_apt7/tag.diff16
14 files changed, 559 insertions, 122 deletions
diff --git a/data/_apt7/_metadata/version b/data/_apt7/_metadata/version
index 015cc16c2..61c4e572d 100644
--- a/data/_apt7/_metadata/version
+++ b/data/_apt7/_metadata/version
@@ -1 +1 @@
-0.7.20.2
+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_0.7.20.2.tar.gz b/data/_apt7/apt_0.7.20.2.tar.gz
deleted file mode 100644
index 52d2429ee..000000000
--- a/data/_apt7/apt_0.7.20.2.tar.gz
+++ /dev/null
Binary files differ
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/cfnetwork.diff b/data/_apt7/cfnetwork.diff
index 7da0635a0..7fe04f454 100644
--- a/data/_apt7/cfnetwork.diff
+++ b/data/_apt7/cfnetwork.diff
@@ -1,19 +1,21 @@
-diff -ru apt-0.7.20.2/methods/http.cc apt-0.7.20.2+iPhone/methods/http.cc
---- apt-0.7.20.2/methods/http.cc 2009-02-07 15:09:35.000000000 +0000
-+++ apt-0.7.20.2+iPhone/methods/http.cc 2009-04-14 16:34:31.000000000 +0000
-@@ -30,6 +30,7 @@
- #include <apt-pkg/error.h>
+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>
-@@ -40,9 +41,16 @@
+@@ -41,11 +42,18 @@
#include <string.h>
#include <iostream>
- #include <apti18n.h>
+ #include <map>
+#include <set>
+ #include <apti18n.h>
+
// Internet stuff
#include <netdb.h>
@@ -26,7 +28,7 @@ diff -ru apt-0.7.20.2/methods/http.cc apt-0.7.20.2+iPhone/methods/http.cc
#include "config.h"
#include "connect.h"
-@@ -52,6 +60,51 @@
+@@ -54,6 +62,51 @@
/*}}}*/
using namespace std;
@@ -78,7 +80,7 @@ diff -ru apt-0.7.20.2/methods/http.cc apt-0.7.20.2+iPhone/methods/http.cc
string HttpMethod::FailFile;
int HttpMethod::FailFd = -1;
time_t HttpMethod::FailTime = 0;
-@@ -632,6 +685,51 @@
+@@ -646,6 +699,51 @@
}
/*}}}*/
@@ -130,7 +132,7 @@ diff -ru apt-0.7.20.2/methods/http.cc apt-0.7.20.2+iPhone/methods/http.cc
// HttpMethod::SendReq - Send the HTTP request /*{{{*/
// ---------------------------------------------------------------------
/* This places the http request in the outbound buffer */
-@@ -1043,6 +1141,8 @@
+@@ -1088,6 +1186,8 @@
signal(SIGINT,SigTerm);
Server = 0;
@@ -139,10 +141,11 @@ diff -ru apt-0.7.20.2/methods/http.cc apt-0.7.20.2+iPhone/methods/http.cc
int FailCounter = 0;
while (1)
-@@ -1063,173 +1163,313 @@
+@@ -1107,214 +1207,314 @@
+
if (Queue == 0)
continue;
-
+-
- // Connect to the server
- if (Server == 0 || Server->Comp(Queue->Uri) == false)
- {
@@ -168,8 +171,31 @@ diff -ru apt-0.7.20.2/methods/http.cc apt-0.7.20.2+iPhone/methods/http.cc
- 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);
@@ -208,29 +234,6 @@ diff -ru apt-0.7.20.2/methods/http.cc apt-0.7.20.2+iPhone/methods/http.cc
- continue;
- }
- };
-+ 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);
-+ }
-+
+ CFStringRef sr = CFStringCreateWithCString(kCFAllocatorDefault, urs.c_str(), se);
+ CFURLRef ur = CFURLCreateWithString(kCFAllocatorDefault, sr, NULL);
+ CFRelease(sr);
@@ -343,9 +346,7 @@ diff -ru apt-0.7.20.2/methods/http.cc apt-0.7.20.2+iPhone/methods/http.cc
- bool Result = Server->RunData();
+ hm = (CFHTTPMessageRef) CFReadStreamCopyProperty(rs, kCFStreamPropertyHTTPResponseHeader);
+ sc = CFHTTPMessageGetResponseStatusCode(hm);
-
-- /* If the server is sending back sizeless responses then fill in
-- the size now */
++
+ if (sc == 301 || sc == 302) {
+ sr = CFHTTPMessageCopyHeaderFieldValue(hm, CFSTR("Location"));
+ if (sr == NULL) {
@@ -420,7 +421,9 @@ diff -ru apt-0.7.20.2/methods/http.cc apt-0.7.20.2+iPhone/methods/http.cc
+
+ 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];
+
@@ -567,23 +570,6 @@ diff -ru apt-0.7.20.2/methods/http.cc apt-0.7.20.2+iPhone/methods/http.cc
+ Fail();
+ goto done;
+ }
-+
-+ dt += sz;
-+ rd -= sz;
-+ }
-+
-+ rd = CFReadStreamRead(rs, data, sizeof(data));
-+ goto read;
-+ }
-+ }
-+
-+ goto done;
-+ done_:
-+ CFRelease(hm);
-+ done:
-+ CFReadStreamClose(rs);
-+ CFRelease(rs);
-+ free(url);
- // We need to flush the data, the header is like a 404 w/ error text
- case 4:
@@ -598,16 +584,69 @@ diff -ru apt-0.7.20.2/methods/http.cc apt-0.7.20.2+iPhone/methods/http.cc
- 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;
}
-@@ -1242,6 +1482,34 @@
- setlocale(LC_ALL, "");
+@@ -1330,6 +1530,35 @@
+ signal(SIGPIPE, SIG_IGN);
HttpMethod Mth;
+
@@ -638,13 +677,14 @@ diff -ru apt-0.7.20.2/methods/http.cc apt-0.7.20.2+iPhone/methods/http.cc
+ UniqueID_ = lockdown_copy_value(lockdown, NULL, kLockdownUniqueDeviceIDKey);
+ lockdown_disconnect(lockdown);
+ }
-
++
return Mth.Loop();
}
-diff -ru apt-0.7.20.2/methods/makefile apt-0.7.20.2+iPhone/methods/makefile
---- apt-0.7.20.2/methods/makefile 2009-02-07 15:09:35.000000000 +0000
-+++ apt-0.7.20.2+iPhone/methods/makefile 2009-04-14 16:18:18.000000000 +0000
-@@ -47,7 +47,7 @@
+
+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
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/dllimit.diff b/data/_apt7/dllimit.diff
deleted file mode 100644
index 367c73006..000000000
--- a/data/_apt7/dllimit.diff
+++ /dev/null
@@ -1,12 +0,0 @@
-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
-@@ -268,7 +286,7 @@
- return 0;
-
- /* if a method uses DownloadLimit, we switch to SingleInstance mode */
-- if(_config->FindI("Acquire::"+Access+"::DlLimit",0) > 0)
-+ if(_config->FindI("Acquire::"+Access+"::Dl-Limit",0) > 0)
- Conf->SingleInstance = true;
-
- return Conf;
diff --git a/data/_apt7/iconv.diff b/data/_apt7/iconv.diff
index f6808de2b..d8887b1aa 100644
--- a/data/_apt7/iconv.diff
+++ b/data/_apt7/iconv.diff
@@ -2,12 +2,12 @@ diff -ru apt-0.7.20.2/apt-pkg/makefile apt-0.7.20.2+iPhone/apt-pkg/makefile
--- apt-0.7.20.2/apt-pkg/makefile 2009-02-07 15:09:35.000000000 +0000
+++ apt-0.7.20.2+iPhone/apt-pkg/makefile 2009-04-15 19:36:09.000000000 +0000
@@ -15,7 +15,7 @@
- LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
- MAJOR=4.6
- MINOR=0
--SLIBS=$(PTHREADLIB) $(INTLLIBS) -lutil
-+SLIBS=$(PTHREADLIB) $(INTLLIBS) -lutil $(LIBICONV)
- APT_DOMAIN:=libapt-pkg$(MAJOR)
+ 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
diff --git a/data/_apt7/make.sh b/data/_apt7/make.sh
index fbfc6a7a2..e71defc10 100644
--- a/data/_apt7/make.sh
+++ b/data/_apt7/make.sh
@@ -3,6 +3,7 @@ autoconf
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/sources.list.d
pkg: mkdir -p /var/cache/apt/archives/partial
pkg: mkdir -p /var/lib/apt/lists/partial
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/mmap.diff b/data/_apt7/mmap.diff
index 06f4dbac0..1b745e8b5 100644
--- a/data/_apt7/mmap.diff
+++ b/data/_apt7/mmap.diff
@@ -61,7 +61,7 @@ diff -ru apt-0.7.20.2/apt-pkg/tagfile.cc apt-0.7.20.2+iPhone/apt-pkg/tagfile.cc
- End = Start + EndSize;
- return true;
-}
--
+- /*}}}*/
// TagFile::Step - Advance to the next section /*{{{*/
// ---------------------------------------------------------------------
/* If the Section Scanner fails we refill the buffer and try again.
@@ -163,7 +163,7 @@ diff -ru apt-0.7.20.2/apt-pkg/tagfile.cc apt-0.7.20.2+iPhone/apt-pkg/tagfile.cc
+ Stop = End;
+ goto end;
+ }
-
+
for (; Stop+1 < End && Stop[1] == '\r'; Stop++);
// Double newline marks the end of the record
@@ -172,7 +172,7 @@ diff -ru apt-0.7.20.2/apt-pkg/tagfile.cc apt-0.7.20.2+iPhone/apt-pkg/tagfile.cc
+ if (Stop+1 == End || Stop[1] == '\n')
+ end: {
Indexes[TagCount] = Stop - Section;
- for (; Stop < End && (Stop[0] == '\n' || Stop[0] == '\r'); Stop++);
+ 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
diff --git a/data/_apt7/port.diff b/data/_apt7/port.diff
index af30d7269..f2190eca7 100644
--- a/data/_apt7/port.diff
+++ b/data/_apt7/port.diff
@@ -9,19 +9,15 @@ diff -ru apt-0.7.20.2/apt-inst/deb/dpkgdb.cc apt-0.7.20.2+iPhone/apt-inst/deb/dp
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
-diff -ru apt-0.7.20.2/apt-inst/makefile apt-0.7.20.2+iPhone/apt-inst/makefile
---- apt-0.7.20.2/apt-inst/makefile 2009-02-07 15:09:35.000000000 +0000
-+++ apt-0.7.20.2+iPhone/apt-inst/makefile 2009-04-14 16:10:02.000000000 +0000
-@@ -11,7 +11,8 @@
-
- # The library name
- LIBRARY=apt-inst
--LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
+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=
-+#$(GLIBC_VER)$(LIBSTDCPP_VER)
- MAJOR=1.1
- MINOR=0
- SLIBS=$(PTHREADLIB) -lapt-pkg
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
@@ -34,19 +30,6 @@ diff -ru apt-0.7.20.2/apt-pkg/deb/dpkgpm.cc apt-0.7.20.2+iPhone/apt-pkg/deb/dpkg
/* 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/apt-pkg/makefile apt-0.7.20.2+iPhone/apt-pkg/makefile
---- apt-0.7.20.2/apt-pkg/makefile 2009-02-07 15:09:35.000000000 +0000
-+++ apt-0.7.20.2+iPhone/apt-pkg/makefile 2009-04-14 16:16:15.000000000 +0000
-@@ -12,7 +12,8 @@
- # The library name, don't forget to update init.h and the copy in
- # methods/makefile - FIXME
- LIBRARY=apt-pkg
--LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
-+LIBEXT=
-+#$(GLIBC_VER)$(LIBSTDCPP_VER)
- MAJOR=4.6
- MINOR=0
- SLIBS=$(PTHREADLIB) $(INTLLIBS) -lutil
diff -ru apt-0.7.20.2/buildlib/environment.mak.in apt-0.7.20.2+iPhone/buildlib/environment.mak.in
--- apt-0.7.20.2/buildlib/environment.mak.in 2009-02-07 15:09:35.000000000 +0000
+++ apt-0.7.20.2+iPhone/buildlib/environment.mak.in 2009-04-14 16:11:50.000000000 +0000
@@ -198,10 +181,10 @@ diff -ru apt-0.7.20.2/ftparchive/contents.cc apt-0.7.20.2+iPhone/ftparchive/cont
diff -ru apt-0.7.20.2/Makefile apt-0.7.20.2+iPhone/Makefile
--- apt-0.7.20.2/Makefile 2009-02-07 15:09:35.000000000 +0000
+++ apt-0.7.20.2+iPhone/Makefile 2009-04-14 16:10:02.000000000 +0000
-@@ -18,7 +18,6 @@
+@@ -18,7 +18,5 @@
$(MAKE) -C ftparchive $@
$(MAKE) -C dselect $@
- $(MAKE) -C doc $@
+- $(MAKE) -C doc $@
- $(MAKE) -C po $@
# Some very common aliases
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
index b315e2e50..78ce39645 100644
--- a/data/_apt7/tag.diff
+++ b/data/_apt7/tag.diff
@@ -12,8 +12,8 @@ diff -ru apt-0.7.20.2/apt-pkg/cacheiterators.h apt-0.7.20.2+iPhone/apt-pkg/cache
@@ -148,6 +150,48 @@
};
};
-
-+// Tag Iterator
+ /*}}}*/
++// Tag Iterator /*{{{*/
+class pkgCache::TagIterator
+{
+ Tag *Tg;
@@ -54,8 +54,8 @@ diff -ru apt-0.7.20.2/apt-pkg/cacheiterators.h apt-0.7.20.2+iPhone/apt-pkg/cache
+ Tg = Owner.TagP;
+ };
+};
-+
- // Description Iterator
++ /*}}}*/
+ // Description Iterator /*{{{*/
class pkgCache::DescIterator
{
@@ -423,6 +467,8 @@
@@ -260,14 +260,14 @@ diff -ru apt-0.7.20.2/apt-pkg/pkgcache.h apt-0.7.20.2+iPhone/apt-pkg/pkgcache.h
@@ -248,6 +255,12 @@
unsigned short Size;
};
-
-+struct pkgCache::Tag
+ /*}}}*/
++struct pkgCache::Tag /*{{{*/
+{
+ map_ptrloc Name; // Stringtable
+ map_ptrloc NextTag; // Tag
+};
-+
- struct pkgCache::DescFile
++ /*}}}*/
+ struct pkgCache::DescFile /*{{{*/
{
map_ptrloc File; // PackageFile
@@ -340,6 +354,7 @@