summaryrefslogtreecommitdiff
path: root/.copr/prepare.sh
diff options
context:
space:
mode:
authorSorin Sbarnea <ssbarnea@redhat.com>2019-12-02 16:33:27 +0000
committerSorin Sbarnea <ssbarnea@redhat.com>2019-12-02 16:33:51 +0000
commit3befbb19978c596c4bf4331c29097b6cd4d62ff3 (patch)
tree91a74a099773aeb7b40aaa03de22716f061ead23 /.copr/prepare.sh
parente4275b3453598c3cdcf1ee00ff73c55780aef444 (diff)
downloadpodman-3befbb19978c596c4bf4331c29097b6cd4d62ff3.tar.gz
podman-3befbb19978c596c4bf4331c29097b6cd4d62ff3.tar.bz2
podman-3befbb19978c596c4bf4331c29097b6cd4d62ff3.zip
build: improved prepare.sh
* assure we use bash strict mode * avoid shallow errors on full clones * make script bit more idempotent Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
Diffstat (limited to '.copr/prepare.sh')
-rw-r--r--.copr/prepare.sh17
1 files changed, 12 insertions, 5 deletions
diff --git a/.copr/prepare.sh b/.copr/prepare.sh
index d8ad34d08..713cdc2ee 100644
--- a/.copr/prepare.sh
+++ b/.copr/prepare.sh
@@ -1,12 +1,14 @@
#!/bin/sh -euf
-set -x
+set -euxo pipefail
OS_TEST=${OS_TEST:=0}
if [ ! -e /usr/bin/git ]; then
dnf -y install git-core
fi
-git fetch --unshallow || :
+if [ -f $(git rev-parse --git-dir)/shallow ]; then
+ git fetch --unshallow
+fi
COMMIT=$(git rev-parse HEAD)
COMMIT_SHORT=$(git rev-parse --short=8 HEAD)
@@ -26,7 +28,12 @@ if [ ${OS_TEST} -eq 0 ]; then
sed -i "s/${BR}/${NEWBR}/g" contrib/spec/podman.spec
fi
-mkdir build/
+mkdir -p build/
git archive --prefix "libpod-${COMMIT_SHORT}/" --format "tar.gz" HEAD -o "build/libpod-${COMMIT_SHORT}.tar.gz"
-git clone https://github.com/containers/conmon
-cd conmon && git checkout 6f3572558b97bc60dd8f8c7f0807748e6ce2c440 && git archive --prefix "conmon/" --format "tar.gz" HEAD -o "../build/conmon.tar.gz"
+if [ ! -d conmon ]; then
+ git clone -n --quiet https://github.com/containers/conmon
+fi
+pushd conmon
+git checkout 6f3572558b97bc60dd8f8c7f0807748e6ce2c440
+git archive --prefix "conmon/" --format "tar.gz" HEAD -o "../build/conmon.tar.gz"
+popd