diff -ruN apt-0.5.4/apt-inst/deb/dpkgdb.cc apt-0.5.4-patched/apt-inst/deb/dpkgdb.cc --- apt-0.5.4/apt-inst/deb/dpkgdb.cc 2001-05-27 19:50:42.000000000 -0400 +++ apt-0.5.4-patched/apt-inst/deb/dpkgdb.cc 2006-08-14 23:01:18.000000000 -0400 @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff -urN apt-0.5.4.orig/apt-inst/makefile apt-0.5.4/apt-inst/makefile --- apt-0.5.4.orig/apt-inst/makefile 2001-02-27 13:16:05.000000000 +0900 +++ apt-0.5.4/apt-inst/makefile 2005-03-08 13:00:37.000000000 +0900 @@ -10,6 +10,7 @@ include ../buildlib/defaults.mak # The library name +LDFLAGS += -L../apt-pkg -lapt-pkg LIBRARY=apt-inst LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER) MAJOR=1.0 diff -urN apt-0.5.4.orig/apt-pkg/contrib/mmap.cc apt-0.5.4/apt-pkg/contrib/mmap.cc --- apt-0.5.4.orig/apt-pkg/contrib/mmap.cc 2001-05-27 14:19:30.000000000 +0900 +++ apt-0.5.4/apt-pkg/contrib/mmap.cc 2005-03-08 13:00:37.000000000 +0900 @@ -41,7 +41,7 @@ // --------------------------------------------------------------------- /* */ MMap::MMap(FileFd &F,unsigned long Flags) : Flags(Flags), iSize(0), - Base(0) + Base(0), iFd(0) { if ((Flags & NoImmMap) != NoImmMap) Map(F); @@ -51,7 +51,7 @@ // --------------------------------------------------------------------- /* */ MMap::MMap(unsigned long Flags) : Flags(Flags), iSize(0), - Base(0) + Base(0), iFd(0) { } /*}}}*/ @@ -68,6 +68,7 @@ /* */ bool MMap::Map(FileFd &Fd) { + iFd = &Fd; iSize = Fd.Size(); // Set the permissions. @@ -81,10 +82,19 @@ if (iSize == 0) return _error->Error(_("Can't mmap an empty file")); +#ifndef EMULATE_MMAP // Map it. Base = mmap(0,iSize,Prot,Map,Fd.Fd(),0); if (Base == (void *)-1) return _error->Errno("mmap",_("Couldn't make mmap of %lu bytes"),iSize); +#else + Base = new unsigned char[iSize]; + if (Base == NULL) + return _error->Errno("mmap",_("Couldn't allocate %lu bytes to emulate mmap"),iSize); + + Fd.Seek(0); + Fd.Read(Base, iSize, true); +#endif return true; } @@ -100,8 +110,16 @@ if (DoSync == true) Sync(); +#ifndef EMULATE_MMAP if (munmap((char *)Base,iSize) != 0) _error->Warning("Unable to munmap"); +#else + if ((Flags & ReadOnly) != ReadOnly && iFd != 0) { + iFd->Seek(0); + iFd->Write(Base, iSize); + } + delete [] (unsigned char *)Base; +#endif iSize = 0; Base = 0; @@ -117,11 +135,13 @@ if ((Flags & UnMapped) == UnMapped) return true; +#ifndef EMULATE_MMAP #ifdef _POSIX_SYNCHRONIZED_IO if ((Flags & ReadOnly) != ReadOnly) if (msync((char *)Base,iSize,MS_SYNC) != 0) return _error->Errno("msync","Unable to write mmap"); #endif +#endif return true; } /*}}}*/ @@ -133,12 +153,14 @@ if ((Flags & UnMapped) == UnMapped) return true; +#ifndef EMULATE_MMAP #ifdef _POSIX_SYNCHRONIZED_IO unsigned long PSize = sysconf(_SC_PAGESIZE); if ((Flags & ReadOnly) != ReadOnly) if (msync((char *)Base+(int)(Start/PSize)*PSize,Stop - Start,MS_SYNC) != 0) return _error->Errno("msync","Unable to write mmap"); #endif +#endif return true; } /*}}}*/ diff -urN apt-0.5.4.orig/apt-pkg/contrib/mmap.h apt-0.5.4/apt-pkg/contrib/mmap.h --- apt-0.5.4.orig/apt-pkg/contrib/mmap.h 2001-05-14 14:16:43.000000000 +0900 +++ apt-0.5.4/apt-pkg/contrib/mmap.h 2005-03-08 13:00:38.000000000 +0900 @@ -46,6 +46,7 @@ unsigned long Flags; unsigned long iSize; void *Base; + FileFd *iFd; bool Map(FileFd &Fd); bool Close(bool DoSync = true); diff -urN apt-0.5.4.orig/apt-pkg/deb/debindexfile.cc apt-0.5.4/apt-pkg/deb/debindexfile.cc --- apt-0.5.4.orig/apt-pkg/deb/debindexfile.cc 2001-04-29 14:13:51.000000000 +0900 +++ apt-0.5.4/apt-pkg/deb/debindexfile.cc 2005-03-08 13:00:38.000000000 +0900 @@ -505,3 +505,11 @@ } /*}}}*/ +void init_deb2() +{ + (void)_apt_DebType; + (void)_apt_DebSrcType; + (void)_apt_Src; + (void)_apt_Pkg; + (void)_apt_Status; +} diff -urN apt-0.5.4.orig/apt-pkg/deb/deblistparser.cc apt-0.5.4/apt-pkg/deb/deblistparser.cc --- apt-0.5.4.orig/apt-pkg/deb/deblistparser.cc 2001-07-26 02:15:59.000000000 -0400 +++ apt-0.5.4/apt-pkg/deb/deblistparser.cc 2011-05-13 03:50:31.000000000 -0400 @@ -163,18 +163,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 *J = S; for (; Start != End; Start++) { if (isspace(*Start) == 0) - *I++ = tolower(*Start); + *J++ = tolower(*Start); if (*Start == '<' && Start[1] != '<' && Start[1] != '=') - *I++ = '='; + *J++ = '='; if (*Start == '>' && Start[1] != '>' && Start[1] != '=') - *I++ = '='; + *J++ = '='; } - Result = AddCRC16(Result,S,I - S); + Result = AddCRC16(Result,S,J - S); } return Result; diff -urN apt-0.5.4.orig/apt-pkg/deb/debsystem.cc apt-0.5.4/apt-pkg/deb/debsystem.cc --- apt-0.5.4.orig/apt-pkg/deb/debsystem.cc 2001-04-29 14:13:51.000000000 +0900 +++ apt-0.5.4/apt-pkg/deb/debsystem.cc 2011-04-29 14:25:17.000000000 -0400 @@ -27,6 +27,109 @@ #include #include /*}}}*/ +/* FINK LOCAL begin */ +#include +#include +#include +#include + +extern void init_deb2(); +extern void init_deb3(); + +#define FINKSTATUSFILE "/tmp/finkaptstatus" + +struct versionrevision { + unsigned long epoch; + const char *version; + const char *revision; +}; + +struct versionrevision darwin_version = {0,NULL,NULL}; +struct versionrevision macosx_version = {0,NULL,NULL}; + +static void finkinit() +{ + Boolean status; + SInt32 errorCode; + CFURLRef fileURL = NULL; + CFDataRef resourceData = NULL; + CFPropertyListRef propertyList = NULL; + CFStringRef string; + static char buffer[256]; // This is static, to ensure the buffer stays around + + static struct utsname ver; // This is static, to ensure the buffer stays around + + /* Determine system version */ + /* TODO - should maybe check if this is really Darwin? */ + if (!uname(&ver)) { + darwin_version.version = ver.release; + } + + /* Check whether this is Mac OS X, and which version of it */ + + fileURL = CFURLCreateWithFileSystemPath( NULL, + CFSTR("/System/Library/CoreServices/SystemVersion.plist"), + kCFURLPOSIXPathStyle, + false ); + if (!fileURL) + goto BAIL; + + /* Read the XML */ + status = CFURLCreateDataAndPropertiesFromResource( + NULL, + fileURL, + &resourceData, + NULL, + NULL, + &errorCode); + if (!status || errorCode != 0) + goto BAIL; + + /* Reconstitute the dictionary using the XML data. */ + propertyList = CFPropertyListCreateFromXMLData( NULL, + resourceData, + kCFPropertyListImmutable, + &string); + if (!propertyList) + goto BAIL; + + /* Try to read the system version from it. */ + status = CFDictionaryGetValueIfPresent( + (CFDictionaryRef) propertyList, + (const void *) CFSTR("ProductVersion"), + (const void**) &string); + if (!status) + goto BAIL; + + /* Convert into a C string */ + status = CFStringGetCString( string, + buffer, + sizeof(buffer), + kCFStringEncodingISOLatin1); + if (!status) + goto BAIL; + + /* Finally link the buffer into the macosx_version struct. */ + macosx_version.version = buffer; + +BAIL: + // Release all of the CF objects we're responsible for. + if (fileURL) + CFRelease(fileURL); + if (resourceData) + CFRelease(resourceData); + if (propertyList) + CFRelease(propertyList); +} + +void initDebSystem() +{ + finkinit(); + (void)debSys; + init_deb2(); + init_deb3(); +} +/* FINK LOCAL end */ debSystem debSys; @@ -48,6 +151,8 @@ debSystem::~debSystem() { delete StatusFile; + delete FinkStatusFile; + unlink(FINKSTATUSFILE); } /*}}}*/ // System::Lock - Get the lock /*{{{*/ @@ -161,8 +266,8 @@ which is yet to be determined. The functions in pkgcachegen should be the only users of these */ Cnf.CndSet("Dir::State::userstatus","status.user"); // Defunct - Cnf.CndSet("Dir::State::status","/var/lib/dpkg/status"); - Cnf.CndSet("Dir::Bin::dpkg","/usr/bin/dpkg"); + Cnf.CndSet("Dir::State::status","@PREFIX@/var/lib/dpkg/status"); + Cnf.CndSet("Dir::Bin::dpkg","@PREFIX@/bin/dpkg"); return true; } @@ -185,9 +290,9 @@ signed debSystem::Score(Configuration const &Cnf) { signed Score = 0; - if (FileExists(Cnf.FindFile("Dir::State::status","/var/lib/dpkg/status")) == true) + if (FileExists(Cnf.FindFile("Dir::State::status","@PREFIX@/var/lib/dpkg/status")) == true) Score += 10; - if (FileExists(Cnf.FindFile("Dir::Bin::dpkg","/usr/bin/dpkg")) == true) + if (FileExists(Cnf.FindFile("Dir::Bin::dpkg","@PREFIX@/bin/dpkg")) == true) Score += 10; if (FileExists("/etc/debian_version") == true) Score += 10; @@ -202,6 +307,54 @@ if (StatusFile == 0) StatusFile = new debStatusIndex(_config->FindFile("Dir::State::status")); List.push_back(StatusFile); +/* FINK LOCAL begin */ + + if (FinkStatusFile == 0) { + struct stat unused_sbuf; + unlink(FINKSTATUSFILE); + if ( 0 == stat("@PREFIX@/bin/fink-virtual-pkgs",&unused_sbuf)) { + // will be trying to use fink's own virtpkg data + int have_fvp_data=0; + if ( 0 == system("@PREFIX@/bin/fink-virtual-pkgs --apt")) { + if (0 == stat(FINKSTATUSFILE, &unused_sbuf)) { + // f-v-p did not fail and we have its data-file available + have_fvp_data=1; + } + } + if ( !have_fvp_data ) { + // f-v-p failed somehow? ABORT! + return _error->Error("Error while setting up data-piping from fink-virtual-pkgs"); + } + } else { + // no f-v-p...use dummy data + std::ofstream finkstatus(FINKSTATUSFILE); + if(macosx_version.version != 0) + { + finkstatus << "Package: macosx" << endl; + finkstatus << "Status: install ok installed" << endl; + finkstatus << "Priority: optional" << endl; + finkstatus << "Section: base" << endl; + finkstatus << "Maintainer: None" << endl; + finkstatus << "Source: macosx" << endl; + finkstatus << "Version: " << macosx_version.version << endl; + finkstatus << "Description: Pseudo package representing Mac OS X" << endl; + finkstatus << " Pseudo package representing Mac OS X" << endl << endl; + } + finkstatus << "Package: darwin" << endl; + finkstatus << "Status: install ok installed" << endl; + finkstatus << "Priority: optional" << endl; + finkstatus << "Section: base" << endl; + finkstatus << "Maintainer: None" << endl; + finkstatus << "Source: darwin" << endl; + finkstatus << "Version: " << darwin_version.version << endl; + finkstatus << "Description: Pseudo package representing Darwin" << endl; + finkstatus << " Pseudo package representing Darwin" << endl << endl; + finkstatus.close(); + } + FinkStatusFile = new debStatusIndex(FINKSTATUSFILE); + } + List.push_back(FinkStatusFile); +/* FINK LOCAL end */ return true; } /*}}}*/ @@ -217,6 +370,10 @@ { Found = StatusFile; return true; + } else if ((FinkStatusFile != 0) && (FinkStatusFile->FindInCache(*File.Cache()) == File)) + { + Found = FinkStatusFile; + return true; } return false; diff -urN apt-0.5.4.orig/apt-pkg/deb/debsystem.h apt-0.5.4/apt-pkg/deb/debsystem.h --- apt-0.5.4.orig/apt-pkg/deb/debsystem.h 2001-04-29 14:13:51.000000000 +0900 +++ apt-0.5.4/apt-pkg/deb/debsystem.h 2005-03-08 13:00:38.000000000 +0900 @@ -25,6 +25,7 @@ bool CheckUpdates(); debStatusIndex *StatusFile; + debStatusIndex *FinkStatusFile; public: diff -urN apt-0.5.4.orig/apt-pkg/deb/debversion.cc apt-0.5.4/apt-pkg/deb/debversion.cc --- apt-0.5.4.orig/apt-pkg/deb/debversion.cc 2001-05-07 14:14:53.000000000 +0900 +++ apt-0.5.4/apt-pkg/deb/debversion.cc 2005-03-08 13:00:38.000000000 +0900 @@ -24,6 +24,11 @@ debVersioningSystem debVS; +void init_deb3() +{ + (void)debVS; +} + // debVS::debVersioningSystem - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ diff -urN apt-0.5.4.orig/apt-pkg/init.cc apt-0.5.4/apt-pkg/init.cc --- apt-0.5.4.orig/apt-pkg/init.cc 2001-03-13 15:51:46.000000000 +0900 +++ apt-0.5.4/apt-pkg/init.cc 2005-03-08 13:00:38.000000000 +0900 @@ -15,6 +15,8 @@ #include #include #include + +extern void initDebSystem(); /*}}}*/ #define Stringfy_(x) # x @@ -39,7 +41,7 @@ Cnf.Set("APT::Architecture",COMMON_CPU); else Cnf.Set("APT::Architecture",COMMON_OS "-" COMMON_CPU); - Cnf.Set("Dir","/"); + Cnf.Set("Dir","@PREFIX@/"); // State Cnf.Set("Dir::State","var/lib/apt/"); @@ -68,7 +70,7 @@ Cnf.Set("Dir::Etc::main","apt.conf"); Cnf.Set("Dir::Etc::parts","apt.conf.d"); Cnf.Set("Dir::Etc::preferences","preferences"); - Cnf.Set("Dir::Bin::methods","/usr/lib/apt/methods"); + Cnf.Set("Dir::Bin::methods","@PREFIX@/lib/apt/methods"); bool Res = true; @@ -101,6 +103,8 @@ /* */ bool pkgInitSystem(Configuration &Cnf,pkgSystem *&Sys) { + initDebSystem(); + Sys = 0; string Label = Cnf.Find("Apt::System",""); if (Label.empty() == false) diff -Nurd -x'*~' apt-0.5.4.orig/apt-pkg/pkgcachegen.cc apt-0.5.4/apt-pkg/pkgcachegen.cc --- apt-0.5.4.orig/apt-pkg/pkgcachegen.cc 2001-07-01 18:28:24.000000000 -0400 +++ apt-0.5.4/apt-pkg/pkgcachegen.cc 2009-12-06 13:58:16.000000000 -0500 @@ -597,7 +597,7 @@ bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress, MMap **OutMap,bool AllowMem) { - unsigned long MapSize = _config->FindI("APT::Cache-Limit",6*1024*1024); + unsigned long MapSize = _config->FindI("APT::Cache-Limit",60*1024*1024); vector Files(List.begin(),List.end()); unsigned long EndOfSource = Files.size(); diff -urN apt-0.5.4.orig/apt-pkg/pkgcachegen.h apt-0.5.4/apt-pkg/pkgcachegen.h --- apt-0.5.4.orig/apt-pkg/pkgcachegen.h 2001-02-20 02:03:17.000000000 -0500 +++ apt-0.5.4/apt-pkg/pkgcachegen.h 2011-05-21 00:01:31.000000000 -0400 @@ -50,7 +50,7 @@ string PkgFileName; pkgCache::PackageFile *CurrentFile; - bool NewPackage(pkgCache::PkgIterator &Pkg,string Pkg); + bool NewPackage(pkgCache::PkgIterator &Pkg,string Name); bool NewFileVer(pkgCache::VerIterator &Ver,ListParser &List); unsigned long NewVersion(pkgCache::VerIterator &Ver,string VerStr,unsigned long Next); diff -urN apt-0.5.4.orig/apt-pkg/policy.cc apt-0.5.4/apt-pkg/policy.cc --- apt-0.5.4.orig/apt-pkg/policy.cc 2001-05-28 08:40:56.000000000 +0900 +++ apt-0.5.4/apt-pkg/policy.cc 2005-03-08 13:00:38.000000000 +0900 @@ -183,7 +183,7 @@ Pin *P = 0; if (Name.empty() == true) - P = &*Defaults.insert(Defaults.end()); + P = &*Defaults.insert(Defaults.end(),PkgPin()); else { // Get a spot to put the pin @@ -197,7 +197,7 @@ P = &*I; if (P == 0) - P = &*Unmatched.insert(Unmatched.end()); + P = &*Unmatched.insert(Unmatched.end(), PkgPin()); } else { diff -urN apt-0.5.4.orig/apt-pkg/tagfile.cc apt-0.5.4/apt-pkg/tagfile.cc --- apt-0.5.4.orig/apt-pkg/tagfile.cc 2001-05-14 14:56:26.000000000 +0900 +++ apt-0.5.4/apt-pkg/tagfile.cc 2005-03-08 13:00:38.000000000 +0900 @@ -197,7 +197,7 @@ return false; TagCount = 0; - while (TagCount < sizeof(Indexes)/sizeof(Indexes[0]) && Stop < End) + while (TagCount+1 < sizeof(Indexes)/sizeof(Indexes[0]) && Stop < End) { // Start a new index and add it to the hash if (isspace(Stop[0]) == 0) @@ -211,13 +211,13 @@ if (Stop == 0) return false; - for (; Stop[1] == '\r' && Stop+1 < End; Stop++); + for (; Stop+1 < End && Stop[1] == '\r'; Stop++); // Double newline marks the end of the record if (Stop+1 < End && Stop[1] == '\n') { Indexes[TagCount] = Stop - Section; - for (; (Stop[0] == '\n' || Stop[0] == '\r') && Stop < End; Stop++); + for (; Stop < End && (Stop[0] == '\n' || Stop[0] == '\r'); Stop++); return true; } diff -urN apt-0.5.4.orig/apt-pkg/tagfile.h apt-0.5.4/apt-pkg/tagfile.h --- apt-0.5.4.orig/apt-pkg/tagfile.h 2001-04-22 14:42:52.000000000 +0900 +++ apt-0.5.4/apt-pkg/tagfile.h 2005-03-08 13:00:38.000000000 +0900 @@ -34,7 +34,7 @@ // We have a limit of 256 tags per section. unsigned short Indexes[256]; - unsigned short AlphaIndexes[0xff]; + unsigned short AlphaIndexes[0x100]; unsigned int TagCount; diff -urN apt-0.5.4.orig/buildlib/environment.mak.in apt-0.5.4/buildlib/environment.mak.in --- apt-0.5.4.orig/buildlib/environment.mak.in 2001-05-29 14:11:03.000000000 +0900 +++ apt-0.5.4/buildlib/environment.mak.in 2005-03-08 13:00:38.000000000 +0900 @@ -11,8 +11,8 @@ LIBSTDCPP_VER = @LIBSTDCPP_VER@ # Linker stuff -PICFLAGS+= -fPIC -DPIC -LFLAGS+= @LDFLAGS@ +PICFLAGS+= -fno-common -DPIC +LFLAGS+= @LDFLAGS@ -framework CoreFoundation LEFLAGS+= SOCKETLIBS:= @SOCKETLIBS@ AR:=@AR@ @@ -47,11 +47,13 @@ # Shared library things HOST_OS = @host_os@ -ifneq ($(words $(filter linux-gnu gnu%,$(HOST_OS))),0) - SONAME_MAGIC=-Wl,-soname -Wl, - LFLAGS_SO= -else - # Do not know how to create shared libraries here. - ONLYSTATICLIBS = yes -endif +#ifneq ($(words $(filter linux-gnu gnu%,$(HOST_OS))),0) +# SONAME_MAGIC=-Wl,-soname -Wl, +# LFLAGS_SO= +#else +# # Do not know how to create shared libraries here. +# ONLYSTATICLIBS = yes +#endif +SONAME_MAGIC=-install_name @PREFIX@/lib/ +LFLAGS_SO=-dynamiclib diff -urN apt-0.5.4.orig/buildlib/library.mak apt-0.5.4/buildlib/library.mak --- apt-0.5.4.orig/buildlib/library.mak 2001-02-27 13:16:05.000000000 +0900 +++ apt-0.5.4/buildlib/library.mak 2005-03-08 13:00:38.000000000 +0900 @@ -15,17 +15,17 @@ # See defaults.mak for information about LOCAL # Some local definitions -LOCAL := lib$(LIBRARY)$(LIBEXT).so.$(MAJOR).$(MINOR) +LOCAL := lib$(LIBRARY)$(LIBEXT).$(MAJOR).$(MINOR).dylib $(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).$(MAJOR).dylib $(LOCAL)-SLIBS := $(SLIBS) $(LOCAL)-LIBRARY := $(LIBRARY) # Install the command hooks headers: $($(LOCAL)-HEADERS) -library: $(LIB)/lib$(LIBRARY).so $(LIB)/lib$(LIBRARY)$(LIBEXT).so.$(MAJOR) +library: $(LIB)/lib$(LIBRARY).dylib $(LIB)/lib$(LIBRARY)$(LIBEXT).$(MAJOR).dylib clean: clean/$(LOCAL) veryclean: veryclean/$(LOCAL) @@ -37,21 +37,23 @@ clean/$(LOCAL): -rm -f $($(@F)-OBJS) $($(@F)-DEP) veryclean/$(LOCAL): clean/$(LOCAL) - -rm -f $($(@F)-HEADERS) $(LIB)/lib$($(@F)-LIBRARY)*.so* + -rm -f $($(@F)-HEADERS) $(LIB)/lib$($(@F)-LIBRARY)*.dylib # Build rules for the two symlinks -.PHONY: $(LIB)/lib$(LIBRARY)$(LIBEXT).so.$(MAJOR) $(LIB)/lib$(LIBRARY).so -$(LIB)/lib$(LIBRARY)$(LIBEXT).so.$(MAJOR): $(LIB)/lib$(LIBRARY)$(LIBEXT).so.$(MAJOR).$(MINOR) +.PHONY: $(LIB)/lib$(LIBRARY)$(LIBEXT).$(MAJOR).dylib $(LIB)/lib$(LIBRARY).dylib +$(LIB)/lib$(LIBRARY)$(LIBEXT).$(MAJOR).dylib: $(LIB)/lib$(LIBRARY)$(LIBEXT).$(MAJOR).$(MINOR).dylib ln -sf $( /dev/null +$(LIB)/lib$(LIBRARY)$(LIBEXT).$(MAJOR).$(MINOR).dylib: $($(LOCAL)-HEADERS) $($(LOCAL)-OBJS) + -rm -f $(LIB)/lib$($(@F)-LIBRARY)*.dylib 2> /dev/null echo Building shared library $@ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(PICFLAGS) $(LFLAGS) $(LFLAGS_SO)\ - -o $@ $(SONAME_MAGIC)$($(@F)-SONAME) -shared \ + -o $@ $(SONAME_MAGIC)$($(@F)-SONAME) \ + -compatibility_version $(MAJOR).$(MINOR) \ + -current_version $(MAJOR).$(MINOR) \ $(filter %.opic,$^) \ $($(@F)-SLIBS) diff -urN apt-0.5.4.orig/buildlib/ostable apt-0.5.4/buildlib/ostable --- apt-0.5.4.orig/buildlib/ostable 2001-02-20 16:03:17.000000000 +0900 +++ apt-0.5.4/buildlib/ostable 2005-03-08 13:00:38.000000000 +0900 @@ -14,6 +14,7 @@ hp-hpux[^-]* hp-ux sun-solaris[^-]* solaris [^-]*-openbsd[^-]* openbsd +[^-]*-darwin[^-]* darwin # Catch all .* unknown diff -urN apt-0.5.4.orig/cmdline/apt-cache.cc apt-0.5.4/cmdline/apt-cache.cc --- apt-0.5.4.orig/cmdline/apt-cache.cc 2001-07-02 09:10:32.000000000 +0900 +++ apt-0.5.4/cmdline/apt-cache.cc 2009-05-16 03:26:33.000000000 -0400 @@ -374,8 +374,10 @@ if (ReadPinFile(Plcy) == false) return false; - pkgCache::VerFile **VFList = new pkgCache::VerFile *[Cache.HeaderP->PackageCount]; - memset(VFList,0,sizeof(*VFList)*Cache.HeaderP->PackageCount); + // Make sure we have a sentinel for the list. + unsigned long Count = Cache.HeaderP->PackageCount+1; + pkgCache::VerFile **VFList = new pkgCache::VerFile *[Count]; + memset(VFList,0,sizeof(*VFList)*Count); // Map versions that we want to write out onto the VerList array. for (pkgCache::PkgIterator P = Cache.PkgBegin(); P.end() == false; P++) @@ -428,7 +430,7 @@ VFList[P->ID] = VF; } - LocalitySort(VFList,Cache.HeaderP->PackageCount,sizeof(*VFList)); + LocalitySort(VFList,Count,sizeof(*VFList)); // Iterate over all the package files and write them out. char *Buffer = new char[Cache.HeaderP->MaxVerFileSize+10]; @@ -1361,7 +1363,7 @@ if (CmdL.DispatchArg(CmdsA,false) == false && _error->PendingError() == false) { - MMap *Map; + MMap *Map = 0; if (_config->FindB("APT::Cache::Generate",true) == false) { Map = new MMap(*new FileFd(_config->FindFile("Dir::Cache::pkgcache"), diff -urN apt-0.5.4.orig/cmdline/apt-get.cc apt-0.5.4/cmdline/apt-get.cc --- apt-0.5.4.orig/cmdline/apt-get.cc 2001-07-02 07:59:04.000000000 +0900 +++ apt-0.5.4/cmdline/apt-get.cc 2005-03-08 13:00:38.000000000 +0900 @@ -113,6 +113,8 @@ return true; } + fflush(NULL); + char C = 0; char Jnk = 0; if (read(STDIN_FILENO,&C,1) != 1) @@ -281,7 +283,14 @@ if (Cache[Targ].CandidateVerIter(Cache).end() == true) { if (Targ->ProvidesList == 0) - out << _("but it is not installable"); + { + out << _("but it is not installable. For Fink users, "); + out << _("this often means that you have attempted "); + out << _("to install a package from the binary distribution "); + out << _("which depends on a \"Restrictive\" package. "); + out << _("See , "); + out << _(""); + } else out << _("but it is a virtual package"); } @@ -569,7 +578,9 @@ return false; // Nothing is broken - if (DCache->BrokenCount() == 0 || AllowBroken == true) + // FINK LOCAL added APT::Get::Ignore-Breakage test + if (DCache->BrokenCount() == 0 || AllowBroken == true + || _config->FindB("APT::Get::Ignore-Breakage") == true) return true; // Attempt to fix broken things @@ -634,7 +645,9 @@ Stats(c1out,Cache); // Sanity check - if (Cache->BrokenCount() != 0) + // FINK LOCAL added APT::Get::Ignore-Breakage test + if (Cache->BrokenCount() != 0 + && _config->FindB("APT::Get::Ignore-Breakage",false) == false) { ShowBroken(c1out,Cache,false); return _error->Error("Internal Error, InstallPackages was called with broken packages!"); @@ -1019,7 +1032,9 @@ ExpectedInst++; // Install it with autoinstalling enabled. - if (State.InstBroken() == true && BrokenFix == false) + // FINK LOCAL added APT::Get::Ignore-Breakage test + if (State.InstBroken() == true && BrokenFix == false + && _config->FindB("APT::Get::Ignore-Breakage") == false) Cache.MarkInstall(Pkg,true); return true; } @@ -1366,7 +1381,9 @@ /* If we are in the Broken fixing mode we do not attempt to fix the problems. This is if the user invoked install without -f and gave packages */ - if (BrokenFix == true && Cache->BrokenCount() != 0) + // FINK LOCAL added APT::Get::Ignore-Breakage test + if (BrokenFix == true && Cache->BrokenCount() != 0 + && _config->FindB("APT::Get::Ignore-Breakage") == false) { c1out << _("You might want to run `apt-get -f install' to correct these:") << endl; ShowBroken(c1out,Cache,false); @@ -1376,11 +1393,13 @@ // Call the scored problem resolver Fix.InstallProtect(); - if (Fix.Resolve(true) == false) + // FINK LOCAL added APT::Get::Ignore-Breakage test + if (_config->FindB("APT::Get::Ignore-Breakage") == false && Fix.Resolve(true) == false) _error->Discard(); // Now we check the state of the packages, - if (Cache->BrokenCount() != 0) + // FINK LOCAL added APT::Get::Ignore-Breakage test + if (Cache->BrokenCount() != 0 && _config->FindB("APT::Get::Ignore-Breakage") == false) { c1out << _("Some packages could not be installed. This may mean that you have\n" @@ -1413,12 +1432,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()) + " "; } @@ -2057,6 +2076,8 @@ _config->Set("APT::Get::Simulate",false); _config->Set("APT::Get::Assume-Yes",false); _config->Set("APT::Get::Fix-Broken",false); + // FINK LOCAL added APT::Get::Ignore-Breakage + _config->Set("APT::Get::Ignore-Breakage",false); _config->Set("APT::Get::Force-Yes",false); _config->Set("APT::Get::APT::Get::No-List-Cleanup",true); } @@ -2094,6 +2115,8 @@ {'y',"yes","APT::Get::Assume-Yes",0}, {'y',"assume-yes","APT::Get::Assume-Yes",0}, {'f',"fix-broken","APT::Get::Fix-Broken",0}, + // FINK LOCAL added APT::Get::Ignore-Breakage + {0,"ignore-breakage","APT::Get::Ignore-Breakage",0}, {'u',"show-upgraded","APT::Get::Show-Upgraded",0}, {'m',"ignore-missing","APT::Get::Fix-Missing",0}, {'t',"target-release","APT::Default-Release",CommandLine::HasArg}, @@ -2151,6 +2174,22 @@ ShowHelp(CmdL); return 0; } + + /* FINK LOCAL begin */ + if (_config->FindB("APT::Get::Ignore-Breakage",false) == true) { + if (_config->FindB("APT::Get::Print-URIs",false) == false && + _config->FindB("APT::Get::Download-Only",false) == false) { + _error->Error("--ignore-breakage can only be used with --print-uris or --download-only"); + _error->DumpErrors(); + return 100; + } + if (strcmp(CmdL.FileList[0],"install") != 0) { + _error->Error("--ignore-breakage can only be used with apt-get install"); + _error->DumpErrors(); + return 100; + } + } + /* FINK LOCAL end */ // Deal with stdout not being a tty if (ttyname(STDOUT_FILENO) == 0 && _config->FindI("quiet",0) < 1) diff -urN apt-0.5.4.orig/cmdline/apt-sortpkgs.cc apt-0.5.4/cmdline/apt-sortpkgs.cc --- apt-0.5.4.orig/cmdline/apt-sortpkgs.cc 2001-02-20 02:03:17.000000000 -0500 +++ apt-0.5.4/cmdline/apt-sortpkgs.cc 2011-05-13 03:38:54.000000000 -0400 @@ -159,7 +159,7 @@ } /*}}}*/ -int main(unsigned int argc,const char *argv[]) +int main(int argc,const char *argv[]) { CommandLine::Args Args[] = { {'h',"help","help",0}, diff -urN apt-0.5.4.orig/configure apt-0.5.4/configure --- apt-0.5.4.orig/configure 2001-08-19 09:46:43.000000000 +0900 +++ apt-0.5.4/configure 2005-03-08 13:00:38.000000000 +0900 @@ -2394,7 +2394,7 @@ ac_given_srcdir=$srcdir -trap 'rm -fr `echo "environment.mak:buildlib/environment.mak.in makefile:buildlib/makefile.in include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "environment.mak:buildlib/environment.mak.in makefile.wrap:buildlib/makefile.in include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then @@ -2670,7 +2670,7 @@ EOF cat >> $CONFIG_STATUS <<\EOF -make -s dirs +make -f makefile.wrap -s dirs exit 0 EOF chmod +x $CONFIG_STATUS diff -urN apt-0.5.4.orig/configure.in apt-0.5.4/configure.in --- apt-0.5.4.orig/configure.in 2001-06-18 14:56:32.000000000 +0900 +++ apt-0.5.4/configure.in 2005-03-08 13:00:38.000000000 +0900 @@ -163,4 +163,4 @@ rc_LIBSTDCPP_VER ah_GCC3DEP -AC_OUTPUT(environment.mak:buildlib/environment.mak.in makefile:buildlib/makefile.in,make -s dirs) +AC_OUTPUT(environment.mak:buildlib/environment.mak.in makefile.wrap:buildlib/makefile.in,make -f makefile.wrap -s dirs) diff -urN apt-0.5.4.orig/doc/apt-cache.8 apt-0.5.4/doc/apt-cache.8 --- apt-0.5.4.orig/doc/apt-cache.8 2001-08-19 09:48:24.000000000 +0900 +++ apt-0.5.4/doc/apt-cache.8 2005-03-08 13:00:38.000000000 +0900 @@ -277,16 +277,16 @@ option. The syntax is \fB-o Foo::Bar=bar\fR. .SH "FILES" .TP -\fB\fI/etc/apt/sources.list\fB\fR +\fB\fI@PREFIX@/etc/apt/sources.list\fB\fR locations to fetch packages from. Configuration Item: Dir::Etc::SourceList. .TP -\fB\fI/var/lib/apt/lists/\fB\fR +\fB\fI@PREFIX@/var/lib/apt/lists/\fB\fR storage area for state information for each package resource specified in \fB\fIsources.list\fB\fR(5) Configuration Item: Dir::State::Lists. .TP -\fB\fI/var/lib/apt/lists/partial/\fB\fR +\fB\fI@PREFIX@/var/lib/apt/lists/partial/\fB\fR storage area for state information in transit. Configuration Item: Dir::State::Lists (implicit partial). .SH "SEE ALSO" diff -urN apt-0.5.4.orig/doc/apt-cdrom.8 apt-0.5.4/doc/apt-cdrom.8 --- apt-0.5.4.orig/doc/apt-cdrom.8 2001-08-19 09:48:25.000000000 +0900 +++ apt-0.5.4/doc/apt-cdrom.8 2005-03-08 13:00:38.000000000 +0900 @@ -32,7 +32,7 @@ APT uses a CDROM ID to track which disc is currently in the drive and maintains a database of these IDs in -\fI/var/lib/apt/cdroms.list\fR +\fI@PREFIX@/var/lib/apt/cdroms.list\fR .TP \fBident\fR A debugging tool to report the identity of the current disc as well diff -urN apt-0.5.4.orig/doc/apt-config.8 apt-0.5.4/doc/apt-config.8 --- apt-0.5.4.orig/doc/apt-config.8 2001-08-19 09:48:27.000000000 +0900 +++ apt-0.5.4/doc/apt-config.8 2005-03-08 13:00:38.000000000 +0900 @@ -13,7 +13,7 @@ .PP \fBapt-config\fR is an internal program used by various portions of the APT suite to provide consistent configurability. It accesses the main -configuarion file \fI/etc/apt/apt.conf\fR in a manner that is +configuarion file \fI@PREFIX@/etc/apt/apt.conf\fR in a manner that is easy to use by scripted applications. .PP Unless the \fB-h\fR, or \fB--help\fR option is given one of the diff -urN apt-0.5.4.orig/doc/apt-get.8 apt-0.5.4/doc/apt-get.8 --- apt-0.5.4.orig/doc/apt-get.8 2001-08-19 09:48:25.000000000 +0900 +++ apt-0.5.4/doc/apt-get.8 2005-03-08 13:00:38.000000000 +0900 @@ -20,7 +20,7 @@ \fBupdate\fR update is used to resynchronize the package index files from their sources. The indexes of available packages are fetched from the -location(s) specified in \fI/etc/apt/sources.list\fR. +location(s) specified in \fI@PREFIX@/etc/apt/sources.list\fR. For example, when using a Debian archive, this command retrieves and scans the \fIPackages.gz\fR files, so that information about new and updated packages is available. An update should always be @@ -31,7 +31,7 @@ \fBupgrade\fR upgrade is used to install the newest versions of all packages currently installed on the system from the sources enumerated in -\fI/etc/apt/sources.list\fR. Packages currently installed with +\fI@PREFIX@/etc/apt/sources.list\fR. Packages currently installed with new versions available are retrieved and upgraded; under no circumstances are currently installed packages removed, or packages not already installed retrieved and installed. New versions of currently installed packages that @@ -54,7 +54,7 @@ with new versions of packages; \fBapt-get\fR has a "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary. -The \fI/etc/apt/sources.list\fR file contains a list of locations +The \fI@PREFIX@/etc/apt/sources.list\fR file contains a list of locations from which to retrieve desired package files. .TP \fBinstall\fR @@ -63,7 +63,7 @@ filename (for instance, in a Debian GNU/Linux system, libc6 would be the argument provided, not em(libc6_1.9.6-2.deb)). All packages required by the package(s) specified for installation will also be retrieved and -installed. The \fI/etc/apt/sources.list\fR file is used to locate +installed. The \fI@PREFIX@/etc/apt/sources.list\fR file is used to locate the desired packages. If a hyphen is appended to the package name (with no intervening space), the identified package will be removed if it is installed. Similarly a plus sign can be used to designate a package to @@ -75,7 +75,7 @@ to select. This will cause that version to be located and selected for install. Alternatively a specific distribution can be selected by following the package name with a slash and the version of the -distribution or the Archive name (stable, frozen, unstable). +distribution or the Archive name (@DIST@/release or @DIST@/current). Both of the version selection mechanisms can downgrade packages and must be used with care. @@ -126,8 +126,8 @@ \fBclean\fR clean clears out the local repository of retrieved package files. It removes everything but the lock file from -\fI/var/cache/apt/archives/\fR and -\fI/var/cache/apt/archive/partial/\fR. When APT is used as a +\fI@PREFIX@/var/cache/apt/archives/\fR and +\fI@PREFIX@/var/cache/apt/archive/partial/\fR. When APT is used as a \fBdselect\fR(8) method, clean is run automatically. Those who do not use dselect will likely want to run apt-get clean from time to time to free up disk space. @@ -169,6 +169,17 @@ error in some situations. Configuration Item: APT::Get::Fix-Broken. .TP +\fB--ignore-breakage\fR +For mode \fBinstall\fR, ignore dependency problems. This option is +useful if you want to perform actions on just a particular package, +not its whole dependency tree. It must be used in conjunction with +\fB--download-only\fR or \fB--print-uris\fR. Configuration Item: +APT::Get::Ignore-Breakage. + +Note: The \fB--ignore-breakage\fR option was added by The Fink Project +and hence is only available in the \fBapt-get\fR provided by Fink's +\fBapt\fR package. +.TP \fB-m\fR .TP \fB--ignore-missing\fR @@ -284,7 +295,7 @@ \fB--list-cleanup\fR This option defaults to on, use --no-list-cleanup to turn it off. When on \fBapt-get\fR will automatically manage the contents of -\fI/var/lib/apt/lists\fR to ensure that obsolete files are erased. +\fI@PREFIX@/var/lib/apt/lists\fR to ensure that obsolete files are erased. The only reason to turn it off is if you frequently change your source list. Configuration Item: APT::Get::List-Cleanup. @@ -349,36 +360,36 @@ option. The syntax is \fB-o Foo::Bar=bar\fR. .SH "FILES" .TP -\fB\fI/etc/apt/sources.list\fB\fR +\fB\fI@PREFIX@/etc/apt/sources.list\fB\fR locations to fetch packages from. Configuration Item: Dir::Etc::SourceList. .TP -\fB\fI/etc/apt/apt.conf\fB\fR +\fB\fI@PREFIX@/etc/apt/apt.conf\fB\fR APT configuration file. Configuration Item: Dir::Etc::Main. .TP -\fB\fI/etc/apt/apt.conf.d/\fB\fR +\fB\fI@PREFIX@/etc/apt/apt.conf.d/\fB\fR APT configuration file fragments Configuration Item: Dir::Etc::Parts. .TP -\fB\fI/etc/apt/preferences\fB\fR +\fB\fI@PREFIX@/etc/apt/preferences\fB\fR version preferences file Configuration Item: Dir::Etc::Preferences. .TP -\fB\fI/var/cache/apt/archives/\fB\fR +\fB\fI@PREFIX@/var/cache/apt/archives/\fB\fR storage area for retrieved package files. Configuration Item: Dir::Cache::Archives. .TP -\fB\fI/var/cache/apt/archives/partial/\fB\fR +\fB\fI@PREFIX@/var/cache/apt/archives/partial/\fB\fR storage area for package files in transit. Configuration Item: Dir::Cache::Archives (implicit partial). .TP -\fB\fI/var/lib/apt/lists/\fB\fR +\fB\fI@PREFIX@/var/lib/apt/lists/\fB\fR storage area for state information for each package resource specified in \fB\fIsources.list\fB\fR(5) Configuration Item: Dir::State::Lists. .TP -\fB\fI/var/lib/apt/lists/partial/\fB\fR +\fB\fI@PREFIX@/var/lib/apt/lists/partial/\fB\fR storage area for state information in transit. Configuration Item: Dir::State::Lists (implicit partial). .SH "SEE ALSO" diff -urN apt-0.5.4.orig/doc/apt_preferences.5 apt-0.5.4/doc/apt_preferences.5 --- apt-0.5.4.orig/doc/apt_preferences.5 2001-08-19 09:48:28.000000000 +0900 +++ apt-0.5.4/doc/apt_preferences.5 2005-03-08 13:00:38.000000000 +0900 @@ -12,7 +12,7 @@ It is meant to be user editable and manipulatable from software. The file consists of a number of records formed like the dpkg status file, space seperated sections of text with at the start of each line tags seperated -by a colon. It is stored in \fI/etc/apt/preferences\fR. +by a colon. It is stored in \fI@PREFIX@/etc/apt/preferences\fR. .SH "VERSIONING" .PP One purpose of the preferences file is to let the user select which version diff -urN apt-0.5.4.orig/doc/sources.list.5 apt-0.5.4/doc/sources.list.5 --- apt-0.5.4.orig/doc/sources.list.5 2001-08-19 09:48:26.000000000 +0900 +++ apt-0.5.4/doc/sources.list.5 2005-03-08 13:00:38.000000000 +0900 @@ -11,7 +11,7 @@ The package resource list is used to locate archives of the package distribution system in use on the system. At this time, this manual page documents only the packaging system used by the Debian GNU/Linux system. -This control file is located in \fI/etc/apt/sources.list\fR +This control file is located in \fI@PREFIX@/etc/apt/sources.list\fR .PP The source list is designed to support any number of active sources and a variety of source media. The file lists one source per line, with the @@ -25,9 +25,8 @@ .PP The deb type describes a typical two-level Debian archive, \fIdistribution/component\fR. Typically, distribution is -generally one of stable, unstable, or -frozen, while component is one of main, -contrib, non-free, or non-us. The +generally one of @DIST@/release or @DIST@/current, +while component is one of main or crypto. The deb-src type describes a debian distribution's source code in the same form as the deb type. A deb-src line is required to fetch source indexes. diff -urN apt-0.5.4.orig/dselect/install apt-0.5.4/dselect/install --- apt-0.5.4.orig/dselect/install 2001-02-20 16:03:17.000000000 +0900 +++ apt-0.5.4/dselect/install 2005-03-08 13:00:38.000000000 +0900 @@ -3,8 +3,8 @@ # Get the configuration from /etc/apt/apt.conf CLEAN="prompt" OPTS="-f" -APTGET="/usr/bin/apt-get" -DPKG="/usr/bin/dpkg" +APTGET="@PREFIX@/bin/apt-get" +DPKG="@PREFIX@/bin/dpkg" DPKG_OPTS="--admindir=$1" APT_OPT0="-oDir::State::status=$1/status" APT_OPT1="-oDPkg::Options::=$DPKG_OPTS" diff -urN apt-0.5.4.orig/dselect/setup apt-0.5.4/dselect/setup --- apt-0.5.4.orig/dselect/setup 2000-01-27 13:15:10.000000000 +0900 +++ apt-0.5.4/dselect/setup 2005-03-08 13:00:38.000000000 +0900 @@ -23,15 +23,17 @@ my $vardir=$ARGV[0]; my $method=$ARGV[1]; my $option=$ARGV[2]; -my $config_file = '/etc/apt/sources.list'; +my $config_file = '@PREFIX@/etc/apt/sources.list'; -my $boldon=`setterm -bold on`; -my $boldoff=`setterm -bold off`; +my $boldon=`setterm -bold on 2>/dev/null`; +my $boldoff=`setterm -bold off 2>/dev/null`; +$boldon = "" unless defined $boldon; +$boldoff = "" unless defined $boldon; my @known_types = ('deb'); my @known_access = ('http', 'ftp', 'file'); -my @typical_distributions = ('stable', 'unstable', 'frozen', 'non-US'); -my @typical_components = ('main', 'contrib', 'non-free'); +my @typical_distributions = ('@DIST@/release', '@DIST@/current'); +my @typical_components = ('main', 'crypto'); my %known_access = map {($_,$_)} @known_access; my %typical_distributions = map {($_,$_)} @typical_distributions; @@ -118,9 +120,9 @@ } $type = 'deb'; - $urn = "http://http.us.debian.org/debian" unless $urn; - $distribution = "stable" unless $distribution; - $components = "main contrib non-free" unless $components; + $urn = "http://us.dl.sourceforge.net/fink/direct_download" unless $urn; + $distribution = "@DIST@/release" unless $distribution; + $components = "main" unless $components; $rec->{'Type'} = 'deb'; @@ -222,19 +224,13 @@ print "\t$boldon Set up a list of distribution source locations $boldoff \n"; print "\n"; - print " Please give the base URL of the debian distribution.\n"; + print " Please give the base URL of the Fink distribution.\n"; print " The access schemes I know about are:$boldon "; print join (' ', @known_access), "$boldoff\n"; -# print " The mirror scheme is special that it does not specify the\n"; -# print " location of a debian archive but specifies the location\n"; -# print " of a list of mirrors to use to access the archive.\n"; print "\n"; print " For example:\n"; - print " file:/mnt/debian,\n"; - print " ftp://ftp.debian.org/debian,\n"; - print " http://ftp.de.debian.org/debian,\n"; -# print " and the special mirror scheme,\n"; -# print " mirror:http://www.debian.org/archivemirrors \n"; + print " file:@PREFIX@/fink,\n"; + print " http://us.dl.sourceforge.net/fink/direct_download\n"; print "\n"; my $index = 0; @@ -269,7 +265,10 @@ print "-" x 72, "\n"; &print_config('Config' => \@Oldconfig); print "-" x 72, "\n"; - print "$boldon Do you wish to change (overwrite) it?[y/N]$boldoff "; + print "$boldon In most cases, this file was installed by Fink or by apt," + ." and$boldoff\n"; + print "$boldon should NOT be changed. " . + "Do you wish to change (overwrite) it?[y/N]$boldoff "; my $answer = ; chomp ($answer); $answer =~ s/\s+/ /og; diff -urN apt-0.5.4.orig/dselect/update apt-0.5.4/dselect/update --- apt-0.5.4.orig/dselect/update 2001-03-13 10:45:36.000000000 +0900 +++ apt-0.5.4/dselect/update 2005-03-08 13:00:38.000000000 +0900 @@ -4,13 +4,13 @@ # Get the configuration from /etc/apt/apt.conf CLEAN="prompt" OPTS="-f" -APTGET="/usr/bin/apt-get" -APTCACHE="/usr/bin/apt-cache" -DPKG="/usr/bin/dpkg" +APTGET="@PREFIX@/bin/apt-get" +APTCACHE="@PREFIX@/bin/apt-cache" +DPKG="@PREFIX@/bin/dpkg" DPKG_OPTS="--admindir=$1" APT_OPT0="-oDir::State::status=$1/status" APT_OPT1="-oDPkg::Options::=$DPKG_OPTS" -CACHEDIR="/var/cache/apt" +CACHEDIR="@PREFIX@/var/cache/apt" PROMPT="false" RES=`apt-config shell CLEAN DSelect::Clean OPTS DSelect::UpdateOptions \ DPKG Dir::Bin::dpkg/f APTGET Dir::Bin::apt-get/f \ diff -urN apt-0.5.4.orig/methods/connect.cc apt-0.5.4/methods/connect.cc --- apt-0.5.4.orig/methods/connect.cc 2001-02-20 16:03:18.000000000 +0900 +++ apt-0.5.4/methods/connect.cc 2005-03-08 13:10:40.000000000 +0900 @@ -90,7 +90,11 @@ // Check the socket for an error condition unsigned int Err; - unsigned int Len = sizeof(Err); +#ifndef HAVE_SOCKLEN_T + int Len = sizeof(Err); +#else + socklen_t Len = sizeof(Err); +#endif if (getsockopt(Fd,SOL_SOCKET,SO_ERROR,&Err,&Len) != 0) return _error->Errno("getsockopt","Failed"); diff -urN apt-0.5.4.orig/methods/ftp.cc apt-0.5.4/methods/ftp.cc --- apt-0.5.4.orig/methods/ftp.cc 2001-05-22 13:02:00.000000000 +0900 +++ apt-0.5.4/methods/ftp.cc 2005-03-08 13:09:26.000000000 +0900 @@ -694,7 +694,11 @@ if (WaitFd(DataFd,true,TimeOut) == false) return _error->Error("Could not connect data socket, connection timed out"); unsigned int Err; - unsigned int Len = sizeof(Err); +#ifndef HAVE_SOCKLEN_T + int Len = sizeof(Err); +#else + socklen_t Len = sizeof(Err); +#endif if (getsockopt(DataFd,SOL_SOCKET,SO_ERROR,&Err,&Len) != 0) return _error->Errno("getsockopt","Failed"); if (Err != 0) diff -urN apt-0.5.4.orig/methods/rfc2553emu.h apt-0.5.4/methods/rfc2553emu.h --- apt-0.5.4.orig/methods/rfc2553emu.h 2000-06-18 15:04:45.000000000 +0900 +++ apt-0.5.4/methods/rfc2553emu.h 2005-03-08 13:00:38.000000000 +0900 @@ -26,6 +26,11 @@ #include #include +// Always use full emulation on Darwin: +// netdb.h has the structures and constants, but getnameinfo() is missing +// and getaddrinfo() seems to be broken +#ifndef __APPLE__ + // Autosense getaddrinfo #if defined(AI_PASSIVE) && defined(EAI_NONAME) #define HAVE_GETADDRINFO @@ -36,6 +41,8 @@ #define HAVE_GETNAMEINFO #endif +#endif /* __APPLE__ */ + // getaddrinfo support? #ifndef HAVE_GETADDRINFO // Renamed to advoid type clashing.. (for debugging) @@ -101,6 +108,9 @@ #define NI_NAMEREQD (1<<3) #define NI_DATAGRAM (1<<4) #endif + #ifndef NI_DATAGRAM + #define NI_DATAGRAM NI_DGRAM + #endif #define sockaddr_storage sockaddr_in #endif diff -urN apt-0.5.4.orig/patch_flush apt-0.5.4/patch_flush --- apt-0.5.4.orig/patch_flush 1970-01-01 09:00:00.000000000 +0900 +++ apt-0.5.4/patch_flush 2005-03-08 13:00:38.000000000 +0900 @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +files=`find . -name '*.cc' -print | xargs grep -l 'flush;'` + +for i in $files ; do + sed 's/<< flush;/<< flush, fflush(NULL);/g' <$i >$i.tmp + mv $i.tmp $i +done + +exit 0 diff -urN apt-0.5.4/apt-inst/contrib/extracttar.cc apt-new/apt-inst/contrib/extracttar.cc --- apt-0.5.4/apt-inst/contrib/extracttar.cc 2001-05-27 19:47:09.000000000 -0400 +++ apt-new/apt-inst/contrib/extracttar.cc 2005-11-25 06:27:24.000000000 -0500 @@ -144,6 +144,18 @@ return true; } /*}}}*/ + +// Handle the ridiculous way that tar stores large numbers +static bool TarUIDToNum(const char *Str, unsigned long &Res, unsigned Len) { + switch (*Str) { + case '\200': + Res = ntohl(*((unsigned long *)(Str + Len - sizeof(unsigned long)))); + return true; + default: + return StrToNum(Str+1, Res, Len-1, 8); + } +} + // ExtractTar::Go - Perform extraction /*{{{*/ // --------------------------------------------------------------------- /* This reads each 512 byte block from the archive and extracts the header @@ -193,8 +205,8 @@ unsigned long UID; unsigned long GID; if (StrToNum(Tar->Mode,Itm.Mode,sizeof(Tar->Mode),8) == false || - StrToNum(Tar->UserID,UID,sizeof(Tar->UserID),8) == false || - StrToNum(Tar->GroupID,GID,sizeof(Tar->GroupID),8) == false || + TarUIDToNum(Tar->UserID,Itm.UID,sizeof(Tar->UserID)) == false || + TarUIDToNum(Tar->GroupID,Itm.GID,sizeof(Tar->GroupID)) == false || StrToNum(Tar->Size,Itm.Size,sizeof(Tar->Size),8) == false || StrToNum(Tar->MTime,Itm.MTime,sizeof(Tar->MTime),8) == false || StrToNum(Tar->Major,Itm.Major,sizeof(Tar->Major),8) == false || --- apt-0.5.4/apt-pkg/contrib/system.h~ 1999-12-10 17:40:29.000000000 -0600 +++ apt-0.5.4/apt-pkg/contrib/system.h 2008-12-08 00:45:25.000000000 -0600 @@ -25,12 +25,6 @@ #define MAX(x,y) _max(x,y) #endif -// GNU C++ has a min/max operator -#if defined(__GNUG__) -#define MIN(A,B) ((A) ? (B)) -#endif - /* Templates tend to mess up existing code that uses min/max because of the strict matching requirements */ #if !defined(MIN) --- apt-0.5.4/apt-inst/extract.cc.orig 2013-06-18 14:02:07.000000000 -0400 +++ apt-0.5.4/apt-inst/extract.cc 2013-06-18 14:07:02.000000000 -0400 @@ -164,7 +164,7 @@ if (Res.length() > sizeof(FileName)) return _error->Error("The path %s is too long",Res.c_str()); if (Debug == true) - clog << "Followed conf file from " << FileName << " to " << Res << endl; + std::clog << "Followed conf file from " << FileName << " to " << Res << std::endl; Itm.Name = strcpy(FileName,Res.c_str()); } @@ -242,7 +242,7 @@ } if (Debug == true) - clog << "Extract " << string(Itm.Name,End) << endl; + std::clog << "Extract " << string(Itm.Name,End) << std::endl; /* if (Count != 0) return _error->Error("Done");*/ @@ -265,7 +265,7 @@ bool pkgExtract::Aborted() { if (Debug == true) - clog << "Aborted, backing out" << endl; + std::clog << "Aborted, backing out" << std::endl; pkgFLCache::NodeIterator Files = FLPkg.Files(); map_ptrloc *Last = &FLPkg->Files; @@ -306,21 +306,21 @@ pkgFLCache::Node::Replaced) { if (Debug == true) - clog << "De-replaced " << FileName << " from " << Nde.RealPackage()->Name << endl; + std::clog << "De-replaced " << FileName << " from " << Nde.RealPackage()->Name << std::endl; Nde->Flags &= ~pkgFLCache::Node::Replaced; } } // Undo the change in the filesystem if (Debug == true) - clog << "Backing out " << FileName; + std::clog << "Backing out " << FileName; // Remove a new node if ((Files->Flags & pkgFLCache::Node::NewFile) == pkgFLCache::Node::NewFile) { if (Debug == true) - clog << " [new node]" << endl; + std::clog << " [new node]" << std::endl; pkgFLCache::Node *Tmp = Files; Files++; *Last = Tmp->NextPkg; @@ -331,7 +331,7 @@ else { if (Debug == true) - clog << endl; + std::clog << std::endl; Last = &Files->NextPkg; Files++; @@ -420,7 +420,7 @@ if (debVS.CheckDep(Pkg.CurrentVer().VerStr(),Dep->CompareOp,Dep.TargetVer()) == true) { if (Debug == true) - clog << "Replaced file " << Nde.DirN() << '/' << Nde.File() << " from " << Pkg.Name() << endl; + std::clog << "Replaced file " << Nde.DirN() << '/' << Nde.File() << " from " << Pkg.Name() << std::endl; Nde->Flags |= pkgFLCache::Node::Replaced; Ok = true; break; --- apt-0.5.4/apt-inst/deb/dpkgdb.cc.orig 2013-06-18 14:05:01.000000000 -0400 +++ apt-0.5.4/apt-inst/deb/dpkgdb.cc 2013-06-18 14:06:09.000000000 -0400 @@ -401,12 +401,12 @@ return false; } - cout << "Node: " << FList->HeaderP->NodeCount << ',' << FList->HeaderP->UniqNodes << endl; - cout << "Dir: " << FList->HeaderP->DirCount << endl; - cout << "Package: " << FList->HeaderP->PackageCount << endl; - cout << "HashSize: " << FList->HeaderP->HashSize << endl; - cout << "Size: " << FileMap->Size() << endl; - cout << endl; + std::cout << "Node: " << FList->HeaderP->NodeCount << ',' << FList->HeaderP->UniqNodes << std::endl; + std::cout << "Dir: " << FList->HeaderP->DirCount << std::endl; + std::cout << "Package: " << FList->HeaderP->PackageCount << std::endl; + std::cout << "HashSize: " << FList->HeaderP->HashSize << std::endl; + std::cout << "Size: " << FileMap->Size() << std::endl; + std::cout << std::endl; return true; } --- apt-0.5.4/apt-pkg/algorithms.cc.orig 2013-06-18 13:19:25.000000000 -0400 +++ apt-0.5.4/apt-pkg/algorithms.cc 2013-06-18 13:56:47.000000000 -0400 @@ -75,8 +75,8 @@ PkgIterator Pkg = Sim.FindPkg(iPkg.Name()); Flags[Pkg->ID] = 1; - cout << "Inst "; - Describe(Pkg,cout,false); + std::cout << "Inst "; + Describe(Pkg,std::cout,false); Sim.MarkInstall(Pkg,false); // Look for broken conflicts+predepends. @@ -96,7 +96,7 @@ { if ((Sim[End] & pkgDepCache::DepGInstall) == 0) { - cout << " [" << I.Name() << " on " << Start.TargetPkg().Name() << ']'; + std::cout << " [" << I.Name() << " on " << Start.TargetPkg().Name() << ']'; if (Start->Type == pkgCache::Dep::Conflicts) _error->Error("Fatal, conflicts violated %s",I.Name()); } @@ -107,7 +107,7 @@ if (Sim.BrokenCount() != 0) ShortBreaks(); else - cout << endl; + std::cout << std::endl; return true; } /*}}}*/ @@ -125,7 +125,7 @@ // Sim.MarkInstall(Pkg,false); if (Sim[Pkg].InstBroken() == true) { - cout << "Conf " << Pkg.Name() << " broken" << endl; + std::cout << "Conf " << Pkg.Name() << " broken" << std::endl; Sim.Update(); @@ -137,26 +137,26 @@ continue; if (D->Type == pkgCache::Dep::Obsoletes) - cout << " Obsoletes:" << D.TargetPkg().Name(); + std::cout << " Obsoletes:" << D.TargetPkg().Name(); else if (D->Type == pkgCache::Dep::Conflicts) - cout << " Conflicts:" << D.TargetPkg().Name(); + std::cout << " Conflicts:" << D.TargetPkg().Name(); else - cout << " Depends:" << D.TargetPkg().Name(); + std::cout << " Depends:" << D.TargetPkg().Name(); } - cout << endl; + std::cout << std::endl; _error->Error("Conf Broken %s",Pkg.Name()); } else { - cout << "Conf "; - Describe(Pkg,cout,false); + std::cout << "Conf "; + Describe(Pkg,std::cout,false); } if (Sim.BrokenCount() != 0) ShortBreaks(); else - cout << endl; + std::cout << std::endl; return true; } @@ -172,15 +172,15 @@ Flags[Pkg->ID] = 3; Sim.MarkDelete(Pkg); if (Purge == true) - cout << "Purg "; + std::cout << "Purg "; else - cout << "Remv "; - Describe(Pkg,cout,false); + std::cout << "Remv "; + Describe(Pkg,std::cout,false); if (Sim.BrokenCount() != 0) ShortBreaks(); else - cout << endl; + std::cout << std::endl; return true; } @@ -190,18 +190,18 @@ /* */ void pkgSimulate::ShortBreaks() { - cout << " ["; + std::cout << " ["; for (PkgIterator I = Sim.PkgBegin(); I.end() == false; I++) { if (Sim[I].InstBroken() == true) { if (Flags[I->ID] == 0) - cout << I.Name() << ' '; + std::cout << I.Name() << ' '; /* else - cout << I.Name() << "! ";*/ + std::cout << I.Name() << "! ";*/ } } - cout << ']' << endl; + std::cout << ']' << std::endl; } /*}}}*/ // ApplyStatus - Adjust for non-ok packages /*{{{*/ @@ -599,7 +599,7 @@ if ((Flags[P->ID] & Protected) == Protected) { if (Debug == true) - clog << " Reinst Failed because of protected " << P.Name() << endl; + std::clog << " Reinst Failed because of protected " << P.Name() << std::endl; Fail = true; } else @@ -610,7 +610,7 @@ if (DoUpgrade(P) == false) { if (Debug == true) - clog << " Reinst Failed because of " << P.Name() << endl; + std::clog << " Reinst Failed because of " << P.Name() << std::endl; Fail = true; } else @@ -628,7 +628,7 @@ break; if (Debug == true) - clog << " Reinst Failed early because of " << Start.TargetPkg().Name() << endl; + std::clog << " Reinst Failed early because of " << Start.TargetPkg().Name() << std::endl; Fail = true; } } @@ -652,7 +652,7 @@ } if (Debug == true) - clog << " Re-Instated " << Pkg.Name() << endl; + std::clog << " Re-Instated " << Pkg.Name() << std::endl; return true; } /*}}}*/ @@ -700,7 +700,7 @@ while (Again == true); if (Debug == true) - clog << "Starting" << endl; + std::clog << "Starting" << std::endl; MakeScores(); @@ -725,7 +725,7 @@ } */ if (Debug == true) - clog << "Starting 2" << endl; + std::clog << "Starting 2" << std::endl; /* Now consider all broken packages. For each broken package we either remove the package or fix it's problem. We do this once, it should @@ -748,7 +748,7 @@ (Flags[I->ID] & ReInstateTried) == 0) { if (Debug == true) - clog << " Try to Re-Instate " << I.Name() << endl; + std::clog << " Try to Re-Instate " << I.Name() << std::endl; unsigned long OldBreaks = Cache.BrokenCount(); pkgCache::Version *OldVer = Cache[I].InstallVer; Flags[I->ID] &= ReInstateTried; @@ -764,14 +764,14 @@ } else if (Debug == true) - clog << "Re-Instated " << I.Name() << " (" << OldBreaks << " vs " << Cache.BrokenCount() << ')' << endl; + std::clog << "Re-Instated " << I.Name() << " (" << OldBreaks << " vs " << Cache.BrokenCount() << ')' << std::endl; } if (Cache[I].InstallVer == 0 || Cache[I].InstBroken() == false) continue; if (Debug == true) - cout << "Investigating " << I.Name() << endl; + std::cout << "Investigating " << I.Name() << std::endl; // Isolate the problem dependency PackageKill KillList[100]; @@ -796,14 +796,14 @@ if ((Flags[I->ID] & Protected) != Protected) { if (Debug == true) - clog << " Or group remove for " << I.Name() << endl; + std::clog << " Or group remove for " << I.Name() << std::endl; Cache.MarkDelete(I); } } if (OldEnd == LEnd && OrOp == OrKeep) { if (Debug == true) - clog << " Or group keep for " << I.Name() << endl; + std::clog << " Or group keep for " << I.Name() << std::endl; Cache.MarkKeep(I); } } @@ -831,7 +831,7 @@ continue; if (Debug == true) - clog << "Package " << I.Name() << " has broken dep on " << Start.TargetPkg().Name() << endl; + std::clog << "Package " << I.Name() << " has broken dep on " << Start.TargetPkg().Name() << std::endl; /* Look across the version list. If there are no possible targets then we keep the package and bail. This is necessary @@ -861,8 +861,8 @@ pkgCache::PkgIterator Pkg = Ver.ParentPkg(); if (Debug == true) - clog << " Considering " << Pkg.Name() << ' ' << (int)Scores[Pkg->ID] << - " as a solution to " << I.Name() << ' ' << (int)Scores[I->ID] << endl; + std::clog << " Considering " << Pkg.Name() << ' ' << (int)Scores[Pkg->ID] << + " as a solution to " << I.Name() << ' ' << (int)Scores[I->ID] << std::endl; /* Try to fix the package under consideration rather than fiddle with the VList package */ @@ -899,7 +899,7 @@ Cache.MarkInstall(I,false); if (Debug == true) - clog << " Holding Back " << I.Name() << " rather than change " << Start.TargetPkg().Name() << endl; + std::clog << " Holding Back " << I.Name() << " rather than change " << Start.TargetPkg().Name() << std::endl; } else { @@ -909,7 +909,7 @@ if (InOr == false) { if (Debug == true) - clog << " Removing " << I.Name() << " rather than change " << Start.TargetPkg().Name() << endl; + std::clog << " Removing " << I.Name() << " rather than change " << Start.TargetPkg().Name() << std::endl; Cache.MarkDelete(I); if (Counter > 1) { @@ -940,7 +940,7 @@ continue; if (Debug == true) - clog << " Added " << Pkg.Name() << " to the remove list" << endl; + std::clog << " Added " << Pkg.Name() << " to the remove list" << std::endl; LEnd->Pkg = Pkg; LEnd->Dep = End; @@ -971,12 +971,12 @@ Cache.MarkInstall(I,false); if (Debug == true) - clog << " Holding Back " << I.Name() << " because I can't find " << Start.TargetPkg().Name() << endl; + std::clog << " Holding Back " << I.Name() << " because I can't find " << Start.TargetPkg().Name() << std::endl; } else { if (Debug == true) - clog << " Removing " << I.Name() << " because I can't find " << Start.TargetPkg().Name() << endl; + std::clog << " Removing " << I.Name() << " because I can't find " << Start.TargetPkg().Name() << std::endl; if (InOr == false) Cache.MarkDelete(I); } @@ -1005,14 +1005,14 @@ J->Dep->Type == pkgCache::Dep::Obsoletes) { if (Debug == true) - clog << " Fixing " << I.Name() << " via remove of " << J->Pkg.Name() << endl; + std::clog << " Fixing " << I.Name() << " via remove of " << J->Pkg.Name() << std::endl; Cache.MarkDelete(J->Pkg); } } else { if (Debug == true) - clog << " Fixing " << I.Name() << " via keep of " << J->Pkg.Name() << endl; + std::clog << " Fixing " << I.Name() << " via keep of " << J->Pkg.Name() << std::endl; Cache.MarkKeep(J->Pkg); } @@ -1027,7 +1027,7 @@ } if (Debug == true) - clog << "Done" << endl; + std::clog << "Done" << std::endl; if (Cache.BrokenCount() != 0) { @@ -1056,7 +1056,7 @@ unsigned long Size = Cache.Head().PackageCount; if (Debug == true) - clog << "Entering ResolveByKeep" << endl; + std::clog << "Entering ResolveByKeep" << std::endl; MakeScores(); @@ -1085,7 +1085,7 @@ if ((Flags[I->ID] & Protected) == 0) { if (Debug == true) - clog << "Keeping package " << I.Name() << endl; + std::clog << "Keeping package " << I.Name() << std::endl; Cache.MarkKeep(I); if (Cache[I].InstBroken() == false) { @@ -1120,14 +1120,14 @@ // Hm, the group is broken.. I have no idea how to handle this if (Start != End) { - clog << "Note, a broken or group was found in " << I.Name() << "." << endl; + std::clog << "Note, a broken or group was found in " << I.Name() << "." << std::endl; if ((Flags[I->ID] & Protected) == 0) Cache.MarkKeep(I); break; } if (Debug == true) - clog << "Package " << I.Name() << " has broken dep on " << End.TargetPkg().Name() << endl; + std::clog << "Package " << I.Name() << " has broken dep on " << End.TargetPkg().Name() << std::endl; // Look at all the possible provides on this package SPtrArray VList = End.AllTargets(); @@ -1144,7 +1144,7 @@ if ((Flags[I->ID] & Protected) == 0) { if (Debug == true) - clog << " Keeping Package " << Pkg.Name() << " due to dep" << endl; + std::clog << " Keeping Package " << Pkg.Name() << " due to dep" << std::endl; Cache.MarkKeep(Pkg); } --- apt-0.5.4/apt-pkg/init.cc.orig 2013-06-18 13:18:38.000000000 -0400 +++ apt-0.5.4/apt-pkg/init.cc 2013-06-18 13:18:50.000000000 -0400 @@ -15,6 +15,7 @@ #include #include #include +#include extern void initDebSystem(); /*}}}*/ --- apt-0.5.4/apt-pkg/deb/debsystem.cc.orig 2013-06-18 13:13:53.000000000 -0400 +++ apt-0.5.4/apt-pkg/deb/debsystem.cc 2013-06-18 13:59:15.000000000 -0400 @@ -26,6 +26,7 @@ #include #include #include +#include /*}}}*/ /* FINK LOCAL begin */ #include @@ -330,25 +331,25 @@ std::ofstream finkstatus(FINKSTATUSFILE); if(macosx_version.version != 0) { - finkstatus << "Package: macosx" << endl; - finkstatus << "Status: install ok installed" << endl; - finkstatus << "Priority: optional" << endl; - finkstatus << "Section: base" << endl; - finkstatus << "Maintainer: None" << endl; - finkstatus << "Source: macosx" << endl; - finkstatus << "Version: " << macosx_version.version << endl; - finkstatus << "Description: Pseudo package representing Mac OS X" << endl; - finkstatus << " Pseudo package representing Mac OS X" << endl << endl; + finkstatus << "Package: macosx" << std::endl; + finkstatus << "Status: install ok installed" << std::endl; + finkstatus << "Priority: optional" << std::endl; + finkstatus << "Section: base" << std::endl; + finkstatus << "Maintainer: None" << std::endl; + finkstatus << "Source: macosx" << std::endl; + finkstatus << "Version: " << macosx_version.version << std::endl; + finkstatus << "Description: Pseudo package representing Mac OS X" << std::endl; + finkstatus << " Pseudo package representing Mac OS X" << std::endl << std::endl; } - finkstatus << "Package: darwin" << endl; - finkstatus << "Status: install ok installed" << endl; - finkstatus << "Priority: optional" << endl; - finkstatus << "Section: base" << endl; - finkstatus << "Maintainer: None" << endl; - finkstatus << "Source: darwin" << endl; - finkstatus << "Version: " << darwin_version.version << endl; - finkstatus << "Description: Pseudo package representing Darwin" << endl; - finkstatus << " Pseudo package representing Darwin" << endl << endl; + finkstatus << "Package: darwin" << std::endl; + finkstatus << "Status: install ok installed" << std::endl; + finkstatus << "Priority: optional" << std::endl; + finkstatus << "Section: base" << std::endl; + finkstatus << "Maintainer: None" << std::endl; + finkstatus << "Source: darwin" << std::endl; + finkstatus << "Version: " << darwin_version.version << std::endl; + finkstatus << "Description: Pseudo package representing Darwin" << std::endl; + finkstatus << " Pseudo package representing Darwin" << std::endl << std::endl; finkstatus.close(); } FinkStatusFile = new debStatusIndex(FINKSTATUSFILE); --- apt-0.5.4/apt-pkg/contrib/cdromutl.cc.orig 2013-06-18 13:08:41.000000000 -0400 +++ apt-0.5.4/apt-pkg/contrib/cdromutl.cc 2013-06-18 13:11:01.000000000 -0400 @@ -29,6 +29,7 @@ #include #include #include +#include /*}}}*/ // IsMounted - Returns true if the mount point is mounted /*{{{*/ --- apt-0.5.4/cmdline/apt-cache.cc.orig 2013-06-18 14:12:28.000000000 -0400 +++ apt-0.5.4/cmdline/apt-cache.cc 2013-06-18 15:00:01.000000000 -0400 @@ -127,29 +127,29 @@ // Oops, it failed.. if (Header == false) - ioprintf(cout,_("Package %s version %s has an unmet dep:\n"), + ioprintf(std::cout,_("Package %s version %s has an unmet dep:\n"), P.Name(),V.VerStr()); Header = true; // Print out the dep type - cout << " " << End.DepType() << ": "; + std::cout << " " << End.DepType() << ": "; // Show the group Start = RealStart; do { - cout << Start.TargetPkg().Name(); + std::cout << Start.TargetPkg().Name(); if (Start.TargetVer() != 0) - cout << " (" << Start.CompType() << " " << Start.TargetVer() << + std::cout << " (" << Start.CompType() << " " << Start.TargetVer() << ")"; if (Start == End) break; - cout << " | "; + std::cout << " | "; Start++; } while (1); - cout << endl; + std::cout << std::endl; } } } @@ -171,48 +171,48 @@ continue; } - cout << "Package: " << Pkg.Name() << endl; - cout << "Versions: " << endl; + std::cout << "Package: " << Pkg.Name() << std::endl; + std::cout << "Versions: " << std::endl; for (pkgCache::VerIterator Cur = Pkg.VersionList(); Cur.end() != true; Cur++) { - cout << Cur.VerStr(); + std::cout << Cur.VerStr(); for (pkgCache::VerFileIterator Vf = Cur.FileList(); Vf.end() == false; Vf++) - cout << "(" << Vf.File().FileName() << ")"; - cout << endl; + std::cout << "(" << Vf.File().FileName() << ")"; + std::cout << std::endl; } - cout << endl; + std::cout << std::endl; - cout << "Reverse Depends: " << endl; + std::cout << "Reverse Depends: " << std::endl; for (pkgCache::DepIterator D = Pkg.RevDependsList(); D.end() != true; D++) { - cout << " " << D.ParentPkg().Name() << ',' << D.TargetPkg().Name(); + std::cout << " " << D.ParentPkg().Name() << ',' << D.TargetPkg().Name(); if (D->Version != 0) - cout << ' ' << DeNull(D.TargetVer()) << endl; + std::cout << ' ' << DeNull(D.TargetVer()) << std::endl; else - cout << endl; + std::cout << std::endl; } - cout << "Dependencies: " << endl; + std::cout << "Dependencies: " << std::endl; for (pkgCache::VerIterator Cur = Pkg.VersionList(); Cur.end() != true; Cur++) { - cout << Cur.VerStr() << " - "; + std::cout << Cur.VerStr() << " - "; for (pkgCache::DepIterator Dep = Cur.DependsList(); Dep.end() != true; Dep++) - cout << Dep.TargetPkg().Name() << " (" << (int)Dep->CompareOp << " " << DeNull(Dep.TargetVer()) << ") "; - cout << endl; + std::cout << Dep.TargetPkg().Name() << " (" << (int)Dep->CompareOp << " " << DeNull(Dep.TargetVer()) << ") "; + std::cout << std::endl; } - cout << "Provides: " << endl; + std::cout << "Provides: " << std::endl; for (pkgCache::VerIterator Cur = Pkg.VersionList(); Cur.end() != true; Cur++) { - cout << Cur.VerStr() << " - "; + std::cout << Cur.VerStr() << " - "; for (pkgCache::PrvIterator Prv = Cur.ProvidesList(); Prv.end() != true; Prv++) - cout << Prv.ParentPkg().Name() << " "; - cout << endl; + std::cout << Prv.ParentPkg().Name() << " "; + std::cout << std::endl; } - cout << "Reverse Provides: " << endl; + std::cout << "Reverse Provides: " << std::endl; for (pkgCache::PrvIterator Prv = Pkg.ProvidesList(); Prv.end() != true; Prv++) - cout << Prv.OwnerPkg().Name() << " " << Prv.OwnerVer().VerStr() << endl; + std::cout << Prv.OwnerPkg().Name() << " " << Prv.OwnerVer().VerStr() << std::endl; } return true; @@ -224,8 +224,8 @@ bool Stats(CommandLine &Cmd) { pkgCache &Cache = *GCache; - cout << _("Total Package Names : ") << Cache.Head().PackageCount << " (" << - SizeToStr(Cache.Head().PackageCount*Cache.Head().PackageSz) << ')' << endl; + std::cout << _("Total Package Names : ") << Cache.Head().PackageCount << " (" << + SizeToStr(Cache.Head().PackageCount*Cache.Head().PackageSz) << ')' << std::endl; int Normal = 0; int Virtual = 0; @@ -264,21 +264,21 @@ continue; } } - cout << _(" Normal Packages: ") << Normal << endl; - cout << _(" Pure Virtual Packages: ") << Virtual << endl; - cout << _(" Single Virtual Packages: ") << DVirt << endl; - cout << _(" Mixed Virtual Packages: ") << NVirt << endl; - cout << _(" Missing: ") << Missing << endl; - - cout << _("Total Distinct Versions: ") << Cache.Head().VersionCount << " (" << - SizeToStr(Cache.Head().VersionCount*Cache.Head().VersionSz) << ')' << endl; - cout << _("Total Dependencies: ") << Cache.Head().DependsCount << " (" << - SizeToStr(Cache.Head().DependsCount*Cache.Head().DependencySz) << ')' << endl; - - cout << _("Total Ver/File relations: ") << Cache.Head().VerFileCount << " (" << - SizeToStr(Cache.Head().VerFileCount*Cache.Head().VerFileSz) << ')' << endl; - cout << _("Total Provides Mappings: ") << Cache.Head().ProvidesCount << " (" << - SizeToStr(Cache.Head().ProvidesCount*Cache.Head().ProvidesSz) << ')' << endl; + std::cout << _(" Normal Packages: ") << Normal << std::endl; + std::cout << _(" Pure Virtual Packages: ") << Virtual << std::endl; + std::cout << _(" Single Virtual Packages: ") << DVirt << std::endl; + std::cout << _(" Mixed Virtual Packages: ") << NVirt << std::endl; + std::cout << _(" Missing: ") << Missing << std::endl; + + std::cout << _("Total Distinct Versions: ") << Cache.Head().VersionCount << " (" << + SizeToStr(Cache.Head().VersionCount*Cache.Head().VersionSz) << ')' << std::endl; + std::cout << _("Total Dependencies: ") << Cache.Head().DependsCount << " (" << + SizeToStr(Cache.Head().DependsCount*Cache.Head().DependencySz) << ')' << std::endl; + + std::cout << _("Total Ver/File relations: ") << Cache.Head().VerFileCount << " (" << + SizeToStr(Cache.Head().VerFileCount*Cache.Head().VerFileSz) << ')' << std::endl; + std::cout << _("Total Provides Mappings: ") << Cache.Head().ProvidesCount << " (" << + SizeToStr(Cache.Head().ProvidesCount*Cache.Head().ProvidesSz) << ')' << std::endl; // String list stats unsigned long Size = 0; @@ -289,7 +289,7 @@ Count++; Size += strlen(Cache.StrP + I->String) + 1; } - cout << _("Total Globbed Strings: ") << Count << " (" << SizeToStr(Size) << ')' << endl; + std::cout << _("Total Globbed Strings: ") << Count << " (" << SizeToStr(Size) << ')' << std::endl; unsigned long DepVerSize = 0; for (pkgCache::PkgIterator P = Cache.PkgBegin(); P.end() == false; P++) @@ -303,12 +303,12 @@ } } } - cout << _("Total Dependency Version space: ") << SizeToStr(DepVerSize) << endl; + std::cout << _("Total Dependency Version space: ") << SizeToStr(DepVerSize) << std::endl; unsigned long Slack = 0; for (int I = 0; I != 7; I++) Slack += Cache.Head().Pools[I].ItemSize*Cache.Head().Pools[I].Count; - cout << _("Total Slack space: ") << SizeToStr(Slack) << endl; + std::cout << _("Total Slack space: ") << SizeToStr(Slack) << std::endl; unsigned long Total = 0; Total = Slack + Size + Cache.Head().DependsCount*Cache.Head().DependencySz + @@ -316,7 +316,7 @@ Cache.Head().PackageCount*Cache.Head().PackageSz + Cache.Head().VerFileCount*Cache.Head().VerFileSz + Cache.Head().ProvidesCount*Cache.Head().ProvidesSz; - cout << _("Total Space Accounted for: ") << SizeToStr(Total) << endl; + std::cout << _("Total Space Accounted for: ") << SizeToStr(Total) << std::endl; return true; } @@ -327,36 +327,36 @@ bool Dump(CommandLine &Cmd) { pkgCache &Cache = *GCache; - cout << "Using Versioning System: " << Cache.VS->Label << endl; + std::cout << "Using Versioning System: " << Cache.VS->Label << std::endl; for (pkgCache::PkgIterator P = Cache.PkgBegin(); P.end() == false; P++) { - cout << "Package: " << P.Name() << endl; + std::cout << "Package: " << P.Name() << std::endl; for (pkgCache::VerIterator V = P.VersionList(); V.end() == false; V++) { - cout << " Version: " << V.VerStr() << endl; - cout << " File: " << V.FileList().File().FileName() << endl; + std::cout << " Version: " << V.VerStr() << std::endl; + std::cout << " File: " << V.FileList().File().FileName() << std::endl; for (pkgCache::DepIterator D = V.DependsList(); D.end() == false; D++) - cout << " Depends: " << D.TargetPkg().Name() << ' ' << - DeNull(D.TargetVer()) << endl; + std::cout << " Depends: " << D.TargetPkg().Name() << ' ' << + DeNull(D.TargetVer()) << std::endl; } } for (pkgCache::PkgFileIterator F = Cache.FileBegin(); F.end() == false; F++) { - cout << "File: " << F.FileName() << endl; - cout << " Type: " << F.IndexType() << endl; - cout << " Size: " << F->Size << endl; - cout << " ID: " << F->ID << endl; - cout << " Flags: " << F->Flags << endl; - cout << " Time: " << TimeRFC1123(F->mtime) << endl; - cout << " Archive: " << DeNull(F.Archive()) << endl; - cout << " Component: " << DeNull(F.Component()) << endl; - cout << " Version: " << DeNull(F.Version()) << endl; - cout << " Origin: " << DeNull(F.Origin()) << endl; - cout << " Site: " << DeNull(F.Site()) << endl; - cout << " Label: " << DeNull(F.Label()) << endl; - cout << " Architecture: " << DeNull(F.Architecture()) << endl; + std::cout << "File: " << F.FileName() << std::endl; + std::cout << " Type: " << F.IndexType() << std::endl; + std::cout << " Size: " << F->Size << std::endl; + std::cout << " ID: " << F->ID << std::endl; + std::cout << " Flags: " << F->Flags << std::endl; + std::cout << " Time: " << TimeRFC1123(F->mtime) << std::endl; + std::cout << " Archive: " << DeNull(F.Archive()) << std::endl; + std::cout << " Component: " << DeNull(F.Component()) << std::endl; + std::cout << " Version: " << DeNull(F.Version()) << std::endl; + std::cout << " Origin: " << DeNull(F.Origin()) << std::endl; + std::cout << " Site: " << DeNull(F.Site()) << std::endl; + std::cout << " Label: " << DeNull(F.Label()) << std::endl; + std::cout << " Architecture: " << DeNull(F.Architecture()) << std::endl; } return true; @@ -541,25 +541,25 @@ pkgCache::VerIterator Ver = Pkg.VersionList(); if (Ver.end() == true) { - cout << '<' << Pkg.Name() << '>' << endl; + std::cout << '<' << Pkg.Name() << '>' << std::endl; continue; } - cout << Pkg.Name() << endl; + std::cout << Pkg.Name() << std::endl; for (pkgCache::DepIterator D = Ver.DependsList(); D.end() == false; D++) { if ((D->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or) - cout << " |"; + std::cout << " |"; else - cout << " "; + std::cout << " "; // Show the package pkgCache::PkgIterator Trg = D.TargetPkg(); if (Trg->VersionList == 0) - cout << D.DepType() << ": <" << Trg.Name() << ">" << endl; + std::cout << D.DepType() << ": <" << Trg.Name() << ">" << std::endl; else - cout << D.DepType() << ": " << Trg.Name() << endl; + std::cout << D.DepType() << ": " << Trg.Name() << std::endl; if (Recurse == true) Colours[D.TargetPkg()->ID]++; @@ -573,7 +573,7 @@ if (V != Cache.VerP + V.ParentPkg()->VersionList || V->ParentPkg == D->Package) continue; - cout << " " << V.ParentPkg().Name() << endl; + std::cout << " " << V.ParentPkg().Name() << std::endl; if (Recurse == true) Colours[D.ParentPkg()->ID]++; @@ -1075,7 +1075,7 @@ continue; if (strncmp(I.Name(),CmdL.FileList[1],strlen(CmdL.FileList[1])) == 0) - cout << I.Name() << endl; + std::cout << I.Name() << std::endl; } return true; @@ -1086,7 +1086,7 @@ { if (All == false && I->VersionList == 0) continue; - cout << I.Name() << endl; + std::cout << I.Name() << std::endl; } return true; @@ -1111,7 +1111,7 @@ pkgSrcRecords::Parser *Parse; while ((Parse = SrcRecs.Find(*I,false)) != 0) - cout << Parse->AsStr() << endl;; + std::cout << Parse->AsStr() << std::endl;; } return true; } @@ -1132,7 +1132,7 @@ // Print out all of the package files if (CmdL.FileList[1] == 0) { - cout << _("Package Files:") << endl; + std::cout << _("Package Files:") << std::endl; for (pkgCache::PkgFileIterator F = Cache.FileBegin(); F.end() == false; F++) { // Locate the associated index files so we can derive a description @@ -1152,7 +1152,7 @@ } // Show any packages have explicit pins - cout << _("Pinned Packages:") << endl; + std::cout << _("Pinned Packages:") << std::endl; pkgCache::PkgIterator I = Cache.PkgBegin(); for (;I.end() != true; I++) { @@ -1160,13 +1160,13 @@ continue; // Print the package name and the version we are forcing to - cout << " " << I.Name() << " -> "; + std::cout << " " << I.Name() << " -> "; pkgCache::VerIterator V = Plcy.GetMatch(I); if (V.end() == true) - cout << _("(not found)") << endl; + std::cout << _("(not found)") << std::endl; else - cout << V.VerStr() << endl; + std::cout << V.VerStr() << std::endl; } return true; @@ -1182,43 +1182,43 @@ continue; } - cout << Pkg.Name() << ":" << endl; + std::cout << Pkg.Name() << ":" << std::endl; // Installed version - cout << _(" Installed: "); + std::cout << _(" Installed: "); if (Pkg->CurrentVer == 0) - cout << _("(none)") << endl; + std::cout << _("(none)") << std::endl; else - cout << Pkg.CurrentVer().VerStr() << endl; + std::cout << Pkg.CurrentVer().VerStr() << std::endl; // Candidate Version - cout << _(" Candidate: "); + std::cout << _(" Candidate: "); pkgCache::VerIterator V = Plcy.GetCandidateVer(Pkg); if (V.end() == true) - cout << _("(none)") << endl; + std::cout << _("(none)") << std::endl; else - cout << V.VerStr() << endl; + std::cout << V.VerStr() << std::endl; // Pinned version if (Plcy.GetPriority(Pkg) != 0) { - cout << _(" Package Pin: "); + std::cout << _(" Package Pin: "); V = Plcy.GetMatch(Pkg); if (V.end() == true) - cout << _("(not found)") << endl; + std::cout << _("(not found)") << std::endl; else - cout << V.VerStr() << endl; + std::cout << V.VerStr() << std::endl; } // Show the priority tables - cout << _(" Version Table:") << endl; + std::cout << _(" Version Table:") << std::endl; for (V = Pkg.VersionList(); V.end() == false; V++) { if (Pkg.CurrentVer() == V) - cout << " *** " << V.VerStr(); + std::cout << " *** " << V.VerStr(); else - cout << " " << V.VerStr(); - cout << " " << Plcy.GetPriority(Pkg) << endl; + std::cout << " " << V.VerStr(); + std::cout << " " << Plcy.GetPriority(Pkg) << std::endl; for (pkgCache::VerFileIterator VF = V.FileList(); VF.end() == false; VF++) { // Locate the associated index files so we can derive a description @@ -1253,10 +1253,10 @@ /* */ bool ShowHelp(CommandLine &Cmd) { - ioprintf(cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION, + ioprintf(std::cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION, COMMON_OS,COMMON_CPU,__DATE__,__TIME__); - cout << + std::cout << _("Usage: apt-cache [options] command\n" " apt-cache [options] add file1 [file1 ...]\n" " apt-cache [options] showpkg pkg1 [pkg2 ...]\n" --- apt-0.5.4/cmdline/apt-config.cc.orig 2013-06-18 14:09:25.000000000 -0400 +++ apt-0.5.4/cmdline/apt-config.cc 2013-06-18 14:22:41.000000000 -0400 @@ -43,8 +43,8 @@ key.append("d"); if (_config->ExistsAny(key.c_str())) - cout << *I << "='" << - SubstVar(_config->FindAny(key.c_str()),"'","'\\''") << '\'' << endl; + std::cout << *I << "='" << + SubstVar(_config->FindAny(key.c_str()),"'","'\\''") << '\'' << std::endl; } @@ -65,12 +65,12 @@ /* */ int ShowHelp() { - ioprintf(cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION, + ioprintf(std::cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION, COMMON_OS,COMMON_CPU,__DATE__,__TIME__); if (_config->FindB("version") == true) return 0; - cout << + std::cout << _("Usage: apt-config [options] command\n" "\n" "apt-config is a simple tool to read the APT config file\n" --- apt-0.5.4/cmdline/apt-extracttemplates.cc.orig 2013-06-18 14:26:35.000000000 -0400 +++ apt-0.5.4/cmdline/apt-extracttemplates.cc 2013-06-18 14:29:38.000000000 -0400 @@ -219,13 +219,13 @@ /* */ int ShowHelp(void) { - ioprintf(cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION, + ioprintf(std::cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION, COMMON_OS,COMMON_CPU,__DATE__,__TIME__); if (_config->FindB("version") == true) return 0; - cout << + std::cout << _("Usage: apt-extracttemplates file1 [file2 ...]\n" "\n" "apt-extracttemplates is a tool to extract config and template info\n" @@ -272,8 +272,8 @@ if (templatefile.empty() == true || configscript.empty() == true) return; - cout << file.Package << " " << file.Version << " " - << templatefile << " " << configscript << endl; + std::cout << file.Package << " " << file.Version << " " + << templatefile << " " << configscript << std::endl; } /*}}}*/ // InitCache - initialize the package cache /*{{{*/ @@ -309,7 +309,7 @@ { // Check to make sure debconf dependencies are // satisfied - cout << "Check " << file.DepVer << ',' << debconfver << endl; + std::cout << "Check " << file.DepVer << ',' << debconfver << std::endl; if (file.DepVer != "" && DebFile::Cache->VS->CheckDep(debconfver.c_str(), file.DepOp,file.DepVer.c_str() --- apt-0.5.4/cmdline/apt-sortpkgs.cc.orig 2013-06-18 14:14:06.000000000 -0400 +++ apt-0.5.4/cmdline/apt-sortpkgs.cc 2013-06-18 14:22:16.000000000 -0400 @@ -138,12 +138,12 @@ /* */ int ShowHelp() { - ioprintf(cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION, + ioprintf(std::cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION, COMMON_OS,COMMON_CPU,__DATE__,__TIME__); if (_config->FindB("version") == true) return 0; - cout << + std::cout << _("Usage: apt-sortpkgs [options] file1 [file2 ...]\n" "\n" "apt-sortpkgs is a simple tool to sort package files. The -s option is used\n" --- apt-0.5.4/apt-inst/contrib/extracttar.cc.orig 2013-06-18 14:00:53.000000000 -0400 +++ apt-0.5.4/apt-inst/contrib/extracttar.cc 2013-06-18 14:01:35.000000000 -0400 @@ -134,7 +134,7 @@ Args[1] = "-d"; Args[2] = 0; execv(Args[0],(char **)Args); - cerr << "Failed to exec gzip " << Args[0] << endl; + std::cerr << "Failed to exec gzip " << Args[0] << std::endl; _exit(100); } --- apt-0.5.4/apt-pkg/deb/debsystem.h.orig 2013-06-18 13:16:56.000000000 -0400 +++ apt-0.5.4/apt-pkg/deb/debsystem.h 2013-06-18 13:17:31.000000000 -0400 @@ -35,7 +35,7 @@ virtual bool Initialize(Configuration &Cnf); virtual bool ArchiveSupported(const char *Type); virtual signed Score(Configuration const &Cnf); - virtual bool AddStatusFiles(vector &List); + virtual bool AddStatusFiles(std::vector &List); virtual bool FindIndex(pkgCache::PkgFileIterator File, pkgIndexFile *&Found) const; --- apt-0.5.4/apt-pkg/pkgsystem.h.orig 2013-06-18 16:52:54.000000000 -0400 +++ apt-0.5.4/apt-pkg/pkgsystem.h 2013-06-18 16:53:53.000000000 -0400 @@ -79,7 +79,7 @@ virtual bool ArchiveSupported(const char *Type) = 0; // Return a list of system index files.. - virtual bool AddStatusFiles(vector &List) = 0; + virtual bool AddStatusFiles(std::vector &List) = 0; virtual bool FindIndex(pkgCache::PkgFileIterator File, pkgIndexFile *&Found) const = 0;