File: .packit-rpm-git-commit.sh

package info (click to toggle)
podman 5.7.0%2Bds2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 23,824 kB
  • sloc: sh: 4,699; python: 2,798; perl: 1,885; ansic: 1,484; makefile: 977; ruby: 42; csh: 8
file content (17 lines) | stat: -rw-r--r-- 416 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/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