Skip to content

Commit 29c2edf

Browse files
committed
build: remove unused scripts from libnvme
These scripts are not used anymore since the repo merge. Move the linker script update part into the top release.sh script. Signed-off-by: Daniel Wagner <[email protected]>
1 parent 3a7873d commit 29c2edf

3 files changed

Lines changed: 35 additions & 204 deletions

File tree

libnvme/scripts/meson-vcs-tag.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

libnvme/scripts/release.sh

Lines changed: 0 additions & 187 deletions
This file was deleted.

scripts/release.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,41 @@ if [ "$build_doc" = true ]; then
132132
git commit -s -m "doc: Regenerate all docs for $VERSION"
133133
fi
134134

135+
declare -A ldscripts
136+
ldscripts=(
137+
[libnvme/src/libnvme.ld]=LIBNVME
138+
)
139+
140+
lib_ver="${ver//./_}"
141+
142+
for ld_file in "${!ldscripts[@]}"
143+
do
144+
lib_name=${ldscripts[$ld_file]}
145+
146+
if [ ! -f "${ld_file}" ]; then
147+
continue
148+
fi
149+
150+
lib_unreleased="${lib_name}_UNRELEASED"
151+
152+
# Check if UNRELEASED has symbols
153+
if ! awk -v lib_unreleased="$lib_unreleased" '
154+
$0 ~ "^"lib_unreleased { in_section = 1; next }
155+
in_section && $0 ~ /\}/ { exit }
156+
in_section && $0 !~ /^[[:space:]]*($|\/|\/\*|\*|#)/ { found = 1; exit }
157+
END { exit !found }
158+
' "${ld_file}"; then
159+
continue
160+
fi
161+
162+
sed -i \
163+
-e "s/^${lib_unreleased}\s*{/&\n};\n\n${lib_name}_${lib_ver} {/" \
164+
"$ld_file"
165+
166+
git add "${ld_file}"
167+
echo "${ld_file} updated."
168+
done
169+
135170
# update meson.build
136171
sed -i -e "0,/[ \t]version: /s/\([ \t]version: \).*/\1\'$ver\',/" meson.build
137172
if [[ -n "$libnvme_VERSION" ]] && [[ -f subprojects/libnvme.wrap ]]; then

0 commit comments

Comments
 (0)