Wireshark-dev: Re: [Wireshark-dev] RFC: Add fallback path to get_datafile_dir

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Mon, 29 Aug 2011 13:45:58 -0700
On Aug 29, 2011, at 11:48 AM, Joerg Mayer wrote:

> On Mon, Aug 29, 2011 at 11:38:55AM -0700, Guy Harris wrote:
>>> as the problem recently popped up how to load auxillary files in the source
>>> directory that have not been installed to their final paths, I've created a
>>> patch that will add a fallback directory path to get_datafile_dir.
>>> So far get_datafile_dir would check wether some magic variable were set to
>>> locate generated (i.e. compiled) stuff inside the build dir instead of the
>>> install dir. This patch allows to override this behaviour to search in the
>>> specified directory relative to the source dir.
>> 
>> So this is for the case where the build directory isn't the source directory, and you want to run Wireshark from the build directory?
> 
> Correct. I think I haven't built Wireshark in tree for a few years.

It appears the patch is trying to resolve two separate issues:

	1) running from the build directory when the build directory isn't the source directory;

	2) dealing with the source directory not being laid out the way the installation directory is laid out.

The first of those needs to be done *regardless* of whether there needs to be an extra directory inserted in the path if you're fetching data from the source directory; it's best done in init_progfile_dir() (and, on UN*X, *not* done if running with special privileges).

The second of those needs to be done *regardless* of whether the build and source directories are the same; it should probably be done similarly to how it's done for the plugin and Python directories.