Enable support for Software Collections

Fedora, RHEL, and CentOS provide support for multiple versions of
the same software components using Software Collections.  This
patch lists the active collections in a similar manner to Python
virtualenvs.
This commit is contained in:
nzwulfin 2014-05-15 11:45:26 -04:00 committed by Olivier Mengué
parent db25aedffe
commit cc1be7e29d
2 changed files with 13 additions and 1 deletions

View File

@ -268,6 +268,7 @@ _lp_source_config()
LP_ENABLE_RUNTIME=${LP_ENABLE_RUNTIME:-0}
fi
LP_ENABLE_VIRTUALENV=${LP_ENABLE_VIRTUALENV:-1}
LP_ENABLE_SCLS=${LP_ENABLE_SCLS:-1}
LP_ENABLE_VCS_ROOT=${LP_ENABLE_VCS_ROOT:-0}
LP_ENABLE_TITLE=${LP_ENABLE_TITLE:-0}
LP_ENABLE_SCREEN_TITLE=${LP_ENABLE_SCREEN_TITLE:-0}
@ -1563,6 +1564,13 @@ _lp_set_prompt()
LP_VENV=
fi
# Display the current software collections enabled, if available
if [[ "$LP_ENABLE_SCLS,$X_SCLS" = 1,?* ]] ; then
LP_SCLS=" [${LP_COLOR_VIRTUALENV}${X_SCLS%"${X_SCLS##*[![:space:]]}"}${NO_COL}]"
else
LP_SCLS=
fi
LP_RUNTIME=$(_lp_sl "$(_lp_runtime)")
# if change of working directory
@ -1662,7 +1670,7 @@ _lp_set_prompt()
# add user, host and permissions colon
PS1="${PS1}${LP_BRACKET_OPEN}${LP_USER}${LP_HOST}${LP_PERM}"
PS1="${PS1}${LP_PWD}${LP_BRACKET_CLOSE}${LP_VENV}${LP_PROXY}"
PS1="${PS1}${LP_PWD}${LP_BRACKET_CLOSE}${LP_SCLS}${LP_VENV}${LP_PROXY}"
# Add VCS infos
# If root, the info has not been collected unless LP_ENABLE_VCS_ROOT

View File

@ -111,6 +111,10 @@ LP_RUNTIME_THRESHOLD=2
# Recommended value is 1
LP_ENABLE_VIRTUALENV=1
# Display the enabled software collections, if any
# Recommended value is 1
LP_ENABLE_SCLS=1
# Show average system temperature
LP_ENABLE_TEMP=1