summaryrefslogtreecommitdiff
path: root/setup
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2015-01-26 10:44:05 +0100
committerAaron Bohy <aab@odoo.com>2015-01-26 14:24:44 +0100
commit1db27f417d20b92e6c390550dbe8365dfd7968f0 (patch)
tree18fcb1e932e9f2373c697b15e689b8ac1be49f45 /setup
parent6ebdcbd2cdf64257d163d69caaeb20c176a2c823 (diff)
[FIX] Packaging: Windows: _prepare_build_dir
Catch shutil.Error thrown when addons have already been moved to openerp/addons. Fixes the bug introduced by commit 91026647d43358594df0e17f3d408a3aa415c665.
Diffstat (limited to 'setup')
-rwxr-xr-xsetup/package.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/setup/package.py b/setup/package.py
index 9ca97d19dd9..71de37bbf99 100755
--- a/setup/package.py
+++ b/setup/package.py
@@ -246,9 +246,14 @@ def _prepare_build_dir(o, win32=False):
if not win32:
cmd += ['--exclude', 'setup/win32']
system(cmd + ['%s/' % o.odoo_dir, o.build_dir])
- for i in glob(join(o.build_dir, 'addons/*')):
- if i.split(os.path.sep)[-1] not in ADDONS_NOT_TO_PUBLISH:
- shutil.move(i, join(o.build_dir, 'openerp/addons'))
+ try:
+ for addon_path in glob(join(o.build_dir, 'addons/*')):
+ if addon_path.split(os.path.sep)[-1] not in ADDONS_NOT_TO_PUBLISH:
+ shutil.move(addon_path, join(o.build_dir, 'openerp/addons'))
+ except shutil.Error:
+ # Thrown when the add-on is already in openerp/addons (if _prepare_build_dir
+ # has already been called once)
+ pass
def build_tgz(o):
system(['python2', 'setup.py', 'sdist', '--quiet', '--formats=gztar,zip'], o.build_dir)