Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.extension
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.extension
Commits
c60c3d98
Commit
c60c3d98
authored
10 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
Scan pkg-config location before using it to avoid impromptu error message
parent
894bd61a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/extension/pkgconfig.py
+7
-2
7 additions, 2 deletions
bob/extension/pkgconfig.py
with
7 additions
and
2 deletions
bob/extension/pkgconfig.py
+
7
−
2
View file @
c60c3d98
...
@@ -7,7 +7,7 @@ import os
...
@@ -7,7 +7,7 @@ import os
import
sys
import
sys
import
subprocess
import
subprocess
import
logging
import
logging
from
.utils
import
uniq
,
uniq_paths
from
.utils
import
uniq
,
uniq_paths
,
find_executable
def
call_pkgconfig
(
cmd
,
paths
=
None
):
def
call_pkgconfig
(
cmd
,
paths
=
None
):
"""
Runs a command as a subprocess and raises if that does not work
"""
Runs a command as a subprocess and raises if that does not work
...
@@ -15,6 +15,11 @@ def call_pkgconfig(cmd, paths=None):
...
@@ -15,6 +15,11 @@ def call_pkgconfig(cmd, paths=None):
Returns the exit status, stdout and stderr.
Returns the exit status, stdout and stderr.
"""
"""
# locates the pkg-config program
pkg_config
=
find_executable
(
'
pkg-config
'
)
if
not
pkg_config
:
raise
OSError
(
"
Cannot find `pkg-config
'
- did you install it?
"
)
# sets the PKG_CONFIG_PATH taking into consideration:
# sets the PKG_CONFIG_PATH taking into consideration:
# 1. BOB_PREFIX_PATH, if set
# 1. BOB_PREFIX_PATH, if set
# 2. the paths set by the user
# 2. the paths set by the user
...
@@ -43,7 +48,7 @@ def call_pkgconfig(cmd, paths=None):
...
@@ -43,7 +48,7 @@ def call_pkgconfig(cmd, paths=None):
env
[
'
PKG_CONFIG_PATH
'
]
=
os
.
pathsep
.
join
([
var
,
old
])
if
old
else
var
env
[
'
PKG_CONFIG_PATH
'
]
=
os
.
pathsep
.
join
([
var
,
old
])
if
old
else
var
# calls the program
# calls the program
cmd
=
[
'
pkg
-
config
'
]
+
[
str
(
k
)
for
k
in
cmd
]
cmd
=
pkg
_
config
[:
1
]
+
[
str
(
k
)
for
k
in
cmd
]
subproc
=
subprocess
.
Popen
(
subproc
=
subprocess
.
Popen
(
cmd
,
cmd
,
env
=
env
,
env
=
env
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment