diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2008-08-06 14:01:29 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2008-08-06 14:01:29 +0200 |
commit | cb714f283871f3deb9e0f8566ab6866ae9d7791e (patch) | |
tree | 85e812387cd35c5982405c6666ca65fddbdda27b | |
parent | cbf217843cc8eaaebd6d798854d92aab961efd9d (diff) | |
parent | 496a05c628d39c981a8f472f16629043d8508808 (diff) |
* fix various -Wall warnings
* make "apt-get build-dep" installed packages marked automatic
by default. This can be changed by setting the value of
APT::Get::Build-Dep-Automatic to false (thanks to Aaron
Haviland, closes: #44874, LP: #248268)
-rw-r--r-- | apt-inst/contrib/extracttar.cc | 4 | ||||
-rw-r--r-- | apt-pkg/acquire.cc | 3 | ||||
-rw-r--r-- | apt-pkg/contrib/cdromutl.cc | 3 | ||||
-rw-r--r-- | apt-pkg/contrib/mmap.cc | 5 | ||||
-rw-r--r-- | apt-pkg/deb/dpkgpm.cc | 4 | ||||
-rw-r--r-- | apt-pkg/depcache.cc | 2 | ||||
-rw-r--r-- | apt-pkg/indexcopy.cc | 2 | ||||
-rw-r--r-- | cmdline/apt-cache.cc | 2 | ||||
-rw-r--r-- | cmdline/apt-get.cc | 2 | ||||
-rw-r--r-- | debian/changelog | 12 | ||||
-rw-r--r-- | doc/examples/configure-index | 1 | ||||
-rw-r--r-- | methods/http.cc | 3 | ||||
-rw-r--r-- | methods/https.cc | 2 |
13 files changed, 31 insertions, 14 deletions
diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc index 68c871a5d..8338fd89d 100644 --- a/apt-inst/contrib/extracttar.cc +++ b/apt-inst/contrib/extracttar.cc @@ -208,14 +208,14 @@ bool ExtractTar::Go(pkgDirStream &Stream) Itm.Name = (char *)LastLongName.c_str(); else { - Tar->Name[sizeof(Tar->Name)] = 0; + Tar->Name[sizeof(Tar->Name)-1] = 0; Itm.Name = Tar->Name; } if (Itm.Name[0] == '.' && Itm.Name[1] == '/' && Itm.Name[2] != 0) Itm.Name += 2; // Grab the link target - Tar->Name[sizeof(Tar->LinkName)] = 0; + Tar->Name[sizeof(Tar->LinkName)-1] = 0; Itm.LinkTarget = Tar->LinkName; if (LastLongLink.empty() == false) diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 6840ae120..91f603889 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -444,8 +444,9 @@ bool pkgAcquire::Clean(string Dir) unlink(Dir->d_name); }; - chdir(StartDir.c_str()); closedir(D); + if (chdir(StartDir.c_str()) != 0) + return _error->Errno("chdir",_("Unable to change to %s"),StartDir.c_str()); return true; } /*}}}*/ diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc index 6f00e1451..b6524a178 100644 --- a/apt-pkg/contrib/cdromutl.cc +++ b/apt-pkg/contrib/cdromutl.cc @@ -176,7 +176,8 @@ bool IdentCdrom(string CD,string &Res,unsigned int Version) Hash.Add(Dir->d_name); }; - chdir(StartDir.c_str()); + if (chdir(StartDir.c_str()) != 0) + return _error->Errno("chdir",_("Unable to change to %s"),StartDir.c_str()); closedir(D); // Some stats from the fsys diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc index abcae46fe..eed438250 100644 --- a/apt-pkg/contrib/mmap.cc +++ b/apt-pkg/contrib/mmap.cc @@ -192,7 +192,8 @@ DynamicMMap::~DynamicMMap() unsigned long EndOfFile = iSize; iSize = WorkSpace; Close(false); - ftruncate(Fd->Fd(),EndOfFile); + if(ftruncate(Fd->Fd(),EndOfFile) < 0) + _error->Errno("ftruncate", _("Failed to truncate file")); } /*}}}*/ // DynamicMMap::RawAllocate - Allocate a raw chunk of unaligned space /*{{{*/ @@ -209,7 +210,7 @@ unsigned long DynamicMMap::RawAllocate(unsigned long Size,unsigned long Aln) // Just in case error check if (Result + Size > WorkSpace) { - _error->Error("Dynamic MMap ran out of room"); + _error->Error(_("Dynamic MMap ran out of room")); return 0; } diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index a3f32e3c5..e1b3c6bc0 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -498,7 +498,7 @@ bool pkgDPkgPM::OpenLog() struct tm *tmp = localtime(&t); strftime(outstr, sizeof(outstr), "%F %T", tmp); fprintf(term_out, "\nLog started: "); - fprintf(term_out, outstr); + fprintf(term_out, "%s", outstr); fprintf(term_out, "\n"); } return true; @@ -513,7 +513,7 @@ bool pkgDPkgPM::CloseLog() struct tm *tmp = localtime(&t); strftime(outstr, sizeof(outstr), "%F %T", tmp); fprintf(term_out, "Log ended: "); - fprintf(term_out, outstr); + fprintf(term_out, "%s", outstr); fprintf(term_out, "\n"); fclose(term_out); } diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 8d8befbdf..17864c76c 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -269,7 +269,7 @@ bool pkgDepCache::writeStateFile(OpProgress *prog, bool InstalledOnly) ostr.str(string("")); ostr << "Package: " << pkg.Name() << "\nAuto-Installed: 1\n\n"; - fprintf(OutFile,ostr.str().c_str()); + fprintf(OutFile,"%s",ostr.str().c_str()); fprintf(OutFile,"\n"); } } diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index b30777d8d..9e5c03e0b 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -639,7 +639,7 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector<string> &SigList, // Open the Release file and add it to the MetaIndex if(!MetaIndex->Load(*I+"Release")) { - _error->Error(MetaIndex->ErrorText.c_str()); + _error->Error("%s",MetaIndex->ErrorText.c_str()); return false; } diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index a73e35a53..b16a0e5d0 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1276,7 +1276,7 @@ bool DisplayRecord(pkgCache::VerIterator V) /*}}}*/ // Search - Perform a search /*{{{*/ // --------------------------------------------------------------------- -/* This searches the package names and pacakge descriptions for a pattern */ +/* This searches the package names and package descriptions for a pattern */ struct ExDescFile { pkgCache::DescFile *Df; diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 278404938..bc9828db1 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2540,6 +2540,8 @@ bool DoBuildDep(CommandLine &CmdL) { // We successfully installed something; skip remaining alternatives skipAlternatives = hasAlternatives; + if(_config->FindB("APT::Get::Build-Dep-Automatic", true) == true) + Cache->MarkAuto(Pkg, true); continue; } else if (hasAlternatives) diff --git a/debian/changelog b/debian/changelog index 91724d164..44fcb96fe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +apt (0.7.14ubuntu5) intrepid; urgency=low + + * fix various -Wall warnings + * make "apt-get build-dep" installed packages marked automatic + by default. This can be changed by setting the value of + APT::Get::Build-Dep-Automatic to false (thanks to Aaron + Haviland, closes: #44874, LP: #248268) + + -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 06 Aug 2008 14:00:51 +0200 + apt (0.7.14ubuntu4) intrepid; urgency=low [ Michael Vogt ] @@ -15,7 +25,7 @@ apt (0.7.14ubuntu4) intrepid; urgency=low (thanks to Joey Hess) * document --install-recommends and --no-install-recommends (thanks to Dereck Wonnacott, LP: #126180) - + [ Dereck Wonnacott ] * apt-ftparchive might write corrupt Release files (LP: #46439) * Apply --important option to apt-cache depends (LP: #16947) diff --git a/doc/examples/configure-index b/doc/examples/configure-index index a6ad56067..8e80a95a3 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -54,6 +54,7 @@ APT Only-Source ""; Diff-Only "false"; Tar-Only "false"; + Build-Dep-Automatic "true"; }; Cache diff --git a/methods/http.cc b/methods/http.cc index 61321c850..b0fb89fda 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -943,7 +943,8 @@ int HttpMethod::DealWithHeaders(FetchResult &Res,ServerState *Srv) if (Srv->StartPos >= 0) { Res.ResumePoint = Srv->StartPos; - ftruncate(File->Fd(),Srv->StartPos); + if (ftruncate(File->Fd(),Srv->StartPos) < 0) + _error->Errno("ftruncate", _("Failed to truncate file")); } // Set the start point diff --git a/methods/https.cc b/methods/https.cc index e53ba1a11..98dfeefa1 100644 --- a/methods/https.cc +++ b/methods/https.cc @@ -249,7 +249,7 @@ bool HttpsMethod::Fetch(FetchItem *Itm) if(success != 0) { unlink(File->Name().c_str()); - _error->Error(curl_errorstr); + _error->Error("%s", curl_errorstr); Fail(); return true; } |