diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2006-06-12 15:14:54 +0000 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2006-06-12 15:14:54 +0000 |
commit | 667fc7876f39a37bd23ecd7132baba1849746ee9 (patch) | |
tree | 444cf65b1fce6985c491ee65a05dff5e603c3c7a /bin | |
parent | 69e988d29f7e1ec35d40db1fb770483f40c19f4b (diff) | |
download | ptxdist-667fc7876f39a37bd23ecd7132baba1849746ee9.tar.gz ptxdist-667fc7876f39a37bd23ecd7132baba1849746ee9.tar.xz |
* bin/ptxdist:
fixed check for writeable prefix
fixed new packet script
git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunks/ptxdist-0.10-trunk@5766 33e552b5-05e3-0310-8538-816dae2090ed
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ptxdist | 57 |
1 files changed, 37 insertions, 20 deletions
diff --git a/bin/ptxdist b/bin/ptxdist index 45735aadc..537fb5d65 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -197,28 +197,45 @@ check_dirs() { ptxconf_prefix=$PREFIX fi - testfile=${ptxconf_prefix}/.secret-world-domination-project - touch ${testfile} 2> /dev/null - if test $? -eq 1; then - echo - echo "error: ${ptxconf_prefix} does not exists and cannot be created!" - echo " please create that dir with write permissions for you" - echo - read -t 5 -p "press enter to use sudo to create it" - if test $? -eq 1; then + if test -d ${ptxconf_prefix}; then + testfile=${ptxconf_prefix}/.secret-world-domination-project + touch ${testfile} 2> /dev/null + if test $? -ne 0; then echo - exit 1 + echo "error: \"${ptxconf_prefix}\"" + echo " does exists, but is not writeabel." + echo " Change the permission and try again." + echo + read -t 5 -p "press enter to let sudo to the job!" + if test $? -ne 0; then + echo + exit 1 + fi + echo + echo sudo chown $UID ${ptxconf_prefix} + sudo chown $UID ${ptxconf_prefix} + fi + else + mkdir -p ${ptxconf_prefix} 2> /dev/null + if test $? -ne 0; then + echo + echo "error: \"${ptxconf_prefix}\"" + echo " does not exists and cannot be created!" + echo " Please create that dir with write permissions for you." + echo + read -t 5 -p "press enter to let sudo do that job!" + if test $? -ne 0; then + echo + exit 1 + fi + echo + echo sudo mkdir -p ${ptxconf_prefix} + sudo mkdir -p ${ptxconf_prefix} + echo + echo sudo chown $UID ${ptxconf_prefix} + sudo chown $UID ${ptxconf_prefix} fi - echo - echo sudo mkdir -p ${ptxconf_prefix} - sudo mkdir -p ${ptxconf_prefix} - echo - echo sudo chown $UID ${ptxconf_prefix} - sudo chown $UID ${ptxconf_prefix} - echo - echo Thanks fi - rm -f ${testfile} ptxconf_gnu_target=$(. ptxconfig && echo ${PTXCONF_GNU_TARGET}) @@ -433,7 +450,7 @@ newpacket () { echo -n "${PROMPT}enter suffix............: " read SUFFIX YEAR=`date +%Y` - PACKET_NAME="`echo | tr - _`" + PACKET_NAME="`echo $PACKET_NAME| tr - _`" packet=`echo $PACKET_NAME | tr "[A-Z]" "[a-z]"` PACKET=`echo $PACKET_NAME | tr "[a-z]" "[A-Z]"` |