Skip to content

Commit

Permalink
cleanup: Use short git digest in onload_mkdist
Browse files Browse the repository at this point in the history
  • Loading branch information
pcolledg-amd committed Nov 23, 2023
1 parent 5455a61 commit ed3fbf8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/lib/mkdist/preprocess_source
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ update_product_strings() {
# This is a wrapper around the various preprocessing stages for environments
# with appropriately-defined global variables.
preprocess_source() {
[ -n "$src_rev" ] || src_rev=$(cd "$TOP" && "$git" rev-parse HEAD)
[ -n "$src_rev" ] || src_rev=$(cd "$TOP" && "$git" rev-parse --short=7 HEAD)

copy_distfiles "$distfiles_d"
update_readme_strings "$product" "$version" "$src_rev"
Expand Down
6 changes: 4 additions & 2 deletions scripts/onload_mkdist
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ git=${GIT_PATH:-"git"}
while [ $# -gt 0 ]; do
case "$1" in
--version) shift; version="$1";;
--srcrev) shift; src_rev="$1";;
--srcrev) shift; src_rev="${1:0:7}";;
--release) release=true;;
--product) shift; Product="$1";;
--cloud) cloud=true;;
Expand All @@ -107,8 +107,10 @@ TOP=$("$bin/mmaketool" --toppath)
if [ -z "$version" ]; then
if $release; then
version=$(date '+%Y%m%d')
elif [ -n "$src_rev" ]; then
version="$src_rev"
else
version=$(cd "$TOP" && "$git" rev-parse HEAD)
version=$(cd "$TOP" && "$git" rev-parse --short=7 HEAD)
[ -z "$version" ] && fail "ERROR: Could not find HEAD revision"
fi
fi
Expand Down

0 comments on commit ed3fbf8

Please sign in to comment.