From f45fc29fe09a98c46e85da56f1709be438d4c33f Mon Sep 17 00:00:00 2001 From: nl6720 Date: Mon, 28 Sep 2020 20:12:01 +0300 Subject: 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. --- archiso/mkarchiso | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/archiso/mkarchiso b/archiso/mkarchiso index 2e31e65..6153c4e 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -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 -- cgit v1.2.3-54-g00ecf