diff options
Diffstat (limited to 'scripts/include')
-rw-r--r-- | scripts/include/common.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/include/common.sh b/scripts/include/common.sh index c00a638..76cf8cc 100644 --- a/scripts/include/common.sh +++ b/scripts/include/common.sh @@ -55,6 +55,7 @@ function common_package_init { fi export packagefile="${package}.sh" + export SRCTYPE="git" if [ ! -f "../packages/${packagefile}" ]; then echo "Error: Package '${package}' not exists." @@ -170,6 +171,17 @@ function run_hg_clone { check_error $? } +function run_clone { + if [[ "${SRCTYPE}" == "git" ]]; then + run_git_clone $1 + elif [[ "${SRCTYPE}" == "hg" ]]; then + run_hg_clone $1 + else + echo "Error: unknown SRCTYPE: ${SRCTYPE}" + exit 1 + fi +} + function run_git_switch_branch { cd "${srcdir}" check_error $? @@ -193,6 +205,17 @@ function run_hg_switch_branch { check_error $? } +function run_switch_branch { + if [[ "${SRCTYPE}" == "git" ]]; then + run_git_switch_branch $1 + elif [[ "${SRCTYPE}" == "hg" ]]; then + run_hg_switch_branch $1 + else + echo "Error: unknown SRCTYPE: ${SRCTYPE}" + exit 1 + fi +} + function package_use { env_path "bin" env_lib_library_path "lib" |