Skip to content

Commit 5c708b4

Browse files
committed
buildextend-extensions: Copy repofiles to tmpdir
Copy repo config files from config dir & yumrepos git repo. Fixes: coreos#3074 Fixes: coreos#3036 Fixes: coreos#3045
1 parent 58397a0 commit 5c708b4

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/cmd-buildextend-extensions

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,25 @@ def prepare_tmpworkdir():
8888
if os.path.exists(tmpworkdir):
8989
shutil.rmtree(tmpworkdir)
9090
os.mkdir(tmpworkdir)
91+
configdir = 'src/config'
92+
for f in os.listdir(configdir):
93+
if os.path.isfile(f"{configdir}/{f}") and f.endswith('.repo'):
94+
shutil.copyfile(f"{configdir}/{f}", f"{tmpworkdir}/{f}")
95+
yumreposdir = 'src/yumrepos'
96+
if os.path.exists(yumreposdir):
97+
for f in os.listdir(yumreposdir):
98+
if os.path.isfile(f"{yumreposdir}/{f}") and f.endswith('.repo'):
99+
shutil.copyfile(f"{yumreposdir}/{f}", f"{tmpworkdir}/{f}")
91100
return tmpworkdir
92101

93102

94103
def run_rpmostree(workdir, commit, treefile, extensions):
95104
cmdlib.cmdlib_sh(f'''
105+
cat > "{workdir}/manifest-override.yaml" <<EOF
106+
include: ../../{treefile}
107+
EOF
96108
changed_stamp={workdir}/changed
97-
runcompose_extensions {workdir}/output {treefile} {extensions} \
109+
runcompose_extensions {workdir}/output {workdir}/manifest-override.yaml {extensions} \
98110
--base-rev {commit}''')
99111
return os.path.exists(f'{workdir}/changed')
100112

0 commit comments

Comments
 (0)