mirror of
https://github.com/containers/podman.git
synced 2025-05-16 22:48:46 +08:00

This fixes multiple trailing quotes after the commit and also ensures the older commit id will be correctly replaced by the newer id. Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
18 lines
416 B
Bash
18 lines
416 B
Bash
#!/usr/bin/env bash
|
|
|
|
# Updates the rpm spec with the upstream git SHA. Works for both copr and koji
|
|
# builds via Packit actions. See .packit.yaml for usage.
|
|
|
|
set -exo pipefail
|
|
|
|
PACKAGE=podman
|
|
|
|
# Set path to rpm spec file
|
|
SPEC_FILE=rpm/$PACKAGE.spec
|
|
|
|
# Get short sha
|
|
GIT_COMMIT=$(git rev-parse HEAD)
|
|
|
|
# Update LDFLAGS to show commit id for Copr builds
|
|
sed -i "s/^GIT_COMMIT=.*/GIT_COMMIT=\"$GIT_COMMIT\"/" $SPEC_FILE
|