summaryrefslogtreecommitdiff
path: root/tcwg-generate-source-cache.sh
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2017-04-15 06:52:48 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2017-04-19 08:11:16 +0000
commit1f02537b3277d9d67a6a363ee8690b6cef0c3584 (patch)
tree70d5e3745a355c1abc2c660088766d8f09b7f20e /tcwg-generate-source-cache.sh
parent828e885d7e80afb1e01c04465faa2c961026469e (diff)
tcwg-generate-source-cache.sh: Add --dir-abe and --dir-llvm options
Change-Id: I420fa21198aed877a68458c8f8cc97cd6d8512e0
Diffstat (limited to 'tcwg-generate-source-cache.sh')
-rwxr-xr-xtcwg-generate-source-cache.sh49
1 files changed, 33 insertions, 16 deletions
diff --git a/tcwg-generate-source-cache.sh b/tcwg-generate-source-cache.sh
index 59118d7f..607f018b 100755
--- a/tcwg-generate-source-cache.sh
+++ b/tcwg-generate-source-cache.sh
@@ -18,8 +18,8 @@ EOF
exit 1
}
-snapshots_dir=$HOME/snapshots-ref
-llvm_reference=$HOME/llvm-reference
+snapshots_dir=""
+llvm_reference=""
generate_abe=true
generate_llvm=true
generate_misc=true
@@ -27,9 +27,11 @@ update_abe_git=true
update_llvm_git=true
verbose=false
-OPTS="`getopt -l generate-abe:,generate-llvm:,generate-misc:,update-abe-git:,update-llvm-git:,verbose: -- "$@"`"
+OPTS="`getopt -l dir-abe:,dir-llvm:,generate-abe:,generate-llvm:,generate-misc:,update-abe-git:,update-llvm-git:,verbose: -- "$@"`"
while test $# -gt 0; do
case $1 in
+ --dir-abe) snapshots_dir="$2"; shift ;;
+ --dir-llvm) llvm_reference="$2"; shift ;;
--generate-abe) generate_abe="$2"; shift ;;
--generate-llvm) generate_llvm="$2"; shift ;;
--generate-misc) generate_misc="$2"; shift ;;
@@ -46,6 +48,18 @@ else
verbose="set +x"
fi
+$verbose
+
+if [ x"$snapshots_dir" = x"" ]; then
+ echo "ERROR: no --dir-abe DIR option"
+ usage
+fi
+
+if [ x"$llvm_reference" = x"" ]; then
+ echo "ERROR: no --dir-llvm DIR option"
+ usage
+fi
+
# Checkout into $snapshots_dir using ABE
generate_abe_snapshots ()
{
@@ -58,7 +72,7 @@ generate_abe_snapshots ()
git clone --branch stable --depth 1 https://git-us.linaro.org/toolchain/abe $abe_temp
cd $abe_temp
- ./configure --with-local-snapshots=${snapshots_dir}-new
+ ./configure --with-local-snapshots=$snapshots_dir
if [ -e $HOME/.aberc ]; then
echo "ERROR: $HOME/.aberc detected and it might override ABE's behavior"
@@ -75,7 +89,7 @@ generate_abe_snapshots ()
)
# Remove checked-out branch directories
- rm -rf ${snapshots_dir}-new/*~*
+ rm -rf $snapshots_dir/*~*
for t in "${targets[@]}"; do
for c in gcc5 gcc6 gcc7; do
@@ -84,10 +98,10 @@ generate_abe_snapshots ()
done
# Remove checked-out branch directories
- rm -rf ${snapshots_dir}-new/*~*
+ rm -rf $snapshots_dir/*~*
# Remove md5sums to force ABE to fetch canonical version via http://.
- rm -f ${snapshots_dir}-new/md5sums
+ rm -f $snapshots_dir/md5sums
}
generate_misc_files ()
@@ -98,12 +112,12 @@ generate_misc_files ()
# Distribute Foundation Model to the builders so that containers
# running there can access Foundation Model via a bind-mount for
# bare-metal testing.
- tar xf $HOME/public_html/infrastructure/FM000-KT-00035-r9p5-41rel0.tgz -C $HOME/${snapshots_dir}-new
- chmod -R ugo+rx $HOME/${snapshots_dir}-new/Foundation_Platformpkg
+ tar xf $HOME/public_html/infrastructure/FM000-KT-00035-r9p5-41rel0.tgz -C $snapshots_dir
+ chmod -R ugo+rx $snapshots_dir/Foundation_Platformpkg
# Clone the Linux kernel if not already
# present. Subsequent calls will update it.
- linux_git=$HOME/${snapshots_dir}-new/linux.git
+ linux_git=$snapshots_dir/linux.git
if [ ! -d ${linux_git} ]; then
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ${linux_git}
fi
@@ -133,12 +147,12 @@ update_git_repos () {
}
if $generate_abe; then
- mkdir -p ${snapshots_dir}-new
+ mkdir -p $snapshots_dir
# Remove *.asc files to fix cached incorrect md5sum files
- rm -f ${snapshots_dir}-new/*.asc
+ rm -f $snapshots_dir/*.asc
- update_git_repos ${snapshots_dir}-new
+ update_git_repos $snapshots_dir
generate_abe_snapshots
fi
@@ -151,12 +165,15 @@ if $generate_misc; then
fi
if $update_abe_git; then
- update_git_repos ${snapshots_dir}-new
+ update_git_repos $snapshots_dir
fi
if $update_llvm_git; then
- update_git_repos ${llvm_reference}-new
+ update_git_repos $llvm_reference
fi
echo "Snapshots status:"
-du -hs $snapshots_dir-new/*
+du -hs $snapshots_dir/*
+
+echo "LLVM reference status:"
+du -hs $llvm_reference/*