From 241ed15da41b6f412c75a2a7d4cc0d10ffbfa17d Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 4 Feb 2019 15:39:57 +0100 Subject: Bump SONAMEs in preparation for ABI breaks --- apt-pkg/contrib/macros.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg/contrib') diff --git a/apt-pkg/contrib/macros.h b/apt-pkg/contrib/macros.h index 57d3f6c22..f15625a4c 100644 --- a/apt-pkg/contrib/macros.h +++ b/apt-pkg/contrib/macros.h @@ -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 -- cgit v1.2.3-70-g09d2 From f53a120320cd09d572658d424badc5485f1b9182 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 12:57:46 +0100 Subject: hashes: Remove deprecated functions This keeps the members in the class, but makes them private. We want to migrate to libgcrypt eventually, since we already use libgcrypt through gpgv anyway. --- apt-pkg/contrib/hashes.cc | 21 --------------------- apt-pkg/contrib/hashes.h | 43 ++++++------------------------------------- debian/libapt-pkg6.0.symbols | 11 ----------- 3 files changed, 6 insertions(+), 69 deletions(-) (limited to 'apt-pkg/contrib') diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc index 98b92cc81..d03fb6083 100644 --- a/apt-pkg/contrib/hashes.cc +++ b/apt-pkg/contrib/hashes.cc @@ -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 diff --git a/apt-pkg/contrib/hashes.h b/apt-pkg/contrib/hashes.h index 28bfd3459..9ef2945d7 100644 --- a/apt-pkg/contrib/hashes.h +++ b/apt-pkg/contrib/hashes.h @@ -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(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 diff --git a/debian/libapt-pkg6.0.symbols b/debian/libapt-pkg6.0.symbols index 01dc3808a..5cf9e64b9 100644 --- a/debian/libapt-pkg6.0.symbols +++ b/debian/libapt-pkg6.0.symbols @@ -394,7 +394,6 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"IndexCopy::ChopDirs(std::__cxx11::basic_string, std::allocator >, unsigned int)@APTPKG_6.0" 0.8.0 (c++)"IndexCopy::GrabFirst(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >&, unsigned int)@APTPKG_6.0" 0.8.0 (c++)"SigVerify::CopyAndVerify(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::vector, std::allocator >, std::allocator, std::allocator > > >, std::vector, std::allocator >, std::allocator, std::allocator > > >)@APTPKG_6.0" 0.8.0 - (c++)"SigVerify::RunGPGV(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, int const&, int*)@APTPKG_6.0" 0.8.0 (c++)"debSystem::Initialize(Configuration&)@APTPKG_6.0" 0.8.0 (c++)"debSystem::AddStatusFiles(std::vector >&)@APTPKG_6.0" 0.8.0 (c++)"debSystem::ArchiveSupported(char const*)@APTPKG_6.0" 0.8.0 @@ -967,15 +966,6 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"typeinfo name for APT::VersionContainer > >@APTPKG_6.0" 1.1~exp15 (c++)"vtable for APT::VersionContainer > >@APTPKG_6.0" 1.1~exp15 ### all the hashes are belong to us -# (c++|optional=inline)"Hashes::AddFD(int, unsigned long long, bool, bool, bool, bool)@APTPKG_6.0" 0.8.16~exp6 -# (c++|optional=inline)"Hashes::AddFD(FileFd&, unsigned long long, bool, bool, bool, bool)@APTPKG_6.0" 0.8.16~exp9 -# (c++|optional=inline)"pkgRecords::Parser::MD5Hash()@APTPKG_6.0" 0.8.0 -# (c++|optional=inline)"pkgRecords::Parser::SHA1Hash()@APTPKG_6.0" 0.8.0 -# (c++|optional=inline)"pkgRecords::Parser::SHA256Hash()@APTPKG_6.0" 0.8.0 -# (c++|optional=inline)"pkgRecords::Parser::SHA512Hash()@APTPKG_6.0" 0.8.16~exp6 - (c++)"Hashes::AddFD(FileFd&, unsigned long long, unsigned int)@APTPKG_6.0" 1.1~exp1 - (c++)"Hashes::AddFD(int, unsigned long long, unsigned int)@APTPKG_6.0" 1.1~exp1 - (c++)"Hashes::Add(unsigned char const*, unsigned long long, unsigned int)@APTPKG_6.0" 1.1~exp1 (c++)"Hashes::GetHashStringList()@APTPKG_6.0" 1.1~exp1 (c++)"Hashes::Hashes()@APTPKG_6.0" 1.1~exp1 (c++)"Hashes::~Hashes()@APTPKG_6.0" 1.1~exp1 @@ -1011,7 +1001,6 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"_strrstrip(char*)@APTPKG_6.0" 0.9.7.9~exp2 (c++)"SplitClearSignedFile(std::__cxx11::basic_string, std::allocator > const&, FileFd*, std::vector, std::allocator >, std::allocator, std::allocator > > >*, FileFd*)@APTPKG_6.0" 0.9.7.9~exp2 (c++)"OpenMaybeClearSignedFile(std::__cxx11::basic_string, std::allocator > const&, FileFd&)@APTPKG_6.0" 0.9.7.9~exp2 - (c++)"SigVerify::RunGPGV(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, int const&)@APTPKG_6.0" 0.9.7.9~exp2 (c++)"Configuration::Dump(std::basic_ostream >&, char const*, char const*, bool)@APTPKG_6.0" 0.9.3 (c++)"AcquireUpdate(pkgAcquire&, int, bool, bool)@APTPKG_6.0" 0.9.3 (c++)"APT::CacheFilter::PackageArchitectureMatchesSpecification::PackageArchitectureMatchesSpecification(std::__cxx11::basic_string, std::allocator > const&, bool)@APTPKG_6.0" 0.9.7 -- cgit v1.2.3-70-g09d2 From 36adf6dd0504d7b280e93f5206d93ee5f7f13e84 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 13:15:38 +0100 Subject: netrc: Remove deprecated function maybe_add_auth() --- apt-pkg/contrib/netrc.cc | 9 --------- apt-pkg/contrib/netrc.h | 2 -- debian/libapt-pkg6.0.symbols | 1 - 3 files changed, 12 deletions(-) (limited to 'apt-pkg/contrib') diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc index 48114ba3c..ee1996f8d 100644 --- a/apt-pkg/contrib/netrc.cc +++ b/apt-pkg/contrib/netrc.cc @@ -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> &authconfs) { diff --git a/apt-pkg/contrib/netrc.h b/apt-pkg/contrib/netrc.h index 80d95acc1..96a5a0973 100644 --- a/apt-pkg/contrib/netrc.h +++ b/apt-pkg/contrib/netrc.h @@ -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> &authconfs) APT_HIDDEN; #endif diff --git a/debian/libapt-pkg6.0.symbols b/debian/libapt-pkg6.0.symbols index 4c2e44fae..f7bb2eff1 100644 --- a/debian/libapt-pkg6.0.symbols +++ b/debian/libapt-pkg6.0.symbols @@ -39,7 +39,6 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"ParseQuoteWord(char const*&, std::__cxx11::basic_string, std::allocator >&)@APTPKG_6.0" 0.8.0 (c++)"ReadConfigFile(Configuration&, std::__cxx11::basic_string, std::allocator > const&, bool const&, unsigned int const&)@APTPKG_6.0" 0.8.0 (c++)"TokSplitString(char, char*, char**, unsigned long)@APTPKG_6.0" 0.8.0 - (c++)"maybe_add_auth(URI&, std::__cxx11::basic_string, std::allocator >)@APTPKG_6.0" 0.8.0 (c++)"pkgApplyStatus(pkgDepCache&)@APTPKG_6.0" 0.8.0 (c++)"CheckDomainList(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_6.0" 0.8.0 (c++)"CreateDirectory(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_6.0" 0.8.0 -- cgit v1.2.3-70-g09d2 From 29465ea9555a453ca733280955505de8bfcce935 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 13:21:07 +0100 Subject: sptr: Remove deprecated smart pointer classes Please use the standard C++ variants instead. --- apt-pkg/contrib/fileutl.cc | 1 - apt-pkg/contrib/sptr.h | 74 ------------------------------------------ apt-private/private-install.cc | 1 - cmdline/apt-cache.cc | 1 - cmdline/apt-get.cc | 1 - 5 files changed, 78 deletions(-) delete mode 100644 apt-pkg/contrib/sptr.h (limited to 'apt-pkg/contrib') diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 0c0cb05ea..860739f68 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -25,7 +25,6 @@ #include #include #include -#include #include #include diff --git a/apt-pkg/contrib/sptr.h b/apt-pkg/contrib/sptr.h deleted file mode 100644 index 77806d94d..000000000 --- a/apt-pkg/contrib/sptr.h +++ /dev/null @@ -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 - -template -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 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 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 #include #include -#include #include #include diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 3c0e477b1..ce7400fc7 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index da18d2d19..fe6e22d81 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include -- cgit v1.2.3-70-g09d2 From 88d3a9fde4ed1d1070ba0326569138f651cc60e8 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 13:41:02 +0100 Subject: strutl: Remove deprecated functions --- apt-pkg/contrib/strutl.cc | 55 -------------------------------------------- apt-pkg/contrib/strutl.h | 2 -- debian/libapt-pkg6.0.symbols | 4 ---- 3 files changed, 61 deletions(-) (limited to 'apt-pkg/contrib') diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index 50344d1fe..e854c5bf1 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -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 diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h index 9f74f8c2a..c25ce8054 100644 --- a/apt-pkg/contrib/strutl.h +++ b/apt-pkg/contrib/strutl.h @@ -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 &List); diff --git a/debian/libapt-pkg6.0.symbols b/debian/libapt-pkg6.0.symbols index c7abac750..1ac905bbd 100644 --- a/debian/libapt-pkg6.0.symbols +++ b/debian/libapt-pkg6.0.symbols @@ -633,12 +633,8 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (arch=i386 armel armhf hppa hurd-i386 kfreebsd-i386 mips mipsel powerpc powerpcspe sh4 sparc x32|c++)"_strtabexpand(char*, unsigned int)@APTPKG_6.0" 0.8.0 (arch=alpha amd64 arm64 ia64 kfreebsd-amd64 mips64el s390 s390x sparc64 ppc64 ppc64el|c++)"_strtabexpand(char*, unsigned long)@APTPKG_6.0" 0.8.0 ### architecture specific: time_t - (arch=!x32|c++)"TimeRFC1123[abi:cxx11](long)@APTPKG_6.0" 0.8.0 - (arch=x32|c++)"TimeRFC1123[abi:cxx11](long long)@APTPKG_6.0" 0.8.0 (arch=!x32|c++)"FTPMDTMStrToTime(char const*, long&)@APTPKG_6.0" 0.8.0 (arch=x32|c++)"FTPMDTMStrToTime(char const*, long long&)@APTPKG_6.0" 0.8.0 - (arch=!x32|c++)"StrToTime(std::__cxx11::basic_string, std::allocator > const&, long&)@APTPKG_6.0" 0.8.0 - (arch=x32|c++)"StrToTime(std::__cxx11::basic_string, std::allocator > const&, long long&)@APTPKG_6.0" 0.8.0 (arch=!x32|c++)"RFC1123StrToTime(char const*, long&)@APTPKG_6.0" 0.8.0 (arch=x32|c++)"RFC1123StrToTime(char const*, long long&)@APTPKG_6.0" 0.8.0 ### architecture specific: mode_t -- cgit v1.2.3-70-g09d2 From 680b916ce7203a40ebd0a3882b9a71ca77278a67 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 13:44:23 +0100 Subject: fileutl: Remove deprecated functions such as gzFd() --- apt-pkg/contrib/fileutl.cc | 13 ------------- apt-pkg/contrib/fileutl.h | 15 --------------- debian/libapt-pkg6.0.symbols | 1 - 3 files changed, 29 deletions(-) (limited to 'apt-pkg/contrib') diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 860739f68..d23e805e0 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -3014,19 +3014,6 @@ bool FileFd::FileFdError(const char *Description,...) { return false; } /*}}}*/ -gzFile FileFd::gzFd() { /*{{{*/ -#ifdef HAVE_ZLIB - GzipFileFdPrivate * const gzipd = dynamic_cast(d); - if (gzipd == nullptr) - return nullptr; - else - return gzipd->gz; -#else - return nullptr; -#endif -} - /*}}}*/ - // Glob - wrapper around "glob()" /*{{{*/ std::vector Glob(std::string const &pattern, int flags) { diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index 862880c31..bbfd0768e 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -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;}; diff --git a/debian/libapt-pkg6.0.symbols b/debian/libapt-pkg6.0.symbols index 1ac905bbd..120b0579c 100644 --- a/debian/libapt-pkg6.0.symbols +++ b/debian/libapt-pkg6.0.symbols @@ -752,7 +752,6 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"FileFd::Open(std::__cxx11::basic_string, std::allocator >, unsigned int, APT::Configuration::Compressor const&, unsigned long)@APTPKG_6.0" 0.8.16~exp9 (c++)"FileFd::ReadLine(char*, unsigned long long)@APTPKG_6.0" 0.8.16~exp9 (c++)"SummationImplementation::AddFD(FileFd&, unsigned long long)@APTPKG_6.0" 0.8.16~exp9 - (c++|optional=deprecated,previous-inline)"FileFd::gzFd()@APTPKG_6.0" 0.8.0 ### CacheSet rework: making them real containers breaks bigtime the API (for the CacheSetHelper) (c++)"APT::CacheSetHelper::canNotFindTask(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@APTPKG_6.0" 0.8.16~exp9 (c++)"APT::CacheSetHelper::canNotFindRegEx(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@APTPKG_6.0" 0.8.16~exp9 -- cgit v1.2.3-70-g09d2 From e1024dc0acf72b9615c0821f005364543775a58a Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 14:36:42 +0100 Subject: fileutl: Merge Popen variants --- apt-pkg/contrib/fileutl.cc | 10 ---------- apt-pkg/contrib/fileutl.h | 4 +--- debian/libapt-pkg6.0.symbols | 3 +-- 3 files changed, 2 insertions(+), 15 deletions(-) (limited to 'apt-pkg/contrib') diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index d23e805e0..3b4a4a10c 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -3136,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; diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index bbfd0768e..fff49a757 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -279,9 +279,7 @@ std::vector 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); diff --git a/debian/libapt-pkg6.0.symbols b/debian/libapt-pkg6.0.symbols index 5c91ce9af..5be6fa880 100644 --- a/debian/libapt-pkg6.0.symbols +++ b/debian/libapt-pkg6.0.symbols @@ -1040,7 +1040,7 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"pkgTagSection::FindB(char const*, bool const&) const@APTPKG_6.0" 1.1~exp1 (c++)"pkgTagSection::Scan(char const*, unsigned long, bool)@APTPKG_6.0" 1.1~exp1 (c++)"StartsWithGPGClearTextSignature(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_6.0" 1.1~exp1 - (c++)"Popen(char const**, FileFd&, int&, FileFd::OpenMode)@APTPKG_6.0" 1.1~exp1 + (c++)"Popen(char const**, FileFd&, int&, FileFd::OpenMode, bool, bool)@APTPKG_6.0" 1.9.0~ (c++)"APT::String::Startswith(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_6.0" 1.1~exp2 (c++)"APT::Upgrade::Upgrade(pkgDepCache&, int, OpProgress*)@APTPKG_6.0" 1.1~exp4 (c++)"pkgProblemResolver::Resolve(bool, OpProgress*)@APTPKG_6.0" 1.1~exp4 @@ -1436,7 +1436,6 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"APT::String::Join(std::vector, std::allocator >, std::allocator, std::allocator > > >, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_6.0" 1.4~beta4 (c++)"debListParser::ParseDepends(char const*, char const*, std::__cxx11::basic_string, std::allocator >&, std::__cxx11::basic_string, std::allocator >&, unsigned int&, bool const&, bool const&, bool const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_6.0" 1.4~beta3 (c++)"pkgTagHash(char const*, unsigned long)@APTPKG_6.0" 1.4~beta1 - (c++)"Popen(char const**, FileFd&, int&, FileFd::OpenMode, bool)@APTPKG_6.0" 1.3.1 (c++|optional=std)"void std::vector, std::allocator >, std::allocator, std::allocator > > >::emplace_back(char const (&) [4])@APTPKG_6.0" 1.4~beta4 (c++)"FileFd::ReadLine(std::__cxx11::basic_string, std::allocator >&)@APTPKG_6.0" 1.5~beta2~ (c++)"MaybeAddAuth(FileFd&, URI&)@APTPKG_6.0" 1.5~beta2~ -- cgit v1.2.3-70-g09d2