summaryrefslogtreecommitdiff
path: root/apt-private
diff options
context:
space:
mode:
Diffstat (limited to 'apt-private')
-rw-r--r--apt-private/acqprogress.cc20
-rw-r--r--apt-private/acqprogress.h2
-rw-r--r--apt-private/private-cacheset.h2
-rw-r--r--apt-private/private-download.cc2
-rw-r--r--apt-private/private-install.cc1
-rw-r--r--apt-private/private-json-hooks.cc2
-rw-r--r--apt-private/private-main.cc1
-rw-r--r--apt-private/private-main.h1
-rw-r--r--apt-private/private-source.cc6
-rw-r--r--apt-private/private-sources.cc2
10 files changed, 19 insertions, 20 deletions
diff --git a/apt-private/acqprogress.cc b/apt-private/acqprogress.cc
index a788ec98b..b37934cd4 100644
--- a/apt-private/acqprogress.cc
+++ b/apt-private/acqprogress.cc
@@ -33,7 +33,7 @@
// ---------------------------------------------------------------------
/* */
AcqTextStatus::AcqTextStatus(std::ostream &out, unsigned int &ScreenWidth,unsigned int const Quiet) :
- pkgAcquireStatus2(), out(out), ScreenWidth(ScreenWidth), LastLineLength(0), ID(0), Quiet(Quiet)
+ pkgAcquireStatus(), out(out), ScreenWidth(ScreenWidth), LastLineLength(0), ID(0), Quiet(Quiet)
{
// testcases use it to disable pulses without disabling other user messages
if (Quiet == 0 && _config->FindB("quiet::NoUpdate", false) == true)
@@ -221,21 +221,21 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner)
enum {Long = 0,Medium,Short} Mode = Medium;
// Add the current progress
if (Mode == Long)
- S << " " << std::to_string(I->CurrentSize);
+ S << " " << std::to_string(I->CurrentItem->CurrentSize);
else
{
- if (Mode == Medium || I->TotalSize == 0)
- S << " " << SizeToStr(I->CurrentSize) << "B";
+ if (Mode == Medium || I->CurrentItem->TotalSize == 0)
+ S << " " << SizeToStr(I->CurrentItem->CurrentSize) << "B";
}
// Add the total size and percent
- if (I->TotalSize > 0 && I->CurrentItem->Owner->Complete == false)
+ if (I->CurrentItem->TotalSize > 0 && I->CurrentItem->Owner->Complete == false)
{
if (Mode == Short)
- ioprintf(S, " %.0f%%", (I->CurrentSize*100.0)/I->TotalSize);
+ ioprintf(S, " %.0f%%", (I->CurrentItem->CurrentSize*100.0)/I->CurrentItem->TotalSize);
else
- ioprintf(S, "/%sB %.0f%%", SizeToStr(I->TotalSize).c_str(),
- (I->CurrentSize*100.0)/I->TotalSize);
+ ioprintf(S, "/%sB %.0f%%", SizeToStr(I->CurrentItem->TotalSize).c_str(),
+ (I->CurrentItem->CurrentSize*100.0)/I->CurrentItem->TotalSize);
}
S << "]";
}
@@ -335,10 +335,10 @@ bool AcqTextStatus::ReleaseInfoChanges(metaIndex const * const L, metaIndex cons
{
if (Quiet >= 2 || isatty(STDOUT_FILENO) != 1 || isatty(STDIN_FILENO) != 1 ||
_config->FindB("APT::Get::Update::InteractiveReleaseInfoChanges", false) == false)
- return pkgAcquireStatus2::ReleaseInfoChanges(nullptr, nullptr, std::move(Changes));
+ return pkgAcquireStatus::ReleaseInfoChanges(nullptr, nullptr, std::move(Changes));
_error->PushToStack();
- auto const confirmed = pkgAcquireStatus2::ReleaseInfoChanges(L, N, std::move(Changes));
+ auto const confirmed = pkgAcquireStatus::ReleaseInfoChanges(L, N, std::move(Changes));
if (confirmed == true)
{
_error->MergeWithStack();
diff --git a/apt-private/acqprogress.h b/apt-private/acqprogress.h
index c8c211689..87b957e4b 100644
--- a/apt-private/acqprogress.h
+++ b/apt-private/acqprogress.h
@@ -15,7 +15,7 @@
#include <iostream>
#include <string>
-class APT_PUBLIC AcqTextStatus : public pkgAcquireStatus2
+class APT_PUBLIC AcqTextStatus : public pkgAcquireStatus
{
std::ostream &out;
unsigned int &ScreenWidth;
diff --git a/apt-private/private-cacheset.h b/apt-private/private-cacheset.h
index 3370bd03a..c52df36d7 100644
--- a/apt-private/private-cacheset.h
+++ b/apt-private/private-cacheset.h
@@ -18,6 +18,8 @@ class VerIteratorWithCaching
const pkgCache::VerIterator iter;
const pkgCache::DescFile * descFile;
public:
+
+ // cppcheck-suppress noExplicitConstructor
VerIteratorWithCaching(const pkgCache::VerIterator& iter) :
iter(iter),
descFile(iter->DescriptionList != 0
diff --git a/apt-private/private-download.cc b/apt-private/private-download.cc
index 2c12676ea..16d11255b 100644
--- a/apt-private/private-download.cc
+++ b/apt-private/private-download.cc
@@ -339,7 +339,7 @@ bool DoClean(CommandLine &)
// ---------------------------------------------------------------------
/* This is similar to clean but it only purges things that cannot be
downloaded, that is old versions of cached packages. */
- class LogCleaner : public pkgArchiveCleaner2
+ class LogCleaner : public pkgArchiveCleaner
{
protected:
virtual void Erase(int const dirfd, char const * const File, std::string const &Pkg, std::string const &Ver,struct stat const &St) APT_OVERRIDE
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc
index 40543d995..a5a88c99d 100644
--- a/apt-private/private-install.cc
+++ b/apt-private/private-install.cc
@@ -18,7 +18,6 @@
#include <apt-pkg/pkgrecords.h>
#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/prettyprinters.h>
-#include <apt-pkg/sptr.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/upgrade.h>
diff --git a/apt-private/private-json-hooks.cc b/apt-private/private-json-hooks.cc
index 65ff87924..3e0d8c93b 100644
--- a/apt-private/private-json-hooks.cc
+++ b/apt-private/private-json-hooks.cc
@@ -79,7 +79,7 @@ class APT_HIDDEN JsonWriter
}
public:
- JsonWriter(std::ostream &os) : os(os) { old_locale = os.imbue(std::locale::classic()); }
+ explicit JsonWriter(std::ostream &os) : os(os) { old_locale = os.imbue(std::locale::classic()); }
~JsonWriter() { os.imbue(old_locale); }
JsonWriter &beginArray()
{
diff --git a/apt-private/private-main.cc b/apt-private/private-main.cc
index 47b1a0921..e9f65bd83 100644
--- a/apt-private/private-main.cc
+++ b/apt-private/private-main.cc
@@ -44,7 +44,6 @@ void InitLocale(APT_CMD const binary) /*{{{*/
break;
}
}
-void InitLocale() {}
/*}}}*/
void InitSignals() /*{{{*/
{
diff --git a/apt-private/private-main.h b/apt-private/private-main.h
index 0d60797ed..4dcb2716a 100644
--- a/apt-private/private-main.h
+++ b/apt-private/private-main.h
@@ -8,7 +8,6 @@
class CommandLine;
void InitLocale(APT_CMD const binary);
-APT_PUBLIC APT_DEPRECATED_MSG("Is a no-op now") void InitLocale();
APT_PUBLIC void InitSignals();
APT_PUBLIC void CheckIfSimulateMode(CommandLine &CmdL);
APT_PUBLIC void CheckIfCalledByScript(int argc, const char *argv[]);
diff --git a/apt-private/private-source.cc b/apt-private/private-source.cc
index c8a48a74a..48c9d8094 100644
--- a/apt-private/private-source.cc
+++ b/apt-private/private-source.cc
@@ -383,14 +383,14 @@ bool DoSource(CommandLine &CmdL)
}
// Back track
- std::vector<pkgSrcRecords::File2> Lst;
- if (Last->Files2(Lst) == false) {
+ std::vector<pkgSrcRecords::File> Lst;
+ if (Last->Files(Lst) == false) {
return false;
}
DscFile curDsc;
// Load them into the fetcher
- for (std::vector<pkgSrcRecords::File2>::const_iterator I = Lst.begin();
+ for (std::vector<pkgSrcRecords::File>::const_iterator I = Lst.begin();
I != Lst.end(); ++I)
{
// Try to guess what sort of file it is we are getting.
diff --git a/apt-private/private-sources.cc b/apt-private/private-sources.cc
index 713327f02..4cfb87938 100644
--- a/apt-private/private-sources.cc
+++ b/apt-private/private-sources.cc
@@ -31,7 +31,7 @@
class APT_HIDDEN ScopedGetLock {
public:
int fd;
- ScopedGetLock(std::string const &filename) : fd(GetLock(filename)) {}
+ explicit ScopedGetLock(std::string const &filename) : fd(GetLock(filename)) {}
~ScopedGetLock() { close(fd); }
};
bool EditSources(CommandLine &CmdL)