Skip to content

Commit 5843231

Browse files
committed
class-version.sh: work around new hexdump bug
It seems that newer versions of hexdump do not allow seeking from stdin anymore? At least, that's what others online have concluded: https://www.medo64.com/2021/06/hexdumps-illegal-seek/ Fortunately, in this case, we can just decode all 8 of the first bytes, and then take the last 4.
1 parent fd386c7 commit 5843231

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Diff for: ci-setup-github-actions.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
#
66

77
echo "BUILD_REPOSITORY=https://github.com/${GITHUB_REPOSITORY}"
8-
echo "BUILD_OS=${RUNNER_OS}"
8+
echo "BUILD_OS=${RUNNER_OS}"
9+
echo "BUILD_DEPLOY_FORBIDDEN=..." # CTR START HERE - use GITHUB-specific env vars set upon PR to decide this
910

1011
echo "BUILD_REPOSITORY=https://github.com/${GITHUB_REPOSITORY}" >> $GITHUB_ENV
1112
echo "BUILD_OS=${RUNNER_OS}" >> $GITHUB_ENV

Diff for: class-version.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class_version() {
66
# extract bytes 4-7
7-
info=$(head -c 8 | hexdump -s 4 -e '4/1 "%d\n" "\n"')
7+
info=$(head -c 8 | hexdump -e '4/1 "%d\n" "\n"' | tail -n4)
88
minor1="$(echo "$info" | sed -n 1p)"
99
minor2="$(echo "$info" | sed -n 2p)"
1010
major1="$(echo "$info" | sed -n 3p)"

0 commit comments

Comments
 (0)