Modified - [scripts] [configure] [git-lfs] Added conditional Git LFS setup to configure.sh when repository LFS hooks are installed.
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled

- 1 - I updated `.configure.sh` so repositories that already have Git LFS hook scripts in `.git/hooks` now treat `git-lfs` as a required dependency during verification, install the `git-lfs` system package on supported package managers, and run `git lfs install --local` during non-verify setup.
This commit is contained in:
2026-05-19 23:46:15 +03:00
parent 06e5bd7f46
commit b66ec8c19d
2 changed files with 41 additions and 0 deletions
+3
View File
@@ -805,3 +805,6 @@ History search guidance:
- 2 - I added a dedicated Darwin SQLite build path in `smart-build.sh` that routes macOS `bindata sqlite sqlite_unlock_notify` builds through `make release-darwin`, and I updated `Makefile` to make `release-darwin` configurable through `DARWIN_ARCHS` so helper scripts can request only `darwin-10.12/amd64` or `darwin-10.12/arm64`. - 2 - I added a dedicated Darwin SQLite build path in `smart-build.sh` that routes macOS `bindata sqlite sqlite_unlock_notify` builds through `make release-darwin`, and I updated `Makefile` to make `release-darwin` configurable through `DARWIN_ARCHS` so helper scripts can request only `darwin-10.12/amd64` or `darwin-10.12/arm64`.
- 3 - I hardened the Darwin SQLite flow in `smart-build.sh` for `code-server`-style containerized workspaces by distinguishing between a missing Docker CLI and an unreachable Docker daemon, by validating that the host Docker daemon can see the same mounted repository `go.mod` path as the current workspace, and by moving the temporary release output under `dist/` instead of `/tmp`. - 3 - I hardened the Darwin SQLite flow in `smart-build.sh` for `code-server`-style containerized workspaces by distinguishing between a missing Docker CLI and an unreachable Docker daemon, by validating that the host Docker daemon can see the same mounted repository `go.mod` path as the current workspace, and by moving the temporary release output under `dist/` instead of `/tmp`.
- 4 - I added `SMART_BUILD_DARWIN_HOST_REPO_PATH` support to `smart-build.sh` so Darwin SQLite builds can be redirected to a host-visible repository mount path when the interactive workspace path inside the container differs from the real host path used by the Docker daemon. - 4 - I added `SMART_BUILD_DARWIN_HOST_REPO_PATH` support to `smart-build.sh` so Darwin SQLite builds can be redirected to a host-visible repository mount path when the interactive workspace path inside the container differs from the real host path used by the Docker daemon.
161 - [2026-05-19 23:43:29] - v1.27.0-dev-172-g06e5bd7f46 - Type: Modified - [scripts] [configure] [git-lfs] Added conditional Git LFS setup to `configure.sh` when repository LFS hooks are installed.
- 1 - I updated `.configure.sh` so repositories that already have Git LFS hook scripts in `.git/hooks` now treat `git-lfs` as a required dependency during verification, install the `git-lfs` system package on supported package managers, and run `git lfs install --local` during non-verify setup.
+38
View File
@@ -68,6 +68,7 @@ This script prepares the local machine for the Gitea build used in this tree.
It can install or verify: It can install or verify:
- the required system build packages, including gcc, make, git, pkg-config, - the required system build packages, including gcc, make, git, pkg-config,
and the SQLite/PAM libraries; and the SQLite/PAM libraries;
- git-lfs when this repository has Git LFS hooks installed;
- Go $GO_VERSION, as required by go.mod; - Go $GO_VERSION, as required by go.mod;
- Node $NODE_VERSION and pnpm $PNPM_VERSION, as required by package.json; - Node $NODE_VERSION and pnpm $PNPM_VERSION, as required by package.json;
- frontend dependencies with pnpm install --frozen-lockfile; - frontend dependencies with pnpm install --frozen-lockfile;
@@ -149,6 +150,21 @@ command_exists() {
command -v "$1" >/dev/null 2>&1 command -v "$1" >/dev/null 2>&1
} }
repo_has_git_lfs_hooks() {
local hook
for hook in pre-push post-checkout post-commit post-merge; do
[ -f "$SCRIPT_DIR/.git/hooks/$hook" ] || continue
if grep -q 'git-lfs' "$SCRIPT_DIR/.git/hooks/$hook"; then
return 0
fi
done
return 1
}
repo_requires_git_lfs() {
repo_has_git_lfs_hooks
}
run_as_root() { run_as_root() {
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
"$@" "$@"
@@ -227,6 +243,7 @@ install_system_packages() {
xz-utils xz-utils
zip zip
) )
repo_requires_git_lfs && packages+=(git-lfs)
if [ "$WITH_CROSS_CGO" -eq 1 ]; then if [ "$WITH_CROSS_CGO" -eq 1 ]; then
packages+=( packages+=(
gcc-arm-linux-gnueabihf gcc-arm-linux-gnueabihf
@@ -267,6 +284,7 @@ install_system_packages() {
xz xz
zip zip
) )
repo_requires_git_lfs && packages+=(git-lfs)
run_as_root dnf install -y "${packages[@]}" run_as_root dnf install -y "${packages[@]}"
[ "$WITH_CROSS_CGO" -eq 0 ] || warn "Cross-CGO package setup is only automated for apt-based systems." [ "$WITH_CROSS_CGO" -eq 0 ] || warn "Cross-CGO package setup is only automated for apt-based systems."
return return
@@ -299,6 +317,7 @@ install_system_packages() {
xz xz
zip zip
) )
repo_requires_git_lfs && packages+=(git-lfs)
run_as_root yum install -y "${packages[@]}" run_as_root yum install -y "${packages[@]}"
[ "$WITH_CROSS_CGO" -eq 0 ] || warn "Cross-CGO package setup is only automated for apt-based systems." [ "$WITH_CROSS_CGO" -eq 0 ] || warn "Cross-CGO package setup is only automated for apt-based systems."
return return
@@ -329,6 +348,7 @@ install_system_packages() {
xz xz
zip zip
) )
repo_requires_git_lfs && packages+=(git-lfs)
run_as_root pacman -Sy --needed --noconfirm "${packages[@]}" run_as_root pacman -Sy --needed --noconfirm "${packages[@]}"
[ "$WITH_CROSS_CGO" -eq 0 ] || warn "Cross-CGO package setup is only automated for apt-based systems." [ "$WITH_CROSS_CGO" -eq 0 ] || warn "Cross-CGO package setup is only automated for apt-based systems."
return return
@@ -361,6 +381,7 @@ install_system_packages() {
xz xz
zip zip
) )
repo_requires_git_lfs && packages+=(git-lfs)
run_as_root zypper install -y "${packages[@]}" run_as_root zypper install -y "${packages[@]}"
[ "$WITH_CROSS_CGO" -eq 0 ] || warn "Cross-CGO package setup is only automated for apt-based systems." [ "$WITH_CROSS_CGO" -eq 0 ] || warn "Cross-CGO package setup is only automated for apt-based systems."
return return
@@ -484,6 +505,16 @@ install_frontend_deps() {
pnpm install --frozen-lockfile pnpm install --frozen-lockfile
} }
configure_git_lfs() {
repo_requires_git_lfs || return
log "Configuring Git LFS"
command_exists git-lfs || die "git-lfs is required for this repository but is not installed."
cd "$SCRIPT_DIR"
git lfs install --local >/dev/null
}
configure_cross_cgo() { configure_cross_cgo() {
[ "$WITH_CROSS_CGO" -eq 1 ] || return [ "$WITH_CROSS_CGO" -eq 1 ] || return
@@ -528,6 +559,9 @@ verify_environment() {
missing+=("$command_name") missing+=("$command_name")
fi fi
done done
if repo_requires_git_lfs && ! command_exists git-lfs; then
missing+=("git-lfs")
fi
if command_exists go; then if command_exists go; then
local found_go local found_go
@@ -592,6 +626,9 @@ verify_environment() {
printf 'Node: %s\n' "$(node --version)" printf 'Node: %s\n' "$(node --version)"
printf 'pnpm: %s\n' "$(pnpm --version)" printf 'pnpm: %s\n' "$(pnpm --version)"
printf 'gcc: %s\n' "$(gcc --version | head -n 1)" printf 'gcc: %s\n' "$(gcc --version | head -n 1)"
if repo_requires_git_lfs; then
printf 'git-lfs: %s\n' "$(git lfs version)"
fi
if [ -d "$SCRIPT_DIR/node_modules" ]; then if [ -d "$SCRIPT_DIR/node_modules" ]; then
printf 'node_modules: present\n' printf 'node_modules: present\n'
else else
@@ -652,6 +689,7 @@ fi
if [ "$VERIFY_ONLY" -eq 0 ]; then if [ "$VERIFY_ONLY" -eq 0 ]; then
[ "$INSTALL_SYSTEM" -eq 0 ] || install_system_packages [ "$INSTALL_SYSTEM" -eq 0 ] || install_system_packages
configure_git_lfs
[ "$INSTALL_GO" -eq 0 ] || install_go [ "$INSTALL_GO" -eq 0 ] || install_go
[ "$INSTALL_NODE" -eq 0 ] || install_node_and_pnpm [ "$INSTALL_NODE" -eq 0 ] || install_node_and_pnpm
configure_cross_cgo configure_cross_cgo