Re: [PATCH rdma-core 3/3] cbuild: use rpmspec for macro replacement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Le 09/08/2017 à 22:19, Jason Gunthorpe a écrit :
> On Wed, Aug 09, 2017 at 06:39:23PM +0200, Nicolas Morey-Chaisemartin wrote:
>>>>>          subprocess.check_call(["git","archive",
>>>>> -                               "--prefix","%s/"%(os.path.splitext(tarfn)[0]),
>>>>> +                               # This must match the prefix generated buildlib/github-release
>>>>> +                               "--prefix","%s-%s/"%(project,get_version()),
>>>>>                                 "--output",os.path.join(tmpdir,"SOURCES",tarfn),
>>>> You have an issue here because tarfn is not set yet.
>>> No, it was still set above, see the first hunk.
>> Yes. But the value it has is "wrong"
>> If I take the current spec file used in OBS:
>> Source0:        %{name}-%{version}%{git_ver}.tar.xz
>>
>> Omitting the Source0 that should be changed to Source, this wille set tarfn to rdma-core-15%{git_ver}.tar.xz
> Okay..
>
> Why not use
>
> %setup -n %{name}-%{version}
>
> In the spec file? Eg do not include the git version in the prefix so
> it matches the format produced by the github scripts.
>
> Then, the above will make a archive with 'rdma-core-15/' as the prefix.
>
> The archive will be called
>
> 'SOURCE/%{name}-%{version}%{git_ver}.tar.xz'
>
> Then the go.py will parse and determine that the archive should be
> called
>
> 'SOURCE/rdma-core-15-git124556.tar.xz'
>
> And drop a symlink to fix it up.
Yes this should work. It feels a little bit dirty to have a tarball name with unreplaced macro but it's a temporay state so I can live with this :)

>> This means that we would need to detar/rename/retar the package in
>> the go.py.  It feels overly complicated :/ What we use this for is
>> mainly for RC and non-release packages. We set the git_ver to -rc1,
>> -<NN>-g<SHA1>  so we know at a glance that this is not an official
>> release.  I can either try to get this working in the go.py, or I'll
>> simply drop this from our spec and bring it back when needed for non
>> release packages.
> I think if this is your usage then you would be fine to use '%setup
> -n'..
>
> We can already recover the git HEAD from a git archive output by using
> 'git get-tar-commit-id' so it isn't really necessary to include the
> git commit id in the prefix.
>
> Jason

Yes the setup part is easy enough.
There two reason for this:
- I have a lot of packages to maintain and I can see at a glance what is what.
- If someone wants to fork the package in OBS and have its own build (for whatever reason: different compiler, different flag, extra patches, etc.) it clears which exact version it is without digging the SHA1 from the _service file we have or within the tarball.


Nicolas

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux