forked from gussi362/android_kernel_samsung_n770f
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup_repos.sh
More file actions
executable file
·65 lines (49 loc) · 1.49 KB
/
setup_repos.sh
File metadata and controls
executable file
·65 lines (49 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
tools_root='buildtools';
if [ -d "$tools_root" ]; then
echo "$tools_root does exist.";
else
mkdir $tools_root;
echo 'created build toold directory';
fi
clone_if_not_existing() {
local repo_url="$1"
local repo_branch="$2"
local repo_name="${3:-${repo_url##*/}}"
if [ -d "$tools_root/$repo_name" ]; then
print_info "$repo_name - already exists, skipping download"
return 0
fi
# Try shallow clone first, fallback to full clone
if ! git clone "$repo_url" -b "$repo_branch" --depth 1 --recursive "$tools_root/$repo_name"; then
print_info "Shallow clone failed, attempting full clone..."
git clone "$repo_url" -b "$repo_branch" --recursive "$tools_root/$repo_name"
fi
}
if [ -n "$TERM" ] && [ "$TERM" != "dumb" ]; then
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
POWDER_BLUE=$(tput setaf 153)
RESET=$(tput sgr0)
fi
function print_error() {
printf "${RED}%s${RESET}\\n" "${*}" 1>&2
}
function print_warning() {
printf "${YELLOW}%s${RESET}\\n" "${*}"
}
function print_success() {
printf "${GREEN}%s${RESET}\\n" "${*}"
}
function print_info() {
printf "${POWDER_BLUE}%s${RESET}\\n" "${*}"
}
function print_message() {
printf "${RESET}%s${RESET}\\n" "${*}"
}
function print_header() {
printf "${GREEN}%s${RESET}\\n" "${*}"
}
clone_if_not_existing "https://github.com/gussi362/linaro-gcc-4.9" "main"
clone_if_not_existing "https://github.com/gussi362/samsung-toolchain" "samsung"