From 1e17239d27b5ad0c14724bd9af221bf1567ce3de Mon Sep 17 00:00:00 2001
From: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Date: Wed, 7 May 2025 08:49:46 +0900
Subject: [PATCH] Drop bashism from debian/libdebuginfod-common.postinst
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

debian/libdebuginfod-common.postinst depends on bash, but using
‘local foo; readonly foo’ instead of ‘local -r foo’ removes the bash dependency
and also works in dash.

```
$ checkbashisms debian/libdebuginfod-common.postinst
possible bashism in debian/libdebuginfod-common.postinst line 32 (local -opt):
    local -r OLDVER="$1"
[...]
```

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
---
 debian/libdebuginfod-common.postinst | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/debian/libdebuginfod-common.postinst b/debian/libdebuginfod-common.postinst
index a1b6eda..83a6864 100644
--- a/debian/libdebuginfod-common.postinst
+++ b/debian/libdebuginfod-common.postinst
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 set -e
 
@@ -29,7 +29,8 @@ configure_debuginfod_debian()
 
 configure_debuginfod_ubuntu()
 {
-    local -r OLDVER="$1"
+    local OLDVER="$1"
+    readonly OLDVER
 
     # Handle previous versions where the debuginfod configuration was
     # optional.
@@ -52,7 +53,8 @@ configure_debuginfod_ubuntu()
 
 configure_debuginfod()
 {
-    local -r OLDVER="$1"
+    local OLDVER="$1"
+    readonly OLDVER
 
     if grep -qFx "ID=debian" /etc/os-release; then
 	configure_debuginfod_debian "${OLDVER}"
-- 
2.49.0

