Bootstrap: reorganization, bugfixes

This commit is contained in:
2015-02-27 22:49:18 +01:00
parent 6c8e2c9fa9
commit 7690327e9e
9 changed files with 54 additions and 29 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/bash
#set -o functrace
source "$(dirname $0)/../../lib/libem.bash"
source "$(dirname $0)/../../../lib/libem.bash"
TCL_DIR="${PSI_PREFIX}/Tools/Pmodules/0.99.0"

View File

@@ -569,10 +569,10 @@ subcommand_avail() {
local dir=''
# get number of columns of terminal
eval $(resize)
cols=$(tput cols)
output_header() {
let i=($COLUMNS-${#dir})/2-2
let i=($cols-${#dir})/2-2
printf -- "%0.s-" $(seq 1 $i) 1>&2
printf -- " %s " "${dir}" 1>&2
printf -- "%0.s-" $(seq 1 $i) 1>&2
@@ -618,7 +618,7 @@ subcommand_avail() {
human_readable_output() {
output_header
local -i column=$COLUMNS
local -i column=$cols
local -i colsize=16
for ((i=0; i<${#mods[@]}; i+=2)); do
if [[ ${userlvl} == 'novice' ]]; then
@@ -637,11 +637,11 @@ subcommand_avail() {
local -i len=${#mod}
local -i span=$(( len / 16 + 1 ))
local -i colsize=$(( span * 16 ))
if (( column+len >= COLUMNS )); then
if (( column+len >= cols )); then
printf -- "\n" 1>&2
column=0
fi
if (( column+colsize < COLUMNS )); then
if (( column+colsize < cols )); then
fmt="%-${colsize}s"
else
fmt="%-s"
@@ -680,7 +680,7 @@ compute_family_depth () {
{
local -r family=$1
cd "${modulepath_root}"
local -r tmp=$(find "${family}" -d -type f -o -type l | head -1)
local -r tmp=$(find "${family}" -depth -type f -o -type l | head -1)
local -ar tmp2=( ${tmp//\// } )
local depth=${#tmp2[@]}
let depth-=3

View File

@@ -1 +0,0 @@
../Programming/Tcl.build

27
scripts/Bootstrap/Tcl/build Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
source "$(dirname $0)/../../../lib/libem.bash"
function em.configure() {
case ${OS} in
Linux )
srcdir="${MODULE_SRCDIR}/unix"
;;
Darwin )
srcdir="${MODULE_SRCDIR}/macosx"
;;
esac
"${srcdir}"/configure \
--prefix="${PREFIX}" \
--enable-shared=no \
|| exit 1
}
function em.post_install() {
{ cd "${PREFIX}"/bin && rm -f tclsh && ln -fs tclsh${V%.*} tclsh; };
}
em.add_to_family 'Programming'
em.set_docfiles 'license.terms' 'README'
em.set_build_dependencies "${COMPILER}"
em.make_all

View File

@@ -1,6 +1,6 @@
#!/bin/bash
source "$(dirname $0)/../../lib/libem.bash"
source "$(dirname $0)/../../../lib/libem.bash"
function em.configure() {
"${MODULE_SRCDIR}"/configure \

View File

@@ -8,13 +8,13 @@ source "${BASE_DIR}/config/pmodules_version.conf"
unset PMODULES_HOME
source "/opt/psi/config/environment.bash"
${BOOTSTRAP_DIR}/gettext.build --bootstrap
${BOOTSTRAP_DIR}/getopt.build --bootstrap
${BOOTSTRAP_DIR}/dialog.build --bootstrap
${BOOTSTRAP_DIR}/bash.build --bootstrap
${BOOTSTRAP_DIR}/Tcl.build --bootstrap
${BOOTSTRAP_DIR}/gettext/build --bootstrap
${BOOTSTRAP_DIR}/getopt/build --bootstrap
${BOOTSTRAP_DIR}/dialog/build --bootstrap
${BOOTSTRAP_DIR}/bash/build --bootstrap
${BOOTSTRAP_DIR}/Tcl/build --bootstrap
# we have to remove the init directory - otherwise the next build will fail...
rm -rf "${PMODULES_HOME}/init"
${BOOTSTRAP_DIR}/Modules.build --bootstrap
${BOOTSTRAP_DIR}/Modules/build --bootstrap
mv -v "${PMODULES_HOME}/bin/modulecmd" "${PMODULES_HOME}/bin/modulecmd.tcl"

View File

@@ -1,6 +1,6 @@
#!/bin/bash
source "$(dirname $0)/../../lib/libem.bash"
source "$(dirname $0)/../../../lib/libem.bash"
function em.configure() {
"${MODULE_SRCDIR}"/configure \

View File

@@ -1,6 +1,6 @@
#!/bin/bash
source "$(dirname $0)/../../lib/libem.bash"
source "$(dirname $0)/../../../lib/libem.bash"
function em.configure() {
:
@@ -9,7 +9,7 @@ function em.configure() {
function em.build() {
case ${OS} in
Linux )
declare -x LDFLAGS="-lintl -liconv"
declare -x LDFLAGS="-lintl"
;;
Darwin )
declare -x LDFLAGS="-lintl -liconv -framework CoreFoundation"

View File

@@ -1,6 +1,6 @@
#!/bin/bash
source "$(dirname $0)/../../lib/libem.bash"
source "$(dirname $0)/../../../lib/libem.bash"
function em.configure() {
"${MODULE_SRCDIR}"/configure \

View File

@@ -2,6 +2,7 @@
declare -r BASE_DIR=$(cd "$(dirname $0)/../.." && pwd)
declare -r BOOTSTRAP_DIR="${BASE_DIR}/scripts/Bootstrap"
declare -r SRC_DIR="${BOOTSTRAP_DIR}/Pmodules"
source "${BASE_DIR}/config/pmodules_version.conf"
@@ -11,21 +12,19 @@ source "/opt/psi/config/environment.bash"
sed_cmd="s:@PMODULES_HOME@:${PMODULES_HOME}:g;"
sed_cmd+="s:@PMODULES_VERSION@:${PMODULES_VERSION}:g;"
sed_cmd+="s:@MODULES_VERSION@:${MODULES_VERSION}:g"
sed "${sed_cmd}" "${BOOTSTRAP_DIR}/modulecmd.bash" > "${BOOTSTRAP_DIR}/modulecmd"
sed "${sed_cmd}" "${SRC_DIR}/modulecmd.bash" > "${SRC_DIR}/modulecmd"
install -d -m 0755 "${PMODULES_HOME}/bin"
install -d -m 0755 "${PMODULES_HOME}/config"
install -d -m 0755 "${PMODULES_HOME}/init"
install -d -m 0755 "${PMODULES_HOME}/lib"
install -m 0755 "${BOOTSTRAP_DIR}/modulecmd" "${PMODULES_HOME}/bin"
install -m 0755 "${BOOTSTRAP_DIR}/init_local_env.bash" "${PMODULES_HOME}/bin"
install -m 0755 "${BOOTSTRAP_DIR}/modsync.bash" "${PMODULES_HOME}/bin"
install -m 0755 "${BOOTSTRAP_DIR}/dialog.bash" "${PMODULES_HOME}/bin"
install -m 0755 "${SRC_DIR}/modulecmd" "${PMODULES_HOME}/bin"
install -m 0755 "${SRC_DIR}/init_local_env.bash" "${PMODULES_HOME}/bin"
install -m 0755 "${SRC_DIR}/modsync.bash" "${PMODULES_HOME}/bin"
install -m 0755 "${SRC_DIR}/dialog.bash" "${PMODULES_HOME}/bin"
#install -m 0644 "${BOOTSTRAP_DIR}/modulerc" "${PMODULES_HOME}/config"
install -m 0644 "${SRC_DIR}/bash" "${PMODULES_HOME}/init"
install -m 0644 "${SRC_DIR}/bash_completion" "${PMODULES_HOME}/init"
install -m 0644 "${BOOTSTRAP_DIR}/bash" "${PMODULES_HOME}/init"
install -m 0644 "${BOOTSTRAP_DIR}/bash_completion" "${PMODULES_HOME}/init"
install -m 0644 "${BOOTSTRAP_DIR}/libmodules.tcl" "${PMODULES_HOME}/lib"
install -m 0644 "${SRC_DIR}/libmodules.tcl" "${PMODULES_HOME}/lib"