/
githubmirror
/
cpython
Обзор
Документация
Войти
/
githubmirror
/
cpython
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v3.13.13
Modules/expat/refresh.sh
67 строк
2 KB
Miss Islington (bot)
[3.13] gh-146083: Upgrade bundled Expat to 2.7.5 (GH-146085) (#146604)
29 мар 2026, 20:50
Не верифицирован
29 мар 2026, 20:50
472f1af
Код
Авторство
О чём код?
#!/usr/bin/env bash # # Use this script to update libexpat set -e set -o pipefail if [[ "${BASH_VERSINFO[0]}" -lt 4 ]]; then echo "A bash version >= 4 required. Got: $BASH_VERSION" >&2 exit 1 fi # Update this when updating to a new version after verifying that the changes # the update brings in are good. These values are used for verifying the SBOM, too. expected_libexpat_tag="R_2_7_5" expected_libexpat_version="2.7.5" expected_libexpat_sha256="9931f9860d18e6cf72d183eb8f309bfb96196c00e1d40caa978e95bc9aa978b6" expat_dir="$(realpath "$(dirname -- "${BASH_SOURCE[0]}")")" cd ${expat_dir} # Step 1: download and copy files curl --location "https://github.com/libexpat/libexpat/releases/download/${expected_libexpat_tag}/expat-${expected_libexpat_version}.tar.gz" > libexpat.tar.gz echo "${expected_libexpat_sha256} libexpat.tar.gz" | sha256sum --check # Step 2: Pull files from the libexpat distribution tar xzvf libexpat.tar.gz "expat-${expected_libexpat_version}/COPYING" --strip-components 2 declare -a lib_files lib_files=( ascii.h asciitab.h expat.h expat_external.h iasciitab.h internal.h latin1tab.h nametab.h siphash.h utf8tab.h winconfig.h xmlparse.c xmlrole.c xmlrole.h xmltok.c xmltok.h xmltok_impl.c xmltok_impl.h xmltok_ns.c ) for f in "${lib_files[@]}"; do tar xzvf libexpat.tar.gz "expat-${expected_libexpat_version}/lib/${f}" --strip-components 2 done rm libexpat.tar.gz # Step 3: Add the namespacing include to expat_external.h sed -i 's/# define Expat_External_INCLUDED 1/&\n\/* Namespace external symbols to allow multiple libexpat version to\n co-exist. \*\/\n#include "pyexpatns.h"/' expat_external.h echo " Updated! next steps: - Verify all is okay: git diff git status - Regenerate the sbom file make regen-sbom "