Skip to content

Commit b656128

Browse files
committed
xx-verify: since file 5.46 it expects Intel i386
Signed-off-by: CrazyMax <[email protected]>
1 parent eb66764 commit b656128

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

src/test-verify.bats

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ load 'assert'
147147
run xx-verify /idontexist
148148
assert_failure
149149

150+
export XX_VERIFY_FILE_CMD_OUTPUT=": PE32 executable (console) Intel i386 (stripped to external PDB), for MS Windows"
151+
export TARGETPLATFORM=windows/386
152+
run xx-verify /idontexist
153+
assert_success
154+
150155
export XX_VERIFY_FILE_CMD_OUTPUT=": PE32 executable (console) Intel 80386 (stripped to external PDB), for MS Windows"
151156
export TARGETPLATFORM=windows/386
152157
run xx-verify /idontexist
@@ -208,6 +213,11 @@ load 'assert'
208213
run xx-verify /idontexist
209214
assert_failure
210215

216+
export XX_VERIFY_FILE_CMD_OUTPUT=": ELF 32-bit LSB executable, Intel i386, version 1 (SYSV), statically linked, Go BuildID=GUb5psm2_Qmc_LlEF7GP/wcIHIg_4MjQh8NC5wfep/LSmTmWKKZ5smuAQbfeFE/FBYRjFmbJQpV--JKtz4i, not stripped"
217+
export TARGETPLATFORM=linux/386
218+
run xx-verify /idontexist
219+
assert_success
220+
211221
export XX_VERIFY_FILE_CMD_OUTPUT=": ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, Go BuildID=GUb5psm2_Qmc_LlEF7GP/wcIHIg_4MjQh8NC5wfep/LSmTmWKKZ5smuAQbfeFE/FBYRjFmbJQpV--JKtz4i, not stripped"
212222
export TARGETPLATFORM=linux/386
213223
run xx-verify /idontexist

src/xx-verify

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ for f in "$@"; do
144144
fi
145145

146146
expArch=""
147-
expArch2="" # extra check for endianness
147+
expArchAlt="" # alternate arch name
148+
expArch2="" # extra check for endianness
148149
case "$TARGETARCH" in
149150
"arm64")
150151
case "$TARGETOS" in
@@ -226,7 +227,8 @@ for f in "$@"; do
226227
expArch2="64-bit LSB"
227228
;;
228229
"386")
229-
expArch="Intel 80386"
230+
expArch="Intel i386"
231+
expArchAlt="Intel 80386"
230232
if [ "$TARGETOS" != "windows" ]; then
231233
expArch2="32-bit LSB"
232234
fi
@@ -239,8 +241,15 @@ for f in "$@"; do
239241
fi
240242

241243
if ! echo "$out" | grep "$expArch" >/dev/null; then
242-
echo >&2 "file ${f} does not match expected target architecture ${TARGETARCH}: $out"
243-
exit 1
244+
if [ -n "$expArchAlt" ]; then
245+
if ! echo "$out" | grep "$expArchAlt" >/dev/null; then
246+
echo >&2 "file ${f} does not match expected target architecture ${TARGETARCH}: $out"
247+
exit 1
248+
fi
249+
else
250+
echo >&2 "file ${f} does not match expected target architecture ${TARGETARCH}: $out"
251+
exit 1
252+
fi
244253
fi
245254

246255
if [ -n "$expArch2" ]; then

0 commit comments

Comments
 (0)