File use-prebuilt-binaries.patch of Package gitaly

Index: gitaly-v18.4.0/Makefile
===================================================================
--- gitaly-v18.4.0.orig/Makefile
+++ gitaly-v18.4.0/Makefile
@@ -163,7 +163,7 @@ GIT_VERSION_PREV ?= 41d0310a83aba75a1958
 # GIT_VERSION_x_xx defines versions for each instance of bundled Git we ship. When a new
 # major version is added, be sure to update GIT_PACKED_EXECUTABLES, the *-bundled-git targets,
 # and add new targets under the "# These targets build specific releases of Git." section.
-GIT_VERSION_2_50 ?= v2.50.1.gl1
+GIT_VERSION_2_50 ?= 2.51.1.gl1
 #
 # OVERRIDE_GIT_VERSION allows you to specify a custom semver value to be reported by the
 # `git --version` command. This affects bundled and non-bundled Git, and can be used whenever
@@ -276,8 +276,7 @@ ifdef CI
 endif
 
 # Git binaries that are eventually embedded into the Gitaly binary.
-GIT_PACKED_EXECUTABLES       = $(addprefix ${BUILD_DIR}/bin/gitaly-, $(addsuffix -master, ${GIT_EXECUTABLES})) \
-                                $(addprefix ${BUILD_DIR}/bin/gitaly-, $(addsuffix -v2.50, ${GIT_EXECUTABLES}))
+GIT_PACKED_EXECUTABLES       = $(addprefix ${BUILD_DIR}/bin/gitaly-, $(addsuffix -v2.51, ${GIT_EXECUTABLES}))
 
 # All executables provided by Gitaly.
 GITALY_EXECUTABLES           = $(addprefix ${BUILD_DIR}/bin/,$(notdir $(shell find ${SOURCE_DIR}/cmd -mindepth 1 -maxdepth 1 -type d -print)))
@@ -364,18 +363,18 @@ install: build
 	${Q}mkdir -p ${INSTALL_DEST_DIR}
 	install ${GITALY_INSTALLED_EXECUTABLES} "${INSTALL_DEST_DIR}"
 
-.PHONY: build-bundled-git
-## Build bundled Git binaries.
-build-bundled-git: build-bundled-git-master build-bundled-git-v2.50
-build-bundled-git-master: $(patsubst %,${BUILD_DIR}/bin/gitaly-%-master,${GIT_EXECUTABLES})
-build-bundled-git-v2.50: $(patsubst %,${BUILD_DIR}/bin/gitaly-%-v2.50,${GIT_EXECUTABLES})
-
-.PHONY: install-bundled-git
-## Install bundled Git binaries. The target directory can be modified by
-## setting PREFIX and DESTDIR.
-install-bundled-git: install-bundled-git-master install-bundled-git-v2.50
-install-bundled-git-master: $(patsubst %,${INSTALL_DEST_DIR}/gitaly-%-master,${GIT_EXECUTABLES})
-install-bundled-git-v2.50: $(patsubst %,${INSTALL_DEST_DIR}/gitaly-%-v2.50,${GIT_EXECUTABLES})
+# .PHONY: build-bundled-git
+# ## Build bundled Git binaries.
+# build-bundled-git: build-bundled-git-master build-bundled-git-2.51
+# build-bundled-git-master: $(patsubst %,${BUILD_DIR}/bin/gitaly-%-master,${GIT_EXECUTABLES})
+# build-bundled-git-2.51: $(patsubst %,${BUILD_DIR}/bin/gitaly-%-2.51,${GIT_EXECUTABLES})
+#
+# .PHONY: install-bundled-git
+# ## Install bundled Git binaries. The target directory can be modified by
+# ## setting PREFIX and DESTDIR.
+# install-bundled-git: install-bundled-git-master install-bundled-git-2.51
+# install-bundled-git-master: $(patsubst %,${INSTALL_DEST_DIR}/gitaly-%-master,${GIT_EXECUTABLES})
+# install-bundled-git-2.51: $(patsubst %,${INSTALL_DEST_DIR}/gitaly-%-2.51,${GIT_EXECUTABLES})
 
 ifdef WITH_BUNDLED_GIT
 build: build-bundled-git
@@ -706,20 +705,20 @@ ${DEPENDENCY_DIR}/git-distribution/build
 	${Q}touch $@
 
 # These targets build specific releases of Git.
-${BUILD_DIR}/bin/gitaly-%-v2.50: override GIT_VERSION = ${GIT_VERSION_2_50}
+${BUILD_DIR}/bin/gitaly-%-2.51: override GIT_VERSION = ${GIT_VERSION_2_50}
 ${BUILD_DIR}/bin/gitaly-%-master: override GIT_VERSION = ${GIT_VERSION_MASTER}
 
-ifdef USE_MESON
-${BUILD_DIR}/bin/gitaly-%-v2.50: ${DEPENDENCY_DIR}/git-v2.50/build/% | ${BUILD_DIR}/bin
-	${Q}install $< $@
-${BUILD_DIR}/bin/gitaly-%-master: ${DEPENDENCY_DIR}/git-master/build/% | ${BUILD_DIR}/bin
-	${Q}install $< $@
-else
-${BUILD_DIR}/bin/gitaly-%-v2.50: ${DEPENDENCY_DIR}/git-v2.50/% | ${BUILD_DIR}/bin
-	${Q}install $< $@
-${BUILD_DIR}/bin/gitaly-%-master: ${DEPENDENCY_DIR}/git-master/% | ${BUILD_DIR}/bin
-	${Q}install $< $@
-endif
+# ifdef USE_MESON
+# ${BUILD_DIR}/bin/gitaly-%-2.51: ${DEPENDENCY_DIR}/git-2.51/build/% | ${BUILD_DIR}/bin
+# 	${Q}install $< $@
+# ${BUILD_DIR}/bin/gitaly-%-master: ${DEPENDENCY_DIR}/git-master/build/% | ${BUILD_DIR}/bin
+# 	${Q}install $< $@
+# else
+# ${BUILD_DIR}/bin/gitaly-%-2.51: ${DEPENDENCY_DIR}/git-2.51/% | ${BUILD_DIR}/bin
+# 	${Q}install $< $@
+# ${BUILD_DIR}/bin/gitaly-%-master: ${DEPENDENCY_DIR}/git-master/% | ${BUILD_DIR}/bin
+# 	${Q}install $< $@
+# endif
 
 # clear-go-build-cache-if-needed cleans the Go build cache if it exceeds the maximum size as
 # configured in GOCACHE_MAX_SIZE_KB.
@@ -727,7 +726,7 @@ endif
 clear-go-build-cache-if-needed:
 	${Q}if [ -d ${GOCACHE} ] && [ $$(du -sk ${GOCACHE} | cut -f 1) -gt ${GOCACHE_MAX_SIZE_KB} ]; then go clean --cache; fi
 
-${BUILD_DIR}/bin/gitaly:   build-bundled-git
+#${BUILD_DIR}/bin/gitaly:   build-bundled-git
 ${BUILD_DIR}/bin/gitaly:   GO_BUILD_TAGS = ${SERVER_BUILD_TAGS}
 ${BUILD_DIR}/bin/gitaly:   ${GITALY_PACKED_EXECUTABLES} ${GIT_PACKED_EXECUTABLES}
 ${BUILD_DIR}/bin/praefect: GO_BUILD_TAGS = ${SERVER_BUILD_TAGS}
@@ -740,34 +739,34 @@ ${GITALY_EXECUTABLES}: ${BUILD_DIR}/bin/
 # change. The dependency on the phony target is required to always rebuild
 # these targets.
 .PHONY: dependency-version
-${DEPENDENCY_DIR}/git-%.version: dependency-version | ${DEPENDENCY_DIR}
-	${Q}[ x"$$(cat "$@" 2>/dev/null)" = x"${GIT_VERSION} ${GIT_BUILD_OPTIONS} ${GIT_MESON_BUILD_OPTIONS} ${USE_MESON}" ] || >$@ echo -n "${GIT_VERSION} ${GIT_BUILD_OPTIONS} ${GIT_MESON_BUILD_OPTIONS} ${USE_MESON}"
+#${DEPENDENCY_DIR}/git-%.version: dependency-version | ${DEPENDENCY_DIR}
+#	${Q}[ x"$$(cat "$@" 2>/dev/null)" = x"${GIT_VERSION} ${GIT_BUILD_OPTIONS} ${GIT_MESON_BUILD_OPTIONS} ${USE_MESON}" ] || >$@ echo -n "${GIT_VERSION} ${GIT_BUILD_OPTIONS} ${GIT_MESON_BUILD_OPTIONS} ${USE_MESON}"
 ${DEPENDENCY_DIR}/protoc.version: dependency-version | ${DEPENDENCY_DIR}
 	${Q}[ x"$$(cat "$@" 2>/dev/null)" = x"${PROTOC_VERSION} ${PROTOC_BUILD_OPTIONS}" ] || >$@ echo -n "${PROTOC_VERSION} ${PROTOC_BUILD_OPTIONS}"
-${DEPENDENCY_DIR}/git-filter-repo.version: dependency-version | ${DEPENDENCY_DIR}
-	${Q}[ x"$$(cat "$@" 2>/dev/null)" = x"${GIT_FILTER_REPO_VERSION}" ] || >$@ echo -n "${GIT_FILTER_REPO_VERSION}"
+#${DEPENDENCY_DIR}/git-filter-repo.version: dependency-version | ${DEPENDENCY_DIR}
+#	${Q}[ x"$$(cat "$@" 2>/dev/null)" = x"${GIT_FILTER_REPO_VERSION}" ] || >$@ echo -n "${GIT_FILTER_REPO_VERSION}"
 # This target is responsible for checking out Git sources. In theory, we'd only
 # need to depend on the source directory. But given that the source directory
 # always changes when anything inside of it changes, like when we for example
 # build binaries inside of it, we cannot depend on it directly or we'd
 # otherwise try to rebuild all targets depending on it whenever we build
 # something else. We thus depend on the Makefile instead.
-${DEPENDENCY_DIR}/git-%/Makefile: ${DEPENDENCY_DIR}/git-%.version
-	${Q}${GIT} -c init.defaultBranch=master init ${GIT_QUIET} "${@D}"
-	${Q}${GIT} -C "${@D}" config remote.origin.url ${GIT_REPO_URL}
-	${Q}${GIT} -C "${@D}" config remote.origin.tagOpt --no-tags
-	${Q}${GIT} -C "${@D}" fetch --depth 1 ${GIT_QUIET} origin ${GIT_VERSION}
-	${Q}${GIT} -C "${@D}" reset --hard
-	${Q}${GIT} -C "${@D}" checkout ${GIT_QUIET} --detach FETCH_HEAD
-ifeq ($(OVERRIDE_GIT_VERSION),)
-	${Q}rm -f "${@D}"/version
-else
-	@ # We're writing the version into the "version" file in Git's own source
-	@ # directory. If it exists, Git's Makefile will pick it up and use it as
-	@ # the version instead of auto-detecting via git-describe(1).
-	${Q}echo ${OVERRIDE_GIT_VERSION} >"${@D}"/version
-endif
-	${Q}touch $@
+# ${DEPENDENCY_DIR}/git-%/Makefile: ${DEPENDENCY_DIR}/git-%.version
+# 	${Q}${GIT} -c init.defaultBranch=master init ${GIT_QUIET} "${@D}"
+# 	${Q}${GIT} -C "${@D}" config remote.origin.url ${GIT_REPO_URL}
+# 	${Q}${GIT} -C "${@D}" config remote.origin.tagOpt --no-tags
+# 	${Q}${GIT} -C "${@D}" fetch --depth 1 ${GIT_QUIET} origin ${GIT_VERSION}
+# 	${Q}${GIT} -C "${@D}" reset --hard
+# 	${Q}${GIT} -C "${@D}" checkout ${GIT_QUIET} --detach FETCH_HEAD
+# ifeq ($(OVERRIDE_GIT_VERSION),)
+# 	${Q}rm -f "${@D}"/version
+# else
+# 	@ # We're writing the version into the "version" file in Git's own source
+# 	@ # directory. If it exists, Git's Makefile will pick it up and use it as
+# 	@ # the version instead of auto-detecting via git-describe(1).
+# 	${Q}echo ${OVERRIDE_GIT_VERSION} >"${@D}"/version
+# endif
+# 	${Q}touch $@
 
 $(patsubst %,${DEPENDENCY_DIR}/git-\%/build/%,${GIT_EXECUTABLES}): ${DEPENDENCY_DIR}/git-%/Makefile
 	${Q}rm -rf "$(dir ${@D})"/build
@@ -815,14 +814,14 @@ ${DEPENDENCY_DIR}/raftpb: ${DEPENDENCY_D
 	${Q}${GIT} -C "${RAFTPB_SOURCE_DIR}" fetch --depth 1 ${GIT_QUIET} origin main
 	${Q}${GIT} -C "${RAFTPB_SOURCE_DIR}" checkout ${GIT_QUIET} --detach FETCH_HEAD
 
-${GIT_FILTER_REPO}: ${DEPENDENCY_DIR}/git-filter-repo.version | ${BUILD_DIR}/bin
-	${Q}${GIT} -c init.defaultBranch=master init ${GIT_QUIET} "${GIT_FILTER_REPO_SOURCE_DIR}"
-	${Q}${GIT} -C "${GIT_FILTER_REPO_SOURCE_DIR}" config remote.origin.url ${GIT_FILTER_REPO_REPO_URL}
-	${Q}${GIT} -C "${GIT_FILTER_REPO_SOURCE_DIR}" config remote.origin.tagOpt --no-tags
-	${Q}${GIT} -C "${GIT_FILTER_REPO_SOURCE_DIR}" fetch --depth 1 ${GIT_QUIET} origin ${GIT_FILTER_REPO_VERSION}
-	${Q}${GIT} -C "${GIT_FILTER_REPO_SOURCE_DIR}" reset --hard
-	${Q}${GIT} -C "${GIT_FILTER_REPO_SOURCE_DIR}" checkout ${GIT_QUIET} --detach FETCH_HEAD
-	${Q}cp "${GIT_FILTER_REPO_SOURCE_DIR}/git-filter-repo" ${GIT_FILTER_REPO}
+# ${GIT_FILTER_REPO}: ${DEPENDENCY_DIR}/git-filter-repo.version | ${BUILD_DIR}/bin
+# 	${Q}${GIT} -c init.defaultBranch=master init ${GIT_QUIET} "${GIT_FILTER_REPO_SOURCE_DIR}"
+# 	${Q}${GIT} -C "${GIT_FILTER_REPO_SOURCE_DIR}" config remote.origin.url ${GIT_FILTER_REPO_REPO_URL}
+# 	${Q}${GIT} -C "${GIT_FILTER_REPO_SOURCE_DIR}" config remote.origin.tagOpt --no-tags
+# 	${Q}${GIT} -C "${GIT_FILTER_REPO_SOURCE_DIR}" fetch --depth 1 ${GIT_QUIET} origin ${GIT_FILTER_REPO_VERSION}
+# 	${Q}${GIT} -C "${GIT_FILTER_REPO_SOURCE_DIR}" reset --hard
+# 	${Q}${GIT} -C "${GIT_FILTER_REPO_SOURCE_DIR}" checkout ${GIT_QUIET} --detach FETCH_HEAD
+# 	${Q}cp "${GIT_FILTER_REPO_SOURCE_DIR}/git-filter-repo" ${GIT_FILTER_REPO}
 
 # External tools
 ${TOOLS_DIR}/%: ${SOURCE_DIR}/tools/%/tool.go ${SOURCE_DIR}/tools/%/go.mod ${SOURCE_DIR}/tools/%/go.sum | ${TOOLS_DIR}
Index: gitaly-v18.4.0/internal/git/gitcmd/execution_environment.go
===================================================================
--- gitaly-v18.4.0.orig/internal/git/gitcmd/execution_environment.go
+++ gitaly-v18.4.0/internal/git/gitcmd/execution_environment.go
@@ -28,7 +28,7 @@ var (
 			},
 		},
 		{
-			Suffix: "-v2.50",
+			Suffix: "-v2.51",
 		},
 	}
 
openSUSE Build Service is sponsored by