Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making get_repo, get_timestamp, get_commit, get_version files optional #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,22 @@ if [ "$container_image" = localhost/builder ]; then
"$container_engine" build -t "$container_image" "$dir"
fi

repo="$(./get_repo)"
commit="$(./get_commit)"
timestamp="$(./get_timestamp)"
default_version="$(./get_version)"
[ -e get_repo ] && repo="$(./get_repo)" || repo="http://deb.debian.org/debian"
if [ -e get_commit ]
then
commit="$(./get_commit)"
else
pushd $(dirname "${BASH_SOURCE[0]}")
if [ -z "$(git status --porcelain 2> /dev/null)" ]
then
commit=$(git rev-parse HEAD 2> /dev/null)
else
commit="local"
fi
popd
fi
[ -e get_timestamp ] && timestamp="$(./get_timestamp)" || timestamp="0"
[ -e get_version ] && default_version="$(./get_version)" || default_version="bookworm"

[ -d $target_dir ] || mkdir $target_dir

Expand Down