Commit 833e6356 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add kernel source repo checkout, update existing branches

parent 59cf4288
#!/bin/sh -x
#!/bin/bash -x
# creates new branch for the major kernel version or update such branch
fatal()
{
......@@ -6,21 +8,52 @@ fatal()
exit 1
}
ECSOURCE=../../etercifs-source
MERGEOPT="--no-edit"
MV="$1"
[ -n "$MV" ] || fatal
[ -n "$MV" ] || fatal "Run with version, f.i. ./update_git.sh 4.11"
KTAG=v$MV
KBRANCH=linux-$MV.y
ELIST="etersoft-common etersoft-share-flags etersoft-wine"
cd ../../cifs-2.6 || fatal
if [ ! -d $ECSOURCE ] ; then
cd $(dirname $ECSOURCE) || fatal
git clone https://gitlab.eterfund.ru/etersoft/etercifs-source.git || fatal
cd etercifs-source || fatal
git remote add upstream https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
else
cd $ECSOURCE || fatal
fi
git fetch upstream
git tag | grep "$KTAG" || fatal "There is no $KTAG tag in the git repo."
if git branch | grep -q $KTAG-etercifs ; then
LASTTAG=$(git describe --tags upstream/$KBRANCH) || fatal
echo "Just update branch $KTAG-etercifs to latest commit from $KBRANCH with tag $LASTTAG"
git checkout $KTAG-etercifs || fatal
#git merge $MERGEOPT upstream/$KBRANCH || fatal
git merge $MERGEOPT $LASTTAG || fatal
exit
fi
echo
echo "Update branches..."
for i in $ELIST ; do
git checkout $i || fatal
git merge $MV || fatal
git merge $MERGEOPT $KTAG || fatal
done
# create branch from tag
git checkout -b $MV-etercifs $MV || fatal
echo
echo "Create branch from the tag and merge all to it..."
git checkout -b $MV-etercifs $KTAG || fatal
for i in $ELIST ; do
git merge $i || fatal
git merge $MERGEOPT $i || fatal
done
echo "You are in branch $MV-etercifs, copy fs/cifs to "
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment