On Mon, Apr 25, 2022 at 2:46 PM Vitaly Zaitsev via devel
<devel(a)lists.fedoraproject.org> wrote:
On 25/04/2022 13:42, Fabio Valentini wrote:
> For example, we could use something like:
> # SourceScript: gen_clean_tarball.sh
Source1: gen_clean_tarball.sh
Well, doing that alone wouldn't work. How would the program know if
this Source is one that should be executed, or not?
So, even if the script is included as a Source file for the SRPM, we'd
still need to specify *which* file to actually execute (if any).
Which is why I suggested to use a marker comment like "# SourceScript: foo.sh".
> That would make it easy for spectool to parse this information
from
> the .spec file, and then execute the program with that name.
Can be easily parsed even with regular expression.
Sure. script_path = if line.startswith("# SourceScript:"): line.split("
\t")[1]
That's not a problem. But we still need to specify *which* source file
is actually the script to run (if any).
Fabio