]> git.saurik.com Git - apt.git/commitdiff
Revert "travis: use gcc-5 instead of gcc(-4.8)"
authorDavid Kalnischkies <david@kalnischkies.de>
Wed, 29 Jun 2016 09:00:04 +0000 (11:00 +0200)
committerDavid Kalnischkies <david@kalnischkies.de>
Wed, 29 Jun 2016 10:23:02 +0000 (12:23 +0200)
This reverts commit 2b8221d66a8284042fc53c7bbb14bb9750e9137f.

Avoiding the use of GCC >= 5 stuff lets use go back to 4.8 simplifying
the travis setup again as well as reducing the backport requirements in
general.

This is possible because the std::get_time use requiring GCC >= 5 in
9febc2b238e1e322dce1f94ecbed46d595893b52 was replaced by handrolling it
in 1d742e01470bba27715a8191c50adde4b39c2f19, so the remaining uses are
just small conviniences we can do without.

Gbp-Dch: Ignore

.travis.yml
apt-pkg/contrib/strutl.cc
apt-pkg/deb/dpkgpm.cc
ftparchive/writer.cc

index 2a648c9401c37a98cb91595921f79fc82e470d36..a076d3e4c82ee0e15eb721d4eb2426d0cb1dab9b 100644 (file)
@@ -3,15 +3,13 @@ sudo: required
 dist: trusty
 before_install:
  - sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu/ wily main universe' -y
 dist: trusty
 before_install:
  - sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu/ wily main universe' -y
- - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
  - |
    sudo sh -c '/bin/echo -e "Package: *\nPin: release n=wily\nPin-Priority: 1" > /etc/apt/preferences.d/wily'
  - sudo apt-get update -qq
 install:
  - sudo ./prepare-release travis-ci
  - sudo apt-get -qq -y -t wily install gettext liblz4-dev python3-apt
  - |
    sudo sh -c '/bin/echo -e "Package: *\nPin: release n=wily\nPin-Priority: 1" > /etc/apt/preferences.d/wily'
  - sudo apt-get update -qq
 install:
  - sudo ./prepare-release travis-ci
  - sudo apt-get -qq -y -t wily install gettext liblz4-dev python3-apt
- - sudo apt-get -qq -y install gcc-5 g++-5
- - CC=gcc-5 CXX=g++-5 make
+ - make
 script:
  - make test
  - ./test/integration/run-tests -q
 script:
  - make test
  - ./test/integration/run-tests -q
index 1d9577125de2cbaff636b7e32ec8150bb7be441c..d0bc938e44c6adad5b3449e266c24b6d21b888bc 100644 (file)
@@ -757,7 +757,10 @@ string TimeRFC1123(time_t Date)
    auto const posix = std::locale("C.UTF-8");
    std::ostringstream datestr;
    datestr.imbue(posix);
    auto const posix = std::locale("C.UTF-8");
    std::ostringstream datestr;
    datestr.imbue(posix);
-   datestr << std::put_time(&Conv, "%a, %d %b %Y %H:%M:%S GMT");
+   APT::StringView const fmt("%a, %d %b %Y %H:%M:%S GMT");
+   std::use_facet<std::time_put<char>>(posix).put(
+                    std::ostreambuf_iterator<char>(datestr),
+                    datestr, ' ', &Conv, fmt.data(), fmt.data() + fmt.size());
    return datestr.str();
 }
                                                                        /*}}}*/
    return datestr.str();
 }
                                                                        /*}}}*/
index d8e8388829aeb3e7bd2acbb851eedf978a3e945b..5e27c2686b905bac55f8d8e3418a02bd681e1998 100644 (file)
@@ -1233,9 +1233,9 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress)
    if (notconfidx != std::numeric_limits<decltype(notconfidx)>::max())
    {
       if (ConfigurePending)
    if (notconfidx != std::numeric_limits<decltype(notconfidx)>::max())
    {
       if (ConfigurePending)
-        List.erase(std::next(List.cbegin(), notconfidx), std::prev(List.cend()));
+        List.erase(std::next(List.begin(), notconfidx), std::prev(List.end()));
       else
       else
-        List.erase(std::next(List.cbegin(), notconfidx), List.cend());
+        List.erase(std::next(List.begin(), notconfidx), List.end());
    }
 
    d->stdin_is_dev_null = false;
    }
 
    d->stdin_is_dev_null = false;
index 1036ce0b88e89e31964ed6d9355c3285f7a80bdd..dbeaa16a6a0b446151697c403118c1cc69096037 100644 (file)
@@ -967,6 +967,15 @@ bool ContentsWriter::ReadFromPkgs(string const &PkgFile,string const &PkgCompres
 // ReleaseWriter::ReleaseWriter - Constructor                          /*{{{*/
 // ---------------------------------------------------------------------
 /* */
 // ReleaseWriter::ReleaseWriter - Constructor                          /*{{{*/
 // ---------------------------------------------------------------------
 /* */
+static std::string formatUTCDateTime(time_t const now)
+{
+   // TimeRFC1123 uses GMT to satisfy HTTP/1.1
+   std::string datetime = TimeRFC1123(now);
+   auto const lastspace = datetime.rfind(' ');
+   if (likely(lastspace != std::string::npos))
+      datetime.replace(lastspace + 1, 3, "UTC");
+   return datetime;
+}
 ReleaseWriter::ReleaseWriter(FileFd * const GivenOutput, string const &/*DB*/) : FTWScanner(GivenOutput)
 {
    if (_config->FindB("APT::FTPArchive::Release::Default-Patterns", true) == true)
 ReleaseWriter::ReleaseWriter(FileFd * const GivenOutput, string const &/*DB*/) : FTWScanner(GivenOutput)
 {
    if (_config->FindB("APT::FTPArchive::Release::Default-Patterns", true) == true)
@@ -988,20 +997,7 @@ ReleaseWriter::ReleaseWriter(FileFd * const GivenOutput, string const &/*DB*/) :
    AddPatterns(_config->FindVector("APT::FTPArchive::Release::Patterns"));
 
    time_t const now = time(NULL);
    AddPatterns(_config->FindVector("APT::FTPArchive::Release::Patterns"));
 
    time_t const now = time(NULL);
-   auto const posix = std::locale("C.UTF-8");
-
-   // FIXME: use TimeRFC1123 here? But that uses GMT to satisfy HTTP/1.1
-   std::ostringstream datestr;
-   datestr.imbue(posix);
-   datestr << std::put_time(gmtime(&now), "%a, %d %b %Y %H:%M:%S UTC");
-
    time_t const validuntil = now + _config->FindI("APT::FTPArchive::Release::ValidTime", 0);
    time_t const validuntil = now + _config->FindI("APT::FTPArchive::Release::ValidTime", 0);
-   std::ostringstream validstr;
-   if (validuntil != now)
-   {
-      datestr.imbue(posix);
-      validstr << std::put_time(gmtime(&validuntil), "%a, %d %b %Y %H:%M:%S UTC");
-   }
 
    map<string,string> Fields;
    Fields["Origin"] = "";
 
    map<string,string> Fields;
    Fields["Origin"] = "";
@@ -1009,8 +1005,9 @@ ReleaseWriter::ReleaseWriter(FileFd * const GivenOutput, string const &/*DB*/) :
    Fields["Suite"] = "";
    Fields["Version"] = "";
    Fields["Codename"] = "";
    Fields["Suite"] = "";
    Fields["Version"] = "";
    Fields["Codename"] = "";
-   Fields["Date"] = datestr.str();
-   Fields["Valid-Until"] = validstr.str();
+   Fields["Date"] = formatUTCDateTime(now);
+   if (validuntil != now)
+      Fields["Valid-Until"] = formatUTCDateTime(validuntil);
    Fields["Architectures"] = "";
    Fields["Components"] = "";
    Fields["Description"] = "";
    Fields["Architectures"] = "";
    Fields["Components"] = "";
    Fields["Description"] = "";