2017-03-29 14:04:07 +00:00
|
|
|
#
|
|
|
|
# \brief Utilities for accessing depot content from run scripts
|
|
|
|
# \author Norman Feske
|
|
|
|
# \date 2017-03-29
|
|
|
|
#
|
|
|
|
|
2018-01-09 12:37:18 +00:00
|
|
|
#
|
|
|
|
# Return depot directory path
|
|
|
|
#
|
|
|
|
# \param --depot-dir set depot directory to given path, otherwise
|
|
|
|
# default value [genode_dir]/depot is used
|
|
|
|
#
|
|
|
|
proc depot_dir { } {
|
|
|
|
return [get_cmd_arg_first --depot-dir "[genode_dir]/depot"]
|
|
|
|
}
|
2017-03-29 14:04:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
# Return spec value to be used to access binary archives
|
|
|
|
#
|
|
|
|
proc depot_spec { } {
|
2017-06-26 12:02:42 +00:00
|
|
|
if {[have_spec x86_32]} { return "x86_32" }
|
|
|
|
if {[have_spec x86_64]} { return "x86_64" }
|
2018-11-30 10:18:24 +00:00
|
|
|
if {[have_spec arm_v6]} { return "arm_v6" }
|
2017-06-26 12:02:42 +00:00
|
|
|
if {[have_spec arm_v7a]} { return "arm_v7a" }
|
2019-05-21 12:01:26 +00:00
|
|
|
if {[have_spec arm_v8a]} { return "arm_v8a" }
|
2021-02-18 07:59:38 +00:00
|
|
|
if {[have_spec riscv]} { return "riscv" }
|
|
|
|
|
|
|
|
puts stderr "Error: unsupported architecture"
|
|
|
|
exit 1
|
2017-03-29 14:04:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Variable used for keeping track of archives that are missing from the
|
|
|
|
# depot. The list is populated by calls of 'import_from_depot' and evaluated
|
|
|
|
# at the boot-image-creation stage via 'check_for_missing_depot_archives'.
|
|
|
|
#
|
2017-12-11 16:19:03 +00:00
|
|
|
# Each list element is a list of <user>, <type>, <spec>, <name>, and <version>.
|
|
|
|
#
|
2017-03-29 14:04:07 +00:00
|
|
|
set _missing_depot_archives {}
|
|
|
|
|
|
|
|
|
|
|
|
#
|
2018-11-20 13:29:59 +00:00
|
|
|
# Pattern to parse a version-less archive path into <user>, <type>, <name>
|
2017-03-29 14:04:07 +00:00
|
|
|
#
|
2017-12-11 16:19:03 +00:00
|
|
|
proc _depot_archive_path_pattern { } {
|
2020-02-26 12:46:59 +00:00
|
|
|
return {^([\w\d\-]+)/([\w]+)/([\w\d\-_]+)$} }
|
2017-12-11 16:19:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
#
|
2018-11-20 13:29:59 +00:00
|
|
|
# Pattern to parse a versioned archive path into <user>, <type>, <name>, <version>
|
2017-12-11 16:19:03 +00:00
|
|
|
#
|
|
|
|
proc _depot_archive_versioned_path_pattern { } {
|
2020-02-26 12:46:59 +00:00
|
|
|
return {^([\w\d\-]+)/([\w]+)/([\w\d\-_]+)/([\w\d\-\._]+)$} }
|
2017-12-11 16:19:03 +00:00
|
|
|
|
2017-03-29 14:04:07 +00:00
|
|
|
|
|
|
|
#
|
2018-11-20 13:29:59 +00:00
|
|
|
# Pattern to parse a binary archive path into <user>, <spec>, <name>.
|
2017-03-29 14:04:07 +00:00
|
|
|
#
|
2017-12-11 16:19:03 +00:00
|
|
|
proc _depot_bin_archive_path_pattern { } {
|
2020-02-26 12:46:59 +00:00
|
|
|
return {^([\w\d\-]+)/bin/([\w\d]+)/([\w\d\-_]+)$} }
|
2017-03-29 14:04:07 +00:00
|
|
|
|
|
|
|
|
2018-11-20 13:29:59 +00:00
|
|
|
#
|
|
|
|
# Pattern to parse a versioned api name into <name>, <version>
|
|
|
|
#
|
|
|
|
proc _depot_api_versioned_name_pattern { } {
|
|
|
|
return {^([\w\d\-_]+)/([\w\d\-\._]+)$} }
|
|
|
|
|
|
|
|
|
2017-03-29 14:04:07 +00:00
|
|
|
##
|
2017-07-04 12:09:52 +00:00
|
|
|
# Determine content of a pkg archive and its dependencies
|
2017-03-29 14:04:07 +00:00
|
|
|
#
|
2017-12-11 16:19:03 +00:00
|
|
|
proc _collect_pkg_archive_from_depot { user name version } {
|
2017-03-29 14:04:07 +00:00
|
|
|
|
|
|
|
global _missing_depot_archives
|
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
set archive_dir "$user/pkg/$name/$version"
|
2017-07-04 12:09:52 +00:00
|
|
|
set archives_file "[depot_dir]/$archive_dir/archives"
|
2017-03-29 14:04:07 +00:00
|
|
|
|
2017-07-04 12:09:52 +00:00
|
|
|
if {![file exists $archives_file]} {
|
2018-05-14 18:05:17 +00:00
|
|
|
puts stderr "Error: missing file $archives_file"
|
2017-03-29 14:04:07 +00:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2017-07-04 12:09:52 +00:00
|
|
|
set fh [open $archives_file "RDONLY"]
|
2017-03-29 14:04:07 +00:00
|
|
|
set archives [read $fh]
|
|
|
|
close $fh
|
|
|
|
|
2017-07-04 12:09:52 +00:00
|
|
|
set content "$archive_dir"
|
2017-03-29 14:04:07 +00:00
|
|
|
foreach archive $archives {
|
2017-12-11 16:19:03 +00:00
|
|
|
if {[regexp [_depot_archive_versioned_path_pattern] $archive dummy user type name version]} {
|
2017-03-29 14:04:07 +00:00
|
|
|
if {($type == "pkg") || ($type == "src") || ($type == "raw")} {
|
2017-07-04 12:09:52 +00:00
|
|
|
set content [concat $content [_collect_from_depot $archive]]
|
2017-03-29 14:04:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-07-04 12:09:52 +00:00
|
|
|
|
|
|
|
return $content
|
2017-03-29 14:04:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
proc _copy_directory_content_to_run_dir { dir } {
|
|
|
|
|
|
|
|
if {![file isdirectory $dir]} {
|
|
|
|
puts stderr "Error: expected directory at '$dir'"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2021-09-29 09:20:42 +00:00
|
|
|
foreach file [glob -nocomplain -directory $dir *] { copy_file $file [run_dir]/genode/ }
|
2017-03-29 14:04:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
proc _collect_raw_archive_from_depot { user name version } {
|
|
|
|
return "$user/raw/$name/$version" }
|
2017-03-29 14:04:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
##
|
2018-11-20 13:29:59 +00:00
|
|
|
# Determine binary and api content for a given source archive
|
2017-03-29 14:04:07 +00:00
|
|
|
#
|
2017-12-11 16:19:03 +00:00
|
|
|
proc _collect_src_archive_from_depot { user name version } {
|
2017-03-29 14:04:07 +00:00
|
|
|
|
|
|
|
global _missing_depot_archives;
|
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
set src_archive_dir "$user/src/$name/$version"
|
|
|
|
set bin_archive_dir "$user/bin/[depot_spec]/$name/$version"
|
2018-11-20 13:29:59 +00:00
|
|
|
set used_apis_file "[depot_dir]/$src_archive_dir/used_apis"
|
|
|
|
|
|
|
|
set content {}
|
2017-03-29 14:04:07 +00:00
|
|
|
|
2017-07-04 12:09:52 +00:00
|
|
|
if {[file exists [depot_dir]/$bin_archive_dir]} {
|
2018-11-20 13:29:59 +00:00
|
|
|
append content [list $src_archive_dir $bin_archive_dir]
|
2017-03-29 14:04:07 +00:00
|
|
|
} else {
|
2017-12-11 16:19:03 +00:00
|
|
|
lappend _missing_depot_archives [list $user bin [depot_spec] $name $version]
|
2017-03-29 14:04:07 +00:00
|
|
|
}
|
2017-07-04 12:09:52 +00:00
|
|
|
|
2018-11-20 13:29:59 +00:00
|
|
|
if {![file exists $used_apis_file]} {
|
|
|
|
puts stderr "Error: missing file $used_apis_file"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
set fh [open $used_apis_file "RDONLY"]
|
|
|
|
set used_apis [read $fh]
|
|
|
|
close $fh
|
|
|
|
|
|
|
|
foreach api $used_apis {
|
2024-01-23 15:17:54 +00:00
|
|
|
#
|
|
|
|
# The 'used_apis' file can contain fully specified entries or shortcuts.
|
|
|
|
# A fully specified entry has the form '<user>/api/<name>/version'.
|
|
|
|
# A shortcut has the form '<name>/version'. In this case, the '<user>' is
|
|
|
|
# implicitely equal to the depot user of the src archive.
|
|
|
|
#
|
|
|
|
if {![regexp [_depot_archive_versioned_path_pattern] $api dummy user dummy api_name api_version]} {
|
|
|
|
regexp [_depot_api_versioned_name_pattern] $api dummy api_name api_version }
|
2018-11-20 13:29:59 +00:00
|
|
|
if {![_depot_contains_archive $user api $api_name $api_version]} {
|
|
|
|
lappend _missing_depot_archives [list $user api "" $api_name $api_version]
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
lappend content $user/api/$api_name/$api_version
|
|
|
|
}
|
|
|
|
|
|
|
|
return $content
|
2017-03-29 14:04:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
##
|
2017-12-11 16:19:03 +00:00
|
|
|
# Determine the current version for the given archive
|
2017-03-29 14:04:07 +00:00
|
|
|
#
|
2017-12-11 16:19:03 +00:00
|
|
|
# This function tries to determine the version information from the Genode
|
2018-05-14 18:05:17 +00:00
|
|
|
# source tree. It exits with an error if the archive is missing from the
|
2017-03-29 14:04:07 +00:00
|
|
|
# depot.
|
|
|
|
#
|
2017-12-11 16:19:03 +00:00
|
|
|
proc _current_depot_archive_version { type name } {
|
2017-03-29 14:04:07 +00:00
|
|
|
|
|
|
|
set hash_rel_path "recipes/$type/$name/hash"
|
|
|
|
set repo [repository_contains $hash_rel_path]
|
|
|
|
|
2018-05-14 18:05:17 +00:00
|
|
|
if {$repo == ""} {
|
2019-06-04 13:48:10 +00:00
|
|
|
puts stderr "Error: recipe for '$type/$name' not found - unable to guess version"
|
2018-05-14 18:05:17 +00:00
|
|
|
exit 1
|
2017-03-29 14:04:07 +00:00
|
|
|
}
|
2018-05-14 18:05:17 +00:00
|
|
|
|
|
|
|
set fh [open "$repo/$hash_rel_path" "RDONLY"]
|
|
|
|
set version [lindex [gets $fh] 0]
|
|
|
|
close $fh
|
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
return $version
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
proc _depot_contains_archive { user type name version } {
|
2017-03-29 14:04:07 +00:00
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
return [file exists [depot_dir]/$user/$type/$name/$version]
|
2017-03-29 14:04:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-04-01 15:28:12 +00:00
|
|
|
proc _depot_auto_update { archives } {
|
|
|
|
|
|
|
|
set archives_to_create { }
|
|
|
|
foreach archive $archives {
|
|
|
|
|
|
|
|
if {[regexp [_depot_archive_path_pattern] $archive dummy user type name]} {
|
|
|
|
|
|
|
|
if {$type == "pkg"} {
|
|
|
|
lappend archives_to_create "$user/pkg/[depot_spec]/$name" }
|
|
|
|
|
|
|
|
if {$type == "src"} {
|
|
|
|
lappend archives_to_create "$user/bin/[depot_spec]/$name" }
|
|
|
|
|
|
|
|
if {$type == "raw"} {
|
|
|
|
lappend archives_to_create "$user/raw/$name" }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# remove duplicates
|
|
|
|
set archives_to_create [lsort -unique $archives_to_create]
|
|
|
|
|
2022-01-06 21:48:16 +00:00
|
|
|
if {[llength $archives_to_create] == 0} {
|
|
|
|
return }
|
|
|
|
|
2019-04-01 15:28:12 +00:00
|
|
|
set cmd "[genode_dir]/tool/depot/create $archives_to_create "
|
|
|
|
append cmd "CROSS_DEV_PREFIX=[cross_dev_prefix] "
|
2019-05-08 11:57:59 +00:00
|
|
|
append cmd "DEPOT_DIR=[depot_dir] "
|
2019-04-01 15:28:12 +00:00
|
|
|
append cmd "UPDATE_VERSIONS=1 FORCE=1 REBUILD= "
|
|
|
|
|
2021-03-05 15:02:27 +00:00
|
|
|
if {[get_cmd_switch --ccache]} {
|
|
|
|
append cmd "CCACHE=1 " }
|
|
|
|
|
2019-04-01 15:28:12 +00:00
|
|
|
set make_j_arg ""
|
|
|
|
regexp {.*(-j\d*)} [get_cmd_arg_first --make ""] dummy make_j_arg
|
|
|
|
append cmd "$make_j_arg "
|
|
|
|
|
|
|
|
puts "update depot: $cmd"
|
|
|
|
|
|
|
|
exec {*}$cmd >@ stdout 2>@ stderr
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# keep track of recursion to perform '_depot_auto_update' only at the top level
|
|
|
|
set _collect_from_depot_nesting_level 0
|
|
|
|
|
|
|
|
|
2017-07-04 12:09:52 +00:00
|
|
|
proc _collect_from_depot { archives } {
|
2017-03-29 14:04:07 +00:00
|
|
|
|
|
|
|
global _missing_depot_archives
|
2019-04-01 15:28:12 +00:00
|
|
|
global _collect_from_depot_nesting_level
|
|
|
|
|
|
|
|
incr _collect_from_depot_nesting_level
|
|
|
|
|
|
|
|
# fill depot with up-to-date content if --depot-auto-update is enabled
|
|
|
|
if {[get_cmd_switch --depot-auto-update]} {
|
|
|
|
if {$_collect_from_depot_nesting_level == 1} {
|
|
|
|
_depot_auto_update $archives } }
|
2017-03-29 14:04:07 +00:00
|
|
|
|
2017-07-04 12:09:52 +00:00
|
|
|
set all_content {}
|
|
|
|
|
|
|
|
foreach archive $archives {
|
2017-03-29 14:04:07 +00:00
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
set version ""
|
2017-03-29 14:04:07 +00:00
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
#
|
|
|
|
# Try to parse versioned archive path. If no version is specified, use
|
|
|
|
# the current version as present in the source tree.
|
|
|
|
#
|
|
|
|
if {![regexp [_depot_archive_versioned_path_pattern] $archive dummy user type name version]} {
|
|
|
|
|
|
|
|
if {[regexp [_depot_archive_path_pattern] $archive dummy user type name]} {
|
|
|
|
set version [_current_depot_archive_version $type $name]
|
2017-03-29 14:04:07 +00:00
|
|
|
|
|
|
|
} else {
|
2017-12-11 16:19:03 +00:00
|
|
|
puts stderr "Error: malformed depot-archive path '$archive',"
|
|
|
|
puts stderr " expected '<user>/<type>/<name>'"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if {$version == ""} {
|
|
|
|
puts stderr "Error: unable to guess version of '$type/$name' archive"
|
|
|
|
exit 1
|
|
|
|
}
|
2017-03-29 14:04:07 +00:00
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
if {![_depot_contains_archive $user $type $name $version]} {
|
|
|
|
lappend _missing_depot_archives [list $user $type "" $name $version]
|
|
|
|
continue
|
|
|
|
}
|
2017-07-04 12:09:52 +00:00
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
set content {}
|
2017-03-29 14:04:07 +00:00
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
switch $type {
|
2017-03-29 14:04:07 +00:00
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
"pkg" { set content [_collect_pkg_archive_from_depot $user $name $version] }
|
|
|
|
"src" { set content [_collect_src_archive_from_depot $user $name $version] }
|
|
|
|
"raw" { set content [_collect_raw_archive_from_depot $user $name $version] }
|
2017-07-04 12:09:52 +00:00
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
default {
|
|
|
|
puts stderr "Error: unknown depot-archive type '$type'"
|
|
|
|
exit 1
|
2017-03-29 14:04:07 +00:00
|
|
|
}
|
|
|
|
}
|
2017-12-11 16:19:03 +00:00
|
|
|
set all_content [concat $all_content $content]
|
2017-03-29 14:04:07 +00:00
|
|
|
}
|
2019-04-01 15:28:12 +00:00
|
|
|
|
|
|
|
incr _collect_from_depot_nesting_level -1
|
2017-07-04 12:09:52 +00:00
|
|
|
return $all_content
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-01-22 11:58:39 +00:00
|
|
|
##
|
|
|
|
# Parse depot user from run tool arguments with a fallback to "genodelabs"
|
|
|
|
#
|
|
|
|
#
|
|
|
|
proc depot_user {} { return [get_cmd_arg --depot-user genodelabs] }
|
|
|
|
|
|
|
|
|
2017-07-04 12:09:52 +00:00
|
|
|
##
|
|
|
|
# Import binary and raw content of the specified depot archives into the run
|
|
|
|
# directory of the scenario
|
|
|
|
#
|
|
|
|
proc import_from_depot { args } {
|
|
|
|
|
2017-12-22 08:31:36 +00:00
|
|
|
foreach subdir [_collect_from_depot [join $args " "]] {
|
2017-07-04 12:09:52 +00:00
|
|
|
|
|
|
|
# prevent src, api, and pkg archives from inflating the boot image
|
2017-12-11 16:19:03 +00:00
|
|
|
if {[regexp [_depot_archive_versioned_path_pattern] $subdir dummy user type]} {
|
2017-07-04 12:09:52 +00:00
|
|
|
if {$type == "src"} continue;
|
|
|
|
if {$type == "api"} continue;
|
|
|
|
if {$type == "pkg"} continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
_copy_directory_content_to_run_dir "[depot_dir]/$subdir"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
# Assemble tar archive from binary content of the depot
|
|
|
|
#
|
|
|
|
proc create_tar_from_depot_binaries { archive_path args } {
|
|
|
|
|
|
|
|
# filter out api and src archives from requested depot content
|
|
|
|
set content {}
|
|
|
|
foreach subdir [_collect_from_depot $args] {
|
2017-12-11 16:19:03 +00:00
|
|
|
if {[regexp [_depot_archive_versioned_path_pattern] $subdir dummy user type]} {
|
2017-07-04 12:09:52 +00:00
|
|
|
if {$type == "src"} continue;
|
|
|
|
if {$type == "api"} continue;
|
|
|
|
}
|
|
|
|
lappend content $subdir
|
|
|
|
}
|
|
|
|
|
|
|
|
check_for_missing_depot_archives
|
|
|
|
|
2022-02-15 15:08:32 +00:00
|
|
|
if {[llength $args] > 0} {
|
|
|
|
eval "exec tar cf $archive_path -C [depot_dir] [lsort -unique $content]"
|
|
|
|
} else {
|
|
|
|
eval "exec tar cf $archive_path -T /dev/null"
|
|
|
|
}
|
2017-03-29 14:04:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-11-20 13:29:59 +00:00
|
|
|
##
|
|
|
|
# Append src and api packages to the tar archive
|
|
|
|
#
|
|
|
|
proc append_src_and_api_depot_packages_to_tar { archive_path args } {
|
|
|
|
|
|
|
|
set content {}
|
|
|
|
foreach subdir [_collect_from_depot $args] {
|
|
|
|
if {[regexp [_depot_archive_versioned_path_pattern] $subdir dummy user type]} {
|
|
|
|
if {($type != "src") && ($type != "api")} continue;
|
|
|
|
lappend content $subdir
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
check_for_missing_depot_archives
|
|
|
|
|
|
|
|
eval "exec tar rf $archive_path -C [depot_dir] [lsort -unique $content]"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
proc _locally_available_recipe { user type name version } {
|
2017-03-29 14:04:07 +00:00
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
if {$type == "bin"} { set type "src" }
|
2017-03-29 14:04:07 +00:00
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
if {[repository_contains "recipes/$type/$name/hash"] == ""} {
|
|
|
|
return 0 }
|
2017-03-29 14:04:07 +00:00
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
if {$version != [_current_depot_archive_version $type $name]} {
|
|
|
|
return 0 }
|
2017-03-29 14:04:07 +00:00
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
return 1
|
2017-03-29 14:04:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
# Check for the completeness of the imported depot content
|
|
|
|
#
|
|
|
|
# This function aborts the run script if any archives are missing.
|
|
|
|
#
|
|
|
|
proc check_for_missing_depot_archives { } {
|
|
|
|
|
|
|
|
global _missing_depot_archives
|
|
|
|
|
|
|
|
if {[llength $_missing_depot_archives] == 0} { return }
|
|
|
|
|
|
|
|
puts stderr "\nError: missing depot archives:"
|
|
|
|
|
|
|
|
#
|
|
|
|
# Try to assist the user with obtaining the missing archives
|
|
|
|
#
|
|
|
|
# For missing archives that belong to the configured depot user, the
|
|
|
|
# user should be able to created them from the source tree as long as
|
|
|
|
# recipe exists.
|
|
|
|
#
|
|
|
|
# Archives that do not belong to the configured depot user may be
|
|
|
|
# downloaded.
|
|
|
|
#
|
|
|
|
# XXX Present this option only if the URL and public key of the
|
|
|
|
# archives user is known
|
|
|
|
# XXX Present download option even for archives that can be created locally
|
|
|
|
#
|
|
|
|
|
|
|
|
set nonexisting_archives {}
|
|
|
|
set local_user_archives {}
|
|
|
|
set foreign_archives {}
|
|
|
|
|
2018-10-29 23:05:38 +00:00
|
|
|
set _missing_depot_archives [lsort -unique $_missing_depot_archives]
|
|
|
|
|
2017-03-29 14:04:07 +00:00
|
|
|
foreach archive $_missing_depot_archives {
|
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
set user [lindex $archive 0]
|
|
|
|
set type [lindex $archive 1]
|
|
|
|
set spec [lindex $archive 2]
|
|
|
|
set name [lindex $archive 3]
|
|
|
|
set version [lindex $archive 4]
|
|
|
|
|
|
|
|
#
|
|
|
|
# If a pkg archive is missing, suggest to obtain the binary-pkg
|
|
|
|
# archive (matching the build directory) immediately, which implies
|
|
|
|
# the pkg archive. Otherwise, the user would first obtain the pkg
|
|
|
|
# archive and its source dependencies, and then get an error for
|
|
|
|
# the missing binary archives on the next attempt to execute the
|
|
|
|
# run script.
|
|
|
|
#
|
|
|
|
if {$type == "pkg"} { set spec "[depot_spec]" }
|
|
|
|
if {$type == "src"} {
|
|
|
|
set type "bin"
|
|
|
|
set spec "[depot_spec]"
|
|
|
|
}
|
|
|
|
|
|
|
|
set path "$user/$type/$name"
|
2018-03-15 09:39:20 +00:00
|
|
|
if {$type == "bin" || $type == "pkg"} {
|
|
|
|
set path "$user/$type/$spec/$name" }
|
2017-03-29 14:04:07 +00:00
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
puts stderr " $path/$version"
|
2017-03-29 14:04:07 +00:00
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
if {[_locally_available_recipe $user $type $name $version]} {
|
|
|
|
lappend local_user_archives $path
|
|
|
|
} else {
|
|
|
|
lappend foreign_archives $path/$version
|
2017-03-29 14:04:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-11 16:19:03 +00:00
|
|
|
if {[llength $local_user_archives] || [llength $foreign_archives]} {
|
|
|
|
puts stderr "" }
|
2017-03-29 14:04:07 +00:00
|
|
|
|
|
|
|
if {[llength $local_user_archives]} {
|
2017-12-11 16:19:03 +00:00
|
|
|
append create_args " CROSS_DEV_PREFIX=[cross_dev_prefix]"
|
2020-09-03 07:24:38 +00:00
|
|
|
puts stderr "You may create the following archives locally by executing:\n"
|
2017-03-29 14:04:07 +00:00
|
|
|
puts stderr " [genode_dir]/tool/depot/create $local_user_archives$create_args\n"
|
|
|
|
}
|
|
|
|
|
|
|
|
if {[llength $foreign_archives]} {
|
2020-09-03 07:24:38 +00:00
|
|
|
puts stderr "You may try to download the following archives by executing:\n"
|
2017-03-29 14:04:07 +00:00
|
|
|
puts stderr " [genode_dir]/tool/depot/download $foreign_archives\n"
|
|
|
|
}
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
proc drivers_interactive_pkg { } {
|
|
|
|
|
2021-01-13 09:15:10 +00:00
|
|
|
if {[have_board imx53_qsb_tz]} { return drivers_interactive-imx53_qsb }
|
2017-03-29 14:04:07 +00:00
|
|
|
|
2021-07-14 11:47:28 +00:00
|
|
|
return "drivers_interactive-[board]"
|
2017-03-29 14:04:07 +00:00
|
|
|
}
|
2018-12-05 14:20:42 +00:00
|
|
|
|
|
|
|
|
2021-07-14 11:47:28 +00:00
|
|
|
proc drivers_nic_pkg { } { return "drivers_nic-[board]" }
|