[Yum-devel] [PATCH][RFC] Add skip-broken to YumBase
Tim Lauridsen
tim.lauridsen at googlemail.com
Thu Nov 15 10:22:42 UTC 2007
I have created at patch to add skip-broken functionality to YumBase.
I works the following way:
1. I have added some code to the depsolver to store packages with
problems in the self.po_with_problems dict. So we have the po with
problems when the depsolving is completed.
2. I have added a extra 'skip-broken' parameter to
YumBase.buildTransaction to control if we want to skip packages with
problem from the transaction. (default = no)
3. if the skip-broken parameter is True, then we do
While "There is problems"
Remove the packages from the transaction
Depsolve
It will remove packages with problem from the transaction and desolve
again until all problems are gone or the transaction is empty.
I have attached a test script and some test packages to provoke dep errors.
foo-1.0-1.fc8.noarch.rpm:
Requires: foobar > 1.1.0 ( This should fails always )
bar-1.0-1.fc8.noarch.rpm:
Requires: bar ( This should fails if foo is not in the transaction )
# sudo python test-skipbroken.py
Will do normal depsolvning and report depsolve error.
# sudo python test-skipbroken.py --skip-broken
Will first remove the foo packages, because nothing provides foobar.
Then bar will fail because there is no longer anything providing foo.
bar will be removed and the transaction will complete.
to test how it look when all packages is removed, just comment out
txmbr = yb.install(name='BackupPC')
and run
# sudo python test-skipbroken.py --skip-broken
Tim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Added-skip-broken-packages-functionality-to-YumBase.patch
Type: text/x-patch
Size: 4521 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20071115/11c9188b/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-skipbroken.py
Type: text/x-python
Size: 889 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20071115/11c9188b/attachment.py
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bar-1.0-1.fc8.noarch.rpm
Type: application/x-rpm
Size: 2081 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20071115/11c9188b/attachment-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo-1.0-1.fc8.noarch.rpm
Type: application/x-rpm
Size: 2088 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20071115/11c9188b/attachment-0002.bin
More information about the Yum-devel
mailing list