[COMMITTED] gdb-add-index: quote PKGVERSION

Message ID 988a084f4dd281a5eeb9efe26987162ec090e19d.1742424413.git.sam@gentoo.org
State New
Headers
Series [COMMITTED] gdb-add-index: quote PKGVERSION |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply

Commit Message

Sam James March 19, 2025, 10:46 p.m. UTC
  In Gentoo, we configure our gdb with `--with-pkgversion=` with
"Gentoo VERSION XXXX" where XXX depends on patching (not that we patch
gdb really these days) or vanilla.

Since 71f193a5c1cb02dcde6ac160cdab88e9725862bb, this goes wrong, yielding
```
/usr/bin/gdb-add-index: 25: Syntax error: "(" unexpected
```

with lines 25-26 being:
```
PKGVERSION=(Gentoo 9999 vanilla)
VERSION=17.0.50.20250319-git
```

Quote both assignments (PKGVERSION by necessity, VERSION for consistency
or symmetry).

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32325
---
Committed as obvious.

 gdb/contrib/gdb-add-index.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


base-commit: d1da7bb43ecab2425a1135f09d6f62c9a7f63ae7
  

Patch

diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh
index 4db123492f8..b299f830373 100755
--- a/gdb/contrib/gdb-add-index.sh
+++ b/gdb/contrib/gdb-add-index.sh
@@ -22,8 +22,8 @@  GDB=${GDB:=gdb}
 OBJCOPY=${OBJCOPY:=objcopy}
 READELF=${READELF:=readelf}
 
-PKGVERSION=@PKGVERSION@
-VERSION=@VERSION@
+PKGVERSION="@PKGVERSION@"
+VERSION="@VERSION@"
 
 myname="${0##*/}"