From 8525474cdabd20d2a1c3521cd968bc51647c9489 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Sat, 7 Oct 2023 14:43:31 +0200 Subject: [PATCH] conf: only print rust2rpm.conf deprecation warning if file is present --- rust2rpm/conf.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/rust2rpm/conf.py b/rust2rpm/conf.py index 9b4905b..1e49c94 100644 --- a/rust2rpm/conf.py +++ b/rust2rpm/conf.py @@ -552,11 +552,12 @@ def load_config(features: set[str], target: str) -> TomlConf: log.error(str(exc)) sys.exit(1) - log.warn( - "The rust2rpm.conf file format is deprecated and support for it will " - + "be removed in a future release of rust2rpm. Please migrate settings " - + "to the new TOML based format (rust2rpm.toml)." - ) + if distconf.conf_file: + log.warn( + "The rust2rpm.conf file format is deprecated and support for it will " + + "be removed in a future release of rust2rpm. Please migrate settings " + + "to the new TOML based format (rust2rpm.toml)." + ) tomlconf = TomlConf.from_conf(distconf) return tomlconf