2021-11-09 09:52:08 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# This script assures we always deliver the current documentation/configs
|
|
|
|
# for the c/storage, c/image and c/common vendored in podman, skopeo, buildah
|
|
|
|
# For questions reach to Jindrich Novy <jnovy@redhat.com>
|
|
|
|
rm -f /tmp/ver_image /tmp/ver_common /tmp/ver_storage
|
|
|
|
CENTOS=""
|
|
|
|
pwd | grep /tmp/centos > /dev/null
|
|
|
|
if [ $? == 0 ]; then
|
|
|
|
CENTOS=1
|
2023-11-15 10:13:38 +00:00
|
|
|
PKG=centpkg
|
|
|
|
else
|
|
|
|
PKG=rhpkg
|
2021-11-09 09:52:08 +00:00
|
|
|
fi
|
2022-02-01 20:12:39 +00:00
|
|
|
set -e
|
2021-11-09 09:52:08 +00:00
|
|
|
for P in podman skopeo buildah; do
|
|
|
|
BRN=`pwd | sed 's,^.*/,,'`
|
|
|
|
rm -rf $P
|
2023-11-15 10:13:38 +00:00
|
|
|
$PKG clone $P
|
2021-11-09 09:52:08 +00:00
|
|
|
cd $P
|
2023-11-15 10:13:38 +00:00
|
|
|
$PKG switch-branch $BRN
|
|
|
|
cache_deploy
|
2021-11-09 09:52:08 +00:00
|
|
|
if [ $BRN != stream-container-tools-rhel8 ]; then
|
2023-11-15 10:13:38 +00:00
|
|
|
$PKG prep
|
2021-11-09 09:52:08 +00:00
|
|
|
else
|
2023-11-15 10:13:38 +00:00
|
|
|
$PKG --release rhel-8 prep
|
2021-11-09 09:52:08 +00:00
|
|
|
fi
|
2023-11-15 10:13:38 +00:00
|
|
|
DIR=`ls -d -- */ | grep "$P"`
|
2023-05-16 06:10:31 +00:00
|
|
|
grep github.com/containers/image $DIR/go.mod | cut -d\ -f2 | sed 's,-.*,,'>> /tmp/ver_image
|
|
|
|
grep github.com/containers/common $DIR/go.mod | cut -d\ -f2 | sed 's,-.*,,' >> /tmp/ver_common
|
|
|
|
grep github.com/containers/storage $DIR/go.mod | cut -d\ -f2 | sed 's,-.*,,' >> /tmp/ver_storage
|
2021-11-09 09:52:08 +00:00
|
|
|
cd -
|
|
|
|
done
|
|
|
|
IMAGE_VER=`sort -n /tmp/ver_image | head -n1`
|
|
|
|
COMMON_VER=`sort -n /tmp/ver_common | head -n1`
|
|
|
|
STORAGE_VER=`sort -n /tmp/ver_storage | head -n1`
|
|
|
|
sed -i "s,^%global.*image_branch.*,%global image_branch $IMAGE_VER," containers-common.spec
|
|
|
|
sed -i "s,^%global.*common_branch.*,%global common_branch $COMMON_VER," containers-common.spec
|
|
|
|
sed -i "s,^%global.*storage_branch.*,%global storage_branch $STORAGE_VER," containers-common.spec
|
|
|
|
rm -f /tmp/ver_image /tmp/ver_common /tmp/ver_storage
|
|
|
|
rm -rf podman skopeo buildah
|