diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-01-11 17:34:06 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-01-11 17:34:06 +0000 |
commit | c33279ef1613770bd03d6a8d954ed22f24c94915 (patch) | |
tree | ecfd970afa061cd9c4a09a0b701d224d5cd1d71a | |
parent | aaee88bf4323dc4f29af63dd1b2a99c87c23ffa1 (diff) | |
download | morph-c33279ef1613770bd03d6a8d954ed22f24c94915.tar.gz |
add ldconfig location(s) to PATH before running it
Previously, we required the caller to add /usr/sbin (or
other possible locations for ldconfig) to PATH before
invoking morph. This was inconvenient, so now morph
adds the FHS-compliant possible locations itself,
to save the caller a bit of pain.
-rwxr-xr-x | check | 3 | ||||
-rw-r--r-- | morphlib/builder.py | 3 |
2 files changed, 4 insertions, 2 deletions
@@ -20,5 +20,4 @@ set -e python setup.py clean check -fakeroot env PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin" \ - cmdtest -c ./morph tests +fakeroot cmdtest -c ./morph tests diff --git a/morphlib/builder.py b/morphlib/builder.py index 1ac18e0b..8d8fcf14 100644 --- a/morphlib/builder.py +++ b/morphlib/builder.py @@ -47,7 +47,10 @@ def ldconfig(ex, rootdir): if os.path.exists(conf): logging.debug('Running ldconfig for %s' % rootdir) cache = os.path.join(rootdir, 'etc', 'ld.so.cache') + old_path = ex.env['PATH'] + ex.env['PATH'] = '%s:/sbin:/usr/sbin:/usr/local/sbin' % old_path ex.runv(['ldconfig', '-f', conf, '-C', cache, '-r', rootdir]) + ex.env['PATH'] = old_path else: logging.debug('No %s, not running ldconfig' % conf) |