add branch config support

This commit is contained in:
Casper Chang
2021-01-05 18:11:23 +08:00
parent 1dc0cc6d84
commit a3fed5c785
6 changed files with 45 additions and 12 deletions

View File

@@ -16,6 +16,7 @@ if { ${num_arg} > 0} {
set user_password "default"
set working_dir "default"
set repo_branch "default"
set f [open "config.txt"]
set configs [split [read $f] "\n"]
@@ -40,6 +41,15 @@ foreach config $configs {
puts "$key:$value"
set working_dir $value
}
repo_branch {
if { $value eq "default"} {
puts "INFO: no branch specified, repo init main branch"
set repo_branch ""
} else {
puts "$key:$value"
set repo_branch $value
}
}
# Add argument here
default {
puts "ERROR: Invalid argument $key"
@@ -52,10 +62,10 @@ foreach config $configs {
set timeout -1
spawn ./cros_repoinit.sh ${working_dir}
spawn ./cros_repoinit.sh ${working_dir} ${repo_branch}
expect "repo has been initialized"
spawn ./cros_cp_localmanifest.sh ${working_dir}
spawn ./cros_cp_localmanifest.sh ${working_dir} ${repo_branch}
expect "local_manifests"
spawn ./cros_reposync.sh ${working_dir}
@@ -63,7 +73,6 @@ expect "repo sync has finished successfully"
spawn ./cros_cp_utilities.sh ${working_dir}
expect "dut_pty.sh"
# todo: copy the utility scripts into src/script directory
spawn ./cros_enter_sdk.sh ${working_dir}
expect "password"