[Rpm-maint] [rpm-software-management/rpm] RFE: set builsubdir to the *first* extracted archive not the last one (#551)
Panu Matilainen
notifications at github.com
Fri Sep 28 07:24:44 UTC 2018
> No it won't, the variable is not really set before %build
NOW we're getting somewhere. %setup parsing certainly defines it, and this happens before any shell script is executed, but I see it gets lost somewhere in the cracks of %prep parsing. I can take a look at it, all I remember off-hand is that %prep parsing is entirely different from the rest of the build-sections.
However I still don't see the big problem here. %buildsubdir is not some magic random value calculated by rpm, it's always %{name}-%{version}, or literally whatever you pass to %setup with -n argument. It's also the directory you'll find yourself in the shell, so derivable from "basename ${PWD}" inside %prep.
I have no idea what you mean by chainbuild in this context, nor do I know what %somesetup -zN is supposed to do. Please give us concrete examples and issues so we don't need to guess and assume because I'm sure we all know how well that works. What I *can* see here is that you be in charge of %buildsubdir. Well, here's an artificial example that will unpack all your sources in a pre-determined randomly named directory and prove that it's what ends up as %buildsubdir.
```
%global mysub %{basename:%(mktemp -d)}
%prep
%setup -c -T -n %{mysub}
expr %{mysub} = $(basename $(pwd)) || exit
for s in %{sources}; do
tar xf ${s};
done
%build
expr %{mysub} = %{buildsubdir} || exit
```
You could hide the detail of calling %setup exactly once in the %somesetup macro I'm sure.
And if all that has nothing to do with what you want to do, then that just goes to show the need for concrete issues and examples.
Note that none of this is average "something people want to do", I can only assume this is *you* wanting to do something with the %forgesetup stuff. Which is all fine and cool, but please speak about the needs of *your macros* instead of some vague "they" that doesn't exist.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/551#issuecomment-425346722
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20180928/662db6d6/attachment.html>
More information about the Rpm-maint
mailing list