mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-27 00:21:44 +02:00
pkg-auto: Add md5-metadata cache to reports
This adds an explicit generation of md5-metadata cache before any we do any emerge invocations. That way we can have a copy of reports even if emerge fails for some reason. But mostly the reason for this copying is to consume the data later, outside the SDK container.
This commit is contained in:
parent
b52676a64b
commit
7b5841c039
@ -98,16 +98,18 @@ function package_info_for_board() {
|
||||
function set_eo() {
|
||||
local dir=${1}; shift
|
||||
|
||||
SDK_EO="${dir}/sdk-emerge-output"
|
||||
BOARD_EO="${dir}/board-emerge-output"
|
||||
# shellcheck disable=SC2034 # used externally
|
||||
declare -g EGENCACHE_W="${dir}/egencache-warnings"
|
||||
declare -g SDK_EO="${dir}/sdk-emerge-output"
|
||||
declare -g BOARD_EO="${dir}/board-emerge-output"
|
||||
# shellcheck disable=SC2034 # used indirectly in cat_eo_f
|
||||
SDK_EO_F="${SDK_EO}-filtered"
|
||||
declare -g SDK_EO_F="${SDK_EO}-filtered"
|
||||
# shellcheck disable=SC2034 # used indirectly in cat_eo_f
|
||||
BOARD_EO_F="${BOARD_EO}-filtered"
|
||||
declare -g BOARD_EO_F="${BOARD_EO}-filtered"
|
||||
# shellcheck disable=SC2034 # used indirectly in cat_eo_w
|
||||
SDK_EO_W="${SDK_EO}-warnings"
|
||||
declare -g SDK_EO_W="${SDK_EO}-warnings"
|
||||
# shellcheck disable=SC2034 # used indirectly in cat_eo_w
|
||||
BOARD_EO_W="${BOARD_EO}-warnings"
|
||||
declare -g BOARD_EO_W="${BOARD_EO}-warnings"
|
||||
}
|
||||
|
||||
# Print the contents of file, path of which is stored in a variable of
|
||||
@ -484,4 +486,19 @@ function clean_empty_warning_files() {
|
||||
done
|
||||
}
|
||||
|
||||
function generate_cache_for() {
|
||||
local repo=${1}; shift
|
||||
|
||||
egencache --repo "${repo}" --update
|
||||
}
|
||||
|
||||
function copy_cache_to_reports() {
|
||||
local repo=${1}; shift
|
||||
local reports_dir=${1}; shift
|
||||
|
||||
local repo_dir
|
||||
repo_dir=$(portageq get_repo_path / "${repo}")
|
||||
cp -a "${repo_dir}/metadata/md5-cache" "${reports_dir}/${repo}-cache"
|
||||
}
|
||||
|
||||
fi
|
||||
|
@ -65,6 +65,16 @@ mkdir -p "${reports_dir}"
|
||||
|
||||
set_eo "${reports_dir}"
|
||||
|
||||
echo 'Running egencache for portage-stable'
|
||||
generate_cache_for 'portage-stable' 2>"${EGENCACHE_W}"
|
||||
echo 'Running egencache for coreos-overlay'
|
||||
generate_cache_for 'coreos-overlay' 2>>"${EGENCACHE_W}"
|
||||
|
||||
echo 'Copying portage-stable cache to reports'
|
||||
copy_cache_to_reports 'portage-stable' "${reports_dir}" 2>>"${EGENCACHE_W}"
|
||||
echo 'Copying coreos-overlay cache to reports'
|
||||
copy_cache_to_reports 'coreos-overlay' "${reports_dir}" 2>>"${EGENCACHE_W}"
|
||||
|
||||
echo 'Running pretend-emerge to get complete report for SDK'
|
||||
package_info_for_sdk >"${SDK_EO}" 2>"${SDK_EO_W}"
|
||||
echo 'Running pretend-emerge to get complete report for board'
|
||||
|
Loading…
x
Reference in New Issue
Block a user