Merge lp:~cv.clearcorp/oerptools/faster-repo-build into lp:oerptools/1.0

Proposed by Carlos Vásquez (ClearCorp)
Status: Merged
Merged at revision: 299
Proposed branch: lp:~cv.clearcorp/oerptools/faster-repo-build
Merge into: lp:oerptools/1.0
Diff against target: 206 lines (+123/-3)
4 files modified
devel-scripts/openerp-src/openerp-src-make.sh (+29/-0)
devel-scripts/openerp-src/openerp-src-parent-locations.sh (+5/-0)
devel-scripts/openerp-src/openerp-src-update.sh (+52/-2)
openerp-scripts/openerp-lib.sh (+37/-1)
To merge this branch: bzr merge lp:~cv.clearcorp/oerptools/faster-repo-build
Reviewer Review Type Date Requested Status
Carlos Vásquez (ClearCorp) Pending
Review via email: mp+97549@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'devel-scripts/openerp-src/openerp-src-make.sh'
2--- devel-scripts/openerp-src/openerp-src-make.sh 2012-03-02 18:30:42 +0000
3+++ devel-scripts/openerp-src/openerp-src-make.sh 2012-03-15 00:52:20 +0000
4@@ -33,6 +33,33 @@
5 echo ""
6 }
7
8+function mkrepo {
9+
10+ REPO_DIR=$OPENERP_REPO_BASE/openerp-src/src/openerp
11+
12+ if [ -d $REPO_DIR ]; then
13+ echo "repository already exists, delete before running the script to recreate"
14+ echo $REPO_DIR
15+ else
16+ echo "bzr init-repo $REPO_DIR"
17+ bzr init-repo $REPO_DIR
18+
19+ mkdir $REPO_DIR/trunk
20+
21+ echo "bzr branch $OPENERP_REPO_BASE/openobject-server/main/trunk-ccorp $REPO_DIR/trunk/openobject-server"
22+ bzr branch $OPENERP_REPO_BASE/openobject-server/main/trunk-ccorp $REPO_DIR/trunk/openobject-server
23+ echo "parent_location = http://bazaar.launchpad.net/~clearcorp/openobject-server/trunk-ccorp" > $REPO_DIR/trunk/openobject-server/.bzr/branch/branch.conf
24+
25+ echo "bzr branch $OPENERP_REPO_BASE/openerp-web/main/trunk-ccorp $REPO_DIR/trunk/openerp-web"
26+ bzr branch $OPENERP_REPO_BASE/openerp-web/main/trunk-ccorp $REPO_DIR/trunk/openerp-web
27+ echo "parent_location = http://bazaar.launchpad.net/~clearcorp/openerp-web/trunk-ccorp" > $REPO_DIR/trunk/openerp-web/.bzr/branch/branch.conf
28+
29+ echo "bzr branch $OPENERP_REPO_BASE/openobject-addons/main/trunk-ccorp $REPO_DIR/trunk/openobject-addons"
30+ bzr branch $OPENERP_REPO_BASE/openobject-addons/main/trunk-ccorp $REPO_DIR/trunk/openobject-addons
31+ echo "parent_location = http://bazaar.launchpad.net/~clearcorp/openobject-addons/trunk-ccorp" > $REPO_DIR/trunk/openobject-addons/.bzr/branch/branch.conf
32+ fi
33+}
34+
35 branch_project openobject-server 5.0 5.0-ccorp openobject-server
36 branch_project openobject-server 6.0 6.0-ccorp openobject-server
37 branch_project openobject-server 6.1 6.1-ccorp openobject-server
38@@ -56,3 +83,5 @@
39 branch_project openobject-client-web 6.0 6.0-ccorp openobject-client-web
40 branch_project openerp-web 6.1 6.1-ccorp openerp-web
41 branch_project openerp-web trunk trunk-ccorp openerp-web
42+
43+mkrepo
44
45=== modified file 'devel-scripts/openerp-src/openerp-src-parent-locations.sh'
46--- devel-scripts/openerp-src/openerp-src-parent-locations.sh 2012-03-02 18:30:42 +0000
47+++ devel-scripts/openerp-src/openerp-src-parent-locations.sh 2012-03-15 00:52:20 +0000
48@@ -31,3 +31,8 @@
49 echo "parent_location = http://bazaar.launchpad.net/~clearcorp/openobject-client-web/6.0-ccorp" > $REPO_DIR/6.0/openobject-client-web/.bzr/branch/branch.conf
50 echo "parent_location = http://bazaar.launchpad.net/~clearcorp/openerp-web/6.1-ccorp" > $REPO_DIR/6.1/openerp-web/.bzr/branch/branch.conf
51 echo "parent_location = http://bazaar.launchpad.net/~clearcorp/openerp-web/trunk-ccorp" > $REPO_DIR/trunk/openerp-web/.bzr/branch/branch.conf
52+
53+
54+echo "parent_location = http://bazaar.launchpad.net/~clearcorp/openobject-server/trunk-ccorp" > $REPO_DIR/openerp/trunk/openobject-server/.bzr/branch/branch.conf
55+echo "parent_location = http://bazaar.launchpad.net/~clearcorp/openerp-web/trunk-ccorp" > $REPO_DIR/openerp/trunk/openerp-web/.bzr/branch/branch.conf
56+echo "parent_location = http://bazaar.launchpad.net/~clearcorp/openobject-addons/trunk-ccorp" > $REPO_DIR/openerp/trunk/openobject-addons/.bzr/branch/branch.conf
57
58=== modified file 'devel-scripts/openerp-src/openerp-src-update.sh'
59--- devel-scripts/openerp-src/openerp-src-update.sh 2012-03-01 16:57:38 +0000
60+++ devel-scripts/openerp-src/openerp-src-update.sh 2012-03-15 00:52:20 +0000
61@@ -36,8 +36,55 @@
62 echo "COMPRESS $1/$2"
63
64 cd $OPENERP_REPO_BASE/openerp-src/src
65- rm $OPENERP_REPO_BASE/openerp-src/bin/$1/$2.tgz
66- tar czf $OPENERP_REPO_BASE/openerp-src/bin/$1/$2.tgz $1/$2/
67+ tar czf $OPENERP_REPO_BASE/openerp-src/bin/$1/$2.tmp.tgz $1/$2/
68+ if [[ $? != 0 ]]; then
69+ echo "tar exited with error code $?, skipping the file"
70+ else
71+ echo "tar OK, moving the file"
72+ mv $OPENERP_REPO_BASE/openerp-src/bin/$1/$2.tmp.tgz $OPENERP_REPO_BASE/openerp-src/bin/$1/$2.tgz
73+ fi
74+}
75+
76+function update_repo {
77+ # $1:
78+
79+ REPO_DIR=$OPENERP_REPO_BASE/openerp-src/src
80+
81+ echo ""
82+ echo ""
83+ echo "UPDATE $REPO_DIR/openerp"
84+ echo "--------------------------------------------------------------"
85+ echo ""
86+ echo "Updating branch trunk/openobject-server"
87+ cd $REPO_DIR/openerp/trunk/openobject-server
88+ bzr pull
89+ echo ""
90+ echo "Updating branch trunk/openerp-web"
91+ cd $REPO_DIR/openerp/trunk/openerp-web
92+ bzr pull
93+ echo ""
94+ echo "Updating branch trunk/openobject-addons"
95+ cd $REPO_DIR/openerp/trunk/openobject-addons
96+ bzr pull
97+}
98+
99+function compress_repo {
100+ # $1:
101+
102+ REPO_DIR=$OPENERP_REPO_BASE/openerp-src/src
103+
104+ echo ""
105+ echo ""
106+ echo "COMPRESS $REPO_DIR/openerp"
107+
108+ cd $REPO_DIR
109+ tar czf $OPENERP_REPO_BASE/openerp-src/bin/openerp.tmp.tgz openerp/.bzr
110+ if [[ $? != 0 ]]; then
111+ echo "tar exited with error code $?, skipping the file"
112+ else
113+ echo "tar OK, moving the file"
114+ mv $OPENERP_REPO_BASE/openerp-src/bin/openerp.tmp.tgz $OPENERP_REPO_BASE/openerp-src/bin/openerp.tgz
115+ fi
116 }
117
118 update_project openobject-server 5.0 5.0-ccorp openobject-server
119@@ -89,3 +136,6 @@
120 compress_project 6.0 openobject-client-web
121 compress_project 6.1 openerp-web
122 compress_project trunk openerp-web
123+
124+update_repo
125+compress_repo
126
127=== modified file 'openerp-scripts/openerp-lib.sh'
128--- openerp-scripts/openerp-lib.sh 2012-03-04 04:33:40 +0000
129+++ openerp-scripts/openerp-lib.sh 2012-03-15 00:52:20 +0000
130@@ -153,6 +153,7 @@
131 if [[ $branch =~ "6.1" ]] || [[ $branch =~ "trunk" ]]; then
132 # Dependencies
133 packages+=(python-werkzeug)
134+ install_werkzeug=1
135 packages+=(python-zsi)
136
137 # Recomended
138@@ -188,6 +189,7 @@
139 if [[ $branch =~ "6.1" ]] || [[ $branch =~ "trunk" ]]; then
140 # Dependencies
141 packages+=(python-werkzeug)
142+ install_werkzeug=1
143
144 # Recomended
145 packages+=(python-mock) # For testing
146@@ -199,6 +201,11 @@
147 # Install packages
148 log_echo "apt-get -qy install ${packages[*]}"
149 apt-get -qy install ${packages[*]} >> $INSTALL_LOG_FILE
150+
151+ # werkzeug verion in lucid is too old.
152+ if [[ $dist =~ "lucid" ]] && [[ $install_werkzeug == 1 ]]; then
153+ easy_install -U werkzeug >> $INSTALL_LOG_FILE
154+ fi
155 }
156
157 function install_bzr {
158@@ -244,9 +251,15 @@
159 mkdir -p /srv/openerp/$branch/src >> $INSTALL_LOG_FILE
160 cd /srv/openerp/$branch/src >> $INSTALL_LOG_FILE
161 if [ -e $1 ]; then
162+ log_echo "$branch/$1 exists, updating"
163 cd $1 >> $INSTALL_LOG_FILE
164+ log_echo "bzr pull"
165 bzr pull >> $INSTALL_LOG_FILE
166+ elif [[ $repo_downloaded =~ ^[Yy]$ ]] && [[ $1 =~ ^openobject-server|openerp-web|openobject-addons$ ]]; then
167+ log_echo "bzr branch lp:~clearcorp/$2/$3 $1"
168+ bzr branch lp:~clearcorp/$2/$3 $1 >> $INSTALL_LOG_FILE
169 else
170+ log_echo "Downloading $branch/$1 from code.clearcorp.co.cr"
171 mkdir -p /usr/local/src/openerp/$branch >> $INSTALL_LOG_FILE
172 cd /usr/local/src/openerp/$branch >> $INSTALL_LOG_FILE
173 if [[ ! -f $1.tgz ]]; then
174@@ -280,8 +293,31 @@
175 log_echo ""
176 }
177
178+function download_repo {
179+ # $1: sources branch
180+ # $2: launchpad project
181+ # $3: launchpad branch
182+ # Download branch latest release.
183+ log_echo "Downloading latest openerp repository..."
184+ mkdir -p /usr/local/src/openerp >> $INSTALL_LOG_FILE
185+ cd /usr/local/src/openerp >> $INSTALL_LOG_FILE
186+ if [[ ! -f openerp.tgz ]]; then
187+ wget http://code.clearcorp.co.cr/bzr/openerp/openerp-src/bin/openerp.tgz >> $INSTALL_LOG_FILE
188+ fi
189+ cd /srv >> $INSTALL_LOG_FILE
190+ tar xzf /usr/local/src/openerp/openerp.tgz >> $INSTALL_LOG_FILE
191+ repo_downloaded="y"
192+ log_echo ""
193+}
194+
195 function download_openerp {
196- bzr init-repo /srv/openerp
197+ log_echo "Creating /srv/openerp repository"
198+ if [ -d /srv/openerp ]; then
199+ log_echo "/srv/openerp already exists"
200+ else
201+ download_repo
202+ fi
203+
204 if [[ $branch == "5.0" ]] || [[ $branch == "6.0" ]] || [[ $branch == "6.1" ]] || [[ $branch == "trunk" ]]; then
205 download_openerp_branch openobject-server openobject-server $branch-ccorp
206 if [[ $install_openerp_addons =~ ^[Yy]$ ]]; then

Subscribers

People subscribed via source and target branches