Skip to content

Commit 43730b6

Browse files
committed
scripts: update release scripts for meson
Update scripts/prepare-release and scripts/do_abidiff to use meson, and change the expected branch name from 'master' to 'main'. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Dan Williams <[email protected]> Signed-off-by: Vishal Verma <[email protected]>
1 parent 59ed1ca commit 43730b6

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

scripts/do_abidiff

+6-8
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ build_rpm()
1717
local version=""
1818

1919
# prepare ndctl tree
20-
rm -rf results_ndctl
20+
rm -rf results_ndctl build
2121
git checkout -b rel_${ref} $ref
22-
./autogen.sh
23-
./configure CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64
24-
make clean
25-
make rhel/ndctl.spec
26-
cp rhel/ndctl.spec .
22+
meson setup build
23+
meson compile -C build rhel/ndctl.spec
24+
cp build/rhel/ndctl.spec .
2725

2826
# build and copy RPMs
2927
version="$(./git-version)"
@@ -46,8 +44,8 @@ build_rpm()
4644
do_diff()
4745
{
4846
local pkg="$1"
49-
local old_base="$(find . -regex "./release/rel_${old}/${pkg}-[0-9]+.*" | head -1)"
50-
local new_base="$(find . -regex "./release/rel_${new}/${pkg}-[0-9]+.*" | head -1)"
47+
local old_base="$(find . -regex "./release/rel_${old}/${pkg}[-cli]*-[0-9]+.*" | head -1)"
48+
local new_base="$(find . -regex "./release/rel_${new}/${pkg}[-cli]*-[0-9]+.*" | head -1)"
5149
local old_dev="$(find . -regex "./release/rel_${old}/${pkg}-devel-[0-9]+.*" | head -1)"
5250
local new_dev="$(find . -regex "./release/rel_${new}/${pkg}-devel-[0-9]+.*" | head -1)"
5351
local old_lib="$(find . -regex "./release/rel_${old}/${pkg}-libs-[0-9]+.*" | head -1)"

scripts/prepare-release.sh

+12-12
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Notes:
88
# - Checkout to the appropriate branch beforehand
9-
# master - for major release
9+
# main - for major release
1010
# ndctl-xx.y - for fixup release
1111
# This is important for generating the shortlog
1212
# - Add a temporary commit that updates the libtool versions as needed.
@@ -50,9 +50,9 @@ check_branch()
5050
err "expected an ndctl-xx.y branch for fixup release"
5151
fi
5252
else
53-
# major release, expect master branch
54-
if ! grep -Eq "^master$" <<< "$cur"; then
55-
err "expected master branch for a major release"
53+
# major release, expect main branch
54+
if ! grep -Eq "^main$" <<< "$cur"; then
55+
err "expected main branch for a major release"
5656
fi
5757
fi
5858
if ! git diff-index --quiet HEAD --; then
@@ -99,21 +99,21 @@ gen_lists()
9999
c_count=$(git log --pretty=format:"%s" "$range" | wc -l)
100100
}
101101

102-
# Check libtool versions in Makefile.am.in
102+
# Check libtool versions in meson.build
103103
# $1: lib name (currently libndctl, libdaxctl, or libcxl)
104104
check_libtool_vers()
105105
{
106106
local lib="$1"
107107
local lib_u="${lib^^}"
108108
local libdir="${lib##lib}/lib/"
109109
local symfile="${libdir}/${lib}.sym"
110-
local last_cur=$(git show $last_ref:Makefile.am.in | grep -E "^${lib_u}_CURRENT" | cut -d'=' -f2)
111-
local last_rev=$(git show $last_ref:Makefile.am.in | grep -E "^${lib_u}_REVISION" | cut -d'=' -f2)
112-
local last_age=$(git show $last_ref:Makefile.am.in | grep -E "^${lib_u}_AGE" | cut -d'=' -f2)
110+
local last_cur=$(git show $last_ref:meson.build | grep -E "^${lib_u}_CURRENT" | cut -d'=' -f2)
111+
local last_rev=$(git show $last_ref:meson.build | grep -E "^${lib_u}_REVISION" | cut -d'=' -f2)
112+
local last_age=$(git show $last_ref:meson.build | grep -E "^${lib_u}_AGE" | cut -d'=' -f2)
113113
local last_soname=$((last_cur - last_age))
114-
local next_cur=$(git show HEAD:Makefile.am.in | grep -E "^${lib_u}_CURRENT" | cut -d'=' -f2)
115-
local next_rev=$(git show HEAD:Makefile.am.in | grep -E "^${lib_u}_REVISION" | cut -d'=' -f2)
116-
local next_age=$(git show HEAD:Makefile.am.in | grep -E "^${lib_u}_AGE" | cut -d'=' -f2)
114+
local next_cur=$(git show HEAD:meson.build | grep -E "^${lib_u}_CURRENT" | cut -d'=' -f2)
115+
local next_rev=$(git show HEAD:meson.build | grep -E "^${lib_u}_REVISION" | cut -d'=' -f2)
116+
local next_age=$(git show HEAD:meson.build | grep -E "^${lib_u}_AGE" | cut -d'=' -f2)
117117
local next_soname=$((next_cur - next_age))
118118
local soname_diff=$((next_soname - last_soname))
119119

@@ -195,6 +195,6 @@ sed -i -e "s/DEF_VER=[0-9]\+.*/DEF_VER=${next_ref#v}/" git-version
195195
echo "Ready to release ndctl-$next_ref with $c_count new commits."
196196
echo "Add git-version to the top commit to get the updated version."
197197
echo "Use release/commits and release/shortlog to compose the release message"
198-
echo "The release commit typically contains the Makefile.am.in libtool version"
198+
echo "The release commit typically contains the meson.build libtool version"
199199
echo "update, and the git-version update."
200200
echo "Finally, ensure the release commit as well as the tag are PGP signed."

0 commit comments

Comments
 (0)