diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2009-06-14 22:20:49 +0000 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2009-06-14 22:20:49 +0000 |
commit | 8fbf1c611a90a00e8ac6f275ef42aaad43ff8d97 (patch) | |
tree | f6cae32ac0ad22288fcd107c458b3962f0581341 | |
parent | 70b8f960ebddc66ccc197498325bc66d1a2d4095 (diff) | |
download | ptxdist-8fbf1c611a90a00e8ac6f275ef42aaad43ff8d97.tar.gz ptxdist-8fbf1c611a90a00e8ac6f275ef42aaad43ff8d97.tar.xz |
[ptxdist] provide sane error message if user uses an invalid package name
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunks/ptxdist-trunk@10764 33e552b5-05e3-0310-8538-816dae2090ed
-rw-r--r-- | TODO | 9 | ||||
-rwxr-xr-x | bin/ptxdist | 14 | ||||
-rw-r--r-- | scripts/libptxdist.sh | 8 |
3 files changed, 24 insertions, 7 deletions
@@ -3,13 +3,20 @@ TODO before 2.0.0 [ ] http://www.osadl.org/Single-View.111+M52e8d0c2b2f.0.html -[ ] rsc@thebe:OSELAS.BSP-Phytec-phyCORE-trunk$ ./p compile sw-ek-lm3s3748.compile +[x] rsc@thebe:OSELAS.BSP-Phytec-phyCORE-trunk$ ./p compile sw-ek-lm3s3748.compile /home/rsc/git/ptxdist/scripts/libptxdist.sh: line 125: unset: `PTXCONF_SW_EK_LM3S3748.COMPILE': not a valid identifier ptxdist: error: 'sw-ek-lm3s3748.compile' is not selected in /home/rsc/svn/oselas/bsp/phytec/phyCORE/OSELAS.BSP-Phytec-phyCORE-trunk/selected_ptxconfig PTXdist: fatal error ... cannot start, sorry! + update: 20090614 mkl: + + [frogger@hardanger:OSELAS.BSP-Pengutronix-AllYes-trunk]$ ./p compile sw-ek-lm3s3748.compile + ptxdist: error: 'sw-ek-lm3s3748.compile' is not a valid package name + + PTXdist: fatal error ... cannot start, sorry! + [ ] ipkg with dependecies [ ] rsc: port python 2.6 patches to 3.x -> mkl diff --git a/bin/ptxdist b/bin/ptxdist index 91ccfe802..1932b5b69 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -630,10 +630,16 @@ check_if_selected() { local configvar="PTXCONF_$(ptxd_name_to_NAME "${1}")" # FIXME ptxd_get_ptxconf "${configvar}" > /dev/null || { - ptxd_dialog_msgbox \ - "${PROMPT}error: '${1}' is not selected in\n" \ - " ${PTXDIST_PTXCONFIG}" - return 1 + if [ $? -eq 2 ]; then + ptxd_dialog_msgbox \ + "${PROMPT}error: '${1}' is not a valid package name" + return 1 + else + ptxd_dialog_msgbox \ + "${PROMPT}error: '${1}' is not selected in\n" \ + " ${PTXDIST_PTXCONFIG}" + return 1 + fi } } diff --git a/scripts/libptxdist.sh b/scripts/libptxdist.sh index 52ae9253f..df3cf6342 100644 --- a/scripts/libptxdist.sh +++ b/scripts/libptxdist.sh @@ -121,12 +121,16 @@ ptxd_source_kconfig() { # # get a symbol from the ptx or platformconfig # +# return: +# 1: symbol not found +# 2: symbol is not valid +# ptxd_get_ptxconf() { - unset "${1}" 2>/dev/null || true + unset "${1}" 2>/dev/null || return 2 if test -f "${PTXDIST_PLATFORMCONFIG}"; then source "${PTXDIST_PLATFORMCONFIG}" || \ - ptxd_bailout "unable to source '${PTXDIST_PLATFORMCONFIG}' (maybe svn conflict?)" + ptxd_bailout "unable to source '${PTXDIST_PLATFORMCONFIG}' (maybe svn/git conflict?)" fi if [ -n "${!1}" ]; then echo "${!1}" |