Skip to content

Commit 92b69e8

Browse files
committed
[fix] : Use common variables to get Git revisions
1 parent cdd979b commit 92b69e8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

build.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ prepare_build() {
444444
[[ "${customized_password}" = false ]] && password="${defaultpassword}"
445445

446446
# gitversion
447-
[[ "${gitversion}" = true ]] && iso_version="${iso_version}-$(cd "${script_path}"; git rev-parse --short HEAD)"
447+
[[ "${gitversion}" = true ]] && iso_version="${iso_version}-${gitrev}"
448448

449449
# Generate iso file name.
450450
local _channel_name="${channel_name%.add}-${locale_version}"
@@ -1009,7 +1009,7 @@ make_alteriso_info(){
10091009
local _info_file="${isofs_dir}/alteriso-info" _version="${iso_version}"
10101010
remove "${_info_file}"; touch "${_info_file}"
10111011
if [[ -d "${script_path}/.git" ]] && [[ "${gitversion}" = false ]]; then
1012-
_version="${iso_version}-$(git rev-parse --short HEAD)"
1012+
_version="${iso_version}-${gitrev}"
10131013
fi
10141014
"${tools_dir}/alteriso-info.sh" -a "${arch}" -b "${boot_splash}" -c "${channel_name%.add}" -d "${iso_publisher}" -k "${kernel}" -o "${os_name}" -p "${password}" -u "${username}" -v "${_version}" > "${_info_file}"
10151015
fi
@@ -1293,13 +1293,14 @@ else
12931293
channel_dir="${script_path}/channels/${channel_name}"
12941294
fi
12951295

1296-
# Set dirs
1296+
# Set vars
12971297
work_dir="$(realpath "${work_dir}")"
12981298
build_dir="${work_dir}/build/${arch}"
12991299
cache_dir="${work_dir}/cache/${arch}"
13001300
airootfs_dir="${build_dir}/airootfs"
13011301
isofs_dir="${build_dir}/iso"
13021302
lockfile_dir="${build_dir}/lockfile"
1303+
gitrev="$(cd "${script_path}"; git rev-parse --short HEAD)"
13031304

13041305
# Create dir
13051306
for _dir in "${build_dir}" "${cache_dir}" "${airootfs_dir}" "${isofs_dir}" "${lockfile_dir}"; do

0 commit comments

Comments
 (0)