diff options
author | Iikka Eklund <iikka.eklund@qt.io> | 2021-03-23 09:15:12 +0200 |
---|---|---|
committer | Iikka Eklund <iikka.eklund@qt.io> | 2021-04-12 12:35:06 +0200 |
commit | 55397a42e38b718dfb07775476e56dbdefa885f4 (patch) | |
tree | cd574dd67ec98b0bafe9eecd20dd4a728c722676 /conanfile.py | |
parent | 81ada90e559c30268653b345cdae2b93b78ff8e8 (diff) |
Conan: Use "scm" revision mode when exporting from .git repository
We have two use cases where the conan export is being executed:
- Conan export from src tar ball
- .git directory is not present
- Coin/CI: conan export from git repository
The "scm" feature will not work if the ".git" repository does not
exist. If this is the case then use the default "hash" mode for the
recipe revision.
Pick-to: 6.1
Change-Id: I8fb37fec1b7b05b116377d169c835117801c5f45
Reviewed-by: Toni Saario <toni.saario@qt.io>
Diffstat (limited to 'conanfile.py')
-rw-r--r-- | conanfile.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/conanfile.py b/conanfile.py index 96a49a26..ddef2cf8 100644 --- a/conanfile.py +++ b/conanfile.py @@ -28,6 +28,7 @@ from conans import ConanFile, tools, CMake import os +from pathlib import Path class QtConanError(Exception): @@ -56,7 +57,8 @@ class QtVirtualKeyboard(ConanFile): "qt6": None, } exports_sources = "*", "!conan*.*" - revision_mode = "scm" # use commit ID as the RREV (recipe revision) + # use commit ID as the RREV (recipe revision) if this is exported from .git repository + revision_mode = "scm" if Path(Path(__file__).parent.resolve() / ".git").exists() else "hash" def source(self): # sources are installed next to recipe, no need to clone etc. sources here |