From: Zhang Qiang Date: Wed, 16 Jan 2013 06:38:22 +0000 (+0800) Subject: fix misleading error handling while no spec file found X-Git-Tag: 0.13~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ccbc3d2e65bad47dd7c40ecf7fc0ff8a9098f843;p=tools%2Fgbs.git fix misleading error handling while no spec file found Change-Id: I7be2d57cd5c9e1c2756686cb9f43d4eb1a998fd0 --- diff --git a/gitbuildsys/utils.py b/gitbuildsys/utils.py index 4ad0982..33ce54b 100644 --- a/gitbuildsys/utils.py +++ b/gitbuildsys/utils.py @@ -72,9 +72,6 @@ def guess_spec(git_path, packaging_dir, given_spec, commit_id='WC.UNTRACKED'): glob_ = lambda pattern: glob_in_rev(git_path, pattern, commit_id) msg = "No such spec file %%s in %s" % commit_id - if not check(packaging_dir, True): - raise GbsError("No packaging directory: '%s/', so there is nothing to " - "export." % packaging_dir) if given_spec: spec = os.path.join(packaging_dir, given_spec) if not check(spec): @@ -83,7 +80,8 @@ def guess_spec(git_path, packaging_dir, given_spec, commit_id='WC.UNTRACKED'): specs = glob_(os.path.join(packaging_dir, '*.spec')) if not specs: - raise GbsError("can't find any spec file") + raise GbsError("can't find any spec file under packaging dir: " + "%s" % packaging_dir) project_name = os.path.basename(git_path) spec = os.path.join(packaging_dir, '%s.spec' % project_name)