1 |
commit: 4493c3698b25fab4c0c6c497593752226c694503 |
2 |
Author: Magnus Granberg <zorry <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 29 15:55:38 2012 +0000 |
4 |
Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 29 15:55:38 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/zorry.git;a=commit;h=4493c369 |
7 |
|
8 |
adding updatedb to job host deamon part3 |
9 |
|
10 |
--- |
11 |
ebuild/dev-python/gobs/gobs-9999.ebuild | 10 ++-------- |
12 |
gobs/bin/gobs_host_jobs | 1 + |
13 |
gobs/bin/{gobs_host_jobs => gobs_host_jobs~} | 0 |
14 |
gobs/pym/sync.py | 8 ++++---- |
15 |
gobs/pym/{sync.py => sync.py~} | 8 ++++---- |
16 |
gobs/pym/updatedb.py | 7 ++++--- |
17 |
gobs/pym/{updatedb.py => updatedb.py~} | 7 ++++--- |
18 |
7 files changed, 19 insertions(+), 22 deletions(-) |
19 |
|
20 |
diff --git a/ebuild/dev-python/gobs/gobs-9999.ebuild b/ebuild/dev-python/gobs/gobs-9999.ebuild |
21 |
index 5430529..1a6fc3d 100644 |
22 |
--- a/ebuild/dev-python/gobs/gobs-9999.ebuild |
23 |
+++ b/ebuild/dev-python/gobs/gobs-9999.ebuild |
24 |
@@ -26,12 +26,6 @@ DEPEND="${RDEPEND} |
25 |
# RESTRICT_PYTHON_ABIS="3.*" |
26 |
|
27 |
EGIT_REPO_URI="http://git.overlays.gentoo.org/gitroot/dev/zorry.git" |
28 |
-#EGIT_FETCH_CMD="git clone" |
29 |
-##EGIT_BRANCH="master" |
30 |
-##EGIT_COMMIT=${EGIT_BRANCH} |
31 |
-# The eclass is based on subversion eclass. |
32 |
-# If you use this eclass, the ${S} is ${WORKDIR}/${P}. |
33 |
-# It is necessary to define the EGIT_REPO_URI variable at least. |
34 |
|
35 |
PYTHON_MODNAME="gobs" |
36 |
|
37 |
@@ -40,9 +34,9 @@ src_install() { |
38 |
dodir etc/gobs || die |
39 |
insinto /etc/gobs |
40 |
doins ${FILESDIR}/gobs.conf || die |
41 |
- dobin ${S}/gobs/bin/gobs_updatedb || die |
42 |
+ dobin ${S}/gobs/sbin/gobs_host_jobs || die |
43 |
dobin ${S}/gobs/bin/gobs_setup_profile || die |
44 |
- dosbin ${S}/gobs/bin/gobs_buildquerys || die |
45 |
+ dosbin ${S}/gobs/sbin/gobs_buildquerys || die |
46 |
dodoc ${S}/gobs/sql/pgdump.sql.gz || die |
47 |
dodoc ${S}/gobs/doc/Setup.txt || die |
48 |
|
49 |
|
50 |
diff --git a/gobs/bin/gobs_host_jobs b/gobs/bin/gobs_host_jobs |
51 |
index 87e856e..c5d80a1 100755 |
52 |
--- a/gobs/bin/gobs_host_jobs |
53 |
+++ b/gobs/bin/gobs_host_jobs |
54 |
@@ -50,6 +50,7 @@ def main(): |
55 |
repeat = False |
56 |
CM.putConnection(conn) |
57 |
time.sleep(60) |
58 |
+ CM.closeAllConnections() |
59 |
|
60 |
if __name__ == "__main__": |
61 |
main() |
62 |
\ No newline at end of file |
63 |
|
64 |
diff --git a/gobs/bin/gobs_host_jobs b/gobs/bin/gobs_host_jobs~ |
65 |
similarity index 100% |
66 |
copy from gobs/bin/gobs_host_jobs |
67 |
copy to gobs/bin/gobs_host_jobs~ |
68 |
|
69 |
diff --git a/gobs/pym/sync.py b/gobs/pym/sync.py |
70 |
index 20d8420..a39ff4d 100644 |
71 |
--- a/gobs/pym/sync.py |
72 |
+++ b/gobs/pym/sync.py |
73 |
@@ -33,13 +33,13 @@ def sync_tree(): |
74 |
tmpcmdline = [] |
75 |
tmpcmdline.append("--sync") |
76 |
tmpcmdline.append("--quiet") |
77 |
- tmpcmdline.append("--config_root=" + default_config_root) |
78 |
- print("tmpcmdline:" + tmpcmdline) |
79 |
+ tmpcmdline.append("--config-root=" + default_config_root) |
80 |
logging.info("Emerge --sync") |
81 |
- fail_sync = 0 |
82 |
+ fail_sync = False |
83 |
#fail_sync = emerge_main(args=tmpcmdline) |
84 |
if fail_sync is True: |
85 |
logging.warning("Emerge --sync fail!") |
86 |
+ return False |
87 |
else: |
88 |
logging.info("Emerge --sync ... Done.") |
89 |
- return |
90 |
+ return True |
91 |
|
92 |
diff --git a/gobs/pym/sync.py b/gobs/pym/sync.py~ |
93 |
similarity index 91% |
94 |
copy from gobs/pym/sync.py |
95 |
copy to gobs/pym/sync.py~ |
96 |
index 20d8420..a39ff4d 100644 |
97 |
--- a/gobs/pym/sync.py |
98 |
+++ b/gobs/pym/sync.py~ |
99 |
@@ -33,13 +33,13 @@ def sync_tree(): |
100 |
tmpcmdline = [] |
101 |
tmpcmdline.append("--sync") |
102 |
tmpcmdline.append("--quiet") |
103 |
- tmpcmdline.append("--config_root=" + default_config_root) |
104 |
- print("tmpcmdline:" + tmpcmdline) |
105 |
+ tmpcmdline.append("--config-root=" + default_config_root) |
106 |
logging.info("Emerge --sync") |
107 |
- fail_sync = 0 |
108 |
+ fail_sync = False |
109 |
#fail_sync = emerge_main(args=tmpcmdline) |
110 |
if fail_sync is True: |
111 |
logging.warning("Emerge --sync fail!") |
112 |
+ return False |
113 |
else: |
114 |
logging.info("Emerge --sync ... Done.") |
115 |
- return |
116 |
+ return True |
117 |
|
118 |
diff --git a/gobs/pym/updatedb.py b/gobs/pym/updatedb.py |
119 |
index 738179f..bd73602 100755 |
120 |
--- a/gobs/pym/updatedb.py |
121 |
+++ b/gobs/pym/updatedb.py |
122 |
@@ -1,4 +1,3 @@ |
123 |
-# Copyright 2006-2011 Gentoo Foundation |
124 |
# Distributed under the terms of the GNU General Public License v2 |
125 |
|
126 |
""" This code will update the sql backend with needed info for |
127 |
@@ -115,13 +114,15 @@ def update_db_main(): |
128 |
logging.info("Update db started.") |
129 |
# Sync portage and profile/settings |
130 |
git_pull |
131 |
- sync_tree() |
132 |
+ resutalt = sync_tree() |
133 |
+ if resutalt is False: |
134 |
+ logging.info("Update db ... Fail.") |
135 |
+ return False |
136 |
# Init settings for the default config |
137 |
mysettings = init_portage_settings() |
138 |
init_arch = gobs_arch() |
139 |
init_arch.update_arch_db() |
140 |
# Update the cpv db |
141 |
update_cpv_db(mysettings) |
142 |
- CM.closeAllConnections() |
143 |
logging.info("Update db ... Done.") |
144 |
return True |
145 |
\ No newline at end of file |
146 |
|
147 |
diff --git a/gobs/pym/updatedb.py b/gobs/pym/updatedb.py~ |
148 |
similarity index 97% |
149 |
copy from gobs/pym/updatedb.py |
150 |
copy to gobs/pym/updatedb.py~ |
151 |
index 738179f..5919e64 100755 |
152 |
--- a/gobs/pym/updatedb.py |
153 |
+++ b/gobs/pym/updatedb.py~ |
154 |
@@ -1,4 +1,3 @@ |
155 |
-# Copyright 2006-2011 Gentoo Foundation |
156 |
# Distributed under the terms of the GNU General Public License v2 |
157 |
|
158 |
""" This code will update the sql backend with needed info for |
159 |
@@ -115,13 +114,15 @@ def update_db_main(): |
160 |
logging.info("Update db started.") |
161 |
# Sync portage and profile/settings |
162 |
git_pull |
163 |
- sync_tree() |
164 |
+ esutalt = sync_tree() |
165 |
+ if resutalt is False: |
166 |
+ logging.info("Update db ... Fail.") |
167 |
+ return False |
168 |
# Init settings for the default config |
169 |
mysettings = init_portage_settings() |
170 |
init_arch = gobs_arch() |
171 |
init_arch.update_arch_db() |
172 |
# Update the cpv db |
173 |
update_cpv_db(mysettings) |
174 |
- CM.closeAllConnections() |
175 |
logging.info("Update db ... Done.") |
176 |
return True |
177 |
\ No newline at end of file |