iop: update_feed_branches: Remove script

It was used to update branches of feeds according to the commit hashes
in feeds.conf. Mostly used when doing release branches for the
first time. We do it manually now, so it is not needed anymore.
This commit is contained in:
Piotr Kubik 2024-10-02 13:44:30 +02:00
parent ed78a58455
commit a09f5a3ba6
2 changed files with 1 additions and 62 deletions

View file

@ -36,7 +36,7 @@ _iop()
feeds_update genconfig \
generate_tarballs install_key \
scp_changes setup_host ssh_install_key status \
update_feed_branches ssh_upgrade smoketest"
ssh_upgrade smoketest"
if [ $COMP_CWORD -eq 1 ] ; then

View file

@ -1,61 +0,0 @@
#!/bin/sh
# Exported interface
function update_feed_branches {
local release="$1"
local ipath="$(pwd)"
local branch="$2"
local curbranch
[ -n "$release" ] || {
echo "Usage: ./update_feeds <RELEASE> <BRANCH>"
echo ""
echo "If you do not give a branch as argument,"
echo "<RELEASE> branch will be updated to commit"
echo "hash given in feeds.conf for each feed repo"
exit 1
}
if [ -n "$branch" ]; then
echo "Updating release branch $release to specific commit hash given in feeds.conf for each feed repo at branch $branch"
if git diff-index --quiet HEAD; then
curbranch=`git symbolic-ref HEAD 2>/dev/null`
curbranch=${curbranch##refs/heads/}
if [ -z $curbranch ]; then
curbranch=`git log -1 --pretty=format:"%H"`
fi
git checkout $branch || {
echo "couldn't checkout branch $branch"
exit 99
}
else
echo "You have unsaved changes."
exit 99
fi
else
echo "Updating release branch $release to specific commit hash given in feeds.conf for each feed repo"
fi
ifeeds="$(grep -r 'dev.iopsys.eu' feeds.conf | awk '{print$2}' | tr '\n' ' ')"
for f in $ifeeds; do
commith=$(grep $f feeds.conf | cut -d'^' -f2)
cd $ipath/feeds/$f
git branch -D $release 2>/dev/null
echo "$f: updating release branch $release to commit $commith"
git checkout $commith
git push origin :$release
git checkout -b $release
git push --set-upstream origin $release
cd $ipath
done
if [ -n "$branch" ]; then
echo "Release branch $release is updated to specific commit hash given in feeds.conf in in branch $branch for each feed repo"
git checkout $curbranch
else
echo "Release branch $release is updated to specific commit hash given in feeds.conf for each feed repo"
fi
}
register_command "update_feed_branches" "<release> [branch] Update branches in feeds from the current top level commit or specified top level branch"