summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2015-07-08 00:23:48 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-09 18:00:18 +0100
commit05b02d27d2115c0af32988bb3b43286f7943471c (patch)
tree436f4bb3fef2875da1051a41630530b7aeafdae0 /meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch
parentf9ac3f3e200e4fd0dfe0f45ddc606ce945ea0143 (diff)
downloadpoky-05b02d27d2115c0af32988bb3b43286f7943471c.tar.gz
python-smartpm: 1.4.1 -> 1.5
* Remove the following patches since the are already in the source: smart-config-ignore-all-recommends.patch smart-conflict-provider.patch smart-dflags.patch smart-filename-NAME_MAX.patch smart-flag-exclude-packages.patch smart-flag-ignore-recommends.patch smart-metadata-match.patch smart-multilib-fixes.patch smart-rpm-extra-macros.patch smart-rpm-md-parse.patch smart-rpm-root.patch smart-tmpdir.patch smart-yaml-error.patch * Update the following patches, part of the code are already in the source: smart-attempt.patch smart-improve-error-reporting.patch smart-recommends.patch smartpm-rpm5-nodig.patch * Use github and git repo as the SRC_URI. (From OE-Core rev: 5fc580fc444e45d00de0e50d32b6e6e0b2e6b7ea) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch')
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch168
1 files changed, 3 insertions, 165 deletions
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch b/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch
index 2ca0f6d593..b82265b3ff 100644
--- a/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch
+++ b/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch
@@ -8,170 +8,8 @@ Upstream-Status: Pending
8 8
9Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com> 9Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
10 10
11diff --git a/smart/commands/channel.py b/smart/commands/channel.py
12index aa76f91..63fbb35 100644
13--- a/smart/commands/channel.py
14+++ b/smart/commands/channel.py
15@@ -157,7 +157,17 @@ def main(ctrl, opts):
16 opts.show is None and opts.yaml is None):
17 iface.warning(_("Can't edit channels information."))
18 raise Error, _("Configuration is in readonly mode.")
19-
20+
21+ # Argument check
22+ opts.check_args_of_option("set", -1)
23+ opts.check_args_of_option("remove", -1)
24+ opts.check_args_of_option("edit", 0)
25+ opts.check_args_of_option("enable", -1)
26+ opts.check_args_of_option("disable", -1)
27+ opts.ensure_action("channel", ["add", "set", "remove", "remove_all",
28+ "list", "show", "yaml", "enable", "disable"])
29+ opts.check_remaining_args()
30+
31 if opts.add is not None:
32 if not opts.add and opts.args == ["-"]:
33 newchannels = []
34diff --git a/smart/commands/check.py b/smart/commands/check.py
35index b08608a..506e852 100644
36--- a/smart/commands/check.py
37+++ b/smart/commands/check.py
38@@ -72,6 +72,9 @@ def parse_options(argv):
39
40 def main(ctrl, opts, reloadchannels=True):
41
42+ # Argument check
43+ opts.check_args_of_option("channels", 1)
44+
45 if sysconf.get("auto-update"):
46 from smart.commands import update
47 updateopts = update.parse_options([])
48diff --git a/smart/commands/config.py b/smart/commands/config.py
49index dd50dee..4fe4366 100644
50--- a/smart/commands/config.py
51+++ b/smart/commands/config.py
52@@ -80,6 +80,12 @@ def main(ctrl, opts):
53 globals["false"] = False
54 globals["no"] = False
55
56+ # Check arguments
57+ opts.check_args_of_option("set", -1)
58+ opts.check_args_of_option("remove", -1)
59+ opts.ensure_action("config", ["set", "show", "yaml", "remove"])
60+ opts.check_remaining_args()
61+
62 if opts.set:
63 for opt in opts.set:
64 m = SETRE.match(opt)
65diff --git a/smart/commands/download.py b/smart/commands/download.py
66index 6837993..b853c61 100644
67--- a/smart/commands/download.py
68+++ b/smart/commands/download.py
69@@ -81,6 +81,14 @@ def parse_options(argv):
70
71 def main(ctrl, opts):
72
73+ # Argument check
74+ opts.check_args_of_option("target", 1)
75+ opts.check_args_of_option("output", 1)
76+ opts.check_args_of_option("from_urls", -1)
77+ opts.check_args_of_option("from_metalink", -1)
78+ if not opts.args and not opts.from_metalink and not opts.from_urls:
79+ raise Error, _("no package(s) given")
80+
81 packages = []
82 if opts.args:
83 if sysconf.get("auto-update"):
84diff --git a/smart/commands/info.py b/smart/commands/info.py
85index 12f74f0..59fbe98 100644
86--- a/smart/commands/info.py
87+++ b/smart/commands/info.py
88@@ -58,6 +58,10 @@ def parse_options(argv):
89
90 def main(ctrl, opts, reloadchannels=True):
91
92+ # Argument check
93+ if not opts.args:
94+ raise Error, _("No package(s) given")
95+
96 if sysconf.get("auto-update"):
97 from smart.commands import update
98 updateopts = update.parse_options([])
99diff --git a/smart/commands/install.py b/smart/commands/install.py
100index 8a45954..590222c 100644
101--- a/smart/commands/install.py
102+++ b/smart/commands/install.py
103@@ -76,6 +76,10 @@ def parse_options(argv):
104
105 def main(ctrl, opts):
106
107+ # Argument check
108+ if not opts.args:
109+ raise Error, _("no package(s) given")
110+
111 if opts.explain:
112 sysconf.set("explain-changesets", True, soft=True)
113
114diff --git a/smart/commands/reinstall.py b/smart/commands/reinstall.py
115index e59d896..32da3e6 100644
116--- a/smart/commands/reinstall.py
117+++ b/smart/commands/reinstall.py
118@@ -68,7 +68,11 @@ def parse_options(argv):
119 return opts
120
121 def main(ctrl, opts):
122-
123+
124+ # Argument check
125+ if not opts.args:
126+ raise Error, _("no package(s) given")
127+
128 if opts.explain:
129 sysconf.set("explain-changesets", True, soft=True)
130
131diff --git a/smart/commands/remove.py b/smart/commands/remove.py
132index b4823a6..acd3bbd 100644
133--- a/smart/commands/remove.py
134+++ b/smart/commands/remove.py
135@@ -74,6 +74,10 @@ def parse_options(argv):
136
137 def main(ctrl, opts):
138
139+ # Argument check
140+ if not opts.args:
141+ raise Error, _("no package(s) given")
142+
143 if opts.explain:
144 sysconf.set("explain-changesets", True, soft=True)
145
146diff --git a/smart/commands/search.py b/smart/commands/search.py
147index 0d0b573..44806b8 100644
148--- a/smart/commands/search.py
149+++ b/smart/commands/search.py
150@@ -44,6 +44,8 @@ def option_parser():
151 def parse_options(argv):
152 opts = query.parse_options(argv, usage=USAGE, \
153 description=DESCRIPTION, examples=EXAMPLES)
154+ if not argv:
155+ raise Error, _("Search expression not specified")
156 opts.name = opts.args
157 opts.summary = opts.args
158 opts.description = opts.args
159diff --git a/smart/commands/upgrade.py b/smart/commands/upgrade.py
160index ec86290..7e290d8 100644
161--- a/smart/commands/upgrade.py
162+++ b/smart/commands/upgrade.py
163@@ -91,6 +91,9 @@ def parse_options(argv):
164
165 def main(ctrl, opts):
166
167+ # Argument check
168+ opts.check_args_of_option("flag", 1)
169+
170 if opts.explain:
171 sysconf.set("explain-changesets", True, soft=True)
172
173diff --git a/smart/util/optparse.py b/smart/util/optparse.py 11diff --git a/smart/util/optparse.py b/smart/util/optparse.py
174index 4a3d3a8..279b0bf 100644 12index 6fff1bc..f445a3b 100644
175--- a/smart/util/optparse.py 13--- a/smart/util/optparse.py
176+++ b/smart/util/optparse.py 14+++ b/smart/util/optparse.py
177@@ -70,6 +70,8 @@ import sys, os 15@@ -70,6 +70,8 @@ import sys, os
@@ -183,7 +21,7 @@ index 4a3d3a8..279b0bf 100644
183 21
184 def _repr(self): 22 def _repr(self):
185 return "<%s at 0x%x: %s>" % (self.__class__.__name__, id(self), self) 23 return "<%s at 0x%x: %s>" % (self.__class__.__name__, id(self), self)
186@@ -708,6 +710,12 @@ class Option: 24@@ -710,6 +712,12 @@ class Option:
187 self.action, self.dest, opt, value, values, parser) 25 self.action, self.dest, opt, value, values, parser)
188 26
189 def take_action(self, action, dest, opt, value, values, parser): 27 def take_action(self, action, dest, opt, value, values, parser):
@@ -196,7 +34,7 @@ index 4a3d3a8..279b0bf 100644
196 if action == "store": 34 if action == "store":
197 setattr(values, dest, value) 35 setattr(values, dest, value)
198 elif action == "store_const": 36 elif action == "store_const":
199@@ -819,6 +827,54 @@ class Values: 37@@ -821,6 +829,54 @@ class Values:
200 setattr(self, attr, value) 38 setattr(self, attr, value)
201 return getattr(self, attr) 39 return getattr(self, attr)
202 40