8 import_upstream.sh
- Import HomeBank from upstream
12 .
/maint
/import_upstream.sh BRANCH
14 # import the latest release on the 5.1.x branch
15 .
/maint
/import_upstream.sh
5.1.x
19 This
script downloads the latest HomeBank release on a given branch and adds
20 that release to the
local C
<upstream
> branch.
24 export GIT_AUTHOR_NAME
='Maxime Doyen'
25 export GIT_AUTHOR_EMAIL
='homebank@free.fr'
31 if [ -z "$branch_bzr" ]
33 echo >&2 "$0: Must specify homebank branch (e.g. \"5.1.x\")"
40 cleanup
='rm -rf "$branch_bzr"'
43 bzr branch
"lp:homebank/$branch_bzr" "$branch_bzr"
46 hb_version
=$(perl <"$branch_bzr/src/homebank.h" -ne 's/#define HB_VERSION\s+"(.*)"/$1/ && print')
47 if [ -z "$hb_version" ]
49 echo >&2 "$0: Cannot determine homebank version
"
53 cp .gitignore "$branch_bzr/"
55 # commit new version of homebank
57 tree_ref=$(git write-tree --prefix="$branch_bzr/")
58 git reset "$branch_bzr"
59 parent_ref=$(git rev-parse "$branch_git")
60 commit_ref=$(git commit-tree -m "import homebank-$hb_version" -p $parent_ref $tree_ref)
63 git branch -f "$branch_git" $commit_ref