-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix marking repo dir for COPR as safe 5
Signed-off-by: Martin Perina <mperina@redhat.com>
- Loading branch information
Showing
1 changed file
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,27 @@ | ||
.PHONY: installdeps srpm | ||
.PHONY: installdeps srpm git_config_pre create_srpm git_config_post | ||
|
||
installdeps: | ||
dnf -y install git | ||
|
||
srpm: installdeps | ||
git_config_pre: | ||
# From git 2.35.2 we need to mark temporary directory, where the project is cloned to, as safe, otherwise | ||
# git commands won't work, and the remove afterwards to make git user config clean | ||
$(eval REPO_DIR=$(shell pwd)) | ||
git config --global --add safe.directory ${REPO_DIR} | ||
|
||
create_srpm: | ||
$(eval SUFFIX=.git$(shell git rev-parse --short HEAD)) | ||
echo ${SUFFIX} | ||
git config --global --unset safe.directory ${REPO_DIR} | ||
# changing the spec file as passing -D won't preserve the suffix when rebuilding in mock | ||
sed "s:%{?release_suffix}:${SUFFIX}:" -i ovirt-engine.spec.in | ||
mkdir -p tmp.repos/SOURCES | ||
make dist | ||
rpmbuild \ | ||
-D "_topdir tmp.repos" \ | ||
-ts ./*.tar.gz | ||
|
||
git_config_post: | ||
git config --global --unset safe.directory ${REPO_DIR} | ||
|
||
srpm: installdeps git_config_pre create_srpm git_config_post | ||
cp tmp.repos/SRPMS/*.src.rpm $(outdir) |