Ticket #117 (closed cage: fixed)

Opened 6 years ago

Last modified 6 years ago

[todo] 4 different perl slurp methods in Parrot::

Reported by: rurban Owned by: jkeenan
Priority: minor Milestone:
Component: configure Version: trunk
Severity: medium Keywords:
Cc: Language:
Patch status: Platform: all

Description

In our perl5 build system we have currently 4 slurp functions.

Parrot::Distribution Parrot::Configure::Utils Parrot::BuildUtils Parrot::Test

Parrot::BuildUtils has the least dependencies, it works even without Parrot::Config, so we can reduce it to this one only.

Attachments

slurp.functions.txt Download (1.4 KB) - added by jkeenan 6 years ago.
Our 5 different slurp functions.
sub.slurp.txt Download (2.3 KB) - added by jkeenan 6 years ago.
Additional locations where: ack 'sub.*slurp'

Change History

follow-up: ↓ 2   Changed 6 years ago by jkeenan

  • owner set to jkeenan
  • status changed from new to assigned

As shown in attachment slurp.functions.txt, two of the four functions change DOS line endings to Unix endings.

Is there any reason why we should not retain this line-ending-changing functionality in the surviving function?

Thank you very much.
kid51

Changed 6 years ago by jkeenan

Our 5 different slurp functions.

in reply to: ↑ 1   Changed 6 years ago by jkeenan

It turns out there is a slurp_file function in tools/util/dump_pbc.pl as well, though its use is weirder.

Changed 6 years ago by jkeenan

Additional locations where: ack 'sub.*slurp'

  Changed 6 years ago by jkeenan

So far I have eliminated the unused function in Parrot::Distribution and aliased the functions in Parrot::Configure::Utils and Parrot::Test to Parrot::BuildUtil::slurp_file().

follow-up: ↓ 5   Changed 6 years ago by jkeenan

I had to restore the slurp method to Parrot::Distribution. It's a P::D method and so cannot be directly replaced with/aliased to one of the other subs.

in reply to: ↑ 4 ; follow-up: ↓ 6   Changed 6 years ago by jkeenan

  • status changed from assigned to closed
  • resolution set to fixed

I changed the names of two Parrot::Configure::Data methods, slurp() and slurp_temp(), so that we could reduce the number of '*slurp*' subroutines that ack or grep would find in the repository.

The function in Parrot::Distribution is a method in that class, so it has to be retained (at least for the time being).

Since the subroutines found in Parrot::Configure::Utils and Parrot::Test are used in many test files, I figured it would be simpler to alias those subroutines to the function in Parrot::BuildUtil than to re-code all those tests.

Closing ticket.

in reply to: ↑ 5   Changed 6 years ago by coke

Replying to jkeenan:

I was confused by the comment thread here, but: Looks like the slurp methods referred to here were called slurp, but weren't simply slurp clones. Renaming them to something that more closely identifies their intent? +1

in reply to: ↑ description   Changed 6 years ago by jkeenan

Replying to rurban:

In our perl5 build system we have currently 4 slurp functions. Parrot::Distribution Parrot::Configure::Utils Parrot::BuildUtils

It should be noted that the relevant package is:
Parrot::BuildUtil

... i.e., no final s.

kid51

Note: See TracTickets for help on using tickets.