Skip to content

Commit

Permalink
📦 [#63] various changes
Browse files Browse the repository at this point in the history
  • Loading branch information
electricduck committed Jan 29, 2023
1 parent 0c94d62 commit a001094
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
22 changes: 16 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ if [[ ! -f $treefile ]]; then
fi

ref="$(echo "$(cat "$treefile")" | grep "ref:" | sed "s/ref: //" | sed "s/\${basearch}/$(uname -m)/")"
unified="false"

if [[ $variant == *"-unified" ]]; then
unified="true"
fi

if [[ $(command -v "git") ]]; then
if [[ -d "$base_dir/.git" ]]; then
Expand Down Expand Up @@ -121,19 +126,24 @@ buildinfo_content="BUILD_DATE=\"$(date +"%Y-%m-%d %T %z")\"
\nBUILD_TOOL=\"rpm-ostree $(echo "$(rpm-ostree --version)" | grep "Version:" | sed "s/ Version: //" | tr -d "'")+$(echo "$(rpm-ostree --version)" | grep "Git:" | sed "s/ Git: //")\"
\nGIT_COMMIT=$git_commit
\nGIT_TAG=$git_tag
\nREF=\"$ref\"
\nVARIANT=\"$variant\""
\nOS_REF=\"$ref\"
\nOS_UNIFIED=\"$unified\"
\nOS_VARIANT=\"$variant\""

echo -e $buildinfo_content > $buildinfo_file

echo "$(emj "âš¡")Building tree..."
echo "================================================================================"

if [[ $SODALITE_BUILD_DRY_BUILD_SLEEP == "" ]]; then
rpm-ostree compose tree \
--cachedir="$ostree_cache_dir" \
--repo="$ostree_repo_dir" \
`[[ -s $lockfile ]] && echo "--ex-lockfile="$lockfile""` $treefile
compose_args=""

compose_args+="--repo=\"$ostree_repo_dir\""
[[ $ostree_cache_dir != "" ]] && compose_args+=" --cachedir=\"$ostree_cache_dir\""
[[ -s $lockfile ]] && compose_args+=" --ex-lockfile=\"$lockfile\""
[[ $unified == "true" ]] && compose_args+=" --unified-core"

eval "rpm-ostree compose tree $compose_args $treefile"
else
echo "Doing things..."
sleep $SODALITE_BUILD_DRY_BUILD_SLEEP
Expand Down
4 changes: 2 additions & 2 deletions src/shared/post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ fi
if [[ $(cat $buildinfo_file) != "" ]]; then
[[ -z $(get_property $buildinfo_file "GIT_TAG") ]] && \
version_tag="$(get_property $buildinfo_file "GIT_COMMIT")"
[[ ! -z $(get_property $buildinfo_file "VARIANT") ]] && \
variant="$(get_property $buildinfo_file "VARIANT")"
[[ ! -z $(get_property $buildinfo_file "OS_VARIANT") ]] && \
variant="$(get_property $buildinfo_file "OS_VARIANT")"
fi

if [[ -n $variant ]]; then
Expand Down

0 comments on commit a001094

Please sign in to comment.