I wanted to make a python3-cement recipe with the latest version of that package. Everything seems to be building fine until it reaches the package_write_rpm. The failure seems to stem from the fact that the developers named some of the directories and files such as:
> > > > cement/cement/cli/templates/generate/plugin/{{ label }}/controllers/{{ > label }}.py > > And this appears to be a valid path, as in my personal workstation, I see the following: /lib/python3.8/site-packages/cement/cli/templates/generate/script/__pycache__/{{ label }}.cpython-38.pyc /lib/python3.8/site-packages/cement/cli/templates/generate/script/{{ label }}.py /lib/python3.8/site-packages/cement/cli/templates/generate/plugin/{{ label }} /lib/python3.8/site-packages/cement/cli/templates/generate/plugin/{{ label }}/templates/plugins/{{ label }} /lib/python3.8/site-packages/cement/cli/templates/generate/plugin/{{ label }}/controllers/{{ label }}.py /lib/python3.8/site-packages/cement/cli/templates/generate/project/{{ label }} /lib/python3.8/site-packages/cement/cli/templates/generate/project/config/{{ label }}.yml.example The issue is that when it reaches this package_write_rpm stage, it fails in the following way: > > > > | NOTE: Creating RPM package for python3-cement > | DEBUG: Python function write_specfile finished > | DEBUG: PKGWRITEDIR: > /project/tmp/work/corei7-64-linux/python3-cement/3.0.4.dev2c2ae1e5-r0/deploy-rpms/corei7_64 > > | DEBUG: Executing shell function BUILDSPEC > | Building target platforms: corei7_64-linux > | Building for target corei7_64-linux > | Processing files: python3-cement-3.0.4.dev2c2ae1e5-r0.0.corei7_64 > | error: File not found: > /project/tmp/work/corei7-64-linux/python3-cement/3.0.4.dev2c2ae1e5-r0/package/usr/lib/python3.8/site-packages/cement/cli/templates/generate/script/{{ > > | error: Path is outside buildroot: label > | error: Path is outside buildroot: }}.py > > which to me it looks like it can't process these special characters. What I tried to do was I appended the write_specfile to substitute the special characters with the escaped form in the specfile as such: > > > > write_specfile_append() { > > > > new_spec_file = "" > > > > with open(outspecfile, 'r') as specfile: > > > > for line in specfile: > > > > if '{{ label }}' in line: > > > > line = line.replace('{{ label }}','\{\{\ label\ \}\}') > > > > new_spec_file += line > > > > > > > > with open(outspecfile,'w') as specfile: > > > > specfile.write(new_spec_file) > > > > } > > so that I get something like > > cement/cement/cli/templates/generate/plugin/\{\{\ label\ > \}\}/controllers/\{\{\ label\ \}\}.py > That did seem to move it along but then rpmbuild fails, complaining it can't find the files or directories associated with the special character lines: > > | NOTE: Creating RPM package for python3-cement > | DEBUG: Python function write_specfile finished > | DEBUG: PKGWRITEDIR: > /project/tmp/work/corei7-64-linux/python3-cement/3.0.4.dev2c2ae1e5-r0/deploy-rpms/corei7_64 > > | DEBUG: Executing shell function BUILDSPEC > | Building target platforms: corei7_64-linux > | Building for target corei7_64-linux > | Processing files: python3-cement-3.0.4.dev2c2ae1e5-r0.0.corei7_64 > | error: File not found: > /localdisk/yocto/builds/evernight/evernight-generic-intel-x86-64/tmp/work/corei7-64-evernight-linux/python3-cement/3.0.4.dev2c2ae1e5-r0/package/usr/lib/python3.8/site-packages/cement/cli/templates/generate/script/\{\{\ > label\ \}\}.py > And now I am at a loss for what else I can do. Has anyone seen something similar and can advise on how to work around it?
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#52809): https://lists.yoctoproject.org/g/yocto/message/52809 Mute This Topic: https://lists.yoctoproject.org/mt/81536668/21656 Mute #yocto:https://lists.yoctoproject.org/g/yocto/mutehashtag/yocto Mute #dunfell:https://lists.yoctoproject.org/g/yocto/mutehashtag/dunfell Mute #python:https://lists.yoctoproject.org/g/yocto/mutehashtag/python Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-