Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,42 @@ if [ "$build_doc" = true ]; then
git commit -s -m "doc: Regenerate all docs for $VERSION"
fi

declare -A maps
maps=(
[src/libnvme.map]=LIBNVME
[src/libnvme-mi.map]=LIBNVME_MI
)

lib_ver="${ver//./_}"

for map_file in "${!maps[@]}"
do
lib_name=${maps[$map_file]}

if [ ! -f "${map_file}" ]; then
continue
fi

lib_unreleased="${lib_name}_UNRELEASED"

# Check if UNRELEASED has symbols
if ! awk -v lib_unreleased="$lib_unreleased" '
$0 ~ "^"lib_unreleased { in_section = 1; next }
in_section && $0 ~ /\}/ { exit }
in_section && $0 !~ /^[[:space:]]*($|\/|\/\*|\*|#)/ { found = 1; exit }
END { exit !found }
' "${map_file}"; then
continue
fi

sed -i \
-e "s/^${lib_unreleased}\s*{/&\n};\n\n${lib_name}_${lib_ver} {/" \
"$map_file"

git add "${map_file}"
echo "${map_file} updated."
done

# update meson.build
sed -i -e "0,/[ \t]version: /s/\([ \t]version: \).*/\1\'$ver\',/" meson.build
if [[ -n "$libnvme_VERSION" ]] && [[ -f subprojects/libnvme.wrap ]]; then
Expand Down
4 changes: 4 additions & 0 deletions src/libnvme-mi.map
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
LIBNVME_UNRELEASED {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LIBNVME_MI_UNRELEASED

};

LIBNVME_MI_1_12 {
global:
nvme_mi_mi_xfer;
Expand Down
3 changes: 3 additions & 0 deletions src/libnvme.map
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
LIBNVME_UNRELEASED {
};

LIBNVME_1.13 {
global:
nvme_subsystem_get_fw_rev;
Expand Down