[MacPorts] #58758: wireshark3 3.0.2_1: no "wireshark" executable (just Wireshark.app)
MacPorts
noreply at macports.org
Thu Jul 25 23:39:14 UTC 2019
#58758: wireshark3 3.0.2_1: no "wireshark" executable (just Wireshark.app)
-------------------------+------------------------
Reporter: ewenmcneill | Owner: (none)
Type: enhancement | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Keywords: | Port: wireshark3
-------------------------+------------------------
Prior versions of wireshark were able to be run from the command line as,
eg, `wireshark PCAP_FILE`, which is convenient when using `scp`/`sftp` to
download a PCAP file from elsewhere to analysis.
With the `wireshark3` package, there is no `wireshark` executable any
more, because it is now delivered as a native macOS application (eg,
`/Applications/MacPorts/Wireshark.app`) which means that it needs a new
way to open the application (and depending on how the PCAP files are
named, might need two steps -- one to open the application and one to
locate and open the PCAP file).
It would be helpful to include a `wireshark` wrapper script to bridge this
gap, perhaps something like this (which I put in
`/usr/local/bin/wireshark` myself after stumbling across this "why can't I
run wireshark" issue repeatedly while trying to analyse downloaded PCAP
files...):
{{{
#! /bin/sh
# This is a wrapper so we can run "wireshark FILE" and have it open.
#
# With wireshark3, MacPorts ships a native QT3 application (Wireshark.app)
# instead of an X11 port, and calls it Wireshark.app, and puts it outside
# the shell search path.
#---------------------------------------------------------------------------
if [ -n "${1}" ]; then
exec open -a /Applications/MacPorts/Wireshark.app "$@"
else
exec open /Applications/MacPorts/Wireshark.app
fi
}}}
That seems to work for me for both of the common cases that I regularly
use, ie "wireshark" by itself will open the application, and "wireshark
PCAP_FILE" will open the application for the PCAP file.
{{{
ewen at ashram:~$ port contents wireshark3 | grep /bin/
/opt/local/bin/capinfos
/opt/local/bin/captype
/opt/local/bin/dumpcap
/opt/local/bin/editcap
/opt/local/bin/idl2wrs
/opt/local/bin/mergecap
/opt/local/bin/randpkt
/opt/local/bin/rawshark
/opt/local/bin/reordercap
/opt/local/bin/sharkd
/opt/local/bin/text2pcap
/opt/local/bin/tshark
ewen at ashram:~$
}}}
--
Ticket URL: <https://trac.macports.org/ticket/58758>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list