[packages/php] - drop if clause introduced in commit 20dcadbb (guard clause for rpm 4.16), we have fully transiti

Neal Gompa ngompa13 at gmail.com
Sat May 15 18:10:36 CEST 2021


On Sat, May 15, 2021 at 12:08 PM Jan Palus <atler at pld-linux.org> wrote:
>
> On 15.05.2021 11:44, Neal Gompa wrote:
> > On Sat, May 15, 2021 at 10:41 AM Adam Gołębiowski <adamg at pld-linux.org> wrote:
> > >
> > >
> > > W dniu 2021-05-15 o 15:26, Neal Gompa pisze:
> > > > On Sat, May 15, 2021 at 6:23 AM Adam Gołębiowski <adamg at pld-linux.org> wrote:
> > > >>
> > > >> W dniu 2021-05-15 o 11:52, Neal Gompa pisze:
> > > >>> On Sat, May 15, 2021 at 5:38 AM Adam Gołębiowski <adamg at pld-linux.org> wrote:
> > > >>>> W dniu 2021-05-13 o 21:32, Elan Ruusamäe pisze:
> > > >>>>
> > > >>>>> point of that guard was to wait for support to become available or
> > > >>>>> someone implement a solution.
> > > >>>>> (...)
> > > >>>>> but as no such solution as provided, you need to update obsoletes to
> > > >>>>> fill **all** package names that provide that file path.
> > > >>>>>
> > > >>>>> I refuse to do that myself as it's pretty stupid.
> > > >>>> ugly, for sure, but unless we come up with another solution (patching
> > > >>>> rpm to support Obsoletes: /path), we will need to maintain 11 Obsoletes:
> > > >>>> lines per package ...
> > > >>>>
> > > >>> What problem are you trying to solve here? I'm not sure I understand
> > > >>> why you're doing this.
> > > >> Each of the php*-program packages provide /usr/bin/php symlink:
> > > >>
> > > >> /poldek:/all-avail> install phpcs////Processing dependencies...////phpcs-3.4.1-2.noarch: required "/usr/bin/php" is provided by the
> > > >> following packages:////a) php4-program-4.4.9-67.x86_64////b) php52-program-5.2.17-20130717.35.x86_64////c) php53-program-5.3.29-52.x86_64////d) php54-program-5.4.45-30.x86_64////e) php55-program-5.5.38-22.x86_64////f) php56-program-5.6.40-9.x86_64////g) php70-program-7.0.33-8.x86_64////h) php71-program-7.1.33-3.x86_64////i) php72-program-7.2.34-1.x86_64////j) php73-program-7.3.24-1.x86_64////k) php74-program-7.4.12-2.x86_64////l) php80-program-8.0.0-2.x86_64////Which one do you want to install ('Q' to abort)?
> > > >> [php4-program-4.4.9-67.x86_64]/
> > > >>
> > > >>
> > > >>
> > > >> Prior to rpm switch, each of those packages also had Obsoletes: /usr/bin/php so that you could easily switch the provider of /usr/bin/php symlinkL
> > > >> /poldek:/all-avail> install php80-program-8.0.0-2.x86_64///
> > > >>
> > > >> /Loading [pndir]th-2020-updates...
> > > >> Loading [pndir]th-2020-updates...
> > > >> Loading [pndir]th-2020...
> > > >> Loading [pndir]th-2020...
> > > >> 29952 packages read
> > > >> Processing dependencies...
> > > >> php80-program-8.0.0-2.x86_64 marks php80-cli-8.0.0-2.x86_64 (cap
> > > >> php80-cli = 4:8.0.0-2)
> > > >>    php80-cli-8.0.0-2.x86_64 marks php80-common-8.0.0-2.x86_64 (cap
> > > >> /etc/php80)
> > > >> There are 3 packages to install (2 marked by dependencies):
> > > >> A php80-cli-8.0.0-2.x86_64  php80-common-8.0.0-2.x86_64
> > > >> php80-program-8.0.0-2.x86_64
> > > >> This operation will use 4.6MB of disk space.
> > > >> Need to get 1.4MB of archives (1.4MB to download).
> > > >>
> > > >> [1/3] th-2020::php80-common-8.0.0-2.x86_64.rpm [1.4M (1.4M/s)]
> > > >> [2/3] th-2020::php80-cli-8.0.0-2.x86_64.rpm [51.7K (51.7K/s)]
> > > >> [3/3] th-2020::php80-program-8.0.0-2.x86_64.rpm [5.0K (5.0K/s)]
> > > >> Executing pm-command.sh --upgrade -vh --root / --define
> > > >> _check_dirname_deps 1...
> > > >> error: failed to open /etc/mtab: No such file or directory
> > > >> Preparing... ########################################### [100%]
> > > >> Repackaging...
> > > >>      1:php72-program ########################################### [100%]
> > > >> Upgrading...
> > > >>      1:php80-common ########################################### [ 33%]
> > > >>      2:php80-cli ########################################### [ 67%]
> > > >>      3:php80-program ########################################### [100%]
> > > >> poldek:/all-avail>/
> > > >>
> > > >>
> > > >> But rpm-4 no longer allows / in Obsoletes:
> > > >>
> > > >> /Illegal char '/' (0x2f) in: Obsoletes: /usr/bin/php /
> > > >>
> > > >> Which makes this smooth transition no longer possible:
> > > >>
> > > >> /poldek:/all-avail> install php73-program-7.3.27-1.x86_64//
> > > >> //Processing dependencies...//
> > > >> //php73-program-7.3.27-1.x86_64 marks php73-cli-7.3.27-1.x86_64 (cap
> > > >> php73-cli = 4:7.3.27-1)//
> > > >> // php73-cli-7.3.27-1.x86_64 marks php73-common-7.3.27-1.x86_64 (cap
> > > >> libphp_common-7.3.27.so()(64bit))//
> > > >> //There are 3 packages to install (2 marked by dependencies)://
> > > >> //A php73-cli-7.3.27-1.x86_64 php73-common-7.3.27-1.x86_64
> > > >> php73-program-7.3.27-1.x86_64//
> > > >> //This operation will use 4.2MB of disk space.//
> > > >> //Need to get 1.2MB of archives.//
> > > >> //php73-common-7.3.27-1.x86_64.rpm: digests OK//
> > > >> //php73-cli-7.3.27-1.x86_64.rpm: digests OK//
> > > >> //php73-program-7.3.27-1.x86_64.rpm: digests OK//
> > > >> //Executing pm-command.sh --upgrade -vh --root / --define
> > > >> _check_dirname_deps 0...//
> > > >> //Verifying... ################################# [100%]//
> > > >> //Preparing... ################################# [100%]//
> > > >> //        file /usr/bin/php from install of
> > > >> php73-program-4:7.3.27-1.x86_64 conflicts with file from package
> > > >> php74-program-4:7.4.19-1.1.x86_64//
> > > >> //        file /usr/share/man/man1/php.1 from install of
> > > >> php73-program-4:7.3.27-1.x86_64 conflicts with file from package
> > > >> php74-program-4:7.4.19-1.1.x86_64//
> > > >> //There were errors//
> > > >> //poldek:/all-avail>/
> > > >>
> > > >> To keep what we had with rpm5 , we either need to patch rpm, or add 11
> > > >> (as of today) Obsoletes: php${ver}-program  lines to each spec.
> > > > RPM supports using Provides+Conflicts to represent this issue.
> > > >
> > > > Provides: php-interpreter
> > > > Conflicts: php-interpreter
> > > >
> > > > When this is set, RPM knows that one and only one implementation
> > > > providing "php-interpreter" is permitted and permits swapping them.
> > >
> > > Nope, this does seem to not work like that:
> > >
> > > [adamg at pld-xcp-ng RPMS]$ rpm -q --provides php80-program
> > > php-interpreter
> > > php80-program = 4:8.0.6-1.2
> > > php80-program(x86-64) = 4:8.0.6-1.2
> > > [adamg at pld-xcp-ng RPMS]$ rpm -q --conflicts php80-program
> > > php-interpreter
> > > [adamg at pld-xcp-ng RPMS]$ rpm -qp --provides
> > > php74-program-7.4.19-1.2.x86_64.rpm
> > > php-interpreter
> > > php74-program = 4:7.4.19-1.2
> > > php74-program(x86-64) = 4:7.4.19-1.2
> > > [adamg at pld-xcp-ng RPMS]$ rpm -qp --conflicts
> > > php74-program-7.4.19-1.2.x86_64.rpm
> > > php-interpreter
> > > [adamg at pld-xcp-ng RPMS]$ rpm -Uhv php74-program-7.4.19-1.2.x86_64.rpm
> > > error: Failed dependencies:
> > >          php-interpreter conflicts with php74-program-4:7.4.19-1.2.x86_64
> > >          php-interpreter conflicts with (installed)
> > > php80-program-4:8.0.6-1.2.x86_64
> > > [adamg at pld-xcp-ng RPMS]$
> > >
> >
> > It should be supported, it was introduced in RPM 4.9:
> > https://rpm.org/wiki/Releases/4.9.0
> >
> > Are we patching RPM in a way to break it?
>
> Just checked in fedora container and it behaves exactly the same way
> there. I've even rebuilt packages with fedora's rpmbuild to be sure.

Oh, now I understand, you're not supposed to be able to use rpm -Uvh
for it, because that's *upgrading*. You need to trigger an
installation + removal in the same transaction (ie. "dnf swap" or "dnf
install --allowerasing").


-- 
真実はいつも一つ!/ Always, there's only one truth!


More information about the pld-devel-en mailing list