Save SOURCE_DATE_EPOCH to a file and read it from the file when resuming a build
Print the build date. Don't re-run mksquashfs if it succeeded, but the failure was in gpg signing. For example, if the gpg pinentry timed out.
This commit is contained in:
parent
455e2b94c0
commit
f45fc29fe0
@ -149,7 +149,8 @@ ENDUSAGETEXT
|
||||
# Shows configuration according to command mode.
|
||||
# $1: build_profile | init | install | run | prepare | iso
|
||||
_show_config() {
|
||||
local _mode="$1"
|
||||
local _mode="$1" build_date
|
||||
build_date="$(date --utc --iso-8601=seconds -d "@${SOURCE_DATE_EPOCH}")"
|
||||
_msg_info "${app_name} configuration settings"
|
||||
[[ ! -d "${command_name}" ]] && _msg_info " Legacy Command: ${command_name}"
|
||||
_msg_info " Architecture: ${arch}"
|
||||
@ -157,6 +158,7 @@ _show_config() {
|
||||
_msg_info " Installation directory: ${install_dir}"
|
||||
case "${_mode}" in
|
||||
build_profile)
|
||||
_msg_info " Build date: ${build_date}"
|
||||
_msg_info " Output directory: ${out_dir}"
|
||||
_msg_info " GPG key: ${gpg_key:-None}"
|
||||
_msg_info " Profile: ${profile}"
|
||||
@ -597,9 +599,9 @@ _make_boot_uefi-x64.systemd-boot.eltorito() {
|
||||
# Build airootfs filesystem image
|
||||
_make_prepare() {
|
||||
if [[ "${sfs_mode}" == "sfs" ]]; then
|
||||
_mkairootfs_sfs
|
||||
_run_once _mkairootfs_sfs
|
||||
else
|
||||
_mkairootfs_img
|
||||
_run_once _mkairootfs_img
|
||||
fi
|
||||
_mkchecksum
|
||||
if [[ "${gpg_key}" ]]; then
|
||||
@ -783,12 +785,16 @@ command_build_profile() {
|
||||
isofs_dir="${work_dir}/iso"
|
||||
# Set ISO file name
|
||||
img_name="${iso_name}-${iso_version}-${arch}.iso"
|
||||
|
||||
_show_config "${FUNCNAME[0]#command_}"
|
||||
|
||||
# Create working directory
|
||||
[[ -d "${work_dir}" ]] || install -d -- "${work_dir}"
|
||||
# Write build date to file or if the file exists, read it from there
|
||||
if [[ -e "${work_dir}/build_date" ]]; then
|
||||
SOURCE_DATE_EPOCH="$(<"${work_dir}/build_date")"
|
||||
else
|
||||
printf '%s\n' "$SOURCE_DATE_EPOCH" > "${work_dir}/build_date"
|
||||
fi
|
||||
|
||||
_show_config "${FUNCNAME[0]#command_}"
|
||||
_run_once _make_pacman_conf
|
||||
_run_once _export_gpg_publickey
|
||||
_run_once _make_custom_airootfs
|
||||
|
Loading…
Reference in New Issue
Block a user