Skip to content

Commit

Permalink
Fixes #6: pc files can be specified directly
Browse files Browse the repository at this point in the history
  • Loading branch information
gbiggs committed Apr 13, 2012
1 parent b9d38bf commit c4dd7d6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pykg_config/pkgsearcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# $Source$

from os import getenv, listdir
from os.path import isdir, join, split
from os.path import isdir, isfile, join, split, splitext
import sys
if sys.platform == 'win32':
import _winreg
Expand Down Expand Up @@ -116,8 +116,13 @@ def search_for_package(self, dep, globals):
"""
# Get a list of pc files matching the package name
ErrorPrinter().debug_print('Searching for package matching %s', (dep))
pcfiles = self.search_for_pcfile(dep.name)
if isfile(dep.name) and splitext(dep.name)[1] == '.pc':
# No need to search for a pc file
ErrorPrinter().debug_print('Using provided pc file %s', (dep.name))
pcfiles = [dep.name]
else:
ErrorPrinter().debug_print('Searching for package matching %s', (dep))
pcfiles = self.search_for_pcfile(dep.name)
ErrorPrinter().debug_print('Found .pc files: %s', (str(pcfiles)))
if not pcfiles:
raise PackageNotFoundError(str(dep))
Expand Down

0 comments on commit c4dd7d6

Please sign in to comment.