diff --git a/.packit.yaml b/.packit.yaml index 3e7827fbf3..37be3fda7e 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -44,8 +44,8 @@ srpm_build_deps: - make actions: - fix-spec-file: "bash .packit-copr-rpm.sh" - pre-sync: "bash .packit-rpm-git-commit.sh" + fix-spec-file: "bash contrib/packit-tmt/packit-copr-rpm.sh" + pre-sync: "bash contrib/packit-tmt/packit-rpm-git-commit.sh" jobs: - job: copr_build diff --git a/.packit-copr-rpm.sh b/contrib/packit-tmt/packit-copr-rpm.sh similarity index 78% rename from .packit-copr-rpm.sh rename to contrib/packit-tmt/packit-copr-rpm.sh index 9200eaf6e5..ace24b916a 100644 --- a/.packit-copr-rpm.sh +++ b/contrib/packit-tmt/packit-copr-rpm.sh @@ -6,16 +6,19 @@ set -exo pipefail -. .packit-rpm-git-commit.sh +TOP_GIT_DIR=$(git rev-parse --show-toplevel) + +. "$TOP_GIT_DIR"/contrib/packit-tmt/packit-rpm-git-commit.sh # Get Version from HEAD VERSION=$(grep '^const RawVersion' version/rawversion/version.go | cut -d\" -f2) # RPM Version can't take "-" -RPM_VERSION=$(echo $VERSION | sed -e 's/-/~/') +# shellcheck disable=SC2001 +RPM_VERSION=$(echo "$VERSION" | sed -e 's/-/~/') # Generate source tarball from HEAD -git-archive-all -C $(git rev-parse --show-toplevel) --prefix=$PACKAGE-$VERSION/ rpm/$PACKAGE-$VERSION.tar.gz +git-archive-all -C "$TOP_GIT_DIR" --prefix="$PACKAGE-$VERSION/" "$TOP_GIT_DIR/rpm/$PACKAGE-$VERSION.tar.gz" # RPM Spec modifications diff --git a/.packit-rpm-git-commit.sh b/contrib/packit-tmt/packit-rpm-git-commit.sh similarity index 100% rename from .packit-rpm-git-commit.sh rename to contrib/packit-tmt/packit-rpm-git-commit.sh