-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add %specpartsdir to macros.in #2534
Conversation
Right, that's another way to deal with it. Having an extra directory seems a bit messy but then it'd be just temporary thing until (and further motivation for) #2078 . It does add an unconditional dependency on using a buildsubdir (and so, %setup), but that's not necessarily a bad thing at all. |
macros.in
Outdated
@@ -132,6 +132,8 @@ | |||
|
|||
%_keyringpath %{_dbpath}/pubkeys/ | |||
|
|||
%specpartsdir %{_builddir}/%{buildsubdir}-SPECPARTS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this next to the other build directory stuff, _specdir and buildroot and whatnot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is buildsubdir always defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In practise yes, because the debuginfo machinery depends on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh and just realized that moving the specparts dir out of buildsubdir makes it kinda unnecessary to make it user overridable, but maybe there are other use-cases for that anyhow.
It's of course not actually introduced in this patch, but I have to say the |
Of course, moving it out of the main build directory has the same caveat as renaming to a dotfile: the magic becomes largely invisible to the packager. |
Yes, the underscores in macros are a bit of a mess. I modeled %specpartsdir on %buildsubdir which also comes without an underscore. I think the idea is that macros to be used directly don't have an underscore. Stuff to be configured have one underscore and stuff not to be touched have two. |
so it can be configured from the spec file Also move the dir beside the %buildsubdir as %{buildsubdir}-SPECPARTS so it doesn't pollute the %buildsubdir. Resolves: rpm-software-management#2532
Adjusted the docs to the new location and added Resolved tag to the original ticket in the commit message. |
In newer version of rpmbuild, for spec file snippets generated during build prep there is a directory created with default location %{_builddir}/%{buildsubdir}-SPECPARTS. This location can be configured via specpartsdir macro. More details: rpm-software-management/rpm#2534 With this solution, when getting the build directory in get_BUILD_dir method, we ignore the directory with the default location (but this doesn't cover the case when specpartsdir macro is configured to other location). Without ignoring it, the method resulted in an exception because more than one directory could be obtained from the BUILD directory.
In newer version of rpmbuild, for spec file snippets generated during build prep there is a directory created with default location %{_builddir}/%{buildsubdir}-SPECPARTS. This location can be configured via specpartsdir macro. More details: rpm-software-management/rpm#2534 With this solution, when getting the build directory in get_BUILD_dir method, we ignore the directory with the default location (but this doesn't cover the case when specpartsdir macro is configured to other location). Without ignoring it, the method resulted in an exception because more than one directory could be obtained from the BUILD directory.
so it can be configured from the spec file
Also move the dir beside the %buildsubdir as %{buildsubdir}-SPECPARTS so it doesn't pollute the %buildsubdir.
This patch is still missing adjustments to the dynamic_specs.md as we might decide to keep the SPECPARTS in %buildsubdir