Bug 552818 - [RFE MD change] yum should know Requires(pre,post) flag for depsolving, and yum check
Summary: [RFE MD change] yum should know Requires(pre,post) flag for depsolving, and y...
Keywords:
Status: CLOSED DUPLICATE of bug 785690
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Seth Vidal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-06 08:41 UTC by Mamoru TASAKA
Modified: 2014-01-21 23:13 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-05-30 08:09:51 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
test spec file: dep1 (498 bytes, text/plain)
2010-01-06 14:18 UTC, Mamoru TASAKA
no flags Details
test spec file: dep2 (472 bytes, text/plain)
2010-01-06 14:21 UTC, Mamoru TASAKA
no flags Details

Description Mamoru TASAKA 2010-01-06 08:41:27 UTC
Description of problem:
rpm-4.8.0-0.beta1.5.i686
yum-3.2.25-8.fc13.noarch
jadetex-3.13-8.fc12.noarch

On my system:
[root@localhost ~]# env LANG=C yum check
jadetex-3.13-8.fc12.noarch missing requires policycoreutils
Error: check all

However:
[root@localhost ~]# env LANG=C rpm -q --whatrequires policycoreutils
no package requires policycoreutils

Actually:
[tasaka1@localhost ~]$ rpm -qv --requires jadetex
interp: /bin/sh  
post: /bin/sh  
postun: /bin/sh  
manual: jade  
post: policycoreutils  
rpmlib: rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib: rpmlib(FileDigests) <= 4.6.0-1
rpmlib: rpmlib(PayloadFilesHavePrefix) <= 4.0-1
manual: sgml-common >= 0.5
manual: tex(latex)  
manual: texlive  
post: texlive  
rpmlib: rpmlib(PayloadIsXz) <= 5.2-1

So policycoreutils is required as Requires(post) and as far
as I am correct rpm allows to remove dependency for Requires(post)
once the package (in this case jadetex) is correctly installed
(like my current system).

I think as rpm reports that "no package requires policycoreutils"
yum should not report dependency for Requires(post) or so with
"yum check"

Comment 1 James Antill 2010-01-06 13:40:35 UTC
Well yum check operates on the same data the rest of yum has, so if "yum remove" wouldn't work then "yum check" will complain about it.

I guess you could change this to an RFC that yum should know about the post flag, but that'd require huge changes (and I'm not sure we can tell if it's just Require(post) or if you've got Require(postun), the later mneaning we can't remove it).

Comment 2 Mamoru TASAKA 2010-01-06 14:18:00 UTC
Well, with a short test it seems that dependency for Requires(pre) 
and Requires(post) can be removed after installing a rpm completes, 
however the dependency for Requires(preun) or Requires(postun) 
cannot be removed.

Now changing to RFE.

Comment 3 Mamoru TASAKA 2010-01-06 14:18:51 UTC
Created attachment 381999 [details]
test spec file: dep1

Comment 4 Mamoru TASAKA 2010-01-06 14:21:45 UTC
Created attachment 382000 [details]
test spec file: dep2

With the attached dep1.spec and dep2.spec,
# rpm -ivh dep1 dep2
# rpm -e dep2
# yum remove dep1

shows the following messages:
[root@localhost noarch]# env LANG=C yum -y remove dep1
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package dep1.noarch 0:0-1.fc set to be erased
--> Finished Dependency Resolution

Dependencies Resolved

==================================================
 Package    Arch    Version   Repository  Size
==================================================
Removing:
 dep1       noarch  0-1.fc    installed    0.0 

Transaction Summary
==================================================
Remove        1 Package(s)
Reinstall     0 Package(s)
Downgrade     0 Package(s)

Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
dep1-0-1.fc.noarch missing requires dep2
jadetex-3.13-8.fc12.noarch missing requires policycoreutils
  Erasing        : dep1-0-1.fc.noarch       1/1 

Removed:
  dep1.noarch 0:0-1.fc                                                                         

Complete!

Comment 5 James Antill 2010-01-06 16:29:37 UTC
 Ok, writing a quick test program:

http://james.fedorapeople.org/yum/commands/rpm-dump-prco.py

...we seem to have all the data we need, now we "just" have to change all the yum internals to keep it around and add it to the repo metadata.

Comment 6 Panu Matilainen 2013-05-30 08:09:51 UTC
This forgotten bug has actually been long since fixed via what is essentially a dupe of this (bug 785690). The bogus error is now gone:

[root@localhost rpm]# rpm -Uvh /home/pmatilai/rpmbuild/RPMS/noarch/dep2-0-1.fc18.noarch.rpm /home/pmatilai/rpmbuild/RPMS/noarch/dep1-0-1.fc18.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:dep2-0-1.fc18                    ################################# [ 50%]
   2:dep1-0-1.fc18                    ################################# [100%]
[root@localhost rpm]# rpm -e dep2
[root@localhost rpm]# yum check
Loaded plugins: langpacks, presto, refresh-packagekit, tsflags
check all
[root@localhost rpm]# yum remove dep1
Loaded plugins: langpacks, presto, refresh-packagekit, tsflags
Resolving Dependencies
--> Running transaction check
---> Package dep1.noarch 0:0-1.fc18 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package        Arch             Version              Repository           Size
================================================================================
Removing:
 dep1           noarch           0-1.fc18             installed           0.0  

Transaction Summary
================================================================================
Remove  1 Package

Installed size: 0  
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Erasing    : dep1-0-1.fc18.noarch                                         1/1 
  Verifying  : dep1-0-1.fc18.noarch                                         1/1 

Removed:
  dep1.noarch 0:0-1.fc18                                                        

Complete!
[root@localhost rpm]#

*** This bug has been marked as a duplicate of bug 785690 ***


Note You need to log in before you can comment on or make changes to this bug.