3 # Usage copy import-lorikeet.sh and rebase-lorikeet.sh
4 # into an empty directory maybe call it update-heimdal
5 # and don't use it for any other work than importing lorikeet heimdal
8 # These parameter might be changed:
14 # you can pass skip_fetch=yes and/or skip_rebase=yes as env vars
17 # this needs to be reachable from
18 old_lorikeet_branch=$1
20 DATE=`date --utc +%Y%m%d%H%M`
22 heimdal_my_wip_name="heimdal-my-wip"
23 heimdal_my_wip_url="git://git.samba.org/metze/heimdal/wip.git"
25 if test x"$old_lorikeet_branch" = x""; then
26 old_lorikeet_branch="heimdal-metze-wip/lorikeet-heimdal"
29 tmp_lorikeet_branch="lorikeet-heimdal-tmp"
30 new_lorikeet_branch="lorikeet-heimdal-${DATE}"
36 # 1. create a local heimdal repository in the heimdal subdir
40 mkdir heimdal || bailout $?
42 git init || bailout $?
43 git remote add heimdal-svnmirror git://git.samba.org/metze/heimdal/svnmirror.git
44 git remote add heimdal-metze-wip git://git.samba.org/metze/heimdal/wip.git
45 git remote add ${heimdal_my_wip_name} ${heimdal_my_wip_url}
52 # 2. bring the repository uptodate
54 test x"$skip_fetch" = x"yes" || {
56 git fetch heimdal-svnmirror || bailout $?
57 git fetch heimdal-metze-wip || bailout $?
58 git fetch ${heimdal_my_wip_name} || bailout $?
65 # 3. rebase the old_lorikeet_branch on top of heimdals trunk
67 test x"$skip_rebase" = x"yes" || {
70 git update-ref refs/heads/$tmp_lorikeet_branch $old_lorikeet_branch || bailout $?
72 git checkout $tmp_lorikeet_branch || bailout $?
73 echo "git reset --hard HEAD"
76 git rebase heimdal-svnmirror/trunk || {
77 echo "PS1=\"'git-rebase shell'>\"" > ../.bashrc.heimdal_rebase
78 bash --rcfile ../.bashrc.heimdal_rebase || {
80 echo "git rebase --abort (just in case)"
85 echo "git rebase --abort (just in case)"
87 echo "Now build and test the lorikeet heimdal tree"
88 echo "and exit with 0 if you want to create a $new_lorikeet_branch branch"
90 echo "PS1=\"'build shell'>\"" > ../.bashrc.heimdal_build
91 bash --rcfile ../.bashrc.heimdal_build || bailout $?
92 git branch $new_lorikeet_branch $tmp_lorikeet_branch || bailout $?
93 echo "branch $new_lorikeet_branch created"