Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archiso
diff options
context:
space:
mode:
authornl6720 <nl6720@gmail.com>2023-03-16 09:45:00 +0200
committernl6720 <nl6720@gmail.com>2023-05-17 15:23:44 +0300
commit8cc0e9e5b09d504a50701a825f0ab9992ed73b6f (patch)
tree6947b1620022c02320430bb9fd44def2b7a21d22 /archiso
parentce8fdedbf7af54544983f87472f8854b7b850603 (diff)
mkarchiso: read SOURCE_DATE_EPOCH from file early
When restarting an interrupted build, SOURCE_DATE_EPOCH needs to be available before `profiledef.sh` is read, since it may reference it. Fixes 7c6f266ec94e3eff23466ed8d0c45e4bee0ddae4
Diffstat (limited to 'archiso')
-rwxr-xr-xarchiso/mkarchiso15
1 files changed, 9 insertions, 6 deletions
diff --git a/archiso/mkarchiso b/archiso/mkarchiso
index afaeb6e..d1d753e 100755
--- a/archiso/mkarchiso
+++ b/archiso/mkarchiso
@@ -1742,12 +1742,8 @@ _build_iso_base() {
# 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
+ # Write build date to file if it does not exist already
+ [[ -e "${work_dir}/build_date" ]] || printf '%s\n' "$SOURCE_DATE_EPOCH" > "${work_dir}/build_date"
[[ "${quiet}" == "y" ]] || _show_config
_run_once _make_pacman_conf
@@ -1863,6 +1859,13 @@ fi
# get the absolute path representation of the first non-option argument
profile="$(realpath -- "${1}")"
+# Read SOURCE_DATE_EPOCH from file early
+build_date_file="$(realpath -q -- "${override_work_dir:-./work}/build_date")" || :
+if [[ -f "$build_date_file" ]]; then
+ SOURCE_DATE_EPOCH="$(<"$build_date_file")"
+fi
+unset build_date_file
+
_read_profile
_set_overrides
_validate_options