Repository: conan-io/conan
Issue: [bug] unable to create package with overridden dependency and requires in package_info

### Environment details

* Operating System+version: Windows 10
* Compiler+version: msvc 193
* Conan version: 2.0.5
* Python version: 3.10.0


### Steps to reproduce

1. Create conanfile with overridden dependency and requires in package_info
```
from conan import ConanFile

class ConanRecipe(ConanFile):
    name = "test-lib"

    def requirements(self):
        self.requires("libffi/3.4.4", override=True)
        self.requires("glib/2.76.2")
    def package_info(self):
        self.cpp_info.requires = [
            "glib::glib",
        ]
```
2. run conan create . 
With conan 2.0.4 all works as expected 

### Logs

```
conan create . -pr:b=conan/profiles/windows_build -pr:h=conan/profiles/windows_x86 --version=0.0.1                         

======== Exporting recipe to the cache ========
WARN: Name containing special chars is discouraged 'test-lib'                    
test-lib/0.0.1: Exporting package recipe: D:\\ClionProjects\\hotreload\\conanfile.py
test-lib/0.0.1: Copied 1 '.py' file: conanfile.py                                
test-lib/0.0.1: Exported to cache folder: C:\\Users\\Roman\\.conan2\\p\\test-9fc43bfefbb24\\e            
test-lib/0.0.1: Exported: test-lib/0.0.1#b597a043878cfd0eeb478c5ae7451826 (2023-05-19 07:29:53 UTC)
                                                                                                   
======== Input profiles ========                                                                   
Profile host:                                                                                      
[settings]
arch=x86
build_type=Release
compiler=msvc
compiler.cppstd=20
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows
[conf]
tools.cmake.cmaketoolchain:generator=Ninja

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=20
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows
[conf]
tools.cmake.cmaketoolchain:generator=Ninja


======== Computing dependency graph ========
Graph root
    cli
Requirements
    bzip2/1.0.8#411fc05e80d47a89045edc1ee6f23c1d - Cache
    glib/2.76.2#b0bbe0db6132c641cb33a2ae48575612 - Cache
    libffi/3.4.4#5cb7e238ba52f36d24c40b8528686967 - Cache
    libgettext/0.21#f4b0a8d73ecaa9f481fe4688b79fb04c - Cache
    libiconv/1.17#171f2ce1f8b4178cc12e4488d3d6ad67 - Cache
    pcre2/10.42#2079a0447f9652dffcbbf1eb73ae2d4e - Cache
    test-lib/0.0.1#b597a043878cfd0eeb478c5ae7451826 - Cache
    zlib/1.2.13#13c96f538b52e1600c40b88994de240f - Cache
Build requirements
    autoconf/2.71#f4e2bd681d49b4b80761aa587bde94d5 - Cache
    automake/1.16.5#891f585a736bce951cc0e7109aa5ffee - Cache
    m4/1.4.19#c1c4b1ee919e34630bb9b50046253d3c - Cache
    meson/1.0.0#15586c0ac6f682805875ef903dbe7ee2 - Cache
    meson/1.1.0#6176e4f21370f5820c27da02836c32c9 - Cache
    msys2/cci.latest#567331f1604f3c584f04feade960f06e - Cache
    ninja/1.11.1#63bca91350508f335754f5f9e17ec989 - Cache
    pkgconf/1.9.3#a920b5c7f8d04f22b9fe03db91a864dd - Cache
Overrides
    libffi/3.4.4: ['libffi/3.4.4']

======== Computing necessary packages ========
test-lib/0.0.1: Forced build from source
Requirements
    glib/2.76.2#b0bbe0db6132c641cb33a2ae48575612:f8e2fe6e090f15df888ad83fe069c8664b251ec9#813386b3671f188bd665dfc1d09ff8e9 - Cache
    libgettext/0.21#f4b0a8d73ecaa9f481fe4688b79fb04c:925cf07be0f3f1fae7f8c940613391f9680dd77e#292a3759edf7fef41a90eebb4bd3c61a - Cache
    libiconv/1.17#171f2ce1f8b4178cc12e4488d3d6ad67:8419bdd2579514d415d70db8caf4318ede661647#1db152027f0130a39f34607fb99e39cb - Cache
    test-lib/0.0.1#b597a043878cfd0eeb478c5ae7451826:761d8555cb61a5deaf58f4e6de0a46ad674849e7 - Build
Build requirements
Skipped binaries
    ['bzip2/1.0.8', 'libffi/3.4.4', 'pcre2/10.42', 'zlib/1.2.13', 'autoconf/2.71', 'automake/1.16.5', 'm4/1.4.19', 'meson/1.0.0', 'meson/1.1.0', 'msys2/cci.latest', 'ninja/1.11.1', 'pkgconf/1.9.3']

======== Installing packages ========
libiconv/1.17: Already installed! (1 of 4)
libgettext/0.21: Already installed! (2 of 4)
glib/2.76.2: Already installed! (3 of 4)

-------- Installing package test-lib/0.0.1 (4 of 4) --------
test-lib/0.0.1: Building from source
test-lib/0.0.1: Package test-lib/0.0.1:761d8555cb61a5deaf58f4e6de0a46ad674849e7
test-lib/0.0.1: Copying sources to build folder
test-lib/0.0.1: Building your package in C:\\Users\\Roman\\.conan2\\p\\b\\test-ea00fc6b1a508\\b
test-lib/0.0.1: Generating aggregated env files
test-lib/0.0.1: Generated aggregated env files: ['conanbuild.bat', 'conanrun.sh']
test-lib/0.0.1: Package '761d8555cb61a5deaf58f4e6de0a46ad674849e7' built
test-lib/0.0.1: Build folder C:\\Users\\Roman\\.conan2\\p\\b\\test-ea00fc6b1a508\\b
test-lib/0.0.1: Generating the package
test-lib/0.0.1: Temporary package folder C:\\Users\\Roman\\.conan2\\p\\b\\test-ea00fc6b1a508\\p
test-lib/0.0.1: package(): WARN: No files in this package!
test-lib/0.0.1: Created package revision 3542be7efe21ac57f2345a030a713ffc
test-lib/0.0.1: Package '761d8555cb61a5deaf58f4e6de0a46ad674849e7' created
test-lib/0.0.1: Full package reference: test-lib/0.0.1#b597a043878cfd0eeb478c5ae7451826:761d8555cb61a5deaf58f4e6de0a46ad674849e7#3542be7efe21ac57f2345a030a713ffc
test-lib/0.0.1: Package folder C:\\Users\\Roman\\.conan2\\p\\b\\test-ea00fc6b1a508\\p
ERROR: test-lib/0.0.1: Required package 'libffi' not in component 'requires'
```

Changed files:
conans/model/build_info.py, conans/test/integration/test_components.py

diff --git a/conans/model/build_info.py b/conans/model/build_info.py
index bf6c42de9..16de20cb2 100644
--- a/conans/model/build_info.py
+++ b/conans/model/build_info.py
@@ -530,7 +530,7 @@ class CppInfo:
             return
         # Only direct host (not test) dependencies can define required components
         direct_dependencies = [d.ref.name for d in conanfile.requires.values()
-                               if not d.build and not d.is_test and d.visible]
+                               if not d.build and not d.is_test and d.visible and not d.override]
 
         for e in external:
             if e not in direct_dependencies:
diff --git a/conans/test/integration/test_components.py b/conans/test/integration/test_components.py
index ad46f6fb9..595a1ea90 100644
--- a/conans/test/integration/test_components.py
+++ b/conans/test/integration/test_components.py
@@ -113,3 +113,36 @@ def test_components_not_required():
     c.run("create expat")
     c.run("create wayland")
     assert "wayland/1.0: Created package" in c.out
+
+
+def test_components_overrides():
+    """
+    overrides are not direct dependencies, and as such, they don't need to be mandatory
+    to specify in the components requires
+
+    https://github.com/conan-io/conan/issues/13922
+    """
+    c = TestClient()
+    consumer = textwrap.dedent("""
+        from conan import ConanFile
+
+        class ConanRecipe(ConanFile):
+            name = "app"
+            version = "0.1"
+
+            def requirements(self):
+                self.requires("libffi/3.4.4", override=True)
+                self.requires("glib/2.76.2")
+
+            def package_info(self):
+                self.cpp_info.requires = ["glib::glib"]
+        """)
+    c.save({"libffi/conanfile.py": GenConanfile("libffi"),
+           "glib/conanfile.py": GenConanfile("glib", "2.76.2").with_requires("libffi/3.0"),
+            "app/conanfile.py": consumer})
+    c.run("create libffi --version=3.0")
+    c.run("create libffi --version=3.4.4")
+    c.run("create glib")
+    # This used to crash, because override was not correctly excluded
+    c.run("create app")
+    assert "app/0.1: Created package" in c.out