diff options
author | Lucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de> | 2016-03-07 15:57:34 +0000 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de> | 2016-03-07 15:57:34 +0000 |
commit | 960d2e87b9170fe28c5bce92723ba0d7904cd10e (patch) | |
tree | ef8a99a77d5630cd303755960c1d381ece978472 | |
parent | ca303129ab9b7005c5f69f9aa9d10934c9dc2f5f (diff) | |
download | midipix_build-960d2e87b9170fe28c5bce92723ba0d7904cd10e.tar.bz2 midipix_build-960d2e87b9170fe28c5bce92723ba0d7904cd10e.tar.xz |
- Make the midipix shell window shell script less useless.
It now defaults to "/c/Midipix /z" if no arguments are specified.
- Include midipix.sh in distribution tarball.
-rw-r--r-- | 399.midipix_sh.build | 56 | ||||
-rwxr-xr-x | build.sh | 2 |
2 files changed, 48 insertions, 10 deletions
diff --git a/399.midipix_sh.build b/399.midipix_sh.build index 4aa41da7..906cd241 100644 --- a/399.midipix_sh.build +++ b/399.midipix_sh.build @@ -5,15 +5,53 @@ if ! is_build_script_done install; then IFS=""; cat <<EOF > ${PREFIX}/midipix.sh; #!/bin/sh -MIDIPIX_DRIVE=\${1:-z}; -MIDIPIX_DNAME="\${2:-}"; -MIDIPIX_PATH="/\${MIDIPIX_DRIVE}\${MIDIPIX_DNAME:+/\${MIDIPIX_DNAME}}"; -mintty -h always -e /bin/sh -c " - set -o errexit; stty raw -echo; - mount --change-cygdrive-prefix /; - cd \"\${MIDIPIX_PATH}/native/bin\"; - export PATH=\"\${MIDIPIX_PATH}/native/bin:\${MIDIPIX_PATH}/native/lib\"; - ./ntctty.exe -e chroot /native /bin/bash"; +# +MIDIPIX_PATH_DEFAULTS="/c/Midipix /z"; + +if [ "\${1}" = -h ]; then + echo "usage: \$0 [drive_letter [dirname]]"; + exit 1; +elif [ \${#} -eq 0 ]; then +for MIDIPIX_PATH in \${MIDIPIX_PATH_DEFAULTS}; do + [ -d /cygdrive\${MIDIPIX_PATH} ] || continue; + MIDIPIX_DRIVE=\${MIDIPIX_PATH#/}; + MIDIPIX_DRIVE=\${MIDIPIX_DRIVE%%/*}; + MIDIPIX_PNAME=\${MIDIPIX_PATH#/\${MIDIPIX_DRIVE}}; + MIDIPIX_PNAME=\${MIDIPIX_PNAME#/}; + break; +done; +else + MIDIPIX_DRIVE="\${1}"; MIDIPIX_PNAME="\${2}"; + if [ "\${MIDIPIX_DRIVE#*[ ]*}" != "\${MIDIPIX_DRIVE}" ]\\ + || [ "\${MIDIPIX_PNAME#*[ ]*}" != "\${MIDIPIX_PNAME}" ]; then + echo "Error: drive_letter/dirname must not contain SP (\\\` ') or VT (\\\`\\\\\t') characters."; + exit 1; + fi; +fi; +MIDIPIX_PATH=/\${MIDIPIX_DRIVE}\${MIDIPIX_PNAME:+/\${MIDIPIX_PNAME}}; +if [ ! -d /cygdrive\${MIDIPIX_PATH} ]; then + echo "Error: Midipix path non-existent or invalid (\\\`\${MIDIPIX_PATH}'.)"; + exit 1; +else + echo "Midipix drive letter.....: \${MIDIPIX_DRIVE}"; + echo "Midipix pathname.........: \${MIDIPIX_PNAME}"; + echo "Absolute Midipix pathname: \${MIDIPIX_PATH}"; + echo -------------------------------------------------------- + echo WARNING: The cygdrive path prefix will be changed to / + echo whilst the Midipix shell window is running. It will be + echo reset to its original value of /cygdrive after it exits. + echo -------------------------------------------------------- + mintty -h always -e /bin/sh -c " + set -o errexit; stty raw -echo; + mount --change-cygdrive-prefix /; + cd \${MIDIPIX_PATH}/native/bin; + export PATH=\${MIDIPIX_PATH}/native/bin:\${MIDIPIX_PATH}/native/lib; + ./ntctty.exe -e chroot //\${MIDIPIX_PATH#/}/native /bin/bash"; + echo -------------------------------------------------------- + echo Resetting cygdrive path prefix to /. + echo -------------------------------------------------------- + mount --change-cygdrive-prefix /cygdrive; +fi; EOF chmod +x ${PREFIX}/midipix.sh; set_build_script_done install finish; @@ -109,7 +109,7 @@ if [ $(( ${BUILD_NFINI} + ${BUILD_NSKIP} )) -ge 0 ] \ log_msg info "Converted symbolic links in ${PREFIX_BASENAME}/lib to hard links."; tar -cJpf ${TARBALL_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.xz\ $(find_with_no_paths "${TARBALL_EXCLUDE_PATHS} native/lib.bak" . \ - -mindepth 1 -maxdepth 2 -type d -not -path ./native); + -mindepth 1 -maxdepth 2 -type d -not -path ./native) midipix.sh; log_msg info "Finished building distribution tarball."; rm -rf ${PREFIX_BASENAME}/lib; mv ${PREFIX_BASENAME}/lib.bak ${PREFIX_BASENAME}/lib; log_msg info "Restored ${PREFIX_BASENAME}/lib."; |