root/build-tools/mirror_rebase/link_cgcs_centos_repo_8

66 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
#
# Part of the monthly mirror update
#
# Update symlinks in cgcs-centos-repo to point to the latest version of packages in /import/mirrors/CentOS/tis-r5-CentOS/newton
#
# Start an edit session for packages to be upgraded - post upgrade version
#
UPVERSION_LOG=$MY_WORKSPACE/upversion.log
if [ "x$WORKING_BRANCH" == "x" ]; then
WORKING_BRANCH=CGCS_DEV_0029_rebase_7_4
fi
if [ ! -f $UPVERSION_LOG ]; then
echo "ERROR: Can't find UPVERSION_LOG at '$UPVERSION_LOG'"
fi
# Restore new symlinks
cd $MY_REPO/cgcs-3rd-party-repo
git checkout $WORKING_BRANCH
if [ $? != 0 ]; then
echo "ERROR: Can't checkout branch '$WORKING_BRANCH' in directory '$MY_REPO/cgcs-3rd-party-repo'"
exit 1
fi
cd $MY_REPO/cgcs-centos-repo
git checkout $WORKING_BRANCH
if [ $? != 0 ]; then
echo "ERROR: Can't checkout branch '$WORKING_BRANCH' in directory '$MY_REPO/cgcs-centos-repo'"
exit 1
fi
FAILED=""
for dat in $(cat $UPVERSION_LOG); do
name=$(echo $dat | awk -F '#' '{print $1}')
srpm_path=$(echo $dat | awk -F '#' '{print $2}')
old_src_rpm=$(echo $dat | awk -F '#' '{print $4}')
new_src_rpm=$(echo $dat | awk -F '#' '{print $5}')
echo "$name $old_src_rpm $new_src_rpm"
if [ "$name" == "kernel" ]; then
build-pkgs --std --edit $name --no-meta-patch
elif [ "$name" == "kernel-rt" ]; then
build-pkgs --rt --edit $name --no-meta-patch
else
build-pkgs --edit $name --no-meta-patch
fi
if [ $? -ne 0 ]; then
echo "ERROR: failed cmd 'build-pkgs --edit $name'"
FAILED="$name $FAILED"
break
fi
echo "$? <=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<="
done
if [ "$FAILED" != "" ]; then
echo "Failed build-pkgs --edit for ... $FAILED"
exit 1
fi