Browse Source

Merge branch 'pu/abi6'

tags/devuan/2.0.1+devuan1
Julian Andres Klode 1 year ago
parent
commit
3b13b8a0b7
No known key found for this signature in database GPG Key ID: 6FA458DD1DB03F71
68 changed files with 1553 additions and 2850 deletions
  1. +1
    -1
      apt-inst/CMakeLists.txt
  2. +0
    -4
      apt-inst/contrib/extracttar.cc
  3. +0
    -1
      apt-inst/contrib/extracttar.h
  4. +3
    -18
      apt-pkg/acquire-item.cc
  5. +0
    -32
      apt-pkg/acquire-item.h
  6. +2
    -28
      apt-pkg/acquire.cc
  7. +1
    -27
      apt-pkg/acquire.h
  8. +0
    -26
      apt-pkg/algorithms.cc
  9. +0
    -2
      apt-pkg/algorithms.h
  10. +0
    -2
      apt-pkg/cachefile.h
  11. +0
    -10
      apt-pkg/cacheiterators.h
  12. +1
    -18
      apt-pkg/clean.cc
  13. +4
    -12
      apt-pkg/clean.h
  14. +0
    -24
      apt-pkg/contrib/fileutl.cc
  15. +1
    -18
      apt-pkg/contrib/fileutl.h
  16. +0
    -21
      apt-pkg/contrib/hashes.cc
  17. +6
    -37
      apt-pkg/contrib/hashes.h
  18. +2
    -2
      apt-pkg/contrib/macros.h
  19. +0
    -9
      apt-pkg/contrib/netrc.cc
  20. +0
    -2
      apt-pkg/contrib/netrc.h
  21. +0
    -74
      apt-pkg/contrib/sptr.h
  22. +0
    -55
      apt-pkg/contrib/strutl.cc
  23. +0
    -2
      apt-pkg/contrib/strutl.h
  24. +0
    -3
      apt-pkg/deb/debmetaindex.cc
  25. +3
    -38
      apt-pkg/deb/debsrcrecords.cc
  26. +0
    -1
      apt-pkg/deb/debsrcrecords.h
  27. +0
    -15
      apt-pkg/deb/dpkgpm.cc
  28. +0
    -2
      apt-pkg/deb/dpkgpm.h
  29. +0
    -15
      apt-pkg/depcache.cc
  30. +0
    -4
      apt-pkg/depcache.h
  31. +2
    -328
      apt-pkg/edsp.cc
  32. +0
    -19
      apt-pkg/edsp.h
  33. +0
    -10
      apt-pkg/indexcopy.cc
  34. +0
    -5
      apt-pkg/indexcopy.h
  35. +0
    -26
      apt-pkg/indexfile.cc
  36. +0
    -9
      apt-pkg/indexfile.h
  37. +0
    -4
      apt-pkg/metaindex.h
  38. +0
    -1
      apt-pkg/orderlist.h
  39. +0
    -30
      apt-pkg/packagemanager.cc
  40. +0
    -5
      apt-pkg/packagemanager.h
  41. +1
    -41
      apt-pkg/pkgcache.cc
  42. +0
    -20
      apt-pkg/pkgcache.h
  43. +0
    -8
      apt-pkg/pkgcachegen.cc
  44. +0
    -4
      apt-pkg/pkgcachegen.h
  45. +0
    -4
      apt-pkg/pkgrecords.h
  46. +2
    -19
      apt-pkg/sourcelist.cc
  47. +0
    -1
      apt-pkg/sourcelist.h
  48. +0
    -30
      apt-pkg/srcrecords.cc
  49. +0
    -8
      apt-pkg/srcrecords.h
  50. +2
    -146
      apt-pkg/tagfile.cc
  51. +0
    -16
      apt-pkg/tagfile.h
  52. +1
    -22
      apt-pkg/upgrade.cc
  53. +0
    -3
      apt-pkg/upgrade.h
  54. +3
    -3
      apt-private/acqprogress.cc
  55. +1
    -1
      apt-private/acqprogress.h
  56. +1
    -1
      apt-private/private-download.cc
  57. +0
    -1
      apt-private/private-install.cc
  58. +0
    -1
      apt-private/private-main.cc
  59. +0
    -1
      apt-private/private-main.h
  60. +3
    -3
      apt-private/private-source.cc
  61. +0
    -1
      cmdline/apt-cache.cc
  62. +0
    -1
      cmdline/apt-get.cc
  63. +2
    -2
      debian/control
  64. +0
    -69
      debian/libapt-inst2.0.symbols
  65. +0
    -0
      debian/libapt-inst3.0.install
  66. +68
    -0
      debian/libapt-inst3.0.symbols
  67. +0
    -0
      debian/libapt-pkg6.0.install
  68. +1443
    -1504
      debian/libapt-pkg6.0.symbols

+ 1
- 1
apt-inst/CMakeLists.txt View File

@@ -2,7 +2,7 @@
include_directories(${PROJECT_BINARY_DIR}/include/apt-pkg)

# Set the version of the library
set(MAJOR 2.0)
set(MAJOR 3.0)
set(MINOR 0)
set(APT_INST_MAJOR ${MAJOR} PARENT_SCOPE)



+ 0
- 4
apt-inst/contrib/extracttar.cc View File

@@ -76,10 +76,6 @@ ExtractTar::~ExtractTar()
}
/*}}}*/
// ExtractTar::Done - Reap the gzip sub process /*{{{*/
bool ExtractTar::Done(bool)
{
return Done();
}
bool ExtractTar::Done()
{
return InFd.Close();


+ 0
- 1
apt-inst/contrib/extracttar.h View File

@@ -48,7 +48,6 @@ class ExtractTar
// Fork and reap gzip
bool StartGzip();
bool Done();
APT_DEPRECATED_MSG("Parameter Force is ignored, use Done() instead.") bool Done(bool Force);

public:



+ 3
- 18
apt-pkg/acquire-item.cc View File

@@ -770,15 +770,13 @@ class APT_HIDDEN CleanupItem : public pkgAcqTransactionItem /*{{{*/
/*}}}*/

// Acquire::Item::Item - Constructor /*{{{*/
APT_IGNORE_DEPRECATED_PUSH
pkgAcquire::Item::Item(pkgAcquire * const owner) :
FileSize(0), PartialSize(0), Mode(0), ID(0), Complete(false), Local(false),
FileSize(0), PartialSize(0), ID(0), Complete(false), Local(false),
QueueCounter(0), ExpectedAdditionalItems(0), Owner(owner), d(new Private())
{
Owner->Add(this);
Status = StatIdle;
}
APT_IGNORE_DEPRECATED_POP
/*}}}*/
// Acquire::Item::~Item - Destructor /*{{{*/
pkgAcquire::Item::~Item()
@@ -1120,15 +1118,6 @@ bool pkgAcquire::Item::RenameOnError(pkgAcquire::Item::RenameOnErrorState const
void pkgAcquire::Item::SetActiveSubprocess(const std::string &subprocess)/*{{{*/
{
ActiveSubprocess = subprocess;
APT_IGNORE_DEPRECATED_PUSH
Mode = ActiveSubprocess.c_str();
APT_IGNORE_DEPRECATED_POP
}
/*}}}*/
// Acquire::Item::ReportMirrorFailure /*{{{*/
void pkgAcquire::Item::ReportMirrorFailure(std::string const &FailCode)
{
ReportMirrorFailureToCentral(*this, FailCode, FailCode);
}
/*}}}*/
std::string pkgAcquire::Item::HashSum() const /*{{{*/
@@ -3346,11 +3335,10 @@ pkgAcqIndex::~pkgAcqIndex() {}
// ---------------------------------------------------------------------
/* This just sets up the initial fetch environment and queues the first
possibilitiy */
APT_IGNORE_DEPRECATED_PUSH
pkgAcqArchive::pkgAcqArchive(pkgAcquire *const Owner, pkgSourceList *const Sources,
pkgRecords *const Recs, pkgCache::VerIterator const &Version,
string &StoreFilename) : Item(Owner), d(NULL), LocalSource(false), Version(Version), Sources(Sources), Recs(Recs),
StoreFilename(StoreFilename), Vf(),
StoreFilename(StoreFilename),
Trusted(false)
{
if (Version.Arch() == 0)
@@ -3539,7 +3527,6 @@ pkgAcqArchive::pkgAcqArchive(pkgAcquire *const Owner, pkgSourceList *const Sourc
Local = false;
QueueURI(Desc);
}
APT_IGNORE_DEPRECATED_POP
/*}}}*/
bool pkgAcqArchive::QueueNext() /*{{{*/
{
@@ -3865,11 +3852,10 @@ pkgAcqChangelog::~pkgAcqChangelog() /*{{{*/
/*}}}*/

// AcqFile::pkgAcqFile - Constructor /*{{{*/
APT_IGNORE_DEPRECATED_PUSH
pkgAcqFile::pkgAcqFile(pkgAcquire *const Owner, string const &URI, HashStringList const &Hashes,
unsigned long long const Size, string const &Dsc, string const &ShortDesc,
const string &DestDir, const string &DestFilename,
bool const IsIndexFile) : Item(Owner), d(NULL), Retries(0), IsIndexFile(IsIndexFile), ExpectedHashes(Hashes)
bool const IsIndexFile) : Item(Owner), d(NULL), IsIndexFile(IsIndexFile), ExpectedHashes(Hashes)
{
if(!DestFilename.empty())
DestFile = DestFilename;
@@ -3900,7 +3886,6 @@ pkgAcqFile::pkgAcqFile(pkgAcquire *const Owner, string const &URI, HashStringLis

QueueURI(Desc);
}
APT_IGNORE_DEPRECATED_POP
/*}}}*/
// AcqFile::Done - Item downloaded OK /*{{{*/
void pkgAcqFile::Done(string const &Message,HashStringList const &CalcHashes,


+ 0
- 32
apt-pkg/acquire-item.h View File

@@ -102,11 +102,6 @@ class pkgAcquire::Item : public WeakPointable /*{{{*/
/** \brief How much of the object was already fetched. */
unsigned long long PartialSize;

/** \brief If not \b NULL, contains the name of a subprocess that
* is operating on this object (for instance, "gzip" or "gpgv").
*/
APT_DEPRECATED_MSG("Use the std::string member ActiveSubprocess instead") const char *Mode;

/** \brief contains the name of the subprocess that is operating on this object
* (for instance, "gzip", "rred" or "gpgv"). This is obsoleting #Mode from above
* as it can manage the lifetime of included string properly. */
@@ -284,15 +279,6 @@ class pkgAcquire::Item : public WeakPointable /*{{{*/
/** \return \b true if this object is being fetched from a trusted source. */
virtual bool IsTrusted() const;

/** \brief Report mirror problem
*
* This allows reporting mirror failures back to a centralized
* server. The apt-report-mirror-failure script is called for this
*
* \param FailCode A short failure string that is send
*/
APT_DEPRECATED_MSG("Item::Failed does this for you") void ReportMirrorFailure(std::string const &FailCode);

/** \brief Set the name of the current active subprocess
*
* See also #ActiveSubprocess
@@ -983,18 +969,6 @@ class pkgAcqArchive : public pkgAcquire::Item
*/
std::string &StoreFilename;

/** \brief The next file for this version to try to download. */
APT_DEPRECATED_MSG("Unused member")
pkgCache::VerFileIterator Vf;

/** \brief How many (more) times to try to find a new source from
* which to download this package version if it fails.
*
* Set from Acquire::Retries.
*/
APT_DEPRECATED_MSG("Unused member. See pkgAcqItem::Retries.")
unsigned int Retries;

/** \brief \b true if this version file is being downloaded from a
* trusted source.
*/
@@ -1167,12 +1141,6 @@ class pkgAcqFile : public pkgAcquire::Item
{
void * const d;

/** \brief How many times to retry the download, set from
* Acquire::Retries.
*/
APT_DEPRECATED_MSG("Unused member. See pkgAcqItem::Retries.")
unsigned int Retries;

/** \brief Should this file be considered a index file */
bool IsIndexFile;



+ 2
- 28
apt-pkg/acquire.cc View File

@@ -127,25 +127,6 @@ static bool SetupAPTPartialDirectory(std::string const &grand, std::string const

return true;
}
bool pkgAcquire::Setup(pkgAcquireStatus *Progress, string const &Lock)
{
Log = Progress;
if (Lock.empty())
{
string const listDir = _config->FindDir("Dir::State::lists");
if (SetupAPTPartialDirectory(_config->FindDir("Dir::State"), listDir, "partial", 0700) == false)
return _error->Errno("Acquire", _("List directory %s is missing."), (listDir + "partial").c_str());
if (SetupAPTPartialDirectory(_config->FindDir("Dir::State"), listDir, "auxfiles", 0755) == false)
{
// not being able to create lists/auxfiles isn't critical as we will use a tmpdir then
}
string const archivesDir = _config->FindDir("Dir::Cache::Archives");
if (SetupAPTPartialDirectory(_config->FindDir("Dir::Cache"), archivesDir, "partial", 0700) == false)
return _error->Errno("Acquire", _("Archives directory %s is missing."), (archivesDir + "partial").c_str());
return true;
}
return GetLock(Lock);
}
bool pkgAcquire::GetLock(std::string const &Lock)
{
if (Lock.empty() == true)
@@ -1444,9 +1425,8 @@ void pkgAcquireStatus::Fetched(unsigned long long Size,unsigned long long Resume
/*}}}*/
bool pkgAcquireStatus::ReleaseInfoChanges(metaIndex const * const LastRelease, metaIndex const * const CurrentRelease, std::vector<ReleaseInfoChange> &&Changes)/*{{{*/
{
auto const virt = dynamic_cast<pkgAcquireStatus2*>(this);
if (virt != nullptr)
return virt->ReleaseInfoChanges(LastRelease, CurrentRelease, std::move(Changes));
(void) LastRelease;
(void) CurrentRelease;
return ReleaseInfoChangesAsGlobalErrors(std::move(Changes));
}
/*}}}*/
@@ -1464,12 +1444,6 @@ bool pkgAcquireStatus::ReleaseInfoChangesAsGlobalErrors(std::vector<ReleaseInfoC
return AllOkay;
}
/*}}}*/
bool pkgAcquireStatus2::ReleaseInfoChanges(metaIndex const * const, metaIndex const * const, std::vector<ReleaseInfoChange> &&Changes)
{
return ReleaseInfoChangesAsGlobalErrors(std::move(Changes));
}
pkgAcquireStatus2::pkgAcquireStatus2() : pkgAcquireStatus() {}
pkgAcquireStatus2::~pkgAcquireStatus2() {}


pkgAcquire::UriIterator::UriIterator(pkgAcquire::Queue *Q) : d(NULL), CurQ(Q), CurItem(0)


+ 1
- 27
apt-pkg/acquire.h View File

@@ -353,20 +353,6 @@ class pkgAcquire
*/
unsigned long long PartialPresent();

/** \brief Delayed constructor
*
* \param Progress indicator associated with this download or
* \b NULL for none. This object is not owned by the
* download process and will not be deleted when the pkgAcquire
* object is destroyed. Naturally, it should live for at least as
* long as the pkgAcquire object does.
* \param Lock defines a lock file that should be acquired to ensure
* only one Acquire class is in action at the time or an empty string
* if no lock file should be used. If set also all needed directories
* will be created.
*/
APT_DEPRECATED_MSG("Use constructors, .SetLog and .GetLock as needed") bool Setup(pkgAcquireStatus *Progress = NULL, std::string const &Lock = "");

void SetLog(pkgAcquireStatus *Progress) { Log = Progress; }

/** \brief acquire lock and perform directory setup
@@ -819,17 +805,13 @@ class pkgAcquireStatus
* success it will print for each change the message attached to it via GlobalError either as an
* error (if DefaultAction == false) or as a notice otherwise.
*
* \b Note: To keep ABI compatibility for now this method isn't marked as
* virtual, but you can derive your class from #pkgAcquireStatus2 which has it
* marked as virtual. TODO on next ABI break: merge both classes.
*
* @param LastRelease can be used to extract further information from the previous Release file
* @param CurrentRelease can be used to extract further information from the current Release file
* @param Changes is an array of changes alongside explanatory messages
* which should be presented in some way to the user.
* @return \b true if all changes are accepted by user, otherwise or if user can't be asked \b false
*/
bool ReleaseInfoChanges(metaIndex const * const LastRelease, metaIndex const * const CurrentRelease, std::vector<ReleaseInfoChange> &&Changes);
virtual bool ReleaseInfoChanges(metaIndex const * const LastRelease, metaIndex const * const CurrentRelease, std::vector<ReleaseInfoChange> &&Changes);
APT_HIDDEN static bool ReleaseInfoChangesAsGlobalErrors(std::vector<ReleaseInfoChange> &&Changes);

/** \brief Invoked when an item is confirmed to be up-to-date.
@@ -871,14 +853,6 @@ class pkgAcquireStatus
/** \brief Initialize all counters to 0 and the time to the current time. */
pkgAcquireStatus();
virtual ~pkgAcquireStatus();
};
class pkgAcquireStatus2: public pkgAcquireStatus
{
public:
virtual bool ReleaseInfoChanges(metaIndex const * const LastRelease, metaIndex const * const CurrentRelease, std::vector<ReleaseInfoChange> &&Changes);

pkgAcquireStatus2();
virtual ~pkgAcquireStatus2();
};
/*}}}*/
/** @} */


+ 0
- 26
apt-pkg/algorithms.cc View File

@@ -1343,32 +1343,6 @@ bool pkgProblemResolver::ResolveByKeepInternal()
return true;
}
/*}}}*/
// ProblemResolver::InstallProtect - deprecated cpu-eating no-op /*{{{*/
// ---------------------------------------------------------------------
/* Actions issued with FromUser bit set are protected from further
modification (expect by other calls with FromUser set) nowadays , so we
don't need to reissue actions here, they are already set in stone. */
void pkgProblemResolver::InstallProtect()
{
pkgDepCache::ActionGroup group(Cache);

for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
if ((Flags[I->ID] & Protected) == Protected)
{
if ((Flags[I->ID] & ToRemove) == ToRemove)
Cache.MarkDelete(I);
else
{
// preserve the information whether the package was auto
// or manually installed
bool autoInst = (Cache[I].Flags & pkgCache::Flag::Auto);
Cache.MarkInstall(I, false, 0, !autoInst);
}
}
}
}
/*}}}*/
// PrioSortList - Sort a list of versions by priority /*{{{*/
// ---------------------------------------------------------------------
/* This is meant to be used in conjunction with AllTargets to get a list


+ 0
- 2
apt-pkg/algorithms.h View File

@@ -147,8 +147,6 @@ class pkgProblemResolver /*{{{*/
bool ResolveByKeep(OpProgress * const Progress = NULL);
APT_HIDDEN bool ResolveByKeepInternal();

APT_DEPRECATED_MSG("NOOP as MarkInstall enforces not overriding FromUser markings") void InstallProtect();

explicit pkgProblemResolver(pkgDepCache *Cache);
virtual ~pkgProblemResolver();
};


+ 0
- 2
apt-pkg/cachefile.h View File

@@ -65,13 +65,11 @@ class pkgCacheFile
inline unsigned char &operator [](pkgCache::DepIterator const &I) const {return (*DCache)[I];};

bool BuildCaches(OpProgress *Progress = NULL,bool WithLock = true);
APT_DEPRECATED_MSG("Pass Progress in as a pointer") bool BuildCaches(OpProgress &Progress,bool const &WithLock = true) { return BuildCaches(&Progress, WithLock); };
bool BuildSourceList(OpProgress *Progress = NULL);
bool BuildPolicy(OpProgress *Progress = NULL);
bool BuildDepCache(OpProgress *Progress = NULL);
bool Open(OpProgress *Progress = NULL, bool WithLock = true);
inline bool ReadOnlyOpen(OpProgress *Progress = NULL) { return Open(Progress, false); };
APT_DEPRECATED_MSG("Pass Progress in as a pointer") bool Open(OpProgress &Progress,bool const &WithLock = true) { return Open(&Progress, WithLock); };
static void RemoveCaches();
void Close();



+ 0
- 10
apt-pkg/cacheiterators.h View File

@@ -164,9 +164,6 @@ class pkgCache::PkgIterator: public Iterator<Package, PkgIterator> {

// Accessors
inline const char *Name() const { return Group().Name(); }
// Versions have sections - and packages can have different versions with different sections
// so this interface is broken by design. Run as fast as you can to Version.Section().
APT_DEPRECATED_MSG("Use the .Section method of VerIterator instead") inline const char *Section() const;
inline bool Purge() const {return S->CurrentState == pkgCache::State::Purge ||
(S->CurrentVer == 0 && S->CurrentState == pkgCache::State::NotInstalled);}
inline const char *Arch() const {return S->Arch == 0?0:Owner->StrP + S->Arch;}
@@ -177,7 +174,6 @@ class pkgCache::PkgIterator: public Iterator<Package, PkgIterator> {
inline DepIterator RevDependsList() const APT_PURE;
inline PrvIterator ProvidesList() const APT_PURE;
OkState State() const APT_PURE;
APT_DEPRECATED_MSG("This method does not respect apt_preferences! Use pkgDepCache::GetCandidateVersion(Pkg)") const char *CandVersion() const APT_PURE;
const char *CurVersion() const APT_PURE;

//Nice printable representation
@@ -422,8 +418,6 @@ class pkgCache::RlsFileIterator : public Iterator<ReleaseFile, RlsFileIterator>
inline const char *Site() const {return S->Site == 0?0:Owner->StrP + S->Site;}
inline bool Flagged(pkgCache::Flag::ReleaseFileFlags const flag) const {return (S->Flags & flag) == flag; }

APT_DEPRECATED_MSG("Can be remove without replacement; it is a no-op")
bool IsOk();
std::string RelStr();

// Constructors
@@ -458,8 +452,6 @@ class pkgCache::PkgFileIterator : public Iterator<PackageFile, PkgFileIterator>
inline const char *Architecture() const {return S->Architecture == 0?0:Owner->StrP + S->Architecture;}
inline const char *IndexType() const {return S->IndexType == 0?0:Owner->StrP + S->IndexType;}

APT_DEPRECATED_MSG("Can be remove without replacement; it is a no-op")
bool IsOk();
std::string RelStr();

// Constructors
@@ -525,7 +517,5 @@ inline pkgCache::VerFileIterator pkgCache::VerIterator::FileList() const
{return VerFileIterator(*Owner,Owner->VerFileP + S->FileList);}
inline pkgCache::DescFileIterator pkgCache::DescIterator::FileList() const
{return DescFileIterator(*Owner,Owner->DescFileP + S->FileList);}
APT_DEPRECATED_MSG("Use the .Section method of VerIterator instead") inline const char * pkgCache::PkgIterator::Section() const
{return S->VersionList == 0 ? 0 : VersionList().Section();}
/*}}}*/
#endif

+ 1
- 18
apt-pkg/clean.cc View File

@@ -43,17 +43,9 @@ bool pkgArchiveCleaner::Go(std::string Dir,pkgCache &Cache)
if (FileExists(Dir) == false)
return true;

auto const withoutChangingDir = dynamic_cast<pkgArchiveCleaner2*>(this);
int const dirfd = open(Dir.c_str(), O_RDONLY | O_DIRECTORY | O_CLOEXEC);
if (dirfd == -1)
return _error->Errno("open",_("Unable to read %s"),Dir.c_str());
std::string CWD;
if (withoutChangingDir == nullptr)
{
CWD = SafeGetCWD();
if (fchdir(dirfd) != 0)
return _error->Errno("fchdir",_("Unable to change to %s"),Dir.c_str());
}
DIR * const D = fdopendir(dirfd);
if (D == nullptr)
return _error->Errno("opendir",_("Unable to read %s"),Dir.c_str());
@@ -131,18 +123,9 @@ bool pkgArchiveCleaner::Go(std::string Dir,pkgCache &Cache)
continue;
}

if (withoutChangingDir == nullptr)
{
APT_IGNORE_DEPRECATED_PUSH
Erase(Dir->d_name, Pkg, Ver, St);
APT_IGNORE_DEPRECATED_POP
}
else
withoutChangingDir->Erase(dirfd, Dir->d_name, Pkg, Ver, St);
Erase(dirfd, Dir->d_name, Pkg, Ver, St);
}
closedir(D);
if (withoutChangingDir == nullptr && chdir(CWD.c_str()) != 0)
return _error->Errno("chdir", _("Unable to change to %s"),Dir.c_str());
return true;
}
/*}}}*/


+ 4
- 12
apt-pkg/clean.h View File

@@ -25,8 +25,9 @@ class pkgArchiveCleaner
void * const d;

protected:

APT_DEPRECATED_MSG("Use pkgArchiveCleaner2 to avoid CWD expectations and chdir") virtual void Erase(const char * /*File*/,std::string /*Pkg*/,std::string /*Ver*/,struct stat & /*St*/) {};
virtual void Erase(int const dirfd, char const * const File,
std::string const &Pkg,std::string const &Ver,
struct stat const &St) = 0;

public:

@@ -35,15 +36,6 @@ class pkgArchiveCleaner
pkgArchiveCleaner();
virtual ~pkgArchiveCleaner();
};
// TODO: merge classes and "erase" the old way
class pkgArchiveCleaner2: public pkgArchiveCleaner
{
friend class pkgArchiveCleaner;
protected:
using pkgArchiveCleaner::Erase;
virtual void Erase(int const dirfd, char const * const File,
std::string const &Pkg,std::string const &Ver,
struct stat const &St) = 0;
};


#endif

+ 0
- 24
apt-pkg/contrib/fileutl.cc View File

@@ -25,7 +25,6 @@
#include <apt-pkg/fileutl.h>
#include <apt-pkg/macros.h>
#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/sptr.h>
#include <apt-pkg/strutl.h>

#include <cstdio>
@@ -3015,19 +3014,6 @@ bool FileFd::FileFdError(const char *Description,...) {
return false;
}
/*}}}*/
gzFile FileFd::gzFd() { /*{{{*/
#ifdef HAVE_ZLIB
GzipFileFdPrivate * const gzipd = dynamic_cast<GzipFileFdPrivate*>(d);
if (gzipd == nullptr)
return nullptr;
else
return gzipd->gz;
#else
return nullptr;
#endif
}
/*}}}*/

// Glob - wrapper around "glob()" /*{{{*/
std::vector<std::string> Glob(std::string const &pattern, int flags)
{
@@ -3150,16 +3136,6 @@ bool Rename(std::string From, std::string To) /*{{{*/
return true;
}
/*}}}*/
bool Popen(const char* Args[], FileFd &Fd, pid_t &Child, FileFd::OpenMode Mode)/*{{{*/
{
return Popen(Args, Fd, Child, Mode, true);
}
/*}}}*/
bool Popen(const char* Args[], FileFd &Fd, pid_t &Child, FileFd::OpenMode Mode, bool CaptureStderr)/*{{{*/
{
return Popen(Args, Fd, Child, Mode, CaptureStderr, false);
}
/*}}}*/
bool Popen(const char *Args[], FileFd &Fd, pid_t &Child, FileFd::OpenMode Mode, bool CaptureStderr, bool Sandbox) /*{{{*/
{
int fd;


+ 1
- 18
apt-pkg/contrib/fileutl.h View File

@@ -133,20 +133,6 @@ class FileFd
unsigned long long FileSize();
time_t ModificationTime();

/* You want to use 'unsigned long long' if you are talking about a file
to be able to support large files (>2 or >4 GB) properly.
This shouldn't happen all to often for the indexes, but deb's might be…
And as the auto-conversation converts a 'unsigned long *' to a 'bool'
instead of 'unsigned long long *' we need to provide this explicitly -
otherwise applications magically start to fail… */
bool Read(void *To,unsigned long long Size,unsigned long *Actual) APT_DEPRECATED_MSG("The Actual variable you pass in should be an unsigned long long")
{
unsigned long long R;
bool const T = Read(To, Size, &R);
*Actual = R;
return T;
}

bool Open(std::string FileName,unsigned int const Mode,CompressMode Compress,unsigned long const AccessMode = 0666);
bool Open(std::string FileName,unsigned int const Mode,APT::Configuration::Compressor const &compressor,unsigned long const AccessMode = 0666);
inline bool Open(std::string const &FileName,unsigned int const Mode, unsigned long const AccessMode = 0666) {
@@ -163,7 +149,6 @@ class FileFd
// Simple manipulators
inline int Fd() {return iFd;};
inline void Fd(int fd) { OpenDescriptor(fd, ReadWrite);};
gzFile gzFd() APT_DEPRECATED_MSG("Implementation detail, do not use to be able to support bzip2, xz and co") APT_PURE;

inline bool IsOpen() {return iFd >= 0;};
inline bool Failed() {return (Flags & Fail) == Fail;};
@@ -294,9 +279,7 @@ std::vector<std::string> Glob(std::string const &pattern, int flags=0);
* \param Sandbox True if this should run sandboxed
* \return true on success, false on failure with _error set
*/
bool Popen(const char *Args[], FileFd &Fd, pid_t &Child, FileFd::OpenMode Mode, bool CaptureStderr, bool Sandbox) APT_HIDDEN;
bool Popen(const char* Args[], FileFd &Fd, pid_t &Child, FileFd::OpenMode Mode, bool CaptureStderr);
bool Popen(const char* Args[], FileFd &Fd, pid_t &Child, FileFd::OpenMode Mode);
bool Popen(const char *Args[], FileFd &Fd, pid_t &Child, FileFd::OpenMode Mode, bool CaptureStderr = true, bool Sandbox = false);

APT_HIDDEN bool OpenConfigurationFileFd(std::string const &File, FileFd &Fd);



+ 0
- 21
apt-pkg/contrib/hashes.cc View File

@@ -312,7 +312,6 @@ bool Hashes::Add(const unsigned char * const Data, unsigned long long const Size
if (Size == 0)
return true;
bool Res = true;
APT_IGNORE_DEPRECATED_PUSH
if ((d->CalcHashes & MD5SUM) == MD5SUM)
Res &= MD5.Add(Data, Size);
if ((d->CalcHashes & SHA1SUM) == SHA1SUM)
@@ -321,15 +320,9 @@ APT_IGNORE_DEPRECATED_PUSH
Res &= SHA256.Add(Data, Size);
if ((d->CalcHashes & SHA512SUM) == SHA512SUM)
Res &= SHA512.Add(Data, Size);
APT_IGNORE_DEPRECATED_POP
d->FileSize += Size;
return Res;
}
bool Hashes::Add(const unsigned char * const Data, unsigned long long const Size, unsigned int const Hashes)
{
d->CalcHashes = Hashes;
return Add(Data, Size);
}
bool Hashes::AddFD(int const Fd,unsigned long long Size)
{
unsigned char Buf[64*64];
@@ -349,11 +342,6 @@ bool Hashes::AddFD(int const Fd,unsigned long long Size)
}
return true;
}
bool Hashes::AddFD(int const Fd,unsigned long long Size, unsigned int const Hashes)
{
d->CalcHashes = Hashes;
return AddFD(Fd, Size);
}
bool Hashes::AddFD(FileFd &Fd,unsigned long long Size)
{
unsigned char Buf[64*64];
@@ -377,17 +365,11 @@ bool Hashes::AddFD(FileFd &Fd,unsigned long long Size)
return false;
}
return true;
}
bool Hashes::AddFD(FileFd &Fd,unsigned long long Size, unsigned int const Hashes)
{
d->CalcHashes = Hashes;
return AddFD(Fd, Size);
}
/*}}}*/
HashStringList Hashes::GetHashStringList()
{
HashStringList hashes;
APT_IGNORE_DEPRECATED_PUSH
if ((d->CalcHashes & MD5SUM) == MD5SUM)
hashes.push_back(HashString("MD5Sum", MD5.Result().Value()));
if ((d->CalcHashes & SHA1SUM) == SHA1SUM)
@@ -396,13 +378,10 @@ APT_IGNORE_DEPRECATED_PUSH
hashes.push_back(HashString("SHA256", SHA256.Result().Value()));
if ((d->CalcHashes & SHA512SUM) == SHA512SUM)
hashes.push_back(HashString("SHA512", SHA512.Result().Value()));
APT_IGNORE_DEPRECATED_POP
hashes.FileSize(d->FileSize);
return hashes;
}
APT_IGNORE_DEPRECATED_PUSH
Hashes::Hashes() : d(new PrivateHashes(~0)) { }
Hashes::Hashes(unsigned int const Hashes) : d(new PrivateHashes(Hashes)) {}
Hashes::Hashes(HashStringList const &Hashes) : d(new PrivateHashes(Hashes)) {}
Hashes::~Hashes() { delete d; }
APT_IGNORE_DEPRECATED_POP

+ 6
- 37
apt-pkg/contrib/hashes.h View File

@@ -53,8 +53,6 @@ class HashString
// get hash type used
std::string HashType() const { return Type; };
std::string HashValue() const { return Hash; };
APT_DEPRECATED_MSG("method was const-ified") std::string HashType() { return Type; };
APT_DEPRECATED_MSG("method was const-ified") std::string HashValue() { return Hash; };

// verify the given filename against the currently loaded hash
bool VerifyFile(std::string filename) const;
@@ -182,19 +180,17 @@ class PrivateHashes;
class Hashes
{
PrivateHashes * const d;

public:
/* those will disappear in the future as it is hard to add new ones this way.
/* TODO: those will disappear in the future as it is hard to add new ones this way.
* Use Add* to build the results and get them via GetHashStringList() instead */
APT_DEPRECATED_MSG("Use general .Add* and .GetHashStringList methods instead of hardcoding specific hashes") MD5Summation MD5;
APT_DEPRECATED_MSG("Use general .Add* and .GetHashStringList methods instead of hardcoding specific hashes") SHA1Summation SHA1;
APT_DEPRECATED_MSG("Use general .Add* and .GetHashStringList methods instead of hardcoding specific hashes") SHA256Summation SHA256;
APT_DEPRECATED_MSG("Use general .Add* and .GetHashStringList methods instead of hardcoding specific hashes") SHA512Summation SHA512;
MD5Summation MD5;
SHA1Summation SHA1;
SHA256Summation SHA256;
SHA512Summation SHA512;

public:
static const int UntilEOF = 0;

bool Add(const unsigned char * const Data, unsigned long long const Size) APT_NONNULL(2);
APT_DEPRECATED_MSG("Construct accordingly instead of choosing hashes while adding") bool Add(const unsigned char * const Data, unsigned long long const Size, unsigned int const Hashes) APT_NONNULL(2);
inline bool Add(const char * const Data) APT_NONNULL(2)
{return Add(reinterpret_cast<unsigned char const *>(Data),strlen(Data));};
inline bool Add(const unsigned char * const Beg,const unsigned char * const End) APT_NONNULL(2,3)
@@ -203,13 +199,10 @@ class Hashes
enum SupportedHashes { MD5SUM = (1 << 0), SHA1SUM = (1 << 1), SHA256SUM = (1 << 2),
SHA512SUM = (1 << 3) };
bool AddFD(int const Fd,unsigned long long Size = 0);
APT_DEPRECATED_MSG("Construct accordingly instead of choosing hashes while adding") bool AddFD(int const Fd,unsigned long long Size, unsigned int const Hashes);
bool AddFD(FileFd &Fd,unsigned long long Size = 0);
APT_DEPRECATED_MSG("Construct accordingly instead of choosing hashes while adding") bool AddFD(FileFd &Fd,unsigned long long Size, unsigned int const Hashes);

HashStringList GetHashStringList();

APT_IGNORE_DEPRECATED_PUSH
/** create a Hashes object to calculate all supported hashes
*
* If ALL is too much, you can limit which Hashes are calculated
@@ -221,30 +214,6 @@ APT_IGNORE_DEPRECATED_PUSH
/** @param Hashes is a list of hashes */
Hashes(HashStringList const &Hashes);
virtual ~Hashes();
APT_IGNORE_DEPRECATED_POP

private:
APT_HIDDEN APT_PURE inline unsigned int boolsToFlag(bool const addMD5, bool const addSHA1, bool const addSHA256, bool const addSHA512)
{
unsigned int hashes = ~0;
if (addMD5 == false) hashes &= ~MD5SUM;
if (addSHA1 == false) hashes &= ~SHA1SUM;
if (addSHA256 == false) hashes &= ~SHA256SUM;
if (addSHA512 == false) hashes &= ~SHA512SUM;
return hashes;
}

public:
APT_IGNORE_DEPRECATED_PUSH
APT_DEPRECATED_MSG("Construct accordingly instead of choosing hashes while adding") bool AddFD(int const Fd, unsigned long long Size, bool const addMD5,
bool const addSHA1, bool const addSHA256, bool const addSHA512) {
return AddFD(Fd, Size, boolsToFlag(addMD5, addSHA1, addSHA256, addSHA512));
};
APT_DEPRECATED_MSG("Construct accordingly instead of choosing hashes while adding") bool AddFD(FileFd &Fd, unsigned long long Size, bool const addMD5,
bool const addSHA1, bool const addSHA256, bool const addSHA512) {
return AddFD(Fd, Size, boolsToFlag(addMD5, addSHA1, addSHA256, addSHA512));
};
APT_IGNORE_DEPRECATED_POP
};

#endif

+ 2
- 2
apt-pkg/contrib/macros.h View File

@@ -165,9 +165,9 @@
// reverse-dependencies of libapt-pkg against the new SONAME.
// Non-ABI-Breaks should only increase RELEASE number.
// See also buildlib/libversion.mak
#define APT_PKG_MAJOR 5
#define APT_PKG_MAJOR 6
#define APT_PKG_MINOR 0
#define APT_PKG_RELEASE 2
#define APT_PKG_RELEASE 0
#define APT_PKG_ABI ((APT_PKG_MAJOR * 100) + APT_PKG_MINOR)

#endif

+ 0
- 9
apt-pkg/contrib/netrc.cc View File

@@ -142,15 +142,6 @@ bool MaybeAddAuth(FileFd &NetRCFile, URI &Uri)
return false;
}

void maybe_add_auth(URI &Uri, std::string NetRCFile)
{
if (FileExists(NetRCFile) == false)
return;
FileFd fd;
if (fd.Open(NetRCFile, FileFd::ReadOnly))
MaybeAddAuth(fd, Uri);
}

/* Check if we are authorized. */
bool IsAuthorized(pkgCache::PkgFileIterator const I, std::vector<std::unique_ptr<FileFd>> &authconfs)
{


+ 0
- 2
apt-pkg/contrib/netrc.h View File

@@ -32,8 +32,6 @@
class URI;
class FileFd;

APT_DEPRECATED_MSG("Use FileFd-based MaybeAddAuth instead")
void maybe_add_auth(URI &Uri, std::string NetRCFile);
bool MaybeAddAuth(FileFd &NetRCFile, URI &Uri);
bool IsAuthorized(pkgCache::PkgFileIterator const I, std::vector<std::unique_ptr<FileFd>> &authconfs) APT_HIDDEN;
#endif

+ 0
- 74
apt-pkg/contrib/sptr.h View File

@@ -1,74 +0,0 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
/* ######################################################################
Trivial non-ref counted 'smart pointer'
This is really only good to eliminate
{
delete Foo;
return;
}
Blocks from functions.
I think G++ has become good enough that doing this won't have much
code size implications.
##################################################################### */
/*}}}*/
#ifndef SMART_POINTER_H
#define SMART_POINTER_H
#include <apt-pkg/macros.h>

template <class T>
class APT_DEPRECATED_MSG("use std::unique_ptr instead") SPtr
{
public:
T *Ptr;
inline T *operator ->() {return Ptr;};
inline T &operator *() {return *Ptr;};
inline operator T *() {return Ptr;};
inline operator void *() {return Ptr;};
inline T *UnGuard() {T *Tmp = Ptr; Ptr = 0; return Tmp;};
inline void operator =(T *N) {Ptr = N;};
inline bool operator ==(T *lhs) const {return Ptr == lhs;};
inline bool operator !=(T *lhs) const {return Ptr != lhs;};
inline T*Get() {return Ptr;};
inline SPtr(T *Ptr) : Ptr(Ptr) {};
inline SPtr() : Ptr(0) {};
inline ~SPtr() {delete Ptr;};
};

template <class T>
class APT_DEPRECATED_MSG("use std::unique_ptr instead") SPtrArray
{
public:
T *Ptr;
//inline T &operator *() {return *Ptr;};
inline operator T *() {return Ptr;};
inline operator void *() {return Ptr;};
inline T *UnGuard() {T *Tmp = Ptr; Ptr = 0; return Tmp;};
//inline T &operator [](signed long I) {return Ptr[I];};
inline void operator =(T *N) {Ptr = N;};
inline bool operator ==(T *lhs) const {return Ptr == lhs;};
inline bool operator !=(T *lhs) const {return Ptr != lhs;};
inline T *Get() {return Ptr;};
inline SPtrArray(T *Ptr) : Ptr(Ptr) {};
inline SPtrArray() : Ptr(0) {};
#if __GNUC__ >= 4
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
// gcc warns about this, but we can do nothing here…
#endif
inline ~SPtrArray() {delete [] Ptr;};
#if __GNUC__ >= 4
#pragma GCC diagnostic pop
#endif
};

#endif

+ 0
- 55
apt-pkg/contrib/strutl.cc View File

@@ -806,10 +806,6 @@ int StringToBool(const string &Text,int Default)
// ---------------------------------------------------------------------
/* This converts a time_t into a string time representation that is
year 2000 compliant and timezone neutral */
string TimeRFC1123(time_t Date)
{
return TimeRFC1123(Date, false);
}
string TimeRFC1123(time_t Date, bool const NumericTimezone)
{
struct tm Conv;
@@ -1099,57 +1095,6 @@ bool FTPMDTMStrToTime(const char* const str,time_t &time)
return true;
}
/*}}}*/
// StrToTime - Converts a string into a time_t /*{{{*/
// ---------------------------------------------------------------------
/* This handles all 3 popular time formats including RFC 1123, RFC 1036
and the C library asctime format. It requires the GNU library function
'timegm' to convert a struct tm in UTC to a time_t. For some bizzar
reason the C library does not provide any such function :< This also
handles the weird, but unambiguous FTP time format*/
bool StrToTime(const string &Val,time_t &Result)
{
struct tm Tm;
char Month[10];

// Skip the day of the week
const char *I = strchr(Val.c_str(), ' ');

// Handle RFC 1123 time
Month[0] = 0;
if (sscanf(I," %2d %3s %4d %2d:%2d:%2d GMT",&Tm.tm_mday,Month,&Tm.tm_year,
&Tm.tm_hour,&Tm.tm_min,&Tm.tm_sec) != 6)
{
// Handle RFC 1036 time
if (sscanf(I," %2d-%3s-%3d %2d:%2d:%2d GMT",&Tm.tm_mday,Month,
&Tm.tm_year,&Tm.tm_hour,&Tm.tm_min,&Tm.tm_sec) == 6)
Tm.tm_year += 1900;
else
{
// asctime format
if (sscanf(I," %3s %2d %2d:%2d:%2d %4d",Month,&Tm.tm_mday,
&Tm.tm_hour,&Tm.tm_min,&Tm.tm_sec,&Tm.tm_year) != 6)
{
// 'ftp' time
if (sscanf(Val.c_str(),"%4d%2d%2d%2d%2d%2d",&Tm.tm_year,&Tm.tm_mon,
&Tm.tm_mday,&Tm.tm_hour,&Tm.tm_min,&Tm.tm_sec) != 6)
return false;
Tm.tm_mon--;
}
}
}
Tm.tm_isdst = 0;
if (Month[0] != 0)
Tm.tm_mon = MonthConv(Month);
else
Tm.tm_mon = 0; // we don't have a month, so pick something
Tm.tm_year -= 1900;
// Convert to local time and then to GMT
Result = timegm(&Tm);
return true;
}
/*}}}*/
// StrToNum - Convert a fixed length string to a number /*{{{*/
// ---------------------------------------------------------------------
/* This is used in decoding the crazy fixed length string headers in


+ 0
- 2
apt-pkg/contrib/strutl.h View File

@@ -66,7 +66,6 @@ std::string TimeToStr(unsigned long Sec);
std::string Base64Encode(const std::string &Str);
std::string OutputInDepth(const unsigned long Depth, const char* Separator=" ");
std::string URItoFileName(const std::string &URI);
APT_DEPRECATED_MSG("Specify if GMT is required or a numeric timezone can be used") std::string TimeRFC1123(time_t Date);
/** returns a datetime string as needed by HTTP/1.1 and Debian files.
*
* Note: The date will always be represented in a UTC timezone
@@ -94,7 +93,6 @@ std::string TimeRFC1123(time_t Date, bool const NumericTimezone);
*/
bool RFC1123StrToTime(const char* const str,time_t &time) APT_MUSTCHECK;
bool FTPMDTMStrToTime(const char* const str,time_t &time) APT_MUSTCHECK;
APT_DEPRECATED_MSG("Use RFC1123StrToTime or FTPMDTMStrToTime as needed instead") bool StrToTime(const std::string &Val,time_t &Result);
std::string LookupTag(const std::string &Message,const char *Tag,const char *Default = 0);
int StringToBool(const std::string &Text,int Default = -1);
bool ReadMessages(int Fd, std::vector<std::string> &List);


+ 0
- 3
apt-pkg/deb/debmetaindex.cc View File

@@ -510,9 +510,6 @@ bool debReleaseIndex::Load(std::string const &Filename, std::string * const Erro
Sum->MetaKeyFilename = Name;
Sum->Size = Size;
Sum->Hashes.FileSize(Size);
APT_IGNORE_DEPRECATED_PUSH
Sum->Hash = hs;
APT_IGNORE_DEPRECATED_POP
Entries[Name] = Sum;
}
Entries[Name]->Hashes.push_back(hs);


+ 3
- 38
apt-pkg/deb/debsrcrecords.cc View File

@@ -158,30 +158,7 @@ bool debSrcRecordParser::BuildDepends(std::vector<pkgSrcRecords::Parser::BuildDe
// ---------------------------------------------------------------------
/* This parses the list of files and returns it, each file is required to have
a complete source package */
bool debSrcRecordParser::Files(std::vector<pkgSrcRecords::File> &F)
{
std::vector<pkgSrcRecords::File2> F2;
if (Files2(F2) == false)
return false;
for (std::vector<pkgSrcRecords::File2>::const_iterator f2 = F2.begin(); f2 != F2.end(); ++f2)
{
pkgSrcRecords::File2 f;
#if __GNUC__ >= 4
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
f.MD5Hash = f2->MD5Hash;
f.Size = f2->Size;
#if __GNUC__ >= 4
#pragma GCC diagnostic pop
#endif
f.Path = f2->Path;
f.Type = f2->Type;
F.push_back(f);
}
return true;
}
bool debSrcRecordParser::Files2(std::vector<pkgSrcRecords::File2> &List)
bool debSrcRecordParser::Files(std::vector<pkgSrcRecords::File> &List)
{
List.clear();

@@ -231,7 +208,7 @@ bool debSrcRecordParser::Files2(std::vector<pkgSrcRecords::File2> &List)
path = Base + path;

// look if we have a record for this file already
std::vector<pkgSrcRecords::File2>::iterator file = List.begin();
std::vector<pkgSrcRecords::File>::iterator file = List.begin();
for (; file != List.end(); ++file)
if (file->Path == path)
break;
@@ -239,12 +216,6 @@ bool debSrcRecordParser::Files2(std::vector<pkgSrcRecords::File2> &List)
// we have it already, store the new hash and be done
if (file != List.end())
{
if (checksumField == "Files")
{
APT_IGNORE_DEPRECATED_PUSH
file->MD5Hash = hash;
APT_IGNORE_DEPRECATED_POP
}
// an error here indicates that we have two different hashes for the same file
if (file->Hashes.push_back(hashString) == false)
return _error->Error("Error parsing checksum in %s of source package %s", checksumField.c_str(), Package().c_str());
@@ -252,18 +223,12 @@ bool debSrcRecordParser::Files2(std::vector<pkgSrcRecords::File2> &List)
}

// we haven't seen this file yet
pkgSrcRecords::File2 F;
pkgSrcRecords::File F;
F.Path = path;
F.FileSize = strtoull(size.c_str(), NULL, 10);
F.Hashes.push_back(hashString);
F.Hashes.FileSize(F.FileSize);

APT_IGNORE_DEPRECATED_PUSH
F.Size = F.FileSize;
if (checksumField == "Files")
F.MD5Hash = hash;
APT_IGNORE_DEPRECATED_POP

// Try to guess what sort of file it is we are getting.
string::size_type Pos = F.Path.length()-1;
while (1)


+ 0
- 1
apt-pkg/deb/debsrcrecords.h View File

@@ -53,7 +53,6 @@ class APT_HIDDEN debSrcRecordParser : public pkgSrcRecords::Parser
return std::string(Start,Stop);
};
virtual bool Files(std::vector<pkgSrcRecords::File> &F) APT_OVERRIDE;
bool Files2(std::vector<pkgSrcRecords::File2> &F);

debSrcRecordParser(std::string const &File,pkgIndexFile const *Index);
virtual ~debSrcRecordParser();


+ 0
- 15
apt-pkg/deb/dpkgpm.cc View File

@@ -301,10 +301,6 @@ bool pkgDPkgPM::Remove(PkgIterator Pkg,bool Purge)
// ---------------------------------------------------------------------
/* This is part of the helper script communication interface, it sends
very complete information down to the other end of the pipe.*/
bool pkgDPkgPM::SendV2Pkgs(FILE *F)
{
return SendPkgsInfo(F, 2);
}
bool pkgDPkgPM::SendPkgsInfo(FILE * const F, unsigned int const &Version)
{
// This version of APT supports only v3, so don't sent higher versions
@@ -1223,17 +1219,6 @@ void pkgDPkgPM::BuildPackagesProgressMap()
++PackagesTotal;
}
/*}}}*/
bool pkgDPkgPM::Go(int StatusFd) /*{{{*/
{
APT::Progress::PackageManager *progress = NULL;
if (StatusFd == -1)
progress = APT::Progress::PackageManagerProgressFactory();
else
progress = new APT::Progress::PackageManagerProgressFd(StatusFd);

return Go(progress);
}
/*}}}*/
void pkgDPkgPM::StartPtyMagic() /*{{{*/
{
if (_config->FindB("Dpkg::Use-Pty", true) == false)


+ 0
- 2
apt-pkg/deb/dpkgpm.h View File

@@ -93,7 +93,6 @@ class pkgDPkgPM : public pkgPackageManager

// Helpers
bool RunScriptsWithPkgs(const char *Cnf);
APT_DEPRECATED_MSG("Use SendPkgInfo with the version as parameter instead") bool SendV2Pkgs(FILE *F);
bool SendPkgsInfo(FILE * const F, unsigned int const &Version);
void WriteHistoryTag(std::string const &tag, std::string value);
std::string ExpandShortPackageName(pkgDepCache &Cache,
@@ -127,7 +126,6 @@ class pkgDPkgPM : public pkgPackageManager
virtual bool Remove(PkgIterator Pkg,bool Purge = false) APT_OVERRIDE;

virtual bool Go(APT::Progress::PackageManager *progress) APT_OVERRIDE;
APT_DEPRECATED_MSG("Use overload with explicit progress manager") virtual bool Go(int StatusFd=-1) APT_OVERRIDE;

virtual void Reset() APT_OVERRIDE;


+ 0
- 15
apt-pkg/depcache.cc View File

@@ -1723,21 +1723,6 @@ void pkgDepCache::StateCache::Update(PkgIterator Pkg,pkgCache &Cache)
Status = 2;
}
/*}}}*/
// StateCache::StripEpoch - Remove the epoch specifier from the version /*{{{*/
// ---------------------------------------------------------------------
/* */
const char *pkgDepCache::StateCache::StripEpoch(const char *Ver)
{
if (Ver == 0)
return 0;

// Strip any epoch
char const * const I = strchr(Ver, ':');
if (I == nullptr)
return Ver;
return I + 1;
}
/*}}}*/
// Policy::GetCandidateVer - Returns the Candidate install version /*{{{*/
// ---------------------------------------------------------------------
/* The default just returns the highest available version that is not


+ 0
- 4
apt-pkg/depcache.h View File

@@ -243,7 +243,6 @@ class pkgDepCache : protected pkgCache::Namespace
unsigned char DepState; // DepState Flags

// Update of candidate version
APT_DEPRECATED_MSG("Use the method of the same name in contrib/strutl.h instead if you must") const char *StripEpoch(const char *Ver) APT_PURE;
void Update(PkgIterator Pkg,pkgCache &Cache);
// Various test members for the current status of the package
@@ -364,9 +363,6 @@ class pkgDepCache : protected pkgCache::Namespace
inline pkgCache &GetCache() {return *Cache;};
inline pkgVersioningSystem &VS() {return *Cache->VS;};

// Policy implementation
APT_DEPRECATED_MSG("Confusingly named method which returns the candidate as chosen by policy (NOT as chosen via .SetCandidateVersion!). You probably want to use .GetCandidateVersion instead.") inline VerIterator GetCandidateVer(PkgIterator const &Pkg) {return /* GetCandidateVersion(Pkg); but for API compat: */ LocalPolicy->GetCandidateVer(Pkg);};

inline bool IsImportantDep(DepIterator Dep) const {return LocalPolicy->IsImportantDep(Dep);};
inline Policy &GetPolicy() {return *LocalPolicy;};


+ 2
- 328
apt-pkg/edsp.cc View File

@@ -73,52 +73,6 @@ template<typename... Data> static bool WriteOkay(FileFd &output, Data&&... data)
}
/*}}}*/
// WriteScenarioVersion /*{{{*/
static void WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::PkgIterator const &Pkg,
pkgCache::VerIterator const &Ver)
{
fprintf(output, "Package: %s\n", Pkg.Name());
fprintf(output, "Source: %s\n", Ver.SourcePkgName());
fprintf(output, "Architecture: %s\n", Ver.Arch());
fprintf(output, "Version: %s\n", Ver.VerStr());
fprintf(output, "Source-Version: %s\n", Ver.SourceVerStr());
if (Pkg.CurrentVer() == Ver)
fprintf(output, "Installed: yes\n");
if (Pkg->SelectedState == pkgCache::State::Hold ||
(Cache[Pkg].Keep() == true && Cache[Pkg].Protect() == true))
fprintf(output, "Hold: yes\n");
fprintf(output, "APT-ID: %d\n", Ver->ID);
if (PrioMap[Ver->Priority] != nullptr)
fprintf(output, "Priority: %s\n", PrioMap[Ver->Priority]);
if ((Pkg->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential)
fprintf(output, "Essential: yes\n");
if (Ver->Section != 0)
fprintf(output, "Section: %s\n", Ver.Section());
if ((Ver->MultiArch & pkgCache::Version::Allowed) == pkgCache::Version::Allowed)
fprintf(output, "Multi-Arch: allowed\n");
else if ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign)
fprintf(output, "Multi-Arch: foreign\n");
else if ((Ver->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same)
fprintf(output, "Multi-Arch: same\n");
std::set<string> Releases;
for (pkgCache::VerFileIterator I = Ver.FileList(); I.end() == false; ++I) {
pkgCache::PkgFileIterator File = I.File();
if (File.Flagged(pkgCache::Flag::NotSource) == false) {
string Release = File.RelStr();
if (!Release.empty())
Releases.insert(Release);
}
}
if (!Releases.empty()) {
fprintf(output, "APT-Release:\n");
for (std::set<string>::iterator R = Releases.begin(); R != Releases.end(); ++R)
fprintf(output, " %s\n", R->c_str());
}
fprintf(output, "APT-Pin: %d\n", Cache.GetPolicy().GetPriority(Ver));
if (Cache.GetCandidateVersion(Pkg) == Ver)
fprintf(output, "APT-Candidate: yes\n");
if ((Cache[Pkg].Flags & pkgCache::Flag::Auto) == pkgCache::Flag::Auto)
fprintf(output, "APT-Automatic: yes\n");
}
static bool WriteScenarioVersion(FileFd &output, pkgCache::PkgIterator const &Pkg,
pkgCache::VerIterator const &Ver)
{
@@ -138,44 +92,6 @@ static bool WriteScenarioVersion(FileFd &output, pkgCache::PkgIterator const &Pk
}
/*}}}*/
// WriteScenarioDependency /*{{{*/
static void WriteScenarioDependency( FILE* output, pkgCache::VerIterator const &Ver)
{
std::array<std::string, _count(DepMap)> dependencies;
bool orGroup = false;
for (pkgCache::DepIterator Dep = Ver.DependsList(); Dep.end() == false; ++Dep)
{
if (Dep.IsImplicit() == true)
continue;
if (orGroup == false)
dependencies[Dep->Type].append(", ");
dependencies[Dep->Type].append(Dep.TargetPkg().Name());
if (Dep->Version != 0)
dependencies[Dep->Type].append(" (").append(pkgCache::CompTypeDeb(Dep->CompareOp)).append(" ").append(Dep.TargetVer()).append(")");
if ((Dep->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or)
{
dependencies[Dep->Type].append(" | ");
orGroup = true;
}
else
orGroup = false;
}
for (size_t i = 1; i < dependencies.size(); ++i)
if (dependencies[i].empty() == false)
fprintf(output, "%s: %s\n", DepMap[i], dependencies[i].c_str()+2);
string provides;
for (pkgCache::PrvIterator Prv = Ver.ProvidesList(); Prv.end() == false; ++Prv)
{
if (Prv.IsMultiArchImplicit() == true)
continue;
if (provides.empty() == false)
provides.append(", ");
provides.append(Prv.Name());
if (Prv->ProvideVersion != 0)
provides.append(" (= ").append(Prv.ProvideVersion()).append(")");
}
if (provides.empty() == false)
fprintf(output, "Provides: %s\n", provides.c_str());
}
static bool WriteScenarioDependency(FileFd &output, pkgCache::VerIterator const &Ver, bool const OnlyCritical)
{
std::array<std::string, _count(DepMap)> dependencies;
@@ -220,61 +136,6 @@ static bool WriteScenarioDependency(FileFd &output, pkgCache::VerIterator const
}
/*}}}*/
// WriteScenarioLimitedDependency /*{{{*/
static void WriteScenarioLimitedDependency(FILE* output,
pkgCache::VerIterator const &Ver,
APT::PackageSet const &pkgset)
{
std::array<std::string, _count(DepMap)> dependencies;
bool orGroup = false;
for (pkgCache::DepIterator Dep = Ver.DependsList(); Dep.end() == false; ++Dep)
{
if (Dep.IsImplicit() == true)
continue;
if (orGroup == false)
{
if (pkgset.find(Dep.TargetPkg()) == pkgset.end())
continue;
if (dependencies[Dep->Type].empty() == false)
dependencies[Dep->Type].append(", ");
}
else if (pkgset.find(Dep.TargetPkg()) == pkgset.end())
{
if ((Dep->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or)
continue;
dependencies[Dep->Type].erase(dependencies[Dep->Type].end()-3, dependencies[Dep->Type].end());
orGroup = false;
continue;
}
dependencies[Dep->Type].append(Dep.TargetPkg().Name());
if (Dep->Version != 0)
dependencies[Dep->Type].append(" (").append(pkgCache::CompTypeDeb(Dep->CompareOp)).append(" ").append(Dep.TargetVer()).append(")");
if ((Dep->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or)
{
dependencies[Dep->Type].append(" | ");
orGroup = true;
}
else
orGroup = false;
}
for (size_t i = 1; i < dependencies.size(); ++i)
if (dependencies[i].empty() == false)
fprintf(output, "%s: %s\n", DepMap[i], dependencies[i].c_str());
string provides;
for (pkgCache::PrvIterator Prv = Ver.ProvidesList(); Prv.end() == false; ++Prv)
{
if (Prv.IsMultiArchImplicit() == true)
continue;
if (pkgset.find(Prv.ParentPkg()) == pkgset.end())
continue;
if (provides.empty() == false)
provides.append(", ");
provides.append(Prv.Name());
if (Prv->ProvideVersion != 0)
provides.append(" (= ").append(Prv.ProvideVersion()).append(")");
}
if (provides.empty() == false)
fprintf(output, "Provides: %s\n", provides.c_str());
}
static bool WriteScenarioLimitedDependency(FileFd &output,
pkgCache::VerIterator const &Ver,
std::vector<bool> const &pkgset,
@@ -391,30 +252,6 @@ static bool WriteScenarioEDSPVersion(pkgDepCache &Cache, FileFd &output, pkgCach
}
/*}}}*/
// EDSP::WriteScenario - to the given file descriptor /*{{{*/
bool EDSP::WriteScenario(pkgDepCache &Cache, FILE* output, OpProgress *Progress)
{
if (Progress != NULL)
Progress->SubProgress(Cache.Head().VersionCount, _("Send scenario to solver"));
decltype(Cache.Head().VersionCount) p = 0;
std::vector<std::string> archs = APT::Configuration::getArchitectures();
for (pkgCache::PkgIterator Pkg = Cache.PkgBegin(); Pkg.end() == false; ++Pkg)
{
std::string const arch = Pkg.Arch();
if (std::find(archs.begin(), archs.end(), arch) == archs.end())
continue;
for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; ++Ver, ++p)
{
if (SkipUnavailableVersions(Cache, Pkg, Ver))
continue;
WriteScenarioVersion(Cache, output, Pkg, Ver);
WriteScenarioDependency(output, Ver);
fprintf(output, "\n");
if (Progress != NULL && p % 100 == 0)
Progress->Progress(p);
}
}
return true;
}
bool EDSP::WriteScenario(pkgDepCache &Cache, FileFd &output, OpProgress *Progress)
{
if (Progress != NULL)
@@ -443,28 +280,6 @@ bool EDSP::WriteScenario(pkgDepCache &Cache, FileFd &output, OpProgress *Progres
}
/*}}}*/
// EDSP::WriteLimitedScenario - to the given file descriptor /*{{{*/
bool EDSP::WriteLimitedScenario(pkgDepCache &Cache, FILE* output,
APT::PackageSet const &pkgset,
OpProgress *Progress)
{
if (Progress != NULL)
Progress->SubProgress(Cache.Head().VersionCount, _("Send scenario to solver"));
decltype(Cache.Head().PackageCount) p = 0;
for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg, ++p)
for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; ++Ver)
{
if (SkipUnavailableVersions(Cache, Pkg, Ver))
continue;
WriteScenarioVersion(Cache, output, Pkg, Ver);
WriteScenarioLimitedDependency(output, Ver, pkgset);
fprintf(output, "\n");
if (Progress != NULL && p % 100 == 0)
Progress->Progress(p);
}
if (Progress != NULL)
Progress->Done();
return true;
}
bool EDSP::WriteLimitedScenario(pkgDepCache &Cache, FileFd &output,
std::vector<bool> const &pkgset,
OpProgress *Progress)
@@ -495,60 +310,6 @@ bool EDSP::WriteLimitedScenario(pkgDepCache &Cache, FileFd &output,
}
/*}}}*/
// EDSP::WriteRequest - to the given file descriptor /*{{{*/
bool EDSP::WriteRequest(pkgDepCache &Cache, FILE* output, bool const Upgrade,
bool const DistUpgrade, bool const AutoRemove,
OpProgress *Progress)
{
if (Progress != NULL)
Progress->SubProgress(Cache.Head().PackageCount, _("Send request to solver"));
decltype(Cache.Head().PackageCount) p = 0;
string del, inst;
for (pkgCache::PkgIterator Pkg = Cache.PkgBegin(); Pkg.end() == false; ++Pkg, ++p)
{
if (Progress != NULL && p % 100 == 0)
Progress->Progress(p);
string* req;
pkgDepCache::StateCache &P = Cache[Pkg];
if (P.Delete() == true)
req = &del;
else if (P.NewInstall() == true || P.Upgrade() == true || P.ReInstall() == true ||
(P.Mode == pkgDepCache::ModeKeep && (P.iFlags & pkgDepCache::Protected) == pkgDepCache::Protected))
req = &inst;
else
continue;
req->append(" ").append(Pkg.FullName());
}
fprintf(output, "Request: EDSP 0.5\n");

const char *arch = _config->Find("APT::Architecture").c_str();
std::vector<string> archs = APT::Configuration::getArchitectures();
fprintf(output, "Architecture: %s\n", arch);
fprintf(output, "Architectures:");
for (std::vector<string>::const_iterator a = archs.begin(); a != archs.end(); ++a)
fprintf(output, " %s", a->c_str());
fprintf(output, "\n");

if (del.empty() == false)
fprintf(output, "Remove: %s\n", del.c_str()+1);
if (inst.empty() == false)
fprintf(output, "Install: %s\n", inst.c_str()+1);
if (Upgrade == true)
fprintf(output, "Upgrade: yes\n");
if (DistUpgrade == true)
fprintf(output, "Dist-Upgrade: yes\n");
if (AutoRemove == true)
fprintf(output, "Autoremove: yes\n");
auto const solver = _config->Find("APT::Solver", "internal");
fprintf(output, "Solver: %s\n", solver.c_str());
auto const solverconf = std::string("APT::Solver::") + solver + "::";
if (_config->FindB(solverconf + "Strict-Pinning", _config->FindB("APT::Solver::Strict-Pinning", true)) == false)
fprintf(output, "Strict-Pinning: no\n");
auto const solverpref = _config->Find(solverconf + "Preferences", _config->Find("APT::Solver::Preferences", ""));
if (solverpref.empty() == false)
fprintf(output, "Preferences: %s\n", solverpref.c_str());
fprintf(output, "\n");
return true;
}
bool EDSP::WriteRequest(pkgDepCache &Cache, FileFd &output,
unsigned int const flags,
OpProgress *Progress)
@@ -822,33 +583,7 @@ bool EDSP::ReadRequest(int const input, std::list<std::string> &install,
}
}
return false;
}
bool EDSP::ReadRequest(int const input, std::list<std::string> &install,
std::list<std::string> &remove, bool &upgrade,
bool &distUpgrade, bool &autoRemove)
{
unsigned int flags;
auto const ret = ReadRequest(input, install, remove, flags);
autoRemove = (flags & Request::AUTOREMOVE);
if (flags & Request::UPGRADE_ALL)
{
if (flags & (Request::FORBID_NEW_INSTALL | Request::FORBID_REMOVE))
{
upgrade = true;
distUpgrade = false;
} else {
upgrade = false;
distUpgrade = false;
}
}
else
{
upgrade = false;
distUpgrade = false;
}
return ret;
}
/*}}}*/
} /*}}}*/
// EDSP::ApplyRequest - first stanza from the given file descriptor /*{{{*/
bool EDSP::ApplyRequest(std::list<std::string> const &install,
std::list<std::string> const &remove,
@@ -875,37 +610,6 @@ bool EDSP::ApplyRequest(std::list<std::string> const &install,
}
/*}}}*/
// EDSP::WriteSolutionStanza - to the given file descriptor /*{{{*/
bool EDSP::WriteSolution(pkgDepCache &Cache, FILE* output)
{
bool const Debug = _config->FindB("Debug::EDSP::WriteSolution", false);
for (pkgCache::PkgIterator Pkg = Cache.PkgBegin(); Pkg.end() == false; ++Pkg)
{
if (Cache[Pkg].Delete() == true)
{
fprintf(output, "Remove: %d\n", _system->GetVersionMapping(Pkg.CurrentVer()->ID));
if (Debug == true)
fprintf(output, "Package: %s\nVersion: %s\n", Pkg.FullName().c_str(), Pkg.CurrentVer().VerStr());
}
else if (Cache[Pkg].NewInstall() == true || Cache[Pkg].Upgrade() == true)
{
pkgCache::VerIterator const CandVer = Cache.GetCandidateVersion(Pkg);
fprintf(output, "Install: %d\n", _system->GetVersionMapping(CandVer->ID));
if (Debug == true)
fprintf(output, "Package: %s\nVersion: %s\n", Pkg.FullName().c_str(), CandVer.VerStr());
}
else if (Cache[Pkg].Garbage == true)
{
fprintf(output, "Autoremove: %d\n", _system->GetVersionMapping(Pkg.CurrentVer()->ID));
if (Debug == true)
fprintf(output, "Package: %s\nVersion: %s\n", Pkg.FullName().c_str(), Pkg.CurrentVer().VerStr());
}
else
continue;
fprintf(output, "\n");
}

return true;
}
bool EDSP::WriteSolutionStanza(FileFd &output, char const * const Type, pkgCache::VerIterator const &Ver)
{
bool Okay = output.Failed() == false;
@@ -916,13 +620,6 @@ bool EDSP::WriteSolutionStanza(FileFd &output, char const * const Type, pkgCache
}
/*}}}*/
// EDSP::WriteProgess - pulse to the given file descriptor /*{{{*/
bool EDSP::WriteProgress(unsigned short const percent, const char* const message, FILE* output) {
fprintf(output, "Progress: %s\n", TimeRFC1123(time(NULL), true).c_str());
fprintf(output, "Percentage: %d\n", percent);
fprintf(output, "Message: %s\n\n", message);
fflush(output);
return true;
}
bool EDSP::WriteProgress(unsigned short const percent, const char* const message, FileFd &output) {
return WriteOkay(output, "Progress: ", TimeRFC1123(time(NULL), true), "\n",
"Percentage: ", percent, "\n",
@@ -934,11 +631,6 @@ static std::string formatMessage(std::string const &msg)
{
return SubstVar(SubstVar(APT::String::Strip(msg), "\n\n", "\n.\n"), "\n", "\n ");
}
bool EDSP::WriteError(char const * const uuid, std::string const &message, FILE* output) {
fprintf(output, "Error: %s\n", uuid);
fprintf(output, "Message: %s\n\n", formatMessage(message).c_str());
return true;
}
bool EDSP::WriteError(char const * const uuid, std::string const &message, FileFd &output) {
return WriteOkay(output, "Error: ", uuid, "\n",
"Message: ", formatMessage(message),
@@ -1019,11 +711,6 @@ static pid_t ExecuteExternal(char const* const type, char const * const binary,
// EDSP::ExecuteSolver - fork requested solver and setup ipc pipes {{{*/
pid_t EDSP::ExecuteSolver(const char* const solver, int * const solver_in, int * const solver_out, bool) {
return ExecuteExternal("solver", solver, "Dir::Bin::Solvers", solver_in, solver_out);
}
bool EDSP::ExecuteSolver(const char* const solver, int *solver_in, int *solver_out) {
if (ExecuteSolver(solver, solver_in, solver_out, true) == 0)
return false;
return true;
}
/*}}}*/
static bool CreateDumpFile(char const * const id, char const * const type, FileFd &output)/*{{{*/
@@ -1086,20 +773,7 @@ bool EDSP::ResolveExternal(const char* const solver, pkgDepCache &Cache,
if (ExecWait(solver_pid, solver))
return ret;
return false;
}
bool EDSP::ResolveExternal(const char* const solver, pkgDepCache &Cache,
bool const upgrade, bool const distUpgrade,
bool const autoRemove, OpProgress *Progress) {
unsigned int flags = 0;
if (autoRemove)
flags |= Request::AUTOREMOVE;
if (upgrade)
flags |= Request::UPGRADE_ALL | Request::FORBID_REMOVE | Request::FORBID_NEW_INSTALL;
if (distUpgrade)
flags |= Request::UPGRADE_ALL;
return ResolveExternal(solver, Cache, flags, Progress);
}
/*}}}*/
} /*}}}*/

bool EIPP::OrderInstall(char const * const solver, pkgPackageManager * const PM, /*{{{*/
unsigned int const flags, OpProgress * const Progress)


+ 0
- 19
apt-pkg/edsp.h View File

@@ -56,11 +56,6 @@ namespace EDSP /*{{{*/
bool WriteRequest(pkgDepCache &Cache, FileFd &output,
unsigned int const flags = 0,
OpProgress *Progress = NULL);
bool WriteRequest(pkgDepCache &Cache, FILE* output,
bool const upgrade = false,
bool const distUpgrade = false,
bool const autoRemove = false,
OpProgress *Progress = NULL) APT_DEPRECATED_MSG("Use FileFd-based interface instead");

/** \brief creates the scenario representing the package universe
*
@@ -80,7 +75,6 @@ namespace EDSP /*{{{*/
* \return true if universe was composed successfully, otherwise false
*/
bool WriteScenario(pkgDepCache &Cache, FileFd &output, OpProgress *Progress = NULL);
bool WriteScenario(pkgDepCache &Cache, FILE* output, OpProgress *Progress = NULL) APT_DEPRECATED_MSG("Use FileFd-based interface instead");

/** \brief creates a limited scenario representing the package universe
*
@@ -100,9 +94,6 @@ namespace EDSP /*{{{*/
bool WriteLimitedScenario(pkgDepCache &Cache, FileFd &output,
std::vector<bool> const &pkgset,
OpProgress *Progress = NULL);
bool WriteLimitedScenario(pkgDepCache &Cache, FILE* output,
APT::PackageSet const &pkgset,
OpProgress *Progress = NULL) APT_DEPRECATED_MSG("Use FileFd-based interface instead");

/** \brief waits and acts on the information returned from the solver
*
@@ -138,9 +129,6 @@ namespace EDSP /*{{{*/
*/
bool ReadRequest(int const input, std::list<std::string> &install,
std::list<std::string> &remove, unsigned int &flags);
APT_DEPRECATED_MSG("use the flag-based version instead") bool ReadRequest(int const input, std::list<std::string> &install,
std::list<std::string> &remove, bool &upgrade,
bool &distUpgrade, bool &autoRemove);

/** \brief takes the request lists and applies it on the cache
*
@@ -171,7 +159,6 @@ namespace EDSP /*{{{*/
* \return true if stanza could be written, otherwise false
*/
bool WriteSolutionStanza(FileFd &output, char const * const Type, pkgCache::VerIterator const &Ver);
bool WriteSolution(pkgDepCache &Cache, FILE* output) APT_DEPRECATED_MSG("Use FileFd-based single-stanza interface instead");

/** \brief sends a progress report
*
@@ -180,7 +167,6 @@ namespace EDSP /*{{{*/
* \param output the front-end listens for progress report
*/
bool WriteProgress(unsigned short const percent, const char* const message, FileFd &output);
bool WriteProgress(unsigned short const percent, const char* const message, FILE* output) APT_DEPRECATED_MSG("Use FileFd-based interface instead");

/** \brief sends an error report
*
@@ -198,7 +184,6 @@ namespace EDSP /*{{{*/
* \param output the front-end listens for error messages
*/
bool WriteError(char const * const uuid, std::string const &message, FileFd &output);
bool WriteError(char const * const uuid, std::string const &message, FILE* output) APT_DEPRECATED_MSG("Use FileFd-based interface instead");


/** \brief executes the given solver and returns the pipe ends
@@ -213,7 +198,6 @@ namespace EDSP /*{{{*/
* \return PID of the started solver or 0 if failure occurred
*/
pid_t ExecuteSolver(const char* const solver, int * const solver_in, int * const solver_out, bool /*overload*/);
APT_DEPRECATED_MSG("add a dummy bool parameter to use the overload returning a pid_t") bool ExecuteSolver(const char* const solver, int *solver_in, int *solver_out);

/** \brief call an external resolver to handle the request
*
@@ -230,9 +214,6 @@ namespace EDSP /*{{{*/
bool ResolveExternal(const char* const solver, pkgDepCache &Cache,
unsigned int const flags = 0,
OpProgress *Progress = NULL);
APT_DEPRECATED_MSG("use the flag-based version instead") bool ResolveExternal(const char* const solver, pkgDepCache &Cache,
bool const upgrade, bool const distUpgrade,
bool const autoRemove, OpProgress *Progress = NULL);
}
/*}}}*/
class pkgPackageManager;


+ 0
- 10
apt-pkg/indexcopy.cc View File

@@ -640,16 +640,6 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector<string> &SigList,
return true;
}
/*}}}*/
// SigVerify::RunGPGV - deprecated wrapper calling ExecGPGV /*{{{*/
APT_NORETURN bool SigVerify::RunGPGV(std::string const &File, std::string const &FileOut,
int const &statusfd, int fd[2]) {
ExecGPGV(File, FileOut, statusfd, fd);
}
APT_NORETURN bool SigVerify::RunGPGV(std::string const &File, std::string const &FileOut,
int const &statusfd) {
ExecGPGV(File, FileOut, statusfd);
}
/*}}}*/
bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/
vector<string> &List, pkgCdromStatus *log)
{


+ 0
- 5
apt-pkg/indexcopy.h View File

@@ -116,11 +116,6 @@ class SigVerify /*{{{*/
bool CopyAndVerify(std::string CDROM,std::string Name,std::vector<std::string> &SigList,
std::vector<std::string> PkgList,std::vector<std::string> SrcList);

APT_DEPRECATED_MSG("Use ExecGPGV instead") static bool RunGPGV(std::string const &File, std::string const &FileOut,
int const &statusfd, int fd[2]);
APT_DEPRECATED_MSG("Use ExecGPGV instead") static bool RunGPGV(std::string const &File, std::string const &FileOut,
int const &statusfd = -1);

SigVerify();
virtual ~SigVerify();
};


+ 0
- 26
apt-pkg/indexfile.cc View File

@@ -86,32 +86,6 @@ std::string pkgIndexFile::SourceInfo(pkgSrcRecords::Parser const &/*Record*/,
return std::string();
}
/*}}}*/
// IndexFile::TranslationsAvailable - Check if will use Translation /*{{{*/
bool pkgIndexFile::TranslationsAvailable() {
return (APT::Configuration::getLanguages().empty() != true);
}
/*}}}*/
// IndexFile::CheckLanguageCode - Check the Language Code /*{{{*/
bool pkgIndexFile::CheckLanguageCode(const char * const Lang)
{
if (strlen(Lang) == 2 || (strlen(Lang) == 5 && Lang[2] == '_'))
return true;

if (strcmp(Lang,"C") != 0)
_error->Warning("Wrong language code %s", Lang);

return false;
}
/*}}}*/
// IndexFile::LanguageCode - Return the Language Code /*{{{*/
std::string pkgIndexFile::LanguageCode() {
APT_IGNORE_DEPRECATED_PUSH
if (TranslationsAvailable() == false)
return "";
return APT::Configuration::getLanguages()[0];
APT_IGNORE_DEPRECATED_POP
}
/*}}}*/

// IndexTarget - Constructor /*{{{*/
IndexTarget::IndexTarget(std::string const &MetaKey, std::string const &ShortDesc,


+ 0
- 9
apt-pkg/indexfile.h View File

@@ -150,15 +150,6 @@ class pkgIndexFile
virtual bool Merge(pkgCacheGenerator &/*Gen*/, OpProgress* const /*Prog*/) { return true; };
virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;

APT_DEPRECATED_MSG("These methods make no sense anymore with multi-language support") static bool TranslationsAvailable();
/* No intern need for this method anymore as the check for correctness
is already done in getLanguages(). Note also that this check is
rather bad (doesn't take three character like ast into account).*/
APT_DEPRECATED_MSG("These methods make no sense anymore with multi-language support") static bool CheckLanguageCode(const char * const Lang);
/* As we have now possibly more than one LanguageCode this method is
superseded by a) private classmembers or b) getLanguages() */
APT_DEPRECATED_MSG("These methods make no sense anymore with multi-language support") static std::string LanguageCode();

bool IsTrusted() const { return Trusted; };

explicit pkgIndexFile(bool const Trusted);


+ 0
- 4
apt-pkg/metaindex.h View File

@@ -30,16 +30,12 @@ class metaIndexPrivate;
class metaIndex
{
public:
APT_IGNORE_DEPRECATED_PUSH
struct checkSum
{
std::string MetaKeyFilename;
HashStringList Hashes;
unsigned long long Size;

APT_DEPRECATED_MSG("Use the HashStringList member Hashes instead of a hardcoded HashString") HashString Hash;
};
APT_IGNORE_DEPRECATED_POP

enum APT_HIDDEN TriState {
TRI_YES, TRI_DONTCARE, TRI_NO, TRI_UNSET


+ 0
- 1
apt-pkg/orderlist.h View File

@@ -47,7 +47,6 @@ class pkgOrderList : protected pkgCache::Namespace
bool Debug;
// Main visit function
APT_DEPRECATED_MSG("Add a unique calling identifier as parameter for debugging output") bool VisitNode(PkgIterator Pkg) { return VisitNode(Pkg, "UNKNOWN"); };
bool VisitNode(PkgIterator Pkg, char const* from);
bool VisitDeps(DepFunc F,PkgIterator Pkg);
bool VisitRDeps(DepFunc F,PkgIterator Pkg);


+ 0
- 30
apt-pkg/packagemanager.cc View File

@@ -632,10 +632,6 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg, int const Depth)
// PM::EarlyRemove - Perform removal of packages before their time /*{{{*/
// ---------------------------------------------------------------------
/* This is called to deal with conflicts arising from unpacking */
bool pkgPackageManager::EarlyRemove(PkgIterator Pkg)
{
return EarlyRemove(Pkg, NULL);
}
bool pkgPackageManager::EarlyRemove(PkgIterator Pkg, DepIterator const * const Dep)
{
if (List->IsNow(Pkg) == false)
@@ -1128,19 +1124,6 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
return Completed;
}
// PM::DoInstallPostFork - compat /*{{{*/
// ---------------------------------------------------------------------
/*}}}*/
pkgPackageManager::OrderResult
pkgPackageManager::DoInstallPostFork(int statusFd)
{
APT::Progress::PackageManager *progress = new
APT::Progress::PackageManagerProgressFd(statusFd);
pkgPackageManager::OrderResult res = DoInstallPostFork(progress);
delete progress;
return res;
}
/*}}}*/
// PM::DoInstallPostFork - Does install part that happens after the fork /*{{{*/
// ---------------------------------------------------------------------
pkgPackageManager::OrderResult
@@ -1160,19 +1143,6 @@ pkgPackageManager::DoInstallPostFork(APT::Progress::PackageManager *progress)
/*}}}*/
// PM::DoInstall - Does the installation /*{{{*/
// ---------------------------------------------------------------------
/* compat */
pkgPackageManager::OrderResult
pkgPackageManager::DoInstall(int statusFd)
{
APT::Progress::PackageManager *progress = new
APT::Progress::PackageManagerProgressFd(statusFd);
OrderResult res = DoInstall(progress);
delete progress;
return res;
}
/*}}}*/
// PM::DoInstall - Does the installation /*{{{*/
// ---------------------------------------------------------------------
/* This uses the filenames in FileNames and the information in the
DepCache to perform the installation of packages.*/
pkgPackageManager::OrderResult


+ 0
- 5
apt-pkg/packagemanager.h View File

@@ -92,14 +92,12 @@ class pkgPackageManager : protected pkgCache::Namespace
bool SmartUnPack(PkgIterator Pkg, bool const Immediate, int const Depth) APT_MUSTCHECK;
bool SmartRemove(PkgIterator Pkg) APT_MUSTCHECK;
bool EarlyRemove(PkgIterator Pkg, DepIterator const * const Dep) APT_MUSTCHECK;
APT_DEPRECATED bool EarlyRemove(PkgIterator Pkg) APT_MUSTCHECK;

// The Actual installation implementation
virtual bool Install(PkgIterator /*Pkg*/,std::string /*File*/) {return false;};
virtual bool Configure(PkgIterator /*Pkg*/) {return false;};
virtual bool Remove(PkgIterator /*Pkg*/,bool /*Purge*/=false) {return false;};
virtual bool Go(APT::Progress::PackageManager * /*progress*/) {return true;};
APT_DEPRECATED_MSG("Use overload with explicit progress manager") virtual bool Go(int /*statusFd*/=-1) {return true;};

virtual void Reset() {};

@@ -114,8 +112,6 @@ class pkgPackageManager : protected pkgCache::Namespace

// Do the installation
OrderResult DoInstall(APT::Progress::PackageManager *progress);
// compat
APT_DEPRECATED_MSG("Use APT::Progress::PackageManager subclass instead of fd") OrderResult DoInstall(int statusFd=-1);

friend bool EIPP::OrderInstall(char const * const planner, pkgPackageManager * const PM,
unsigned int const version, OpProgress * const Progress);
@@ -131,7 +127,6 @@ class pkgPackageManager : protected pkgCache::Namespace
// stuff that needs to be done after the fork
OrderResult DoInstallPostFork(APT::Progress::PackageManager *progress);
// compat
APT_DEPRECATED_MSG("Use APT::Progress::PackageManager subclass instead of fd") OrderResult DoInstallPostFork(int statusFd=-1);

// ?
bool FixMissing();


+ 1
- 41
apt-pkg/pkgcache.cc View File

@@ -125,7 +125,6 @@ bool pkgCache::Header::CheckSizes(Header &Against) const
// Cache::pkgCache - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
APT_IGNORE_DEPRECATED_PUSH
pkgCache::pkgCache(MMap *Map, bool DoMap) : Map(*Map), VS(nullptr), d(NULL)
{
// call getArchitectures() with cached=false to ensure that the
@@ -135,7 +134,6 @@ pkgCache::pkgCache(MMap *Map, bool DoMap) : Map(*Map), VS(nullptr), d(NULL)
if (DoMap == true)
ReMap();
}
APT_IGNORE_DEPRECATED_POP
/*}}}*/
// Cache::ReMap - Reopen the cache file /*{{{*/
// ---------------------------------------------------------------------
@@ -562,19 +560,6 @@ pkgCache::PkgIterator::OkState pkgCache::PkgIterator::State() const
return NeedsNothing;
}
/*}}}*/
// PkgIterator::CandVersion - Returns the candidate version string /*{{{*/
// ---------------------------------------------------------------------
/* Return string representing of the candidate version. */
const char *
pkgCache::PkgIterator::CandVersion() const
{
//TargetVer is empty, so don't use it.
VerIterator version = pkgPolicy(Owner).GetCandidateVer(*this);
if (version.IsGood())
return version.VerStr();
return 0;
}
/*}}}*/
// PkgIterator::CurVersion - Returns the current version string /*{{{*/
// ---------------------------------------------------------------------
/* Return string representing of the current version. */
@@ -600,15 +585,10 @@ operator<<(std::ostream& out, pkgCache::PkgIterator Pkg)
return out << "invalid package";