Merge branch 'master' of /srv/git/myshellconfig
This commit is contained in:
commit
741e1b626a
2 changed files with 20 additions and 27 deletions
15
bashrc_add
15
bashrc_add
|
@ -32,13 +32,14 @@ if [[ $- = *i* ]] ; then
|
||||||
[ -z "${FULLNAME+x}" ] && export FULLNAME="$(getent passwd $USER | cut -d ":" -f 5 | cut -d ',' -f 1)"
|
[ -z "${FULLNAME+x}" ] && export FULLNAME="$(getent passwd $USER | cut -d ":" -f 5 | cut -d ',' -f 1)"
|
||||||
|
|
||||||
# GIT
|
# GIT
|
||||||
[ -z "${GIT_AUTHOR_NAME+x}" ] && export GIT_AUTHOR_NAME=$FULLNAME
|
[ -z "${GIT_AUTHOR_NAME+x}" ] && export GIT_AUTHOR_NAME=$FULLNAME
|
||||||
[ -z "${GIT_AUTHOR_EMAIL+x}" ] && export GIT_AUTHOR_EMAIL=$USEREMAIL
|
[ -z "${GIT_AUTHOR_EMAIL+x}" ] && export GIT_AUTHOR_EMAIL=$USEREMAIL
|
||||||
[ -z "${GIT_COMMITTER_NAME+x}" ] && export GIT_COMMITTER_NAME=$FULLNAME
|
[ -z "${GIT_COMMITTER_NAME+x}" ] && export GIT_COMMITTER_NAME=$FULLNAME
|
||||||
[ -z "${GIT_COMMITTER_EMAIL+x}" ] && export GIT_COMMITTER_EMAIL=$USEREMAIL
|
[ -z "${GIT_COMMITTER_EMAIL+x}" ] && export GIT_COMMITTER_EMAIL=$USEREMAIL
|
||||||
[ -z "${MYSHELLCONFIG_GIT_TIMEOUT+x}" ] && MYSHELLCONFIG_GIT_TIMEOUT=5s
|
[ -z "${MYSHELLCONFIG_GIT_TIMEOUT+x}" ] && export MYSHELLCONFIG_GIT_TIMEOUT=5s
|
||||||
[ -z "${MYSHELLCONFIG_GIT_CHECKOUT_TIMEOUT+x}" ] && MYSHELLCONFIG_GIT_CHECKOUT_TIMEOUT=20s
|
[ -z "${MYSHELLCONFIG_GIT_CHECKOUT_TIMEOUT+x}" ] && export MYSHELLCONFIG_GIT_CHECKOUT_TIMEOUT=20s
|
||||||
[ -z "${MYSHELLCONFIG_GIT_SYNC+x}" ] && MYSHELLCONFIG_GIT_SYNC=true
|
[ -z "${MYSHELLCONFIG_GIT_SYNC+x}" ] && export MYSHELLCONFIG_GIT_SYNC=true
|
||||||
|
[ -z "${MYSHELLCONFIG_GIT_UPDATE_SUBMODULES_DEFAULT+x}" ] && export MYSHELLCONFIG_GIT_UPDATE_SUBMODULES_DEFAULT=true
|
||||||
# hardcoded git
|
# hardcoded git
|
||||||
export SGIT="git -C ${MYSHELLCONFIG_BASE}"
|
export SGIT="git -C ${MYSHELLCONFIG_BASE}"
|
||||||
|
|
||||||
|
|
|
@ -81,29 +81,21 @@ EOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ${MYSHELLCONFIG_GIT_UPDATE_SUBMODLUES-${MYSHELLCONFIG_GIT_UPDATE_SUBMODULES_DEFAULT-true}}; then
|
||||||
|
logdebug "update submodules"
|
||||||
|
rc=0
|
||||||
|
|
||||||
loginfo "+-----update submodules $(date) ---------------------------------+"
|
logdebug "update submodules" >&2
|
||||||
#cat << EOF >> "${MYSHELLCONFIG_LOGFILE}"
|
# Submodules always have origin and master as repo and branch to track
|
||||||
#
|
$SGIT submodule init 1>>"${MYSHELLCONFIG_LOGFILE}" 2>&1|| { logwarn "update submodules failed on ini"; rc=5; }
|
||||||
#+-----update submodules $(date) ---------------------------------+
|
$SGIT submodule sync 1>>"${MYSHELLCONFIG_LOGFILE}" 2>&1|| { logwarn "sync submodules failed on sync"; rc=6; }
|
||||||
#
|
$SGIT submodule foreach "git checkout master" 1>>"${MYSHELLCONFIG_LOGFILE}" 2>&1 || { logwarn "checkout master submodules failed on set upstream"; rc=7; }
|
||||||
#EOF
|
$SGIT submodule foreach "git branch -u origin/master master" 1>>"${MYSHELLCONFIG_LOGFILE}" 2>&1|| { logwarn "set-upstream submodules failed on set upstream"; rc=8; }
|
||||||
rc=0
|
$SGIT submodule update --recursive --remote --merge 1>>"${MYSHELLCONFIG_LOGFILE}" 2>&1 || { logwarn " update submodules failed on update"; rc=9; }
|
||||||
|
logdebug "submodules updated" >&2
|
||||||
|
|
||||||
logdebug "update submodules" >&2
|
logdebug "update submodules ENDE"
|
||||||
# Submodules always have origin and master as repo and branch to track
|
|
||||||
$SGIT submodule init 1>>"${MYSHELLCONFIG_LOGFILE}" 2>&1|| { logwarn "update submodules failed on ini"; rc=5; }
|
|
||||||
$SGIT submodule sync 1>>"${MYSHELLCONFIG_LOGFILE}" 2>&1|| { logwarn "sync submodules failed on sync"; rc=6; }
|
|
||||||
$SGIT submodule foreach "git checkout master" 1>>"${MYSHELLCONFIG_LOGFILE}" 2>&1 || { logwarn "checkout master submodules failed on set upstream"; rc=7; }
|
|
||||||
$SGIT submodule foreach "git branch -u origin/master master" 1>>"${MYSHELLCONFIG_LOGFILE}" 2>&1|| { logwarn "set-upstream submodules failed on set upstream"; rc=8; }
|
|
||||||
$SGIT submodule update --recursive --remote --merge 1>>"${MYSHELLCONFIG_LOGFILE}" 2>&1 || { logwarn " update submodules failed on update"; rc=9; }
|
|
||||||
logdebug "submodules updated" >&2
|
|
||||||
|
|
||||||
loginfo << EOF >> "${MYSHELLCONFIG_LOGFILE}"
|
|
||||||
|
|
||||||
+-----ENDE $(date) ---------------------------------+
|
|
||||||
|
|
||||||
EOF
|
|
||||||
EXIT
|
EXIT
|
||||||
exit $rc
|
exit $rc
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue