Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit c2cd51b

Browse files
author
William Douglas
committed
Have vendor.py also update the options.conf file
This file is used for spec and upstream content so updating it is important for improving the build automation. Signed-off-by: William Douglas <[email protected]>
1 parent ed1ef58 commit c2cd51b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

vendor.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def update_cargo_vendor(path, name, git):
9292

9393
def update_cargo_sources(name, tag):
9494
makefile = []
95+
options = []
9596
archive_match = os.path.join('$(CGIT_BASE_URL)', 'vendor', name,
9697
'snapshot', name)
9798
with open('Makefile', encoding='utf8') as mfile:
@@ -108,6 +109,20 @@ def update_cargo_sources(name, tag):
108109
with open('Makefile', 'w', encoding='utf8') as mfile:
109110
mfile.writelines(makefile)
110111

112+
with open('options.conf', encoding='utf8') as ofile:
113+
for line in ofile.readlines():
114+
if line.startswith('archives'):
115+
if re.match(archive_match + r'[a-zA-Z0-9_\-.]+\.tar\.xz', line):
116+
new_archives = re.sub(archive_match + r'[a-zA-Z0-9_\-.]+\.tar\.xz',
117+
f"{archive_match}-{tag}.tar.xz\n", line)
118+
else:
119+
new_archives = f"achives = {archive_match}-{tag}.tar.xz ./vendor\n"
120+
options.append(new_archives)
121+
else:
122+
options.append(line)
123+
with open('options.conf', 'w', encoding='utf8') as ofile:
124+
ofile.writelines(options)
125+
111126

112127
def main():
113128
vtype = vendor_check()

0 commit comments

Comments
 (0)