New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #26255 (closed defect: fixed)

Opened 3 years ago

Last modified 22 months ago

tsung-1.3.1 -- tsung_stats.pl references system perl

Reported by: aaronbrashears@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: Cc: jpo@…
Port: tsung

Description

The first line of tsung_stats.pl reads:

#!/usr/bin/perl -w

And should probably instead refer to the ports perl so that the p5-template-toolkit is found.

#!/opt/local/bin/perl -w

On Mac 10.5, without going into CPAN to meet the dependency tsung_stats.pl dumps:

Can't locate Template.pm in @INC (@INC contains: ...) at /opt/local/lib/tsung/bin/tsung_stats.pl line 365.

Attachments

tsung-1.3.3-Portfile.patch (850 bytes) - added by jpo@… 2 years ago.
tsung portfile patch - perl and python interpreters location; rrdtool requirement

Change History

comment:1 Changed 3 years ago by jmr@…

  • Port set to tsung

Please remember to fill in the Port field.

comment:2 Changed 3 years ago by aaronbrashears@…

My bad, I thought I filled it in. Thanks!

comment:3 Changed 2 years ago by jason-macports@…

What is the correct way to patch the perl file? Should we assume that macports is installed in /opt? Or should we use some sort of "/usr/bin/env perl" to find the macports perl?

I have the same problem as listed on this ticket. Changing the tsung_stats.pl file like described fixed the issue for me as well.

comment:4 Changed 2 years ago by dluke@…

You don't want to hardcode /opt/local but you can use ${prefix} to patch the file.

You can either just use reinplace to fix it in the Portfile, or you can use a patch + reinplace (the patch would put in a placeholder that you update with reinplace to ${prefix})

Setting it to /usr/bin/env perl is maybe OK (depends on the script), but it may run with system perl on some people's systems that way, so if you want it to always use macports perl (which is a good idea for non-trivial scripts), then you don't want to use that method.

comment:5 Changed 2 years ago by jpo@…

  • Cc jpo@… added

Cc Me!

comment:6 Changed 2 years ago by jpo@…

This also affects tsung-1.3.3.

comment:7 Changed 2 years ago by jpo@…

In reality there at least four scripts in /opt/local/lib/tsung that need to be changed (3 perl scripts and 1 python script):

$ find /opt/local/lib/tsung/ -type f | xargs head -n 1

##
## Output edited to show only the 4 scripts that need to be changed
##

==> /opt/local/lib/tsung/bin/log2tsung.pl <==
#!/usr/bin/env perl

==> /opt/local/lib/tsung/bin/tsung-rrd.pl <==
#!/opt/local/bin/perl

==> /opt/local/lib/tsung/bin/tsung_stats.pl <==
#!/opt/local/bin/perl -w

==> /opt/local/lib/tsung/tsung_plotter/tsung.py <==
#! /usr/bin/python

comment:8 Changed 2 years ago by jpo@…

Note: the above scripts - /opt/local/lib/tsung/bin/tsung-rrd.pl and /opt/local/lib/tsung/bin/tsung_stats.pl - were manually changed by me.

Note 2: the perl script also needs the perl module RRDs.pm that is supplied by the rrdtool port (not on the tsung requirements list).

Changed 2 years ago by jpo@…

tsung portfile patch - perl and python interpreters location; rrdtool requirement

comment:9 Changed 2 years ago by jpo@…

The attached patch does the following:

  • bumps revision to 1
  • adds the port rrdtool to the requirements list
  • changes the interpreter pathname of the 4 mentioned scripts to ${prefix}/bin/{perl,python}

comment:10 follow-up: ↓ 11 Changed 2 years ago by jpo@…

ping ! Ticket can be closed with the attached patch.

comment:11 in reply to: ↑ 10 Changed 22 months ago by jmr@…

Replying to jpo@…:

ping ! Ticket can be closed with the attached patch.

You and the reporter are the only ones whose email addresses are on the ticket, so nobody else was notified about this comment.

comment:12 Changed 22 months ago by jmr@…

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.