packit / dist-git-to-source-git

Converting dist-git to source-git
MIT License
4 stars 9 forks source link

.git repo not present in the BUILD/ dir after running %prep #92

Open dhodovsk opened 3 years ago

dhodovsk commented 3 years ago

This occurred again, seen on packages (c8):

TomasTomecek commented 3 years ago

the problem here is these packages change directories (#58) and the build will never pass with the current d2s & packit

we can tinker d2s so that source-git repos will get created though (but build won't pass b/c packit won't be able to recreate patches correctly)

let's look at openblas:

%prep
%setup -q -c -T

# Untar source
tar zxf %{SOURCE0}
cd OpenBLAS-%{version}
%if %{with system_lapack}
%patch0 -p1 -b .system_lapack
%endif
%patch1 -p1 -b .libname
%if 0%{?rhel} == 5
%patch2 -p1 -b .constructor
%endif
%patch3 -p1 -b .tests
...

the way we hijack rpm macros right now is that we override %patch and %autosetup, so with the first %patch invocation, the git repo is created (in %patch0)

but as you can see, we changed directory which is confusing d2s

and this is also the problem for recreating patches: packit creates them from the root of the source-git repo while they are being applied here in a subdirectory - we'd need to store that information that leading dirs should be stripped