diff options
-rw-r--r-- | apt-inst/dirstream.cc | 14 | ||||
-rw-r--r-- | apt-pkg/acquire-method.cc | 229 | ||||
-rw-r--r-- | apt-pkg/algorithms.cc | 4 | ||||
-rw-r--r-- | apt-pkg/cacheset.h | 26 | ||||
-rw-r--r-- | apt-pkg/cdrom.cc | 88 | ||||
-rw-r--r-- | apt-pkg/contrib/cdromutl.cc | 16 | ||||
-rw-r--r-- | apt-pkg/contrib/error.cc | 2 | ||||
-rw-r--r-- | apt-pkg/deb/dpkgpm.cc | 5 | ||||
-rw-r--r-- | apt-pkg/depcache.cc | 4 | ||||
-rw-r--r-- | apt-pkg/orderlist.cc | 2 | ||||
-rw-r--r-- | cmdline/apt-cache.cc | 3 | ||||
-rw-r--r-- | cmdline/apt-get.cc | 23 | ||||
-rw-r--r-- | debian/apt-utils.symbols | 6 | ||||
-rw-r--r-- | debian/apt.lintian-overrides | 2 | ||||
-rw-r--r-- | debian/apt.symbols | 83 | ||||
-rw-r--r-- | debian/changelog | 23 | ||||
-rwxr-xr-x | debian/rules | 3 | ||||
-rw-r--r-- | test/integration/framework | 52 | ||||
-rwxr-xr-x | test/integration/test-ubuntu-bug-761175-remove-purge | 38 | ||||
-rw-r--r-- | test/testextract.cc | 7 |
20 files changed, 361 insertions, 269 deletions
diff --git a/apt-inst/dirstream.cc b/apt-inst/dirstream.cc index 586bbf739..9b6a56848 100644 --- a/apt-inst/dirstream.cc +++ b/apt-inst/dirstream.cc @@ -43,11 +43,17 @@ bool pkgDirStream::DoItem(Item &Itm,int &Fd) // fchmod deals with umask and fchown sets the ownership if (fchmod(iFd,Itm.Mode) != 0) - return _error->Errno("fchmod",_("Failed to write file %s"), - Itm.Name); + { + _error->Errno("fchmod",_("Failed to write file %s"), Itm.Name); + close(iFd); + return false; + } if (fchown(iFd,Itm.UID,Itm.GID) != 0 && errno != EPERM) - return _error->Errno("fchown",_("Failed to write file %s"), - Itm.Name); + { + return _error->Errno("fchown",_("Failed to write file %s"), Itm.Name); + close(iFd); + return false; + } Fd = iFd; return true; } diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc index fb45d9ee7..2f29f7932 100644 --- a/apt-pkg/acquire-method.cc +++ b/apt-pkg/acquire-method.cc @@ -25,7 +25,6 @@ #include <iostream> #include <stdarg.h> #include <stdio.h> -#include <unistd.h> #include <sys/signal.h> /*}}}*/ @@ -36,32 +35,28 @@ using namespace std; /* This constructs the initialization text */ pkgAcqMethod::pkgAcqMethod(const char *Ver,unsigned long Flags) { - char S[300] = ""; - char *End = S; - strcat(End,"100 Capabilities\n"); - sprintf(End+strlen(End),"Version: %s\n",Ver); + std::cout << "100 Capabilities\n" + << "Version: " << Ver << "\n"; if ((Flags & SingleInstance) == SingleInstance) - strcat(End,"Single-Instance: true\n"); - + std::cout << "Single-Instance: true\n"; + if ((Flags & Pipeline) == Pipeline) - strcat(End,"Pipeline: true\n"); - + std::cout << "Pipeline: true\n"; + if ((Flags & SendConfig) == SendConfig) - strcat(End,"Send-Config: true\n"); + std::cout << "Send-Config: true\n"; if ((Flags & LocalOnly) == LocalOnly) - strcat(End,"Local-Only: true\n"); + std::cout <<"Local-Only: true\n"; if ((Flags & NeedsCleanup) == NeedsCleanup) - strcat(End,"Needs-Cleanup: true\n"); + std::cout << "Needs-Cleanup: true\n"; if ((Flags & Removable) == Removable) - strcat(End,"Removable: true\n"); - strcat(End,"\n"); + std::cout << "Removable: true\n"; - if (write(STDOUT_FILENO,S,strlen(S)) != (signed)strlen(S)) - exit(100); + std::cout << "\n" << std::flush; SetNonBlock(STDIN_FILENO,true); @@ -94,13 +89,11 @@ void pkgAcqMethod::Fail(string Err,bool Transient) if (*I == '\n') *I = ' '; } - - char S[1024]; - char *End = S; + if (Queue != 0) { - End += snprintf(S,sizeof(S)-50,"400 URI Failure\nURI: %s\n" - "Message: %s %s\n",Queue->Uri.c_str(), Err.c_str(), IP.c_str()); + std::cout << "400 URI Failure\nURI: " << Queue->Uri << "\n" + << "Message: " << Err << " " << IP << "\n"; // Dequeue FetchItem *Tmp = Queue; Queue = Queue->Next; @@ -109,22 +102,17 @@ void pkgAcqMethod::Fail(string Err,bool Transient) QueueBack = Queue; } else - { - End += snprintf(S,sizeof(S)-50,"400 URI Failure\nURI: <UNKNOWN>\n" - "Message: %s\n",Err.c_str()); - } + std::cout << "400 URI Failure\nURI: <UNKNOWN>\nMessage: " << Err << "\n"; + if(FailReason.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"FailReason: %s\n",FailReason.c_str()); + std::cout << "FailReason: " << FailReason << "\n"; if (UsedMirror.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"UsedMirror: %s\n",UsedMirror.c_str()); - // Set the transient flag + std::cout << "UsedMirror: " << UsedMirror << "\n"; + // Set the transient flag if (Transient == true) - strcat(S,"Transient-Failure: true\n\n"); - else - strcat(S,"\n"); - - if (write(STDOUT_FILENO,S,strlen(S)) != (signed)strlen(S)) - exit(100); + std::cout << "Transient-Failure: true\n"; + + std::cout << "\n" << std::flush; } /*}}}*/ // AcqMethod::URIStart - Indicate a download is starting /*{{{*/ @@ -134,27 +122,22 @@ void pkgAcqMethod::URIStart(FetchResult &Res) { if (Queue == 0) abort(); - - char S[1024] = ""; - char *End = S; - - End += snprintf(S,sizeof(S),"200 URI Start\nURI: %s\n",Queue->Uri.c_str()); + + std::cout << "200 URI Start\n" + << "URI: " << Queue->Uri << "\n"; if (Res.Size != 0) - End += snprintf(End,sizeof(S)-4 - (End - S),"Size: %lu\n",Res.Size); - + std::cout << "Size: " << Res.Size << "\n"; + if (Res.LastModified != 0) - End += snprintf(End,sizeof(S)-4 - (End - S),"Last-Modified: %s\n", - TimeRFC1123(Res.LastModified).c_str()); - + std::cout << "Last-Modified: " << TimeRFC1123(Res.LastModified) << "\n"; + if (Res.ResumePoint != 0) - End += snprintf(End,sizeof(S)-4 - (End - S),"Resume-Point: %lu\n", - Res.ResumePoint); + std::cout << "Resume-Point: " << Res.ResumePoint << "\n"; + if (UsedMirror.empty() == false) - End += snprintf(End,sizeof(S)-4 - (End - S),"UsedMirror: %s\n",UsedMirror.c_str()); - - strcat(End,"\n"); - if (write(STDOUT_FILENO,S,strlen(S)) != (signed)strlen(S)) - exit(100); + std::cout << "UsedMirror: " << UsedMirror << "\n"; + + std::cout << "\n" << std::flush; } /*}}}*/ // AcqMethod::URIDone - A URI is finished /*{{{*/ @@ -164,76 +147,65 @@ void pkgAcqMethod::URIDone(FetchResult &Res, FetchResult *Alt) { if (Queue == 0) abort(); - - char S[1024] = ""; - char *End = S; - - End += snprintf(S,sizeof(S),"201 URI Done\nURI: %s\n",Queue->Uri.c_str()); + + std::cout << "201 URI Done\n" + << "URI: " << Queue->Uri << "\n"; if (Res.Filename.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"Filename: %s\n",Res.Filename.c_str()); - + std::cout << "Filename: " << Res.Filename << "\n"; + if (Res.Size != 0) - End += snprintf(End,sizeof(S)-50 - (End - S),"Size: %lu\n",Res.Size); - + std::cout << "Size: " << Res.Size << "\n"; + if (Res.LastModified != 0) - End += snprintf(End,sizeof(S)-50 - (End - S),"Last-Modified: %s\n", - TimeRFC1123(Res.LastModified).c_str()); + std::cout << "Last-Modified: " << TimeRFC1123(Res.LastModified) << "\n"; if (Res.MD5Sum.empty() == false) - { - End += snprintf(End,sizeof(S)-50 - (End - S),"MD5-Hash: %s\n",Res.MD5Sum.c_str()); - End += snprintf(End,sizeof(S)-50 - (End - S),"MD5Sum-Hash: %s\n",Res.MD5Sum.c_str()); - } + std::cout << "MD5-Hash: " << Res.MD5Sum << "\n" + << "MD5Sum-Hash: " << Res.MD5Sum << "\n"; if (Res.SHA1Sum.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"SHA1-Hash: %s\n",Res.SHA1Sum.c_str()); + std::cout << "SHA1-Hash: " << Res.SHA1Sum << "\n"; if (Res.SHA256Sum.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"SHA256-Hash: %s\n",Res.SHA256Sum.c_str()); + std::cout << "SHA256-Hash: " << Res.SHA256Sum << "\n"; if (UsedMirror.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"UsedMirror: %s\n",UsedMirror.c_str()); - if (Res.GPGVOutput.size() > 0) - End += snprintf(End,sizeof(S)-50 - (End - S),"GPGVOutput:\n"); - for (vector<string>::iterator I = Res.GPGVOutput.begin(); - I != Res.GPGVOutput.end(); I++) - End += snprintf(End,sizeof(S)-50 - (End - S), " %s\n", (*I).c_str()); + std::cout << "UsedMirror: " << UsedMirror << "\n"; + if (Res.GPGVOutput.empty() == false) + { + std::cout << "GPGVOutput:\n"; + for (vector<string>::const_iterator I = Res.GPGVOutput.begin(); + I != Res.GPGVOutput.end(); ++I) + std::cout << " " << *I << "\n"; + } if (Res.ResumePoint != 0) - End += snprintf(End,sizeof(S)-50 - (End - S),"Resume-Point: %lu\n", - Res.ResumePoint); + std::cout << "Resume-Point: " << Res.ResumePoint << "\n"; if (Res.IMSHit == true) - strcat(End,"IMS-Hit: true\n"); - End = S + strlen(S); - + std::cout << "IMS-Hit: true\n"; + if (Alt != 0) { if (Alt->Filename.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"Alt-Filename: %s\n",Alt->Filename.c_str()); - + std::cout << "Alt-Filename: " << Alt->Filename << "\n"; + if (Alt->Size != 0) - End += snprintf(End,sizeof(S)-50 - (End - S),"Alt-Size: %lu\n",Alt->Size); - + std::cout << "Alt-Size: " << Alt->Size << "\n"; + if (Alt->LastModified != 0) - End += snprintf(End,sizeof(S)-50 - (End - S),"Alt-Last-Modified: %s\n", - TimeRFC1123(Alt->LastModified).c_str()); - + std::cout << "Alt-Last-Modified: " << TimeRFC1123(Alt->LastModified) << "\n"; + if (Alt->MD5Sum.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"Alt-MD5-Hash: %s\n", - Alt->MD5Sum.c_str()); + std::cout << "Alt-MD5-Hash: " << Alt->MD5Sum << "\n"; if (Alt->SHA1Sum.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"Alt-SHA1-Hash: %s\n", - Alt->SHA1Sum.c_str()); + std::cout << "Alt-SHA1-Hash: " << Alt->SHA1Sum << "\n"; if (Alt->SHA256Sum.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"Alt-SHA256-Hash: %s\n", - Alt->SHA256Sum.c_str()); - + std::cout << "Alt-SHA256-Hash: " << Alt->SHA256Sum << "\n"; + if (Alt->IMSHit == true) - strcat(End,"Alt-IMS-Hit: true\n"); + std::cout << "Alt-IMS-Hit: true\n"; } - - strcat(End,"\n"); - if (write(STDOUT_FILENO,S,strlen(S)) != (signed)strlen(S)) - exit(100); + + std::cout << "\n" << std::flush; // Dequeue FetchItem *Tmp = Queue; @@ -249,13 +221,10 @@ void pkgAcqMethod::URIDone(FetchResult &Res, FetchResult *Alt) to be ackd */ bool pkgAcqMethod::MediaFail(string Required,string Drive) { - char S[1024]; - snprintf(S,sizeof(S),"403 Media Failure\nMedia: %s\nDrive: %s\n\n", + fprintf(stdout, "403 Media Failure\nMedia: %s\nDrive: %s\n", Required.c_str(),Drive.c_str()); + std::cout << "\n" << std::flush; - if (write(STDOUT_FILENO,S,strlen(S)) != (signed)strlen(S)) - exit(100); - vector<string> MyMessages; /* Here we read messages until we find a 603, each non 603 message is @@ -414,22 +383,15 @@ void pkgAcqMethod::Log(const char *Format,...) string CurrentURI = "<UNKNOWN>"; if (Queue != 0) CurrentURI = Queue->Uri; - + fprintf(stdout, "101 Log\nURI: %s\nUsedMirror: %s\nMessage: ", + UsedMirror.c_str(), CurrentURI.c_str()); + va_list args; va_start(args,Format); + vfprintf(stdout,Format,args); + va_end(args); - // sprintf the description - char S[1024]; - unsigned int Len = snprintf(S,sizeof(S)-4,"101 Log\n" - "URI: %s\n" - "UsedMirror: %s\n" - "Message: ", UsedMirror.c_str(), - CurrentURI.c_str()); - vsnprintf(S+Len,sizeof(S)-4-Len,Format,args); - strcat(S,"\n\n"); - - if (write(STDOUT_FILENO,S,strlen(S)) != (signed)strlen(S)) - exit(100); + std::cout << "\n\n" << std::flush; } /*}}}*/ // AcqMethod::Status - Send a status message /*{{{*/ @@ -440,23 +402,15 @@ void pkgAcqMethod::Status(const char *Format,...) string CurrentURI = "<UNKNOWN>"; if (Queue != 0) CurrentURI = Queue->Uri; - + fprintf(stdout, "102 Status\nURI: %s\nUsedMirror: %s\nMessage: ", + UsedMirror.c_str(), CurrentURI.c_str()); + va_list args; va_start(args,Format); + vfprintf(stdout,Format,args); + va_end(args); - // sprintf the description - char S[1024]; - unsigned int Len = snprintf(S,sizeof(S)-4,"102 Status\n" - "URI: %s\n" - "UsedMirror: %s\n" - "Message: ",UsedMirror.c_str(), - CurrentURI.c_str()); - - vsnprintf(S+Len,sizeof(S)-4-Len,Format,args); - strcat(S,"\n\n"); - - if (write(STDOUT_FILENO,S,strlen(S)) != (signed)strlen(S)) - exit(100); + std::cout << "\n\n" << std::flush; } /*}}}*/ // AcqMethod::Redirect - Send a redirect message /*{{{*/ @@ -465,16 +419,13 @@ void pkgAcqMethod::Status(const char *Format,...) to keep the pipeline synchronized. */ void pkgAcqMethod::Redirect(const string &NewURI) { - string CurrentURI = "<UNKNOWN>"; + std::cout << "103 Redirect\nURI: "; if (Queue != 0) - CurrentURI = Queue->Uri; - - char S[1024]; - snprintf(S, sizeof(S)-50, "103 Redirect\nURI: %s\nNew-URI: %s\n\n", - CurrentURI.c_str(), NewURI.c_str()); - - if (write(STDOUT_FILENO,S,strlen(S)) != (ssize_t)strlen(S)) - exit(100); + std::cout << Queue->Uri << "\n"; + else + std::cout << "<UNKNOWN>\n"; + std::cout << "New-URI: " << NewURI << "\n" + << "\n" << std::flush; // Change the URI for the request. Queue->Uri = NewURI; diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 0b4366e5e..e7703ca93 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -647,12 +647,10 @@ bool pkgProblemResolver::DoUpgrade(pkgCache::PkgIterator Pkg) // Compute a single dependency element (glob or) pkgCache::DepIterator Start = D; pkgCache::DepIterator End = D; - unsigned char State = 0; for (bool LastOR = true; D.end() == false && LastOR == true;) { - State |= Cache[D]; LastOR = (D->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or; - D++; + ++D; if (LastOR == true) End = D; } diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index e690d660c..eb4f04d72 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -135,7 +135,7 @@ public: /*{{{*/ static APT::PackageSet FromTask(pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper); static APT::PackageSet FromTask(pkgCacheFile &Cache, std::string const &pattern) { CacheSetHelper helper; - return APT::PackageSet::FromTask(Cache, pattern, helper); + return FromTask(Cache, pattern, helper); } /** \brief returns all packages in the cache whose name matchs a given pattern @@ -149,7 +149,7 @@ public: /*{{{*/ static APT::PackageSet FromRegEx(pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper); static APT::PackageSet FromRegEx(pkgCacheFile &Cache, std::string const &pattern) { CacheSetHelper helper; - return APT::PackageSet::FromRegEx(Cache, pattern, helper); + return FromRegEx(Cache, pattern, helper); } /** \brief returns all packages specified by a string @@ -160,7 +160,7 @@ public: /*{{{*/ static APT::PackageSet FromString(pkgCacheFile &Cache, std::string const &string, CacheSetHelper &helper); static APT::PackageSet FromString(pkgCacheFile &Cache, std::string const &string) { CacheSetHelper helper; - return APT::PackageSet::FromString(Cache, string, helper); + return FromString(Cache, string, helper); } /** \brief returns a package specified by a string @@ -171,7 +171,7 @@ public: /*{{{*/ static pkgCache::PkgIterator FromName(pkgCacheFile &Cache, std::string const &string, CacheSetHelper &helper); static pkgCache::PkgIterator FromName(pkgCacheFile &Cache, std::string const &string) { CacheSetHelper helper; - return APT::PackageSet::FromName(Cache, string, helper); + return FromName(Cache, string, helper); } /** \brief returns all packages specified on the commandline @@ -184,7 +184,7 @@ public: /*{{{*/ static APT::PackageSet FromCommandLine(pkgCacheFile &Cache, const char **cmdline, CacheSetHelper &helper); static APT::PackageSet FromCommandLine(pkgCacheFile &Cache, const char **cmdline) { CacheSetHelper helper; - return APT::PackageSet::FromCommandLine(Cache, cmdline, helper); + return FromCommandLine(Cache, cmdline, helper); } struct Modifier { @@ -215,7 +215,7 @@ public: /*{{{*/ std::list<PackageSet::Modifier> const &mods, unsigned short const &fallback) { CacheSetHelper helper; - return APT::PackageSet::GroupedFromCommandLine(Cache, cmdline, + return GroupedFromCommandLine(Cache, cmdline, mods, fallback, helper); } @@ -309,10 +309,10 @@ public: /*{{{*/ static APT::VersionSet FromCommandLine(pkgCacheFile &Cache, const char **cmdline, APT::VersionSet::Version const &fallback) { CacheSetHelper helper; - return APT::VersionSet::FromCommandLine(Cache, cmdline, fallback, helper); + return FromCommandLine(Cache, cmdline, fallback, helper); } static APT::VersionSet FromCommandLine(pkgCacheFile &Cache, const char **cmdline) { - return APT::VersionSet::FromCommandLine(Cache, cmdline, CANDINST); + return FromCommandLine(Cache, cmdline, CANDINST); } static APT::VersionSet FromString(pkgCacheFile &Cache, std::string pkg, @@ -321,10 +321,10 @@ public: /*{{{*/ static APT::VersionSet FromString(pkgCacheFile &Cache, std::string pkg, APT::VersionSet::Version const &fallback) { CacheSetHelper helper; - return APT::VersionSet::FromString(Cache, pkg, fallback, helper); + return FromString(Cache, pkg, fallback, helper); } static APT::VersionSet FromString(pkgCacheFile &Cache, std::string pkg) { - return APT::VersionSet::FromString(Cache, pkg, CANDINST); + return FromString(Cache, pkg, CANDINST); } /** \brief returns all versions specified for the package @@ -338,10 +338,10 @@ public: /*{{{*/ static APT::VersionSet FromPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &P, APT::VersionSet::Version const &fallback) { CacheSetHelper helper; - return APT::VersionSet::FromPackage(Cache, P, fallback, helper); + return FromPackage(Cache, P, fallback, helper); } static APT::VersionSet FromPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &P) { - return APT::VersionSet::FromPackage(Cache, P, CANDINST); + return FromPackage(Cache, P, CANDINST); } struct Modifier { @@ -364,7 +364,7 @@ public: /*{{{*/ std::list<VersionSet::Modifier> const &mods, unsigned short const &fallback) { CacheSetHelper helper; - return APT::VersionSet::GroupedFromCommandLine(Cache, cmdline, + return GroupedFromCommandLine(Cache, cmdline, mods, fallback, helper); } /*}}}*/ diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index 36a1d7f12..2a914c665 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -155,7 +155,11 @@ bool pkgCdrom::FindPackages(string CD, break; if (chdir(CD.c_str()) != 0) - return _error->Errno("chdir","Unable to change to %s",CD.c_str()); + { + _error->Errno("chdir","Unable to change to %s", CD.c_str()); + closedir(D); + return false; + } }; closedir(D); @@ -257,8 +261,10 @@ bool pkgCdrom::DropRepeats(vector<string> &List,const char *Name) Inodes[I] = Buf.st_ino; } - if (_error->PendingError() == true) + if (_error->PendingError() == true) { + delete[] Inodes; return false; + } // Look for dups for (unsigned int I = 0; I != List.size(); I++) @@ -513,7 +519,8 @@ bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log) /*{{{*/ if (CDROM[0] == '.') CDROM= SafeGetCWD() + '/' + CDROM; - if(log) { + if (log != NULL) + { msg.str(""); ioprintf(msg, _("Using CD-ROM mount point %s\nMounting CD-ROM\n"), CDROM.c_str()); @@ -523,7 +530,7 @@ bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log) /*{{{*/ return _error->Error("Failed to mount the cdrom."); // Hash the CD to get an ID - if(log) + if (log != NULL) log->Update(_("Identifying.. ")); @@ -533,10 +540,12 @@ bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log) /*{{{*/ return false; } - msg.str(""); - ioprintf(msg, "[%s]\n",ident.c_str()); - log->Update(msg.str()); - + if (log != NULL) + { + msg.str(""); + ioprintf(msg, "[%s]\n",ident.c_str()); + log->Update(msg.str()); + } // Read the database Configuration Database; @@ -547,7 +556,8 @@ bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log) /*{{{*/ return _error->Error("Unable to read the cdrom database %s", DFile.c_str()); } - if(log) { + if (log != NULL) + { msg.str(""); ioprintf(msg, _("Stored label: %s\n"), Database.Find("CD::"+ident).c_str()); @@ -555,8 +565,10 @@ bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log) /*{{{*/ } // Unmount and finish - if (_config->FindB("APT::CDROM::NoMount",false) == false) { - log->Update(_("Unmounting CD-ROM...\n"), STEP_LAST); + if (_config->FindB("APT::CDROM::NoMount",false) == false) + { + if (log != NULL) + log->Update(_("Unmounting CD-ROM...\n"), STEP_LAST); UnmountCdrom(CDROM); } @@ -572,7 +584,8 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/ if (CDROM[0] == '.') CDROM= SafeGetCWD() + '/' + CDROM; - if(log) { + if(log != NULL) + { log->SetTotal(STEP_LAST); msg.str(""); ioprintf(msg, _("Using CD-ROM mount point %s\n"), CDROM.c_str()); @@ -592,11 +605,12 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/ // Unmount the CD and get the user to put in the one they want if (_config->FindB("APT::CDROM::NoMount",false) == false) { - if(log) + if(log != NULL) log->Update(_("Unmounting CD-ROM\n"), STEP_UNMOUNT); UnmountCdrom(CDROM); - if(log) { + if(log != NULL) + { log->Update(_("Waiting for disc...\n"), STEP_WAIT); if(!log->ChangeCdrom()) { // user aborted @@ -605,26 +619,29 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/ } // Mount the new CDROM - log->Update(_("Mounting CD-ROM...\n"), STEP_MOUNT); + if(log != NULL) + log->Update(_("Mounting CD-ROM...\n"), STEP_MOUNT); + if (MountCdrom(CDROM) == false) return _error->Error("Failed to mount the cdrom."); } // Hash the CD to get an ID - if(log) + if(log != NULL) log->Update(_("Identifying.. "), STEP_IDENT); string ID; if (IdentCdrom(CDROM,ID) == false) { - log->Update("\n"); + if (log != NULL) + log->Update("\n"); return false; } - if(log) + if(log != NULL) + { log->Update("["+ID+"]\n"); - - if(log) log->Update(_("Scanning disc for index files..\n"),STEP_SCAN); - + } + // Get the CD structure vector<string> List; vector<string> SourceList; @@ -634,7 +651,8 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/ string InfoDir; if (FindPackages(CDROM,List,SourceList, SigList,TransList,InfoDir,log) == false) { - log->Update("\n"); + if (log != NULL) + log->Update("\n"); return false; } @@ -661,7 +679,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/ DropRepeats(SourceList,"Sources"); DropRepeats(SigList,"Release.gpg"); DropRepeats(TransList,""); - if(log) { + if(log != NULL) { msg.str(""); ioprintf(msg, _("Found %zu package indexes, %zu source indexes, " "%zu translation indexes and %zu signatures\n"), @@ -698,7 +716,8 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/ if (*J == '"' || *J == ']' || *J == '[') *J = '_'; - if(log) { + if(log != NULL) + { msg.str(""); ioprintf(msg, _("Found label '%s'\n"), Name.c_str()); log->Update(msg.str()); @@ -710,7 +729,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/ if (_config->FindB("APT::CDROM::Rename",false) == true || Name.empty() == true) { - if(!log) + if(log == NULL) { if (_config->FindB("APT::CDROM::NoMount",false) == false) UnmountCdrom(CDROM); @@ -743,13 +762,13 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/ *J = '_'; Database.Set("CD::" + ID,Name); - if(log) { + if(log != NULL) + { msg.str(""); ioprintf(msg, _("This disc is called: \n'%s'\n"), Name.c_str()); log->Update(msg.str()); + log->Update(_("Copying package lists..."), STEP_COPY); } - - log->Update(_("Copying package lists..."), STEP_COPY); // take care of the signatures and copy them if they are ok // (we do this before PackageCopy as it modifies "List" and "SourceList") SigVerify SignVerify; @@ -774,16 +793,15 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/ if (WriteDatabase(Database) == false) return false; - if(log) { + if(log != NULL) log->Update(_("Writing new source list\n"), STEP_WRITE); - } if (WriteSourceList(Name,List,false) == false || WriteSourceList(Name,SourceList,true) == false) return false; } // Print the sourcelist entries - if(log) + if(log != NULL) log->Update(_("Source list entries for this disc are:\n")); for (vector<string>::iterator I = List.begin(); I != List.end(); I++) @@ -796,7 +814,8 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/ return _error->Error("Internal error"); } - if(log) { + if(log != NULL) + { msg.str(""); msg << "deb cdrom:[" << Name << "]/" << string(*I,0,Space) << " " << string(*I,Space+1) << endl; @@ -814,7 +833,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/ return _error->Error("Internal error"); } - if(log) { + if(log != NULL) { msg.str(""); msg << "deb-src cdrom:[" << Name << "]/" << string(*I,0,Space) << " " << string(*I,Space+1) << endl; @@ -824,7 +843,8 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/ // Unmount and finish if (_config->FindB("APT::CDROM::NoMount",false) == false) { - log->Update(_("Unmounting CD-ROM...\n"), STEP_LAST); + if (log != NULL) + log->Update(_("Unmounting CD-ROM...\n"), STEP_LAST); UnmountCdrom(CDROM); } diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc index 83c324f54..821e6d688 100644 --- a/apt-pkg/contrib/cdromutl.cc +++ b/apt-pkg/contrib/cdromutl.cc @@ -20,7 +20,6 @@ #include <apti18n.h> #include <sys/wait.h> -#include <sys/errno.h> #include <sys/statvfs.h> #include <dirent.h> #include <fcntl.h> @@ -206,8 +205,11 @@ bool IdentCdrom(string CD,string &Res,unsigned int Version) Hash.Add(Dir->d_name); }; - if (chdir(StartDir.c_str()) != 0) - return _error->Errno("chdir",_("Unable to change to %s"),StartDir.c_str()); + if (chdir(StartDir.c_str()) != 0) { + _error->Errno("chdir",_("Unable to change to %s"),StartDir.c_str()); + closedir(D); + return false; + } closedir(D); // Some stats from the fsys @@ -236,7 +238,7 @@ bool IdentCdrom(string CD,string &Res,unsigned int Version) } /*}}}*/ -// FindMountPointForDevice - Find mountpoint for the given device /*{{{*/ +// FindMountPointForDevice - Find mountpoint for the given device /*{{{*/ string FindMountPointForDevice(const char *devnode) { char buf[255]; @@ -254,7 +256,10 @@ string FindMountPointForDevice(const char *devnode) while ( fgets(buf, sizeof(buf), f) != NULL) { if (strncmp(buf, devnode, strlen(devnode)) == 0) { if(TokSplitString(' ', buf, out, 10)) + { + fclose(f); return string(out[1]); + } } } fclose(f); @@ -263,5 +268,4 @@ string FindMountPointForDevice(const char *devnode) return string(); } - - + /*}}}*/ diff --git a/apt-pkg/contrib/error.cc b/apt-pkg/contrib/error.cc index fe50e606b..18810d2a4 100644 --- a/apt-pkg/contrib/error.cc +++ b/apt-pkg/contrib/error.cc @@ -107,6 +107,7 @@ bool GlobalError::InsertErrno(MsgType type, const char* Function, msgSize = n + 1; else msgSize *= 2; + free(S); return true; } @@ -160,6 +161,7 @@ bool GlobalError::Insert(MsgType type, const char* Description, msgSize = n + 1; else msgSize *= 2; + free(S); return true; } diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 01808be24..b37980b7e 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -391,8 +391,9 @@ void pkgDPkgPM::DoTerminalPty(int master) { // this happens when the child is about to exit, we // give it time to actually exit, otherwise we run - // into a race - usleep(500000); + // into a race so we sleep for half a second. + struct timespec sleepfor = { 0, 500000000 }; + nanosleep(&sleepfor, NULL); return; } if(len <= 0) diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 9dad7e240..474313a0d 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -549,8 +549,8 @@ void pkgDepCache::AddStates(const PkgIterator &Pkg,int Add) // Not installed if (Pkg->CurrentVer == 0) { - if (State.Mode == ModeDelete && - (State.iFlags | Purge) == Purge && Pkg.Purge() == false) + if (State.Mode == ModeDelete && + (State.iFlags & Purge) == Purge && Pkg.Purge() == false) iDelCount += Add; if (State.Mode == ModeInstall) diff --git a/apt-pkg/orderlist.cc b/apt-pkg/orderlist.cc index d5bd19581..eab05a497 100644 --- a/apt-pkg/orderlist.cc +++ b/apt-pkg/orderlist.cc @@ -490,7 +490,7 @@ bool pkgOrderList::VisitRProvides(DepFunc F,VerIterator Ver) bool Res = true; for (PrvIterator P = Ver.ProvidesList(); P.end() == false; P++) Res &= (this->*F)(P.ParentPkg().RevDependsList()); - return true; + return Res; } /*}}}*/ // OrderList::VisitProvides - Visit all of the providing packages /*{{{*/ diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 01e0d22e0..34f8a1a75 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1115,6 +1115,9 @@ bool Dotty(CommandLine &CmdL) } printf("}\n"); + delete[] Show; + delete[] Flags; + delete[] ShapeMap; return true; } /*}}}*/ diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index e2d9bb7d4..38003e430 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2386,8 +2386,10 @@ bool DoSource(CommandLine &CmdL) string Src; pkgSrcRecords::Parser *Last = FindSrc(*I,Recs,SrcRecs,Src,*Cache); - if (Last == 0) + if (Last == 0) { + delete[] Dsc; return _error->Error(_("Unable to find a source package for %s"),Src.c_str()); + } string srec = Last->AsStr(); string::size_type pos = srec.find("\nVcs-"); @@ -2418,8 +2420,10 @@ bool DoSource(CommandLine &CmdL) // Back track vector<pkgSrcRecords::File> Lst; - if (Last->Files(Lst) == false) + if (Last->Files(Lst) == false) { + delete[] Dsc; return false; + } // Load them into the fetcher for (vector<pkgSrcRecords::File>::const_iterator I = Lst.begin(); @@ -2480,6 +2484,7 @@ bool DoSource(CommandLine &CmdL) struct statvfs Buf; string OutputDir = "."; if (statvfs(OutputDir.c_str(),&Buf) != 0) { + delete[] Dsc; if (errno == EOVERFLOW) return _error->WarningE("statvfs",_("Couldn't determine free space in %s"), OutputDir.c_str()); @@ -2493,10 +2498,12 @@ bool DoSource(CommandLine &CmdL) #if HAVE_STRUCT_STATFS_F_TYPE || unsigned(Stat.f_type) != RAMFS_MAGIC #endif - ) + ) { + delete[] Dsc; return _error->Error(_("You don't have enough free space in %s"), OutputDir.c_str()); - } + } + } // Number of bytes if (DebBytes != FetchBytes) @@ -2531,7 +2538,10 @@ bool DoSource(CommandLine &CmdL) // Run it if (Fetcher.Run() == pkgAcquire::Failed) + { + delete[] Dsc; return false; + } // Print error messages bool Failed = false; @@ -2546,8 +2556,11 @@ bool DoSource(CommandLine &CmdL) Failed = true; } if (Failed == true) + { + delete[] Dsc; return _error->Error(_("Failed to fetch some archives.")); - + } + if (_config->FindB("APT::Get::Download-only",false) == true) { c1out << _("Download complete and in download only mode") << endl; diff --git a/debian/apt-utils.symbols b/debian/apt-utils.symbols index 2f57eb10a..9ba283a51 100644 --- a/debian/apt-utils.symbols +++ b/debian/apt-utils.symbols @@ -111,11 +111,13 @@ libapt-inst.so.1.2 libapt-inst1.2 (c++|optional)"vtable for pkgCache::Iterator<pkgCache::Package, pkgCache::PkgIterator>@Base" 0.8.0 (c++|optional)"vtable for pkgCache::Iterator<pkgCache::Version, pkgCache::VerIterator>@Base" 0.8.0 ### gcc-4.4 specific +# (c++|regex|optional=std)"^char\* std::[^ ]+<.+ >::_.+@Base$" 0.8.0 +# (c++|optional=std)"std::basic_string<char, std::char_traits<char>, std::allocator<char> >& std::basic_string<char, std::char_traits<char>, std::allocator<char> >::append<unsigned char*>(unsigned char*, unsigned char*)@Base" 0.8.0 +### gcc-4.6 specific + (c++|optional=std)"std::vector<APT::Configuration::Compressor, std::allocator<APT::Configuration::Compressor> >::~vector()@Base" 0.8.12 1 (c++|optional=std)"std::basic_string<char, std::char_traits<char>, std::allocator<char> >& std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace_dispatch<unsigned char*>(__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, unsigned char*, unsigned char*, std::__false_type)@Base" 0.8.0 ### try to ignore std:: template instances - (c++|optional=std)"std::basic_string<char, std::char_traits<char>, std::allocator<char> >& std::basic_string<char, std::char_traits<char>, std::allocator<char> >::append<unsigned char*>(unsigned char*, unsigned char*)@Base" 0.8.0 (c++|regex|optional=std)"^std::basic_string<.+ >\(.+\)@Base$" 0.8.0 - (c++|regex|optional=std)"^char\* std::[^ ]+<.+ >::_.+@Base$" 0.8.0 (c++|regex|optional=std)"^typeinfo name for std::iterator<.*>@Base$" 0.8.0 (c++|regex|optional=std)"^typeinfo for std::iterator<.*>@Base$" 0.8.0 ### diff --git a/debian/apt.lintian-overrides b/debian/apt.lintian-overrides index 49c5ce53c..828b36905 100644 --- a/debian/apt.lintian-overrides +++ b/debian/apt.lintian-overrides @@ -1,3 +1,3 @@ # apt-mark is rarely used auxiliary script, we don't want to depend on # python-apt only for it. -apt binary: python-script-but-no-python-dep ./usr/bin/apt-mark +apt binary: python-script-but-no-python-dep usr/bin/apt-mark diff --git a/debian/apt.symbols b/debian/apt.symbols index 1c108fb69..bb60c22be 100644 --- a/debian/apt.symbols +++ b/debian/apt.symbols @@ -277,11 +277,7 @@ libapt-pkg.so.4.10 libapt-pkg4.10 (c++)"pkgDepCache::DefaultRootSetFunc::InRootSet(pkgCache::PkgIterator const&)@Base" 0.8.0 (c++)"pkgDepCache::DefaultRootSetFunc::~DefaultRootSetFunc()@Base" 0.8.0 (c++)"pkgDepCache::MarkFollowsSuggests()@Base" 0.8.0 - (c++)"pkgDepCache::SetCandidateVersion(pkgCache::VerIterator)@Base" 0.8.0 (c++)"pkgDepCache::MarkFollowsRecommends()@Base" 0.8.0 - (c++)"pkgDepCache::ReInstallPseudoForGroup(pkgCache::PkgIterator const&, std::set<unsigned long, std::less<unsigned long>, std::allocator<unsigned long> >&)@Base" 0.8.0 - (c++)"pkgDepCache::ReInstallPseudoForGroup(unsigned long const&, std::set<unsigned long, std::less<unsigned long>, std::allocator<unsigned long> >&)@Base" 0.8.0 - (c++)"pkgDepCache::RemovePseudoInstalledPkg(pkgCache::PkgIterator&, std::set<unsigned long, std::less<unsigned long>, std::allocator<unsigned long> >&)@Base" 0.8.0 (c++)"pkgDepCache::Init(OpProgress*)@Base" 0.8.0 (c++)"pkgDepCache::Sweep()@Base" 0.8.0 (c++)"pkgDepCache::Policy::IsImportantDep(pkgCache::DepIterator const&)@Base" 0.8.0 @@ -1222,35 +1218,45 @@ libapt-pkg.so.4.10 libapt-pkg4.10 ### demangle strangeness - buildd report it as MISSING and as new… (c++)"pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<IndexTarget*, std::allocator<IndexTarget*> > const*, indexRecords*)@Base" 0.8.0 ### gcc-4.4 specific - (c++|optional=inherent)"APT::PackageSet::PackageSet(APT::PackageSet const&)@Base" 0.8.0 - (c++|optional=inline)"stringcasecmp(char const*, char const*, char const*)@Base" 0.8.0 - (arch=armel|c++|optional=inline)"stringcasecmp(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*)@Base" 0.8.0 - (c++|optional=inherent)"APT::VersionSet::insert(pkgCache::VerIterator const&)@Base" 0.8.0 - (c++|optional=inline)"APT::VersionSet::insert(APT::VersionSet const&)@Base" 0.8.0 - (c++|optional=private)"debTranslationsIndex::IndexFile(char const*) const@Base" 0.8.0 - (c++|optional=inline)"pkgCache::Iterator<pkgCache::Version, pkgCache::VerIterator>::end() const@Base" 0.8.0 - (c++|optional=inherent)"HashString::operator=(HashString const&)@Base" 0.8.0 - (c++|regex|optional=std)"^std::less<[^ ]+>::operator\(\)\(.+\) const@Base$" 0.8.0 - (c++|regex|optional=std)"^std::vector<.+ >::(vector|push_back|erase|_[^ ]+)\(.+\)( const|)@Base$" 0.8.0 - (c++|regex|optional=std)"^std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string<char( const|)\*>\(.+\)@Base$" 0.8.0 - (c++|regex|optional=std)"^pkgCache::(Dep|Pkg|Ver|Grp|Prv|Desc|PkgFile)Iterator\*\* std::_.+@Base$" 0.8.0 +# (c++|optional=inherent)"APT::PackageSet::PackageSet(APT::PackageSet const&)@Base" 0.8.0 +# (c++|optional=inline)"stringcasecmp(char const*, char const*, char const*)@Base" 0.8.0 +# (arch=armel|c++|optional=inline)"stringcasecmp(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*)@Base" 0.8.0 +# (c++|optional=inherent)"APT::VersionSet::insert(pkgCache::VerIterator const&)@Base" 0.8.0 +# (c++|optional=inline)"APT::VersionSet::insert(APT::VersionSet const&)@Base" 0.8.0 +# (c++|optional=private)"debTranslationsIndex::IndexFile(char const*) const@Base" 0.8.0 +# (c++|optional=inline)"pkgCache::Iterator<pkgCache::Version, pkgCache::VerIterator>::end() const@Base" 0.8.0 +# (c++|optional=inherent)"HashString::operator=(HashString const&)@Base" 0.8.0 +# (c++|regex|optional=std)"^std::less<[^ ]+>::operator\(\)\(.+\) const@Base$" 0.8.0 +# (c++|regex|optional=std)"^std::vector<.+ >::(vector|push_back|erase|_[^ ]+)\(.+\)( const|)@Base$" 0.8.0 +# (c++|regex|optional=std)"^pkgCache::(Dep|Pkg|Ver|Grp|Prv|Desc|PkgFile)Iterator\*\* std::_.+@Base$" 0.8.0 ### gcc-4.5 specific -# (c++|optional=template)"SPtrArray<unsigned char>::~SPtrArray()@Base" 0.8.0 -# (c++|regex|optional=template)"^SPtrArray<[^ ]+>::~SPtrArray\(\)@Base$" 0.8.0 -# (c++|optional=inline)"FileFd::FileFd(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, FileFd::OpenMode, unsigned long)@Base" 0.8.0 -### architecture specific: va_list - (arch=i386 hurd-i386 kfreebsd-i386|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, char*&)@Base" 0.8.0 - (arch=armel armhf|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, std::__va_list&)@Base" 0.8.0 - (arch=alpha|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, __va_list_tag&)@Base" 0.8.0 - (arch=amd64 kfreebsd-amd64 powerpc powerpcspe s390|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, __va_list_tag (&) [1])@Base" 0.8.0 - (arch=hppa ia64 mipsel sparc sparc64|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, void*&)@Base" 0.8.0 - (arch=sh4|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, __builtin_va_list&)@Base" 0.8.0 - (arch=i386 hurd-i386 kfreebsd-i386|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, char*&)@Base" 0.8.0 - (arch=armel armhf|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, std::__va_list&)@Base" 0.8.0 - (arch=alpha|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag&)@Base" 0.8.0 - (arch=amd64 kfreebsd-amd64 powerpc powerpcspe s390|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag (&) [1])@Base" 0.8.0 - (arch=hppa ia64 mipsel sparc sparc64|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, void*&)@Base" 0.8.0 - (arch=sh4|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __builtin_va_list&)@Base" 0.8.0 + (c++|regex|optional=std)"^char\* std::[^ ]+<.+ >::_.+@Base$" 0.8.0 + (c++|optional=inline)"FileFd::FileFd(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, FileFd::OpenMode, unsigned long)@Base" 0.8.0 + (c++|regex|optional=template)"^SPtrArray<[^ ]+>::~SPtrArray\(\)@Base$" 0.8.0 + (c++|optional=template)"SPtrArray<unsigned char>::~SPtrArray()@Base" 0.8.0 +### gcc-4.6 specific + (c++|optional=template)"SPtrArray<pkgCache::Version*>::~SPtrArray()@Base" 0.8.0 + (c++|regex|optional=std)"^std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string<char( const|)\*>\(.+\)@Base$" 0.8.0 + (c++|regex|optional=std)"^std::vector<DiffInfo, .+@Base$" 0.8.0 + (c++|regex|optional=std)"^std::vector<.+ >::(vector|push_back|erase|_[^ ]+)\(.+\)( const|)@Base$" 0.8.0 + (c++|optional=strange)"pkgCache::VerIterator::VerIterator(pkgCache&, pkgCache::Version*)@Base" 0.8.0 +### architecture specific: va_list & size_t + (arch=i386 hurd-i386 kfreebsd-i386|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, char*&, unsigned int&)@Base" 0.8.11.4 1 + (arch=armel armhf|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, std::__va_list&, unsigned int&)@Base" 0.8.11.4 1 + (arch=alpha|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, __va_list_tag&, unsigned long&)@Base" 0.8.11.4 1 + (arch=powerpc powerpcspe|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, __va_list_tag (&) [1], unsigned int&)@Base" 0.8.11.4 1 + (arch=amd64 kfreebsd-amd64 s390|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, __va_list_tag (&) [1], unsigned long&)@Base" 0.8.11.4 1 + (arch=hppa mipsel sparc|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, void*&, unsigned int&)@Base" 0.8.11.4 1 + (arch=ia64 sparc64|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, void*&, unsigned long&)@Base" 0.8.11.4 1 + (arch=sh4|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, __builtin_va_list&, unsigned int&)@Base" 0.8.11.4 1 + (arch=i386 hurd-i386 kfreebsd-i386|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, char*&, int, unsigned int&)@Base" 0.8.11.4 1 + (arch=armel armhf|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, std::__va_list&, int, unsigned int&)@Base" 0.8.11.4 1 + (arch=alpha|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag&, int, unsigned long&)@Base" 0.8.11.4 1 + (arch=powerpc powerpcspe|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag (&) [1], int, unsigned int&)@Base" 0.8.11.4 1 + (arch=amd64 kfreebsd-amd64 s390|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag (&) [1], int, unsigned long&)@Base" 0.8.11.4 1 + (arch=hppa mipsel sparc|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, void*&, int, unsigned int&)@Base" 0.8.11.4 1 + (arch=ia64 sparc64|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, void*&, int, unsigned long&)@Base" 0.8.11.4 1 + (arch=sh4|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __builtin_va_list&, int, unsigned int&)@Base" 0.8.11.4 1 ### architecture specific: size_t (arch=i386 armel armhf hppa hurd-i386 kfreebsd-i386 mipsel powerpc powerpcspe sh4 sparc|c++)"_strtabexpand(char*, unsigned int)@Base" 0.8.0 (arch=alpha amd64 ia64 kfreebsd-amd64 s390 sparc64|c++)"_strtabexpand(char*, unsigned long)@Base" 0.8.0 @@ -1263,7 +1269,6 @@ libapt-pkg.so.4.10 libapt-pkg4.10 (c++|regex|optional=std)"^(bool|void) std::(operator|sort_heap|make_heap)[^ ]+<.+ >\(.+\)@Base$" 0.8.0 (c++|regex|optional=std)"^std::reverse_iterator<.+ > std::__.+@Base$" 0.8.0 (c++|regex|optional=std)"^std::basic_string<.+ >\(.+\)@Base$" 0.8.0 - (c++|regex|optional=std)"^char\* std::[^ ]+<.+ >::_.+@Base$" 0.8.0 (c++|regex|optional=std)"^__gnu_cxx::__[^ ]+<.*@Base$" 0.8.0 (c++|regex|optional=std)"^typeinfo name for std::iterator<.*>@Base$" 0.8.0 (c++|regex|optional=std)"^typeinfo for std::iterator<.*>@Base$" 0.8.0 @@ -1301,3 +1306,15 @@ libapt-pkg.so.4.10 libapt-pkg4.10 (c++)"typeinfo name for pkgAcqMetaClearSig@Base" 0.8.11 1 (c++)"vtable for pkgAcqSubIndex@Base" 0.8.11 1 (c++)"vtable for pkgAcqMetaClearSig@Base" 0.8.11 1 + (c++)"FindMountPointForDevice(char const*)@Base" 0.8.12 1 + (c++)"pkgUdevCdromDevices::ScanForRemovable(bool)@Base" 0.8.12 1 + (c++)"APT::Configuration::Compressor::Compressor(char const*, char const*, char const*, char const*, char const*, unsigned short)@Base" 0.8.12 1 + (c++)"APT::Configuration::Compressor::~Compressor()@Base" 0.8.12 1 + (c++)"APT::Configuration::getCompressors(bool)@Base" 0.8.12 1 + (c++)"APT::Configuration::getCompressorExtensions()@Base" 0.8.12 1 + (c++)"APT::Configuration::setDefaultConfigurationForCompressors()@Base" 0.8.12 1 + (c++)"pkgDepCache::SetCandidateVersion(pkgCache::VerIterator, bool const&)@Base" 0.8.12 1 + (c++)"pkgAcqMetaClearSig::Custom600Headers()@Base" 0.8.13 1 + (c++|optional=private)"debListParser::NewProvidesAllArch(pkgCache::VerIterator&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.8.13.2 1 + (c++|optional=private)"PrintMode(char)@Base" 0.8.13.2 1 + (c++)"pkgDepCache::IsModeChangeOk(pkgDepCache::ModeList, pkgCache::PkgIterator const&, unsigned long, bool)@Base" 0.8.13.2 1 diff --git a/debian/changelog b/debian/changelog index 3f9874bcf..762688386 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,30 @@ apt (0.8.14.2) UNRELEASED; urgency=low + [ Julian Andres Klode ] * apt-pkg/depcache.cc: - Really release action groups only once (Closes: #622744) - -- Julian Andres Klode <jak@debian.org> Mon, 18 Apr 2011 10:54:11 +0200 + [ David Kalnischkies ] + * fix a bunch of cppcheck warnings/errors based on a patch by + Niels Thykier, thanks! (Closes: #622805) + * apt-pkg/depcache.cc: + - really include 'rc' packages in the delete count by fixing a + typo which exists since 1999 in the source… (LP: #761175) + * apt-pkg/acquire-method.cc: + - write directly to stdout instead of creating the message in + memory first before writing to avoid hitting limits + * apt-pkg/orderlist.cc: + - let VisitRProvides report if the calls were successful + * apt-pkg/deb/dpkgpm.cc: + - replace obsolete usleep with nanosleep + * debian/apt{,-utils}.symbols: + - update both experimental symbol-files to reflect 0.8.14 state + * debian/apt.lintian-overrides: + - update the missing-python-dep override to the lintian 2.5 way + * debian/rules: + - remove unused embedded jquery by doxygen from libapt-pkg-doc + + -- David Kalnischkies <kalnischkies@gmail.com> Tue, 19 Apr 2011 20:57:52 +0200 apt (0.8.14.1) unstable; urgency=low diff --git a/debian/rules b/debian/rules index 640900678..0544b2b8e 100755 --- a/debian/rules +++ b/debian/rules @@ -120,6 +120,9 @@ libapt-pkg-doc: build-doc # # libapt-pkg-doc install # + # remove doxygen's embedded jquery as we don't use it anyway (#622147) + rm -f $(BLD)/doc/doxygen/html/jquery.js + dh_installdocs -p$@ $(BLD)/docs/design* \ $(BLD)/docs/dpkg-tech* \ $(BLD)/docs/files* \ diff --git a/test/integration/framework b/test/integration/framework index 013a71ec0..50c5157e9 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -145,6 +145,7 @@ setupenvironment() { echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf echo 'quiet::NoUpdate "true";' >> aptconfig.conf export LC_ALL=C + export PATH="${PATH}:/usr/local/sbin:/usr/sbin:/sbin" msgdone "info" } @@ -218,6 +219,7 @@ buildsimplenativepackage() { local DEPENDENCIES="$5" local DESCRIPTION="$6" local SECTION="${7:-others}" + local PRIORITY="${8:-optional}" local DISTSECTION if [ "$SECTION" = "$(echo "$SECTION" | cut -d'/' -f 2)" ]; then DISTSECTION="main" @@ -240,7 +242,7 @@ echo '$NAME says \"Hello!\"'" > ${BUILDDIR}/${NAME} -- Joe Sixpack <joe@example.org> $(date -R)" > ${BUILDDIR}/debian/changelog echo "Source: $NAME Section: $SECTION -Priority: optional +Priority: $PRIORITY Maintainer: Joe Sixpack <joe@example.org> Standards-Version: 3.9.1 @@ -396,29 +398,34 @@ insertpackage() { local ARCH="$3" local VERSION="$4" local DEPENDENCIES="$5" - local ARCHS="$ARCH" - if [ "$ARCHS" = "all" ]; then - ARCHS="$(aptconfig dump | grep APT::Architecture | cut -d'"' -f 2 | sed '/^$/ d' | sort | uniq | tr '\n' ' ')" - fi - for BUILDARCH in $ARCHS; do - local PPATH="aptarchive/dists/${RELEASE}/main/binary-${BUILDARCH}" - mkdir -p $PPATH aptarchive/dists/${RELEASE}/main/source - touch aptarchive/dists/${RELEASE}/main/source/Sources - local FILE="${PPATH}/Packages" - echo "Package: $NAME -Priority: optional + local PRIORITY="${6:-optional}" + local ARCHS="" + for arch in $(echo "$ARCH" | sed -e 's#,#\n#g'); do + if [ "$arch" = "all" ]; then + ARCHS="$(aptconfig dump | grep APT::Architecture | cut -d'"' -f 2 | sed '/^$/ d' | sort | uniq | tr '\n' ' ')" + else + ARCHS="$arch" + fi + for BUILDARCH in $ARCHS; do + local PPATH="aptarchive/dists/${RELEASE}/main/binary-${BUILDARCH}" + mkdir -p $PPATH aptarchive/dists/${RELEASE}/main/source + touch aptarchive/dists/${RELEASE}/main/source/Sources + local FILE="${PPATH}/Packages" + echo "Package: $NAME +Priority: $PRIORITY Section: other Installed-Size: 42 Maintainer: Joe Sixpack <joe@example.org> -Architecture: $ARCH +Architecture: $arch Version: $VERSION -Filename: pool/main/${NAME}/${NAME}_${VERSION}_${ARCH}.deb" >> $FILE - test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE - echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} +Filename: pool/main/${NAME}/${NAME}_${VERSION}_${arch}.deb" >> $FILE + test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE + echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} If you find such a package installed on your system, YOU did something horribly wrong! They are autogenerated und used only by testcases for APT and surf no other propose… " >> $FILE + done done } @@ -427,21 +434,24 @@ insertinstalledpackage() { local ARCH="$2" local VERSION="$3" local DEPENDENCIES="$4" + local PRIORITY="${5:-optional}" local FILE="rootdir/var/lib/dpkg/status" - echo "Package: $NAME + for arch in $(echo "$ARCH" | sed -e 's#,#\n#g'); do + echo "Package: $NAME Status: install ok installed -Priority: optional +Priority: $PRIORITY Section: other Installed-Size: 42 Maintainer: Joe Sixpack <joe@example.org> -Architecture: $ARCH +Architecture: $arch Version: $VERSION" >> $FILE - test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE - echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} + test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE + echo "Description: an autogenerated dummy ${NAME}=${VERSION}/installed If you find such a package installed on your system, YOU did something horribly wrong! They are autogenerated und used only by testcases for APT and surf no other propose… " >> $FILE + done } diff --git a/test/integration/test-ubuntu-bug-761175-remove-purge b/test/integration/test-ubuntu-bug-761175-remove-purge new file mode 100755 index 000000000..93b67fc02 --- /dev/null +++ b/test/integration/test-ubuntu-bug-761175-remove-purge @@ -0,0 +1,38 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'i386' + +setupsimplenativepackage 'compiz-core' 'i386' '1.0' 'unstable' +BUILDDIR='incoming/compiz-core-1.0' +mkdir -p ${BUILDDIR}/debian/compiz-core/etc +echo 'foo=bar;' > ${BUILDDIR}/compiz.conf +echo 'compiz.conf /etc/compiz.conf' >> ${BUILDDIR}/debian/install +buildpackage "$BUILDDIR" 'unstable' 'main' +rm -rf "$BUILDDIR" + +setupaptarchive + + +testdpkgnotinstalled compiz-core +msgtest 'Install package' 'compiz-core' +aptget install compiz-core -qq 2>&1 >/dev/null && msgpass || msgfail +testdpkginstalled compiz-core + +msgtest 'Remove package' 'compiz-core' +aptget remove compiz-core -y -qq 2>&1 >/dev/null && msgpass || msgfail +testdpkgnotinstalled compiz-core + +msgtest 'Check that conffiles are still around for' 'compiz-core' +dpkg -l compiz-core | grep '^rc' 2>&1 >/dev/null && msgpass || msgfail + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following packages will be REMOVED: + compiz-core* +0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. +Purg compiz-core' aptget purge compiz-core -s diff --git a/test/testextract.cc b/test/testextract.cc index 1c738aab9..b790df618 100644 --- a/test/testextract.cc +++ b/test/testextract.cc @@ -71,9 +71,12 @@ bool Go(int argc,char *argv[]) Itm.Type = pkgDirStream::Item::Directory; int Fd; - if (Extract.DoItem(Itm,Fd) == false) + if (Extract.DoItem(Itm,Fd) == false) { + fclose(F); return false; - } + } + } + fclose(F); } else if (Deb.ExtractArchive(Extract) == false) |