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-local"
23 heimdal_my_wip_url
="/data/heimdal"
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-git https
://github.com
/heimdal
/heimdal.git
44 git remote add lorikeet-heimdal-abartlet
ssh://git.samba.org
/data
/git
/abartlet
/lorikeet-heimdal.git
/.git
45 git remote add lorikeet-heimdal https
://gitlab.com
/samba-team
/devel
/lorikeet-heimdal
46 git remote add
${heimdal_my_wip_name} ${heimdal_my_wip_url}
53 # 2. bring the repository uptodate
55 test x
"$skip_fetch" = x
"yes" ||
{
57 git fetch heimdal-git || bailout $?
58 git fetch lorikeet-heimdal-abartlet || bailout $?
59 git fetch
${heimdal_my_wip_name} || bailout $?
66 # 3. rebase the old_lorikeet_branch on top of heimdals trunk
68 test x
"$skip_rebase" = x
"yes" ||
{
71 git update-ref refs
/heads
/$tmp_lorikeet_branch $old_lorikeet_branch || bailout $?
73 git checkout
$tmp_lorikeet_branch || bailout $?
74 echo "git reset --hard HEAD"
77 git rebase heimdal-git
/master ||
{
78 echo "PS1=\"'git-rebase shell'>\"" > ..
/.bashrc.heimdal_rebase
79 bash
--rcfile ..
/.bashrc.heimdal_rebase ||
{
81 echo "git rebase --abort (just in case)"
86 echo "git rebase --abort (just in case)"
88 echo "Now build and test the lorikeet heimdal tree"
89 echo "and exit with 0 if you want to create a $new_lorikeet_branch branch"
91 echo "PS1=\"'build shell'>\"" > ..
/.bashrc.heimdal_build
92 bash
--rcfile ..
/.bashrc.heimdal_build || bailout $?
93 git branch
$new_lorikeet_branch $tmp_lorikeet_branch || bailout $?
94 echo "branch $new_lorikeet_branch created"