Opened 14 years ago

Closed 13 years ago

#26255 closed defect (fixed)

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 (1)

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

Download all attachments as: .zip

Change History (13)

comment:1 Changed 14 years ago by jmroot (Joshua Root)

Port: tsung added

Please remember to fill in the Port field.

comment:2 Changed 14 years ago by aaronbrashears@…

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

comment:3 Changed 14 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 14 years ago by danielluke (Daniel J. Luke)

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 14 years ago by jpo@…

Cc: jpo@… added

Cc Me!

comment:6 Changed 14 years ago by jpo@…

This also affects tsung-1.3.3.

comment:7 Changed 14 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 14 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 14 years ago by jpo@…

Attachment: tsung-1.3.3-Portfile.patch added

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

comment:9 Changed 14 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 Changed 14 years ago by jpo@…

ping ! Ticket can be closed with the attached patch.

comment:11 in reply to:  10 Changed 13 years ago by jmroot (Joshua Root)

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 13 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.