I have a folder ~/texmf in which I keep locally generated packages useful in my work, or ones that I judiciously modify. I do this to protect against breaking things when I upgrade TeXLive on my Linux system - I always do upgrades/installs using vanilla versions available on texlive.org since the Debian packages are usually out of date.
One such package is saved as a subfolder under ~/texmf/tex/latex/local. Let us call it usefulpackage. Now, ~/texmf/tex/latex/local/usefulpackage/ has a subfolder called images. This contains some images of use in that package. In fact, usefulpackage is on GitHub as a private repo that I distribute to a few selected coworkers. usefulpackage/images contains a few sample files such as scan.png, header.eps, etc.
I was recently writing a document completely unrelated to usefulpackage, in which I had a subfolder called Figures. The subdirectory Figures contains several files, some of which have names that clash with names of some files in usefulpackage/images.
I generally set graphicspath: \graphicspath{{./Figures/}} in my LaTeX documents.
What has happened is that my compiled PDF has ended up with images from usefulpackage/images when that is clealy not my intent or even a desirable outcome.
Is there any way in which I can force LaTeX to override texmf with graphicspath? Clearly, I am doing two things the right way - have a local package saved in ~/texmf and am using graphicspath for an unrelated document. However, the two correct protocols are interacting in this insidious manner.
\includegraphics{./Figures/file.png}
then the local one will be used.