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 # You need to pass the name of the lorikeet branch
9 # within the heimdal/ repository as first argument.
11 # You can pass skip_fetch=yes, skip_create=yes, skip_build=yes, skip_test=yes
15 DATE
=`date --utc +%Y%m%d%H%M`
18 tmp_samba_branch
="import-lorikeet-tmp"
19 new_samba_branch
="import-${lorikeet_branch}"
20 samba_master_branch
="$2"
21 test -n "$samba_master_branch" ||
{
22 samba_master_branch
="origin/master"
25 export CC
="ccache gcc"
31 # 1. check if the heimdal repository created with rebase-lorikeet.sh already
39 test -n "$lorikeet_branch" ||
{
40 echo "usage: $0 <lorikeet-branch> [<samba-branch>]"
47 # 2. initialize the samba repository in the samba subdir
50 mkdir samba || bailout $?
52 git init || bailout $?
53 git remote add origin https
://git.samba.org
/samba.git
54 git remote add local-heimdal ..
/heimdal
61 # 3. bring the repository uptodate
63 test x
"$skip_fetch" = x
"yes" ||
{
65 git fetch origin || bailout $?
66 git fetch local-heimdal || bailout $?
74 # It would be good if you have a lex:yacc combination which can rebuild this
79 test x
"$skip_build" = x
"yes" ||
{
80 .
/configure.developer ||
return $?
82 test x
"$skip_test" = x
"yes" ||
{
83 TDB_NO_FSYNC
=1 make -j test ||
return $?
91 test x
"$skip_create" = x
"yes" ||
{
93 lorikeet_commit
=`git log -1 local-heimdal/$lorikeet_branch | head -1 | cut -d ' ' -f2`
94 echo "local-heimdal/$lorikeet_branch => commit:$lorikeet_commit"
96 git update-ref refs
/heads
/$tmp_samba_branch $samba_master_branch || bailout $?
98 git checkout
$tmp_samba_branch || bailout $?
99 echo "git reset --hard HEAD"
100 git
reset --hard HEAD
101 echo "git clean -d -x -f"
103 echo "git read-tree..."
104 git read-tree
-u --prefix=source4/heimdal-new
/ local-heimdal
/$lorikeet_branch || bailout $?
105 echo "git reset --mixed HEAD"
106 git
reset --mixed HEAD
107 echo "swap old -> new"
108 mv source4/heimdal
source4/heimdal-old || bailout $?
109 rsync
-a source4/heimdal-new
/ source4/heimdal || bailout $?
110 # echo "PS1=\"'import-heimdal shell'>\"" > ../.bashrc.samba_create
111 # bash --rcfile ../.bashrc.samba_create
113 echo "add changed files to the index"
114 git add
-u source4/heimdal
115 echo "commit the changed files blindly"
116 git commit
--no-verify -m "s4:heimdal: import $lorikeet_branch (commit $lorikeet_commit)"
117 echo "cleanup source4/heimdal"
118 rm -rf source4/heimdal
119 git checkout
source4/heimdal
120 echo "try to build samba"
123 echo "Now build the tree and make it compile."
124 echo "Missing files can be copied from source4/heimdal-new/"
125 echo "Also run make test!"
128 echo "Then do a 'git add source4/heimdal' and a 'git commit --amend'"
129 echo "and write a useful commit message..."
130 echo "Then commit all needed changes outside of source4/heimdal"
131 echo "maybe splitted into multiple commits."
135 echo "if you this shell exit with 0, then $new_samba_branch will be created"
137 echo "PS1=\"'import-heimdal shell'>\"" > ..
/.bashrc.samba_create
138 bash
--rcfile ..
/.bashrc.samba_create || bailout $?
139 git branch
$new_samba_branch $tmp_samba_branch || bailout $?
140 echo "branch $new_samba_branch created"