From da9c989d0593dfccc21274799a646dc227b4348d Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Tue, 15 Feb 2022 15:39:43 +0800 Subject: bugscript: drop workaround for long fixed issue in reportbug See-also: https://bugs.debian.org/169495 Fixed-in: reportbug 2.10 Fixed-on: 2002-12-23 --- debian/apt.bug-script | 5 ----- 1 file changed, 5 deletions(-) diff --git a/debian/apt.bug-script b/debian/apt.bug-script index a83b5563a..b22671268 100755 --- a/debian/apt.bug-script +++ b/debian/apt.bug-script @@ -1,10 +1,5 @@ #!/bin/bash -e -# reportbug #169495 -if [ -z "$YESNO" ]; then - YESNO=$"yYnN" -fi - cat < Date: Tue, 15 Feb 2022 15:50:39 +0800 Subject: bugscript: switch from options in shebang to options for set Otherwise the options won't be applied when running the script directly from a sh command instead of via the shebang. --- debian/apt.bug-script | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/apt.bug-script b/debian/apt.bug-script index b22671268..eae54fe69 100755 --- a/debian/apt.bug-script +++ b/debian/apt.bug-script @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/bin/bash +set -e cat < Date: Tue, 15 Feb 2022 15:41:34 +0800 Subject: bugscript: quote config file names The file names could contain spaces and without quoting, the files would not be found and included in the bug reports. Suggested-by: shellcheck --- debian/apt.bug-script | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/apt.bug-script b/debian/apt.bug-script index eae54fe69..1e895fb1f 100755 --- a/debian/apt.bug-script +++ b/debian/apt.bug-script @@ -15,11 +15,11 @@ if [ "$REPLY" = "yep" ]; then fi for config in /etc/apt/preferences /etc/apt/preferences.d/* /etc/apt/sources.list /etc/apt/sources.list.d/* ; do - if [ -f $config ]; then + if [ -f "$config" ]; then yesno "May I include your $config configuration file? [Y/n] " yep if [ "$REPLY" = "yep" ]; then echo -e "\n-- $config --\n" >&3 - cat $config >&3 + cat "$config" >&3 else echo -e "\n-- ($config present, but not submitted) --\n" >&3 fi -- cgit v1.2.3-70-g09d2 From 9f53670dc84d589d58b7689dc11b3ac08fd344e3 Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Tue, 15 Feb 2022 15:47:39 +0800 Subject: bugscript: switch from `echo -e` to printf Otherwise slashes in filenames could be interpreted as newlines etc. Also makes it portable to shells that don't support `echo -e`. --- debian/apt.bug-script | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/apt.bug-script b/debian/apt.bug-script index 1e895fb1f..c322b723b 100755 --- a/debian/apt.bug-script +++ b/debian/apt.bug-script @@ -10,7 +10,7 @@ EOF yesno "May I include your apt configuration (/etc/apt/apt.conf et al)? [Y/n] " yep if [ "$REPLY" = "yep" ]; then - echo -e "\n-- apt-config dump --\n" >&3 + printf "\n-- apt-config dump --\n\n" >&3 apt-config dump >&3 2>&1 fi @@ -18,12 +18,12 @@ for config in /etc/apt/preferences /etc/apt/preferences.d/* /etc/apt/sources.lis if [ -f "$config" ]; then yesno "May I include your $config configuration file? [Y/n] " yep if [ "$REPLY" = "yep" ]; then - echo -e "\n-- $config --\n" >&3 + printf "\n-- %s --\n\n" "$config" >&3 cat "$config" >&3 else - echo -e "\n-- ($config present, but not submitted) --\n" >&3 + printf "\n-- (%s present, but not submitted) --\n\n" "$config" >&3 fi else - echo -e "\n-- (no $config present) --\n" >&3 + printf "\n-- (no %s present) --\n\n" "$config" >&3 fi done -- cgit v1.2.3-70-g09d2 From 4f89d3629b22255963da3705e4222c71045da58a Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Tue, 15 Feb 2022 15:51:22 +0800 Subject: bugscript: switch from bash to POSIX shell This means Debian is one step closer to removing bash from essential. See-also: https://salsa.debian.org/debian/grow-your-ideas/-/issues/20#note_296809 --- debian/apt.bug-script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/apt.bug-script b/debian/apt.bug-script index c322b723b..67242f2ae 100755 --- a/debian/apt.bug-script +++ b/debian/apt.bug-script @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh set -e cat <