mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
parent
175ce0bcb0
commit
4295d3d377
@ -472,6 +472,10 @@ class file:
|
|||||||
('with_download' in self.macros and self.macros['with_download'] == '1'):
|
('with_download' in self.macros and self.macros['with_download'] == '1'):
|
||||||
return '0'
|
return '0'
|
||||||
ok = False
|
ok = False
|
||||||
|
log.trace('pkgconfig: check: crossc=%d pkg_crossc=%d prefix=%s' % ( self._cross_compile(),
|
||||||
|
self.pkgconfig_crosscompile,
|
||||||
|
self.pkgconfig_prefix))
|
||||||
|
log.trace('pkgconfig: check: test=%s' % (test))
|
||||||
if type(test) == str:
|
if type(test) == str:
|
||||||
test = test.split()
|
test = test.split()
|
||||||
if not self._cross_compile() or self.pkgconfig_crosscompile:
|
if not self._cross_compile() or self.pkgconfig_crosscompile:
|
||||||
@ -667,28 +671,50 @@ class file:
|
|||||||
elif m.startswith('%{path '):
|
elif m.startswith('%{path '):
|
||||||
pl = m[7:-1].strip().split()
|
pl = m[7:-1].strip().split()
|
||||||
ok = False
|
ok = False
|
||||||
|
result = ''
|
||||||
|
pl_0 = pl[0].lower()
|
||||||
|
if pl_0 == 'prepend':
|
||||||
if len(pl) == 2:
|
if len(pl) == 2:
|
||||||
ok = True
|
ok = True
|
||||||
epl = []
|
p = ' '.join([self._expand(pp) for pp in pl[1:]])
|
||||||
for p in pl[1:]:
|
|
||||||
epl += [self._expand(p)]
|
|
||||||
p = ' '.join(epl)
|
|
||||||
if pl[0].lower() == 'prepend':
|
|
||||||
if len(self.macros['_pathprepend']):
|
if len(self.macros['_pathprepend']):
|
||||||
self.macros['_pathprepend'] = \
|
self.macros['_pathprepend'] = \
|
||||||
'%s:%s' % (p, self.macros['_pathprepend'])
|
'%s:%s' % (p, self.macros['_pathprepend'])
|
||||||
else:
|
else:
|
||||||
self.macros['_pathprepend'] = p
|
self.macros['_pathprepend'] = p
|
||||||
elif pl[0].lower() == 'postpend':
|
elif pl_0 == 'postpend':
|
||||||
|
if len(pl) == 2:
|
||||||
|
ok = True
|
||||||
|
p = ' '.join([self._expand(pp) for pp in pl[1:]])
|
||||||
if len(self.macros['_pathprepend']):
|
if len(self.macros['_pathprepend']):
|
||||||
self.macros['_pathprepend'] = \
|
self.macros['_pathprepend'] = \
|
||||||
'%s:%s' % (self.macros['_pathprepend'], p)
|
'%s:%s' % (self.macros['_pathprepend'], p)
|
||||||
else:
|
else:
|
||||||
self.macros['_pathprepend'] = p
|
self.macros['_pathprepend'] = p
|
||||||
|
elif pl_0 == 'check':
|
||||||
|
if len(pl) == 3:
|
||||||
|
pl_1 = pl[1].lower()
|
||||||
|
p = ' '.join([self._expand(pp) for pp in pl[2:]])
|
||||||
|
if pl_1 == 'exists':
|
||||||
|
ok = True
|
||||||
|
if path.exists(p):
|
||||||
|
result = '1'
|
||||||
else:
|
else:
|
||||||
ok = False
|
result = '0'
|
||||||
|
elif pl_1 == 'isdir':
|
||||||
|
ok = True
|
||||||
|
if path.isdir(p):
|
||||||
|
result = '1'
|
||||||
|
else:
|
||||||
|
result = '0'
|
||||||
|
elif pl_1 == 'isfile':
|
||||||
|
ok = True
|
||||||
|
if path.isfile(p):
|
||||||
|
result = '1'
|
||||||
|
else:
|
||||||
|
result = '0'
|
||||||
if ok:
|
if ok:
|
||||||
s = s.replace(m, '')
|
s = s.replace(m, result)
|
||||||
else:
|
else:
|
||||||
self._error('path error: %s' % (' '.join(pl)))
|
self._error('path error: %s' % (' '.join(pl)))
|
||||||
mn = None
|
mn = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user