Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

TimeDate 2.30 - Bug in test-code

by Skeeve (Parson)
on Jan 10, 2020 at 09:20 UTC ( [id://11111277]=perlquestion: print w/replies, xml ) Need Help??

Skeeve has asked for the wisdom of the Perl Monks concerning the following question:

Yesterday I stumbled across a bug in https://metacpan.org/release/TimeDate.

One of the modules I install in a docker image is depending on this module but it failed to install.

Reason given was

Redundant argument in printf at t/date.t line 180.

Looking at that line printf "%-40s\t%s\n", $_,$x,"\n"; it's clear that the ,"\n" is the redundant part.

Besides mailing the author (who didn't provide any contribution information), what could one do to fix this issue?

For the time being I force-install the module. Better would be, I guess, to apply a diff.


s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

Replies are listed 'Best First'.
Re: TimeDate 2.30 - Bug in test-code
by marto (Cardinal) on Jan 10, 2020 at 09:31 UTC

    " it's clear that the ,"\n" is the redundant part."

    Are you sure about that? rt://124509 (note the patch and the last comment regarding distroprefs) and issue 20.

      Those seem to be about t/getdate.t rather than t/date.t so that's a different problem I think? rt://TimeDate seems to have a sizeable (and increasing) number of issues, alas.

      ++ @ marto

      You are right. Thanks for looking into it and pointing this out

      Question: Is there a way cpanm can automatically apply the patch given? I have no clue whether or not it's possible.

      Answer: No, there isn't

      Does cpanm support the feature XYZ of CPAN and CPANPLUS? Most likely not. Here are the things that cpanm doesn't do by itself.

      […]

      Patching CPAN modules with distroprefs.

      s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
      +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

        In case anyone is interested, this is my workaround in my docker-compose.yaml

        COPY cpanfile .
        # Patched TimeDate. See https://rt.cpan.org/Public/Bug/Display.html?id=124509
        COPY TimeDate-2.30 /TimeDate-2.30
        RUN cpanm /TimeDate-2.30 \
          && cpanm --installdeps . \
          && rm -rf TimeDate-2.30
        

        The local copy I have is already patched

        I'm sure there are better ways to achieve this


        s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
        +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
Re: TimeDate 2.30 - Bug in test-code
by hippo (Bishop) on Jan 17, 2020 at 16:16 UTC

    There is a new version out now which should fix this (and some other issues too).

      Thanks a lot!

      Today morning the module using the previous version switched to yours.


      s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
      +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

        You're welcome, but the only thing I did was let you know about it. Brother atoomic did all the work.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11111277]
Approved by marto
Front-paged by haukex
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-19 20:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found