[Pkg-ltsp-devel] Bug#690638: ltsp-client-core: bashism in /usr/share/ltsp/ltsp-cleanup
Vagrant Cascadian
vagrant at debian.org
Sat Nov 10 20:49:35 UTC 2012
Control: retitle 690638 ltsp-client-core: bashism in /usr/share/ltsp/ltsp-cleanup
Control: tags 690638 patch pending
On Mon, Oct 15, 2012 at 11:24:09PM -0500, Raphael Geissert wrote:
> checkbashisms' output:
> >possible bashism in ./usr/share/ltsp/ltsp-cleanup line 64 (read with option
> other than -r):
> > read -p "Are you sure you want to do that [Y/n]? " YES
Fixed upstream using a function that emulates the desired functionality of
"read -p":
2397 Alkis Georgopoulos 2012-10-29
Add read_prompt function to ltsp-common-functions, which is ideally a shell
agnostic implementation of "read -p". http://bugs.debian.org/690638
=== modified file 'client/share/ltsp/ltsp-cleanup'
--- client/share/ltsp/ltsp-cleanup 2012-05-30 04:52:16 +0000
+++ client/share/ltsp/ltsp-cleanup 2012-10-29 19:08:41 +0000
@@ -61,7 +61,7 @@
by removing or regenerating sensitive data like user accounts and host keys.
EOF
- read -p "Are you sure you want to do that [Y/n]? " YES
+ read_prompt "Are you sure you want to do that [Y/n]? " YES
fi
if boolean_is_true "$YES"; then
run_parts /usr/share/ltsp/cleanup.d /etc/ltsp/cleanup.d
=== modified file 'common/ltsp-common-functions'
--- common/ltsp-common-functions 2012-06-19 20:23:23 +0000
+++ common/ltsp-common-functions 2012-10-29 19:08:41 +0000
@@ -157,6 +157,17 @@
unset MARKED_MOUNTS
}
+read_prompt() {
+ # Shell agnostic "read -p" implementation
+
+ # Only output if on an interactive terminal
+ if [ -t 0 ]; then
+ echo -n "$1"
+ fi
+ shift
+ read "$@"
+}
+
debug "Started"
# Source tool-specific settings and functions, if they're provided
live well,
vagrant
More information about the Pkg-ltsp-devel
mailing list