diff --git a/bob/devtools/scripts/rebuild.py b/bob/devtools/scripts/rebuild.py
index 3fed8ba964dbfeec644379f0579e395b3e99c699..0421a761e440d6ba3ad262bade8e2fa09b6f7e6d 100644
--- a/bob/devtools/scripts/rebuild.py
+++ b/bob/devtools/scripts/rebuild.py
@@ -206,7 +206,7 @@ def rebuild(recipe_dir, python, condarc, config, append_file,
         conda_build.api.build(metadata[0][0], config=conda_config, notest=False)
         # if you get to this point, the package was successfully rebuilt
         # set environment to signal caller we can upload it
-        os.environ['BDT_REBUILD'] = candidate
+        os.environ['BDT_BUILD'] = candidate
 
     else:  #skip build, test worked
       logger.info('Skipping rebuild of %s-%s-py%s (build: %d) for %s',