summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2019-02-26 13:41:02 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2019-02-26 16:31:20 +0100
commit88d3a9fde4ed1d1070ba0326569138f651cc60e8 (patch)
treeda875f9f33e0e5c6c1059f772025799d7025e525
parente9ac86f11b23310924058a045e0352b499c66d43 (diff)
strutl: Remove deprecated functions
-rw-r--r--apt-pkg/contrib/strutl.cc55
-rw-r--r--apt-pkg/contrib/strutl.h2
-rw-r--r--debian/libapt-pkg6.0.symbols4
3 files changed, 0 insertions, 61 deletions
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<std::string> &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<char, std::char_traits<char>, std::allocator<char> > const&, long&)@APTPKG_6.0" 0.8.0
- (arch=x32|c++)"StrToTime(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > 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