Bug 838480 - perl-DateTime is too old
perl-DateTime is too old
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: perl-DateTime (Show other bugs)
Unspecified Unspecified
high Severity high
: rc
: ---
Assigned To: perl-maint-list
BaseOS QE - Apps
: Rebase
Depends On:
Blocks: 947784
  Show dependency treegraph
Reported: 2012-07-09 04:40 EDT by Petr Pisar
Modified: 2013-06-27 04:56 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Rebase: Bug Fixes and Enhancements
Doc Text:
Story Points: ---
Clone Of: 838476
Last Closed: 2013-06-27 04:56:20 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Petr Pisar 2012-07-09 04:40:07 EDT
+++ This bug was initially created as a clone of Bug #838476 +++

+++ This bug was initially created as a clone of Bug #838120 +++

Fedora delivers version 0.70 which is too old.

For example it does not implement 2012-07 leap second which has been added by upstream in version 0.71 on 2012-01-05. It can result in faulty time arithmetics now.

It's shame Fedora does not deliver current version of such impotant package demanding regular updates. Upstream changelog:

0.76   2012-07-01

- The DateTime->subtract method ignored the end_of_month parameter. Patch by
  Chris Reinhardt. RT #77844.

0.75   2012-06-11

- The epoch for years 1-999 was broken because Time::Local is "clever". A pox
  on all clever APIs, I say! Reported by Christian Hansen. RT #77719.

- Shut up compilation warning from 5.17.x. Reported by Tom Wyant. RT #77490.

0.74   2012-03-22

- Small packaging fix for metacpan's benefit. No need to upgrade.

0.73   2012-03-17

- Change tests to work with Zefram's entirely rebuilt DateTime::TimeZone
  distribution, which will replace the current implementation. Patch by
  Zefram. RT #75757.

0.72   2012-01-05

- Remove Test::DependentModules from the dep list. This is used by some
  author-only tests. Reported by Zefram.

0.71   2012-01-05

- There will be a new leap second on June 30, 2012.

--- Additional comment from iarnell@gmail.com on 2012-07-06 17:59:53 GMT ---


And Petr, how about cloning this for RHEL? It's an even bigger shame that Red Hat delivers an even more outdated version of this package (and more importantly, DateTime::TimeZone) demanding regular updates.

RHEL-6 is affected (perl-DateTime-1:0.5300-1.el6.x86_64). Changelog continuation:

0.70   2011-05-09

- Really fix %N, finally. This was breaking the DateTime::Event::Recurrence
  test suite. Patch by Dagfinn Ilmari Mannsåker.

0.69   2011-05-03

- When a DateTime object had nanoseconds == 0, the %N strftime specifier
  always returned "0" regardless of the precision requested. Reported by John
  Siracusa. RT #67928.

0.68   2011-04-25

- The tests for %N in the last release relied on the vagaries of floating
  point math on a 64-bit system. Now the from_epoch() method just uses string
  operations to separate the epoch into an integer value and a mantissa. This
  avoids floating point insanity. Reported by zefram. RT #67736.

0.67   2011-04-24

- The %N strftime specifier simply truncated nanoseconds, rather than rounding
  them. Reported by Michael R. Davis. RT #66744.

- The %U strftime specifier was off by one in years where January 1st was a
  Sunday. Patch by Christian Hansen. RT #67631.

- The %W strftime specifier was off by one in years where January 1st was a
  Sunday or Monday. Patch by Christian Hansen. RT #67631.

- Some small optimizations from Christian Hansen. The biggest impact is for
  calculating week_of_month, week_number, and week_year.

- This distro now requires Perl 5.8.1+ (it implicitly did this anyway now that
  Params::Validate is 5.8.1+).

0.66   2010-11-26

- A bunch of documentation cleanup. No code changes.

0.65   2010-10-25

- Actually put the right $VERSION in every package. No other changes.

0.64   2010-10-25

* All the constructors besides new() ended up calling new(), which meant that
  these constructors went through the parameter validation code
  twice. Avoiding this should make everything that constructs a new object
  (besides new() itself) a little faster.

  ** This change breaks DateTime::Fiscal::Retail454, but no other modules, to
     the best of my knowledge. **

- The t/39no-so.t test failed for some people. I can't reproduce it, but this
  release will hopefully fix the problem. Patch by Tokuhiro Matsuno. RT

- Added a section on the DateTime Project ecosystem to the docs. Addresses RT

- Fixed wiki links in the docs now that the wiki has moved to a new wiki

- Restored some of the dzil-ification. The repo now has a very minimal
  Build.PL file which is just enough to build the XS code and run the
  tests. This fixes the total lack of prereqs in the META.* files. Reported by
  Bjørn-Olav. RT #62427.

0.63   2010-09-24

- Actually bump the version in the module files. Oops. Reported by bricas.

0.62   2010-09-23

- Don't try to test with DateTime::Format::Strptime unless we have a
  relatively recent version. Should fix some test failures.

0.61   2010-07-16

- Switching to dzil in 0.56 broke the --pp flag for the Build.PL. Reported by
  Jonathan Noack. RT #59421.

0.60   2010-07-03

- By default, Dist::Zilla generates a Build.PL that requires Module::Build
  0.3601+, but this distro really doesn't need any particular version.

0.59   2010-06-29

- More packaging fixes. This release makes sure that POD only shows up in the
  right files. In 0.56 through 0.58, some POD in the wrong place confused the
  search.cpan.org POD display code, and the main module's documentation wasn't

0.58   2010-06-28

- Versions 0.56 and 0.57 did not build XS properly when installing.

0.57   2010-06-26

- Make DateTime::LeapSecond have the same $VERSION as every other .pm file.

0.56   2010-06-26

- The set_formatter() method did not return the DateTime object, and did not
  actually validate the value provided for the formatter. Based on a patch by
  Andrew Whatson. RT #58506.

- Improved docs on floating time zone. Based on suggestions by Michael
  Svoboda. RT #56389.

- Added mention of end-of-month algorithms to docs on DateTime math. Based on
  a patch by Michael R. Davis. RT #58533.

- License is now Artistic 2.0.

0.55   2010-03-16

- Get all tests passing on 5.6.2. Thanks to Zefram for help spotting the

- Moved code to my hg repo at http://hg.urth.org/hg/DateTime.pm.

0.54   2010-03-14

- Bumped the DateTime::TimeZone prereq to 1.09 to force people to use a modern
  version. Previously the minimum version was 0.59, and there have been a lot
  of bug fixes since then.

- String overloading now extends to string comparison, so a DateTime object
  can be compared to any string. In other words

  if ( $dt eq $string ) { ... }

  will simply stringify $dt and then do a normal string-is-equals
  check. Previously, this would blow up unless both operands were a DateTime

  Note that future versions of Test::More (0.95_01+) will no longer stringify
  arguments to is(), which means that older versions of DateTime may cause new
  test failures when you upgrade Test::More. It is highly recommended that you
  upgrade DateTime before upgrading to Test::More 0.95_01+.

  Patch by Michael Schwern. RT #55453.

- Allow passing end_of_month setting to $duration->inverse(). Requested by
  John Siracusa. RT #53985.
Comment 1 Petr Pisar 2013-06-26 07:56:53 EDT
New versions are available. There is no big change except a little bit different rounding algorithm introduced in version 0.78:

1.03   2013-04-17

- The set_time_zone() method was not returning the object when caalled with a
  name that matched the current zone. Reported by Noel Maddy. RT #84699.

1.02   2013-04-15

- When a constructor method like new() or today() was called on an object,
  you'd get an error message like 'Can't locate object method
  "_normalize_nanoseconds" via package "2013-04-15T00:00:00"'. This has been
  fixed to provide a sane error message. Patch by Doug Bell.

- When set_time_zone() is called with a name that matches the current time
  zone, DateTime now short circuits and avoids a lot of work. Patch by Mark

1.01   2013-04-01

- Fixed test failures on older Perls.

1.00   2013-03-31

- Bumped the version to 1.00. This is mostly because my prior use of both X.YY
  and X.YYYY versions causes trouble for some packaging systems. Plus after 10
  years it's probably ready to be called 1.00. Requested by Adam. RT #82800. 

- The %j specifier for strftime was not zero-padding 1 and 2 digit
  numbers. Fixed by Christian Hansen. RT #84310.

- The truncate method was sloppy about validating its "to" parameter, so you
  could pass things like "years" or "month whatever anything goes". The method
  would accept the parameter but then not actually truncate the object. RT

- Previously, if a call to $dt->set_time_zone() failed it would still change
  the time zone of the object, leaving it in a broken state. Reported by Bill
  Moseley. RT #83940.

- DateTime::Infinite objects should no longer die when methods that require a
  locale are called. Instead, these methods return undef for names and
  Inf/-Inf for numbers. This affects methods such as day_name() as well as
  CLDR and strftime formats. When a locale-specific format is used (like the
  "full" datetime format) it uses the en_US format. Reported by Paul
  Boldra. RT #67550.

0.78   2012-11-16

- Reverted the change to round nanoseconds up or down in various
  situtations. Now we always round down. This avoids the case where rounding
  up would require us to then increment the second value (which could then
  require us to increment the minute, which could then require us to increment
  the hour, which could then ...).

  In other words, we don't want to round 2011-12-31T23:59:59.999999 up to
  2012-01-01T00:00:00, because that would be insane.

  This applies to the return values for ->microsecond, ->millisecond, and the
  %N specifier for strftime.

  Patch by Martin Hasch. RT #79845.

0.77   2012-09-25

- POD changes that should make the documentation look better, especially on
  the web.
Comment 2 Petr Pisar 2013-06-26 08:49:33 EDT
Versions after 1.00 requires Try::Tiny that is not packaged in RHEL-6.5 yet. If it's not possible to add it, DateTime can be easily patched (reverting upstream commit 1489430f).

Version after 0.70 requires Test::Fatal for running tests. Test::Fatal is not yet in RHEL-6.5. Test::Fatal requires Try::Tiny. It would be possible to refactor  the tests not to use Test::Fatal, but easier would be to add Test::Fatal.

However as I can see, RHEL-6.5-current DateTime 0.53 bundles DateTime-0.53,  DateTime-Locale-0.44, and DateTime-TimeZone-1.08.

In this light, we had to package them too.

Thus rebase is not good idea here. 

Patching leap second database is more feasible:

diff --git a/leaptab.txt b/leaptab.txt
index ef2ec12..f1c7f2e 100644
--- a/leaptab.txt
+++ b/leaptab.txt
@@ -22,3 +22,4 @@
 1999  Jan. 1  +1
 2006  Jan. 1  +1
 2009  Jan. 1  +1
+2012  Jul. 1  +1
Comment 3 Petr Pisar 2013-06-26 09:20:22 EDT
Well, it's not literally bundled, but still it would require the Test::Fatal and Try::Tiny.
Comment 4 Ondrej Vasik 2013-06-27 04:47:38 EDT
Based on the latest Petr's findings about the dependencies, I'm going to NAK this request from development point of view. The primary issue with leap second will be addressed by #978360.
Comment 5 RHEL Product and Program Management 2013-06-27 04:56:20 EDT
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.

Note You need to log in before you can comment on or make changes to this bug.