Signed-off-by: Roland Hieber <r.hie...@pengutronix.de>
---
 scripts/lib/ptxd_lib_template.sh | 92 ++++++++++++++++++++--------------------
 1 file changed, 47 insertions(+), 45 deletions(-)

diff --git a/scripts/lib/ptxd_lib_template.sh b/scripts/lib/ptxd_lib_template.sh
index 68c614218..6a478e8fa 100644
--- a/scripts/lib/ptxd_lib_template.sh
+++ b/scripts/lib/ptxd_lib_template.sh
@@ -9,7 +9,7 @@
 #
 
 if echo | read -i foo -p bar -e > /dev/null 2>&1; then
-       _ptxd_can_read_initial=1
+    _ptxd_can_read_initial=1
 fi
 export _ptxd_can_read_initial
 #
@@ -22,11 +22,11 @@ export _ptxd_can_read_initial
 ptxd_template_read() {
     local -a iargs
     if [ -n "$_ptxd_can_read_initial" -a -n "${3}" ]; then
-       iargs=( "-i" "${3}" )
+        iargs=( "-i" "${3}" )
     fi
     local prompt="${PTXDIST_LOG_PROMPT}${1}"
     for (( i=$[30-$(wc -c <<< $1)]; $i ; i=$[i-1] )); do
-       prompt="${prompt}."
+        prompt="${prompt}."
     done
     read -e -p "${prompt}: " "${iargs[@]}" "${2}" &&
     export "${2}"
@@ -44,33 +44,33 @@ export -f ptxd_template_read_name
 
 ptxd_template_check_existing() {
     if ptxd_in_path PTXDIST_PATH_RULES "${package_name}.make"; then
-       export ptxd_template_have_existing=1
-       action="${action}-existing-target"
-       template="${template}-existing-target"
+        export ptxd_template_have_existing=1
+        action="${action}-existing-target"
+        template="${template}-existing-target"
     else
-       unset ptxd_template_have_existing
+        unset ptxd_template_have_existing
     fi
 }
 export -f ptxd_template_check_existing
 
 ptxd_template_read_version() {
     if [ -z "${ptxd_template_have_existing}" ]; then
-       ptxd_template_read "enter version number" VERSION
+        ptxd_template_read "enter version number" VERSION
     fi
 }
 export -f ptxd_template_read_version
 
 ptxd_template_read_url() {
     if [ -z "${ptxd_template_have_existing}" ]; then
-       ptxd_template_read "enter URL of basedir" URL
-       ptxd_template_read "enter suffix" SUFFIX
+        ptxd_template_read "enter URL of basedir" URL
+        ptxd_template_read "enter suffix" SUFFIX
     fi
 }
 export -f ptxd_template_read_url
 
 ptxd_template_read_author() {
     ptxd_template_read "enter package author" AUTHOR \
-       "${PTXCONF_SETUP_USER_NAME} <${PTXCONF_SETUP_USER_EMAIL}>"
+        "${PTXCONF_SETUP_USER_NAME} <${PTXCONF_SETUP_USER_EMAIL}>"
 }
 export -f ptxd_template_read_author
 
@@ -113,7 +113,7 @@ export -f ptxd_template_read_local
 
 ptxd_template_print_path() {
     if [ $# -ne 1 ]; then
-       ptxd_bailout "number of arguments must be 1"
+        ptxd_bailout "number of arguments must be 1"
     fi
     echo "${1#${PWD}/}"
 }
@@ -130,21 +130,21 @@ ptxd_template_filter() {
     local template_file="${1}"
     local filename="${2}"
     if [ ! -f "${template_file}" ]; then
-       echo
-       echo "${PTXDIST_LOG_PROMPT}warning: template '${template_file}' does 
not exist"
-       echo
-       continue
+        echo
+        echo "${PTXDIST_LOG_PROMPT}warning: template '${template_file}' does 
not exist"
+        echo
+        continue
     fi
 
     if [ -f "${filename}" ]; then
-       echo
-       local overwrite
-       read -e -p "${PTXDIST_LOG_PROMPT}warning: $(ptxd_template_print_path 
"${filename}") does already exist, overwrite? [y/n] " overwrite
-       if [ "${overwrite}" != "y" ]; then
-       echo "${PTXDIST_LOG_PROMPT}aborted."
-       echo
-       exit
-       fi
+        echo
+        local overwrite
+        read -e -p "${PTXDIST_LOG_PROMPT}warning: $(ptxd_template_print_path 
"${filename}") does already exist, overwrite? [y/n] " overwrite
+        if [ "${overwrite}" != "y" ]; then
+        echo "${PTXDIST_LOG_PROMPT}aborted."
+        echo
+        exit
+        fi
     fi
     echo "generating $(ptxd_template_print_path ${filename})"
     mkdir -p "$(dirname "${filename}")"
@@ -154,7 +154,7 @@ export -f ptxd_template_filter
 
 ptxd_template_file() {
     if ! ptxd_in_path PTXDIST_PATH_TEMPLATES "${1}"; then
-       ptxd_bailout "Failed to find '${1}' in '${PTXDIST_PATH_TEMPLATES}'!"
+        ptxd_bailout "Failed to find '${1}' in '${PTXDIST_PATH_TEMPLATES}'!"
     fi
     echo "${ptxd_reply}"
 }
@@ -164,9 +164,9 @@ ptxd_template_write_rules() {
     local template_suffix
     echo
     for template_suffix in "make" "in"; do
-       local template_file="$(ptxd_template_file 
"${template}-${template_suffix}")"
-       local 
filename="${PTXDIST_WORKSPACE}/rules/${class}${package_filename}.${template_suffix}"
-       ptxd_template_filter "${template_file}" "${filename}"
+        local template_file="$(ptxd_template_file 
"${template}-${template_suffix}")"
+        local 
filename="${PTXDIST_WORKSPACE}/rules/${class}${package_filename}.${template_suffix}"
+        ptxd_template_filter "${template_file}" "${filename}"
     done
 }
 export -f ptxd_template_write_rules
@@ -191,24 +191,24 @@ ptxd_template_write_src() {
     local template_dir
 
     if [ -d "${dst}" ]; then
-       return
+        return
     fi
 
     echo
     local r
     read -e -p "${dst#${PTXDIST_WORKSPACE}/} does not exist, create? [Y/n] " r
     case "${r}" in
-       y|Y|"") ;;
-       *) return ;;
+        y|Y|"") ;;
+        *) return ;;
     esac
 
     template_src="$(ptxd_template_file "${action}")" &&
     mkdir -p "${dst}" &&
     tar -C "${template_src}" -cf - --exclude .svn . | \
-       tar -C "${dst}" -xvf - &&
+        tar -C "${dst}" -xvf - &&
 
     if [ ! -e "${dst}/wizard.sh" ]; then
-       return
+        return
     fi &&
     template_dir=$(dirname "${template_src}") &&
     ( cd "${dst}" && bash wizard.sh "${package}" "${template_dir}") &&
@@ -238,8 +238,8 @@ ptxd_template_new() {
 
     local func="ptxd_template_new_${action//-/_}"
     if ! declare -F | grep -q "${func}$"; then
-       ptxd_template_help
-       return
+        ptxd_template_help
+        return
     fi
     echo
     echo "${PTXDIST_LOG_PROMPT}creating a new '${action}' package:"
@@ -255,12 +255,12 @@ ptxd_template_help() {
     echo
     set -- "${ptxd_template_help_list[@]}"
     while [ $# -gt 0 ]; do
-       while [ -z "${1}" ]; do
-           echo
-           shift
-       done
-       printf "  %-24s %s\n" "${1}" "${2}"
-       shift 2
+        while [ -z "${1}" ]; do
+            echo
+            shift
+        done
+        printf "  %-24s %s\n" "${1}" "${2}"
+        shift 2
     done
     echo
 }
@@ -427,9 +427,9 @@ ptxd_template_new_image_genimage() {
     local template_file="$(ptxd_template_file "${template}-config")"
     local filename="${PTXDIST_PLATFORMCONFIGDIR}/config/images/${CONFIG}"
     if ptxd_get_alternative config/images "${CONFIG}"; then
-       echo "using existing config file $(ptxd_template_print_path 
${ptxd_reply})"
+        echo "using existing config file $(ptxd_template_print_path 
${ptxd_reply})"
     else
-       ptxd_template_filter "${template_file}" "${filename}"
+        ptxd_template_filter "${template_file}" "${filename}"
     fi
 }
 export -f ptxd_template_new_image_genimage
@@ -450,11 +450,13 @@ ptxd_template_new_blspec_entry() {
     local template_file="$(ptxd_template_file "${template}-conf")"
     local 
filename="${PTXDIST_PLATFORMCONFIGDIR}/projectroot/loader/entries/${ENTRY}"
     if ptxd_get_alternative loader/entries "${ENTRY}"; then
-       echo "using existing config file $(ptxd_template_print_path 
${ptxd_reply})"
+        echo "using existing config file $(ptxd_template_print_path 
${ptxd_reply})"
     else
-       ptxd_template_filter "${template_file}" "${filename}"
+        ptxd_template_filter "${template_file}" "${filename}"
     fi
 }
 export -f ptxd_template_new_blspec_entry
 ptxd_template_help_list[${#ptxd_template_help_list[@]}]="blspec-entry"
 ptxd_template_help_list[${#ptxd_template_help_list[@]}]="create package for a 
bootloader spec entry"
+
+# vim: ts=4 sw=4 sts=4 et
-- 
2.11.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to