Bug 1800912 - Make libdav1d's update-version.sh work with BSD sed. r=media-playback-reviewers,azebrowski

It also keeps working with GNU sed.

Differential Revision: https://phabricator.services.mozilla.com/D162210
This commit is contained in:
Paul Adenot 2022-12-01 10:44:20 +00:00
Родитель 43326ed319
Коммит 67f82af8fd
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -4,6 +4,7 @@ MAJOR_VERSION=$(grep -E "dav1d_soname_version\s+=" meson.build | grep -o -E "'([
MINOR_VERSION=$(grep -E "dav1d_soname_version\s+=" meson.build | grep -o -E "\.([0-9]+)\." | sed "s/\.//g") MINOR_VERSION=$(grep -E "dav1d_soname_version\s+=" meson.build | grep -o -E "\.([0-9]+)\." | sed "s/\.//g")
PATCH_VERSION=$(grep -E "dav1d_soname_version\s+=" meson.build | grep -o -E "([0-9]+)'" | sed "s/'//") PATCH_VERSION=$(grep -E "dav1d_soname_version\s+=" meson.build | grep -o -E "([0-9]+)'" | sed "s/'//")
sed -i'' "s/DAV1D_API_VERSION_MAJOR \([0-9]\+\)/DAV1D_API_VERSION_MAJOR $MAJOR_VERSION/" "$1" sed -i.bak "s/DAV1D_API_VERSION_MAJOR \([0-9]\+\)/DAV1D_API_VERSION_MAJOR $MAJOR_VERSION/" "$1"
sed -i'' "s/DAV1D_API_VERSION_MINOR \([0-9]\+\)/DAV1D_API_VERSION_MINOR $MINOR_VERSION/" "$1" sed -i.bak "s/DAV1D_API_VERSION_MINOR \([0-9]\+\)/DAV1D_API_VERSION_MINOR $MINOR_VERSION/" "$1"
sed -i'' "s/DAV1D_API_VERSION_PATCH \([0-9]\+\)/DAV1D_API_VERSION_PATCH $PATCH_VERSION/" "$1" sed -i.bak "s/DAV1D_API_VERSION_PATCH \([0-9]\+\)/DAV1D_API_VERSION_PATCH $PATCH_VERSION/" "$1"
rm -f "$1.bak"