From ccbc3d2e65bad47dd7c40ecf7fc0ff8a9098f843 Mon Sep 17 00:00:00 2001 From: Zhang Qiang Date: Wed, 16 Jan 2013 14:38:22 +0800 Subject: [PATCH] fix misleading error handling while no spec file found Change-Id: I7be2d57cd5c9e1c2756686cb9f43d4eb1a998fd0 --- gitbuildsys/utils.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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) -- 2.7.4