Bug 36062

Summary: ignores strict disttag deps when asked by APT
Product: Sisyphus Reporter: Ivan Zakharyaschev <imz>
Component: rpmAssignee: placeholder <placeholder>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: normal    
Priority: P3 CC: at, glebfm, imz, iv, ldv, placeholder, vseleznv, vt
Version: unstable   
Hardware: all   
OS: Linux   

Description Ivan Zakharyaschev 2019-02-08 09:48:01 MSK
rpm-4.13.0.1-alt5
apt-0.5.15lorg2-alt61

(we've implemented a fix already.)

How it was:

to reproduce this, build the "rpm" package (it serves as an example) with a fresh disttag, regenbasedir, and add it to sources.list, then try to install librpmbuild7 (it fails):

[root@ovicaa ~]# apt-cache showpkg librpmbuild7
Package: librpmbuild7
Versions: 
4.13.0.1-alt5(/var/lib/apt/lists/_home_imz_hasher_repo_x86%5f64_base_pkglist.hasher)
4.13.0.1-alt5(/var/lib/apt/lists/ftp.altlinux.org_pub_distributions_ALTLinux_Sisyphus_x86%5f64_base_pkglist.classic)(/var/lib/apt/lists/_ALT_Sisyphus_x86%5f64_base_pkglist.classic)(/var/lib/rpm/Packages)

Reverse Depends: 
  rpmspec,librpmbuild7 4.13.0.1-alt5:zzz+77.55
  python3-module-rpm,librpmbuild7 4.13.0.1-alt5:zzz+77.55
  python-module-rpm,librpmbuild7 4.13.0.1-alt5:zzz+77.55
  librpmbuild7-debuginfo,librpmbuild7 4.13.0.1-alt5:zzz+77.55
  librpm-devel,librpmbuild7 4.13.0.1-alt5:zzz+77.55
  i586-librpmbuild7.32bit,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
  rpmspec,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
  python3-module-rpm,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
  python-module-rpm,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
  librpm-devel,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
Dependencies: 
4.13.0.1-alt5 - libc.so.6(GLIBC_2.15)(64bit) (0 (null)) libcap.so.2()(64bit) (2 set:igZaxnO5jf) libmagic.so.1()(64bit) (2 set:jg7D3mxom31mc01) libpopt.so.0()(64bit) (2 set:jftck0pY4jRJWvaCunRMZrjSd) librpm7 (5 4.13.0.1-alt5:zzz+77.55) 
4.13.0.1-alt5 - libc.so.6(GLIBC_2.15)(64bit) (0 (null)) libcap.so.2()(64bit) (2 set:igZaxnO5jf) libmagic.so.1()(64bit) (2 set:jg7D3mxom31mc01) libpopt.so.0()(64bit) (2 set:jftck0pY4jRJWvaCunRMZrjSd) librpm7 (5 4.13.0.1-alt5:sisyphus+219346.60.4.1) 
Provides: 
4.13.0.1-alt5 - librpmbuild7 librpmbuild.so.7()(64bit) 
4.13.0.1-alt5 - librpmbuild7 librpmbuild.so.7()(64bit) 
Reverse Provides: 
librpmbuild7 4.13.0.1-alt5
librpmbuild7 4.13.0.1-alt5
[root@ovicaa ~]# apt-get install librpmbuild7
Reading Package Lists... Done
Building Dependency Tree... Done
The following packages will be upgraded
  librpmbuild7
1 upgraded, 0 newly installed, 0 removed and 2169 not upgraded.
Need to get 0B/137kB of archives.
After unpacking 0B of additional disk space will be used.
=== apt-printchanges ===
==librpmbuild7==
* Tue Jan 15 2019 Vladimir D. Seleznev <vseleznv@altlinux.org> 4.13.0.1-alt5
- implemented DistTag support when comparing package versions;
- fixed handling of ancient packages (closes: #33710);
- rpmquery: disabled glob by default (thx Dmitry V. Levin; closes: #35828);
- fixed manifest comments handling (thx Dmitry V. Levin; closes: #35125);
- dirty hacked to make upgrade packages between branches possible;
- rpmpopt: made query info command display DistTag;
- spec: removed excess %EVR in intersubpackages dependencies.
	librpm7 = 4.13.0.1-alt5:zzz+77.55 is needed by librpmbuild7-4.13.0.1-alt5.x86_64
	librpmbuild7 = 4.13.0.1-alt5:sisyphus+219346.60.4.1 is needed by (installed) rpmspec-4.13.0.1-alt5.x86_64
	librpmbuild7 = 4.13.0.1-alt5:sisyphus+219346.60.4.1 is needed by (installed) librpm-devel-4.13.0.1-alt5.x86_64
	librpmbuild7 = 4.13.0.1-alt5:sisyphus+219346.60.4.1 is needed by (installed) python-module-rpm-4.13.0.1-alt5.x86_64
E: Transaction set check failed
[root@ovicaa ~]# 

With the last (unreleased) changes it's better:

[root@ovicaa ~]# apt-cache showpkg librpmbuild7
Package: librpmbuild7
Versions: 
4.13.0.1-alt5(/var/lib/apt/lists/_home_imz_hasher_repo_x86%5f64_base_pkglist.hasher)
4.13.0.1-alt5(/var/lib/rpm/Packages)
4.13.0.1-alt5(/var/lib/apt/lists/_ALT_Sisyphus_x86%5f64_base_pkglist.classic)

Reverse Depends: 
  rpmspec,librpmbuild7 4.13.0.1-alt5:ttt+11.33
  librpm-devel,librpmbuild7 4.13.0.1-alt5:ttt+11.33
  python-module-rpm,librpmbuild7 4.13.0.1-alt5:ttt+11.33
  rpmspec,librpmbuild7 4.13.0.1-alt5:uuu+22.33
  python3-module-rpm,librpmbuild7 4.13.0.1-alt5:uuu+22.33
  python-module-rpm,librpmbuild7 4.13.0.1-alt5:uuu+22.33
  librpmbuild7-debuginfo,librpmbuild7 4.13.0.1-alt5:uuu+22.33
  librpm-devel,librpmbuild7 4.13.0.1-alt5:uuu+22.33
  i586-librpmbuild7.32bit,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
  rpmspec,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
  python3-module-rpm,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
  python-module-rpm,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
  librpm-devel,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
Dependencies: 
4.13.0.1-alt5 - libc.so.6(GLIBC_2.15)(64bit) (0 (null)) libcap.so.2()(64bit) (2 set:igZaxnO5jf) libmagic.so.1()(64bit) (2 set:jg7D3mxom31mc01) libpopt.so.0()(64bit) (2 set:jftck0pY4jRJWvaCunRMZrjSd) librpm7 (5 4.13.0.1-alt5:uuu+22.33) 
4.13.0.1-alt5 - libc.so.6(GLIBC_2.15)(64bit) (0 (null)) libcap.so.2()(64bit) (2 set:igZaxnO5jf) libmagic.so.1()(64bit) (2 set:jg7D3mxom31mc01) libpopt.so.0()(64bit) (2 set:jftck0pY4jRJWvaCunRMZrjSd) librpm7 (5 4.13.0.1-alt5:ttt+11.33) 
4.13.0.1-alt5 - libc.so.6(GLIBC_2.15)(64bit) (0 (null)) libcap.so.2()(64bit) (2 set:igZaxnO5jf) libmagic.so.1()(64bit) (2 set:jg7D3mxom31mc01) libpopt.so.0()(64bit) (2 set:jftck0pY4jRJWvaCunRMZrjSd) librpm7 (5 4.13.0.1-alt5:sisyphus+219346.60.4.1) 
Provides: 
4.13.0.1-alt5 - librpmbuild7 librpmbuild.so.7()(64bit) 
4.13.0.1-alt5 - librpmbuild7 librpmbuild.so.7()(64bit) 
4.13.0.1-alt5 - librpmbuild7 librpmbuild.so.7()(64bit) 
Reverse Provides: 
librpmbuild7 4.13.0.1-alt5
librpmbuild7 4.13.0.1-alt5
librpmbuild7 4.13.0.1-alt5
[root@ovicaa ~]# apt-get install librpmbuild7
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
  librpm-devel librpm7 python-module-rpm rpm rpmspec
The following packages will be upgraded
  librpm-devel librpm7 librpmbuild7 python-module-rpm rpm rpmspec
6 upgraded, 0 newly installed, 0 removed and 2164 not upgraded.
Need to get 0B/1319kB of archives.
After unpacking 0B of additional disk space will be used.
Do you want to continue? [Y/n] 
=== apt-printchanges ===
==rpmspec librpm-devel python-module-rpm librpmbuild7 librpm7 rpm==
* Tue Jan 15 2019 Vladimir D. Seleznev <vseleznv@altlinux.org> 4.13.0.1-alt5
- implemented DistTag support when comparing package versions;
- fixed handling of ancient packages (closes: #33710);
- rpmquery: disabled glob by default (thx Dmitry V. Levin; closes: #35828);
- fixed manifest comments handling (thx Dmitry V. Levin; closes: #35125);
- dirty hacked to make upgrade packages between branches possible;
- rpmpopt: made query info command display DistTag;
- spec: removed excess %EVR in intersubpackages dependencies.
Committing changes...
Preparing...                                                                                                                                                      #################################################################################################### [100%]
Updating / installing...
 1: librpm7-4.13.0.1-alt5                                                                                                                                         #################################################################################################### [  8%]
 2: librpmbuild7-4.13.0.1-alt5                                                                                                                                    #################################################################################################### [ 17%]
 3: rpm-4.13.0.1-alt5                                                                                                                                             #################################################################################################### [ 25%]
 4: librpm-devel-4.13.0.1-alt5                                                                                                                                    #################################################################################################### [ 33%]
 5: python-module-rpm-4.13.0.1-alt5                                                                                                                               #################################################################################################### [ 42%]
 6: rpmspec-4.13.0.1-alt5                                                                                                                                         #################################################################################################### [ 50%]
Cleaning up / removing...
 7: librpm-devel-4.13.0.1-alt5                                                                                                                                    #################################################################################################### [ 58%]
 8: python-module-rpm-4.13.0.1-alt5                                                                                                                               #################################################################################################### [ 67%]
 9: rpm-4.13.0.1-alt5                                                                                                                                             #################################################################################################### [ 75%]
10: rpmspec-4.13.0.1-alt5                                                                                                                                         #################################################################################################### [ 83%]
11: librpmbuild7-4.13.0.1-alt5                                                                                                                                    #################################################################################################### [ 92%]
12: librpm7-4.13.0.1-alt5                                                                                                                                         #################################################################################################### [100%]
Done.
[root@ovicaa ~]#
Comment 1 Ivan Zakharyaschev 2019-02-08 10:00:45 MSK
Here the initially installed example package (rpm) came from Sisyphus and had a disttag (as you can guess from the showpkg output). Then I replaced it with another one, also with disttag. And then I ran the last successful test.

Let's test another situation: the initially installed example package (rpm) had no disttag. (Build it without --define 'disttag ....' in hasher.)

[root@ovicaa ~]# apt-cache showpkg librpmbuild7
Package: librpmbuild7
Versions: 
4.13.0.1-alt5(/var/lib/rpm/Packages)
4.13.0.1-alt5(/var/lib/apt/lists/_home_imz_hasher_repo_x86%5f64_base_pkglist.hasher)
4.13.0.1-alt5(/var/lib/apt/lists/_ALT_Sisyphus_x86%5f64_base_pkglist.classic)

Reverse Depends: 
  python-module-rpm,librpmbuild7 4.13.0.1-alt5
  librpm-devel,librpmbuild7 4.13.0.1-alt5
  rpmspec,librpmbuild7 4.13.0.1-alt5
  rpmspec,librpmbuild7 4.13.0.1-alt5:uuu+22.33
  python3-module-rpm,librpmbuild7 4.13.0.1-alt5:uuu+22.33
  python-module-rpm,librpmbuild7 4.13.0.1-alt5:uuu+22.33
  librpmbuild7-debuginfo,librpmbuild7 4.13.0.1-alt5:uuu+22.33
  librpm-devel,librpmbuild7 4.13.0.1-alt5:uuu+22.33
  i586-librpmbuild7.32bit,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
  rpmspec,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
  python3-module-rpm,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
  python-module-rpm,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
  librpm-devel,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
Dependencies: 
4.13.0.1-alt5 - libc.so.6(GLIBC_2.15)(64bit) (0 (null)) libcap.so.2()(64bit) (2 set:igZaxnO5jf) libmagic.so.1()(64bit) (2 set:jg7D3mxom31mc01) libpopt.so.0()(64bit) (2 set:jftck0pY4jRJWvaCunRMZrjSd) librpm7 (5 4.13.0.1-alt5) 
4.13.0.1-alt5 - libc.so.6(GLIBC_2.15)(64bit) (0 (null)) libcap.so.2()(64bit) (2 set:igZaxnO5jf) libmagic.so.1()(64bit) (2 set:jg7D3mxom31mc01) libpopt.so.0()(64bit) (2 set:jftck0pY4jRJWvaCunRMZrjSd) librpm7 (5 4.13.0.1-alt5:uuu+22.33) 
4.13.0.1-alt5 - libc.so.6(GLIBC_2.15)(64bit) (0 (null)) libcap.so.2()(64bit) (2 set:igZaxnO5jf) libmagic.so.1()(64bit) (2 set:jg7D3mxom31mc01) libpopt.so.0()(64bit) (2 set:jftck0pY4jRJWvaCunRMZrjSd) librpm7 (5 4.13.0.1-alt5:sisyphus+219346.60.4.1) 
Provides: 
4.13.0.1-alt5 - librpmbuild7 librpmbuild.so.7()(64bit) 
4.13.0.1-alt5 - librpmbuild7 librpmbuild.so.7()(64bit) 
4.13.0.1-alt5 - librpmbuild7 librpmbuild.so.7()(64bit) 
Reverse Provides: 
librpmbuild7 4.13.0.1-alt5
librpmbuild7 4.13.0.1-alt5
librpmbuild7 4.13.0.1-alt5

We shall test the "apt-get install" command in this case, too.
Comment 2 Ivan Zakharyaschev 2019-02-08 10:09:26 MSK
(In reply to comment #1)
> Here the initially installed example package (rpm) came from Sisyphus and had a
> disttag (as you can guess from the showpkg output). Then I replaced it with
> another one, also with disttag. And then I ran the last successful test.
> 
> Let's test another situation: the initially installed example package (rpm) had
> no disttag. (Build it without --define 'disttag ....' in hasher.)
> 
> [root@ovicaa ~]# apt-cache showpkg librpmbuild7
> Package: librpmbuild7
> Versions: 
> 4.13.0.1-alt5(/var/lib/rpm/Packages)
> 4.13.0.1-alt5(/var/lib/apt/lists/_home_imz_hasher_repo_x86%5f64_base_pkglist.hasher)
> 4.13.0.1-alt5(/var/lib/apt/lists/_ALT_Sisyphus_x86%5f64_base_pkglist.classic)
> 
> Reverse Depends: 
>   python-module-rpm,librpmbuild7 4.13.0.1-alt5
>   librpm-devel,librpmbuild7 4.13.0.1-alt5
>   rpmspec,librpmbuild7 4.13.0.1-alt5
>   rpmspec,librpmbuild7 4.13.0.1-alt5:uuu+22.33
>   python3-module-rpm,librpmbuild7 4.13.0.1-alt5:uuu+22.33
>   python-module-rpm,librpmbuild7 4.13.0.1-alt5:uuu+22.33
>   librpmbuild7-debuginfo,librpmbuild7 4.13.0.1-alt5:uuu+22.33
>   librpm-devel,librpmbuild7 4.13.0.1-alt5:uuu+22.33
>   i586-librpmbuild7.32bit,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
>   rpmspec,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
>   python3-module-rpm,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
>   python-module-rpm,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
>   librpm-devel,librpmbuild7 4.13.0.1-alt5:sisyphus+219346.60.4.1
> Dependencies: 
> 4.13.0.1-alt5 - libc.so.6(GLIBC_2.15)(64bit) (0 (null)) libcap.so.2()(64bit) (2
> set:igZaxnO5jf) libmagic.so.1()(64bit) (2 set:jg7D3mxom31mc01)
> libpopt.so.0()(64bit) (2 set:jftck0pY4jRJWvaCunRMZrjSd) librpm7 (5
> 4.13.0.1-alt5) 
> 4.13.0.1-alt5 - libc.so.6(GLIBC_2.15)(64bit) (0 (null)) libcap.so.2()(64bit) (2
> set:igZaxnO5jf) libmagic.so.1()(64bit) (2 set:jg7D3mxom31mc01)
> libpopt.so.0()(64bit) (2 set:jftck0pY4jRJWvaCunRMZrjSd) librpm7 (5
> 4.13.0.1-alt5:uuu+22.33) 
> 4.13.0.1-alt5 - libc.so.6(GLIBC_2.15)(64bit) (0 (null)) libcap.so.2()(64bit) (2
> set:igZaxnO5jf) libmagic.so.1()(64bit) (2 set:jg7D3mxom31mc01)
> libpopt.so.0()(64bit) (2 set:jftck0pY4jRJWvaCunRMZrjSd) librpm7 (5
> 4.13.0.1-alt5:sisyphus+219346.60.4.1) 
> Provides: 
> 4.13.0.1-alt5 - librpmbuild7 librpmbuild.so.7()(64bit) 
> 4.13.0.1-alt5 - librpmbuild7 librpmbuild.so.7()(64bit) 
> 4.13.0.1-alt5 - librpmbuild7 librpmbuild.so.7()(64bit) 
> Reverse Provides: 
> librpmbuild7 4.13.0.1-alt5
> librpmbuild7 4.13.0.1-alt5
> librpmbuild7 4.13.0.1-alt5
> 
> We shall test the "apt-get install" command in this case, too.

In this case, the result is a bit different (but it's OK, the best we can get, because the inter-subpackage deps of the initially installed package are not strict enough). At least, the transaction made up by APT doesn't fail when it is processed by RPM:

[root@ovicaa ~]# apt-get install librpmbuild7
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
  librpm7
The following packages will be upgraded
  librpm7 librpmbuild7
2 upgraded, 0 newly installed, 0 removed and 2168 not upgraded.
Need to get 0B/492kB of archives.
After unpacking 0B of additional disk space will be used.
Do you want to continue? [Y/n] 
=== apt-printchanges ===
==librpm7 librpmbuild7==
* Tue Jan 15 2019 Vladimir D. Seleznev <vseleznv@altlinux.org> 4.13.0.1-alt5
- implemented DistTag support when comparing package versions;
- fixed handling of ancient packages (closes: #33710);
- rpmquery: disabled glob by default (thx Dmitry V. Levin; closes: #35828);
- fixed manifest comments handling (thx Dmitry V. Levin; closes: #35125);
- dirty hacked to make upgrade packages between branches possible;
- rpmpopt: made query info command display DistTag;
- spec: removed excess %EVR in intersubpackages dependencies.
Committing changes...
Preparing...                                                                                                                                                      #################################################################################################### [100%]
Updating / installing...
1: librpm7-4.13.0.1-alt5                                                                                                                                          #################################################################################################### [ 25%]
2: librpmbuild7-4.13.0.1-alt5                                                                                                                                     #################################################################################################### [ 50%]
Cleaning up / removing...
3: librpmbuild7-4.13.0.1-alt5                                                                                                                                     #################################################################################################### [ 75%]
4: librpm7-4.13.0.1-alt5                                                                                                                                          #################################################################################################### [100%]
Done.
[root@ovicaa ~]#
Comment 3 Dmitry V. Levin 2019-02-13 05:05:19 MSK
I suppose it was fixed in 4.13.0.1-alt6.