mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-22 09:32:21 +00:00
Support relative path on < include
For pkglist and syncfile, detect relative path and interpret relative to the file that does the include.
This commit is contained in:
parent
7b23ee9c7c
commit
d59ac74f3a
@ -47,7 +47,12 @@ def get_entries(filename):
|
||||
if ent in ('APPENDONCE:', 'MERGE:', 'REPLACE:'):
|
||||
secname = ent
|
||||
if ent[0] == '<':
|
||||
for subent in get_entries(ent[1:]):
|
||||
subfilename = ent[1:]
|
||||
if subfilename[-1] == '>':
|
||||
subfilename = subfilename[:-1]
|
||||
if subfilename[0] != '/':
|
||||
subfilename = os.path.join(os.path.dirname(filename), subfilename)
|
||||
for subent in get_entries(subfilename):
|
||||
yield subent
|
||||
yield secname
|
||||
else:
|
||||
|
@ -424,6 +424,11 @@ class OsHandler(object):
|
||||
if not pkg:
|
||||
continue
|
||||
if pkg[0] == '<': # Include from specified file
|
||||
subfilename = pkg[1:]
|
||||
if subfilename[-1] == '>':
|
||||
subfilename = subfilename[:-1]
|
||||
if subfilename[0] != '/':
|
||||
subfilename = os.path.join(os.path.dirname(pkglistfile), subfilename)
|
||||
retpkgs.extend(self.list_packages(pkg[1:]))
|
||||
else:
|
||||
retpkgs.append(pkg)
|
||||
|
Loading…
Reference in New Issue
Block a user