summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2010-04-21 12:00:46 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2010-04-21 14:04:53 +0200
commit59496e1f59bc37f3e0c00d1e2469de94b0479b70 (patch)
treea4ab3d8c8ce976a966a910447aca4520a771a042 /bin
parent179a354fedd5adf162d21a71b5c884d855919d71 (diff)
downloadptxdist-59496e1f59bc37f3e0c00d1e2469de94b0479b70.tar.gz
ptxdist-59496e1f59bc37f3e0c00d1e2469de94b0479b70.tar.xz
[ptxdist] use readline and prompt for read in newpackage
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ptxdist22
1 files changed, 8 insertions, 14 deletions
diff --git a/bin/ptxdist b/bin/ptxdist
index c9706c5a4..2ae40931a 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -1058,8 +1058,7 @@ newpackage() {
echo
echo "${PTXDIST_LOG_PROMPT}creating a new '${action}' package:"
echo
- echo -n "${PTXDIST_LOG_PROMPT}enter package name.......: "
- read package_name
+ read -e -p "${PTXDIST_LOG_PROMPT}enter package name.......: " package_name
#
# for host and cross packages, find out if there is already an
@@ -1088,25 +1087,21 @@ newpackage() {
*-existing-target|src-make-prog)
;;
*)
- echo -n "${PTXDIST_LOG_PROMPT}enter version number.....: "
- read version
+ read -e -p "${PTXDIST_LOG_PROMPT}enter version number.....: " version
;;
esac
local url suffix
case "${action}" in
host|target|cross|klibc)
- echo -n "${PTXDIST_LOG_PROMPT}enter URL of basedir.....: "
- read url
- echo -n "${PTXDIST_LOG_PROMPT}enter suffix.............: "
- read suffix
+ read -e -p "${PTXDIST_LOG_PROMPT}enter URL of basedir.....: " url
+ read -e -p "${PTXDIST_LOG_PROMPT}enter suffix.............: " suffix
;;
esac
# FIXME: get address from 'ptxdist setup'
local author
- echo -n "${PTXDIST_LOG_PROMPT}enter package author.....: "
- read author
+ read -e -p "${PTXDIST_LOG_PROMPT}enter package author.....: " author
local package_filename="${package_name}"
local package="$(echo ${package_name} | tr "[A-Z]" "[a-z]")"
@@ -1130,9 +1125,8 @@ newpackage() {
if [ -f "${filename}" ]; then
echo
- echo -n "${PTXDIST_LOG_PROMPT}warning: ${filename} does already exist, overwrite? [y/n] "
local overwrite
- read overwrite
+ read -e -p "${PTXDIST_LOG_PROMPT}warning: ${filename} does already exist, overwrite? [y/n] " overwrite
if [ "${overwrite}" != "y" ]; then
echo "${PTXDIST_LOG_PROMPT}aborted."
echo
@@ -1168,9 +1162,9 @@ newpackage() {
return
fi
- echo -e -n "\n${dst#${PTXDIST_WORKSPACE}/} does not exist, create? [Y/n] "
+ echo
local r
- read r
+ read -e -p "${dst#${PTXDIST_WORKSPACE}/} does not exist, create? [Y/n] " r
case "${r}" in
y|Y|"") ;;
*) return ;;