From 3307b82ef3cbc2a2ffe01b473d27ec9b4f98bbb3 Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.dos.anjos@gmail.com>
Date: Thu, 18 Apr 2019 09:47:48 +0200
Subject: [PATCH] [build] Check conda-bld exists before trying to re-index it

---
 bob/devtools/build.py         | 3 ++-
 bob/devtools/scripts/build.py | 3 ++-
 bob/devtools/scripts/test.py  | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/bob/devtools/build.py b/bob/devtools/build.py
index 0de25042..51a81d8e 100644
--- a/bob/devtools/build.py
+++ b/bob/devtools/build.py
@@ -525,7 +525,8 @@ def base_build(bootstrap, server, intranet, use_local, group, recipe_dir,
   # updates the local index to get fresh packages if required
   if use_local:
     prefix = get_env_directory(os.environ['CONDA_EXE'], 'base')
-    conda_build.api.update_index(os.path.join(prefix, 'conda-bld'))
+    conda_bld = os.path.join(prefix, 'conda-bld')
+    if os.path.exists(conda_bld): conda_build.api.update_index(conda_bld)
 
   logger.info('Merging conda configuration files...')
   if python_version not in ('noarch', None):
diff --git a/bob/devtools/scripts/build.py b/bob/devtools/scripts/build.py
index cebb03eb..5391de04 100644
--- a/bob/devtools/scripts/build.py
+++ b/bob/devtools/scripts/build.py
@@ -120,7 +120,8 @@ def build(recipe_dir, python, condarc, config, no_test, append_file,
 
   # updates the local index to get fresh packages if required
   if use_local:
-    conda_build.api.update_index(os.path.join(prefix, 'conda-bld'))
+    conda_bld = os.path.join(prefix, 'conda-bld')
+    if os.path.exists(conda_bld): conda_build.api.update_index(conda_bld)
 
   conda_config = make_conda_config(config, python, append_file,
       condarc_options)
diff --git a/bob/devtools/scripts/test.py b/bob/devtools/scripts/test.py
index d5e951fc..9bab4f2d 100644
--- a/bob/devtools/scripts/test.py
+++ b/bob/devtools/scripts/test.py
@@ -106,7 +106,8 @@ def test(package, condarc, config, append_file, server, group, private, stable,
   # updates the local index to get fresh packages if required
   if use_local and not dry_run:
     prefix = get_env_directory(os.environ['CONDA_EXE'], 'base')
-    conda_build.api.update_index(os.path.join(prefix, 'conda-bld'))
+    conda_bld = os.path.join(prefix, 'conda-bld')
+    if os.path.exists(conda_bld): conda_build.api.update_index(conda_bld)
 
   conda_config = make_conda_config(config, None, append_file,
       condarc_options)
-- 
GitLab