ferdnyc left a comment (rpm-software-management/rpm#3661)

Not sure if you're monitoring that Fedora packaging issue, @pmatilai, but I ran 
into an uncertainty about macro expansions. I figured I'd re-post my question 
here, just in case it's more likely to draw your attention.

Are there any differences in the handling of things like subshell calls, when 
using `%define` vs. `%global`?

There are a _lot_ of `%global` uses in our packaging templates, so in addition 
to updating the guidelines I wanted to also update (at least some of) those. 
But then I ran into these macros from [the TCL packaging 
guidelines](https://docs.fedoraproject.org/en-US/packaging-guidelines/Tcl/#_noarch_packages):

```
%{!?tcl_version: %global tcl_version %(echo 'puts $tcl_version' | tclsh)}
%{!?tcl_sitelib: %global tcl_sitelib %{_datadir}/tcl%{tcl_version}}
```

...And that got me wondering. If this macro definition:

`%global tcl_version %(echo 'puts $tcl_version' | tclsh)`

is replaced with this macro definition:

`%define tcl_version %(echo 'puts $tcl_version' | tclsh)`

...will every use of `%tcl_version` be re-executing that `echo 'puts 
$tcl_version' | tclsh` shell command?

If the answer is yes (though I doubt it is), we may want to continue 
recommending `%global` for macros that invoke subshells or do other complex 
processing.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/3661#issuecomment-2798377940
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/issues/3661/[email protected]>
_______________________________________________
Rpm-maint mailing list
[email protected]
https://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to