Package_.path_position is a numerical value corresponding to where its .pc file was found in the search_dirs list of directories that were searched. However, this number only tracks among directories that were actually able to be read. If a directory is skipped as unreadable, .path_postion no longer corresponds to the correct location in search_dirs. It's confusing when trying to debug: $ PKG_CONFIG_PATH=/nosuch1:/nosuch2:/dir-with-foo.pc $ pkg-config --debug foo [...] Path position of 'foo' is 1 even though foo is actually in the third directory specified. If ever someone wanted to extend Right now, it seems this value is used solely for sorting, to determine which of several pkg entries was found earlier in search_dirs. And one can use Package_.pcfiledir to look up the directory directly if that's what one wants to know. But if someone is extending the use of this value for some other purpose, it seems like broken behavior.
Created attachment 101560 [details] [review] Bump scanned_dir_count even if dir cannot be read My previous test case now gives: Path position of 'foo' is 3 This patch also adds the path_position to the --debug output to help keep track of the progress through the directory list.
Applied in a4ef355. Thanks!
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.