diff options
Diffstat (limited to 'compiz-fusion-git-retrieve')
-rwxr-xr-x | compiz-fusion-git-retrieve | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/compiz-fusion-git-retrieve b/compiz-fusion-git-retrieve new file mode 100755 index 0000000..9f36a1b --- /dev/null +++ b/compiz-fusion-git-retrieve @@ -0,0 +1,96 @@ +#!/bin/bash +# Compiz Fusion Git Retrieval Script + +### DO NOT EDIT BELOW THIS LINE ### + +source $(dirname ${0})/compiz-fusion-git-functions +source $(dirname ${0})/compiz-fusion-git-config + +function get_repo() { + git_path="${1}" # The path to the package upstream + + shift 1 # Remove git_path from "$@" + packages="$@" # Remove the path from packages + + for package in $packages + do + echo "==> Git Cloning/Pulling '${package}': " + + if [[ ! -d $package ]]; then + git clone ${GIT_URI}${git_path}/${package} || die "\n*** ERROR: Failed to complete 'git clone ${GIT_URI}/${package}'" + else + cd $package + git pull || die "\n*** ERROR: Failed to complete 'git pull ${package}'" + cd ../ + fi + + echo "" + done +} + +if [[ "${GIT_USER#!}" == "dev" ]]; then + # Developers + GIT_URI="git+ssh://git.opencompositing.org/git" +else + # Users + GIT_URI="git://anongit.opencompositing.org" +fi + +# Check for git +if [[ ! -x $(which git) ]]; then + echo "You must have GIT installed to use this script." + + # Detect what command to install git with. All debian derivitives must come before ubuntu + + if [[ -e /etc/arch-release ]]; then + echo "To install GIT, please run 'pacman -S git'" + + elif [[ -e /etc/lsb-release && -n $(cat /etc/lsb-release | grep Ubuntu) ]]; then + echo "To install GIT, please run 'sudo apt-get install git-core" + echo "If you have installed 'git' before 'git-core'," + echo "Please run 'sudo update-alternatives --config git' and select the correct" + echo "git package" + + elif [[ -e /etc/debian_version ]]; then + echo "To install GIT, please run 'apt-get install git-core'" + + elif [[ -e /etc/gentoo-release ]]; then + echo "To install GIT, please run 'emerge git'" + + fi + + exit 1 +fi + +# Calculate the packages we will be retrieving + +COMPIZ=$(remove_unwanted_packages ${COMPIZ[*]}) +FUSION=$(remove_unwanted_packages ${FUSION[*]}) +MISC=$(remove_unwanted_packages ${MISC[*]}) +LIBS=$(remove_unwanted_packages ${LIBS[*]}) +CONFIG=$(remove_unwanted_packages ${CONFIG[*]}) +DECORATORS=$(remove_unwanted_packages ${DECORATORS[*]}) +PLUGIN_CONTAINERS=$(remove_unwanted_packages ${PLUGIN_CONTAINERS[*]}) +PLUGINS=$(remove_unwanted_packages ${PLUGINS[*]}) + +# Create the location dir if it doesn't exist +if [[ ! -e $GIT_LOCATION ]]; then + mkdir -p $GIT_LOCATION +fi + +# Checkout Process + +cd $GIT_LOCATION + +get_repo "" $COMPIZ # Compiz doesn't have a path +get_repo "/fusion" $FUSION +get_repo "/fusion/misc" $MISC +get_repo "/fusion/libraries" $LIBS +get_repo "/fusion/compizconfig" $CONFIG +get_repo "/fusion/decorators" $DECORATORS +get_repo "/fusion" $PLUGIN_CONTAINERS +get_repo "/fusion/plugins" $PLUGINS + +echo "Compiz Fusion has been cloned/pulled" +exit 0 + |