summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-07-16 17:15:03 +0300
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-07-21 13:02:49 +0000
commitfd1e8f6ac79624e8541968f926826eec597a9d1d (patch)
tree502d70192448742376f48fdd030aac879c3b2a9e
parent55b04a79d505f20f46c0137e737f723565cea38c (diff)
downloadgit-buildpackage-fd1e8f6ac79624e8541968f926826eec597a9d1d.tar.gz
git-buildpackage-fd1e8f6ac79624e8541968f926826eec597a9d1d.tar.bz2
git-buildpackage-fd1e8f6ac79624e8541968f926826eec597a9d1d.zip
buildpackage-rpm: minor refactor
Change-Id: Ibe43e3e948cb8854dadfc03449854ef044370237 Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rwxr-xr-xgbp/scripts/buildpackage_rpm.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/gbp/scripts/buildpackage_rpm.py b/gbp/scripts/buildpackage_rpm.py
index c84b0a2e..be938aae 100755
--- a/gbp/scripts/buildpackage_rpm.py
+++ b/gbp/scripts/buildpackage_rpm.py
@@ -591,14 +591,11 @@ def main(argv):
dst = os.path.join(spec_dir, f)
else:
dst = os.path.join(source_dir, f)
- try:
- if os.path.isdir(src):
- # dir is not packaging files, skip it
- continue
- else:
+ if not os.path.isdir(src):
+ try:
shutil.copy2(src, dst)
- except IOError, err:
- raise GbpError, "Error exporting files: %s" % err
+ except IOError as err:
+ raise GbpError, "Error exporting files: %s" % err
spec.specdir = os.path.abspath(spec_dir)
if options.orig_prefix != 'auto':