Bug 27918

Summary: apt does not resolve dependencies of locally installed packages against the rpm db.
Product: Sisyphus Reporter: viy <viy>
Component: aptAssignee: placeholder <placeholder>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: normal    
Priority: P3 CC: boyarsh, glebfm, imz, ldv, placeholder, real.altlinux.org, rider
Version: unstable   
Hardware: all   
OS: Linux   
Description Flags
local rpm 1
locak rom 2 none

Description viy 2012-11-02 21:33:29 MSK
Created attachment 5616 [details]
local rpm 1

$ rpm -q libapt apt 
apt does not resolve dependencies of locally installed packages against the local rpm db.
Example (attached):
a local development build of perl-RPM-Source-Convert
depends on locally installed perl(RPM/Source/Transformation/RaiseRelease.pm)
from a locally installed development build of perl-RPM-Source-Editor.
rpm db is ok. But apt refuse to work:
apt> dist-upgrade 
You might want to run `install --fix-broken' to correct these.
The following packages have unmet dependencies:
  perl-RPM-Source-Convert: Depends: perl(RPM/Source/Transformation/RaiseRelease.pm) but it is not installable
E: Unmet dependencies. Try using --fix-broken.
Comment 1 viy 2012-11-02 21:34:16 MSK
Created attachment 5617 [details]
locak rom 2
Comment 2 Anton Farygin 2019-08-29 22:11:53 MSK
Эта ошибка ещё актуальна ?
Comment 3 viy 2019-08-30 09:37:06 MSK
надо пару тестовых пакетов собрать с Provides/Requires вне Сизифа
и попробовать воспроизвести.
Comment 4 viy 2019-08-30 09:57:47 MSK
собрал тесты на p9 - нет, не воспроизводится.
Comment 5 Ivan Zakharyaschev 2019-09-01 19:54:35 MSK
The reason probably was:

1. APT didn't distinguish different builds of a package with the same EVR by APT's version ID ("VerStr"). (So, although there were 2 builds of a package, APT considered them being the same package.)

2. APT took the information about a package (its Provides etc.) from one of the many sources; and there was no guarantee that the information was taken from the local RPM db.

1 was changed by:

* Чт май 30 2019 Ivan Zakharyaschev <imz@altlinux.org> 0.5.15lorg2-alt65
- Add buildtime to VerStrs (used by APT to identify package versions).

* Ср июн 05 2019 Ivan Zakharyaschev <imz@altlinux.org> 0.5.15lorg2-alt68
- Add disttag to VerStrs (used by APT to identify package versions).

and this is basically enough for the described problem, because it's very improbable that a locally built package has the same build time as the one from the repositories.

2 would also be changed to a more adequate behavior (so that the information from the local RPM db about the same package is preferred) by:

* Чт июл 04 2019 Ivan Zakharyaschev <imz@altlinux.org> 0.5.15lorg2-alt68.1
- Made the treatment of the File Provides and the version ID of
  installed packages "stable": not affected negatively by sources.list.
  Also negative effects of different pkglists from sources.list on each other
  have been mitigated. (A pkglist from sources.list that lacked disttags could
  shadow the File Provides of packages from the database or other pkglists.)