Hi, On 10/13/2017 08:39 PM, Johannes Kastl wrote:
hello, as for the errors you're seeing, I vaguely recall that these are the correct errors... You can in theory remove alternatives in %preun or in %postun and both produce an error because both RPM and alternatives are removing the same file. %postun is the correct place for a different reason, but you still get the alternative error because the files it's looking at are already removed. OK, good to know. Other than that, you're not doing it entirely right. Which most likely means the chardet package from which you took it should be fixed as well. You know that better than me. ;-) It is documented pretty good https://en.opensuse.org/openSUSE:Packaging_Python_Singlespec If you think something is missing, please raise your voice :) 3. Do you actually _need_ alternatives here? Does it make sense for the user to choose which python to use for redfish-client (and check-cartridge)? If not, I suggest removing the alternatives entirely, and marking the binaries for python3 in the filelist: I thought the whole point of alternatives was to give the user the
On 13.10.17 14:04 jan matejek wrote: possibility to either install the python2-based or the python3-based package. And either way the binary to use is called redfish-client. So yes, I think I need the alternatives. But there is no reason to use alternatives and it's complexity for users and packagers if there is no reason to do so. In other words: If both version versions are equivalent, only provide it once. This is the case for most user-facing programs written in python. Also: If the provided library is only useful for the executable, there is even no reason to provide both versions of it too. So it is probably not even necessary/recommended to singlespec' it at all. It depends on what the program actually does.
6. For your second question, yes, making a common subpackage this way is a valid approach. However, the "Requires: %{name}-common" doesn't do what you think. This way python2-redfish requires python2-redfish-common and similarly with python3. To fix this, add "Provides: %{python_module redfish-common = %{version}}" to the common subpackage. I must have misread the singlespec docs, I thought using %name-common for the subpackage would lead to it not being touched by singlespec. So there would be only one python-redfish-common package... ;-( See also https://en.opensuse.org/openSUSE:Packaging_Python_Singlespec#Subpackage_decl... and https://en.opensuse.org/openSUSE:Packaging_Python_Singlespec#Requires.2C_Pro...
Sebastian -- python programming - mail server - photo - video - https://sebix.at cryptographic key at https://sebix.at/DC9B463B.asc and on public keyservers