When you \RequirePackage{foo} in a document class, this "loads" the package so you can start using it. But what if you don't want to do that? What if you only want to ensure it is available for loading, e.g. for other code to be able to \usepackage{foo} later on?
Is that possible?
Motivation: I'm going to be deferring the loading of a package within a document class, but I do want to fail immediately if the package isn't there so as not to confuse whoever is reading the logs.
\IfFileExists, see https://tex.stackexchange.com/questions/98203/can-i-test-if-a-file-exists – egreg Sep 19 '17 at 23:32foo.styand nothing else? – einpoklum Sep 19 '17 at 23:34\IfFileExists{foo.sty}{Do something if it exists}{Do something else otherwise}– egreg Sep 19 '17 at 23:36\IfFileExistslook in all of the places that\usepackagewould? – Michael Palmer Sep 19 '17 at 23:51\IfFileExist{\Require...}{error...}in the deferred code. – cfr Sep 20 '17 at 00:45\usepackageitself indirectly calls\IfFileExiststo load the.styfile. – GuM Sep 20 '17 at 01:55