mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-27 22:01:37 +08:00
[vcpkg] Revise the file lists script (#20864)
* Don't mix files from different triplets * Revise printing of includes
This commit is contained in:
parent
60a8f7971e
commit
b652d33fd6
@ -3,7 +3,7 @@ import os.path
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
keyword = "include/"
|
keyword = "/include/"
|
||||||
|
|
||||||
def getFiles(path):
|
def getFiles(path):
|
||||||
files = os.listdir(path)
|
files = os.listdir(path)
|
||||||
@ -11,15 +11,16 @@ def getFiles(path):
|
|||||||
|
|
||||||
def gen_all_file_strings(path, files, headers, output):
|
def gen_all_file_strings(path, files, headers, output):
|
||||||
for file in files:
|
for file in files:
|
||||||
package = file[:file.find("_")]
|
components = file.split("_")
|
||||||
|
package = components[0] + ":" + components[2].replace(".list", "")
|
||||||
f = open(path + file)
|
f = open(path + file)
|
||||||
for line in f:
|
for line in f:
|
||||||
idx = line.strip().find(keyword)
|
if line.strip()[-1] == "/":
|
||||||
if idx >= 0 and line.strip()[-1] != "/":
|
continue
|
||||||
headers.write(package + ":" + line[idx + len(keyword):])
|
filepath = line[line.find("/"):]
|
||||||
output.write(package + ":" + line[idx-1:])
|
output.write(package + ":" + filepath)
|
||||||
elif line.strip()[-1] != "/":
|
if filepath.startswith(keyword):
|
||||||
output.write(package + ":" + line[line.find("/"):])
|
headers.write(package + ":" + filepath[len(keyword):])
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
def main(path):
|
def main(path):
|
||||||
|
Loading…
Reference in New Issue
Block a user