1 |
commit: b808cf28d451235f53d38d70d04a30838dce07a7 |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jun 2 01:48:31 2014 +0000 |
4 |
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
5 |
CommitDate: Mon Jun 2 01:48:31 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b808cf28 |
7 |
|
8 |
Repoman Manifests: Move some additional code to manifests.py |
9 |
|
10 |
Move the digest check to the Manifests class. |
11 |
Optimize usage to use the new qatracker system. |
12 |
|
13 |
--- |
14 |
pym/repoman/checks/ebuilds/manifests.py | 20 +++++++++++++++----- |
15 |
pym/repoman/main.py | 14 ++++---------- |
16 |
2 files changed, 19 insertions(+), 15 deletions(-) |
17 |
|
18 |
diff --git a/pym/repoman/checks/ebuilds/manifests.py b/pym/repoman/checks/ebuilds/manifests.py |
19 |
index 53c3136..c9eda54 100644 |
20 |
--- a/pym/repoman/checks/ebuilds/manifests.py |
21 |
+++ b/pym/repoman/checks/ebuilds/manifests.py |
22 |
@@ -11,8 +11,9 @@ from portage.util import writemsg_level |
23 |
class Manifests(object): |
24 |
|
25 |
|
26 |
- def __init__(self, options, repoman_settings): |
27 |
+ def __init__(self, options, qatracker, repoman_settings): |
28 |
self.options = options |
29 |
+ self.qatracker = qatracker |
30 |
self.repoman_settings = repoman_settings |
31 |
|
32 |
self.digest_only = options.mode != 'manifest-check' and options.digest == 'y' |
33 |
@@ -41,7 +42,8 @@ class Manifests(object): |
34 |
level=logging.ERROR, noiselevel=-1) |
35 |
|
36 |
if not self.generated_manifest: |
37 |
- print("Unable to generate manifest.") |
38 |
+ writemsg_level("Unable to generate manifest.", |
39 |
+ level=logging.ERROR, noiselevel=-1) |
40 |
failed = True |
41 |
|
42 |
if self.options.mode == "manifest": |
43 |
@@ -64,11 +66,11 @@ class Manifests(object): |
44 |
if distfile in self.auto_assumed: |
45 |
portage.writemsg_stdout( |
46 |
" %s::%s\n" % (pf, distfile)) |
47 |
- |
48 |
- return True # continue, skip remaining loop code |
49 |
+ # continue, skip remaining main loop code |
50 |
+ return True |
51 |
elif failed: |
52 |
sys.exit(1) |
53 |
- return False # stay in the loop |
54 |
+ return False |
55 |
|
56 |
|
57 |
def create_manifest(self, checkdir, fetchlist_dict): |
58 |
@@ -89,3 +91,11 @@ class Manifests(object): |
59 |
mf.write() |
60 |
finally: |
61 |
portage._doebuild_manifest_exempt_depend -= 1 |
62 |
+ |
63 |
+ |
64 |
+ def digest_check(self, checkdir): |
65 |
+ self.repoman_settings['O'] = checkdir |
66 |
+ self.repoman_settings['PORTAGE_QUIET'] = '1' |
67 |
+ if not portage.digestcheck([], self.repoman_settings, strict=1): |
68 |
+ self.qatracker.add_error("manifest.bad", os.path.join(xpkg, 'Manifest')) |
69 |
+ self.repoman_settings.pop('PORTAGE_QUIET', None) |
70 |
|
71 |
diff --git a/pym/repoman/main.py b/pym/repoman/main.py |
72 |
index af7c52b..1649c9f 100755 |
73 |
--- a/pym/repoman/main.py |
74 |
+++ b/pym/repoman/main.py |
75 |
@@ -326,18 +326,12 @@ for xpkg in effective_scanlist: |
76 |
checkdir_relative = os.path.join(".", checkdir_relative) |
77 |
|
78 |
##################### |
79 |
- manifester = Manifests(options, repoman_settings) |
80 |
- continue_ = manifester.run(checkdir, portdb) |
81 |
- if continue_: |
82 |
+ manifester = Manifests(options, qatracker, repoman_settings) |
83 |
+ if manifester.run(checkdir, portdb): |
84 |
continue |
85 |
-###################### |
86 |
- |
87 |
if not manifester.generated_manifest: |
88 |
- repoman_settings['O'] = checkdir |
89 |
- repoman_settings['PORTAGE_QUIET'] = '1' |
90 |
- if not portage.digestcheck([], repoman_settings, strict=1): |
91 |
- qatracker.add_error("manifest.bad", os.path.join(xpkg, 'Manifest')) |
92 |
- repoman_settings.pop('PORTAGE_QUIET', None) |
93 |
+ manifester.digest_check(checkdir) |
94 |
+###################### |
95 |
|
96 |
if options.mode == 'manifest-check': |
97 |
continue |