mirror of
git://git.yoctoproject.org/meta-selinux
synced 2026-01-01 13:58:04 +00:00
libselinux-python: support reproducible builds
Originally, direct_url.json contains build path and it was removed to fix buildpaths issue, but the hash of direct_url.json in RECORD was not updated. In order to support reproducible builds [1], this commit manually updates hash of direct_url.json in RECORD after build path was removed [1] https://reproducible-builds.org/ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
This commit is contained in:
parent
c6398215c0
commit
612f8bcbcc
|
|
@ -51,9 +51,19 @@ do_install() {
|
||||||
PYLIBVER='python${PYTHON_BASEVERSION}' \
|
PYLIBVER='python${PYTHON_BASEVERSION}' \
|
||||||
PYTHONLIBDIR='${PYTHON_SITEPACKAGES_DIR}'
|
PYTHONLIBDIR='${PYTHON_SITEPACKAGES_DIR}'
|
||||||
|
|
||||||
|
dicect_url_json="${D}${PYTHON_SITEPACKAGES_DIR}/selinux-${PV}.dist-info/direct_url.json"
|
||||||
|
oldhash=$(nativepython3 -c "from pip._internal.operations.install.wheel import rehash; hash,len = rehash('$dicect_url_json'); print(f'{hash},{len}')")
|
||||||
|
|
||||||
# Fix buildpaths issue
|
# Fix buildpaths issue
|
||||||
sed -i -e 's,${WORKDIR},,g' \
|
sed -i -e 's,${WORKDIR},,g' \
|
||||||
${D}${PYTHON_SITEPACKAGES_DIR}/selinux-${PV}.dist-info/direct_url.json
|
$dicect_url_json
|
||||||
|
|
||||||
|
newhash=$(nativepython3 -c "from pip._internal.operations.install.wheel import rehash; hash,len = rehash('$dicect_url_json'); print(f'{hash},{len}')")
|
||||||
|
|
||||||
|
# Update hash of direct_url.json in RECORD after build path was removed
|
||||||
|
sed -i -e "s/$oldhash/$newhash/g" \
|
||||||
|
${D}${PYTHON_SITEPACKAGES_DIR}/selinux-${PV}.dist-info/RECORD
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BBCLASSEXTEND += "native"
|
BBCLASSEXTEND += "native"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user