From d17b0f44b02e1d0bb8759614b1066eff5ed5374e Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Feb 28 2024 13:24:53 +0000 Subject: Allow setting --force for sources command by env var This is helpful for situations where the sources command is called by another subcommand like prep or srpm and changing the overall process is too difficult. Code provided by Denys Vlasenko. Signed-off-by: Lubomír Sedlář --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index 875dea3..bf0e11d 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -2282,6 +2282,11 @@ class Commands(object): self.log.info("sources file doesn't exist. Source files download skipped.") return + # Backward compatibility for scripts which require "source" + # command to download all files + if os.environ.get("RPKG_SOURCES_FORCE", "0") != "0": + force = True + # Default to putting the files in the layout sourcedir if not outdir: outdir = self.layout.sourcedir