summaryrefslogtreecommitdiff
path: root/meta/recipes-devtools/apt
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2013-01-10 15:58:10 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-10 23:44:42 +0000
commit95a655a853b7cd43163362d72da0c134d4c0ec85 (patch)
treef236587253b795f76421c181476f6cdea280548d /meta/recipes-devtools/apt
parentbcc5773199b46811f913d06e960d34ed9833f714 (diff)
downloadopenembedded-core-95a655a853b7cd43163362d72da0c134d4c0ec85.tar.gz
openembedded-core-95a655a853b7cd43163362d72da0c134d4c0ec85.tar.bz2
openembedded-core-95a655a853b7cd43163362d72da0c134d4c0ec85.zip
apt-native: fix the creation of apt.conf.sample
1.The file of "apt.conf.sample" is in the outdir, and outdir is assigned by "os.path.join" with the params of ${D}, ${sysconfdir} and "apt". But ${sysconfdir} is an absolute dir and that let ${D} be discarded. The following is the help on function os.path.join(a, *p): Join two or more pathname components, inserting '/' as needed. If any component is an absolute path, all previous path components will be discarded. Use oe.path.join instead which don't have this problem. 2. Create apt.conf.sample if it doesn't exist. [YOCTO #3677] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/apt')
-rw-r--r--meta/recipes-devtools/apt/apt-native.inc7
1 files changed, 4 insertions, 3 deletions
diff --git a/meta/recipes-devtools/apt/apt-native.inc b/meta/recipes-devtools/apt/apt-native.inc
index ab89f71c4b..c7e7e420ba 100644
--- a/meta/recipes-devtools/apt/apt-native.inc
+++ b/meta/recipes-devtools/apt/apt-native.inc
@@ -14,17 +14,18 @@ python do_install () {
python do_install_config () {
indir = os.path.dirname(d.getVar('FILE',1))
- infile = file(os.path.join(indir, 'files', 'apt.conf'), 'r')
+ infile = file(oe.path.join(indir, 'files', 'apt.conf'), 'r')
data = infile.read()
infile.close()
data = d.expand(data)
- outdir = os.path.join(d.getVar('D', True), d.getVar('sysconfdir', True), 'apt')
+ outdir = oe.path.join(d.getVar('D', True), d.getVar('sysconfdir', True), 'apt')
if not os.path.exists(outdir):
os.makedirs(outdir)
- outpath = os.path.join(outdir, 'apt.conf.sample')
+ outpath = oe.path.join(outdir, 'apt.conf.sample')
+ if not os.path.exists(outpath):
outfile = file(outpath, 'w')
outfile.write(data)
outfile.close()