pax_global_header00006660000000000000000000000064116205206630014513gustar00rootroot0000000000000052 comment=ccf29c9525c1b39498d37384ede1a12bec766a1b yum-utils-1.1.31/000077500000000000000000000000001162052066300135465ustar00rootroot00000000000000yum-utils-1.1.31/.gitignore000066400000000000000000000000661162052066300155400ustar00rootroot00000000000000*~ *.bak *.pyc *.pyo .project .pydevproject *.tar.gz yum-utils-1.1.31/COPYING000066400000000000000000000430701162052066300146050ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. yum-utils-1.1.31/ChangeLog000066400000000000000000006046721162052066300153370ustar00rootroot000000000000002011-08-10 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.31 2011-08-10 Tim Lauridsen * ChangeLog: updated ChangeLog 2011-08-10 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.31 2011-08-03 Shawn Starr * docs/yum-utils.1: Update yum-utils man page, to add new utils. 2011-07-25 James Antill Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: (3 commits) typo leaving .conf in ybc.conf.yumvar should just be ybc.yumvar ... 2011-07-25 James Antill * plugins/aliases/aliases: Add some new aliases, fix chkD. 2011-07-25 Seth Vidal * yum-config-manager.py: typo leaving .conf in ybc.conf.yumvar should just be ybc.yumvar 2011-07-12 James Antill * plugins/security/security.py: Also auto-apply --security when given --sec-severity for other commands. 2011-07-08 Ville Skyttä * yum-utils.bash: Add repoquery @group completion. 2011-07-08 Ville Skyttä * repoquery.py: Fix "nitmes" typo in previous commit. 2011-07-06 James Antill * repoquery.py: Fix typo 2011-06-29 James Antill * repoquery.py: Allow @foo groups as a packages selector in repoquery. 2011-06-25 Ville Skyttä * plugins/aliases/aliases.py, plugins/security/security.py, plugins/versionlock/versionlock.py: Remove some unused local variables and imports flagged by pyflakes. 2011-06-24 Ville Skyttä * debuginfo-install.py, package-cleanup.py, yum-builddep.py, yum-complete-transaction.py: Check doUtilBuildTransaction return value, exit early on failure. BZ 716267 2011-06-22 James Antill * plugins/security/security.py: Try to be clever when sorting the security severities. 2011-06-17 Raman Gupta * plugins/merge-conf/merge-conf.py: After (external) merge is complete, give user option to delete other file 2011-06-17 Raman Gupta * plugins/merge-conf/merge-conf.py: Support meld as well as vimdiff for merging When using meld, the left side has the "other file" i.e. the file with the .rpmnew or .rpmsave extension. The right side has the "final file" i.e. the target file into which changes have to be merged. If the rpm action was to save the existing conf file, then the left side will be the original conf file (.rpmsave) and the right side will be the new rpm-based configuration. The user should merge any changes they want to keep from their old .rpmsave from left to right. If the rpm action was to keep the existing conf file, then the left side will be the new conf file (.rpmnew) and right side will be the current local configuration. The user should merge any changes in the new rpm file into their local config from left to right. Ideally these operations would be 3-way diffs between the local file and the new rpm config, using the original rpm config as the common merge base. However, the original rpm config is not available to yum and therefore a 3-way diff is not possible. Perhaps a future enhancement would be to use a .orig file, if present, as the merge base for meld. When using vimdiff, the order has not changed. The first parameter to vimdiff is the "final: file i.e. the target file, and the second parameter is the "other" file i.e. the .rpmnew or .rpmsave file. 2011-06-10 James Antill * repodiff.py: Huge speedup for large number of add/remove obsoletes processing. 2011-06-09 Nick Jacek * yumdownloader.py: Stops yumdownloader from attempting to download the same package twice if it is available in multiple repos. BZ 711767 2011-06-10 James Antill * docs/repodiff.1, repodiff.py: Add --compare-arch for the other side of the multilib. diff. BZ 710579. 2011-06-09 Nick Jacek * repodiff.py: Changed archlist set up to handle multilib. BZ 710579 2011-06-01 James Antill * docs/repoquery.1: Add releasever and setopt docs. from yum to repoquery. BZ 638542. 2011-05-20 Seth Vidal * yum-utils.spec: frelling pyyaml pkg named with weird case 2011-05-20 Seth Vidal * plugins/puppetverify/puppetverify.conf, plugins/puppetverify/puppetverify.py, yum-utils.spec: add puppetverify plugin 2011-05-18 Frank Weltersbach * docs/package-cleanup.1: Fix typo in package-cleanup man page. BZ 705617. 2011-05-17 Seth Vidal * repoquery.py: - fix rh bug: #705179 - fix fmt_queryformat not being happy with new 'output' formats passed everywhere else. 2011-04-26 James Antill * yumdownloader.py: Allow files/provides to be used in yumdownloader. 2011-04-26 James Antill * yumdownloader.py: Exit with code 2, if we can't download the packages asked for. BZ 699469. 2011-04-26 James Antill * plugins/auto-update-debuginfo/auto-update-debuginfo.py: try/except the open, for the rpmdbv cached data (a-u-d plugin). 2011-04-24 Ville Skyttä * yum-utils.bash: Add yum-debug-dump completion. 2011-04-24 Ville Skyttä * yum-debug-dump.py: Mention filename arg in yum-debug-dump usage message. 2011-04-24 Ville Skyttä * yum-debug-dump.py: Make yum-debug-dump.py executable for running in-place. 2011-04-24 Ville Skyttä * yum-utils.bash: Use functions from recent bash-completion if available. 2011-04-06 James Antill * repoquery.py, yum-groups-manager.py: Convert repoquery/yum-groups-manager to use preconf only. BZ 694188. 2011-04-06 James Antill * package-cleanup.py: For leaf-regexp don't match libreoffice, and match *-data package. 2011-03-30 James Antill * yum-builddep.py: Also obey .conf.gpgcheck in builddep. 2011-03-30 James Antill * yum-builddep.py: Obey .conf.localpkg_gpgcheck in builddep. 2011-03-30 James Antill * docs/Makefile, docs/show-changed-rco.1, show-changed-rco.py, yum-utils.spec: Add COPYRIGHT info. and docs for show-changed-rco. 2011-03-29 Seth Vidal * needs-restarting.py: clean up the nulls from the delimiters in proc 2011-03-28 James Antill * show-changed-rco.py: Added --ignore-arch and --skip-new to show-changed-rco. 2011-03-15 James Antill * Makefile, yum-utils.spec: Add show-changed-rco to the install. 2011-03-15 James Antill * show-changed-rco.py: Show how a new package version changes in requires/conflicts/obsoletes. 2011-03-15 James Antill * plugins/fs-snapshot/fs-snapshot.py: Add import yum.misc, and fix kernel_inst typos. BZ 669178. 2011-03-10 James Antill * yum-config-manager.py: Port the interpreted sections code from yum's writeRawRepoFile(). Also do the same thing for interpreted values, like baseurl. 2011-03-10 Pierre-Yves Chibon * docs/repoquery.1, repoquery.py: Fix bug in repoquery (Dot => DotPlot) and update repoquery man page. 2011-03-02 James Antill * docs/yumdownloader.1: Add --archlist to yumdownload man page. 2011-03-02 James Antill * plugins/fs-snapshot/fs-snapshot.py: Fix YumPluginExit => PluginYumExit typo. 2011-03-01 Panu Matilainen * plugins/changelog/changelog.py: Avoid unnecessary po header access in changelog plugin Accessing the hdr member of package objects makes yum to keep the entire header in memory forever after, causing huge memory bloat when we're jumping through hoops to conserve memory. 2011-02-28 James Antill * plugins/local/local.conf, plugins/local/local.py: Change deltas to enable_deltas and num-deltas to deltas. 2011-02-26 Alexander Todorov * plugins/local/local.conf: document newly added config options and the repodir option 2011-02-26 Alexander Todorov * plugins/local/local.py: add option to enable/disable createrepo if desired 2011-02-26 Alexander Todorov * plugins/local/local.py: enable delta rpms in the local repository 2011-02-25 Ville Skyttä * yum-utils.bash: Update repoquery completion with current options. 2011-02-25 Ville Skyttä * repoquery.py: Fix --level text in repoquery --help. 2011-02-22 Ville Skyttä * docs/show-installed.1, show-installed.py: Fix "rpm -qa" example formatting for show-installed -i in --help output and man page. 2011-02-16 Tim Lauridsen * plugins/auto-update-debuginfo/auto-update-debuginfo.py: Fix auto-update-debuginfo plugin to not break if the is and option object but no repos option (yumex) 2011-02-04 James Antill * yumutils/i18n.py: Have to put the function definitions before the assignments, BZ 674584 2011-01-25 James Antill * plugins/fs-snapshot/fs-snapshot.py: Hard failure when fs-snapshot can't create a snapshot. BZ 669178. Also, only show the kernel /boot warning when a kernel is within the transaction. 2011-01-15 Pierre-Yves * repoquery.py: Update arguments - Remove --show-dupes from --help (while the argument still works) - Remove --tree-* from --help (while the argument still works) - Implement the --output[text|ascii-tree|dot-tree] (default to 'text') argument - Implement the --level[all|any int] (default to 'all') argument The combination of --requires --output=ascii-tree --level=all reproduce the behavior of --tree-requires same goes for: --whatrequires --output=ascii-tree vs --tree-whatrequires --obsoletes --output=ascii-tree vs --tree-obsoletes --conflicts --output=ascii-tree vs --tree-conflicts Use the propagation of the dot object to determine if it is a tree or a dot tree 2011-01-21 Seth Vidal * repoclosure.py: make sure resolve_sack is empty and exists - if we get a wacky, but caught error from whatProvides we don't want to inadvertently give it back old/invalid results and/or traceback b/c the variable doesn't exist 2011-01-13 Tim Lauridsen * ChangeLog: updated ChangeLog 2011-01-13 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.30 2011-01-10 Seth Vidal * plugins/verify/verify.py: when we run verify make sure we call the verify_plugins_callback so we can pick up any verify modification plugins in our output 2011-01-03 Tim Lauridsen * Makefile, plugins/aliases/aliases.py, yum-utils.spec, yumutils/Makefile, yumutils/__init__.py, yumutils/i18n.py: Added yumutils python module with i18n handling code 2010-12-30 Tim Lauridsen * Makefile, plugins/aliases/aliases.py, po/Makefile, po/POTFILES.in, po/da.po, po/yum-utils.pot, yum-utils.spec: Added translation support to yum-utils Added working translation to yum-plugin-aliases 2010-12-20 Ville Skyttä * yum-utils.bash: Simplify various completions by just invoking yum's functions ignoring stderr. 2010-12-20 Ville Skyttä * yum-utils.bash: Add debuginfo-install completion. 2010-12-20 Ville Skyttä * yum-utils.bash: Use yum's base option completion in package-cleanup and yum-builddep if available. 2010-12-10 Seth Vidal * repoquery.py: add sourcerpm to default output of repoquery -i rh bug: https://bugzilla.redhat.com/show_bug.cgi?id=661827 2010-12-10 James Antill * repoquery.py: Don't set basearch if it's src, because that's not valid (esp. for MM etc.) 2010-12-08 Ville Skyttä * yum-utils.bash: Add basic yum-builddep completion (no support for options yet). 2010-12-03 James Antill * plugins/auto-update-debuginfo/auto-update-debuginfo.py: Obey manual --disablerepo in auto-up-di plugin. 2010-11-24 Panu Matilainen * yum-builddep.py: Teach yum-builddep to install buildrequires parsed directly from spec - Split the actual install part out of get_build_deps() to avoid code duplication - If rpm-python supports it, accept spec files as arguments and grab buildrequires directly out of the parsed spec 2010-11-24 James Antill * plugins/fastestmirror/fastestmirror.py: Don't crash when we can't unlink the hostfilepath. BZ 650468. 2010-11-16 James Antill * docs/yum-versionlock.1, docs/yum-versionlock.conf.5, plugins/versionlock/versionlock.py: Add excludes functionality to versionlock. Document command. 2010-11-12 James Antill * plugins/auto-update-debuginfo/auto-update-debuginfo.py: Add rpmdb caching to a-u-di. 2010-11-12 James Antill * plugins/auto-update-debuginfo/auto-update-debuginfo.py: Be less verbose in a-u-di. 2010-11-09 Seth Vidal * plugins/priorities/priorities.py: add global check_obsoletes for exclude hook. closes rh bug#651598 2010-11-07 Tim Lauridsen * ChangeLog: updated ChangeLog 2010-11-07 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.29 2010-11-07 Tim Lauridsen * Makefile: Make a better test-release Makefile target 2010-11-07 Tim Lauridsen * test/yum-utils-pylintrc: fix config file format changes for pylint in F14 2010-11-04 James Antill * plugins/security/security.py: Add --sec-severity, and deal with severity data in updateinfo. 2010-11-04 James Antill * plugins/aliases/aliases: Some more aliases. 2010-11-01 James Antill * repoquery.py: Use arch as well as name in fmt_requires. 2010-10-26 Seth Vidal * yum-utils.spec: add 3.2.29 requirement for repoquery --search 2010-10-26 Seth Vidal * repoquery.py: - fix repoquery for the bizarre empty results and the traceback on bad input - also needs a fix for yum 3.2.29 in the searchGenerator :( 2010-10-26 Seth Vidal * repoquery.py: add --search and --searchfields to repoquery 2010-10-06 Florian Festi * Makefile, docs/show-installed.1, docs/yum-utils.1, repoclosure.py, show-installed.py, yum-utils.spec: show-installed, a new tool to give a compat description of the packages installed on the system making use of dependencies and comps groups 2010-10-26 James Antill * docs/yumdb.8, yumdb.py: Add yumdb copy-force, for symmetry with rename-force. 2010-10-26 James Antill * yumdb.py: Cleanup yumdb rename/rename-force, and make the difference more obvious. 2010-10-26 James Antill * docs/yumdb.8, yumdb.py: Add a yumdb sync command, for failed transactions. 2010-10-26 James Antill * repodiff.py: Disable any excludes in repodiff. 2010-10-13 James Antill * plugins/priorities/priorities.py: Only display priorities message, if we did something. 2010-10-13 James Antill * plugins/priorities/priorities.py: Speedup priorities: Reuse rawobsoletes. 2010-10-13 Seth Vidal * plugins/auto-update-debuginfo/auto-update-debuginfo.py: make all debuginfo repos enabled by auto-update-debuginfo be set to skip_if_unavailable=True Also change some variable names so I don't go blind when reading this code trying to figure out if 'repos' is the repos object or something else. 2010-10-11 James Antill * yum-debug-dump.py: Fix the filename argument handling in yum-debug-dump, BZ 641837 2010-10-05 James Antill * plugins/tmprepo/tmprepo.py: Obey --nogpgcheck in --tmprepo repos. Use pkgs_gpgcheck/etc. for defaults. 2010-10-04 James Antill * repoquery.py: Fix unicide in repoquery --installed -a --changelog. 2010-10-04 Seth Vidal * plugins/changelog/changelog.py: to_unicode() on the changelog output as per ticket 610 - thanks to Richard Fearn for the suggestion 2010-10-04 James Antill * plugins/tmprepo/tmprepo.conf: Fix the text in the config. file for the tmprepo plugin. 2010-09-20 Casey Jao * plugins/remove-with-leaves/remove-with-leaves.py: Remove-with-leaves plugin: check install reason 2010-09-13 James Antill * docs/debuginfo-install.1, docs/yum-list-data.1: Fix typos in man page, "pacakges" => packages. BZ 632857 2010-09-10 James Antill * repoquery.py: Make --groupmember have sorted output. 2010-09-09 Seth Vidal * repoquery.py: when --groupmember is specified output the groups per pkg not just as one lump intermixed pkgname @groupname @groupname2 pkgname2 @groupname @groupname3 etc 2010-08-26 Seth Vidal * plugins/tsflags/tsflags.py: stop using setConfigOption in tsflags plugin 2010-08-19 James Antill * docs/yum-security.8: Update the docs. for "yum-security". 2010-08-19 James Antill * plugins/security/security.py: Use .text() for notices, to drop files output by default. 2010-08-10 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: Don't display 0: for epoch, on installed kernels security warning Choose the sub-command more intelligently, depending on the args. (or lack) Display multiple certs, on newer yums ... almost certainly not though 2010-08-10 Seth Vidal * repoclosure.py: fix the url-based repofrompaths with repoclosure from having the wrong prefix prepended to them closes rh bug 622710 2010-08-09 James Antill * plugins/security/security.py: Don't display 0: for epoch, on installed kernels security warning 2010-08-09 James Antill * plugins/security/security.py: Choose the sub-command more intelligently, depending on the args. (or lack) 2010-08-09 James Antill * plugins/keys/keys.py: Display multiple certs, on newer yums ... almost certainly not though 2010-08-05 Seth Vidal * repoquery.py: catch repoErrors when we go to matchPkgs since that's where they end up getting setup. partial fix for rh bug #621639 2010-08-04 Ville Skyttä * yum-utils.bash: Add repoquery --lookaside bash completion. 2010-08-04 Ville Skyttä * yum-utils.bash: Add repoquery --tree-* bash completions. 2010-08-04 Ville Skyttä * repoquery.py: --tree-whatrequires help string typo fix. 2010-08-04 Ville Skyttä * yum-utils.bash: Add bash completion for repodiff. 2010-08-03 Seth Vidal * yum-utils.spec: add copying to each plugin for fedora policies 2010-08-03 Dennis Gregorovic * repoclosure.py: add --lookaside switch for depsolving against a repo without depsolving the repo itself 2010-08-03 Tim Lauridsen * ChangeLog: updated ChangeLog 2010-08-03 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.28 2010-08-03 James Antill * repoquery.py: Fix pylint warnings (all false positives, I think). 2010-08-03 Tim Lauridsen * repoquery.py: fix pylint errors ************* Module repoquery W0211:283:pkgQuery._tree_print_req: Static method with 'self' as first argument W0601:325:pkgQuery._fmt_tree_prov: Global variable '__req2pkgs' undefined at the module level W0601:430:pkgQuery.fmt_tree_what_requires: Global variable '__prov2pkgs' undefined at the module level E0602:399:pkgQuery.fmt_tree_obsoletes.obs2pkgs: Undefined variable 'obbs' E1120:364:pkgQuery._fmt_tree_prov: No value passed for parameter 'level' in function call E1120:373:pkgQuery._fmt_tree_prov: No value passed for parameter 'level' in function call E1120:463:pkgQuery.fmt_tree_what_requires: No value passed for parameter 'level' in function call E1120:476:pkgQuery.fmt_tree_what_requires: No value passed for parameter 'level' in function call E1120:413:pkgQuery.fmt_tree_obsoletes: No value passed for parameter 'level' in function call E1120:420:pkgQuery.fmt_tree_obsoletes: No value passed for parameter 'level' in function call 2010-08-03 Tim Lauridsen * plugins/ps/ps.py, plugins/security/security.py: fix pylint erros ************* Module ps W0311: 45: Bad indentation. Found 8 spaces, expected 4 W0311: 47: Bad indentation. Found 8 spaces, expected 4 W0311: 48: Bad indentation. Found 8 spaces, expected 4 W0311: 49: Bad indentation. Found 12 spaces, expected 8 W0311: 50: Bad indentation. Found 16 spaces, expected 12 W0311: 51: Bad indentation. Found 20 spaces, expected 16 W0311: 52: Bad indentation. Found 24 spaces, expected 20 W0311: 53: Bad indentation. Found 20 spaces, expected 16 W0311: 55: Bad indentation. Found 8 spaces, expected 4 W0311: 56: Bad indentation. Found 12 spaces, expected 8 W0311: 57: Bad indentation. Found 8 spaces, expected 4 W0611: 26: Unused import yum ************* Module security W0611: 47: Unused import logginglevels 2010-08-03 Tim Lauridsen * repoquery.py: fix pylint errors ************* Module repoquery W0301:322: Unnecessary semicolon W0301:426: Unnecessary semicolon E0213:267:pkgQuery.tree_print_req: Method should have "self" as first argument E0213:272:pkgQuery.pkg2uniq: Method should have "self" as first argument E0602:274:pkgQuery.pkg2uniq: Undefined variable 'self' E0602:274:pkgQuery.pkg2uniq: Undefined variable 'self' E0213:277:pkgQuery.pkg2val: Method should have "self" as first argument 2010-08-03 James Antill * plugins/security/security.py: Use print instead of log for security output so -q "works", trac 307 2010-08-03 James Antill * plugins/security/security.py: Fix bug for when not using "all", bah. 2010-08-03 James Antill * plugins/security/security.py: Add installed mark, when using list/info "all". Fix usage text. 2010-08-02 James Antill * plugins/security/security.py: Big changes to security plugin command: . Move list, info, summary under a single "updateinfo" command. . Allow each command to see "available", "installed", "updates" or "all". So you can easily see what has been applied as well as what is to be applied. . Should be fully backward compat. . Cleanup some output. ...plugin now approached ridiculously badly named status. 2010-08-02 Seth Vidal * repomanage.py: get rid of exception.message deprecated use 2010-08-02 Seth Vidal * repomanage.py: remove completely unused exception definition from repomanage altogether 2010-07-30 James Antill * yum-config-manager.py: Fix unicide in yum-config-manager, BZ 619851 2010-07-29 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: Accept "*" to mean all arches. 2010-07-29 Seth Vidal * yum-config-manager.py: add '--add-repo' option to yum-config-manager to allow adding repos from: http://someserver/foo.repo or http://someplace/this/is/a/repo/ and setting them up, trivially. 2010-07-27 Dennis Gregorovic * repodiff.py: Accept "*" to mean all arches. 2010-07-27 James Antill * repodiff.py: Don't traceback when --size isn't given. 2010-07-22 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: Fix some minor problems with return codes in updateonboot initscript Fix annoying warnings for non-cli yum callers 2010-07-22 Seth Vidal * repodiff.py: add --simple option to repodiff to condense its output a lot. 2010-07-14 James Antill * updateonboot/yum-updateonboot.init: Fix some minor problems with return codes in updateonboot initscript 2010-07-07 James Antill * plugins/ps/ps.py: Fix annoying warnings for non-cli yum callers 2010-07-06 Seth Vidal * debuginfo-install.py, package-cleanup.py, yum-builddep.py, yum-complete-transaction.py: optionally call doUtilBuildTransaction(), if available for all the utils that need to do that 2010-06-30 Seth Vidal * repoquery.py: - make queryErrors be normal for python exceptions - make whatrequres/provides/conflicts/obsoletes work with --installed or pkgnarrow=installed or all 2010-06-25 James Antill * repoquery.py: Fix doQuery() passing yb keyword, leftover snafu from tree-* args. change 2010-06-22 James Antill * plugins/ps/ps.py, yum-utils.spec: Allow "ps" plugin to work on much older yum versions 2010-06-21 James Antill * plugins/ps/ps.conf, plugins/ps/ps.py, yum-utils.spec: Add ps plugin, to show info about running commands. 2010-06-18 James Antill * docs/repoquery.1, repoquery.py: Have repoquery --archlist change preconf.arch too 2010-06-17 James Antill * docs/repoquery.1: Add docs for --tree-* 2010-06-16 James Antill * repoquery.py: Add --tree-requires, --tree-conflicts, --tree-obsoletes and --tree-whatrequires options to repoquery. These replace pkg-deps-tree-view.py and pkg-provs-tree-view.py, with conflicts and obsoletes added "for fun". Could do --tree-whatconflicts and --tree-whatobsoletes for even more fun, but I passed atm. 2010-06-15 Seth Vidal * reposync.py: get rid of keys() call to the FileTypes function 2010-06-14 Seth Vidal * repoquery.py: add repo. like yumdb_info. for repoquery to keep arbitrary names out of the legacy of repoquery this makes: repoquery -q --qf "%{name} %{repo.name} %{repo.baseurl}" pkgname work correctly 2010-06-14 James Antill * repoquery.py: Fix reponame for installed 2010-06-14 James Antill * repoquery.py: Add reponame variable, as we can't use repo.name 2010-06-07 James Antill * repoquery.py: Don't pre-download filelists, often got this `wrong' with alldeps 2010-06-06 James Antill * repoquery.py: Fix stupid typo in repoquery, let non-installed packages work again 2010-06-06 Tim Lauridsen * ChangeLog: updated ChangeLog 2010-06-06 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.27 2010-06-05 Tim Lauridsen * debuginfo-install.py, plugins/keys/keys.py, yum-complete-transaction.py, yum-debug-dump.py, yumdownloader.py: Fix pylint errors ************* Module debuginfo-install W0611: 26: Unused import to_unicode ************* Module yum-complete-transaction E0602:238:YumCompleteTransaction.main: Undefined variable 'YumBaseError' ************* Module yum-debug-dump E1103:100:YumDebugDump.dump_yum_config_info: Instance of 'DummyYumPlugins' has no '_plugins' member (but some types could not be inferred) ************* Module yumdownloader W0611: 22: Unused import getCacheDir ************* Module keys E9905:229:KeysInfoCommand.show_key: Too many arguments for format string 2010-06-04 Seth Vidal * repodiff.py: to_unicode() summary for repodiff, too closes https://bugzilla.redhat.com/show_bug.cgi?id=600501 2010-06-04 James Antill * repoquery.py: Overridding .qf happens in doQuery, so we have to cache multiple translations 2010-06-04 James Antill * repoquery.py: Do the right thing for: --nevra --qf "blah" 2010-06-03 James Antill * yumdownloader.py: Have yumdownloader use yb.setCacheDir() so it goes the same location. BZ 599726 2010-06-03 Seth Vidal * yum-complete-transaction.py: handle corrupt transaction journals - catch the misc exception when the transaction file is corrupt - tell the user to file a bug b/c whatever made their file corrupt is probably not good for their fs - deals with https://bugzilla.redhat.com/show_bug.cgi?id=599574 2010-06-03 James Antill * repoquery.py: Sort the packages, when we have plain pkgs, basically free! 2010-06-03 James Antill * repoquery.py: Don't match '*' against each pkg. for all, just get all of them 2010-06-03 James Antill * repoquery.py: Don't convert the user qf for each package, when we can now do it once. 2010-06-03 James Antill * repoquery.py: Don't create N PkgQuery objects, when we can reuse them. 2010-06-02 James Antill * repoquery.py: Don't explicitly call doRepoSetup() 2010-06-02 James Antill * repoquery.py: Use .arch.archlist if available, also don't call .doTsSetup 2010-06-02 James Antill * repoquery.py: Use prerepoconf, if available 2010-06-02 James Antill * repoquery.py: Don't auto needfiles, when we are just looking at installed 2010-05-25 James Antill * repodiff.py: Fix comment typo 2010-05-24 James Antill * yum-config-manager.py: Don't save anything we don't have to, mainly enable/disable hack (should fix config. objects to not change unchanged things). 2010-05-21 James Antill * yum-builddep.py: Have yum-builddep just call .install(), deals with updates and multilib. 2010-05-21 James Antill * Makefile, yum-config-manager.py, yum-show-config.py, yum-utils.spec: Change show-config to config-manager, let people set stuff too. 2010-05-21 James Antill * Makefile, yum-show-config.py, yum-utils.spec: Add yum-show-config command, to let people see the config. as yum sees it. 2010-05-21 James Antill * repoquery.py: Fix the description of quiet (and tell people it's on by default). 2010-05-21 James Antill * repoquery.py: Add errormsg for bad repofrompath argument, make repoid not found an error 2010-05-20 James Antill * repomanage.py: Remove exception from getFileList() and return an empty list, BZ 587288. 2010-05-20 James Antill * repoquery.py: Tell the user about bad --repoid args, but only in non-quiet BZ 593786 2010-05-17 Ville Skyttä * docs/debuginfo-install.1, docs/yum-changelog.1, docs/yum-list-data.1, docs/yum-security.8: Man page formatting fixes. 2010-05-12 James Antill * repoquery.py: Sort package lists, in repoquery --whatrequires output. 2010-05-06 Ville Skyttä * yum-utils.bash: Include --installed in repoquery completions. 2010-05-05 Tim Lauridsen * plugins/fastestmirror/fastestmirror.py: fastestmirror: make it work as non-root user (Don't setup cache dir to early) (rhbz #537829) 2010-05-05 Tim Lauridsen * yum-complete-transaction.py: yum-complete-transaction : catch YumBaseError in transaction (rhbz #538748) 2010-05-03 Seth Vidal * repoquery.py: - allow querytags like yumdb_info.from_repo - make ValueErrors if you hit a bad rpmtag a lot nicer - stop the traceback - allow '.'s in fmt querys 2010-05-03 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: add missing import catch yum exception in --orphans (rhbz #582039) The protect-packages feature has been merged into core yum, removing it make package-cleanup handle custom kernel with an '-' in the kernel release (rhbz #539651) [fastestmirror] Bump version and update our changelog [fastestmirror] Patch from Kris Ven to add a 'include_only' option 2010-05-03 Seth Vidal * docs/repoquery.1, repoquery.py: add --installed option - adds pkgnarrow='installed' and disables all repos 2010-05-02 Tim Lauridsen * package-cleanup.py: add missing import 2010-05-02 Tim Lauridsen * package-cleanup.py: catch yum exception in --orphans (rhbz #582039) 2010-04-29 James Antill * plugins/protect-packages/protect-packages.conf, plugins/protect-packages/protect-packages.py, yum-utils.spec: The protect-packages feature has been merged into core yum, removing it 2010-04-29 Tim Lauridsen * package-cleanup.py: make package-cleanup handle custom kernel with an '-' in the kernel release (rhbz #539651) 2010-04-24 Luke Macken * plugins/fastestmirror/ChangeLog, plugins/fastestmirror/fastestmirror.py: [fastestmirror] Bump version and update our changelog 2010-04-24 Luke Macken * plugins/fastestmirror/fastestmirror.conf, plugins/fastestmirror/fastestmirror.py: [fastestmirror] Patch from Kris Ven to add a 'include_only' option 2010-04-20 Maxim Burgerhout * plugins/fs-snapshot/fs-snapshot.py: Don't require /sbin in the path for fs-snapshot to work 2010-04-20 James Antill * debuginfo-install.py, plugins/auto-update-debuginfo/auto-update-debuginfo.py: Add the repo setopts to auto-update-debuginfo 2010-04-20 Matt McCutchen * plugins/auto-update-debuginfo/auto-update-debuginfo.py: Stop calling doRepoSetup many times, in auto-update-debuginfo 2010-04-20 James Antill * debuginfo-install.py: Fixup setopt inheritence 2010-04-20 Matt McCutchen * debuginfo-install.py: Stop calling doRepoSetup many times, in debuginfo-install 2010-04-20 James Antill * debuginfo-install.py: Let debuginfo-install work without getOptionGroup 2010-04-20 James Antill * yum-groups-manager.py: Remove dead code block 2010-04-19 Ville Skyttä * plugins/verify/verify.py: Fix --verify-configuration-files CLI option. 2010-04-19 Ville Skyttä * repoquery.py: Don't bother grabbing changelog names and texts if we don't have times. 2010-04-19 Ville Skyttä * debuginfo-install.py, plugins/fastestmirror/fastestmirror-asyncore/fastestmirror-asyncore .py, plugins/tmprepo/tmprepo.py, repo-rss.py, repodiff.py, repoquery.py, repotrack.py, yum-groups-manager.py: Clean up some unused variables and imports. 2010-04-19 Ville Skyttä * Makefile: Run pylint on plugins/*/*/*.py too. 2010-04-18 James Antill * repodiff.py: Fix the actual bug in repodiff, comparison 2010-04-18 James Antill * repodiff.py: Yes, looking at code at 2am strikes again ... this was total crack. Revert "One more fix for the changelog time comparison" This reverts commit 3d9cf740ee9c9c2fbf8e408fe0eb2d46c1a88a00. 2010-04-18 James Antill * repodiff.py: One more fix for the changelog time comparison 2010-04-16 James Antill * repodiff.py: Use the newest old changelog entry, not the oldest ... *sigh* 2010-04-15 James Antill * repodiff.py: Fix typo on obsoletes check, in repodiff 2010-04-13 James Antill * docs/repodiff.1, repodiff.py: Add message about archlist usage, to stop people being confused. 2010-04-13 James Antill * repodiff.py: Fix obsoletes processing in repodiff, also giant speedup. Compared output both before and after and it was identical: 1. Original with 3.2.27: 8 minutes 27 seconds 2. Original with returnNewestByName() speedup: 1 minute 50 seconds. 3. New repodiff with 3.2.27: 11 seconds. ...tested with Updates/11 vs. Updates/12 on 2010-04-13. 2010-04-13 James Antill * repodiff.py: Stupid typo fix 2010-04-13 Michael Schwendt * repodiff.py: Get the newer "same day" changelog entries in repodiff. Tided by by James. 2010-04-10 Ville Skyttä * yum-utils.bash: Add copy to yumdb completions. 2010-04-09 Seth Vidal * reposync.py: fixes https://bugzilla.redhat.com/show_bug.cgi?id=580343 when we are dealing with compressed comps files just fetch the group not group_gz 2010-04-08 James Antill * plugins/fastestmirror/fastestmirror.conf, plugins/fastestmirror/fastestmirror.py: Use the yum configured cachedir value, in fastestmirror 2010-04-08 James Antill * docs/Makefile, docs/yumdb.8, yum-utils.spec, yumdb.py: Add yumdb man page, and yumdb copy command 2010-04-02 Ville Skyttä * plugins/fastestmirror/fastestmirror.py: Fix always_print_best_host conf setting. 2010-04-01 Ville Skyttä * yum-utils.bash: Add repoclosure --group completion. 2010-03-31 Dennis Gregorovic * repoclosure.py: Add a --group flag to filter packages by comps group 2010-03-31 Dennis Gregorovic * repoclosure.py: Include all packages listed in the pkgonly arg 2010-03-30 Ville Skyttä * package-cleanup.py, plugins/changelog/changelog.py, plugins/fastestmirror/fastestmirror-asyncore/fastestmirror-asyncore .py, plugins/fedorakmod/fedorakmod.py, plugins/fs-snapshot/fs-snapshot.py, plugins/post-transaction-actions/post-transaction-actions.py, plugins/priorities/priorities.py, plugins/protectbase/protectbase.py, plugins/remove-with-leaves/remove-with-leaves.py, plugins/upgrade-helper/upgrade-helper.py, repo-graph.py, repo-rss.py, repoclosure.py, repodiff.py, repomanage.py, repoquery.py, reposync.py, repotrack.py, yum-debug-dump.py: Use "in" instead of has_key. 2010-03-26 Ville Skyttä * yum-utils.bash: Complete on repomanage.py, package-cleanup.py, and verifytree.py. 2010-03-10 Ville Skyttä * yum-utils.bash: Add bash completion for yumdb. 2010-03-02 Tim Lauridsen * repoclosure.py: Make repoclosure work with relative paths, like ./myrepo or just . 2010-03-01 James Antill * package-cleanup.py: Add yum-utils to the run_with_packages when running pkg-cleanup 2010-03-01 James Antill * yum-complete-transaction.py: Add yum-utils to the run_with_packages when running y-c-t 2010-03-01 Seth Vidal * debuginfo-install.py: setup some repo features that make sense for the debug repos to inherit from the non-debug repos when we add them 2010-03-01 Seth Vidal * repoclosure.py: catch all yum errors and valueError (which is coming from yum.config.py :() generally this just means we'll get less ABRT errors and more reports from users (I hope) 2010-02-27 Ville Skyttä * repoquery.py: Fix --releasever. 2010-02-25 Seth Vidal * repoquery.py: move around where we query for pkgs from sackops/prcos and what happens if no special output format is specified in repoquery. makes: repoquery -qfi /bin/bash output -qi output rather than -q output. 2010-02-15 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: Make --alldeps the default in repoquery. 2010-02-15 Seth Vidal * repoquery.py: make repoquery pass in the whole string not just split for names 2010-02-10 Ville Skyttä Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils 2010-02-10 Tim Lauridsen * ChangeLog: updated ChangeLog 2010-02-10 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.26 2010-02-10 Tim Lauridsen * ChangeLog: updated ChangeLog 2010-02-10 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.26 2010-02-09 Ville Skyttä * docs/repoquery.1, repoquery.py, yum-utils.bash: Make --alldeps the default in repoquery. --alldeps is what people really almost always want, but fail to specify for some reason. --exactdeps can be used to get the previous default of exact matching. 2010-02-09 Ville Skyttä * docs/repoquery.1, repoquery.py, yum-utils.bash: Add --config option as the long variant of -c. 2010-02-03 Mike Snitzer * plugins/fs-snapshot/fs-snapshot.py: commit final fs-snapshot patch for mike 2010-02-03 Mike Snitzer * docs/yum-fs-snapshot.1, docs/yum-fs-snapshot.conf.5, plugins/fs-snapshot/fs-snapshot.conf, plugins/fs-snapshot/fs-snapshot.py: add lvm support for fs-snapshot plugin 2010-02-03 James Antill * yum-builddep.py: Minor builddep speedup, for srcnames lookup don't load all pkgs 2010-02-03 James Antill * yum-builddep.py: yum-builddep should do something useful for local .src.rpm files, BZ 561341 2010-02-03 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: Fix copy&paste from Makefile => .spec, $(var) => $var 2010-02-03 Seth Vidal * yum-builddep.py: move toActOn initialization up to avoid rh bug: https://bugzilla.redhat.com/show_bug.cgi?id=561341 2010-02-02 James Antill * yum-utils.spec: Fix copy&paste from Makefile => .spec, $(var) => $var 2010-02-02 Seth Vidal * needs-restarting.py: disable plugins on needs-restarting for rh bug: #561023 2010-02-01 James Antill * yum-util-cli-template: Change cli template: print_help => print format_help() al la. BZ 560369 2010-02-01 James Antill * repomanage.py, repoquery.py: Remove the rest of the print_help calls, unicide al la. BZ 560369 2010-02-01 Tim Lauridsen * package-cleanup.py: fix UnicodeDecode Error in package-cleanup for some locales like de_DE.utf8 (rhbz #560369) 2010-01-29 James Antill * yum-builddep.py: Don't refer to opts.source in yum-builddep 2010-01-28 James Antill * plugins/local/local.py: Fix the done message in the "local" plugin 2010-01-27 Tim Lauridsen * ChangeLog: updated ChangeLog 2010-01-27 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.25 2010-01-27 Tim Lauridsen * docs/Makefile: install fs-snapshot docs 2010-01-27 Tim Lauridsen * yum-utils.spec: make the /etc/yum.repos.d in buildroot 2010-01-27 Tim Lauridsen * yum-utils.spec: Added touch /etc/yum.repos.d/_local.repo to install section this need for for the ghost in files section of yum-plugin-local 2010-01-27 Tim Lauridsen * plugins/fs-snapshot/fs-snapshot.py, plugins/local/local.py, yum-builddep.py: fix pylint errors. ************ Module yum-builddep E0602:169:YumBuildDep.get_build_deps: Undefined variable 'opts' ************* Module fs-snapshot W0107: 47:pretrans_hook: Unnecessary pass statement W0107: 75:pretrans_hook: Unnecessary pass statement W0611: 32: Unused import sys ************* Module local W0601: 39:prereposetup_hook: Global variable 'local_repo_dir' undefined at the module level E0602:118:_rebuild: Undefined variable 'done' 2010-01-21 James Antill * yum-debug-dump.py: Add rpmdb versions to the dump file 2010-01-21 James Antill * yum-debug-restore.py: A couple of fixes for yum-debug-restore, and can now work across arch. Add --ignore-arch option. Don't traceback when not given an argument. Don't traceback when piped. Eg. | head -2 2010-01-20 James Antill * debuginfo-install.py: Put the debuginfo-install options in it's option group 2010-01-20 James Antill * debuginfo-install.py: Auto install the debuginfo plugin, when people install debuginfo packages 2010-01-20 Seth Vidal * repomanage.py: fix up error message from exception 2010-01-18 Seth Vidal * repoquery.py: make repofrompath use add_enable_repo from yumbase rather than its own thing fixes up using --group* commands from --repofrompath repos and also catches GroupsErrors properly at setup closes rh bug: https://bugzilla.redhat.com/show_bug.cgi?id=556215 2010-01-12 Seth Vidal * plugins/changelog/changelog.py: fix for bug: https://bugzilla.redhat.com/show_bug.cgi?id=546811 - make sure we catch valueerror later, too 2010-01-12 Seth Vidal * repo-graph.py: whoops - import sys, too 2010-01-12 Seth Vidal * repo-graph.py: catch yumbaseerror exceptions in repograph so it won't traceback if our repos aren't available for some reason: https://bugzilla.redhat.com/show_bug.cgi?id=548500 2010-01-12 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: Add --releasever to repoquery Fix source downloads, maybe. We parse all the info. from the sourcerpm 2010-01-12 Seth Vidal * yum-debug-restore.py: fix for rh bug: https://bugzilla.redhat.com/show_bug.cgi?id=551671 just make usage() -> print_usage() for optparser 2010-01-11 James Antill * repoquery.py: Add --releasever to repoquery 2010-01-08 James Antill * yum-builddep.py, yumdownloader.py: Fix source downloads, maybe. We parse all the info. from the sourcerpm field when we don't get a source package. Tested with: yumdownloader --source perl-IO-Compress-Zlib 2010-01-08 Gerhardus Geldenhuis * docs/debuginfo-install.1, docs/package-cleanup.1, docs/repo-rss.1, docs/repodiff.1, docs/repoquery.1, docs/reposync.1, docs/yum-aliases.1, docs/yum-builddep.1, docs/yum-changelog.1, docs/yum-complete-transaction.8, docs/yum-debug-dump.1, docs/yum-filter-data.1, docs/yum-fs-snapshot.1, docs/yum-fs-snapshot.conf.5, docs/yum-groups-manager.1, docs/yum-list-data.1, docs/yum-security.8, docs/yum-utils.1, docs/yum-verify.1, docs/yum-versionlock.1, docs/yum-versionlock.conf.5, docs/yumdownloader.1, repo-rss.py: commit patch fixing links to yum website and making all the bug reporting information consistent. Additionally, making the date formatting in the man pages consistent 2010-01-06 Seth Vidal * plugins/auto-update-debuginfo/auto-update-debuginfo.py: make auto update plugin use conduit.info() instead of print yum bug 384 2010-01-04 Seth Vidal * package-cleanup.py: simple, obvious, typo 2010-01-04 Tim Lauridsen * yum-builddep.py: make yum-builddep smarter when a package is build from srpm with another name and make the output a little better (rhbz #426009) 2009-12-28 Gerhardus Geldenhuis * docs/yum-versionlock.1: made the page more apropos friendly changed synopsis to specify usage 2009-12-26 James Antill * plugins/local/local.py: Allow people to ove rpms into and out of the local dir. manually 2009-12-26 James Antill * plugins/aliases/aliases.py: Fix yum "" edge case in aliases, BZ 550647 2009-12-22 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: Added fs-snapshot plugin by Josef Bacik 2009-12-22 Seth Vidal * package-cleanup.py: make sure that noarch pkgs are not listed twice for each duplicate entry 2009-12-17 Tim Lauridsen * docs/yum-fs-snapshot.1, docs/yum-fs-snapshot.conf.5, plugins/fs-snapshot/fs-snapshot.conf, plugins/fs-snapshot/fs-snapshot.py, yum-utils.spec: Added fs-snapshot plugin by Josef Bacik 2009-12-02 Seth Vidal * repoquery.py: don't os.path.normpath() the loc b/c it clips the double / on http:// :( 2009-12-01 James Antill * package-cleanup.py: Fix passing string flags to formatRequires. BZ 541551 2009-11-26 James Antill * yumdb.py: Don't show lots of blank lines in yumdb search 2009-11-24 James Antill * plugins/local/local.conf, plugins/local/local.py: Make local not as verbose, unless requested 2009-11-24 James Antill * plugins/local/local.conf, plugins/local/local.py, yum-utils.spec: Add local plugin, so Fedora people can download/etc. 2009-11-24 James Antill * docs/yum-security.8: Minor cleanup for new-packages explanation 2009-11-24 James Antill * docs/package-cleanup.1: Add docs. explaining that orphans == extras 2009-11-23 James Antill * yum-builddep.py: Don't rely on returnPackageByDep() to give you the installed pkg. BZ#539490 2009-11-18 James Antill * plugins/tmprepo/tmprepo.py: Let tmprepo create/use tmprepos if given mirrorlist/metalink 2009-11-18 James Antill * plugins/tmprepo/tmprepo.py: Let tmprepo create/use tmprepos if given repodata/repomd.xml 2009-11-18 James Antill * plugins/tmprepo/tmprepo.py: Add yum-plugin-tmprepo to run_with when using it 2009-11-18 James Antill * plugins/security/security.py: Add yum-plugin-security to run_with when running update-minimal 2009-11-18 James Antill * plugins/keys/keys.py: Fix keys-remove to use rpmdb.returnGPGPubkeyPackages 2009-11-16 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: remove basearch plugin from spec, it is obsoleted by recent version of yum, truncated changelog to last 2 years updated ChangeLog bumped yum-utils version to 1.1.24 Fix pylint errors: silence pylint runtime error noise Fix UnicodeDecodeError with UTF-8 changelog names. Change update => notice, as that's what we are counting Add summary-updateinfo command Move running kernel check to it's own function Add bash completion for repo-graph, repo-rss, repoclosure and repoquery. 2009-11-16 Seth Vidal * yum-complete-transaction.py: add some checking to yum-complete-transaction - make sure that the transaction we are going to run to complete the unfinished transaction is not different in size than what we were going to run. Helps keep us out of mistakenly removing everything 2009-11-08 Tim Lauridsen * yum-utils.spec: remove basearch plugin from spec, it is obsoleted by recent version of yum, truncated changelog to last 2 years 2009-11-07 Tim Lauridsen * ChangeLog: updated ChangeLog 2009-11-07 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.24 2009-11-07 Tim Lauridsen * debuginfo-install.py, find-repos-of-install.py, plugins/versionlock/versionlock.py, reposync.py: Fix pylint errors: ************* Module debuginfo-install E0602: 78:DebugInfoInstall.main: Undefined variable 'RepoError' E0602: 80:DebugInfoInstall.main: Undefined variable 'to_unicode' ************* Module find-repos-of-install E0602: 52: Undefined variable 'repoq' ************* Module reposync W0301:183: Unnecessary semicolon ************* Module versionlock W0611: 21: Unused import compareEVR 2009-11-07 Tim Lauridsen * Makefile: silence pylint runtime error noise 2009-11-05 Ville Skyttä * repo-rss.py: Fix UnicodeDecodeError with UTF-8 changelog names. 2009-11-06 James Antill * plugins/security/security.py: Change update => notice, as that's what we are counting 2009-11-06 James Antill * docs/yum-security.8, plugins/security/security.py: Add summary-updateinfo command 2009-11-06 James Antill * plugins/security/security.py: Move running kernel check to it's own function 2009-11-05 Ville Skyttä * yum-utils.bash: Add bash completion for repo-graph, repo-rss, repoclosure and repoquery. 2009-11-04 Seth Vidal * repoquery.py: - add fmt_location to pkgquery objects - make --location a pkg operation not a sack operation closes rh bug 533024 2009-11-04 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: Compare the currently running kernel for security problems Add aliases for list-updateinfo instead of list-security 2009-11-04 Seth Vidal * Makefile, needs-restarting.py, yum-utils.spec: add needs-restarting as a yum-util 2009-11-02 James Antill * plugins/security/security.py: Compare the currently running kernel for security problems 2009-10-20 James Antill * plugins/aliases/aliases: Add aliases for list-updateinfo instead of list-security 2009-10-29 Seth Vidal * debuginfo-install.py: catch the repo setup failure when we're adding the -debuginfo repos and report it fixes rh bug: https://bugzilla.redhat.com/show_bug.cgi?id=531743 2009-10-23 Ville Skyttä * repoquery.py: Make repoquery --pkgnarrow=extras actually output its findings. 2009-10-20 James Antill * docs/yum-security.8, plugins/security/security.py: Add option to list-updateinfo command to see new packages in repos. Change list-security => list-updateinfo, as it's now grossly wrong. 2009-10-19 Ville Skyttä * Makefile, yum-utils.bash, yum-utils.spec: Add bash completion for repomanage, package-cleanup and verifytree. Should work with bash >= 3 and doesn't require any particular version of bash-completion. Actually doesn't require bash-completion at all, but without it one needs to source the file through other means besides b-c's autoloading. 2009-10-19 Ville Skyttä * yum-utils.spec: Fix compileall syntax. 2009-10-19 Ville Skyttä * Makefile: Tabify so Emacs doesn't complain about "suspicious lines". 2009-10-14 James Antill * plugins/security/security.py: Fix typos in previous security message commit 2009-10-14 Douglas Silas * plugins/security/security.py: Change the security summary messages, hopefully be less ambiguous. 2009-10-12 Seth Vidal * package-cleanup.py: add --noscripts option to package-cleanup since so much of our cleanup is related to dainbramaged scriptlets 2009-10-12 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: Do obsoletes as well as updates in security list excluding 2009-10-12 Seth Vidal * yum-utils.spec: - add compileall command to yum-utils.spec for plugins - fixes rh bug https://bugzilla.redhat.com/show_bug.cgi?id=493174 2009-10-09 James Antill * plugins/security/security.py: Do obsoletes as well as updates in security list excluding 2009-10-09 Seth Vidal * debuginfo-install.py: make sure we're calling the logging output instead of print so -q does something 2009-10-09 Seth Vidal * docs/debuginfo-install.1: add warning messages section in debuginfo-install man page for: rh bug 480385 2009-10-06 James Antill * yumdb.py: When doing double loops, info/search, print a blank line after each package 2009-10-06 James Antill * plugins/aliases/aliases: Add some more default aliases 2009-10-02 Seth Vidal * package-cleanup.py: rewrite package-cleanup to use YumUtilBase interface and to have more correct logic for kernel removals and duplicate installs 2009-09-21 James Antill * plugins/aliases/aliases.py, plugins/auto-update-debuginfo/auto-update-debuginfo.py, plugins/fastestmirror/fastestmirror.py, plugins/fedorakmod/fedorakmod.py, plugins/kernel-module/kernel-module.py, plugins/keys/keys.py, plugins/protectbase/protectbase.py, plugins/remove-with-leaves/remove-with-leaves.py, plugins/security/security.py, plugins/versionlock/versionlock.py: Use new API (if available) for adding packages using, mainly for history 2009-09-17 James Antill * plugins/verify/verify.py: Show size in bytes, if human units == (BZ 520067) 2009-09-16 Seth Vidal * debuginfo-install.py, yum-builddep.py, yum-complete-transaction.py: modify debuginfo-install, yum-builddep, and yum-complete-transaction to use new doUtilTransaction() method 2009-09-09 Seth Vidal * repoquery.py: when outputting results for prcos (or anything, really) if there is nothing returned from doQuery() then don't print it. It just means that repoquery --conflicts -a outputs at least one line per pkg which is annoying 2009-09-08 Seth Vidal * repoclosure.py: add --basearch option to repoclosure set basearch yum should run as. 2009-09-08 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: Bump require >= 3.2.23 to 3.2.24. 2009-09-08 Seth Vidal * plugins/fastestmirror/fastestmirror-asyncore/fastestmirror-asyncore .py, plugins/fastestmirror/fastestmirror.py, plugins/priorities/priorities.py: change /usr/bin/env python -> /usr/bin/python for fedora and rhel pkg compliance https://bugzilla.redhat.com/show_bug.cgi?id=521469 and it matches everything else we have to not use /usr/bin/env python 2009-09-03 Tim Lauridsen * yum-utils.spec: Bump require >= 3.2.23 to 3.2.24. repoquery needs 22ca5115d59d795bac23eb608700f36be96bc99b (yum) added after yum-3.2.23 was released. http://yum.baseurl.org/gitweb?p=yum-utils.git;a=commitdiff;h=71308f5d13b697a78d81935a086071367a2b0920 2009-09-02 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: updated ChangeLog bumped yum-utils version to 1.1.23 2009-09-02 Seth Vidal * repoclosure.py: clean up some garbage output I left in there about obsoletes 2009-09-02 Tim Lauridsen * ChangeLog: updated ChangeLog 2009-09-02 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.23 2009-08-31 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: If epoch is none we still want to use version in repoclosure. 2009-08-31 Seth Vidal * repoclosure.py: make sure we make the list of pkgs to look at based on the latest pkgsack - complete with pkg deletions of the obsoletes 2009-08-12 Michael Schwendt * repoclosure.py: If epoch is none we still want to use version in repoclosure. 2009-08-04 Seth Vidal * plugins/security/security.py: remove timestamp in created attribute 2009-08-03 Seth Vidal * repoquery.py: make sure -q silences the repofrom path stuff closes rh bug #512563 2009-07-28 James Antill * find-repos-of-install.py: Cleanup tempcache, and fix -C option 2009-07-23 James Antill * plugins/versionlock/versionlock.py: pkgExcluder is all lower(), as excludepkgs/includepkgs are So we lowercase the versionlock data. It's possible, in theory, we'll have a false match, but no one should be insane enough to name things the same apart from case. 2009-07-20 Seth Vidal * docs/repoquery.1: add note to repoquery man page that you must have srpms in your enabled repos for the archlist=src option to really do anything 2009-07-17 James Antill * yum-utils.spec: Bump require version for new versionlock 2009-07-16 James Antill * plugins/versionlock/versionlock.py: Add excluderids, so we don't get N versions 2009-07-16 James Antill * plugins/versionlock/versionlock.py: Move versionlock to use pkgExcluder, add versionlock command 2009-07-16 James Antill * plugins/security/security.py: Add created timestamps to the security plugin commands 2009-07-16 James Antill * plugins/aliases/aliases.py: Add a created timestamp to the alias command 2009-07-14 James Antill * plugins/auto-update-debuginfo/auto-update-debuginfo.py: Remove redundant (and confusing) member access on pkgSack, in auto fix 2009-07-14 James Antill * plugins/auto-update-debuginfo/auto-update-debuginfo.py: Setup normal repos before we setup new debuginfo. ones, fixes trac/135 2009-07-08 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: [fastestmirror] Add a patch from Joel Michael to support a 'preferred' mirror (#509479) 2009-07-08 Seth Vidal * reposync.py: fix for bug: https://bugzilla.redhat.com/show_bug.cgi?id=503587 - make sure we don't fail to grab other metadata just b/c groups is not present 2009-07-08 Luke Macken * plugins/fastestmirror/fastestmirror.py: [fastestmirror] Add a patch from Joel Michael to support a 'preferred' mirror (#509479) 2009-07-07 Seth Vidal * repoclosure.py: make repoclosure work with new archstorage class in yumbase 2009-07-07 Seth Vidal * docs/package-cleanup.1: document exit value if problems are found in package-cleanup --problems 2009-06-22 James Antill * package-cleanup.py: Use base.setCacheDir() in package-cleanup 2009-06-22 James Antill * package-cleanup.py: Don't setup repos. when doing dupes processing 2009-06-22 James Antill * plugins/changelog/changelog.py: Don't assume pkgs have sourcerpm, in changelog plugin 2009-06-08 James Antill * yumdownloader.py: Output a nice message for failed source repos. in yumdownloader 2009-06-08 James Antill * yumdb.py: Sort keys in yumdb info 2009-06-08 James Antill * repoquery.py: Use setCacheDir in repoquery 2009-05-28 Seth Vidal * yum-builddep.py: when --nogpgcheck is passed - make sure we turn off gpg checking on our read ts not just from repos 2009-05-22 Seth Vidal * yum-builddep.py: output a nicer error message when the srpm has an unknown gpg key 2009-05-19 James Antill * plugins/tmprepo/tmprepo.py: Fix tmprepo, when we have option group 2009-05-19 Tim Lauridsen * ChangeLog: updated ChangeLog 2009-05-19 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.22 2009-05-19 Tim Lauridsen * ChangeLog: updated ChangeLog 2009-05-19 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.22 2009-05-19 Tim Lauridsen * yum-utils.spec: fix spec syntax error (2 line summary) 2009-05-19 Tim Lauridsen * Makefile: fix git-archive 2009-05-19 Tim Lauridsen * Makefile: added install-builddeps Makefile target 2009-05-19 Tim Lauridsen * plugins/aliases/aliases.py, reposync.py, test/yum-utils-pylintrc, yumdb.py: fixed pylint errors: bad indentation, unused imports and global not known at module level 2009-05-18 Seth Vidal * plugins/show-leaves/show-leaves.conf, plugins/show-leaves/show-leaves.py, yum-utils.spec: add show-leaves plugin from Ville Skyttä 2009-05-06 James Antill * repoquery.py: Be a bit nicer with filtering out installed pkgs. Still do the same thing by default. But if they specify pkgnarrow=installed (or all) don't filter them. 2009-05-01 James Antill * yumdb.py: Add rename command to yumdb 2009-05-01 James Antill * find-repos-of-install.py: Rename yumdb.repoid to yumdb.from_repo 2009-04-29 Tim Lauridsen * repo-check.py: added a repo-check util command template, it contains the basic stuff for making an easy extentable yum-util, without the need for 100's of almost identical tools 2009-04-24 James Antill * plugins/aliases/aliases.py, yum-utils.spec: Change aliases plugint o use the args_hook 2009-04-15 James Antill * plugins/aliases/aliases.py: Speedup my old dumbass code, walking a dict to do an == test is stupid 2009-04-15 James Antill * plugins/aliases/aliases.py: Exit nicley when people try to run aliased commands 2009-04-14 James Antill * plugins/remove-with-leaves/remove-with-leaves.py: Fix remove-with-leaves for PK usage (no opts) 2009-04-08 James Antill * yum-complete-transaction.py: Add yum-complete-transaction options under it's name 2009-04-08 Seth Vidal * reposync.py: remove -P as a shortcut for --norepopath b/c it is confusingly dissimilar to -p 2009-04-08 Danny Smith * reposync.py: add --norepopath patch 2009-04-06 James Antill * plugins/rpm-warm-cache/rpm-warm-cache.py: And for the no commands case (possible?) 2009-04-06 James Antill * plugins/rpm-warm-cache/rpm-warm-cache.py: Really fix the exception in rpm-warm-cache 2009-04-01 James Antill * Makefile, yum-utils.spec, yumdb.py: Add yumdb command to look at and alter the yumdb 2009-03-31 James Antill * find-repos-of-install.py: Use repoid in find-repos-of-install, also optionally sync. guessed data 2009-03-31 James Antill * plugins/security/security.py, plugins/verify/verify.py: Fix plugins to use plugin_option_group which use parser.values 2009-03-31 James Antill * plugins/changelog/changelog.py, plugins/downloadonly/downloadonly.py, plugins/nofsync/nofsync.py, plugins/priorities/priorities.py, plugins/protect-packages/protect-packages.py, plugins/remove-with-leaves/remove-with-leaves.py, plugins/tmprepo/tmprepo.py: Use plugin_option_group if available, on the easy cases 2009-03-31 James Antill * yum-utils.spec: Remove allow-downgrade, as it's in core now 2009-03-31 Tim Lauridsen * yumdownloader.py: add grouped option support if available in installed version of yum 2009-03-31 Tim Lauridsen * Makefile, test/yum-utils-pylintrc: use same pylint profile as yum and added 'pylint-short' Makefile target 2009-03-31 James Antill * Makefile, yum-debug-restore.py, yum-utils.spec: Add a "simple" version of yum-debug-restore 2009-03-30 James Antill * yum-utils.spec: Put the require for changelog in the right place 2009-03-30 Seth Vidal * repomanage.py: output filename when reporting errors opening packages 2009-03-30 James Antill * docs/yum-changelog.conf.5, plugins/changelog/changelog.py, yum-utils.spec: Allow changelog data to show updateinfo data too 2009-03-30 Tim Lauridsen * plugins/filter-data/filter-data.py, repodiff.py, yum-groups-manager.py: cleanup after API break 2009-03-29 Tim Lauridsen * Makefile, find-repos-of-install.py, plugins/aliases/aliases.py, plugins/auto-update-debuginfo/auto-update-debuginfo.py, plugins/basearchonly/basearchonly.py, plugins/downloadonly/downloadonly.py, plugins/fedorakmod/fedorakmod.py, plugins/filter-data/filter-data.py, plugins/kernel-module/kernel-module.py, plugins/list-data/list-data.py, plugins/protect-packages/protect-packages.py, plugins/refresh-updatesd/refresh-updatesd.py, plugins/rpm-warm-cache/rpm-warm-cache.py, plugins/skip-broken/skip-broken.conf, plugins/skip-broken/skip-broken.py, plugins/tmprepo/tmprepo.py, plugins/verify/verify.py, repo-graph.py, repoclosure.py, repodiff.py, repomanage.py, repoquery.py, test/yum-utils-pylintrc: * 'make pylint' now check all python files. * Make the pylint profile more sane and excluded the most stupid warnings * fix a lot of pylint warning and errors, so 'make pylint' now runs without any messsages and a 10/10 score. so 'make pylint' can be used to catch syntax error like in the one fixed in 8ec41e7c3ccbc3ecd74cbc87f2550e330b3b5be3 2009-03-29 Tim Lauridsen * plugins/remove-with-leaves/remove-with-leaves.py: minor pylint cleanup 2009-03-29 Tim Lauridsen * package-cleanup.py: Fix pylint warning: W:350: Bad indentation. Found 11 spaces, expected 12 W: 32: Unused import Errors 2009-03-29 Tim Lauridsen * test/yum-utils-pylintrc: make pylint conf more sane, dont show refactoring and convention errors 2009-03-28 James Antill * yumdownloader.py: Fix syntax error 2009-03-28 James Antill * yum-utils.spec: rawhide went upto 20-5, so update the obsoletes for auto-debuginfo 2009-03-25 Ville Skyttä * package-cleanup.py: Add query formatting. 2009-03-25 Ville Skyttä * package-cleanup.py: Sort package list output. 2009-03-25 Ville Skyttä * package-cleanup.py: Operate more on yum package objects rather than tuples. 2009-03-25 Ville Skyttä * package-cleanup.py: Fix same arch duplicate checking. 2009-03-25 Tim Lauridsen * ChangeLog: updated ChangeLog 2009-03-25 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.21 2009-03-25 Tim Lauridsen * ChangeLog: updated ChangeLog 2009-03-25 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.21 2009-03-24 James Antill * repoquery.py: Pass the "name" query down to returnPackages/etc. 2009-03-23 Seth Vidal * yumdownloader.py: include a check to make sure the pkg makes sense. 2009-03-23 Seth Vidal * plugins/merge-conf/merge-conf.py: - remove md5 use to remove deprecation warnings on python 2.6 - clean up minor pychecker warnings about 'file' shadowing builtin 2009-03-23 James Antill * yum-utils.spec: Add provides for plugin-auto-update-debuginfo, to help users out 2009-03-23 James Antill * yum-utils.spec: auto-update-debuginfo works by searching for *-debuginfo so it's pretty useless if it triggers on itself. Doh! 2009-03-22 Tim Lauridsen * plugins/versionlock/versionlock.py: add repoid info to versionlock plugin output (rhbz #491415) 2009-03-12 Tim Lauridsen * package-cleanup.py: just a TODO note 2009-03-11 Seth Vidal * repoquery.py: this is a simple fix to remove all installed pkgs from the returned pkgs of any repoquery 2009-03-09 James Antill * yum-debug-dump.py: Find real bug in core yum code, and remove hack for --help 2009-03-09 James Antill * yum-debug-dump.py: Fix --help in yum-debug-dump, who knows how/why 2009-03-06 Seth Vidal * package-cleanup.py: when we clean up kernels make sure that: 1. we look at kernel-PAE,too 2. the running kernel coming back from os.uname()[2] matches what we expect (it changed in F10) 3. if we don't have any kernels installed, it's not an error, it's probably just Xen 2009-03-05 James Antill * package-cleanup.py: Chagne arches to list, as set([1])[0] fails 2009-03-05 Tim Lauridsen * package-cleanup.py: make package-cleanup handle other kind of arch dupes (Ex. i386 & i586) and make it work this time 2009-03-05 Tim Lauridsen * package-cleanup.py: make package-cleanup handle other kind of arch dupes (Ex. i386 & i586) 2009-03-05 Tim Lauridsen * updateonboot/yum-updateonboot.init, updateonboot/yum-updateonboot.sysconfig: make yum-updateonboot more configurable (rhbz #466428) 2009-03-05 Tim Lauridsen * package-cleanup.py: make package-cleanup --oldkernels work with vanilla kernels (rhbz #469825) 2009-03-05 Tim Lauridsen * plugins/remove-with-leaves/remove-with-leaves.conf, plugins/remove-with-leaves/remove-with-leaves.py: made the remove-with-leaves plugin only active when using --remove-leaves or adding remove_always=1 to plugin conf (rhbz #4654149 2009-03-05 Tim Lauridsen * yumdownloader.py: fix issues when running yumdownloader as non-root (rhbz #432889) 2009-03-05 Tim Lauridsen * package-cleanup.py: make cleanup work with the changes to findDupes 2009-03-05 Tim Lauridsen * package-cleanup.py: Make package-cleanup find different arch dupes (Ex. name-1.0-1.i386 & name-2.0-1.noarch) (RHBZ #375411) 2009-03-03 James Antill * repoclosure.py: Fix RepoClosure() API for spam-o-matic, and other users 2009-03-02 Seth Vidal * yumdownloader.py: import os and os.path to make the other changes from 2 weeks ago work 2009-03-02 Tim Lauridsen * yum-utils.spec: added versioned provided to renamed plugins and other minor cleaups 2009-03-01 James Antill * plugins/changelog/changelog.py: Don't output anything when depsolving failed 2009-03-01 Tim Lauridsen * Makefile: make a separate release-tag makefile target 2009-03-01 Tim Lauridsen * ChangeLog: updated ChangeLog 2009-03-01 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.20 2009-03-01 Tim Lauridsen * yum-utils.spec: updateonboot is not a plugin 2009-02-28 Tim Lauridsen * yum-utils.spec: fixed package naming 2009-02-28 Tim Lauridsen * yum-utils.spec: fixed package naming 2009-02-27 James Antill * repoquery.py: Fix unicode bugs in repoquery changelog, BZ 483157 2009-02-27 Seth Vidal * debuginfo-install.py, yum-builddep.py, yumdownloader.py: make sure we're not using print_help() anywhere - use format_help() instead as print_help breaks unicode - closes rh bug #470934 2009-02-26 James Antill * plugins/changelog/changelog.py, yum-utils.spec: Cleanup the ChangeLog output, also fix unicode issue (bad/no utf8 *sigh*) 2009-02-26 James Antill * plugins/changelog/changelog.py: Only download changelog data for repos. we need it from 2009-02-26 James Antill * docs/yum-changelog.conf.5, plugins/changelog/changelog.conf, plugins/changelog/changelog.py, plugins/merge-conf/merge-conf.conf, plugins/merge-conf/merge-conf.py: Add setting for changelog/merge-conf to always work. BZ#483550 2009-02-26 James Antill * yum-utils.spec: Change the version of obsoletes, and add conflicts for RHEL 2009-02-26 James Antill * yum-utils.spec: Change yum-NetworkManager-dispatcher summary and description to make it obvious that it's a "plugin" of the NetworkManager variety, not a yum plugin. 2009-02-26 James Antill * yum-utils.spec: Do big rename for plugins to include plugins in their name 2009-02-25 Tim Lauridsen * yum-utils.spec: removed yum-fedorakmod & yum-kernel-module from spec file 2009-02-13 Seth Vidal * repo-rss.py, yum-builddep.py: fixed duplicate 'Usage' in repo-rss and yum-builddep, too 2009-02-13 Seth Vidal * yumdownloader.py: remove duplicate 'usage' rh bug #485415 2009-02-11 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: Simple hacky workaround for BZ 484603, debuginfo-install x x-debuginfo Fix the way we downgrade ftp mirrors, for hosts which give us both 2009-02-11 Seth Vidal * README, plugins/fedorakmod/fedorakmod.py: apply patch from Felix Schwarz to fix deprecation warnings in fedorakmod plugin and a wrong url in the README 2009-02-09 James Antill * debuginfo-install.py: Simple hacky workaround for BZ 484603, debuginfo-install x x-debuginfo 2009-02-06 James Antill * plugins/fastestmirror/fastestmirror.py: Fix the way we downgrade ftp mirrors, for hosts which give us both 2009-02-03 James Antill * plugins/auto-update-debuginfo/auto-update-debuginfo.conf, plugins/auto-update-debuginfo/auto-update-debuginfo.py, yum-utils.spec: Add auto-update-debuginfo plugin, BZ 432806 2009-02-02 James Antill * yum-utils.spec: Fix stupid english grammar rules in spec file 2009-02-02 Seth Vidal * yum-builddep.py: make yum-builddep behave a bit better when it hits a srpm signed by an unknown key. 2009-02-02 Seth Vidal * plugins/remove-with-leaves/remove-with-leaves.conf, plugins/remove-with-leaves/remove-with-leaves.py: add --leaves-exclude-bin and exclude_bin option to remove with leaves closing bug 481465 2009-01-30 James Antill * yum-debug-dump.py: Allow filenames to yum-debug-dump, make default filename "unique" 2009-01-30 James Antill * yum-debug-dump.py: Fix copy and paste typos. 2009-01-30 James Antill * yum-debug-dump.py: Allow yum-debug-dump to work as non-root 2009-01-28 James Antill * plugins/fedorakmod/fedorakmod.py: Remove kernel-modules-for-kernel provides from kmod, BZ 482893 2009-01-26 James Antill * plugins/changelog/changelog.py: Sort packages in --changelog output 2009-01-26 James Antill * plugins/fastestmirror/fastestmirror.conf: Add "live documentation" about new always_print_best_host config. 2009-01-26 James Antill * plugins/fastestmirror/fastestmirror.py: Allow fastestmirror config. for printing hosts, rhbz #481282 2009-01-26 Tim Lauridsen * plugins/fastestmirror/fastestmirror.py: REVERT: make fastestmirror less verbose (rhbz #481282) 2009-01-26 Tim Lauridsen * plugins/fastestmirror/fastestmirror.py: make fastestmirror less verbose (rhbz #481282) 2009-01-23 James Antill * yum-utils.spec: Bump requires due to usage of hdr2pkgTuple 2009-01-22 Ville Skyttä * repomanage.py: Replace hdr2pkgTuple() with rpmUtils.miscutils.pkgTupleFromHeader(). 2009-01-22 Ville Skyttä * repomanage.py: Replace several internal functions with ones from rpmUtils. 2009-01-21 Ville Skyttä * repomanage.py: Uniquify+sort EVR list for each NA only once, not once for each found file. 2009-01-22 James Antill * docs/reposync.1: Document --source in reposync 2009-01-22 James Antill * reposync.py: Add --source option, to reposync 2009-01-16 James Antill * yumdownloader.py: And group conditionals (until they die!) 2009-01-16 Jason Parker * yumdownloader.py: Obey conf.group_package_types in yumdownloader @cmdline syntax 2009-01-16 James Antill * yumdownloader.py: Don't fail for @core, due to ppc64 pkgs etc. 2009-01-16 James Antill * yumdownloader.py: Add UI for bad/empty groups 2009-01-16 James Antill * yumdownloader.py: Allow @mygroup syntax on yumdownloader cmdline 2009-01-16 James Antill * debuginfo-install.py: For debuginfo for .src.rpm get ver/rel from same, fixes BZ 480316 2008-12-29 Warren Togami * yum-NetworkManager-dispatcher: Fix the script exiting non-zero 2008-12-25 Tim Lauridsen * repoclosure.py: Check for the repoclosure of a single package patch by Kedar Sovani 2008-12-19 Michael Schwendt * repodiff.py: Print only the date, as that's all the info. we have 2008-12-19 Panu Matilainen * plugins/nofsync/nofsync.conf, plugins/nofsync/nofsync.py: Add plugin for disabling rpmdb sync during transaction - gives a nice fat speed-boost for throw-away chroot installs and such, never to be used on live systems though... 2008-12-17 Tim Lauridsen * ChangeLog: updated ChangeLog 2008-12-17 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.19 2008-12-10 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: Fixup the security documentation for --bugfix etc. Allow list-security to specify bugfix/enhancement/recommended/etc. 2008-12-10 Seth Vidal * Makefile, find-repos-of-install.py, yum-utils.spec: add find-repos-of-install 2008-12-10 James Antill * docs/yum-security.8: Fixup the security documentation for --bugfix etc. 2008-12-10 James Antill * plugins/security/security.py: Allow list-security to specify bugfix/enhancement/recommended/etc. Add a --bugfixes option. 2008-12-10 Seth Vidal * package-cleanup.py: make -q in package-cleanup actually be quiet closes rh bug #471244 2008-12-05 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: Have the post-trans-actions plugin create/own it's action config. dir Don't traceback on "changelog 0" and give a nice message. 2008-12-05 Seth Vidal * repoquery.py: make logger outputs go to stderr, not stdout. 2008-12-04 James Antill * yum-utils.spec: Have the post-trans-actions plugin create/own it's action config. dir 2008-11-25 James Antill * plugins/changelog/changelog.py: Don't traceback on "changelog 0" and give a nice message. 2008-11-21 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: If we don't have a command, or it's search/list/info, warm the rpm DB cache Fix rpm warm cache plugin when no commands are there Import PluginYumExit so we can use it 2008-11-21 Seth Vidal * yum-builddep.py: catch yum.Errors.RepoError when setting up the package sacks. 2008-11-21 James Antill * plugins/rpm-warm-cache/rpm-warm-cache.py: If we don't have a command, or it's search/list/info, warm the rpm DB cache 2008-11-21 Ralf Ertzinger * plugins/rpm-warm-cache/rpm-warm-cache.py: Fix rpm warm cache plugin when no commands are there 2008-11-20 James Antill * plugins/changelog/changelog.py: Import PluginYumExit so we can use it 2008-11-14 Seth Vidal * reposync.py: clean up a common traceback when talking to rhn :( 2008-11-12 Seth Vidal * docs/yumdownloader.1: link to yum for rest of options to yumdownloader - closes ticket2 2008-11-12 James Antill * plugins/keys/keys.py: Setup the default repos. so we list the repo. keys 2008-11-12 James Antill * reposync.py: Add total download percentage like "normal" yum download 2008-11-07 Seth Vidal * yum-complete-transaction.py: fix import error from rh bug #470458 2008-11-06 James Antill * yum-groups-manager.py: Fix the regexps, due to - ... add warnings for bad chars. 2008-11-04 Seth Vidal * docs/repoquery.1, repoquery.py: apply documentation patch from Ville Skyttä closes bug #459022 2008-11-03 Seth Vidal * plugins/post-transaction-actions/post-transaction-actions.py, plugins/post-transaction-actions/sample.action: - add $vars to commands that can be run. Update the sample.action file 2008-10-29 Tim Lauridsen * ChangeLog: updated ChangeLog 2008-10-29 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.18 2008-10-27 Seth Vidal * yum-utils.spec: forgot the .* 2008-10-27 Seth Vidal * plugins/rpm-warm-cache/rpm-warm-cache.conf, plugins/rpm-warm-cache/rpm-warm-cache.py, yum-utils.spec: rpm-warm-cache plugin 2008-10-23 Seth Vidal * Makefile, yum-utils.spec: - change urls - add post-transaction-actions to the spec file 2008-10-22 James Antill * repoclosure.py, verifytree.py: More timestamp_check usage, really need a repofrompath type helper function 2008-10-22 James Antill * repodiff.py, repoquery.py: Use the new timestamp_check repo option for the repoids that need it 2008-10-21 James Antill * docs/debuginfo-install.1: Actaully add the debuginfo-install man page 2008-10-21 Seth Vidal * docs/package-cleanup.1, docs/repo-rss.1, docs/repodiff.1, docs/repoquery.1, docs/reposync.1, docs/yum-builddep.1, docs/yum-complete-transaction.8, docs/yum-debug-dump.1, docs/yum-groups-manager.1, docs/yumdownloader.1: yum-utils.baseurl.org doesn't exist 2008-10-21 James Antill * docs/Makefile, docs/repodiff.1, yum-utils.spec: Add repodiff man page 2008-10-21 James Antill * docs/package-cleanup.1, docs/repo-rss.1, docs/repoquery.1, docs/reposync.1, docs/yum-builddep.1, docs/yum-changelog.1, docs/yum-complete-transaction.8, docs/yum-debug-dump.1, docs/yum-groups-manager.1, docs/yum-list-data.1, docs/yum-versionlock.1, docs/yumdownloader.1: Update documentation for duke.edu => baseurl.org change 2008-10-21 James Antill * docs/Makefile, yum-utils.spec: Add debuginfo-install man page 2008-10-21 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: Don't check for unfinished transactions when completing transactions 2008-10-21 Seth Vidal * repodiff.py: fix unicode issues on outputting changelogs 2008-10-17 James Antill * yum-complete-transaction.py, yum-utils.spec: Don't check for unfinished transactions when completing transactions 2008-10-17 Seth Vidal * plugins/post-transaction-actions/post-transaction-actions.conf, plugins/post-transaction-actions/post-transaction-actions.py, plugins/post-transaction-actions/sample.action: add post-transaction-actions - but don't add it to be built, yet 2008-10-16 James Antill * yum-groups-manager.py: Fix groups-manager again, for loads this time 2008-10-16 James Antill * yum-groups-manager.py: Fix translated names with full utf-8 in them 2008-10-16 James Antill * plugins/list-data/list-data.py: Don't output the cli object in the help, fixes bug 467191 2008-10-16 Jan Hutař * docs/yum-groups-manager.1: Fix typo in groups-manager man page 2008-10-15 Seth Vidal Merge branch 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils * 'master' of ssh://yum.baseurl.org/srv/projects/yum/git/yum-utils: [fastestmirror] Return the correct value from _len_non_ftp Fix fastestmirror's exclusion code. Sort the dump output, to it's consistent Enable plugins, so we can print out which are enabled (and spacewalk works) Speedup package-cleanup --orphans, as yum list extras is Turn plugins on in package-cleanup, and add an option to turn them off Always refresh the cache for a manual repo. For repoquery;createrepo;repoquery 2008-10-15 Seth Vidal * repoquery.py: make sure --location returns the proper location if we have a basepath 2008-10-14 Luke Macken * plugins/fastestmirror/fastestmirror.py: [fastestmirror] Return the correct value from _len_non_ftp 2008-10-14 Luke Macken * plugins/fastestmirror/fastestmirror.py: Fix fastestmirror's exclusion code. This fixes the exclusion code to to avoid changing the array that is being iterated. Thanks to Johnny Casey for pointing this out to me and offering up a potential solution. 2008-10-10 James Antill * yum-debug-dump.py: Sort the dump output, to it's consistent 2008-10-10 James Antill * yum-debug-dump.py: Enable plugins, so we can print out which are enabled (and spacewalk works) 2008-10-10 James Antill * package-cleanup.py: Speedup package-cleanup --orphans, as yum list extras is 2008-10-10 James Antill * package-cleanup.py: Turn plugins on in package-cleanup, and add an option to turn them off 2008-10-10 James Antill * repoquery.py: Always refresh the cache for a manual repo. For repoquery;createrepo;repoquery 2008-10-03 Seth Vidal * verifytree.py: apply patch from jkeating to make config parser use in verifytree stop being case insensitive due to file path names in the config verifytree is reading 2008-10-03 Seth Vidal * reposync.py: add option --download-metadata to grab all metadata that is not primary*, filelist*, other* useful for syncing over updateinfo, comps, etc. 2008-09-30 James Antill * plugins/fedorakmod/fedorakmod.py: Add other kernel-modules virtual provide, bug 462099 2008-09-29 Seth Vidal * plugins/remove-with-leaves/remove-with-leaves.py: make sure we don't remove if things are just being updated :) 2008-09-25 James Antill * repodiff.py: Delete any "old" repo. data in the repodiff repo. dirs. 2008-09-24 Tim Lauridsen * Makefile, reposync.py: add reposync to pylint check 2008-09-24 Tim Lauridsen * Makefile, repotrack.py: add repotrack to pylint check 2008-09-24 Tim Lauridsen * Makefile, verifytree.py: add verifytree to pylint check 2008-09-24 Tim Lauridsen * Makefile, test/yum-utils-pylintrc: add security to pylint check 2008-09-24 Tim Lauridsen * Makefile, plugins/upgrade-helper/upgrade-helper.py: add upgrade-helper to pylint check 2008-09-24 Tim Lauridsen * Makefile, test/yum-utils-pylintrc: add remove-with-leaves to pylint check 2008-09-24 Tim Lauridsen * package-cleanup.py, test/yum-utils-pylintrc: disable *More than one statement on a single line* pylint warning an undo some crazy stuff 2008-09-24 Tim Lauridsen * test/test-yumdownloader: make the test-yumdownloader script a little better 2008-09-24 Tim Lauridsen * Makefile, test/yum-utils-pylintrc, yum-groups-manager.py: yum-groups-manager.py to pylint check and cleaned it up 2008-09-24 Tim Lauridsen * Makefile, package-cleanup.py, test/yum-utils-pylintrc: add package-cleanup.py to pylint check and cleaned it up 2008-09-24 Tim Lauridsen * Makefile, debuginfo-install.py, test/yum-utils-pylintrc, yum-complete-transaction.py: add debuginfo-install to pylint check and cleaned up the problems also fixed some issues in yum-complete-transaction 2008-09-24 Tim Lauridsen * yum-util-cli-template: remove cli wildcard import 2008-09-24 Tim Lauridsen * Makefile, test/yum-utils-pylintrc, yum-builddep.py: add yum-builddep to pylint check and cleaned up the problems 2008-09-24 Tim Lauridsen * Makefile, test/yum-utils-pylintrc, yum-debug-dump.py: add yum-debug-dump to pylint check and cleaned up the problems 2008-09-24 Tim Lauridsen * Makefile, test/yum-utils-pylintrc, yum-complete-transaction.py, yum-debug-dump.py: add yum-complete-transaction to pylint check and cleaned up the problems 2008-09-24 Tim Lauridsen * yumdownloader.py: remove cli wildcard import 2008-09-24 Tim Lauridsen * Makefile, test/yum-utils-pylintrc, yumdownloader.py: Added 'pylint' target to Makefile Added pylint rc file yumdownloader cleanup based on pylint messages 2008-09-19 Tim Lauridsen * yum-utils.spec: removed skip-broken plugin 2008-09-19 Seth Vidal Merge branch 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum-utils * 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum-utils: Don't hide download errors in downloadonly mode updated ChangeLog bumped yum-utils version to 1.1.17 Use calcColumns in keys plugin Pass used_map to _has_id from ysp_should_filter_pkg, fixes bug 462372 2008-09-19 Seth Vidal * plugins/remove-with-leaves/remove-with-leaves.py: document the fixme a bit better 2008-09-19 James Antill * plugins/downloadonly/downloadonly.py: Don't hide download errors in downloadonly mode 2008-09-17 Tim Lauridsen * ChangeLog: updated ChangeLog 2008-09-17 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.17 2008-09-16 James Antill * plugins/keys/keys.py: Use calcColumns in keys plugin 2008-09-15 James Antill * plugins/security/security.py: Pass used_map to _has_id from ysp_should_filter_pkg, fixes bug 462372 2008-09-15 Seth Vidal * yum-complete-transaction.py: do the same for y-c-t - setup_locale() 2008-09-15 James Antill * yum-builddep.py: Use the setup_locale call instead of copy&paste 2008-09-15 Seth Vidal * yum-builddep.py: add all the crazy locale code from yum-complete-transaction to yum-build-dep so our confirmation can work on non-C and on-US locales. 2008-09-09 Seth Vidal * plugins/remove-with-leaves/remove-with-leaves.py: get rid of interactive - since it isn't really interactive 2008-09-08 Seth Vidal * yum-utils.spec: add conf file, too 2008-09-08 Seth Vidal * plugins/remove-with-leaves/remove-with-leaves.conf, plugins/remove-with-leaves/remove-with-leaves.py, yum-utils.spec: add remove-with-leaves plugin and update spec file 2008-09-02 James Antill * plugins/keys/keys.py: Add repoid data to info/data output. Don't display the gpg-pubkey noise 2008-08-29 James Antill * plugins/security/security.py: Count packages in the transaction like listTransaction does 2008-08-28 Tim Lauridsen * Makefile: make a gpg signed tag when using 'make release' 2008-08-28 Seth Vidal * reposync.py: add a parens to unbreak reposync 2008-08-27 James Antill * plugins/filter-data/filter-data.py: Fix typo in filter-data plugin 2008-08-27 Tim Lauridsen * Makefile: remove some test stuff from Makefile 2008-08-27 Tim Lauridsen * Makefile: fix the awk voodoo, to do the right thing 2008-08-27 Tim Lauridsen * ChangeLog: updated ChangeLog 2008-08-27 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.16 2008-08-27 Tim Lauridsen * Makefile: Make the uploaded srpm have the right name 2008-08-27 Tim Lauridsen * Makefile: strip the %{dist} from release 2008-08-27 Tim Lauridsen * Makefile: Added to make the build work 2008-08-27 James Antill * plugins/versionlock/versionlock.py: Fix follow_obsoletes in versionlock 2008-08-27 James Antill * plugins/versionlock/versionlock.py: Fix follow_obsoletes in versionlock 2008-08-27 James Antill * yum-NetworkManager-dispatcher: Add the NetworkManager dispatcher script 2008-08-26 Tim Lauridsen * Makefile: Added separate 'test-cleanup' Makefile tag to make it easier to cleaup a failed 'make test-release' Use 'make test-release' to test that every thing builds ok. if something fails then use make 'test-cleanup' to cleanup 2008-08-23 James Antill * yum-utils.spec: Fix the yum-groups-manager man page filename in the specfile 2008-08-23 James Antill * docs/Makefile, docs/yum-groups-manager.1, yum-groups-manager.py, yum-utils.spec: Write man page for yum-groups-manger, tweak the cmd a bit to match docs 2008-08-22 James Antill * plugins/keys/keys.py: Allow keys plugin to remove repo. GPG keys 2008-08-22 James Antill * plugins/keys/keys.py, yum-utils.spec: List/info keys used for repo. signing, as well as rpm ones 2008-08-21 James Antill * yum-groups-manager.py: Trap IO exceptions, allow just group metadata changes (no package name additions/removals). 2008-08-21 James Antill * yum-groups-manager.py: Allow yum-groups-manager to remove packages and rename. Also some tweaks 2008-08-20 James Antill * Makefile, yum-utils.spec: Add yum-groups-manager into the build/install 2008-08-20 James Antill * yum-groups-manager.py: Add the initial version of the yum-groups-manager command, seems to work :) 2008-08-16 James Antill * plugins/changelog/changelog.py: Allow changelog's dateutil to be a soft dependency, for RHEL/CentOS 2008-08-16 Tim Lauridsen * yumdownloader.py: print a more sane error message on RepoError (rh #458501) 2008-08-13 Ville Skyttä * package-cleanup.py: Improve default leaf regex, make it case insensitive. Signed-off-by: Ville Skyttä 2008-08-16 Tim Lauridsen Merge branch 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum-utils 2008-08-13 Ville Skyttä * docs/repoquery.1, repoquery.py: Alias -R to --requires. Signed-off-by: Ville Skyttä 2008-08-14 James Antill * plugins/filter-data/filter-data.py: Minor speedup when filtering on committer as well as another thing(s) 2008-08-14 James Antill * plugins/filter-data/filter-data.py, yum-utils.spec: Use to_str instead of just str() so we don't try and go from unicode to str 2008-08-14 James Antill * plugins/filter-data/filter-data.py: Allow available/recent list commands. Don't require other MD download if we aren't using it. 2008-08-12 Tim Lauridsen * ChangeLog, yum-utils.spec: fixed license tag 2008-08-11 James Antill * docs/yum-security.8: Explain the update-minimal problem of deps. bringing in the newest versions 2008-08-10 James Antill * repoquery.py, yum-utils.spec: Use the new setup_locale yum call, and bump the requires version 2008-08-08 James Antill * plugins/fastestmirror/fastestmirror.py: Do special handling for file: before starting the threading 2008-08-07 James Antill * Makefile, yum-utils.spec: Add yum-NetworkManager-dispatcher pkg, closes bug#437808 2008-08-07 tla@dk.ibm.com * ChangeLog: updated ChangeLog 2008-08-07 tla@dk.ibm.com * yum-utils.spec: bumped yum-utils version to 1.1.15 2008-08-06 James Antill * yum-utils.spec: Put the tmprepo version back to the right version 2008-08-06 James Antill * plugins/tmprepo/tmprepo.py, yum-utils.spec: Due to repo_gpgcheck we can make tmprepo fully backwards compat. 2008-08-06 James Antill * plugins/tmprepo/tmprepo.py: Allow --tmprepo=~/blah/... to be nice 2008-08-06 James Antill * plugins/tmprepo/tmprepo.py: Fix tmprepo gpgcheck to use the new new, config. 2008-08-06 James Antill * yum-utils.spec: Fix minor text overflow in yum-fedorakmod specfile description 2008-08-05 James Antill * yum-utils.spec: Split specfile plugins variable across multiple lines to help patch/diff out 2008-08-05 James Antill * yum-utils.spec: Tidy up description overflow in specfile 2008-08-04 James Antill * plugins/security/security.py: Test for '0' epochs and not None in list-security 2008-08-04 James Antill * plugins/security/security.py: Output list-security data in oldest to newest pkgs 2008-08-04 James Antill * plugins/security/security.py: Don't show 0: for 0 epochs in list-security 2008-08-05 tla@dk.ibm.com * reposync.py: Add option to fetch comps.xml to reposync by Mohd Izhar Firdaus Ismail (duke bz#856) 2008-08-04 Seth Vidal * verifytree.py: clean out the manual image checking and make the treeinfo check return the BAD_IMAGES value 2008-08-04 Seth Vidal * verifytree.py: add optional .treeinfo [checksums] parsing 2008-08-04 James Antill * yum-builddep.py: Allow yum-builddep to use "extras" (installed/not-available pacakges 2008-08-04 James Antill * docs/yum-security.8, plugins/security/security.py: Change the yum-security documentation to reflect the new behaviour. Make update-minimal default to the true updateinfo minimal case (takes the oldest notice data). 2008-07-25 James Antill * plugins/security/security.py, yum-utils.spec: Initial WFM. Security plugin overhaul: Go back to all previous updates looking for matches. Add update-minimal which will do a minimal update given the specs. (security only by default). Eg. Given: pkgA-1 installed pkgA-2 (security update, BZ 69) pkgA-3 (Bugfix update, BZ 69) pkgA-4 (security update) pkgA-5 (Bugfix update) pkgA-6 (Bugfix update) ...then (assuming we see all of the above, and "update" would move us to pkgA-6): 1. update --security will now move from pkgA-1 to pkgA-6 2. update-minimal will move from pkgA-1 to pkgA-4 3. update --bz=69 will now move from pkgA-1 to pkgA-6 4. update-minimal --bz=69 will now move from pkgA-1 to pkgA-3 ...list-sec will also list all relevant notices from the installed version to the latest available version. Also minor i18n python-2.4.z fix. Requires yum-3.2.18 2008-07-29 James Antill * plugins/tmprepo/tmprepo.py: Make true/false work for gpgcheck in tmprepo 2008-07-28 James Antill * plugins/tmprepo/tmprepo.py, yum-utils.spec: Update tmprepo to use CaselessSelectionOption() and understand the new gpgcheck 2008-07-28 James Antill * docs/Makefile, docs/yum-changelog.conf.5, docs/yum-versionlock.1, docs/yum-versionlock.conf.5, plugins/versionlock/versionlock.py, yum-utils.spec: Add versionlock man pages 2008-07-27 James Antill * docs/yum-changelog.1: Remove copy and pasted extra text from yum-changelog man page 2008-07-27 James Antill * plugins/versionlock/versionlock.conf, plugins/versionlock/versionlock.py: Optionally do obsoletes processing for versionlock 2008-07-27 James Antill * plugins/versionlock/versionlock.py: Allow locking to multiple EVR's 2008-07-25 James Antill * plugins/fastestmirror/fastestmirror.py: Add downgrade_ftp option, so that they are still usable ... but never used 2008-07-25 James Antill * plugins/tmprepo/tmprepo.conf, plugins/tmprepo/tmprepo.py: Merge the gpgcheck upstream config. changes into tmprepo 2008-07-21 Seth Vidal * package-cleanup.py: fix for bug number rh #456062. This is fine in more current yum's but it is an easy step-around for fc8. 2008-07-21 James Antill * plugins/tmprepo/tmprepo.py: Add a --tmprepo-keep-created option to do the unthinkable. Fix tmprepo with local files. Tweak the repoid's generated to be more usable. Do the DB generation in createrepo, esp. for "saved tmp. repos" Don't do everything twice when group funcs make yum call reposetup twice. 2008-07-21 James Antill * plugins/tmprepo/tmprepo.py, yum-utils.spec: Add _local_ directory support to tmprepo, requires createrepo. 2008-07-07 Seth Vidal * yum-utils.spec: add verifytree to spec file 2008-07-07 Seth Vidal * Makefile, verifytree.py: add verifytree to yum-utils 2008-07-03 James Antill * plugins/fastestmirror/fastestmirror.py: Skip testing mirrors twice, when postreposetup_hook() is called twice 2008-07-01 James Antill * plugins/fastestmirror/fastestmirror.py: Don't skip just because the file doesn't exist, stupid os.access() 2008-07-01 James Antill * plugins/fastestmirror/fastestmirror.py: Do as much parallelism as possible on testing URLs 2008-07-01 James Antill * plugins/fastestmirror/fastestmirror.py: Use _base.conf.cache not the option, works in yumm/yumex/pirut 2008-07-01 Seth Vidal * reposync.py: if we hit a repoerror downloading a package, just output the error and move along don't make it fatal 2008-06-27 James Antill * plugins/fastestmirror/fastestmirror.py: Work in cacheonly mode if we can't write to the datafile 2008-06-27 James Antill * plugins/fastestmirror/fastestmirror.py: Fix typo in fastestmirror 2008-06-26 James Antill * plugins/fastestmirror/fastestmirror.py: Make fastestmirror faster, mostly in the cached case, now CentOS has made it mandatory without speaking to anyone: . Skip processing of repos with only a single URL . Do socket.setdefaulttimeout() once. Restore to the "default" socket.setdefaulttimeout() if we change it. . Resolve the cached timeout data within the main thread (main fix). Don't do any locking if we don't spawn any threads. . Use the host() function in PollThread. 2008-06-22 Seth Vidal * yum-debug-dump.py: - make yum-debug-dump not traceback when run and repositories are not accessible - add a --norepos option to not dump out the repositories. 2008-06-17 Tim Lauridsen * repotrack.py: fixed Traceback, caused by use of self outside class (rhbz #451725) 2008-06-09 Seth Vidal * plugins/keys/keys.py: import PluginYumExit from plugins in keys 2008-06-03 Jack Neely * plugins/fedorakmod/fedorakmod.py: Port from upstream changes to ignore kernels that are to be erased. 2008-06-02 Tim Lauridsen * repoquery.py: fixes unicode error when running as LANG=C 2008-06-02 Tim Lauridsen * debuginfo-install.py, repodiff.py, yum-complete-transaction.py, yumdownloader.py: Used the same cli setup (LANG,UTF-8) as in yum-cli (rhbz #445916) 2008-05-30 Tim Lauridsen * plugins/refresh-updatesd/refresh-updatesd.py: revert previous commit and add another solution 2008-05-30 Tim Lauridsen * plugins/refresh-updatesd/refresh-updatesd.py: Make the plugin a little simpler so it dont fails (rhbz #437254) 2008-05-29 Tim Lauridsen * repodiff.py: more same way of setting locale (i hope) 2008-05-29 Tim Lauridsen * repodiff.py: Make repodiff always run in LANG=C 2008-05-23 Luke Macken * plugins/fastestmirror/fastestmirror.py: [fastestmirror] Make sure the 'cacheonly' option exists before checking it (rh#448062) 2008-05-23 Luke Macken * plugins/fastestmirror/fastestmirror-asyncore.py, plugins/fastestmirror/fastestmirror-asyncore/fastestmirror-asyncore .py: Hide the fastestmirror-asyncore plugin until we're ready to ship it 2008-05-22 Tim Lauridsen * Makefile: Make test-release target a little better 2008-05-22 Tim Lauridsen * Makefile: Make test-release target a little better 2008-05-22 Tim Lauridsen * Makefile: Make test-release target a little better 2008-05-22 Tim Lauridsen * Makefile: Make test-release target a little better 2008-05-22 Tim Lauridsen * Makefile: Make test-release target a little better 2008-05-22 Tim Lauridsen * Makefile: Make test-release target a little better 2008-05-22 Tim Lauridsen * Makefile: Make test-release target a little better 2008-05-22 Tim Lauridsen * Makefile: Make test-release target a little better 2008-05-22 Tim Lauridsen * Makefile: Make test-release target a little better 2008-05-22 Tim Lauridsen * Makefile: Make test-release target a little better 2008-05-22 Tim Lauridsen * Makefile: Make test-release target to Makefile, to make it easier test the build of a releases without sending it to HEAD 2008-05-21 Tim Lauridsen * ChangeLog: updated ChangeLog 2008-05-21 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.14 2008-05-21 Tim Lauridsen * docs/Makefile: more fixes to make yum utils can build again 2008-05-21 Tim Lauridsen * docs/Makefile: more fixes to make yum utils can build again 2008-05-21 Tim Lauridsen * docs/Makefile, yum-utils.spec: fixed some spec and Makefile issues, so yum utils can build again 2008-05-21 Tim Lauridsen * ChangeLog: updated ChangeLog 2008-05-21 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.14 2008-05-21 Tim Lauridsen * ChangeLog: updated ChangeLog 2008-05-21 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.14 2008-05-19 Luke Macken * plugins/fastestmirror/fastestmirror.py: fastestmirror: If we're using the cache, then don't load cached mirrorlist 2008-05-17 Luke Macken * plugins/fastestmirror/fastestmirror.py: fastestmirror: Apply a patch from Tuomo Soini to fix http auth when used in the baseurl 2008-05-15 Luke Macken * plugins/fastestmirror/fastestmirror.py: fastestmirror: Don't do anything if the user enabled cacheonly (-C) (rh#440428) 2008-05-05 Seth Vidal * docs/yum-complete-transaction.8, yum-complete-transaction.py: yum-complete-transaction --cleanup-only 2008-04-28 Seth Vidal * Makefile, docs/yum-debug-dump.1, yum-debug-dump.py, yum-utils.spec: yum-debug-dump app, man page, Makefile and spec file edits 2008-04-27 Seth Vidal * debuginfo-install.py, yum-builddep.py, yum-complete-transaction.py, yumdownloader.py: make sure all yum-utils using self.getOptionParser set it up as self.optparser not as 'parser' or anything else. this change is necessary due yum git checkin: 761e58a85937e9c56c7387c4d535e77db1b27c7b 2008-04-18 James Antill * repoquery.py: Use urlgrabber.progress.format_number for human readable output 2008-04-18 James Antill * docs/repoquery.1, repoquery.py: Add k,m,g,t and h ... and documentation about the special size syntax 2008-04-18 James Antill * repoquery.py: Remove unused function, add nevra format 2008-04-18 James Antill * docs/repoquery.1, repoquery.py: Add isodate and documentation about the special time syntax 2008-04-12 James Antill * plugins/keys/keys.py: Fix keys compare/sort 2008-04-12 James Antill * plugins/list-data/list-data.py: Fix None values, don't try and convert unicode to str() 2008-04-12 James Antill * plugins/keys/keys.py: Only root can run keys-remove 2008-04-10 James Antill * yum-utils.spec: Add install code for keys 2008-04-10 James Antill * plugins/keys/keys.py: Tweak keys* commands, add keys-remove command 2008-04-10 James Antill * plugins/keys/keys.conf, plugins/keys/keys.py: Plugin for yum commands to query info. on installed signing keys 2008-04-09 James Antill * plugins/filter-data/filter-data.py: Minor tidy thanks to pychecker 2008-04-09 James Antill * plugins/filter-data/filter-data.py: Merge the security fix into filter-data 2008-04-09 James Antill * plugins/security/security.py: Give slightly better messages for update/upgrade 2008-04-09 James Antill * plugins/security/security.py: Tidy code, due to pychecker 2008-04-09 James Antill * plugins/security/security.py: Fix xine-lib / xine-lib-extras-nonfree dep. problem. Problem: xine-lib doesn't require, xine-lib-extras-nonfree deps. on it but due to being in a different repo. isn't _also_ in the security data. And due to security filtering we filter the "remove txmbr" for the old version of xine-libs, which means there's nothing in the transaction to the check that xine-lib-extras-nonfree deps. on something that's going. 2008-04-04 Seth Vidal * repodiff.py: - make repodiff sort the output - make -q really mean -q 2008-04-04 Seth Vidal * repodiff.py: fix for listing modified pkgs correctly. 2008-04-02 James Antill * plugins/verify/verify.py: Do needTs logic in verify comand 2008-04-02 James Antill * plugins/changelog/changelog.py: Do the list needTs logic in changelog comand 2008-04-02 James Antill * plugins/aliases/aliases.py: Don't need Ts for alias 2008-04-02 James Antill * plugins/list-data/list-data.py: Do the list needTs logic in list/info-data comands 2008-03-31 James Antill * docs/Makefile, yum-utils.spec: Add install lines of yum-aliases man page 2008-03-31 James Antill * docs/yum-aliases.1: Add docs. for yum-aliases plugin 2008-03-26 Luke Macken * plugins/fastestmirror/fastestmirror-asyncore.py: Add an threadless version of fastestmirror that uses the asyncore module 2008-03-22 James Bowes * docs/package-cleanup.1, package-cleanup.py: Add more options for control over package-cleanup's --leaves option. Add the following options for --leaves: * --exclude-devel :: Any package whose name ends in devel is not a leaf. * --exclude-bin :: Any package that has a file with 'bin' in the name is not a leaf. * --leaf-regex :: A regular expression used for deciding if a package is a leaf. Use "^(perl)|(python)" to examine perl and python packages, for example. Defaults to "(^lib.*)|(.*lib(|s)$)". 2008-03-22 Seth Vidal * yum-utils.spec: add python-dateutil requires to yum-changelog for rh bug 438585 2008-03-21 Tim Lauridsen * ChangeLog: updated ChangeLog 2008-03-21 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.13 2008-03-21 Tim Lauridsen * docs/Makefile: more Makefile changes to install yum-complete-transaction in sbin and docs to man8 2008-03-21 Tim Lauridsen * Makefile: more Makefile changes to install yum-complete-transaction in sbin and docs to man8 2008-03-21 Tim Lauridsen * Makefile, docs/Makefile, yum-utils.spec: Makefile changes to install yum-complete-transaction in sbin and docs to man8 2008-03-21 Tim Lauridsen * ChangeLog: updated ChangeLog 2008-03-21 Tim Lauridsen * ChangeLog: bumped yum-utils version to 1.1.12 2008-03-21 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.12 2008-03-21 Tim Lauridsen * plugins/fastestmirror/fastestmirror.py: Added doc strings to fastestmirror plugin by Kulbir Saini 2008-03-20 Seth Vidal * repoclosure.py: add --repofrompath option to repoclosure to make jkeating happy. --repofrompath=repoid,url://to/repo 2008-03-19 Seth Vidal * docs/yum-complete-transaction.8, docs/yum-utils.1: add man pages properly *boggle* 2008-03-19 Seth Vidal * docs/yum-complete-transaction.1, yum-utils.spec: - apply patch from Shawn Starr which does: - yum utils man page - move yum-complete-transaction to /usr/sbin - move yum-complete-transaction manpage to be .8 not .1 2008-03-17 Seth Vidal * repodiff.py: output summary info for size changes and total diff. this is mostly b/c james a. is not wrong, but he's still a pain :) 2008-03-17 Seth Vidal * repodiff.py: add --size option to repodiff to output size changes among changed pkgs 2008-03-14 Seth Vidal * debuginfo-install.py: for rhbug #437427 - only install debuginfo's for deps if the requirment is a library of some type. So we check if the requirement contains ".so". if it does, install it, too. 2008-03-13 Seth Vidal * debuginfo-install.py: apply patch from Jan Kratochvil (jan.kratochvil@redhat.com) to make debuginfo-install obey arch 2008-03-13 Seth Vidal * repoquery.py: move info to the top of the list b/c it makes the most sense for it to be first 2008-03-13 Seth Vidal * reposync.py, repotrack.py: fix rh bug: 427724 - add --arch to repotrack fix minor bug with --urls in reposync 2008-03-13 Seth Vidal Merge branch 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum-utils * 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum-utils: The pinKernels functionality fails pretty badly if it can't match your make yumdownloader wine\* download all packages starting with wine (rhbz #435096) make yumdownloader return an non zero value if there is notthing to download (rhbz #170287) Fix man page bug, from RHEL testing Add yum compatible arg. Move debugging message to level 4 2008-03-13 Seth Vidal * plugins/merge-conf/merge-conf.py: slight edit to make it clearer what we're doing for bug 329261 2008-03-13 Seth Vidal * plugins/merge-conf/merge-conf.py: - make sure the user invokved merge-conf on the cli - only run if conf.assumeyes is not set fixes rh bug 329261 2008-03-12 Jack Neely Merge branch 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum-utils 2008-03-12 Jack Neely * plugins/fedorakmod/README, plugins/fedorakmod/fedorakmod.py: The pinKernels functionality fails pretty badly if it can't match your running kernel with a kernel package that it knows about. In this case we grab the highest EVR kernel that we know about and attempt to mimic the kernel modules setup for that kernel. This is handy in the %post of a kickstart as kernel pinning was always broken there or when some body erases your kernel. 2008-03-12 Tim Lauridsen * yumdownloader.py: make yumdownloader wine\* download all packages starting with wine (rhbz #435096) 2008-03-12 Tim Lauridsen * yumdownloader.py: make yumdownloader return an non zero value if there is notthing to download (rhbz #170287) 2008-03-12 James Antill * docs/yum-filter-data.1: Fix man page bug, from RHEL testing 2008-03-11 James Antill * repoquery.py: Add yum compatible arg. 2008-03-11 James Antill * plugins/aliases/aliases.py: Move debugging message to level 4 2008-03-07 Seth Vidal * yumdownloader.py: make sure noarch and other sub-arch downloads still work with --archlist 2008-03-06 Seth Vidal * yumdownloader.py: merge jesse keatings patch for --archlist in yumdownloader 2008-03-06 Seth Vidal * yum-complete-transaction.py: make sure the ts file exists before we unlink it. 2008-03-06 Seth Vidal * yum-complete-transaction.py: if the transaction we're cleaning up fails or exited for ANY REASON do not remove the old transaction files so the user can do it again after they've fixed whatever broke 2008-03-06 James Antill * plugins/list-data/list-data.py: Show unique values in info-* for size range, and baseurl. Make buildhosts output much more readable (use dnsdomainname grouping). 2008-03-01 James Antill * docs/Makefile, docs/yum-verify.1, plugins/verify/verify.conf, plugins/verify/verify.py, yum-utils.spec: Add verify plugin, and documentation 2008-02-27 James Antill * plugins/tmprepo/tmprepo.py: Minor cleanup 2008-02-25 Seth Vidal * repodiff.py: - add obsoletes reporting for non-srpm comparisons. This takes all the removed packages and sees if anything in the new packages obsoletes them. Only works for binary packages b/c srpms don't obsolete things. - added -a, --archlist option to handle looking at other arches as well as src rpms 2008-02-22 James Antill * docs/yum-changelog.1, plugins/changelog/changelog.py: Add recent lists, and allow number of changelogs instead of date 2008-02-22 James Antill * plugins/list-data/list-data.py: Add recent lists 2008-02-21 Seth Vidal * repomanage.py: spell payload right - thanks to Chris Aillon :) 2008-02-20 James Antill * plugins/aliases/aliases: Try and make the repo enable aliases more useful 2008-02-20 James Antill * plugins/versionlock/versionlock.list, yum-utils.spec: Create an empty versionlock file, so we can have it enabled by default 2008-02-20 James Antill * plugins/versionlock/versionlock.py: Revert "Fix non-existant version lock file SNAFU" This reverts commit 3a2d1fdf53635a8929693494b4fbacc2a5bf4545. All bugs are features for someone. 2008-02-20 Seth Vidal * debuginfo-install.py: make sure debuginfo-install obeys/sets yum locks 2008-02-20 James Antill * plugins/versionlock/versionlock.py: Fix non-existant version lock file SNAFU 2008-02-20 James Antill * plugins/versionlock/versionlock.py: Redo versionlock logic for major speedup in non-update cases 2008-02-20 James Antill * plugins/versionlock/versionlock.py: Add obvious speedup to versionlock when no packages versionlocked. 2008-02-20 James Antill * plugins/versionlock/versionlock.conf: Auto enable versionlock on install, as all other plugins do 2008-02-20 James Antill * plugins/versionlock/versionlock.py: Fix versionlock plugin 2008-02-19 James Antill * yum-utils.spec: Fix typo 2008-02-19 James Antill * plugins/changelog/changelog.py: Output the normal list headers 2008-02-18 James Antill * docs/yum-changelog.1, plugins/changelog/changelog.py: Add changelog command to yum-changelog 2008-02-18 James Antill * plugins/fedorakmod/fedorakmod.py: Fix two == None bugs 2008-02-16 Seth Vidal * repoquery.py, yumdownloader.py: repoquery: fix a typo in --enablerepos handling yumdownloader: clean up some crap - make sure that for --enablerepo'd repos that the cachedir is set properly 2008-02-15 Seth Vidal * repoquery.py: make enablerepo behave like yum enablerepo - not like repoid 2008-02-15 Seth Vidal * repoquery.py: support --enablerepo/disablerepo in repoquery so it is more like other yum-utils 2008-02-15 Seth Vidal * repoquery.py: make sure we catch the trace if we're in caching mode and there is no metadata thanks to Bill Nottingham for reporting this one. 2008-02-14 Seth Vidal * docs/package-cleanup.1: apply docs patch from Matej Cepl for rh bug 429158 2008-02-13 James Antill * plugins/refresh-updatesd/refresh-updatesd.py: Do the import 2008-02-13 James Antill * plugins/refresh-updatesd/refresh-updatesd.py: Don't refresh yum-updatesd if we can't have updated anything 2008-02-11 James Antill * plugins/aliases/aliases.py: Remove i18n _ from aliases until we have one 2008-02-08 Seth Vidal Merge branch 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum-utils * 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum-utils: (22 commits) Change groups => rpm-groups, yum-groups => groups. Minor fixes Fix copy and paste problem Add yum groups, to filter-data and list-data Fix the man8 to man1 move in specfile Remove left overs from copy and paste. Also add group examples Add yum-filter-data man page Don't split values with spaces in their names, on spaces Man page for yum-list-data plugin, apparently less /usr/lib/yum-plugins/*.py is not enough for everyone :) Use full command name Add upgrade as a valid command to security The compliment to the list-data plugin, allows you to filter packages based Keep the .strip() result for all strings Add special case for "zero length" sizes updated ChangeLog bumped yum-utils version to 1.1.11 Add --tmprepo as a plugin New help info. for aliases Add support for the new help Add support for the new help Fix bad import ... 2008-02-08 Seth Vidal * yum-utils.spec: add more detail to the description so searches match more 2008-02-05 James Antill * docs/yum-filter-data.1, docs/yum-list-data.1, plugins/filter-data/filter-data.py, plugins/list-data/list-data.py: Change groups => rpm-groups, yum-groups => groups. Minor fixes 2008-02-05 James Antill * docs/yum-filter-data.1: Fix copy and paste problem 2008-02-05 James Antill * docs/yum-filter-data.1, docs/yum-list-data.1, plugins/filter-data/filter-data.py, plugins/list-data/list-data.py: Add yum groups, to filter-data and list-data 2008-02-04 James Antill * yum-utils.spec: Fix the man8 to man1 move in specfile 2008-02-04 James Antill * docs/yum-filter-data.1: Remove left overs from copy and paste. Also add group examples 2008-02-04 James Antill * docs/Makefile, docs/yum-filter-data.1, docs/yum-list-data.1, yum-utils.spec: Add yum-filter-data man page 2008-02-04 James Antill * plugins/filter-data/filter-data.py: Don't split values with spaces in their names, on spaces 2008-02-04 James Antill * docs/Makefile, docs/yum-list-data.1, yum-utils.spec: Man page for yum-list-data plugin, apparently less /usr/lib/yum-plugins/*.py is not enough for everyone :) 2008-02-04 James Antill * docs/yum-security.8: Use full command name 2008-02-01 James Antill * plugins/security/security.py: Add upgrade as a valid command to security 2008-02-01 James Antill * plugins/filter-data/filter-data.conf, plugins/filter-data/filter-data.py, yum-utils.spec: The compliment to the list-data plugin, allows you to filter packages based on arbitrary package data. 2008-01-31 James Antill * plugins/list-data/list-data.py: Keep the .strip() result for all strings 2008-01-31 James Antill * plugins/list-data/list-data.py: Add special case for "zero length" sizes 2008-01-30 Tim Lauridsen * ChangeLog: updated ChangeLog 2008-01-30 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.11 2008-01-28 James Antill * plugins/tmprepo/tmprepo.conf, plugins/tmprepo/tmprepo.py, yum-utils.spec: Add --tmprepo as a plugin 2008-01-28 James Antill * plugins/aliases/aliases.py: New help info. for aliases 2008-01-25 James Antill * plugins/security/security.py: Add support for the new help 2008-01-25 James Antill * plugins/list-data/list-data.py: Add support for the new help 2008-01-25 James Antill * plugins/list-data/list-data.py: Fix bad import 2008-01-25 James Antill * plugins/priorities/priorities.py: Make yum-priorities not eat CPU just by installing it 2008-01-23 James Antill * plugins/list-data/list-data.py: Use .committer property in HEAD yum 2008-01-23 Seth Vidal * debuginfo-install.py, repoclosure.py, repodiff.py, repomanage.py, repotrack.py, yum-complete-transaction.py: add better usage explanations to a lot of yum-utils. helps to give people an idea what the tool is used for. 2008-01-15 James Antill * plugins/list-data/list-data.conf, plugins/list-data/list-data.py, yum-utils.spec: List vendors, groups, packagers, buildhosts, licenses, arches, buildhosts, baseurls, package-sizes, archive-sizes, installed-sizes, committers 2008-01-19 James Antill * docs/package-cleanup.1: Reorder option docs to be sorted 2008-01-19 James Antill * docs/package-cleanup.1: Remove duplicate doc 2008-01-18 Seth Vidal * repodiff.py: make sure this only operates on src rpms b/c otherwise bad things happen 2008-01-18 James Antill * yum-utils.spec: Fix typo 2008-01-17 Seth Vidal * repodiff.py: add -q, --new and --old options to repodiff. Correct some logic issues in the diffing, fix up the output to a pipe 2008-01-16 James Antill * yumdownloader.py: Remove hack for *-source repos. 2008-01-16 James Antill * yumdownloader.py: Real fix for the __len__ problem. Don't disableRepo() and then enable it, this even do the disable last ... oops. 2008-01-13 Seth Vidal add repodiff, merge yum-utils.spec 2008-01-13 Seth Vidal * Makefile, repodiff.py, yum-utils.spec: add repodiff 2008-01-10 James Antill * plugins/aliases/aliases.py: Workaround for bad yum module users 2008-01-09 James Antill * plugins/security/security.py: Remove extra newlines, __str__ already leads with one 2008-01-09 James Antill * plugins/aliases/aliases: Remove empty lss alias and minor cleanup 2008-01-03 Tim Lauridsen * ChangeLog: updated ChangeLog 2008-01-03 Tim Lauridsen * Makefile: bumped yum-utils version to 1.1.10 2008-01-03 Tim Lauridsen * ChangeLog: updated ChangeLog 2008-01-03 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.10 2008-01-03 Tim Lauridsen * ChangeLog: updated ChangeLog 2008-01-03 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.10 2007-12-21 James Antill * plugins/aliases/aliases.py: Quick work around for yumex 2007-12-21 Seth Vidal * debuginfo-install.py: make sure we're root to run debuginfo-install closes rh bug #426470 2007-12-20 James Antill * .gitignore: Match foo.py~ for backup files 2007-12-20 James Antill * yum-utils.spec: Fix typo 2007-12-20 James Antill * yum-utils.spec: Add yum-aliases to the specfile 2007-12-20 James Antill * plugins/aliases/aliases, plugins/aliases/aliases.conf, plugins/aliases/aliases.py: Add aliases module 2007-12-17 Luke Macken * plugins/fastestmirror/ChangeLog, plugins/fastestmirror/fastestmirror.py: Update fastestmirrors ChangeLog, and do a rev bump 2007-12-17 Luke Macken * plugins/fastestmirror/fastestmirror.py: Strip any username:passwords from our mirrors hostname before we display it 2007-12-17 Luke Macken * plugins/fastestmirror/fastestmirror.py: Only display our mirrors if we have some 2007-12-17 Seth Vidal * plugins/priorities/priorities.py: apply patch to fix rh bug: 421961 - make sure we're passing in opts before we get the value of the opts. 2007-12-12 Seth Vidal Merge branch 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum-utils * 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum-utils: Move conduit.getPackages until needed, as it takes significant time 2007-12-12 Seth Vidal * reposync.py: make sure that our repo url has a trailing /, otherwise urljoin does the wrong thing. We should probably append this higher up in the stack, too. closes rh bug: 421801 2007-12-11 James Antill * plugins/basearchonly/basearchonly.py: Move conduit.getPackages until needed, as it takes significant time 2007-12-10 Seth Vidal * yum-complete-transaction.py: make yum-complete-transaction backward compat to yum 3.2.7/3.2.8 2007-12-10 Seth Vidal * docs/Makefile: add complete-transaction to doc makefile, too 2007-12-10 Seth Vidal * Makefile, docs/yum-complete-transaction.1, yum-complete-transaction.py, yum-utils.spec: add yum-complete-transaction man page and update specfile/makefile 2007-12-10 Seth Vidal Merge branch 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum-utils * 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum-utils: Fix unreferenced variable in repoclosure.py updated ChangeLog bumped yum-utils version to 1.1.9 bumped yum-utils version to 1.1.9 2007-12-10 Seth Vidal * yum-complete-transaction.py: implement yum-util to clean up unfinished/aborted transactions using transaction-done/transaction-all files. 2007-12-07 Luke Macken * repoclosure.py: Fix unreferenced variable in repoclosure.py 2007-12-07 Tim Lauridsen * ChangeLog: updated ChangeLog 2007-12-07 Tim Lauridsen * ChangeLog, yum-utils.spec: bumped yum-utils version to 1.1.9 2007-12-07 Tim Lauridsen * yum-utils.spec: bumped yum-utils version to 1.1.9 2007-12-06 Seth Vidal * package-cleanup.py: get rid of the confirmation to clean up old dupes when there are no dupes to clean up. rh bug: 328711 2007-12-03 Luke Macken * plugins/fastestmirror/ChangeLog, plugins/fastestmirror/fastestmirror.conf, plugins/fastestmirror/fastestmirror.py: Support multiple mirror excludes in fastestmirror 2007-12-03 Luke Macken * plugins/fastestmirror/ChangeLog: update fastestmirrors ChangeLog 2007-12-03 Luke Macken * plugins/fastestmirror/fastestmirror.py: Add an 'exclude' configuration option to fastestmirror (Bug #407471) 2007-12-03 Luke Macken * plugins/fastestmirror/fastestmirror.conf, plugins/fastestmirror/fastestmirror.py: Add a maxthreads configuration option to fastestmirror (Bug #227772) 2007-12-03 Luke Macken * plugins/fastestmirror/fastestmirror.py: Actually display the fastest mirrors 2007-12-03 Luke Macken * plugins/fastestmirror/fastestmirror.py: Remove unused PluginYumExit import 2007-11-23 Tim Lauridsen * package-cleanup.py: Added patch by Ville Skytta to make 'package-cleanup --leaves' catch *lib and *libs 2007-11-21 Seth Vidal * yum-builddep.py: port yum-builddep to YumUtilBase format. Make it actually, work :) closes rh bug #381291 2007-11-21 Seth Vidal * package-cleanup.py: clean up a deprecation 2007-11-19 Tim Lauridsen * plugins/basearchonly/basearchonly.conf, plugins/basearchonly/basearchonly.py: basearchobly patch by Adel Gadllah * Fix system-install-packages crash on F8 * Add wildcard support to whitelist * Add all wine packages to the default whitelist on x86 (wine*) 2007-11-12 Tim Lauridsen * Makefile, plugins/priorities/ChangeLog, plugins/priorities/priorities.py: Added optparser check in priorities plugin (bz #847) 2007-11-05 Tim Lauridsen * plugins/priorities/ChangeLog, plugins/priorities/README, plugins/priorities/priorities.py: Make the name.arch checking optional in the priorities plugin. This adds the 'only_samearch' plugin option and the '--samearch-priorities' 2007-10-29 Seth Vidal * plugins/basearchonly/basearchonly.conf: apply patch from Adel Gadllah to add libflashsupport to basearchonly-plugin whitelist 2007-10-29 Seth Vidal * repoquery.py: apply patch from Bill Nottingham to make repoquery more silent when --quiet is specified. 2007-10-29 Seth Vidal * plugins/upgrade-helper/cleanup.xml, plugins/upgrade-helper/remove-stuff.xml: rename remove-stuff.xml to cleanup.xml 2007-10-26 Seth Vidal * plugins/upgrade-helper/upgrade-helper.py: make it work with more recent matchPackageNames than when I originally wrote it 2007-10-26 Seth Vidal * yum-utils.spec: left out upgrade-helper from the list of plugins 2007-10-26 Seth Vidal * plugins/upgrade-helper/remove-stuff.xml, plugins/upgrade-helper/upgrade-helper.conf, plugins/upgrade-helper/upgrade-helper.py, yum-utils.spec: add upgrade-helper - this _should_ work - but I'll be testing it some more before tagging 2007-10-25 Seth Vidal * yumdownloader.py: catch error on download if destdir is not writable. closed rh bug 352911 2007-10-17 Tim Lauridsen * ChangeLog: updated ChangeLog 2007-10-17 Tim Lauridsen * Makefile, yum-utils.spec: bumped yum-utils version to 1.1.8 2007-10-17 Tim Lauridsen * updateonboot/yum-updateonboot.init, yumdownloader.py: Make yumdownloader work as non-root users even if *-source repos is enabled in *.repo files or by --enablerepo. 2007-10-17 Seth Vidal * yumdownloader.py: catches an error if someone has --enablerepo or --disablerepo set and tries to tell them what to do. 2007-10-16 Seth Vidal * yumdownloader.py: make sure enabled source repos don't cause yumdownloader --source to not do the right thing 2007-10-15 Seth Vidal * repo-rss.py: add config file option to repo-rss 2007-10-15 Seth Vidal Merge branch 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum-utils * 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum-utils: provide more verbose failure information with higher debug level check for yum-updatesd being on the bus in case we're using system activation refresh-updatesd: documentation updates refresh-updatesd: Remove repos_setup check. refresh-updatesd: some tweaks fixed issue in debuginfo-install there make it fail with plugins there uses conduit.getPackages() (rhbz #249742) chmod +x *.py (make it a little easier to test) fixed UnboundLocalError: local variable 'r_e' referenced before assignment in repoquery (convert unicode -> str) Make package-cleanup --orphans work as no root (rhbz #253352) Fixed yumdownloader --url output to show the right url (rhbz #301981) Allow package name globs on the list-sec/info-sec lines We need to catch when we install a kmod with a lower VR than a kmod of Don't print metadata more than once 2007-10-15 Seth Vidal * repo-rss.py: - apply guid patch from ricky zhou to repo-rss.xml - add -a option to specify arches that repo-rss should use 2007-10-09 Jeremy Katz * plugins/refresh-updatesd/refresh-updatesd.py: provide more verbose failure information with higher debug level 2007-10-09 Jeremy Katz * plugins/refresh-updatesd/refresh-updatesd.py: check for yum-updatesd being on the bus in case we're using system activation 2007-09-30 James Bowes * plugins/refresh-updatesd/README, plugins/refresh-updatesd/refresh-updatesd.py, yum-utils.spec: refresh-updatesd: documentation updates 2007-09-30 James Bowes * plugins/refresh-updatesd/refresh-updatesd.py: refresh-updatesd: Remove repos_setup check. Since the plugin fires a dbus signal only on posttrans, it will only fire if yum is doing something. This is enough of a check in itself. 2007-09-28 Bill Nottingham * plugins/refresh-updatesd/refresh-updatesd.py: refresh-updatesd: some tweaks 1) Be less verbose, as yum-updatesd might not be running 2) Run on posttrans, not close. This stops it continually firing off when I run repoqeury. (Perhaps repoquery shouldn't initialize plugins, but...) Bill 2007-09-28 Tim Lauridsen * debuginfo-install.py: fixed issue in debuginfo-install there make it fail with plugins there uses conduit.getPackages() (rhbz #249742) 2007-09-28 Tim Lauridsen * debuginfo-install.py, repo-rss.py, repoclosure.py, repomanage.py, repoquery.py, reposync.py, repotrack.py, yumdownloader.py: chmod +x *.py (make it a little easier to test) 2007-09-28 Tim Lauridsen * repoquery.py: fixed UnboundLocalError: local variable 'r_e' referenced before assignment in repoquery (convert unicode -> str) 2007-09-28 Tim Lauridsen * package-cleanup.py: Make package-cleanup --orphans work as no root (rhbz #253352) 2007-09-23 Tim Lauridsen * yumdownloader.py: Fixed yumdownloader --url output to show the right url (rhbz #301981) 2007-09-19 James Antill Fix merge 2007-09-19 Tim Lauridsen Merge branch 'yum-sec-upmd-info-uniq' of http://people.redhat.com/jantill/gits/yum-utils 2007-09-19 James Antill * plugins/security/security.py: Allow package name globs on the list-sec/info-sec lines 2007-09-19 Jack Neely * plugins/fedorakmod/fedorakmod.py: We need to catch when we install a kmod with a lower VR than a kmod of the same name that is already installed. RPM doesn't like this so we need to toss in an extra flag or the transaction wont proccede. 2007-09-19 James Antill * plugins/security/security.py: Don't print metadata more than once 2007-09-18 Tim Lauridsen * package-cleanup.py: Added patch by Mathew Miller to make package-cleanup return exit code 2007-09-14 Tim Lauridsen * yum-utils.spec: do not use wildcards for manpages in yum-utils files section to avoid duplicates (rhbz #290171) 2007-09-14 Tim Lauridsen * ChangeLog, yum-utils.spec: commited yum-utils.spec & Changelog for yum-utils 1.1.7 ( I was some how not committed when i made the release :-( 2007-09-11 Seth Vidal * repoquery.py: add --plugins support to repoquery, too 2007-09-11 Seth Vidal * reposync.py: add option to enable plugins for reposync (helps with using it with rhn-plugin) 2007-09-07 Seth Vidal * plugins/skip-broken/skip-broken.py: closes rh bug 281881 - don't traceback when skip-broken is enabled 2007-09-06 Tim Lauridsen * docs/repoquery.1, repoquery.py: Fixed repoquery help & manpage with --repofrompath=, 2007-09-06 Tim Lauridsen * repoquery.py: Make the --repofrompath take a repoid, so we know what to call the repo' 2007-09-05 Seth Vidal * docs/repoquery.1, repoquery.py: add --repofrompath and docs to repoquery --repofrompath allows repoquery to query arbitrary paths as repositories 2007-09-05 Seth Vidal * repoquery.py: merge --recursive patch from Thomas Vander-Stichele 2007-09-05 Tim Lauridsen * repoquery.py: Added patch by Bill Nottingham to silence progressbars in pipes 2007-09-02 Seth Vidal * debuginfo-install.py: make debuginfo-install use function for matching correctly 2007-08-17 Tim Lauridsen * repoquery.py: Added patch by Panu (rhbz #246519) to make repoquery --whatprovides work with root level directories. 2007-08-12 Seth Vidal * yum-builddep.py: change exception from PackageSackError to YumBaseError to close rh bug #251827 2007-08-08 Luke Macken * plugins/fastestmirror/ChangeLog, plugins/fastestmirror/fastestmirror.py: - Add patch from Christopher Aillon to fail quietly when fastestmirror does not have write access to the timed hostfile. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=237034 2007-08-04 Panu Matilainen * repoquery.py: Repoquery wants to have quiet output by default, it's mostly used in scripts where you don't want any extra junk in the output: - add --verbose option, default to quiet - honor quiet on initialization to avoid messages from plugins as well 2007-08-01 Tim Lauridsen * .gitignore: Added .gitignore 2007-08-01 Tim Lauridsen * yum-utils.spec: Added basearchonly by Adel Gadllah to the spec file 2007-07-31 Tim Lauridsen Merge branch 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum-utils 2007-07-31 Tim Lauridsen * plugins/basearchonly/basearchonly.conf, plugins/basearchonly/basearchonly.py: Added basearchonly plugin files 2007-07-29 Tim Lauridsen * plugins/priorities/priorities.py: fixed obsoletes handling (rhbz #247246) 2007-07-29 Tim Lauridsen * plugins/priorities/priorities.py: revert the latest check_version, it is not totally sane 2007-07-29 Tim Lauridsen * plugins/priorities/priorities.py: Added full version support to priorities plugin (rhbz #249991) Use 'check_versions=1' in priorities.conf to use full nerva check, insted of the default na check. 2007-07-26 Tim Lauridsen * plugins/skip-broken/skip-broken.py: Make skip-broken work again by deleting depsolver cache in each run. 2007-07-25 Tim Lauridsen * Makefile: changed 'archive' Makefile target to work with git-archive (HEAD) 2007-07-24 Tim Lauridsen * Makefile: Fixed git tagging & pushing to work right 2007-07-24 Tim Lauridsen * ChangeLog: updated ChangeLog 2007-07-24 Tim Lauridsen * ChangeLog, yum-utils.spec: bumped yum-utils version to 1.1.6 2007-07-24 Tim Lauridsen * Makefile, tools/README, tools/git2cl: Make the Makefile targets work with git insted of cvs. Added tools\git2cl perl script to create ChangeLog from a git repository 2007-07-24 Tim Lauridsen * Makefile: Remove .git directory from tarball 2007-07-24 Tim Lauridsen * plugins/security/security.py: Added patch to solve speed issue insecurity plugin by James Antill 2007-07-24 Seth Vidal * README: useless test 2007-07-24 Seth Vidal * README: add link to yum wiki about yum-utils. 2007-07-23 Seth Vidal * TODO: more and another test 2007-07-23 Seth Vidal * README: add tim to the README and test the commits email 2007-07-17 Tim Lauridisen * yum-utils.spec: Added Requires: yum-updatesd to yum-refresh-updatesd in spec file rhbz (#248181) 2007-07-13 Tim Lauridisen * updateonboot/Makefile: Added patch by Schlomo Schapiro to make yum-utils build on Suse SLES 10 (wrong init.d dir) 2007-07-03 Panu Matilainen * plugins/versionlock/README, yum-utils.spec: Add versionlock list format documentation (finally...) 2007-06-26 Seth Vidal * repomanage.py: clean up some other calls to that particular exception 2007-06-26 Seth Vidal * repomanage.py: fix formatting error in repomanage closes rh bug #: 245698 I believe this was caused by a change in BaseException in python 2.5 2007-06-26 Tim Lauridisen * yumdownloader.py: solved issue where '--source' was not working if souce repo was enabled in the .repo files (rhbz #244543). made yumdownloader a little more verbose. 2007-06-22 Tim Lauridisen * plugins/protect-packages/protect-packages.py: added cleanup patch to protect-packages plugin by Matthew Miller 2007-06-21 Tim Lauridisen * plugins/protect-packages/protect-packages.conf, plugins/protect-packages/protect-packages.py, yum-utils.spec: Added protect-packages plugin by Svetlana Anissimova and Matthew Miller 2007-06-18 Tim Lauridisen * yumdownloader.py: Make 'yumdownloader --source kernel' work as nonroot with yum 3.2 & and current CVS Head. 2007-06-18 Tim Lauridisen * ChangeLog: updated ChangeLog 2007-06-18 Tim Lauridisen * yum-utils.spec: bumped yum-utils version to 1.1.5 2007-06-17 Tim Lauridisen * plugins/merge-conf/merge-conf.py: Patch to detech vimdiff by Aurelien Bompard 2007-06-15 Panu Matilainen * repoquery.py: Ugly kludge to force local preferred encoding for stdout when redirected to a file where python defaults to ascii... ick. Mostly fixes rhbz#239744. 2007-06-05 Tim Lauridisen * reposync.py: Added patch by Perry Myers: fixes reposync so that it is properly skipping packages that have already been downloaded. 2007-06-05 Tim Lauridisen * repotrack.py, yumdownloader.py: Added patch by Perry Myers: fixes repotrack and yumdownloader so that they properly skip packages that have already been downloaded. 2007-05-30 Seth Vidal * reposync.py: Commit 3 patches from Dan Berrange: 1. output better progress callback for the user in reposync 2. allow the user to set the cachedir specifically in reposync 3. allow reposync to delete no-longer-available packages from the local copy 2007-05-28 Panu Matilainen * plugins/changelog/changelog.py: - filter out packages not updating anything to fix rhbz#238876 - drop extra newline after each changelog entry to make formatting nicer 2007-05-26 Seth Vidal * debuginfo-install.py: if the transaction set is empty, don't try to run it. :) closes rh bug: 241466 2007-05-23 James Bowes * repoquery.py: repoquery - remove unneeded arguments for option init, and load core plugins 2007-05-17 Seth Vidal * repoquery.py: if the user doesn't specify -c then just use whatever the default is for the yum version they have installed. Don't default to /etc/yum.conf anymore. 2007-05-16 Tim Lauridisen * ChangeLog: updated ChangeLog 2007-05-16 Tim Lauridisen * yum-utils.spec: bumped yum-utils version to 1.1.4 2007-05-16 Tim Lauridisen * plugins/security/security.py: Added patch by James Antill: It seems that on RHEL5 there are update metadata entries with references == None (in my FC6 testing they were always == []). This gives a traceback with the current code. 2007-05-09 Tim Lauridisen * yumdownloader.py: removed crap from comment . 2007-05-09 Tim Lauridisen * yumdownloader.py: make the '--source' work and make it a little smarter so the 'reponame-source' are enabled automaticly for all enabled repos, when '--source' is used. (rhbz #239528) 2007-05-08 Tim Lauridisen * plugins/security/security.py: Added patch to security plugin by Luke Macken 2007-05-08 Tim Lauridisen * plugins/security/security.py: Added patch by James Antill. 2007-05-01 Tim Lauridisen * ChangeLog: updated ChangeLog 2007-05-01 Tim Lauridisen * yum-utils.spec: bumped yum-utils version to 1.1.3 2007-05-01 Seth Vidal * Makefile, yum-util-cli-template, yum-utils.spec: - finish added debuginfo-install to makefile - add yum-util-cli-template to repo and add it to %doc in spec file - this is a template for folks to easily add more cli-based yum-utils 2007-05-01 Seth Vidal * yum-utils.spec: add debuginfo-install to spec file 2007-05-01 Seth Vidal * debuginfo-install.py: add debuginfo-install to yum-utils 2007-04-30 Tim Lauridisen * docs/Makefile, docs/reposync.1: Added reposync man page by Daniel de Kok (#717) 2007-04-30 Tim Lauridisen * reposync.py: Added gpgcheck option to reposync by Daniel de Kok (#715) adding a "-g/--gpgcheck" option that removes a newly downloaded package if the signature is not correct. 2007-04-29 Seth Vidal * docs/Makefile: make sure man8 is made before installing the man page for yum-security 2007-04-24 Tim Lauridisen * updateonboot/yum-updateonboot.init: Changed yum-updateonboot priorities to 25/75 -> 30/70 rhbz #235509 2007-04-21 Tim Lauridisen * plugins/downloadonly/downloadonly.py: fixed traceback when using --downloaddir rhbz #237367 2007-04-20 Tim Lauridisen * docs/Makefile, docs/yum-security.8, plugins/security/security.conf, plugins/security/security.py, yum-utils.spec: Added security plugin written by James Antill 2007-04-19 Luke Macken * plugins/fastestmirror/ChangeLog, plugins/fastestmirror/fastestmirror.py: * Apr 19 2007 Luke Macken - 0.2.7 - Remove TYPE_{INTERFACE,INTERACTIVE} 2007-04-13 Tim Lauridisen * yumdownloader.py: create destdir if it not exists 2007-04-12 Tim Lauridisen * ChangeLog: updated ChangeLog 2007-04-12 Tim Lauridisen * ChangeLog: bumped yum-utils version to 1.1.2 2007-04-12 Tim Lauridisen * yum-utils.spec: bumped yum-utils version to 1.1.2 2007-04-12 Tim Lauridisen * plugins/merge-conf/merge-conf.conf, plugins/merge-conf/merge-conf.py: Added merge-conf plugin written by Aurelien Bompard 2007-03-20 Tim Lauridisen * plugins/kernel-module/kernel-module.py: changed getRpmDB().getPackages() -> getRpmDB().returnPackages() 2007-03-19 Tim Lauridisen * repoquery.py: make repoquery work, when running as normal user. 2007-03-14 Tim Lauridisen * plugins/skip-broken/skip-broken.py: Make the skip-broken a little smarter and the make the output better. 2007-03-13 Tim Lauridisen * Makefile: added cleanup of test/ to Makefile. 2007-03-13 Tim Lauridisen * plugins/skip-broken/skip-broken.conf, plugins/skip-broken/skip-broken.py: Added 'check_always' option to the skip-broken plugin. Setting 'check_always=1' will make the skip-broken check run every time. (rhbz #231523) 2007-03-01 Tim Lauridisen * plugins/skip-broken/skip-broken.py: remove special hack to work with current api, they are not nesesary any more. 2007-03-01 Tim Lauridisen * plugins/skip-broken/skip-broken.py: more clean fix for work with latest yum api 2007-03-01 Tim Lauridisen * plugins/skip-broken/skip-broken.py: fixed issues with the latest changes in yum cvs head 2007-02-27 Tim Lauridisen * test/test-all, test/test-package-cleanup, test/test-repo-graph, test/test-repo-rss, test/test-repoclosure, test/test-repoquery, test/test-reposync, test/test-repotrack, test/test-yumdownloader: Added some test scripts to test the basic functions of the yum-utils. 2007-02-20 Tim Lauridisen * ChangeLog: updated ChangeLog 2007-02-20 Tim Lauridisen * ChangeLog: bumped yum-utils version to 1.1.1 2007-02-20 Tim Lauridisen * repo-rss.py: fixed UnicodeEncodeError: 'ascii' codec can't encode character errors. 2007-02-19 Panu Matilainen * plugins/kernel-module/kernel-module.py: - fix deprecation warning 2007-02-19 Tim Lauridisen * ChangeLog: updated ChangeLog 2007-02-19 Tim Lauridisen * yum-utils.spec: bumped yum-utils version to 1.1.1 2007-02-19 Tim Lauridisen * plugins/changelog/changelog.py, repo-rss.py, repoclosure.py, repoquery.py: changed 'with=' to 'mdtype=' in repos.populateSack calls, because of changes in the yum API in YumPackageSack.populate method to avoid warnings about 'with' is a reserved word in Python 2.6. 2007-02-19 Tim Lauridisen * yumdownloader.py: redesigned yumdownloader to use the new yum-utils base class introduced in yum-3.1.1. This version inherit all command line options from the yum-cli and also command line option added by yum plugins. 2007-02-19 Tim Lauridisen * ChangeLog: updated ChangeLog 2007-02-19 Tim Lauridisen * yum-utils.spec: bumped yum-utils version to 1.1.0 2007-02-19 Tim Lauridisen * Makefile: - Made 'make release' work with %{?dist} tag in spec. - 'make ChangeLog' will follow CVS HEAD. - Added 'archive' dependency to 'make srpm' 2007-02-15 Tim Lauridisen * plugins/versionlock/versionlock.list, yum-utils.spec: removed installation of default versionlock.list 2007-02-14 Tim Lauridisen * repo-rss.py: Add a better formating for description, get rid of the body tag for the xml generated by repo-rss. Thanks to Aurelien Bompard (rhbz #193111). 2007-02-14 Tim Lauridisen * plugins/priorities/priorities.py: Make priorities plugin work with multiarch repositories with different repositories. (foo.i386 <> foo.x86_64) rhbz #227540 2007-02-14 Tim Lauridisen * plugins/versionlock/versionlock.list, yum-utils.spec: added versionlock.list to versionlock plugin to avoid at lot of bugzilla reports where people have installed all plugins and then yum,pirut etc. are failing because the versionlock.list file dont exist. 2007-02-14 Tim Lauridisen * yum-utils.spec: fixed skip-broken description (--ignore-broken -> --skip-broken) 2007-02-14 Tim Lauridisen * repo-rss.py: Added patch to make repo-rss create one feed per group found in comps.xml. Thanks to Aurelien Bompard (rhbz #191061) 2007-02-14 Tim Lauridisen * plugins/downloadonly/downloadonly.py: Added '--downloaddir' option to downloadonly plugin. the option make it posible to change the directory where packages are downloaded. Thanks to Dmitry Butskoy (rhbz #213623) 2007-02-14 James Bowes * plugins/refresh-updatesd/README, plugins/refresh-updatesd/refresh-updatesd.conf, plugins/refresh-updatesd/refresh-updatesd.py, yum-utils.spec: Add refresh-updatesd plugin 2007-02-08 Tim Lauridisen * yum-utils.spec: modified spec til to work with yum-changelog man pages Added missing wildcards, so it can build 2007-02-08 Tim Lauridisen * yum-utils.spec: modified spec til to work with yum-changelog man pages 2007-02-08 Tim Lauridisen * docs/Makefile, docs/yum-changelog.1, docs/yum-changelog.conf.5: Added yum-changelog man pages by Chitlesh GOORAH and changed the docs Makefile to install them. 2007-02-07 Tim Lauridisen * yum-utils.spec: Updated spec for HEAD to require yum >= 3.1.1 and set the version to 1.1.0 2007-02-06 Tim Lauridisen * yum-utils.spec: Added %{?dist} to release in spec file, so the spec can be used as is in Fedora Extras and it dont hurt other distros. 2007-02-05 Tim Lauridisen * repoclosure.py: Added patch by Michael Schwendt to sort repoclosure output (yum bz# 681) 2007-01-25 Tim Lauridisen * yumdownloader.py: Fix traceback in yumdownloader using --resolve because rpmdb was not initialized. 2007-01-24 Jack Neely * plugins/fedorakmod/README, plugins/fedorakmod/fedorakmod.py: Clean up some comments and debug statements in fedorakmod.py. Also, updated the TODO list in the README. 2007-01-24 Panu Matilainen * plugins/tsflags/tsflags.py: - fix deprecation warning on plugin type 2007-01-23 Jack Neely * plugins/fedorakmod/fedorakmod.conf, plugins/fedorakmod/fedorakmod.py: fedorakmod.conf: Turn off installallkmods by default. fedorakmod.py: Work around Yum not populating the provides prco information if that is the case. With installallkmods on you can type "yum install kmod-sysprof" and have that module installed for all installed kernels and kernel types. 2007-01-11 Panu Matilainen * yum-builddep.py: - resurrect builddep by package name (rh #220842) - enable core type plugins (eg to allow for fastestmirror) 2007-01-11 Panu Matilainen * repoquery.py: - fix a stupid typo breaking prco operations 2007-01-03 Tim Lauridisen * Makefile: minor change in the Makefile, added Makefile depencies to the upload section. 2006-12-31 Tim Lauridisen * ChangeLog: updated ChangeLog 2006-12-31 Tim Lauridisen * yum-utils.spec: bumped yum-utils version to 1.0.2 2006-12-31 Tim Lauridisen * plugins/skip-broken/skip-broken.py: Changed the CLI option to active the skip-broken from '--ignore-broken' to '--skip-broken', because it make more sense. 2006-12-20 Panu Matilainen * repoquery.py: - fix deprecation warning 2006-12-02 Seth Vidal * docs/yumdownloader.1: close rh bug # 218100 - typo in yumdownloader man page. 2006-11-13 Tim Lauridisen * plugins/versionlock/versionlock.py: fixed AttributeError: YumAvailablePackageSqlite instance has no attribute 'returnNevra in versionlock plugin yum bugzilla #667 2006-11-13 Tim Lauridisen * yum-utils.spec: Added patch from bugzilla #578 2006-11-09 Panu Matilainen * repoquery.py: - fix --cache and --show-dupes options 2006-11-07 Seth Vidal * package-cleanup.py: add in a 'clean old dupes' option to get rid of version-wise-older dupes in the rpmdb 2006-11-03 Tim Lauridisen * yumdownloader.py: Fix problem with yumdownloader prints everything twice because doConfigSetup was called twice. 2006-10-31 Tim Lauridisen * Makefile: add ${RELEASE} tag to filename when uploading srpm 2006-10-31 Tim Lauridisen * Makefile: Added srpm building and upload to Makefile 2006-10-31 Tim Lauridisen * yum-utils.spec: forgot to update spec file changelog for 1.0.1 2006-10-31 Tim Lauridisen * ChangeLog: updated ChangeLog 2006-10-31 Tim Lauridisen * ChangeLog, yum-utils.spec: bumped yum-utils version to 1.0.1 2006-10-31 Tim Lauridisen * Makefile: added tags to make releases more easy 2006-10-27 Tim Lauridisen * yum-utils.spec: Added priorities plugin to spec file 2006-10-27 Tim Lauridisen * plugins/priorities/ChangeLog, plugins/priorities/README, plugins/priorities/priorities.conf, plugins/priorities/priorities.py: Added priorities plugin. 2006-10-25 Seth Vidal * yumdownloader.py: merge Earl Sammons' patch to add a -c option to yumdownloader 2006-10-25 Seth Vidal * reposync.py, repotrack.py, yumdownloader.py: check in patch from Mark McLoughlin to fix handling of local repos in reposync, repotrack and yumdownloader. 2006-10-23 Luke Macken * plugins/fastestmirror/ChangeLog: 0.2.6 2006-10-23 Luke Macken * plugins/fastestmirror/fastestmirror.py: 0.2.6 - Make the instructions less misleading - Support TYPE_INTERFACE for API_VERSION <= 2.3 - Remove cached mirror list in the clean_hook 2006-10-09 Tim Lauridisen * package-cleanup.py: fixed some deprecation warnings using the '--oldkernels' option. Use searchNevra() insted of returnTuplebyKeyword() 2006-10-05 Tim Lauridisen * plugins/allowdowngrade/allowdowngrade.py, plugins/downloadonly/downloadonly.py: TYPE_INTERFACE -> TYPE_INTERACTIVE 2006-10-05 Seth Vidal * yum-utils.spec: fix requires 2006-10-05 Seth Vidal * ChangeLog: Add a changelog, finally. 2006-10-05 Seth Vidal * yum-utils.spec: - mark as 1.0 - update reqs to require yum 3.0 - since most of them do anyway 2006-10-02 Seth Vidal * repoclosure.py: merge Ville's patch to handle alternative arches better and deal with build dep closure, too. 2006-09-30 Tim Lauridisen * yumdownloader.py: my.log -> logger.info 2006-09-29 Tim Lauridisen * plugins/changelog/changelog.py: changed plugin type from TYPE_INTERFACE to TYPE_INTERACTIVE too avoid deprecation warnings. 2006-09-29 Tim Lauridisen * plugins/changelog/changelog.py: fixed plugin to work with current API without deprecation warnings 2006-09-27 Tim Lauridisen * yum-utils.spec: Added skip-broken plugin to yum-utils specfile. 2006-09-25 Tim Lauridisen * reposync.py: removed debug line, Thanks Menno :-) 2006-09-25 Tim Lauridisen * reposync.py: fixed reposync to work with the latest yum API (2.9.x) 2006-09-25 Tim Lauridisen * : changed skip-broken.conf CVS property to ASCII 2006-09-25 Tim Lauridisen * : changed skip-broken.conf CVS property to ASCII 2006-09-25 Tim Lauridisen * plugins/skip-broken/skip-broken.conf, plugins/skip-broken/skip-broken.py: Initial import of the skip-broken plugin A plugin there adds an option to yum to skip packages with dependency problems. 2006-09-25 Tim Lauridisen * repo-rss.py: Chnages to make it work with the new Yum API (2.9.x) 2006-09-25 Tim Lauridisen * repo-graph.py: Changes to make it work with the new yum API (2.9.x) 2006-09-25 Tim Lauridisen * repoclosure.py: make it work with new Yum API (2.9.x) and replaced print statements with python logging. 2006-09-25 Tim Lauridisen * yumdownloader.py: a my.errorlog -> logger.error fix by Andreas Hanke 2006-09-19 Jack Neely * plugins/fedorakmod/README, plugins/fedorakmod/fedorakmod.py: Current fedorakmod pluging work. Most of the agreed upon functionality is there and the plugin should be easily extendable. There seems to be a Yum bug that's preventing installing a given kmod for all installed kernels to work properly. Attempting to track that down. 2006-09-18 Jeremy Katz * repotrack.py: api fixes from tim 2006-09-18 Jeremy Katz * package-cleanup.py: api change fixes from tim 2006-09-18 Jeremy Katz * repoquery.py: patch from tim for api changes 2006-09-18 Jeremy Katz * yumdownloader.py: api fixes from tim 2006-09-18 Jeremy Katz * yum-builddep.py: tim's fix for api changes 2006-09-06 Panu Matilainen * plugins/versionlock/versionlock.conf: - disable versionlock plugin by default 2006-09-05 Panu Matilainen * yum-utils.spec: - actually install allowdowngrade plugin to buildroot, duh 2006-09-05 Panu Matilainen * plugins/allowdowngrade/allowdowngrade.conf, plugins/allowdowngrade/allowdowngrade.py, plugins/changelog/changelog.py, yum-utils.spec: - add allowdowngrade plugin - fix traceback in changelog plugin if package has no changelog 2006-08-13 Seth Vidal * yum-utils.spec: fix the plugins/doc issue 2006-07-20 Jack Neely * plugins/fedorakmod/fedorakmod.conf, plugins/fedorakmod/fedorakmod.py: Make pinkernels default to off. 2006-07-07 Jeremy Katz * repoquery.py: fix for config api changes 2006-07-05 Jack Neely * plugins/fedorakmod/README, plugins/fedorakmod/fedorakmod.conf, plugins/fedorakmod/fedorakmod.py: Refactor so that additional functionality can easily be added in. Implement pinning of kernels based on availability of kernel modules. 2006-07-03 Jack Neely * plugins/fedorakmod/fedorakmod.py: Update to the latest Fedora Extras Kernel Module specs and the latest Yum API. 2006-06-29 Panu Matilainen * repoquery.py: - dont try to lookup source rpms of source rpms... 2006-06-29 Panu Matilainen * repoclosure.py, reposync.py, repotrack.py, yum-builddep.py: - convert repoclosure, reposync, repotrack and yum-builddep to new API 2006-06-29 Panu Matilainen * repoquery.py: - new --srpm option for automatically locating the source rpm of a given package and operating on it 2006-06-29 Panu Matilainen * repoquery.py: - add files() method to querypkg, use it for fmt_list() - with --alldeps, look through files as well for depending packages 2006-06-16 Menno Smits * plugins/changelog/changelog.py: - removed registerOpt() usage. This is only required when adding options to Yum's own configuration files. It is not required for the plugin's own configuration files. - removed unused imports 2006-06-16 Menno Smits * plugins/versionlock/versionlock.py: - changed to UNIX line endings (has DOS line endings) - removed config_hook() and use of registerOpt(). registerOpt() is only for adding options to Yum's main configuration files. It is not required for the plugin's own configuration file. 2006-06-16 Menno Smits * plugins/protectbase/protectbase.py: Added GPL header, author contact note and docstrings. 2006-06-16 Menno Smits * plugins/protectbase/protectbase.py: Updated to use new style option definitions. 2006-06-15 Luke Macken * plugins/fastestmirror/ChangeLog, plugins/fastestmirror/fastestmirror.py: * Jun 14 2006 Luke Macken - 0.2.5 - Use new yum 2.9.0 api 2006-06-13 Paul Nasrat * repoquery.py: new yum api 2006-05-24 Seth Vidal * repomanage.py: - merge Nurdin Premji's patch to optparse-ize repomange. - fix minor bug in patch keeping -k from working 2006-05-18 Seth Vidal * reposync.py: make -a do something quasi-correct 2006-05-14 gijs * yumdownloader.py: Fix bug #469: Make yumdownloader download the correct source rpm if the provided package is a subpackage of another package. For example yumdownloader --source mod_ssl now downloads the httpd src rpm. 2006-05-08 Seth Vidal * reposync.py: make reposync -a work 2006-05-07 Seth Vidal * README: update readme for reposync and repotrack 2006-05-07 Seth Vidal * yum-utils.spec: fix changelog order 2006-05-07 Seth Vidal * reposync.py: clean up the --help output of reposync 2006-05-07 Seth Vidal * yumdownloader.py: fix multiple packages specified on cli 2006-05-07 Seth Vidal * yum-builddep.py: get rid of setConfig and getConfig to kill deprecation warnings 2006-05-07 Seth Vidal * yum-utils.spec: add downloadonly subpkg 2006-05-07 Seth Vidal * plugins/downloadonly/downloadonly.conf, plugins/downloadonly/downloadonly.py: added downloadonly plugin to yum-utils 2006-04-30 Seth Vidal * yum-utils.spec: add in patch to split out each of the plugins into a separate pkg 2006-04-30 Seth Vidal * Makefile, yum-utils.spec: update Makefile and spec for reposync 2006-04-30 Seth Vidal * reposync.py: - make it create the subdirs properly - fix it to download all versions by default 2006-04-11 Seth Vidal * reposync.py: - make reposync create subdirs per repo in destination dir - remove confusing --newest 'toggle' for a simpler --all-versions option that produces the same result 2006-04-11 Seth Vidal * yumdownloader.py: add --enablerepo to yumdownloader - similar to patch from Miroslav Prymek - thanks! 2006-04-03 Panu Matilainen * repoquery.py: - resurrect group operations with yum 2.6.x API 2006-03-27 Panu Matilainen * repoquery.py: - workaround for yum returning extra leading dashes for some directories (which posix allows but it doesn't look good for repoquerys purposes) 2006-03-16 Panu Matilainen * repoquery.py: - convert tags to lower case (yum bugzilla #548) 2006-03-16 Paul Nasrat * yum-builddep.py: Add option parsing 2006-03-07 Seth Vidal * reposync.py: reposync todo modification 2006-02-28 Seth Vidal * reposync.py: update TODO list 2006-02-28 Seth Vidal * reposync.py: first checkin of reposync. It does, essentially, what repotrack does but it just iterates the package lists for a given repository (set of repositories) and downloads all the ones you don't already have downloaded into a path. 2006-02-24 Seth Vidal * package-cleanup.py: add dupe-checking and output --dupes option 2006-02-23 Seth Vidal * yum-utils.spec: changed yum versioned deps 2006-02-16 Panu Matilainen * yumdownloader.py: - apply patch by Ville Skytta to make yumdownloader compatible with yum-2.5.x (https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=175335) 2006-02-13 Jack Neely * plugins/fedorakmod/README, plugins/fedorakmod/fedorakmod.conf, plugins/fedorakmod/fedorakmod.py: A begining of support for the Fedora Extras kernel module proposal. 2006-02-10 Seth Vidal * repotrack.py: simplify RepoTrack.findDeps 2006-02-10 Seth Vidal * Makefile, yum-utils.spec: added in repotrack, bumped version not finished checking yet, though 2006-02-07 Luke Macken * plugins/fastestmirror/ChangeLog, plugins/fastestmirror/fastestmirror.py: * Feb 06 2006 Luke Macken - 0.2.4 - Only write the timedhost file if we've re-pinged the mirrors 2006-02-03 Paul Nasrat * yum-builddep.py: List not individual package 2006-02-02 Luke Macken * plugins/fastestmirror/ChangeLog, plugins/fastestmirror/fastestmirror.conf, plugins/fastestmirror/fastestmirror.py: * Feb 02 2006 Luke Macken - 0.2.3 - Added 'maxhostfileage' option to specify how many days to keep the hostfile 2006-01-22 Seth Vidal * repotrack.py: make urls only print if the file needs to be download and -u is in cli flags. 2006-01-16 Panu Matilainen * docs/repoquery.1, repoquery.py: - add --archlist option for limiting which package architectures to consider in queries. 2006-01-12 Panu Matilainen * repoclosure.py: - remove unnecessary double definition of evrTupletoVer (patch from Brian Long) 2006-01-12 Panu Matilainen * docs/Makefile, docs/repo-rss.1, docs/yum-builddep.1, docs/yumdownloader.1: - Add man pages for yumdownloader, yum-builddep and repo-rss from Brian Long 2006-01-10 Panu Matilainen * docs/Makefile, docs/package-cleanup.1: - Add package-cleanup manpage from Brian Long 2006-01-10 Panu Matilainen * Makefile, repo-graph.py, yum-utils.spec: Apply patch from Brian Long (with slight modifications): - add fastestmirror subpackage - mark config files config(noreplace) - bump version to 0.4 - make lines in repo-graph a bit darker 2006-01-10 Panu Matilainen * plugins/kernel-module/kernel-module.py: - only look at kernel modules of same arch as the new kernel to be installed (patch by Tim Lauridsen) 2006-01-10 Luke Macken * plugins/fastestmirror/fastestmirror-asyncore.py, plugins/fastestmirror/fastestmirror.conf, plugins/fastestmirror/fastestmirror.py: - Latest fastestmirror (0.2.2) - Updated configuration file to reflect new hostfilepath option - Removed fastestmirror-asyncore (deprecated and awful) 2006-01-09 Seth Vidal * repotrack.py: - make it work with yum 2.4.X, too - fix a bug where -u was erroring out if the destdir didn't exist 2006-01-09 Seth Vidal * repotrack.py: update a few comments 2006-01-09 Seth Vidal * repotrack.py: clean up some output, check more error cases, make newest-only download the default 2006-01-09 Seth Vidal * repotrack.py: make it, you know, actually download things 2006-01-06 Panu Matilainen * repo-graph.py: - add initial rough-cut version for creating graphviz dot files from repodata similarly to rpmgraph 2006-01-05 Seth Vidal * repotrack.py: rough cut of repotrack 2006-01-04 Panu Matilainen * plugins/kernel-module/kernel-module.py: - mark kernel-module plugin as type core (patch from Tim Lauridsen) 2006-01-02 Panu Matilainen * docs/repoquery.1, repoquery.py: - --all is really just a shorthand for '*' 2005-12-20 Panu Matilainen * docs/repoquery.1, repoquery.py: - add --whatobsoletes and --whatconflicts operations to repoquery 2005-12-19 Panu Matilainen * plugins/versionlock/versionlock.py: - allow the lockfile location to be specified as an url - lockfile format is envra 2005-12-15 Panu Matilainen * repoquery.py: - remove useless self.conf assignment, making repoquery work with both yum 2.4 and 2.5 (from Ville Skytta) 2005-12-02 Seth Vidal * repoclosure.py: make -n, --newest check newest to newest so we don't end up getting a provide from something that is older. 2005-11-28 Panu Matilainen * yumdownloader.py: - add support for private cache to yumdownloader 2005-11-26 Seth Vidal * repomanage.py: typo on the placement of -c option 2005-11-26 Seth Vidal * repomanage.py: check in most of patch from Ville Skytta from buy #524, disables payload checking 2005-11-25 Panu Matilainen * repoquery.py: - fix http://devel.linux.duke.edu/bugzilla/show_bug.cgi?id=517 - fix http://devel.linux.duke.edu/bugzilla/show_bug.cgi?id=523 (patch from Ville Skyttä) 2005-11-13 Panu Matilainen * docs/repoquery.1: - Document -c option in repoquery manpage 2005-11-12 Jeremy Katz * repoquery.py: allow specifying an alternate config file 2005-11-09 Panu Matilainen * repoquery.py: - fix --resolve option 2005-11-07 Seth Vidal * repoclosure.py: make repoclosure optionally operate on only the newest packages in the repo 2005-11-04 Seth Vidal * package-cleanup.py: merge David Lutterkort's patch to add a -c conffile option to package-cleanup 2005-11-02 Panu Matilainen * plugins/kernel-module/kernel-module.conf, plugins/kernel-module/kernel-module.py: Add kernel-module plugin for livna.org style kernel-module-foo- style kernel module packaging. 2005-10-19 Seth Vidal * repomanage.py: fix repomanage so it won't output multiples of the same entry 2005-10-17 Panu Matilainen * Makefile, docs/Makefile, docs/repoquery.1, yum-utils.spec: - Add initial manpage for repoquery - Install docs in make install 2005-10-13 Seth Vidal * repomanage.py: add option to repomanage to keep latest N packages. so now if you do: repomanage -k 2 -o /some/dir it will list all but the newest 2 packages (by name, arch) or if you do: repomanage -k 2 -n /some/dir it will list only the newest 2 packages (by name, arch) handy for keeping the newest N packages around in a repo 2005-09-06 Panu Matilainen * plugins/changelog/changelog.py: Avoid causing tracebacks with yumex and pup which don't use ConfigParser 2005-08-29 Panu Matilainen * repoquery.py: - _prco wasn't really private to pkgQuery so rename it - Have separate query classes for installed and available packages, necessary because YumInstalledPackage class doesn't have nearly all the methods Available class does. Now --pkgnarrow can actually function for real. - Clean up some old stuff, use existing yum methods for formatting where suitable etc. 2005-08-25 Panu Matilainen * repoquery.py: - and same to HEAD 2005-08-23 Panu Matilainen * plugins/fastestmirror/fastestmirror-asyncore.py, plugins/fastestmirror/fastestmirror.conf, plugins/fastestmirror/fastestmirror.py: Add Luke Macken's fastestmirror plugins (two different implementations) 2005-08-23 Panu Matilainen * plugins/changelog/changelog.py: Only load otherdata when --changelog is actually used 2005-08-09 Panu Matilainen * repoquery.py: - Implement --pkgnarrow=available|recent.. option - Add --show-dupes option 2005-07-25 Panu Matilainen * yum-utils.spec: - Package changelog plugin, add others as %doc. - Bump version to 0.3. 2005-07-25 Panu Matilainen * plugins/changelog/changelog.py, plugins/tsflags/tsflags.py, plugins/versionlock/versionlock.py: Add plugin type definitions to changelog, tsflags and versionlock plugins. 2005-07-20 Panu Matilainen * repoquery.py: Don't traceback on unknown conversions. 2005-07-20 Panu Matilainen * repoquery.py: Add support for rpmquery style string formatting, eg "%-25{name} %{repoid}", date conversions (%{buildtime:date} and :day) and fix changelog time formatting. 2005-07-20 Panu Matilainen * repoquery.py: Unbreak --qf "%{license}" 2005-07-20 Panu Matilainen * repoquery.py: Add --querytags option. Support \t in --queryformat (Paul Nasrat) 2005-07-17 Menno Smits * plugins/protectbase/protectbase.conf, plugins/protectbase/protectbase.py: initial add of protectbase plugin 2005-07-13 Panu Matilainen * package-cleanup.py: Add --orphans option to list locally installed packages, eg those which aren't available in any currently configured repositories. 2005-07-13 Panu Matilainen * repo-rss.py: Add tempcache support to repo-rss. 2005-06-29 Panu Matilainen * plugins/changelog/changelog.conf, plugins/changelog/changelog.py: Add configuration option to changelog plugin to allow viewing the changelog deltas before or after the transaction. 2005-06-27 Panu Matilainen * plugins/changelog/changelog.py: Doh, changelog dates were being compared as a string values, not ints so it wasn't working at all, except that there was a hardcoded limit of five latest entries so it *appeared* to work. Talk about embarrassing... :) 2005-06-23 Panu Matilainen * repoquery.py: Add private cachedir support to reqoquery (default when non-root) 2005-06-23 Seth Vidal * repoclosure.py: check in most of Bill Nottingham's patch to make repoclosure work as a class for importing from other programs 2005-06-23 Seth Vidal * repoquery.py: properly fix up the returnPackagesByDep() method in the repoquery derived class 2005-06-23 Seth Vidal * repoquery.py: make --whatprovides use returnPackagesByDep() method in yum so it will get all possible resolvers for the requested depstring, not just the 'best' one 2005-06-21 Panu Matilainen * repoquery.py: Repoquery: - unbreak group queries - show srpm name with --source like described in help text - querying the source rpm now happens by specifying .src as package arch - add support for "envra" query format 2005-06-21 Panu Matilainen * plugins/changelog/changelog.py, plugins/tsflags/tsflags.py, plugins/versionlock/versionlock.py: Changelog plugin: - nicer formatting - add cli option for enabling it Add GPL notices to my plugins 2005-06-21 Seth Vidal * repoclosure.py: os.lstat() and just in time to mv to yum itself 2005-06-21 gijs * COPYING, yum-utils.spec: - Added GPL COPYING file and add it to the spec file 2005-06-21 Seth Vidal * repoclosure.py: fix up the getCacheDir() dir test to exclude an extremely narrow race condition 2005-06-20 Seth Vidal * repoclosure.py: make repoclosure use a user yum cache if not running as root. 2005-06-16 Panu Matilainen * plugins/tsflags/tsflags.py: Doh, remove extra print :) 2005-06-16 Panu Matilainen * plugins/tsflags/tsflags.conf, plugins/tsflags/tsflags.py: Add plugin for setting tsflags from the cli 2005-06-16 Panu Matilainen * plugins/changelog/changelog.conf, plugins/changelog/changelog.py: Add plugin for showing changelog deltas between package updates. 2005-06-16 Panu Matilainen * plugins/versionlock/versionlock.conf, plugins/versionlock/versionlock.py: Add versionlock plugin 2005-06-13 gijs * package-cleanup.py: - Remove old kernel-devel packages together with kernel packages (this can be disabled by using the --keepdevel command line option) 2005-06-13 Seth Vidal * TODO: todo file for yum-utils please add more 2005-06-13 Seth Vidal * repomanage.py: call the 'arch' for src.rpms as 'src' - not the arch it was built on. thanks to Pasi Pirhonen for pointing it out. 2005-06-13 Seth Vidal * package-cleanup.py: add in a -y to allow removing kernels 'automatically' 2005-06-13 Seth Vidal * package-cleanup.py: various cleanups and edits 2005-06-13 Seth Vidal * package-cleanup.py: add --quiet and optimize getLocalRequires and getKernels 2005-06-12 Seth Vidal * package-cleanup.py: migrated the package-cleanup --leaves to use the returnLeafNodes() method in rpmUtils. This returns leaf nodes much faster. 2005-06-11 Seth Vidal * repotrack.py: stub for a new yum-util - repotrack 2005-06-09 Panu Matilainen * repoquery.py: Repoquery: - don't treat --qf as a separate operation, it's just formatting of how packages represent themselves. - handle --qf with --whatrequires 2005-06-09 Panu Matilainen * repoquery.py: Dont traceback on repo errors (eg cache out of date) 2005-06-09 Paul Nasrat * yum-builddep.py: Error not traceback on non-root 2005-06-05 Seth Vidal * yum-utils.spec: fix spec file for fedora extras 2005-06-04 Seth Vidal * repoquery.py: allow repoquery to handle pkg args like yum 2005-06-04 Seth Vidal * yum-utils.spec: add some requires 2005-06-03 Seth Vidal * README: readme updates 2005-06-03 Seth Vidal * repoclosure.py: make repoclosure use -r args for options, instead of just repoids as argv[1], argv[2] etc. 2005-06-03 Seth Vidal * repoclosure.py: check in bill nottingham's patch to allow to specify arch and a different config file for repoclosure 2005-06-02 Panu Matilainen * repoquery.py: repoquery: - Catch unknown/unsupported querytags and operations - Support some new ways to query things 2005-06-02 Panu Matilainen * README: Add brief description of the included utilities to README. 2005-06-02 Seth Vidal * plugins/README: Added plugins dir 2005-06-01 Seth Vidal * yum-utils.spec: call it 0.2 in the spec file 2005-06-01 Panu Matilainen * repoquery.py, yumdownloader.py: yumdownloader: - add --source option - add /usr/share/yum-cli to module search path so it actually works reqoquery: - remove leftover debug junk 2005-06-01 Seth Vidal * repoquery.py: --repoid help text 2005-05-31 Panu Matilainen * repoquery.py: More repoquery stuff: - add option to run from cache only - get rid of the ugly runtime extensions to yum.AvailablePackage class, generating new pkgQuery instances seems to be just as fast in practice 2005-05-31 Panu Matilainen * repoquery.py: Some fixes to repoquery: - eliminate duplicates from --whatrequires --alldeps - catch various exceptions, print errors to stderr unless --quiet specified 2005-05-30 Panu Matilainen * repoquery.py, yum-utils.spec: New version of repoquery: - support some group queries - only set caching when non-root 2005-05-30 Panu Matilainen * Makefile, yum-builddep.py: Add yum-builddep for installing package build dependencies 2005-05-30 Seth Vidal * repoquery.py: let users specify repos to use repoquery against 2005-05-23 Panu Matilainen * updateonboot/Makefile, updateonboot/yum-updateonboot.init, yum-utils.spec: - add Makefile for updateboot - create a subpackage yum-updateonboot - don't enable updateonboot by default on package install 2005-05-16 gijs * Makefile, yum-utils.spec: Adding Makefile and spec file (both based on mock) 2005-05-16 gijs * README, package-cleanup.py: - Created initial version of README file - Added old kernel clean up to package-cleanup 2005-04-26 gijs * package-cleanup.py: Adding a yum util to list leaf nodes and problems in the local RPM db 2005-04-19 gijs * yumdownloader.py: Added a first version of dep resolving support to yumdownloader 2005-04-10 Seth Vidal * yumdownloader.py: added --urls option to yumdownloader to just print out the urls it would download 2005-04-01 gijs * yumdownloader.py: Fixed a bug in yumdownloader, causing it not to work if relativepath contains a directory name. 2005-03-24 gijs * yumdownloader.py: Initial version of yumdownloader 2005-03-22 gijs * repoquery.py, updateonboot/README, updateonboot/yum-updateonboot.init, updateonboot/yum-updateonboot.sysconfig: Adding initial versions of updateonboot and repoquery scripts 2005-03-22 gijs * repo-rss.py: Make repo-rss work with sqlite by calling returnChangeLog if no changelog info is loaded for a specific package. 2005-03-22 gijs * repoclosure.py: Cache already resolved dependencies 2005-03-21 Seth Vidal * repo-rss.py, repoclosure.py, repomanage.py: initial import of repo* scripts 2005-03-21 Seth Vidal * Initial revision yum-utils-1.1.31/Makefile000066400000000000000000000076571162052066300152250ustar00rootroot00000000000000SUBDIRS = docs po yumutils PKGNAME = yum-utils UTILS = package-cleanup debuginfo-install repoclosure repomanage repoquery repo-graph repo-rss yumdownloader yum-builddep repotrack reposync repodiff yum-debug-dump yum-debug-restore verifytree yum-groups-manager find-repos-of-install needs-restarting yum-config-manager show-installed show-changed-rco UTILSROOT = yum-complete-transaction yumdb VERSION=$(shell awk '/Version:/ { print $$2 }' ${PKGNAME}.spec) RELEASE=$(shell awk -F%: '/Release:/ { print $$2 }' ${PKGNAME}.spec ') SRPM_RELEASE=$(shell awk '/Release:/ { split($$2,a,"%"); print a[1] }' ${PKGNAME}.spec ) SRPM_FILE = ${PKGNAME}-${VERSION}-${SRPM_RELEASE}.src.rpm WEBHOST = yum.baseurl.org WEBPATH = /srv/projects/yum/web/download/yum-utils/ PY_FILES = $(wildcard *.py) $(wildcard plugins/*/*.py) $(wildcard plugins/*/*/*.py) NMPROG=yum-NetworkManager-dispatcher NMPATH=$(DESTDIR)/etc/NetworkManager/dispatcher.d BASHCOMP=yum-utils.bash BASHCOMPPATH=$(DESTDIR)/etc/bash_completion.d GITDATE=git$(shell date +%Y%m%d) VER_REGEX=\(^Version:\s*[0-9]*\.[0-9]*\.\)\(.*\) BUMPED_MINOR=${shell VN=`cat ${PKGNAME}.spec | grep Version| sed 's/${VER_REGEX}/\2/'`; echo $$(($$VN + 1))} NEW_VER=${shell cat ${PKGNAME}.spec | grep Version| sed 's/\(^Version:\s*\)\([0-9]*\.[0-9]*\.\)\(.*\)/\2${BUMPED_MINOR}/'} NEW_REL=0.1.${GITDATE} clean: rm -f *.pyc *.pyo *~ rm -f test/*~ rm -f *.tar.gz install: mkdir -p $(DESTDIR)/usr/bin/ mkdir -p $(DESTDIR)/usr/sbin/ mkdir -p $(DESTDIR)/usr/share/man/man1 for util in $(UTILS); do \ install -m 755 $$util.py $(DESTDIR)/usr/bin/$$util; \ done for util in $(UTILSROOT); do \ install -m 755 $$util.py $(DESTDIR)/usr/sbin/$$util; \ done for d in $(SUBDIRS); do make DESTDIR=`cd $(DESTDIR); pwd` -C $$d install; [ $$? = 0 ] || exit 1; done mkdir -p $(NMPATH) install -m 755 $(NMPROG) $(NMPATH) mkdir -p $(BASHCOMPPATH) install -m 644 $(BASHCOMP) $(BASHCOMPPATH) archive: @rm -rf ${PKGNAME}-${VERSION}.tar.gz @git archive --format=tar --prefix=$(PKGNAME)-$(VERSION)/ HEAD | gzip -9v >${PKGNAME}-$(VERSION).tar.gz @echo "The archive is in ${PKGNAME}-$(VERSION).tar.gz" srpm: archive rm -f ~/rpmbuild/SRPMS/${PKGNAME}-${VERSION}-*.src.rpm rpmbuild -ts ${PKGNAME}-${VERSION}.tar.gz release: @git commit -a -m "bumped yum-utils version to $(VERSION)" @$(MAKE) ChangeLog @git commit -a -m "updated ChangeLog" @git push @$(MAKE) release-tag @$(MAKE) upload release-tag: @git tag -s -f -m "Tagged ${PKGNAME}-$(VERSION)" ${PKGNAME}-$(VERSION) @git push --tags origin install-builddeps: su -c "yum install perl-TimeDate python-devel gettext intltool rpmdevtools" test-release: @git checkout -b release-test # +1 Minor version and add 0.1-gitYYYYMMDD release @cat ${PKGNAME}.spec | sed -e 's/${VER_REGEX}/\1${BUMPED_MINOR}/' -e 's/\(^Release:\s*\)\([0-9]*\)\(.*\)./\10.1.${GITDATE}%{?dist}/' > ${PKGNAME}-test.spec ; mv ${PKGNAME}-test.spec ${PKGNAME}.spec @git commit -a -m "bumped ${PKGNAME} version ${NEW_VER}-${NEW_REL}" # Make Changelog @git log --pretty --numstat --summary | ./tools/git2cl > ChangeLog @git commit -a -m "updated ChangeLog" # Make archive @rm -rf ${PKGNAME}-${NEW_VER}.tar.gz @git archive --format=tar --prefix=$(PKGNAME)-$(NEW_VER)/ HEAD | gzip -9v >${PKGNAME}-$(NEW_VER).tar.gz # Build RPMS @rpmbuild -ta ${PKGNAME}-${NEW_VER}.tar.gz @$(MAKE) test-cleanup test-cleanup: @rm -rf ${PKGNAME}-${VERSION}.test.tar.gz @echo "Cleanup the git release-test local branch" @git checkout -f @git checkout master @git branch -D release-test upload: archive srpm @scp ${PKGNAME}-${VERSION}.tar.gz $(WEBHOST):$(WEBPATH)/ @scp ~/rpmbuild/SRPMS/${PKGNAME}-${VERSION}-*.src.rpm $(WEBHOST):$(WEBPATH)/${SRPM_FILE} @rm -rf ${PKGNAME}-${VERSION}.tar.gz ChangeLog: FORCE @git log --pretty --numstat --summary | ./tools/git2cl > ChangeLog pylint: @pylint --rcfile=test/yum-utils-pylintrc $(PY_FILES) 2>/dev/null pylint-short: @pylint -r n --rcfile=test/yum-utils-pylintrc $(PY_FILES) 2>/dev/null FORCE: yum-utils-1.1.31/README000066400000000000000000000034721162052066300144340ustar00rootroot00000000000000-- Introduction -- Yum-utils is a collection of utilities, plugins and examples related to the yum package manager. See http://wiki.linux.duke.edu/YumUtils for more details. If you encounter any problems using these utilities feel free to send an e-mail to the yum mailing list: http://lists.baseurl.org/mailman/listinfo/yum If you have created an utility related to yum and you'd like to look into getting it included into this set please e-mail the yum-devel mailing list: http://lists.baseurl.org/mailman/listinfo/yum-devel -- Description of the utilities -- package-cleanup: Check for unneeded packages and dependency problems in the system. repoclosure: Check for dependency problems in repositories. repomanage: Look up oldest or newest packages in a directory. Can be used for cleaning up repositories for example. repoquery: Query packages and groups in repositories similarly to rpmquery. repo-rss: Generate RSS feed from repositories. yum-builddep: Install build dependencies of source RPMS. yumdownloader: Download packages (and optionally their dependencies) to arbitrary directories without installing them. reposync: poor-man's rsync for yum repositories. Uses the yum download mechanisms to synchronize a remote repository to a local directory repotrack: allows you to track only certain packages and their dependencies from a remote repository. Useful if you only want a few things out of another repository. -- Authors -- Various people have made a contribution to this collection: - Gijs Hollestelle Author of yumdownloader and package-cleanup - Seth Vidal Maintainer of yum, author of repoclosure, repomanage and repo-rss - Panu Matilainen Author of repoquery, yum-builddep - Sean Dilda Author of the update on boot init scripts - Tim Lauridsen Maintainer of yum-utils - fixer of a lot of misc utils. yum-utils-1.1.31/TODO000066400000000000000000000001331162052066300142330ustar00rootroot00000000000000- port all tools to optparser - standardize some of the args a bit - work on manpages/docs yum-utils-1.1.31/debuginfo-install.py000077500000000000000000000163701162052066300175400ustar00rootroot00000000000000#!/usr/bin/python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Copyright 2007 Seth Vidal import sys import os sys.path.insert(0,'/usr/share/yum-cli/') import yum import yum.Errors from utils import YumUtilBase from yum import _ import logging import rpmUtils plugin_autodebuginfo_package_name = "yum-plugin-auto-update-debug-info" class DebugInfoInstall(YumUtilBase): NAME = 'debuginfo-install' VERSION = '1.0' USAGE = """ debuginfo-install: Install debuginfo packages and their dependencies based on the name of the non-debug package debuginfo-install [options] package1 [package2] [package..]""" def __init__(self): YumUtilBase.__init__(self, DebugInfoInstall.NAME, DebugInfoInstall.VERSION, DebugInfoInstall.USAGE) self.logger = logging.getLogger("yum.verbose.cli.debuginfoinstall") self.optparser = self.getOptionParser() opts = self.optparser # Add util commandline options to the yum-cli ones if hasattr(self, 'getOptionGroup'): opts = self.getOptionGroup() opts.add_option("", "--no-debuginfo-plugin", action="store_true", help="Turn off automatic installation/update of the yum debuginfo plugin") self.main() def doUtilConfigSetup(self, *args, **kwargs): """ We override this to get our extra option out. """ opts = YumUtilBase.doUtilConfigSetup(self, *args, **kwargs) self.no_debuginfo_plugin = opts.no_debuginfo_plugin return opts def main(self): # Parse the commandline option and setup the basics. opts = self.doUtilConfigSetup() # Check if there is anything to do. if len(self.cmds) < 1: print self.optparser.format_help() sys.exit(0) if os.geteuid() != 0: print >> sys.stderr, "You must be root to run this command." sys.exit(1) try: self.doLock() except yum.Errors.LockError, e: self.logger.critical("Another application is holding the yum lock, cannot continue") sys.exit(1) # enable the -debuginfo repos for enabled primary repos repos = {} for repo in self.repos.listEnabled(): repos[repo.id] = repo for repoid in repos: di = '%s-debuginfo' % repoid if di in repos: continue repo = repos[repoid] for r in self.repos.findRepos(di): self.logger.log(yum.logginglevels.INFO_2, _('enabling %s') % r.id) r.enable() # Note: This is shared with auto-update-debuginfo for opt in ['repo_gpgcheck', 'gpgcheck', 'cost', 'skip_if_unavailable']: if hasattr(r, opt): setattr(r, opt, getattr(repo, opt)) # Setup yum (Ts, RPM db, Repo & Sack) self.doUtilYumSetup() self.debugInfo_main() if hasattr(self, 'doUtilBuildTransaction'): errc = self.doUtilBuildTransaction() if errc: sys.exit(errc) else: try: self.buildTransaction() except yum.Errors.YumBaseError, e: self.logger.critical("Error building transaction: %s" % e) sys.exit(1) if len(self.tsInfo) < 1: print 'No debuginfo packages available to install' self.doUnlock() sys.exit() sys.exit(self.doUtilTransaction()) def di_try_install(self, po): if po.name.endswith('-debuginfo'): # Wildcard matches produce this return di_name = '%s-debuginfo' % po.name if self.pkgSack.searchNevra(name=di_name, arch=po.arch): test_name = di_name ver, rel = po.version, po.release else: srpm_data = rpmUtils.miscutils.splitFilename(po.sourcerpm) # take the srpmname srpm_name, ver, rel = srpm_data[0], srpm_data[1], srpm_data[2] test_name = '%s-debuginfo' % srpm_name self.install(name=test_name, arch=po.arch, version=ver, release=rel) def debugInfo_main(self): """for each package specified, walk the package's list of deps and install all the -debuginfo pkgs that match it and its debuginfo""" # for each pkg # add that debuginfo to the ts # look through that pkgs' deps # add all the debuginfos for the pkgs providing those deps for pkgglob in self.cmds: e, m, u = self.rpmdb.matchPackageNames([pkgglob]) for po in e + m: try: self.di_try_install(po) except yum.Errors.InstallError, e: self.logger.critical('Could not find debuginfo for main pkg: %s' % po) # do each of its deps for (n,f,v) in po.requires: if n.startswith('rpmlib'): continue if n.find('.so') != -1: for pkgtup in self.rpmdb.whatProvides(n,f,v): deppo = self.rpmdb.searchPkgTuple(pkgtup)[0] try: self.di_try_install(deppo) except yum.Errors.InstallError, e: self.logger.critical('Could not find debuginfo pkg for dependency package %s' % deppo) # This is kinda hacky, accessing the option from the plugins code # but I'm not sure of a better way of doing it if not self.no_debuginfo_plugin and self.tsInfo: try: self.install(pattern=plugin_autodebuginfo_package_name) except yum.Errors.InstallError, e: self.logger.critical('Could not find auto debuginfo plugin') if __name__ == '__main__': import locale # This test needs to be before locale.getpreferredencoding() as that # does setlocale(LC_CTYPE, "") try: locale.setlocale(locale.LC_ALL, '') except locale.Error, ex: # default to C locale if we get a failure. print >> sys.stderr, 'Failed to set locale, defaulting to C' os.environ['LC_ALL'] = 'C' locale.setlocale(locale.LC_ALL, 'C') if True: # not sys.stdout.isatty(): import codecs sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout) sys.stdout.errors = 'replace' util = DebugInfoInstall() yum-utils-1.1.31/docs/000077500000000000000000000000001162052066300144765ustar00rootroot00000000000000yum-utils-1.1.31/docs/Makefile000066400000000000000000000015741162052066300161450ustar00rootroot00000000000000DOCS = repoquery package-cleanup repo-rss yumdownloader yum-builddep yum-changelog reposync \ yum-list-data yum-filter-data yum-verify yum-utils yum-aliases yum-debug-dump yum-versionlock \ yum-groups-manager debuginfo-install repodiff yum-fs-snapshot \ show-installed show-changed-rco DOCS5 = yum-changelog.conf yum-versionlock.conf yum-fs-snapshot.conf DOCS8 = yum-security yum-complete-transaction yumdb all: echo "Nothing to do" clean: rm -f *.pyc *.pyo *~ install: mkdir -p $(DESTDIR)/usr/share/man/man1 mkdir -p $(DESTDIR)/usr/share/man/man5 mkdir -p $(DESTDIR)/usr/share/man/man8 for doc in $(DOCS); do \ install -m 644 $$doc.1 $(DESTDIR)/usr/share/man/man1/; \ done for doc in $(DOCS5); do \ install -m 644 $$doc.5 $(DESTDIR)/usr/share/man/man5/; \ done for doc in $(DOCS8); do \ install -m 644 $$doc.8 $(DESTDIR)/usr/share/man/man8/; \ done yum-utils-1.1.31/docs/debuginfo-install.1000066400000000000000000000035541162052066300201750ustar00rootroot00000000000000.\" debuginfo-install .TH "debuginfo-install" "1" "21 October 2008" "James Antill" "" .SH "NAME" debuginfo-install .SH "SYNOPSIS" \fBdebuginfo-install\fP package .SH "DESCRIPTION" .PP \fBdebuginfo-install\fP is a program which installs the RPMs needed to debug the specified package. The package argument can be a wildcard, but will only match installed packages. \fBdebuginfo-install\fP will then enable any debuginfo repositories, and install the relevant debuginfo rpm. .PP .SH "EXAMPLES" .IP "Download and install all the RPMs needed to debug the kernel RPM:" \fBdebuginfo-install\fP kernel .PP .SH "WARNING MESSAGES" .IP "Could not find debuginfo for:" You may sometimes see warning messages about certain packages not being found if you run debuginfo-install for a wildcard or glob. Debuginfo packages are not necessary for "noarch" RPMs; these will generate a warning message. Additionally, On 64-bit systems, no multilib debuginfo packages are published, so if you have 32-bit packages installed, these will also generate warning messages. .PP .SH "FILES" As debuginfo-install uses YUM libraries for retrieving all the information, it relies on YUM configuration for its default values like which repositories to use. Consult YUM documentation for details: .PP .nf /etc/yum.conf /etc/yum/repos.d/ /var/cache/yum/ .fi .PP .SH "SEE ALSO" .nf .I yum.conf (5) http://yum-utils.baseurl.org/ http://yum.baseurl.org/ .fi .PP .SH "AUTHORS" .nf See the Authors file included with this program. .fi .PP .SH "BUGS" There are of course no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful in finding a resolution contact the mailing list: yum-devel@lists.baseurl.org. To file a bug use http://bugzilla.redhat.com for Fedora/RHEL/Centos related bugs and http://yum.baseurl.org/report for all other bugs. .fi yum-utils-1.1.31/docs/package-cleanup.1000066400000000000000000000063111162052066300176010ustar00rootroot00000000000000.\" package-cleanup .TH "package-cleanup" "1" "03 November 2005" "Gijs Hollestelle" "" .SH "NAME" package-cleanup .SH "SYNOPSIS" \fBpackage-cleanup\fP [options] .SH "DESCRIPTION" .PP \fBpackage-cleanup\fP is a program for cleaning up the locally-installed RPMs. .PP .SH "GENERAL OPTIONS" .IP "\fB\-c \fP" Use alternative config file (default is /etc/yum.conf). .IP "\fB\-h, \-\-help\fP" Help; display a help message and then quit\&. .IP "\fB\-q, \-\-quiet\fP" Print out nothing unecessary. .IP "\fB\-v, \-\-version\fP" Report program version and exit. .IP "\fB\-y\fP" Agree to anything asked. .IP "\fB\-\-leaves\fP" List leaf nodes in the local RPM database. Leaf nodes are RPMs that are not relied upon by any other RPM. .IP "\fB\-\-orphans\fP" List installed packages which are not available from currently configured repositories. This is identical to "yum list extras", which may provide better output. .IP "\fB\-\-oldkernels\fP" Remove old kernel and kernel-devel packages. .IP "\fB\-\-problems\fP" List dependency problems in the local RPM database. If any problems are found it will exit with an exit code of 1. .IP "\fB\-\-dupes\fP" Scan for duplicates in the local RPM database. .IP "\fB\-\-cleandupes\fP" Scan for duplicates in the local RPM database and clean out the older versions. .PP .SH "LEAVES OPTIONS" .IP "\fB\-\-all\fP" When listing leaf nodes also list leaf nodes that are not libraries. .IP "\fB\-\-leaf\-regex\fP" A package name that matches this regular expression will be considered a leaf. .IP "\fB\-\-exclude\-devel\fP" When listing leaf nodes do not list development packages. .IP "\fB\-\-exclude\-bin\fP" When listing leaf nodes do not list packages with files in bin directories. .PP .SH "OLDKERNELS OPTIONS" .IP "\fB\-\-count \fP" Number of kernel packages to keep on the system (default 2) .IP "\fB\-\-keepdevel\fP" Do not remove kernel-devel packages when removing kernels .SH "EXAMPLES" .IP "List all dependency problems:" \fBpackage-cleanup --problems\fP .IP "List all packages that are not in any Yum repository:" \fBpackage-cleanup --orphans\fP .IP "Remove old kernels keeping 3 and leaving old kernel-devel packages installed:" \fBpackage-cleanup --oldkernels --count=3 --keepdevel\fP .PP .IP "List all leaf packages with no files in a bin directory whose name begins with either 'perl' or 'python':" \fBpackage-cleanup --leaves --exclude-bin --leaf-regex="^(perl)|(python)"\fP .PP .SH "FILES" As package-cleanup uses YUM libraries for retrieving all the information, it relies on YUM configuration for its default values like which repositories to use. Consult YUM documentation for details: .PP .nf /etc/yum.conf /etc/yum/repos.d/ /var/cache/yum/ .fi .PP .SH "SEE ALSO" .nf .I yum.conf (5) http://yum.baseurl.org/ .fi .PP .SH "AUTHORS" .nf See the Authors file included with this program. .fi .PP .SH "BUGS" There are of course no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful in finding a resolution contact the mailing list: yum-devel@lists.baseurl.org. To file a bug use http://bugzilla.redhat.com for Fedora/RHEL/Centos related bugs and http://yum.baseurl.org/report for all other bugs. .fi yum-utils-1.1.31/docs/repo-rss.1000066400000000000000000000036561162052066300163440ustar00rootroot00000000000000.\" repo-rss .TH "repo-rss" "1" "2005" "Seth Vidal" "" .SH "NAME" repo-rss .SH "SYNOPSIS" \fBrepo-rss\fP [options] repoid1 [repoid2...] .SH "DESCRIPTION" .PP \fBrepo-rss\fP is a program for generating RSS feeds for one or more Yum repositories. .PP .SH "GENERAL OPTIONS" .IP "\fB\-h, \-\-help\fP" Help; display a help message and then quit\&. .IP "\fB\-f \fP" Specify the file to which the RSS will be written. Default is repo-rss.xml. .IP "\fB\-l \fP" Specify the URL to the RSS feed. Default is http://yum.baseurl.org/. .IP "\fB\-t \fP" Specify the title for the RSS feed. Default is "RSS Repository - Recent Packages". .IP "\fB\-d <description>\fP" Specify the description of the RSS feed. Default is "Most recent packages in Repositories". .IP "\fB\-r <days>\fP" Specify the number of days to consider most recent. Default is 3. .IP "\fB\-\-tempcache\fP" Enable the use of a temporary directory for the yum cache. This is enabled by default for non-root users. .SH "EXAMPLES" .IP "Generate an RSS for the updates-released repository and save it as updates-release.xml:" \fBrepo-rss -f updates-released.xml updates-released\fP .PP .SH "FILES" As repo-rss uses YUM libraries for retrieving all the information, it relies on YUM configuration for its default values like which repositories to use. Consult YUM documentation for details: .PP .nf /etc/yum.conf /etc/yum/repos.d/ /var/cache/yum/ .fi .PP .SH "SEE ALSO" .nf .I yum.conf (5) http://yum.baseurl.org/ .fi .PP .SH "AUTHORS" .nf See the Authors file included with this program. .fi .PP .SH "BUGS" There are of course no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful in finding a resolution contact the mailing list: yum-devel@lists.baseurl.org. To file a bug use http://bugzilla.redhat.com for Fedora/RHEL/Centos related bugs and http://yum.baseurl.org/report for all other bugs. .fi ����������������������������������������������������������������������������������yum-utils-1.1.31/docs/repodiff.1��������������������������������������������������������������������0000664�0000000�0000000�00000004156�11620520663�0016364�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" repodiff .TH "repodiff" "1" "21 October 2008" "James Antill" "" .SH "NAME" repodiff .SH "SYNOPSIS" \fBrepodiff\fP --old=old_repo_baseurl --new=new_repo_baseurl .SH "DESCRIPTION" .PP \fBrepodiff\fP is a program which will list differences between two sets of repositories. \fBNote\fP that by default only source packages are compared. .PP .SH "GENERAL OPTIONS" .IP "\fB\-\-old, -o\fP" Add a repo. as an old repo. .IP "\fB\-\-new, -n\fP" Add a repo. as an new repo. .IP "\fB\-\-archlist, -a\fP" Add architectures to change the default from just comparing source packages. Note that if you want the same as a native "x86_64" architecture machine you just need to pass "x86_64" (this is different from earlier versions where you needed to specify "x86_64,athlon,i686,i586,i486,i386,noarch" and you still got "src"). .IP "\fB\-\-size, -s\fP" Ouput additional data about the size of the changes. .IP "\fB\-\-compare-arch\fP" Normally packages are just compared based on their name, this flag makes the comparison also use the arch. So foo.i386 and foo.x86_64 are different. .SH "EXAMPLES" .IP "Compare source pkgs in two local repos:" \fBrepodiff --old=/tmp/repo-old --new=/tmp/repo-new\fP .IP "Compare x86_64 compat. binary pkgs in two remote repos, and two local one:" \fBrepodiff -a x86_64 --old=http://example.com/repo1-old --old=/tmp/repo-old --new=http://example.com/repo1-new --new=/tmp/repo-new\fP .IP "Compare x86_64 compat. binary pkgs, but also compare arch:" \fBrepodiff -a x86_64 --compare-arch --old=http://example.com/repo1-old --old=/tmp/repo-old --new=http://example.com/repo1-new --new=/tmp/repo-new\fP .PP .SH "SEE ALSO" .nf .I yum.conf (5) http://yum.baseurl.org/ .fi .PP .SH "AUTHORS" .nf See the Authors file included with this program. .fi .PP .SH "BUGS" There are of course no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful in finding a resolution contact the mailing list: yum-devel@lists.baseurl.org. To file a bug use http://bugzilla.redhat.com for Fedora/RHEL/Centos related bugs and http://yum.baseurl.org/report for all other bugs. .fi ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/docs/repoquery.1�������������������������������������������������������������������0000664�0000000�0000000�00000021415�11620520663�0016616�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" repoquery .TH "repoquery" "1" "17 October 2005" "Panu Matilainen" "" .SH "NAME" repoquery .SH "SYNOPSIS" \fBrepoquery\fP [options] <item ...> .br \fBrepoquery\fP -a [options] .SH "DESCRIPTION" .PP \fBrepoquery\fP is a program for querying information from YUM repositories similarly to rpm queries. .PP .SH "GENERAL OPTIONS" .IP "\fB\-\-querytags\fP" List valid queryformat tags and exit.. .IP "\fB\-v, \-\-version\fP" Report program version and exit. .IP "\fB\-\-repoid=<repo>\fP" Specify which repository to query. Using this option disables all repositories not explicitly enabled with --repoid option (can be used multiple times). By default repoquery uses whatever repositories are enabled in YUM configuration. .IP "\fB\-\-enablerepo=<repo>\fP" In addition to the default set, query the given additional repository, even if it is disabled in YUM configuration. Can be used multiple times. .IP "\fB\-\-disablerepo=<repo>\fP" Do not query the given repository, even if it is enabled in YUM configuration. Can be used multiple times. .IP "\fB\-\-repofrompath=<repoid>,<path/url>\fP" Specify a path or url to a repository (same path as in a baseurl) to add to the repositories for this query. This option can be used multiple times. If you want to view only the pkgs from this repository combine this with --repoid. The repoid for the repository is specified by <repoid>. .IP "\fB\-\-plugins\fP" Enable YUM plugin support. .IP "\fB\-q, \-\-query\fP" For rpmquery compatibility, doesn't do anything. .IP "\fB\-h, \-\-help\fP" Help; display a help message and then quit\&. .IP "\fB\-\-quiet\fP" Run quietly: no warnings printed to stderr. .IP "\fB\-\-verbose\fP" Produce verbose output. .IP "\fB\-C, \-\-cache\fP" Tells repoquery to run entirely from YUM cache - does not download any metadata or update the cache. Queries in this mode can fail or give partial/incorrect results if the cache isn't fully populated beforehand with eg "yum makecache". .IP "\fB\-\-tempcache\fP" Create and use a private cache instead of the main YUM cache. This is used by default when run as non-root user. .IP "\fB\-c <config file>, \-\-config=<config file>\fP" Use alternative config file (default is /etc/yum.conf). .IP "\fB\-\-releasever=version\fP" Pretend the current release version is the given string. This is very useful when combined with \-\-installroot. You can also use \-\-releasever=/ to take the releasever information from outside the installroot. Note that with the default upstream cachedir, of /var/cache/yum, using this option will corrupt your cache (and you can use $releasever in your cachedir configuration to stop this). .IP "\fB\-\-setopt=option=value\fP" Set any config option in yum config or repo files. For options in the global config just use: \-\-setopt=option=value for repo options use: \-\-setopt=repoid.option=value .PP .SH "PACKAGE QUERY OPTIONS" .IP "\fB\-i, \-\-info\fP" Show general information about package similarly to "rpm -qi" .IP "\fB\-l, \-\-list\fP" List files in package. .IP "\fB\-R, \-\-requires\fP" List package dependencies. .IP "\fB\-\-resolve\fP" When used with --requires, resolve capabilities to originating packages. .IP "\fB\-\-provides\fP" List capabilities package provides. .IP "\fB\-\-obsoletes\fP" List capabilities obsoleted by package. .IP "\fB\-\-conflicts\fP" List capabilities conflicting with package. .IP "\fB\-\-changelog\fP" List package changelog. .IP "\fB\-\-location\fP" Show a location where the package could be downloaded from. For example: \fBwget `repoquery --location yum`\fP .IP "\fB\-s, \-\-source\fP" Show package source RPM name. .IP "\fB\-\-srpm\fP" Operate on corresponding source RPM. .IP "\fB\-\-groupmember PACKAGE\fP" List the repodata groups (yumgroups.xml) belongs to (if any). .IP "\fB\-\-nvr\fP" Use name-version-release output format (rpm query default) .IP "\fB\-\-nevra\fP" Use name-epoch:version-release.architecture output format (default) .IP "\fB\-\-envra\fP" Use epoch:name-version-release.architecture output format (easier to parse than nevra) .IP "\fB\--qf=FORMAT, \-\-queryformat=FORMAT\fP" Specify custom output format for queries. You can add ":date", ":day" and ":isodate" to all the tags that are a time, and you can add ":k", ":m", ":g", ":t" and ":h" to sizes. You can also specify field width as in sprintf (Eg. %-20{name}) .IP "\fB\-\-output [text|ascii-tree|dot-tree]\fP" Output format which can be used with --requires/--whatrequires/--obsoletes/--conflicts. Default output is 'text'. .IP "\fB\-\-level [all|any int]\fP" In combination with --output ascii-tree|dot-tree this option specifies the number of level to print on the tree. Default level is 'all'. .PP .SH "PACKAGE SELECTION OPTIONS" .IP "\fB\-a, \-\-all\fP" Query all available packages (for rpmquery compatibility / shorthand for repoquery '*') .IP "\fB\-f, \-\-file FILE\fP" Query package owning FILE. .IP "\fB\-\-whatobsoletes CAPABILITY\fP" Query all packages that obsolete CAPABILITY. .IP "\fB\-\-whatconflicts CAPABILITY\fP" Query all packages that conflict with CAPABILITY. .IP "\fB\-\-whatprovides CAPABILITY\fP" Query all packages that provide CAPABILITY. .IP "\fB\-\-whatrequires CAPABILITY\fP" Query all packages that require CAPABILITY. .IP "\fB\-\-alldeps\fP" When used with --whatrequires, look for non-explicit dependencies in addition to explicit ones (e.g. files and Provides in addition to package names). This is the default. .IP "\fB\-\-exactdeps\fP" When used with --whatrequires, search for dependencies only exactly as given. This is effectively the opposite of --alldeps. .IP "\fB\-\-recursive\fP" When used with --whatrequires, query packages recursively. .IP "\fB\-\-archlist=ARCH1[,ARCH2...]\fP" Limit the query to packages of given architecture(s). Valid values are all architectures known to rpm/yum such as 'i386' and 'src' for source RPMS. Note that repoquery will now change yum's "arch" to the first value in the archlist. So "\-\-archlist=i386,i686" will change yum's canonical arch to i386, but allow packages of i386 and i686. .IP "\fB\-\-pkgnarrow=WHAT\fP" Limit what packages are considered for the query. Valid values for WHAT are: installed, available, recent, updates, extras, all and repository (default). .IP "\fB\-\-installed\fP" Restrict query ONLY to installed pkgs - disables all repos and only acts on rpmdb. .PP .SH "GROUP QUERY OPTIONS" .PP .IP "\fB\-i, \-\-info\fP" Show general information about group. .IP "\fB\-l, \-\-list\fP" List packages belonging to (required by) group. .IP "\fB\-\-grouppkgs=WHAT\fP" Specify what type of packages are queried from groups. Valid values for WHAT are all, mandatory, default, optional. .IP "\fB\-\-requires\fP" List groups required by group. .PP .SH "GROUP SELECTION OPTIONS" .PP .IP "\fB\-a\fP" Query all available groups. .IP "\fB\-g, \-\-group\fP" Query groups instead of packages. .PP .SH "EXAMPLES" .IP "List all packages whose name contains 'perl':" \fBrepoquery '*perl*'\fP .IP "List all packages depending on openssl:" \fBrepoquery --whatrequires openssl\fP .IP "List all package names and the repository they come from, nicely formatted:" \fBrepoquery -a --qf "%-20{repoid} %{name}"\fP .IP "List name and summary of all available updates (if any), nicely formatted:" \fBrepoquery -a --pkgnarrow=updates --qf "%{name}:\\n%{summary}\\n"\fP .IP "List optional packages in base group:" \fBrepoquery -g --grouppkgs=optional -l base\fP .IP "List build requirements from 'anaconda' source rpm:" \fBrepoquery --requires anaconda.src\fP .IP "List packages which BuildRequire gail-devel" \fBrepoquery --archlist=src --whatrequires gail-devel\fP NB: This command will only work if you have repositories enabled which include srpms. .\"TODO: Add more examples... .PP .SH "MISC" .IP "\fBSpecifying package names\fP" A package can be referred to in all queries with any of the following: .IP .br \fBname\fP .br \fBname.arch\fP .br \fBname-ver\fP .br \fBname-ver-rel\fP .br \fBname-ver-rel.arch\fP .br \fBname-epoch:ver-rel.arch\fP .br \fBepoch:name-ver-rel.arch\fP .IP For example: \fBrepoquery -l kernel-2.4.1-10.i686\fP .br Additionally wildcards (shell-style globs) can be used. .PP .SH "FILES" As repoquery uses YUM libraries for retrieving all the information, it relies on YUM configuration for its default values like which repositories to use. Consult YUM documentation for details: .PP .nf /etc/yum.conf /etc/yum/repos.d/ /var/cache/yum/ .fi .PP .SH "SEE ALSO" .nf .I yum.conf (5) http://yum.baseurl.org/ .fi .PP .SH "AUTHORS" .nf See the Authors file included with this program. .fi .PP .SH "BUGS" There are of course no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful in finding a resolution contact the mailing list: yum-devel@lists.baseurl.org. To file a bug use http://bugzilla.redhat.com for Fedora/RHEL/Centos related bugs and http://yum.baseurl.org/report for all other bugs. .fi ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/docs/reposync.1��������������������������������������������������������������������0000664�0000000�0000000�00000004756�11620520663�0016436�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" reposync .TH "reposync" "1" "27 April 2007" "" "" .SH "NAME" reposync - synchronize yum repositories to a local directory .SH "SYNOPSIS" \fBreposync\fP [options] .SH "DESCRIPTION" \fBreposync\fP is used to synchronize a remote yum repository to a local directory, using yum to retrieve the packages. .SH "OPTIONS" .IP "\fB\-h, \-\-help\fP" Display a help message, and then quit. .IP "\fB\-c CONFIG, \-\-config=CONFIG\fP" Config file to use (defaults to /etc/yum.conf). .IP "\fB\-a ARCH, \-\-arch=ARCH\fP" Act as if running the specified arch (default: current arch, note: does not override $releasever). .IP "\fB\-\-source\fP" Also download .src.rpm files. .IP "\fB\-r REPOID, \-\-repoid=REPOID\fP" Specify repo ids to query, can be specified multiple times (default is all enabled). .IP "\fB\-t, \-\-tempcache\fP" Use a temp dir for storing/accessing yum-cache. .IP "\fB\-p DESTDIR, \-\-download_path=DESTDIR\fP" Path to download packages to: defaults to current directory. .IP "\fB\-g, \-\-gpgcheck\fP" Remove packages that fail GPG signature checking after downloading. .IP "\fB\-u, \-\-urls\fP" Just list urls of what would be downloaded, don't download. .IP "\fB\-n, \-\-newest-only\fP" Download only newest packages per-repo. .IP "\fB\-q, \-\-quiet\fP" Output as little information as possible. .SH "EXAMPLES" .IP "Sync all packages from the 'updates' repo to the current directory:" \fB reposync --repoid=updates\fP .IP "Sync only the newest packages from the 'updates' repo to the current directory:" \fB reposync -n --repoid=updates\fP .IP "Sync packages from the 'updates' and 'extras' repos to the current directory:" \fB reposync --repoid=updates --repoid=extras\fP .IP "Sync all packages from the 'updates' repo to the \fBrepos\fP directory:" \fB reposync -p repos --repoid=updates\fP .SH "FILES" \fBreposync\fP uses the yum libraries for retrieving information and packages. If no configuration file is specified, the default yum configuration will be used. .PP .nf /etc/yum.conf /etc/yum/repos.d/ .fi .SH "SEE ALSO" .nf .I yum.conf (5) http://yum.baseurl.org/ .fi .SH "AUTHORS" .nf See the Authors file included with this program. .fi .PP .SH "BUGS" There are of course no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful in finding a resolution contact the mailing list: yum-devel@lists.baseurl.org. To file a bug use http://bugzilla.redhat.com for Fedora/RHEL/Centos related bugs and http://yum.baseurl.org/report for all other bugs. .fi ������������������yum-utils-1.1.31/docs/show-changed-rco.1������������������������������������������������������������0000664�0000000�0000000�00000004770�11620520663�0017720�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" show-changed-rco .TH "show-installed" "1" "30 March 2011" "James Antill" "" .SH "NAME" show\-changed-\-rco .SH "SYNOPSIS" \fBshow\-changed-\-rco\fP [options] .SH "DESCRIPTION" .PP \fBshow\-changed-\-rco\fP gives a compact description of the changes to a packages Requires, Conflicts and Obsoletes data from the installed (or old) to a specified rpm file. .SH OPTIONS .TP .IP \-h, \-\-help show this help message and exit .IP "\fB\-C, \-\-cache\fP" Tells repoquery to run entirely from YUM cache - does not download any metadata or update the cache. Queries in this mode can fail or give partial/incorrect results if the cache isn't fully populated beforehand with eg "yum makecache". .IP "\fB\-c <config file>, \-\-config=<config file>\fP" Use alternative config file (default is /etc/yum.conf). .IP "\fB\-\-repoid=<repo>\fP" Specify which repository to query. Using this option disables all repositories not explicitly enabled with --repoid option (can be used multiple times). By default repoquery uses whatever repositories are enabled in YUM configuration. .IP "\fB\-\-enablerepo=<repo>\fP" In addition to the default set, query the given additional repository, even if it is disabled in YUM configuration. Can be used multiple times. .IP "\fB\-\-disablerepo=<repo>\fP" Do not query the given repository, even if it is enabled in YUM configuration. Can be used multiple times. .IP "\fB\-\-repofrompath=<repoid>,<path/url>\fP" Specify a path or url to a repository (same path as in a baseurl) to add to the repositories for this query. This option can be used multiple times. If you want to view only the pkgs from this repository combine this with --repoid. The repoid for the repository is specified by <repoid>. .IP "\fB\-\-old-packages=<pkg>\fP" Explicitly list the valid old packages to match the new packages against. .IP "\fB\-\-ignore-arch\fP" Ignore arch. so you can compare foo-2.i686 to foo-1.x86_64. .IP "\fB\-\-skip-new\fP" Only give output for packages which we've found an old package for. .PP .SH "SEE ALSO" .nf .I yum.conf (5) http://yum.baseurl.org/ .fi .PP .SH "AUTHORS" .nf See the Authors file included with this program. .fi .PP .SH "BUGS" There are of course no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful in finding a resolution contact the mailing list: yum-devel@lists.baseurl.org. To file a bug use http://bugzilla.redhat.com for Fedora/RHEL/Centos related bugs and http://yum.baseurl.org/report for all other bugs. .fi ��������yum-utils-1.1.31/docs/show-installed.1��������������������������������������������������������������0000664�0000000�0000000�00000003522�11620520663�0017517�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" show-installed .TH "show-installed" "1" "21 October 2010" "Florian Festi" "" .SH "NAME" show\-installed .SH "SYNOPSIS" \fBshow\-installed\fP [options] .SH "DESCRIPTION" .PP \fBshow\-installed\fP gives a compact description of the packages installed (or given) making use of the comps groups found in the repositories. .SH OPTIONS .TP .B \-h, \-\-help show this help message and exit .TP .B \-f FORMAT, \-\-format=FORMAT yum, kickstart or human; yum gives the result as a yum command line; kickstart the content of a %packages section; "human" readable is default. .TP .B \-i INPUT, \-\-input=INPUT File to read the package list from instead of using the rpmdb. \- for stdin. The file must contain package names only separated by white space (including newlines). rpm \-qa \-\-qf='%{name}\\n' produces proper output. .TP .B \-o OUTPUT, \-\-output=OUTPUT File to write the result to. Stdout is used if option is omited. .TP .B \-q, \-\-quiet Do not show warnings. .TP .B \-e, \-\-no\-excludes Only show groups that are installed completely. Do not use exclude lines. .TP .B \-\-global\-excludes Print exclude lines at the end and not after the groups requiring them. .TP .B \-\-global\-addons Print package names at the end and not after the groups offering them as addon. .TP .B \-\-addons\-by\-group Also show groups not selected to sort packages contained by them. Those groups are commented out with a "# " at the begin of the line. .TP .B \-m, \-\-allow\-mandatories Check if just installing the mandatory packages gives better results. Uses "." to mark those groups. .TP .B \-a, \-\-allow\-all Check if installing all packages in the groups gives better results. Uses "*" to mark those groups. .TP .B \-\-ignore\-missing Ignore packages missing in the repos. .TP .B \-\-ignore\-missing\-excludes Do not produce exclude lines for packages not in the repository. .fi ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/docs/yum-aliases.1�����������������������������������������������������������������0000664�0000000�0000000�00000004266�11620520663�0017021�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" yum aliases plugin .TH "yum-aliases" "1" "31 March 2008 " "James Antill" "" .SH "NAME" yum aliases plugin .SH "SYNOPSIS" \fByum\fP [options] alias .SH "DESCRIPTION" .PP This plugin changes other commands in \fByum\fP, much like the alias command in bash. There are a couple of notable differences from shell style aliases though. The alias command has three forms: .br .I \fR * alias .br .I \fR * alias command .br .I \fR * alias command result .br .PP The first form lists all current aliases with their final result, the second form looks up a "command" and shows it's final result or an error message. The last form creates a new alias. .PP .br .br .PP .SH Explanation of alias to final result conversion .PP When you type an aliased command, like "yum --disableexcludes UPT lsu" using the default aliases, the yum-aliases plugin first takes the first "command", by skiping over any options, and then looks up the result (in this case "UPT" is converted to "--enablerepo=updates-tesintg"). If there is a match, then it will replace the aliased "command" in the argument list and try again (again skipping over any options). By convention, in the default aliases list, alias "commands" that are in all CAPS only add options so you can join together a chain of them before any real command or aliased command. .br .PP There are two things that can alter the above, if you have the "recursive" configuration option set to off then alias processing will stop after the first alias to command substitution. Also, like in shell aliases, if the result starts with \\ then alias processing will stop. .br .SH EXAMPLES .PP To create a new alias command called "rm" which does the same thing as the command "remove" use: .IP yum .B alias rm remove .PP To always add the --skip-broken --disableexcludes=all --obsoletes options to the update command (but leaving the upgrade option alone), you could use: .IP yum .B alias update \\update --skip-broken --disableexcludes=all --obsoletes .PP To override the default "up" alias to use the above update command, and never ask for confirmation, you could use: .IP yum .B alias up update -y .br .SH AUTHORS .RS James Antill <james@and.org> .SH "SEE ALSO" .BR yum-utils(1) .BR yum(1) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/docs/yum-builddep.1����������������������������������������������������������������0000664�0000000�0000000�00000002524�11620520663�0017163�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" yum-builddep .TH "yum-builddep" "1" "17 July 2005 " "Panu Matilainen" "" .SH "NAME" yum-builddep .SH "SYNOPSIS" \fByum-builddep\fP package .SH "DESCRIPTION" .PP \fByum-builddep\fP is a program which installs the RPMs needed to build the specified package. The source RPM for the specified package must be available in a Yum repository (which will be automatically enabled, if it is disabled) or it can be a local source RPM file. .PP .SH "EXAMPLES" .IP "Download and install all the RPMs needed to build the kernel RPM:" \fByum-builddep kernel\fP .PP .SH "FILES" As yum-builddep uses YUM libraries for retrieving all the information, it relies on YUM configuration for its default values like which repositories to use. Consult YUM documentation for details: .PP .nf /etc/yum.conf /etc/yum/repos.d/ /var/cache/yum/ .fi .PP .SH "SEE ALSO" .nf .I yum.conf (5) http://yum.baseurl.org/ .fi .PP .SH "AUTHORS" .nf See the Authors file included with this program. .fi .PP .SH "BUGS" There are of course no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful in finding a resolution contact the mailing list: yum-devel@lists.baseurl.org. To file a bug use http://bugzilla.redhat.com for Fedora/RHEL/Centos related bugs and http://yum.baseurl.org/report for all other bugs. .fi ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/docs/yum-changelog.1���������������������������������������������������������������0000664�0000000�0000000�00000004500�11620520663�0017316�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" PROCESS THIS FILE WITH .\" groff -man -Tascii yum-changelog.1 .\" .TH YUM-CHANGELOG 1 "08 February 2007" "" "User Manuals" .SH NAME .B yum-changelog .SH SYNOPSIS The .B yum-changelog package .SH DESCRIPTION .BR yum-changelog(1) is a Yum plugin for viewing package changelogs before/after updating. yum will invoke .BR yum-changelog(1) plugin if the .B --changelog option or the .B changelog command is used with yum. .SH OPTIONS .IP --changelog Show changelog delta of updated packages .SH COMMANDS .IP changelog Show changelog data of packages listed (same format as the list command). The first argument is required and is either "all" for all the changelog entries, a date for the changelog entries since a specified point in time or a number for a given number of changelog entries. .SH FILES .I /etc/yum/pluginconf.d/changelog.conf .RS The system wide configuration file. See .BR yum-changelog.conf(5) for more information. .RE .SH EXAMPLES # yum .B changelog 2008-Jan yum\\* .br Listing changelogs since: 2008-01-18 .br .br yum-versionlock-1.1.11-1.fc8.noarch installed .br * Wed Jan 30 17:00:00 2008 Tim Lauridsen <timlau@fedoraproject.org> .br - mark as 1.1.11 .br .br changelog stats. 33 pkgs, 12 source pkgs, 1 changelog .br .br # yum update ktechlab .B --changelog .br Loading "changelog" plugin .br Setting up Update Process .br Setting up repositories .br [..] .br Resolving Dependencies .br --> Populating transaction set with selected packages. Please wait. .br ---> Package ktechlab.i386 0:0.3-6 set to be updated .br --> Running transaction check Changes in packages about to be updated: ktechlab - 0.3-6.i386 .br * Wed Nov 22 23:00:00 2006 Chitlesh Goorah - 0.3-6 .br - Rebuilt due to new gpsim-devel release .br .SH BUGS There are of course no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful in finding a resolution contact the mailing list: yum-devel@lists.baseurl.org. To file a bug use http://bugzilla.redhat.com for Fedora/RHEL/Centos related bugs and http://yum.baseurl.org/report for all other bugs. .SH AVAILABILITY yum-changelog is available via: .nf # yum install yum-changelog .fi .SH AUTHORS .RS Chitlesh Goorah <chitlesh@fedoraproject.org> .br Panu Matilainen <pmatilai@laiskiainen.org> .br James Antill <james@and.org> .SH "SEE ALSO" .BR yum(1) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/docs/yum-changelog.conf.5����������������������������������������������������������0000664�0000000�0000000�00000003232�11620520663�0020247�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" PROCESS THIS FILE WITH .\" groff -man -Tascii yum-changelog.conf.5 .\" .TH YUM-CHANGELOG.CONF 5 "08 FEBRUARY 2007" "" "File Formats" .SH NAME .B yum-changelog.conf(5) .SH SYNOPSIS .B yum-changelog.conf(5) is the configuration file for .B yum-changelog(1) Yum plugin for viewing package changelogs before/after updating. By default, this plugin will show the changelogs before the updates. .SH FILES .I /etc/yum/pluginconf.d/changelog.conf .SH FILE FORMAT .B yum-changelog.conf(5) utilizes configuration options in the form of .IP OPTION=VALUE .SH OPTION .IP when This option reflects when .B yum-changelog(1) will allow changelog viewing during yum updates. .SH VALUE .IP pre To make .B yum-changelog(5) show the changelog .B before the yum updates .IP post To make .B yum-changelog(5) show the changelog .B after the yum updates. .SH OPTION .IP always This option reflects specifies if the changelog should always be shown. .SH VALUE .IP true The changelog is always displayed. .IP false A command line option is required for the changelog to be displayed. .SH OPTION .IP updateinfo This option specifies that the "changelog" from the repo. updateinfo should be shown. .SH VALUE .IP true The updateinfo is displayed. .IP false The updateinfo is never displayed. .SH OPTION .IP updateinfo_always This option reflects specifies if the "changelog" from the repo. should always be shown (note that if updateinfo is false then this option has no meaning). .SH VALUE .IP true The updateinfo is always displayed. .IP false A command line option is required for the updateinfo to be displayed. .SH AUTHOR .RS Chitlesh Goorah <chitlesh@fedoraproject.org> .RS .SH SEE ALSO .BR yum-changelog(1) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/docs/yum-complete-transaction.8����������������������������������������������������0000664�0000000�0000000�00000003242�11620520663�0021533�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" yum-complete-transaction .TH "yum-complete-transaction" "8" "10 December 2007" "Seth Vidal" "" .SH "NAME" yum-complete-transaction .SH "SYNOPSIS" \fByum-complete-transaction\fP [options] .SH "GENERAL OPTIONS" .IP "\fB\-h, \-\-help\fP" Help; display a help message and then quit\&. .IP "\fB\-\-cleanup-only\fP" Only clean up only transaction journal files and exit\&. .SH "DESCRIPTION" .PP \fByum-complete-transaction\fP is a program which finds incomplete or aborted yum transactions on a system and attempts to complete them. It looks at the transaction-all* and transaction-done* files which can normally be found in /var/lib/yum if a yum transaction aborted in the middle of execution. .PP If it finds more than one unfinished transaction it will attempt to complete the most recent one first. You can run it more than once to clean up all unfinished transactions. .PP .SH "FILES" As yum-complete-transaction uses YUM libraries for retrieving all the information, it relies on YUM configuration for its default values like which repositories to use. Consult YUM documentation for details: .PP .nf /etc/yum.conf /etc/yum/repos.d/ /var/cache/yum/ .fi .PP .SH "SEE ALSO" .nf .I yum.conf (5) http://yum.baseurl.org/ .fi .PP .SH "AUTHORS" .nf See the Authors file included with this program. .fi .PP .SH "BUGS" There are of course no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful in finding a resolution contact the mailing list: yum-devel@lists.baseurl.org. To file a bug use http://bugzilla.redhat.com for Fedora/RHEL/Centos related bugs and http://yum.baseurl.org/report for all other bugs. .fi ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/docs/yum-debug-dump.1��������������������������������������������������������������0000664�0000000�0000000�00000002672�11620520663�0017430�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" yum-debug-dump .TH "yum-debug-dump" "1" "28 April 2008" "Seth Vidal" "" .SH "NAME" yum-debug-dump .SH "SYNOPSIS" \fByum-debug-dump\fP .SH "DESCRIPTION" .PP \fByum-debug-dump\fP is a program which creates a gzipped file containing a lot of information useful to developers trying to debug a problem. .PP By default it will output a file to the current working directory named yum_debug_dump.txt.gz. This file contains no private information but does contain a complete list of all packages you have installed, all packages available in any repository, important configuration and system information. You can view this file using the 'zless' command. .PP .SH "FILES" As yum-debug-dump uses YUM libraries for retrieving all the information, it relies on YUM configuration for its default values like which repositories to use. Consult YUM documentation for details: .PP .nf /etc/yum.conf /etc/yum/repos.d/ /var/cache/yum/ .fi .PP .SH "SEE ALSO" .nf .I yum.conf (5) http://yum.baseurl.org/ .fi .PP .SH "AUTHORS" .nf See the Authors file included with this program. .fi .PP .SH "BUGS" There are of course no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful in finding a resolution contact the mailing list: yum-devel@lists.baseurl.org. To file a bug use http://bugzilla.redhat.com for Fedora/RHEL/Centos related bugs and http://yum.baseurl.org/report for all other bugs. .fi ����������������������������������������������������������������������yum-utils-1.1.31/docs/yum-filter-data.1�������������������������������������������������������������0000664�0000000�0000000�00000011374�11620520663�0017572�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" yum filter data plugin .TH "yum-filter-data" "1" "04 February 2008" "James Antill" "" .SH "NAME" yum filter data plugin .SH "SYNOPSIS" \fByum\fP [options] [command] [package ...] .SH "DESCRIPTION" .PP This plugin extends \fByum\fP with some options, currently just for "update" and "list update" type commands, to allow filters to be placed on which packages should be used based on the data in those packages. Note that due to some of the data being unknown, and thus could possibly match, all unknown data is treated as a match. .PP .SH "GENERAL OPTIONS" These are the options added to yum that are available in the "list updates", "info updates", "check-update" and "update" commands. They are: .PP .IP "\fB\--filter-vendors\fP" This option includes packages which have a vendor which matches one of the passed vendor wildcard strings, or is unknown. Note that vendors can have spaces in their value, so "," is the only way to specify multiple vendors as one option argument. .IP "\fB\--filter-rpm-groups\fP" This option includes packages which have a group which matches one of the passed rpm group wildcard strings, or is unknown. Note that rpm groups can have spaces in their value, so "," is the only way to specify multiple rpm groups as one option argument. .IP "\fB\--filter-packagers\fP" This option includes packages which have a packager which matches one of the passed packager wildcard strings, or is unknown. Note that vendors can have spaces in their value, so "," is the only way to specify multiple packagers as one option argument. .IP "\fB\--filter-licenses\fP" This option includes packages which have a license which matches one of the passed license wildcard strings, or is unknown. Note that licenses can have spaces in their value, so "," is the only way to specify multiple licenses as one option argument. .IP "\fB\--filter-arches\fP" This option includes packages which have a arch which matches one of the passed arch wildcard strings, or is unknown. .IP "\fB\--filter-committers\fP" This option includes packages which have a committer which matches one of the passed committer wildcard strings, or is unknown. Note that committers can have spaces in their value, so "," is the only way to specify multiple committers as one option argument. Also, committer values are so loosely formed that they could contain commas too, it is recommeneded to not do that but you can work around it by using "?". .IP "\fB\--filter-buildhosts\fP" This option includes packages which have a buildhost which matches one of the passed buildhost wildcard strings, or is unknown. .IP "\fB\--filter-urls\fP" This option includes packages which have a url which matches one of the passed url wildcard strings, or is unknown. .IP "\fB\--filter-package-sizes\fP" This option includes packages which have a packagesize which is within one of the passed packagesize ranges, or is unknown. .IP "\fB\--filter-archive-sizes\fP" This option includes packages which have a archivesize which is within one of the passed archivesize ranges, or is unknown. .IP "\fB\--filter-installed-sizes\fP" This option includes packages which have a installedsize which is within one of the passed installedsize ranges, or is unknown. .IP "\fB\--filter-groups\fP" This option includes packages which are in a yum group which matches one of the passed yum group id strings, or is unknown. Note that yum groups can have spaces in their value, so "," is the only way to specify multiple yum groups as one option argument. .PP .PP .SH "EXAMPLES" .PP To list all updates that are 1 MB or less use: .IP yum --filter-package-sizes=-1m check-update .PP To apply updates that Dan Walsh has committed use: .IP yum --filter-committers='Dan Walsh *' update .PP To list updates for a specific group use: .IP yum --filter-rpm-groups='App*/Sys*' list updates .PP To apply updates to a specific set of groups use: .IP yum --filter-rpm-groups='App*/System,Devel*/Lib*,System Environment/Base' update .PP To list updates for a set of yum groups use: .IP yum --filter-groups='PostgreSQL Database,Web Server' list updates .PP To apply updates to a specific set of yum groups use: .IP yum --filter-groups='KDE,Core,Printing Support' update .SH "SEE ALSO" .nf .I yum-list-data (1) .I yum (8) .I yum.conf (5) .fi .SH "AUTHORS" .nf James Antill <james.antill@redhat.com>. .fi .SH "BUGS" Currently yum can't filter packages in all of the commands, so for instance "yum list 'yum*'" doesn't get the results filtered. Apart from that there are no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful in finding a resolution contact the mailing list: yum-devel@lists.baseurl.org. To file a bug use http://bugzilla.redhat.com for Fedora/RHEL/Centos related bugs and http://yum.baseurl.org/report for all other bugs. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/docs/yum-fs-snapshot.1�������������������������������������������������������������0000664�0000000�0000000�00000002005�11620520663�0017632�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" yum-fs-snapshot .TH YUM-FS-SNAPSHOT 1 "3 February 2010" "" "User Manuals" .SH NAME .B yum-fs-snapshot .SH SYNOPSIS The .B yum-fs-snapshot package .SH DESCRIPTION .BR yum-fs-snapshot(1) is a Yum plugin for taking snapshots of your filesystems before running a yum transaction. By default it will take a snapshot of any filesystem that can be snapshotted, which currently is limited to BTRFS filesystems. However, all filesystems built on LVM logical volumes may be snapshotted at the block level using LVM snapshots. LVM snapshot support is provided for the purpose of system rollback. As such LVM snapshots will only be created if the kernel supports the "snapshot-merge" DM target. .SH FILES .B yum-fs-snapshot uses a configuration file for its specific actions: .I /etc/yum/pluginconf.d/fs-snapshot.conf .RS .SH SEE ALSO .nf .I yum-fs-snapshot.conf (5) .fi .PP .SH AUTHORS .nf Josef Bacik <josef@toxicpanda.com> .br Mike Snitzer <msnitzer@fedoraproject.org> .fi .SH "SEE ALSO" .BR yum (1) .BR yum-fs-snapshot.conf (5) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/docs/yum-fs-snapshot.conf.5��������������������������������������������������������0000664�0000000�0000000�00000002404�11620520663�0020565�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" yum-fs-snapshot.conf.5 .TH YUM-FS-SNAPSHOT.CONF 5 "3 February 2010" "" "File Formats" .SH NAME .B yum-fs-snapshot.conf(5) .SH SYNOPSIS .B yum-fs-snapshot.conf(5) is the configuration file for .B yum-fs-snapshot(1) Yum plugin for snapshotting your filesystems before running a yum transaction. By default, this plugin will snapshot all filesystems that it is capable of snapshotting. This includes block-level snapshots using LVM snapshots. .SH FILES .I /etc/yum/pluginconf.d/fs-snapshot.conf .SH FILE FORMAT .B yum-fs-snapshot.conf(5) utilizes configuration options in the form of .IP OPTION=VALUE .SH OPTION .IP exclude This is a space delimited list of the mount points you do not wish to have snapshotted by this plugin. .SH OPTION - [lvm] section .IP enabled This is a boolean value used to control whether LVM snapshots will be created for filesystems built on LVM logical volumes. .SH OPTION - [lvm] section .IP lvcreate_size_args This is the space delimited lvcreate argument list that is used to specify the size of the snapshot LV. Valid lvcreate size options are -l or -L. If not specified then LVM snapshots will not be created. .SH AUTHOR .RS Josef Bacik <josef@toxicpanda.com> .br Mike Snitzer <msnitzer@fedoraproject.org> .RS .SH SEE ALSO .BR yum-fs-snapshot(1) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/docs/yum-groups-manager.1����������������������������������������������������������0000664�0000000�0000000�00000011717�11620520663�0020326�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" yum-groups-manager .TH "yum-groups-manager" "1" "23 August 2008" "" "" .SH "NAME" yum-groups-manager - create and edit yum's group metadata .SH "SYNOPSIS" \fByum-groups-manager\fP [options] [packages] .SH "DESCRIPTION" \fByum-groups-manager\fP is used to create or edit a group metadata file for a yum repository. This is often much easier than writting/editing the XML by hand. The \fByum-groups-manager\fP can load an entire file of groups metadata and either create a new group or edit an existing group and then write all of the groups metadata back out. .SH "OPTIONS" .IP "\fB\-h, \-\-help\fP" Display a help message, and then quit. .IP "\fB\-\-version\fP" Display a version message, and then quit. .IP "\fB\-n, \-\-name\fP" The name to lookup/use for the group. If you specify an existing group id, then the group with that id will have it's name changed to this value. .IP "\fB\-\-id\fP" The id to lookup/use for the group. If you don't specify an id, but do specify a name that doesn't refer to an existing group, then an id for the group is generated based on the name. .IP "\fB\-\-description\fP" The description to use for the group. .IP "\fB\-\-mandatory\fP" Store the package names specified within the mandatory section of the specified group, the default is to use the default section. This overrides the optional argument. .IP "\fB\-\-optional\fP" Store the package names specified within the optional section of the specified group, the default is to use the default section. This option is overridden by the mandatory argument. .IP "\fB\-\-dependencies\fP" Also include the names of the direct dependencies for each package specified. .IP "\fB\-\-not\-user\-visible\fP" Make the group not visible in yum grouplist. .IP "\fB\-\-user\-visible\fP" Make the group visible in yum grouplist (this is the default). .IP "\fB\-\-display\-order\fP" Change the integer which controls the order groups are presented in, for example in yum grouplist. .IP "\fB\-\-load\fP" Load the groups metadata information from the specified file, before performing any operataions. This option can be specified multiple times. .IP "\fB\-\-save\fP" Save the result to this file, you can specify the name of a file you are loading from as the data will only be saved when all the operations have been performed. This option can also be specified multiple times. .IP "\fB\-\-merge\fP" This is the same as loading and saving a file, however the "merge" file is loaded before any others and saved last. .IP "\fB\-\-print\fP" Also print the result to stdout, if saving or merging. .IP "\fB\-\-remove\fP" Instead of adding package, remove them. Note that the packages are removed from all sections (default, mandatory and optional). .IP "\fB\-\-translated\-name\fP" This is another name for the group within the locale given. The syntax is lang:text. Eg. en:my-group-name-in-english .IP "\fB\-\-translated\-description\fP" This is another description for the group within the locale given. The syntax is lang:text. Eg. en:my-group-description-in-english. .SH "YUM OPTIONS" The following options are meant to be the same as those with the same name in yum. .IP "\fB\-c CONFIG, \-\-config=CONFIG\fP" .IP "\fB\-\-quiet\fP" .IP "\fB\-\-verbose\fP" .IP "\fB\-\-enablerepo\fP" .IP "\fB\-\-disablerepo\fP" .IP "\fB\-\-noplugins\fP" .IP "\fB\-C, \-\-cache\fP" .IP "\fB\-\-tempcache\fP" .SH "EXAMPLES" .IP "Create a new group metadata file, with a group called yum containing all the packages that start with yum:" \fB yum-groups-manager --name YUM --save groups.xml 'yum*'\fP .IP "After the above command, load the groups.xml data, work with the yum group, make the group not user visible, and remove the yum-skip-broken and yum-priorities packages from it:" \fB yum-groups-manager -n YUM --merge groups.xml --remove yum-skip-broken yum-priorities --not-user-visible\fP .IP "After the above commands, add a description and a translated name to the yum group:" \fB yum-groups-manager -n YUM --merge groups.xml --description 'This is a group with most of the yum packages in it' --translated-name 'en:yum packages'\fP .SH "FILES" \fByum-groups-manager\fP uses the yum libraries for retrieving information and packages. If no configuration file is specified, the default yum configuration will be used. .PP .nf /etc/yum.conf /etc/yum/repos.d/ .fi .SH "SEE ALSO" .nf .I yum (8) .I yum.conf (5) http://yum.baseurl.org/ .fi .SH "AUTHORS" .nf See the Authors file included with this program. .fi .SH "BUGS" .nf There are a couple of options you can't set, yet. Most notabley you cannot put package names into the conditional section (where they are installed with groupinstall only if another package is installed). Other than that, there are no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful in finding a resolution contact the mailing list: yum-devel@lists.baseurl.org. To file a bug use http://bugzilla.redhat.com for Fedora/RHEL/Centos related bugs and http://yum.baseurl.org/report for all other bugs. .fi �������������������������������������������������yum-utils-1.1.31/docs/yum-list-data.1���������������������������������������������������������������0000664�0000000�0000000�00000010365�11620520663�0017257�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" yum list-data plugin .TH "yum-list-data" "1" "04 February 2008" "James Antill" "" .SH "NAME" yum list data plugin .SH "SYNOPSIS" \fByum\fP [options] [command] [package ...] .SH "DESCRIPTION" .PP This plugin extends \fByum\fP for some commands that give aggregate package data based on lists of packages .PP added yum \fIcommand\fPs are: .br .I \fR * list-vendors .br .I \fR * info-vendors .br .I \fR * list-rpm-groups .br .I \fR * info-rpm-groups .br .I \fR * list-packagers .br .I \fR * info-packagers .br .I \fR * list-licenses .br .I \fR * info-licenses .br .I \fR * list-arches .br .I \fR * info-arches .br .I \fR * list-committers .br .I \fR * info-committers .br .I \fR * list-buildhosts .br .I \fR * info-buildhosts .br .I \fR * list-baseurls .br .I \fR * info-baseurls .br .I \fR * list-package-sizes .br .I \fR * info-package-sizes .br .I \fR * list-archive-sizes .br .I \fR * info-archive-sizes .br .I \fR * list-installed-sizes .br .I \fR * info-installed-sizes .br .I \fR * list-groups .br .I \fR * info-groups .br .PP all of which take the same arguments as the list and info yum commands. The difference between the list and info varieties is that the info versions lists all the packages under each agregation. .PP .br .br .PP .IP "\fBlist-vendors\fP, \fBinfo-vendors\fP" Is used to list the aggregate of the vendor attribute on the packages, examples are "Fedora Project" and "Red Hat, Inc.". .IP .IP "\fBlist-rpm-groups\fP, \fBinfo-rpm-groups\fP" Is used to list the aggregate of the group attribute on the packages, examples are "Applications/System", "Development/Tools" and "System Environment/Base" .IP .IP "\fBlist-packagers\fP, \fBinfo-packagers\fP" Is used to list the aggregate of the packager attribute on the packages, examples are "Fedora Project" and "Red Hat, Inc.". .IP .IP "\fBlist-licenses\fP, \fBinfo-licenses\fP" Is used to list the aggregate of the license attribute on the packages, examples are "GPL" and "MIT" .IP .IP "\fBlist-arches\fP, \fBinfo-arches\fP" Is used to list the aggregate of the arch attribute on the packages, examples are "i386" and "x86_64" .IP .IP "\fBlist-committers\fP, \fBinfo-committers\fP" Is used to list the aggregate of the committer attribute on the packages, this is taken from the most recent changelog entry of the package. .IP .IP "\fBlist-buildhosts\fP, \fBinfo-buildhosts\fP" Is used to list the aggregate of the buildhost attribute on the packages, examples are "mybuilder.example.com" and "xenbuilder1.fedora.redhat.com" .IP .IP "\fBlist-baseurls\fP, \fBinfo-baseurls\fP" Is used to list the aggregate of the url attribute on the packages after discarding the path of the URL, examples are "http://yum.baseurl.org/" and "http://www.and.org/" .IP .IP "\fBlist-package-sizes\fP, \fBinfo-package-sizes\fP" Is used to list the aggregate of specified ranges the packagesize attribute on the packages, examples are "[ 1B - 10KB ]" and "[ 750KB - 1MB ]". .IP .IP "\fBlist-archive-sizes\fP, \fBinfo-archive-sizes\fP" Is used to list the aggregate of specified ranges the archivesize attribute on the packages, examples are "[ 1B - 10KB ]" and "[ 750KB - 1MB ]". .IP .IP "\fBlist-installed-sizes\fP, \fBinfo-installed-sizes\fP" Is used to list the aggregate of specified ranges the installedsize attribute on the packages, examples are "[ 1B - 10KB ]" and "[ 750KB - 1MB ]". .IP .IP "\fBlist-groups\fP, \fBinfo-groups\fP" Is used to list the aggregate of the yum groups that the packages are in, examples are in "yum grouplist". Note that in yum groups a package can be in more than one group at a time. .IP .PP It is worth noting that some of the above data can be "unknown", to yum, at which point a seperate aggregation called "-- Unknown --" is listed. .SH "EXAMPLES" .PP To list all the groups that have an update, along with the number of packages in each group, use: .IP yum list-rpm-groups updates .PP To list all the committers to packages that have yum in their name, use: .IP yum list-committers 'yum*' .PP To list ranges of the sizes of packages installed or available, use: .IP yum list-package-sizes .PP To list yum groups that have an update, use: .IP yum list-groups .SH "SEE ALSO" .nf .I yum-filter-data (1) .I yum (8) .I yum.conf (5) .fi .SH "AUTHORS" .nf James Antill <james.antill@redhat.com>. .fi ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/docs/yum-security.8����������������������������������������������������������������0000664�0000000�0000000�00000014012�11620520663�0017244�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" yum security plugin .TH "yum-security" "8" "12 April 2007" "James Antill" "" .SH "NAME" yum security plugin .SH "SYNOPSIS" \fByum\fP [options] [command] [package ...] .SH "DESCRIPTION" .PP This plugin extends \fByum\fP to allow lists and updates to be limited using security relevant criteria .PP added yum \fIcommand\fPs are: .br .I \fR yum update-minimal .PP This works like the update command, but if you have the the package foo-1 installed and have foo-2 and foo-3 available with updateinfo.xml then update-minimal will update you to foo-3. .br .I \fR yum updateinfo info .br .I \fR yum updateinfo list .br .I \fR yum updateinfo summary .PP all of the last three take these \fIsub-command\fPs: .br .I \fR yum updateinfo * all .br .I \fR yum updateinfo * available .br .I \fR yum updateinfo * installed .br .I \fR yum updateinfo * updates .PP and then: .br .I \fR * <advisory> [advisory...] .br .I \fR * <package> .br .I \fR * bugzillas .br .I \fR * cves .br .I \fR * enhancement .br .I \fR * security .br .I \fR * new-packages .br .br .PP .IP "\fBall\fP" Is used to display information about both install and available advisories. .PP .IP "\fBavailable\fP" Is used to display information about just available advisories. This is the default. .PP .IP "\fBinstalled\fP" Is used to display information about just install advisories. .PP .IP "\fBupdates\fP" This is mostly the same as "available" but it only shows advisory information for packages that can be updated to. .PP .IP "\fB<advisory> [advisory...]\fP" Is used to display information about one or more advisories. .PP .IP "\fB<package> [package...]\fP" Is used to display information about one or more packages. .PP .IP "\fBlist\fP" Is used to list all of the relevant errata notice information, from the updateinfo.xml data in yum. This includes bugzillas, CVEs, security updates and new. .PP .IP "\fBinfo\fP" Is used to show all the errata notice information, from the updateinfo.xml data in yum. This includes bugzillas, CVEs, security updates and new. .PP .IP "\fBlist\fP" Is used to list all of the relevant errata notice information, from the updateinfo.xml data in yum. This includes bugzillas, CVEs, security updates and new. .IP .IP "\fBbugzillas / bzs\fP" Is the subset of the updateinfo information, pertaining to the bugzillas. .IP .IP "\fBcves\fP" Is the subset of the updateinfo information, pertaining to the CVEs. .IP .IP "\fBsecurity / sec\fP" Is the subset of the updateinfo information, pertaining to security. .IP "\fBbugfix\fP" Is the subset of the updateinfo information, pertaining to bugfixes. .IP "\fBenhancement\fP" Is the subset of the updateinfo information, pertaining to enhancements. .IP "\fBrecommended\fP" Is the subset of the updateinfo information, pertaining to recommended updates. .IP "\fBnew-packages\fP" Is the subset of the updateinfo information, pertaining to new packages. These are packages which weren't available at the initial release of your distribution. .IP .PP .SH "GENERAL OPTIONS" There are four options added to yum that are available in the "list updates", "info updates", "check-update" and "update" commands. They are: .PP .IP "\fB\--advisory\fP" This option includes packages coresponding to the advisory ID, Eg. FEDORA-2201-123. .IP "\fB\--bz\fP" This option includes packages that say they fix a Bugzilla ID, Eg. 123. .IP "\fB\--cve\fP" This option includes packages that say they fix a CVE - Common Vulnerabilities and Exposures ID (http://cve.mitre.org/about/), Eg. CVE-2201-0123. .IP "\fB\--bugfixes\fP" This option includes packages that say they fix a bugfix issue. .IP "\fB\--security\fP" This option includes packages that say they fix a security issue. .PP .PP .SH "EXAMPLES" .PP To list all updates that are security relevant, and get a reutrn code on whether there are security updates use: .IP yum --security check-update .PP To upgrade packages that have security errata (upgrades to the latest available package) use: .IP yum --security update .PP To upgrade packages that have security errata (upgrades to the last security errata package) use: .IP yum --security update-minimal .PP To get a list of all BZs that are fixed for packages you have installed use: .IP yum updateinfo list bugzillas .PP To get a list of all security advisoryies, including the ones you have already installed use: .IP yum updateinfo list all security .PP To get the information on advisory FEDORA-2707-4567 use: .IP yum updateinfo info FEDORA-2707-4567 .PP To update packages to the latest version which contain fixes for Bugzillas 123, 456 and 789; and all security updates use: .IP yum --bz 123 --bz 456 --bz 789 --security update .PP To update to the packages which just update Bugzillas 123, 456 and 789; and all security updates use: .IP yum --bz 123 --bz 456 --bz 789 --security update-minimal .PP To get an info list of the latest packages which contain fixes for Bugzilla 123; CVEs CVE-2207-0123 and CVE-2207-3210; and Fedora advisories FEDORA-2707-4567 and FEDORA-2707-7654 use: .IP yum --bz 123 --cve CVE-2207-0123 --cve CVE-2207-3210 --advisory FEDORA-2707-4567 --advisory FEDORA-2707-7654 info updates .PP To get a list of packages which are "new". .IP yum updateinfo list new .PP To get a summary of advisories you haven't installed yet use: .IP yum updateinfo summary .SH "SEE ALSO" .nf .I yum (8) .I yum.conf (5) .fi .SH "AUTHORS" .nf James Antill <james.antill@redhat.com>. .fi .SH "BUGS" The update-minimal command ignores the --obsoletes flag. The update-minimal command can only directly affect things atm., so if you update pkgA minimally but that requires an update to pkgB then pkgB will be updated to the newest version by the depsolver. Also the above will happen even if you've also minimally updated pkgB, if either the direct (minimal) update for pkgB happens after or if the minimal update for pkgB doesn't satisy the requirements of pkgA. The main "problem" is that if the data is not correct the plugin cannot work correctly. For instance "--bz 123" will not fix BZ 123 if a package is updated to fix that BZ without referencing that it does so in the updateinfo.xml. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/docs/yum-utils.1�������������������������������������������������������������������0000664�0000000�0000000�00000005437�11620520663�0016541�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.TH "yum-utils" "1" "August 2011" "yum-utils" "" .SH "NAME" yum\-utils \- tools for manipulating repositories and extended package management .SH "SYNOPSIS" .nf \fBdebuginfo\-install\fR \- install debuginfo packages and their dependencies \fBfind-repos-of-install\fR \- report which repository the package was installed from \fBneeds-restarting\fR \- report process ids that started running before they or some component they use were updated \fBpackage\-cleanup\fR \- manage package cleanup, duplicates, orphaned packages and outstanding dependency problems \fBrepo\-graph\fR \- outputs a full package dependency list in dot format \fBrepo\-rss\fR \- generates an RSS feed from one or more repositories \fBrepoclosure\fR \- reads metadata of repositories, checks dependencies and displays list of unresolved dependencies \fBrepodiff\fR \- takes two or more repositories, returns a list of added, removed or changed packages \fBrepomanage\fR \- manages a directory of rpm packages, returns a list of newest or oldest packages in a directory \fBrepoquery\fR \- query yum repositories and get additional information on the them \fBreposync\fR \- synchronize a remote yum repository to a local directory using yum to retrieve packages \fBrepotrack\fR \- track packages and its dependencies and downloads them \fBshow-installed\fR \- gives a compact description of packages installed and makes use of comps groups in repositories \fBverifytree\fR - verify that a local yum repository is consistent \fByum\-builddep\fR \- installs missing dependencies to build a specified package \fByum\-complete\-transaction\fR \- finds incomplete or aborted yum transactions and attempts to complete them \fByum\-config\-manager\fR \- toggle yum repositories, add new repositories and set main yum configuration options \fByum\-debug\-dump\fR \- creates gzipped file containing information for debugging problems \fByum\-debug\-restore\fR \- replays any transactions captured in gzipped file in yum shell \fByum\-groups\-manager\fR \- create and edit yum's group metadata \fByum\-installed\fR \- print a compact package list making use of comps groups \fByumdb\fR \- query or alter the yum database \fByumdownloader\fR \- downloads packages from yum repositories including source RPMs .SH "DESCRIPTION" .B yum\-utils is a collection of tools and programs for managing yum repositories, installing debug packages, source packages, extended information from repositories and administration. .SH "NOTES" See respective tools for additional help for commands without a manual page .SH "SEE ALSO" debuginfo\-install(1), package\-cleanup(1), repodiff(1), repoquery(1), reposync(1), repo\-rss(1), yumdownloader(1), yum\-builddep(1), yum\-debug\-dump(1), yum\-groups\-manager(1), yumdb(8), yum\-complete\-transaction(8) .SH "AUTHOR" Shawn Starr <shawn.starr@rogers.com> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/docs/yum-verify.1������������������������������������������������������������������0000664�0000000�0000000�00000004732�11620520663�0016702�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" yum verify plugin .TH "yum-verify" "1" "01 March 2008" "James Antill" "" .SH "NAME" yum verify plugin .SH "SYNOPSIS" \fByum\fP [options] verify [package ...] .SH "DESCRIPTION" .PP This plugin extends \fByum\fP with some commands that give verification information on the installed system, much like rpm -V. You can change how the verification is done and which files it applies to. .PP added yum \fIcommand\fPs are: .br .I \fR * verify .br .I \fR * verify-rpm .br .I \fR * verify-all .br .PP all of which take the same arguments as the list yum command, obviously you can only verify packages that are installed on the system. .PP .br .br .PP .IP "\fBverify\fP" Is the generic verification command, and is intented to give the most useful output. It removes all false matches due to multilib and ignores changes to configuration files by default. .IP .IP "\fBverify-rpm\fP" Is meant to be 100% compatible with rpm -V output, and any differences should be considered as bugs. .IP .IP "\fBverify-all\fP" Is used to list all the differences, including some that rpm itself will ignore. .IP .SH "GENERAL OPTIONS" These are the options added to yum that are available in the verify commands. They are: .PP .IP "\fB\--verify-filenames\fP" This option is used to limit the filenames that the packages will perform verification. .IP "\fB\--verify-configuration-files\fP" This option is only useful in the generic verify command, and will enable/disable verification of files that are tagged as configuration files. .SH "EXAMPLES" .PP To do the same as rpm -Va, use: .IP yum verify-rpm .PP To verify the packages starting with the name yum, use: .IP yum verify 'yum*' .PP To verify the binaries that are in a bin directory, use: .IP yum verify --verify-filenames='*bin/*' .PP To verify all include files, Eg. for multilib problems, use: .IP yum verify-all --verify-filenames='/usr/include/*' .SH "SEE ALSO" .nf .I yum (8) .I yum.conf (5) .I the verify.conf file in /etc/yum/plugins.d .fi .SH "AUTHORS" .nf James Antill <james.antill@redhat.com>. .fi .SH "BUGS" .nf Currently yum-verify does not do verify-script checking or dependancy checking, only file checking. Should you find any other bugs, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful in finding a resolution contact the mailing list: yum-devel@lists.baseurl.org. To file a bug use http://bugzilla.redhat.com for Fedora/RHEL/Centos related bugs and http://yum.baseurl.org/report for all other bugs. .fi ��������������������������������������yum-utils-1.1.31/docs/yum-versionlock.1�������������������������������������������������������������0000664�0000000�0000000�00000004514�11620520663�0017732�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" PROCESS THIS FILE WITH .\" groff -man -Tascii yum-versionlock.1 .\" .TH YUM-VERSIONLOCK 1 "28 December 2009" "" "User Manuals" .SH NAME yum-versionlock - Version lock rpm packages .SH SYNOPSIS .B yum-versionlock [ package-name [ package-name]] ... .SH DESCRIPTION .BR yum-versionlock(1) is a Yum plugin that takes a set of name/versions for packages and excludes all other versions of those packages (including optionally following obsoletes). This allows you to protect packages from being updated by newer versions. .PP The plugin provides a command "versionlock" which allows you to view and edit the list of locked packages easily. .br .I \fR yum versionlock add <package-wildcard>... .PP Add a versionlock for all of the packages in the rpmdb matching the given wildcards. .I \fR yum versionlock exclude <package-wildcard>... .PP Add a exclude (within versionlock) for the latest versions of the packages in the available repos. matching the given wildcards. .I \fR yum versionlock list .PP List the current versionlock entries. .I \fR yum versionlock delete <entry-wildcard>... .PP Remove any matching versionlock entries. .I \fR yum versionlock clear .PP Remove all versionlock entries. .SH FILES .I /etc/yum/pluginconf.d/versionlock.conf .RS The system wide configuration file. See .BR yum-versionlock.conf(5) for more information. .RE .I /etc/yum/pluginconf.d/versionlock.list .RS The default place to put package version lock information (one package and version per. line). The file takes entries in the following format .BR EPOCH:NAME-VERSION-RELEASE.ARCH See .BR rpm(8) for more information on custom query formats. If the package does not have an EPOCH the number will default to 0. .RE .SH BUGS There are of course no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful in finding a resolution contact the mailing list: yum-devel@lists.baseurl.org. To file a bug use http://bugzilla.redhat.com for Fedora/RHEL/Centos related bugs and http://yum.baseurl.org/report for all other bugs. .SH AVAILABILITY yum-versionlock is available via: .nf # yum install yum-versionlock .fi .SH AUTHORS Panu Matilainen <pmatilai@laiskiainen.org> .br James Antill <james@and.org> .br Documetation modified by: .br Gerhardus Geldenhuis <gerhardus.geldenhuis@gmail.com> .SH "SEE ALSO" .BR yum(1) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/docs/yum-versionlock.conf.5��������������������������������������������������������0000664�0000000�0000000�00000003730�11620520663�0020661�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" PROCESS THIS FILE WITH .\" groff -man -Tascii yum-changelog.conf.5 .\" .TH YUM-VERSIONLOCK.CONF 5 "27 July 2008" "" "File Formats" .SH NAME .B yum-versionlock.conf(5) .SH SYNOPSIS .B yum-versionlock.conf(5) is the configuration file for .B yum-versionlock(1) Yum plugin for excluding packages that aren't listed in the versionlock file. The plugin will walk each line of the versionlock file, parse out the name and version of the package. It will then exclude any package by that name that doesn't match one of the versions listed within the file (or, optionally, any obsoleter of that package). This is basically the same as doing an exclude for the package name itself (as you cannot exclude installed packages), but yum will still see the versions you have installed/versionlocked as available so that "yum reinstall" will still work, etc. It can also work in the opposite way, like a fast exclude, by prefixing a '!' character to the version. .SH FILES .I /etc/yum/pluginconf.d/versionlock.conf .SH FILE FORMAT .B yum-versionlock.conf(5) utilizes configuration options in the form of .IP OPTION=VALUE .SH OPTION .IP follow_obsoletes This option is a boolean flag which specifies if the versionlock plugin should look at all the obsoletes, and see if any of the packages specified have an obsoleter. If an obsoleter is found then all versions of that package will be excluded. This option is off by default, as .B yum-versionlock(1) will take some time to do the obsoletes processing, and for non-rename obsoletes any issues you had which kept you at a specific version of a package should be different with another package. .SH OPTION .IP locklist This option is a string with points to the file which will have the versionlock information in it. Note that the file .B has to exist (or the versionlock plugin will make yum exit). However it can be empty. .SH AUTHOR .RS Chitlesh Goorah <chitlesh@fedoraproject.org> .br James Antill <james@fedoraproject.org> .RS .SH SEE ALSO .BR yum-versionlock(1) ����������������������������������������yum-utils-1.1.31/docs/yumdb.8�����������������������������������������������������������������������0000664�0000000�0000000�00000010644�11620520663�0015714�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" yumdb command .TH "yumdb" "8" "8 April 2010" "James Antill" "" .SH "NAME" yumdb command .SH "SYNOPSIS" \fByumdb\fP [command] [packages ...] .SH "DESCRIPTION" .PP This command is used to query and alter the yum database, which is a simple key value store used in conjunction with the rpm database. Any installed package can have arbitrary data in the yum database, however the main use case is to store extra data about packages as they are installed. .PP yumdb \fIcommand\fPs are: .br .IP "\fByumdb get <key> [pkg-wildcard]...\fP" .PP This command will get the value for the given key, limiting to any specified packages. .br .IP "\fByumdb set <key> <value> [pkg-wildcard]..." .PP This command will set the value for the given key, to the given value, limiting to any specified packages. .br .IP "\fByumdb del <key> [pkg-wildcard]... .PP This command will delete the given key, limiting to any specified packages. .br .IP "\fByumdb rename <old-key> <new-key> [pkg-wildcard]... .PP This command will rename the given old-key, to the given new-key, limiting to any specified packages. If the old-key does not exist, nothing happens. .br .IP "\fByumdb rename-force <old-key> <new-key> [pkg-wildcard]... .PP This command will rename the given old-key, to the given new-key, limiting to any specified packages. If the old-key does not exist, new-key is deleted. .br .IP "\fByumdb copy <old-key> <new-key> [pkg-wildcard]... .PP This command will copy the given old-key, to the given new-key, limiting to any specified packages. If the old-key does not exist, nothing happens. .br .IP "\fByumdb copy-force <old-key> <new-key> [pkg-wildcard]... .PP This command will copy the given old-key, to the given new-key, limiting to any specified packages. If the old-key does not exist, new-key is deleted. .br .IP "\fByumdb search <key> <wildcard>... .PP This command will search all packages for the given key, against any of the given wildcard values. .br .IP "\fByumdb exist <key> [pkg-wildcard]... .PP This command will print any packages which have the given key, limiting to any specified packages. .br .IP "\fByumdb unset <key> [pkg-wildcard]... .PP This command will print any packages which do not have the given key, limiting to any specified packages. .br .IP "\fByumdb info [pkg-wildcard]... .PP This command will display all the data stored in the yumdb, limiting to any specified packages. .br .IP "\fByumdb sync [pkg-wildcard]... .PP This command will add any missing data to the yumdb from the repositories, limiting to any specified packages. This is useful to run if you have had any aborted transactions (and thus. missing yumdb data). Note that "yumdb sync" cannot know all the information that would have been put into the yumdb at the time. .br .IP "\fByumdb sync-force [pkg-wildcard]... .PP This command will replace any data in the yumdb from the repositories, limiting to any specified packages. .SH "EXAMPLES" .PP List all the packages which don't have a from_repo key/value: .IP yumdb unset from_repo .PP List all the packages which were installed as dependencies: .IP yumdb search reason dep .SH "WELL KNOWN KEYS" .PP Note that there is no limit to the number of keys that can be created or what they may contain (for installed packages only). However this is a list of well known keys, and what they store. .nf .br .IP "\fBchecksum_data .IP "\fBchecksum_type .PP These keys store the createrepo checksum, and it's type, of the available package yum installed. Note that these are used by "yum version" to calculate the rpmdb version. .br .IP "\fBcommand_line .PP This key stores the entire command line, of the yum command (if it was called). .br .IP "\fBfrom_repo .IP "\fBfrom_repo_revision .IP "\fBfrom_repo_timestamp .PP These keys take values from the available package yum installed, and store the repo id, it's revision and timestamp. .br .IP "\fBreason .PP This key stores either "user" or "dep", currently. To mark if the user requested the package to be installed, or if it was brought in automatically as a dependency. Note that this is kept over updates. .br .IP "\fBreleasever .PP This key stores the value of releasever, when the package was installed. .br .IP "\fBinstallonly .PP If this attribute has the value "keep" then this package will not be removed automatically by the installonly process (and does not count towards the installonly_limit). .SH "SEE ALSO" .nf .I yum (8) .I rpm (8) .fi .SH "AUTHORS" .nf James Antill <james.antill@redhat.com>. .fi ��������������������������������������������������������������������������������������������yum-utils-1.1.31/docs/yumdownloader.1���������������������������������������������������������������0000664�0000000�0000000�00000004372�11620520663�0017457�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" yumdownloader .TH "yumdownloader" "1" "28 November 2005" "Gijs Hollestelle" "" .SH "NAME" yumdownloader .SH "SYNOPSIS" \fByumdownloader\fP [options] package1 [package2...] .SH "DESCRIPTION" .PP \fByumdownloader\fP is a program for downloading RPMs from Yum repositories. .PP .SH "GENERAL OPTIONS" .IP "\fB\-h, \-\-help\fP" Help; display a help message and then quit\&. .IP "\fB\-\-destdir DIR\fP" Specify a destination directory for the download. Defaults to the current directory. .IP "\fB\-\-urls\fP" Instead of downloading RPMs, list the URLs that would be downloaded. .IP "\fB\-\-resolve\fP" When downloading RPMs, resolve dependencies and also download the required packages. .IP "\fB\-\-source\fP" Instead of downloading the binary RPMs, download the source RPMs. .IP "\fB\-\-archlist=ARCH1[,ARCH2...]\fP" Limit the query to packages of given architecture(s). Valid values are all architectures known to rpm/yum such as 'i386' and 'src' for source RPMS. Note that repoquery will now change yum's "arch" to the first value in the archlist. So "\-\-archlist=i386,i686" will change yum's canonical arch to i386, but allow packages of i386 and i686. .SH "ADDITIONAL OPTIONS" Yumdownloader inherits all other options from yum. See the yum(8) man page for more information .SH "EXAMPLES" .IP "Download the kernel RPM to /var/tmp:" \fByumdownloader --destdir /var/tmp kernel\fP .IP "List the URL for the kernel and kernel-smp RPMs:" \fByumdownloader --urls kernel kernel-smp\fP .PP .SH "FILES" As yumdownloader uses YUM libraries for retrieving all the information, it relies on YUM configuration for its default values like which repositories to use. Consult YUM documentation for details: .PP .nf /etc/yum.conf /etc/yum/repos.d/ /var/cache/yum/ .fi .PP .SH "SEE ALSO" .nf .I yum.conf (5) http://yum.baseurl.org/ .fi .PP .SH "AUTHORS" .nf See the Authors file included with this program. .fi .PP .SH "BUGS" There are of course no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful in finding a resolution contact the mailing list: yum-devel@lists.baseurl.org. To file a bug use http://bugzilla.redhat.com for Fedora/RHEL/Centos related bugs and http://yum.baseurl.org/report for all other bugs. .fi ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/find-repos-of-install.py�����������������������������������������������������������0000664�0000000�0000000�00000010430�11620520663�0020232�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # copyright 2008 red hat, inc import sys import os import os.path from optparse import OptionParser import yum my = yum.YumBase() my.conf.showdupesfromrepos = 1 if True: parser = OptionParser(version = "find-repos-of-installed version 0.1") parser.add_option("--repoid", action="append", help="specify repoids to query, can be specified multiple times (default is all enabled)") parser.add_option("--enablerepo", action="append", dest="enablerepos", help="specify additional repoids to query, can be specified multiple times") parser.add_option("--disablerepo", action="append", dest="disablerepos", help="specify repoids to disable, can be specified multiple times") parser.add_option("--repofrompath", action="append", help="specify repoid & paths of additional repositories - unique repoid and complete path required, can be specified multiple times. Example. --repofrompath=myrepo,/path/to/repo") parser.add_option("-C", "--cache", action="store_true", help="run from cache only") parser.add_option("--tempcache", action="store_true", help="use private cache (default when used as non-root)") parser.add_option("--sync2yumdb", action="store_true", help="sync anything that is found to the yumdb, if available") (opts, args) = parser.parse_args() if not my.setCacheDir(opts.tempcache): my.logger.error("Error: Could not make cachedir, exiting") sys.exit(50) if opts.cache: my.conf.cache = True my.logger.info('Running from cache, results might be incomplete.') if opts.repofrompath: # setup the fake repos for repo in opts.repofrompath: repoid,repopath = tuple(repo.split(',')) if repopath[0] == '/': baseurl = 'file://' + repopath else: baseurl = repopath repopath = os.path.normpath(repopath) newrepo = yum.yumRepo.YumRepository(repoid) newrepo.name = repopath newrepo.baseurl = baseurl newrepo.basecachedir = my.conf.cachedir newrepo.metadata_expire = 0 newrepo.timestamp_check = False my.repos.add(newrepo) my.repos.enableRepo(newrepo.id) my.logger.info( "Added %s repo from %s" % (repoid,repopath)) if opts.repoid: for repo in my.repos.findRepos('*'): if repo.id not in opts.repoid: repo.disable() else: repo.enable() if opts.disablerepos: for repo_match in opts.disablerepos: for repo in my.repos.findRepos(repo_match): repo.disable() if opts.enablerepos: for repo_match in opts.enablerepos: for repo in my.repos.findRepos(repo_match): repo.enable() if len(args) >= 1: pkgs = my.rpmdb.returnPackages(patterns=sys.argv[1:], ignore_case=True) else: pkgs = my.rpmdb for ipkg in sorted(pkgs): if 'from_repo' in ipkg.yumdb_info: print '%s from repo %s' % (ipkg, ipkg.yumdb_info.from_repo) continue apkgs = my.pkgSack.searchPkgTuple(ipkg.pkgtup) if len(apkgs) < 1: print "Error: %s not found in any repository" % ipkg else: apkg = apkgs[0] if opts.sync2yumdb: # and hasattr(ipkg, 'yumdb_info'): for compat. ? ipkg.yumdb_info.from_repo = apkg.repoid print '%s from repo %s' % (ipkg, apkg.repoid) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/needs-restarting.py����������������������������������������������������������������0000775�0000000�0000000�00000010233�11620520663�0017400�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Copyright 2009 Red Hat Inc # written by Seth Vidal # look through list of running apps # report any app which was updated after it was started # (and therefore needs to be restarted) # for each /proc/number-dir # get stat of create time on that dir # open up smaps and search for all lines with 'fd:' in them # take filename # search for the package owning that file # make a list of installtimes of all pkgs of the files the program has open # sort the list # if the dir create time is < the largest time on the installtimes list # then output the pid and process cmdline as needing to be restarted #TODO: # maybe note deleted files which are not owned by any pkg but which an app # is still using # output userids, too? import sys import os import yum import glob import stat from optparse import OptionParser def parseargs(args): usage = """ needs-restarting: Report a list of process ids of programs that started running before they or some component they use were updated. """ parser = OptionParser(usage=usage) parser.add_option("-u", "--useronly", default=False, action="store_true", help='show processes for my userid only') (opts, args) = parser.parse_args(args) return (opts, args) def return_running_pids(uid=None): mypid = os.getpid() pids = [] for fn in glob.glob('/proc/[0123456789]*'): if mypid == os.path.basename(fn): continue if uid: # meaning we're not root and we've added -u if os.stat(fn)[stat.ST_UID] != uid: continue pids.append(os.path.basename(fn)) return pids def get_open_files(pid): files = [] smaps = '/proc/%s/smaps' % pid try: maps = open(smaps, 'r') except (IOError, OSError), e: print "Could not open %s" % smaps return files for line in maps.readlines(): if line.find('fd:') == -1: continue line = line.replace('\n', '') slash = line.find('/') filename = line[slash:] filename = filename.replace('(deleted)', '') #only mildly retarded filename = filename.strip() if filename not in files: files.append(filename) return files def main(args): (opts, args) = parseargs(args) my = yum.YumBase() my.preconf.init_plugins=False if hasattr(my, 'setCacheDir'): my.setCacheDir() my.conf.cache = True myuid = None if opts.useronly: myuid = os.getuid() needing_restart = [] for pid in return_running_pids(uid=myuid): try: pid_start = os.stat('/proc/' + pid)[stat.ST_CTIME] except OSError, e: continue found_match = False for fn in get_open_files(pid): if found_match: break for pkg in my.rpmdb.searchFiles(fn): if float(pkg.installtime) > float(pid_start): needing_restart.append(pid) found_match = True for pid in needing_restart: try: cmdline = open('/proc/' +pid+ '/cmdline', 'r').read() except OSError, e: print "Couldn't access process information for %s: %s" % (pid, str(e)) continue # proc cmdline is null-delimited so clean that up cmdline = cmdline.replace('\000', ' ') print '%s : %s' % (pid, cmdline) return 0 if __name__ == "__main__": sys.exit(main(sys.argv)) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/package-cleanup.py�����������������������������������������������������������������0000775�0000000�0000000�00000037744�11620520663�0017162�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/python # # (C) 2005 Gijs Hollestelle, released under the GPL # Copyright 2009 Red Hat # Rewritten 2009 - Seth Vidal # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # import sys sys.path.insert(0,'/usr/share/yum-cli') from yum.misc import setup_locale from utils import YumUtilBase import logging import os import re import yum.depsolve # For flags from yum.Errors import YumBaseError from rpmUtils import miscutils, arch from optparse import OptionGroup def exactlyOne(l): return len(filter(None, l)) == 1 class PackageCleanup(YumUtilBase): NAME = 'package-cleanup' VERSION = '1.0' USAGE = """ package-cleanup: helps find problems in the rpmdb of system and correct them usage: package-cleanup --problems or --leaves or --orphans or --oldkernels """ def __init__(self): YumUtilBase.__init__(self, PackageCleanup.NAME, PackageCleanup.VERSION, PackageCleanup.USAGE) self.logger = logging.getLogger("yum.verbose.cli.packagecleanup") # Add util commandline options to the yum-cli ones self.optparser = self.getOptionParser() self.optparser_grp = self.getOptionGroup() self.addCmdOptions() self.main() def addCmdOptions(self): self.optparser_grp.add_option("--problems", default=False, dest="problems", action="store_true", help='List dependency problems in the local RPM database') self.optparser_grp.add_option("--qf", "--queryformat", dest="qf", action="store", default='%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}', help="Query format to use for output.") self.optparser_grp.add_option("--orphans", default=False, dest="orphans",action="store_true", help='List installed packages which are not available from'\ ' currently configured repositories') dupegrp = OptionGroup(self.optparser, 'Duplicate Package Options') dupegrp.add_option("--dupes", default=False, dest="dupes", action="store_true", help='Scan for duplicates in your rpmdb') dupegrp.add_option("--cleandupes", default=False, dest="cleandupes", action="store_true", help='Scan for duplicates in your rpmdb and remove older ') dupegrp.add_option("--noscripts", default=False, dest="noscripts", action="store_true", help="disable rpm scriptlets from running when cleaning duplicates") self.optparser.add_option_group(dupegrp) leafgrp = OptionGroup(self.optparser, 'Leaf Node Options') leafgrp.add_option("--leaves", default=False, dest="leaves", action="store_true", help='List leaf nodes in the local RPM database') leafgrp.add_option("--all", default=False, dest="all_nodes", action="store_true", help='list all packages leaf nodes that do not match'\ ' leaf-regex') leafgrp.add_option("--leaf-regex", default="(^(compat-)?lib(?!reoffice).+|.*libs?[\d-]*|.*-data$)", help='A package name that matches this regular expression' \ ' (case insensitively) is a leaf') leafgrp.add_option("--exclude-devel", default=False, action="store_true", help='do not list development packages as leaf nodes') leafgrp.add_option("--exclude-bin", default=False, action="store_true", help='do not list packages with files in a bin dirs as'\ 'leaf nodes') self.optparser.add_option_group(leafgrp) kernelgrp = OptionGroup(self.optparser, 'Old Kernel Options') kernelgrp.add_option("--oldkernels", default=False, dest="kernels",action="store_true", help="Remove old kernel and kernel-devel packages") kernelgrp.add_option("--count",default=2,dest="kernelcount", action="store", help='Number of kernel packages to keep on the '\ 'system (default 2)') kernelgrp.add_option("--keepdevel", default=False, dest="keepdevel", action="store_true", help='Do not remove kernel-devel packages when ' 'removing kernels') self.optparser.add_option_group(kernelgrp) def _find_missing_deps(self, pkgs): """find any missing dependencies for any installed package in pkgs""" # XXX - move into rpmsack/rpmdb providers = {} # To speed depsolving, don't recheck deps that have # already been checked problems = [] for po in pkgs: for (req,flags,ver) in po.requires: if req.startswith('rpmlib'): continue # ignore rpmlib deps if (req,flags,ver) not in providers: resolve_sack = self.rpmdb.whatProvides(req,flags,ver) else: resolve_sack = providers[(req,flags,ver)] if len(resolve_sack) < 1: flags = yum.depsolve.flags.get(flags, flags) missing = miscutils.formatRequire(req,ver,flags) problems.append((po, "requires %s" % missing)) else: # Store the resolve_sack so that we can re-use it if another # package has the same requirement providers[(req,flags,ver)] = resolve_sack return problems def _find_installed_duplicates(self, ignore_kernel=True): """find installed duplicate packages returns a dict of pkgname = [[dupe1, dupe2], [dupe3, dupe4]] """ # XXX - this should move to be a method of rpmsack multipkgs = {} singlepkgs = {} results = {} for pkg in self.rpmdb.returnPackages(): # just skip kernels and everyone is happier if ignore_kernel: if 'kernel' in pkg.provides_names: continue if pkg.name.startswith('kernel'): continue name = pkg.name if name in multipkgs or name in singlepkgs: continue pkgs = self.rpmdb.searchNevra(name=name) if len(pkgs) <= 1: continue for po in pkgs: if name not in multipkgs: multipkgs[name] = [] if name not in singlepkgs: singlepkgs[name] = [] if arch.isMultiLibArch(arch=po.arch): multipkgs[name].append(po) elif po.arch == 'noarch': multipkgs[name].append(po) singlepkgs[name].append(po) elif not arch.isMultiLibArch(arch=po.arch): singlepkgs[name].append(po) else: print "Warning: neither single nor multi lib arch: %s " % po for (name, pkglist) in multipkgs.items() + singlepkgs.items(): if len(pkglist) <= 1: continue if name not in results: results[name] = [] if pkglist not in results[name]: results[name].append(pkglist) return results def _remove_old_dupes(self): """add older duplicate pkgs to be removed in the transaction""" dupedict = self._find_installed_duplicates() removedupes = [] for (name,dupelists) in dupedict.items(): for dupelist in dupelists: dupelist.sort() for lowpo in dupelist[0:-1]: removedupes.append(lowpo) for po in removedupes: self.remove(po) def _should_show_leaf(self, po, leaf_regex, exclude_devel, exclude_bin): """ Determine if the given pkg should be displayed as a leaf or not. Return True if the pkg should be shown, False if not. """ if po.name == 'gpg-pubkey': return False name = po.name if exclude_devel and name.endswith('devel'): return False if exclude_bin: for file_name in po.filelist: if file_name.find('bin') != -1: return False if leaf_regex.match(name): return True return False def _get_kernels(self): """return a list of all installed kernels, sorted newest to oldest""" kernlist = self.rpmdb.searchProvides(name='kernel') kernlist.sort() kernlist.reverse() return kernlist def _get_old_kernel_devel(self, kernels, removelist): # List all kernel devel packages that either belong to kernel versions that # are no longer installed or to kernel version that are in the removelist devellist = [] for po in self.rpmdb.searchProvides(name='kernel-devel'): # For all kernel-devel packages see if there is a matching kernel # in kernels but not in removelist keep = False for kernel in kernels: if kernel in removelist: continue (kname,karch,kepoch,kver,krel) = kernel.pkgtup (dname,darch,depoch,dver,drel) = po.pkgtup if (karch,kepoch,kver,krel) == (darch,depoch,dver,drel): keep = True if not keep: devellist.append(po) return devellist def _remove_old_kernels(self, count, keepdevel): """Remove old kernels, keep at most count kernels (and always keep the running kernel""" count = int(count) kernels = self._get_kernels() runningkernel = os.uname()[2] # Vanilla kernels dont have a release, only a version if '-' in runningkernel: splt = runningkernel.split('-') if len(splt) == 2: (kver,krel) = splt else: # Handle cases where a custom build kernel has an extra '-' in the release kver=splt[1] krel="-".join(splt[1:]) if krel.split('.')[-1] == os.uname()[-1]: krel = ".".join(krel.split('.')[:-1]) else: kver = runningkernel krel = "" remove = kernels[count:] toremove = [] # Remove running kernel from remove list for kernel in remove: if kernel.version == kver and krel.startswith(kernel.release): print "Not removing kernel %s-%s because it is the running kernel" % (kver,krel) else: toremove.append(kernel) # Now extend the list with all kernel-devel pacakges that either # have no matching kernel installed or belong to a kernel that is to # be removed if not keepdevel: toremove.extend(self._get_old_kernel_devel(kernels, toremove)) for po in toremove: self.remove(po) def main(self): opts = self.doUtilConfigSetup() if not exactlyOne([opts.problems, opts.dupes, opts.leaves, opts.kernels, opts.orphans, opts.cleandupes]): print self.optparser.format_help() sys.exit(1) if self.conf.uid != 0: self.setCacheDir() if opts.problems: issues = self._find_missing_deps(self.rpmdb.returnPackages()) for (pkg, prob) in issues: print 'Package %s %s' % (pkg.hdr.sprintf(opts.qf), prob) if issues: sys.exit(1) else: print 'No Problems Found' sys.exit(0) if opts.dupes: dupes = self._find_installed_duplicates() for name, pkglists in dupes.items(): for pkglist in pkglists: for pkg in pkglist: print '%s' % pkg.hdr.sprintf(opts.qf) sys.exit(0) if opts.kernels: if self.conf.uid != 0: print "Error: Cannot remove kernels as a user, must be root" sys.exit(1) if int(opts.kernelcount) < 1: print "Error should keep at least 1 kernel!" sys.exit(100) self._remove_old_kernels(opts.kernelcount, opts.keepdevel) self.run_with_package_names.add('yum-utils') if hasattr(self, 'doUtilBuildTransaction'): errc = self.doUtilBuildTransaction() if errc: sys.exit(errc) else: try: self.buildTransaction() except yum.Errors.YumBaseError, e: self.logger.critical("Error building transaction: %s" % e) sys.exit(1) if len(self.tsInfo) < 1: print 'No old kernels to remove' sys.exit(0) sys.exit(self.doUtilTransaction()) if opts.leaves: leaves = self.rpmdb.returnLeafNodes() leaf_reg = re.compile(opts.leaf_regex, re.IGNORECASE) for po in sorted(leaves): if opts.all_nodes or \ self._should_show_leaf(po, leaf_reg, opts.exclude_devel, opts.exclude_bin): print po.hdr.sprintf(opts.qf) sys.exit(0) if opts.orphans: if not self.setCacheDir(): self.logger.error("Error: Could not make cachedir, exiting") sys.exit(50) try: for po in sorted(self.doPackageLists(pkgnarrow='extras').extras): print po.hdr.sprintf(opts.qf) except YumBaseError,e: self.logger.error("Error: %s" % str(e)) sys.exit(1) sys.exit(0) if opts.cleandupes: if os.geteuid() != 0: print "Error: Cannot remove packages as a user, must be root" sys.exit(1) if opts.noscripts: self.conf.tsflags.append('noscripts') self._remove_old_dupes() self.run_with_package_names.add('yum-utils') if hasattr(self, 'doUtilBuildTransaction'): errc = self.doUtilBuildTransaction() if errc: sys.exit(errc) else: try: self.buildTransaction() except yum.Errors.YumBaseError, e: self.logger.critical("Error building transaction: %s" % e) sys.exit(1) if len(self.tsInfo) < 1: print 'No duplicates to remove' sys.exit(0) sys.exit(self.doUtilTransaction()) if __name__ == '__main__': setup_locale() util = PackageCleanup() ����������������������������yum-utils-1.1.31/plugins/���������������������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0015227�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/README���������������������������������������������������������������������0000664�0000000�0000000�00000000246�11620520663�0016111�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is a directory of plugins to be used with yum 2.3.X and above. They may not all work at all times but they are good examples to start from for writing your own. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/aliases/�������������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0016650�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/aliases/aliases������������������������������������������������������������0000664�0000000�0000000�00000003400�11620520663�0020211�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ # These are some aliases that a lot of people might find useful, well those # who install yum-aliases plugin anyway :). Note that they require alias # recursion, which is the default. DEV --enablerepo=development UPT --enablerepo=updates-testing SRC --enablerepo=fedora-source --enablerepo=updates-source DEVSRC --enablerepo=development-source UPTSRC --enablerepo=updates-testing-source # Note that we/you can move to =X,Y in 3.2.9 onwards. DBG --enablerepo=fedora-debuginfo --enablerepo=updates-debuginfo DEVDBG --enablerepo=development-debuginfo UPTDBG --enablerepo=updates-testing-debuginfo ALLSRC SRC DEVSRC UPTSRC ALLDBG DBG DEVDBG UPTDBG ALL DEV UPT ALLSRC ALLDBG SEC --security CRIT --sec-severity=critical FORCE --skip-broken --disableexcludes=all DUPS --showduplicates up upgrade inst install in install rm remove down downgrade rein reinstall chk check-update upi updateinfo lp upi list lps upi list security ls list lsi ls installed lsa ls available lsu ls updates lupi list-updateinfo lssu SEC lsu force-install FORCE install force-inst FORCE inst force-upgrade FORCE upgrade force-up FORCE up force-update FORCE update v version h history hi history info hl history list hs history summary hp history package-list rl repolist g group gi groupinfo gl grouplist u updateinfo dbg-install DBG install dbg-inst DBG inst # These are some example aliases, which probably aren't worth enabling for # everyone. Mostly useful for people who use DEV / UPT a lot. # lsT UPT ls # lsD DEV ls # chkT UPT chk # chkD DEV chk # # lsuT lsT updates # lsuD lsD updates # # lssT SEC lsT # lssD SEC lsD # # lssuT SEC lsT updates # lssuD SEC lsD updates # # lupiT UPT lupi # lupiD DEV lupi # # upT UPT up # upD DEV up # # inT UPT inst # inD DEV inst ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/aliases/aliases.conf�������������������������������������������������������0000664�0000000�0000000�00000000473�11620520663�0021144�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 # conffile - config. file to use # <default> = /etc/yum/aliases.conf # recursive - whether aliases a resolved recursivly # <default> = True # register - register aliases a yum commands (so they are in yum help, TAB # complete things might pick them up then too). # <default> = False �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/aliases/aliases.py���������������������������������������������������������0000664�0000000�0000000�00000011663�11620520663�0020652�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # by James Antill from yum.plugins import TYPE_INTERACTIVE, PluginYumExit import time try: # yumex doesn't like import cli, but runs this from cli import CliError except: class CliError: # Never used by yumex pass from yumutils.i18n import _ requires_api_version = '2.1' plugin_type = (TYPE_INTERACTIVE,) class AliasedCommand: def __init__(self, cmd): self.cmd = cmd def getNames(self): return [self.cmd] def getUsage(self): return '' def getSummary(self): return '' def doCheck(self, base, basecmd, extcmds): if recursive: # shouldn't happen raise PluginYumExit('And error has occured for %s, please create a bug report') raise PluginYumExit('%s is an alias not a command, however recursive processing is turned off') doCommand = doCheck aliases = None conffile = None recursive = None def parse_aliases(conffile): aliases = {} for line in file(conffile): args = line.split() if len(args) < 2 or args[0][0] == '#': continue cmd = args.pop(0) aliases[cmd] = args return aliases def resolve_aliases(args, log, skip=0): need_rep = True while need_rep: need_rep = False num = skip for arg in args[skip:]: if arg and arg[0] != '-': break num += 1 if num >= len(args): # Only options break if args[num] not in aliases: continue cmd = args[num] log(4, 'ALIAS DONE(%s): %s' % (cmd, str(aliases[cmd]))) enum = num + 1 args[num:enum] = aliases[cmd] # Mostly works like the shell, so \ls does no alias lookup on ls if args[num][0] == '\\': args[num] = args[num][1:] else: need_rep = recursive class AliasCommand(AliasedCommand): created = 1198172281 def __init__(self): AliasedCommand.__init__(self, "alias") def getUsage(self): return "[ALIAS] [expansion]" def getSummary(self): return "Adds or lists aliases" def doCheck(self, base, basecmd, extcmds): if len(extcmds) > 1: # Add a new alias try: open(conffile, "a").close() except: base.logger.critical(_("Can't open aliases file: %s") % conffile) raise CliError def doCommand(self, base, basecmd, extcmds): if len(extcmds) > 1: # Add a new alias fo = open(conffile, "a") fo.write(_("\n# Alias added on %s\n%s\n") % (time.ctime(), ' '.join(extcmds))) fo.close() return 0, [basecmd + ' done'] if len(extcmds) == 1: # Show just a single alias cmd = extcmds[0] if cmd not in aliases: return 1, [_("%s, no match for %s") % (basecmd, cmd)] args = [cmd] resolve_aliases(args, lambda x,y: base.verbose_logger.debug(y)) print _("Alias %s = %s") % (cmd, " ".join(args)) return 0, [basecmd + ' done'] for cmd in sorted(aliases.keys()): args = aliases[cmd][:] resolve_aliases(args, lambda x,y: base.verbose_logger.debug(y)) print _("Alias %s = %s") % (cmd, " ".join(args)) return 0, [basecmd + ' done'] def needTs(self, base, basecmd, extcmds): return False def config_hook(conduit): global aliases, conffile, recursive conffile = conduit.confString('main', 'conffile', default='/etc/yum/aliases.conf') recursive = conduit.confBool('main', 'recursive', default=True) register = conduit.confBool('main', 'register', default=False) conduit.registerCommand(AliasCommand()) if hasattr(conduit, 'registerPackageName'): conduit.registerPackageName("yum-plugin-aliases") aliases = parse_aliases(conffile) if register: for cmd in aliases: conduit.registerCommand(AliasedCommand(cmd)) def args_hook(conduit): # Skip the yum cmd itself resolve_aliases(args=conduit.getArgs(), log=conduit.info) �����������������������������������������������������������������������������yum-utils-1.1.31/plugins/allowdowngrade/������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0020240�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/allowdowngrade/allowdowngrade.conf�����������������������������������������0000664�0000000�0000000�00000000021�11620520663�0024111�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/allowdowngrade/allowdowngrade.py�������������������������������������������0000664�0000000�0000000�00000002562�11620520663�0023630�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # by Panu Matilainen <pmatilai@laiskiainen.org> from yum.plugins import TYPE_INTERACTIVE from rpm import RPMPROB_FILTER_OLDPACKAGE requires_api_version = '2.4' plugin_type = (TYPE_INTERACTIVE,) def config_hook(conduit): parser = conduit.getOptParser() parser.add_option('--allow-downgrade', dest='allow_downgrade', action='store_true', default=False, help='Allow packages to be downgraded') def postresolve_hook(conduit): opts, args = conduit.getCmdLine() if opts.allow_downgrade: tsInfo = conduit.getTsInfo() tsInfo.probFilterFlags.append(RPMPROB_FILTER_OLDPACKAGE) ����������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/auto-update-debuginfo/�����������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0021417�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/auto-update-debuginfo/auto-update-debuginfo.conf���������������������������0000664�0000000�0000000�00000000021�11620520663�0026447�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/auto-update-debuginfo/auto-update-debuginfo.py�����������������������������0000664�0000000�0000000�00000007314�11620520663�0026166�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # by James Antill <james@fedoraproject.org> # # This plugin enables the debuginfo repos. if you have a debuginfo rpm # installed. from yum.plugins import TYPE_CORE import os, os.path import re import fnmatch requires_api_version = '2.1' plugin_type = (TYPE_CORE,) def _check_man_disable(mdrs, di): """ Was this repo. manually disabled. """ for match in mdrs: if match(di): return True return False def enable_debuginfo_repos(yb, conduit): mdrs = set() opts, args = conduit.getCmdLine() if opts is not None and hasattr(opts.repos) : for opt, repoexp in opts.repos: if opt == '--disablerepo': mdrs.add(repoexp) mdrs = [re.compile(fnmatch.translate(x)).match for x in mdrs] baserepos = {} for repo in yb.repos.listEnabled(): baserepos[repo.id] = repo for repoid in baserepos: di = '%s-debuginfo' % repoid if di in baserepos: continue if _check_man_disable(mdrs, di): continue baserepo = baserepos[repoid] for r in yb.repos.findRepos(di): conduit.info(3, 'Enabling %s: %s' % (r.id, r.name)) r.enable() r.skip_if_unavailable = True # Note: This is shared with debuginfo-install for opt in ['repo_gpgcheck', 'gpgcheck', 'cost']: if hasattr(r, opt): setattr(r, opt, getattr(baserepo, opt)) def _read_cached(cfname): try: fo = open(cfname) crpmdbv = fo.readline()[:-1] cnum = int(fo.readline()) return crpmdbv, cnum except: return None, None def _write_cached(cfname, rpmdbv, num): cdname = os.path.dirname(cfname) if not os.access(cdname, os.W_OK): if os.path.exists(cdname): return try: os.makedirs(cdname) except (IOError, OSError), e: return try: fo = open(cfname + ".tmp", "w") except (IOError, OSError), e: return fo.write(str(rpmdbv)) fo.write('\n') fo.write(str(num)) fo.write('\n') fo.close() os.rename(cfname + ".tmp", cfname) def prereposetup_hook(conduit): yb = conduit._base caching = hasattr(yb.rpmdb, 'simpleVersion') num = None if caching: cfname = yb.conf.persistdir + '/plugins/auto-update-debuginfo/num' crpmdbv, num = _read_cached(cfname) if num is not None: rpmdbv = yb.rpmdb.simpleVersion(main_only=True)[0] if rpmdbv != crpmdbv: num = None if num is None: num = len(yb.rpmdb.returnPackages(patterns=['*-debuginfo'])) if caching: rpmdbv = yb.rpmdb.simpleVersion(main_only=True)[0] _write_cached(cfname, rpmdbv, num) if num: if hasattr(conduit, 'registerPackageName'): conduit.registerPackageName("yum-plugin-auto-update-debug-info") conduit.info(3, "Found %d installed debuginfo package(s)" % num) enable_debuginfo_repos(yb, conduit) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/basearchonly/��������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0017701�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/basearchonly/basearchonly.conf���������������������������������������������0000664�0000000�0000000�00000000331�11620520663�0023217�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 [x86] whitelist = firefox, libflashsupport, wine* [ppc] whitelist = kernel, gdb, frysk, systemtap, ltrace, strace, valgrind [sparc] whitelist = kernel, gdb, frysk, systemtap, ltrace, strace, valgrind �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/basearchonly/basearchonly.py�����������������������������������������������0000664�0000000�0000000�00000004612�11620520663�0022730�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Copyright 2007 by Adel Gadllah import re, os from fnmatch import fnmatch from yum.plugins import TYPE_INTERACTIVE requires_api_version = '2.3' plugin_type = TYPE_INTERACTIVE def exclude_hook(conduit): # Only install i386 packages when told to do so if os.uname()[-1] == 'x86_64': basearch(conduit, "x86", "i?86$") # Only install ppc64 packages when told to do so if os.uname()[-1] == 'ppc64': basearch(conduit, "ppc", "ppc64$") # Only install sparc64 packages when told to do so if os.uname()[-1] == 'sparc64': basearch(conduit, "sparc", "sparc64$") def basearch(conduit, barch, excludearchP): exclude = [] whitelist = [] skippkg = 0 conf , cmd = conduit.getCmdLine() if not cmd: return if cmd[0] != "install": return packageList = conduit.getPackages() excludearch = re.compile(excludearchP) """ get whitelist from config file """ conflist = conduit.confString(barch, 'whitelist') if conflist: tmp = conflist.split(",") for confitem in tmp: whitelist.append(confitem.strip()) """ decide which packages we want to exclude """ for userpkg in cmd: skippkg = 0 for wlpkg in whitelist: if fnmatch(userpkg,wlpkg): skippkg = 1 if not skippkg and not excludearch.search(userpkg): exclude.append(userpkg) """ exclude the packages """ for pkg in packageList: if pkg.name in exclude and excludearch.search(pkg.arch): conduit.delPackage(pkg) conduit.info(3, "--> excluded %s.%s" % (pkg.name, pkg.arch)) ����������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/changelog/�����������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0017156�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/changelog/changelog.conf���������������������������������������������������0000664�0000000�0000000�00000000257�11620520663�0021760�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 # Set to 'pre' or 'post' to see changes before or after transaction when=pre # Set to true, to always get the output (removes the cmd line arg) always=false �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/changelog/changelog.py�����������������������������������������������������0000664�0000000�0000000�00000025045�11620520663�0021465�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # by Panu Matilainen <pmatilai@laiskiainen.org> # James Antill <james@and.org> # # TODO: # - In 'pre' mode we could get the changelogs from rpmdb thus avoiding # the costly 'otherdata' import. import time from rpmUtils.miscutils import splitFilename from yum.plugins import TYPE_INTERACTIVE from yum.plugins import PluginYumExit from yum import logginglevels import logging from yum.i18n import to_unicode, to_str from yum.update_md import UpdateMetadata try: import dateutil.parser as dateutil_parser except ImportError: dateutil_parser = None requires_api_version = '2.5' plugin_type = (TYPE_INTERACTIVE,) origpkgs = {} changelog = False orignots = set() also_updateinfo = False updateinfo = False def changelog_delta(pkg, olddate): out = [] for date, author, message in pkg.returnChangelog(): if int(date) > olddate: out.append("* %s %s\n%s" % (time.ctime(int(date)), author, message)) return out def srpmname(pkg): n,v,r,e,a = splitFilename(pkg.returnSimple('sourcerpm')) return n def _show_changes_changelog(conduit, srpms): for name in sorted(srpms.keys()): rpms = [] if name in origpkgs: for rpm in srpms[name]: rpms.append("%s" % rpm) done = False kvf = conduit._base.fmtKeyValFill rpm_names = ", ".join(sorted(rpms)) for line in changelog_delta(srpms[name][0], origpkgs[name]): if not done: conduit.info(2,kvf("ChangeLog for: ", rpm_names)) done = True conduit.info(2, "%s\n" % to_unicode(line)) if not done: conduit.info(2, "%s\n" % kvf("** No ChangeLog for: ",rpm_names)) def _show_changes_updateinfo(conduit): for note in sorted(orignots): conduit.info(2, note) def show_changes(conduit, msg): # Group by src.rpm name, not binary to avoid showing duplicate changelogs # for subpackages srpms = {} ts = conduit.getTsInfo() for tsmem in ts.getMembers(): if not tsmem.updates: continue name = srpmname(tsmem.po) if name in srpms: srpms[name].append(tsmem.po) else: srpms[name] = [tsmem.po] conduit.info(2, "\n%s\n" % msg) if changelog: _show_changes_changelog(conduit, srpms) if updateinfo: _show_changes_updateinfo(conduit) class ChangeLogCommand: def getNames(self): return ['changelog', 'ChangeLog'] def getUsage(self): return "<date>|<number>|all [PACKAGE|all|installed|updates|extras|obsoletes|recent]" def getSummary(self): return """\ Display changelog data, since a specified time, on a group of packages""" def doCheck(self, base, basecmd, extcmds): pass def changelog(self, pkg): if self._since_all: for date, author, message in pkg.returnChangelog(): yield "* %s %s\n%s" % (time.ctime(int(date)), author, message) return if self._since_num is not None: num = self._since_num for date, author, message in pkg.returnChangelog(): if num <= 0: return num -= 1 yield "* %s %s\n%s" % (time.ctime(int(date)), author, message) return if True: for date, author, message in pkg.returnChangelog(): if int(date) < self._since_tt: return yield "* %s %s\n%s" % (time.ctime(int(date)), author, message) def show_data(self, msg, pkgs, name): done = False for pkg in pkgs: self._pkgs += 1 if pkg.sourcerpm in self._done_spkgs: continue self._spkgs += 1 for line in self.changelog(pkg): if pkg.sourcerpm not in self._done_spkgs: if not self._done_spkgs: msg('') if self._since_all: msg('Listing all changelogs') elif self._since_num is not None: sn = "s" if self._since_num == 1: sn = "" msg('Listing %d changelog%s' % (self._since_num,sn)) else: msg('Listing changelogs since ' + str(self._since_dto.date())) msg('') if not done: msg("%s %s %s" % ('=' * 20, name, '=' * 20)) done = True self._done_spkgs[pkg.sourcerpm] = True msg('%-40.40s %s' % (pkg, pkg.repoid)) self._changelogs += 1 msg(to_unicode(line)) msg('') def doCommand(self, base, basecmd, extcmds): logger = logging.getLogger("yum.verbose.main") def msg(x): logger.log(logginglevels.INFO_2, x) def msg_warn(x): logger.warn(x) self._done_spkgs = {} self._pkgs = 0 self._spkgs = 0 self._changelogs = 0 self._since_all = False self._since_dto = None self._since_tt = None self._since_num = None if not len(extcmds): return 1, [basecmd + " " + self.getUsage()] since = extcmds[0] extcmds = extcmds[1:] if since == 'all': self._since_all = True else: try: num = int(since) if num <= 0: raise ValueError self._since_num = num except: if dateutil_parser is None: msg = "Dateutil module not available, so can't parse dates" raise PluginYumExit(msg) try: self._since_dto = dateutil_parser.parse(since, fuzzy=True) except ValueError: msg = "Argument -- %s -- is not \"all\", a positive number or a date" % since raise PluginYumExit(msg) try: tt = self._since_dto.timetuple() self._since_tt = time.mktime(tt) except ValueError, e: msg = "Argument -- %s -- is not valid: %s" % (since, to_str(e)) raise PluginYumExit(msg) ypl = base.returnPkgLists(extcmds) self.show_data(msg, ypl.installed, 'Installed Packages') self.show_data(msg, ypl.available, 'Available Packages') self.show_data(msg, ypl.extras, 'Extra Packages') self.show_data(msg, ypl.updates, 'Updated Packages') self.show_data(msg, ypl.obsoletes, 'Obsoleting Packages') self.show_data(msg, ypl.recent, 'Recent Packages') ps = sps = cs = "" if self._pkgs != 1: ps = "s" if self._spkgs != 1: sps = "s" if self._changelogs != 1: cs = "s" return 0, [basecmd + ' stats. %d pkg%s, %d source pkg%s, %d changelog%s' % (self._pkgs, ps, self._spkgs, sps, self._changelogs, cs)] def needTs(self, base, basecmd, extcmds): if len(extcmds) and extcmds[0] == 'installed': return False return True def config_hook(conduit): conduit.registerCommand(ChangeLogCommand()) parser = conduit.getOptParser() if parser: if conduit.confBool('main', 'always', default=False): global changelog changelog = True if conduit.confBool('main', 'updateinfo', default=True): global also_updateinfo also_updateinfo = True if (also_updateinfo and conduit.confBool('main', 'updateinfo_always', default=changelog)): global updateinfo updateinfo = True if changelog and (not also_updateinfo or updateinfo): return if hasattr(parser, 'plugin_option_group'): parser = parser.plugin_option_group parser.add_option('--changelog', action='store_true', help='Show changelog delta of updated packages') def _setup_changelog_from_cmdline(conduit): global changelog global updateinfo opts, args = conduit.getCmdLine() if opts: if not changelog: changelog = opts.changelog if not updateinfo: updateinfo = opts.changelog def postresolve_hook(conduit): _setup_changelog_from_cmdline(conduit) if not (changelog or updateinfo) or conduit.resultcode == 1: return # Find currently installed versions of packages we're about to update ts = conduit.getTsInfo() rpmdb = conduit.getRpmDB() if updateinfo: repos = set() for tsmem in ts.getMembers(): if tsmem.po.repoid == 'installed': continue repos.add(tsmem.po.repo) mdi = UpdateMetadata(repos=list(repos)) for tsmem in ts.getMembers(): for po in rpmdb.searchNevra(name=tsmem.po.name, arch=tsmem.po.arch): times = po['changelogtime'] try: n,v,r,e,a = splitFilename(po.sourcerpm) except TypeError: n = po.name if len(times) == 0: # deal with packages without changelog origpkgs[n] = 0 else: origpkgs[n] = times[0] if updateinfo: for (pkgtup, notice) in mdi.get_applicable_notices(po.pkgtup): orignots.add(notice) if conduit.confString('main', 'when', default='post') == 'pre': show_changes(conduit, 'Changes in packages about to be updated:') def posttrans_hook(conduit): if not (changelog or updateinfo): return if conduit.confString('main', 'when', default='post') == "post": show_changes(conduit, 'Changes in updated packages:') �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/downloadonly/��������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0017740�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/downloadonly/downloadonly.conf���������������������������������������������0000664�0000000�0000000�00000000021�11620520663�0023311�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/downloadonly/downloadonly.py�����������������������������������������������0000664�0000000�0000000�00000003503�11620520663�0023024�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # by Menno Smits from yum.plugins import PluginYumExit, TYPE_INTERACTIVE requires_api_version = '2.1' plugin_type = (TYPE_INTERACTIVE,) def config_hook(conduit): parser = conduit.getOptParser() if hasattr(parser, 'plugin_option_group'): parser = parser.plugin_option_group parser.add_option('', '--downloadonly', dest='dlonly', action='store_true', default=False, help="don't update, just download") parser.add_option('', '--downloaddir', dest='dldir', action='store', default=None, help="specifies an alternate directory to store packages") def postreposetup_hook(conduit): opts, commands = conduit.getCmdLine() if opts.dldir: repos = conduit.getRepos() rlist = repos.listEnabled() for repo in rlist: repo.setAttribute('pkgdir',opts.dldir) def postdownload_hook(conduit): opts, commands = conduit.getCmdLine() # Don't die on errors, or we'll never see them. if not conduit.getErrors() and opts.dlonly: raise PluginYumExit('exiting because --downloadonly specified ') ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/fastestmirror/�������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0020133�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/fastestmirror/ChangeLog����������������������������������������������������0000664�0000000�0000000�00000003713�11620520663�0021711�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������* Sat Apr 24 2010 Luke Macken <lmacken@redhat.com> - 0.3.3 - Patch from Kris Ven to add a 'include_only' option * Dec 17 2007 Luke Macken <lmacken@redhat.com> - 0.3.2 - Only display our mirrors if we have any - Strip any username:passwords from our mirrors hostname before we display it * Dec 3 2007 Luke Macken <lmacken@redhat.com> - 0.3.1 - Support multiple excludes * Dec 3 2007 Luke Macken <lmacken@redhat.com> - 0.3.0 - Throttle threads based on 'maxthreads' configuration option (rh#227772) - Add an exclude configuration option (rh#407471) - Actually display the fastest mirrors * Aug 8 2007 Luke Macken <lmacken@redhat.com> - 0.2.8 - Add patch from Christopher Aillon to fail quietly when fastestmirror does not have write access to the timed hostfile. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=237034 * Apr 19 2007 Luke Macken <lmacken@redhat.com> - 0.2.7 - Remove TYPE_{INTERFACE,INTERACTIVE} * Oct 23 2006 Luke Macken <lmacken@redhat.com> - 0.2.6 - Make the instructions less misleading - Support TYPE_INTERFACE for API_VERSION <= 2.3 - Remove cached mirror list in the clean_hook * Jun 14 2006 Luke Macken <lmacken@redhat.com> - 0.2.5 - Use new yum 2.9.0 api * Feb 06 2006 Luke Macken <lmacken@redhat.com> - 0.2.4 - Only write the timedhost file if we've re-pinged the mirrors * Feb 02 2006 Luke Macken <lmacken@redhat.com> - 0.2.3 - Added 'maxhostfileage' option to specify how many days to keep the hostfile * Nov 26 2005 Luke Macken <lmacken@redhat.com> - 0.2.2 - Merge Panu's persistent changes to cache timings - Add 'hostfilepath' as configuration string * Nov 26 2005 Karanbir Singh <kbsingh@centos.org> - 0.2.1 - Work out the mirror URL type and do something worthwhile with it - Test for non standard ports, if used. - file:// url's will always be timed = 0 * Nov 16 2005 Luke Macken <lmacken@redhat.com> - 0.2 - Throttle mirrors before metadata download (thanks to Panu) * Aug 12 2005 Luke Macken <lmacken@redhat.com> - 0.1 - Initial release �����������������������������������������������������yum-utils-1.1.31/plugins/fastestmirror/fastestmirror-asyncore/��������������������������������������0000775�0000000�0000000�00000000000�11620520663�0024660�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/fastestmirror/fastestmirror-asyncore/fastestmirror-asyncore.py�������������0000664�0000000�0000000�00000026565�11620520663�0031775�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/python # This is a threadless prototype version of fastestmirror # # Version: 0.3.2 # # A plugin for the Yellowdog Updater Modified which sorts each repo's # mirrorlist by connection speed prior to download. # # To install this plugin, just drop it into /usr/lib/yum-plugins, and # make sure you have 'plugins=1' in your /etc/yum.conf. You also need to # create the following configuration file, if not installed through an RPM: # # /etc/yum/pluginconf.d/fastestmirror.conf: # [main] # enabled=1 # verbose=1 # socket_timeout=3 # hostfilepath=/var/cache/yum/timedhosts # maxhostfileage=10 # #exclude=.gov, facebook # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # (C) Copyright 2005 Luke Macken <lmacken@redhat.com> # """ B{FastestMirror} is a Yum plugin which sorts each repository's mirrorlist according to connection speed prior to download. """ import os import sys import time import socket import urlparse import datetime import asyncore from yum.plugins import TYPE_CORE requires_api_version = '2.5' plugin_type = (TYPE_CORE,) verbose = False socket_timeout = 1 timedhosts = {} hostfilepath = '' maxhostfileage = 10 loadcache = False exclude = None def init_hook(conduit): """ This function initiliazes the variables required for running B{fastestmirror} module. The variables are initiliazed from the main section of the plugin file. There are no parameteres for this function. It uses global variables to communicate with other functions. This function refers: - L{get_hostfile_age} @param verbose : Verbosity of output. @type verbose : Boolean @param socket_timeout : The default timeout for a socket connection. @type socket_timeout : Integer @param hostfilepath : Absolute path to the plugin's cache file. @type hostfilepath : String @param maxhostfileage : Maximum age of the plugin's cache file. @type maxhostfileage : Integer @param loadcache : Fastest Mirrors to be loaded from plugin's cache or not. @type loadcache : Boolean """ global verbose, socket_timeout, hostfilepath, maxhostfileage, loadcache global exclude verbose = conduit.confBool('main', 'verbose', default=False) socket_timeout = conduit.confInt('main', 'socket_timeout', default=3) hostfilepath = conduit.confString('main', 'hostfilepath', default='/var/cache/yum/timedhosts') maxhostfileage = conduit.confInt('main', 'maxhostfileage', default=10) exclude = conduit.confString('main', 'exclude', default=None) # If the file hostfilepath exists and is newer than the maxhostfileage, # then load the cache. if os.path.exists(hostfilepath) and get_hostfile_age() < maxhostfileage: loadcache = True def clean_hook(conduit): """ This function cleans the plugin cache file if exists. The function is called when C{yum [options] clean [plugins | all ]} is executed. """ if os.path.exists(hostfilepath): conduit.info(2, "Cleaning up list of fastest mirrors") os.unlink(hostfilepath) # Get the hostname from a url, stripping away any usernames/passwords host = lambda mirror: mirror.split('/')[2].split('@')[-1] def postreposetup_hook(conduit): """ This function is called after Yum has initiliazed all the repository information. If cache file exists, this function will load the mirror speeds from the file, else it will determine the fastest mirrors afresh and write them back to the cache file. There are no parameteres for this function. It uses global variables to communicate with other functions. This function refers: - L{read_timedhosts()} - L{FastestMirror.get_mirrorlist()} - L{write_timedhosts()} @param loadcache : Fastest Mirrors to be loaded from plugin's cache file or not. @type loadcache : Boolean """ global loadcache, exclude if loadcache: conduit.info(2, "Loading mirror speeds from cached hostfile") read_timedhosts() else: conduit.info(2, "Determining fastest mirrors") repomirrors = {} repos = conduit.getRepos() for repo in repos.listEnabled(): if str(repo) not in repomirrors: repomirrors[str(repo)] = FastestMirror(repo.urls).get_mirrorlist() if exclude: for mirror in repomirrors[str(repo)]: if filter(lambda exp: exp in host(mirror), exclude.replace(',', ' ').split()): conduit.info(2, "Excluding mirror: %s" % host(mirror)) repomirrors[str(repo)].remove(mirror) repo.urls = repomirrors[str(repo)] if len(repo.urls): conduit.info(2, " * %s: %s" % (str(repo), host(repo.urls[0]))) repo.failovermethod = 'priority' repo.check() repo.setupGrab() if not loadcache: write_timedhosts() def read_timedhosts(): """ This function reads the time and hostname from the plugin's cache file and store them in C{timedhosts}. There are no parameteres for this function. It uses global variables to communicate with other functions. This function is referred by: - L{postreposetup_hook()} @param timedhosts : A list of time intervals to reach different hosts corresponding to the mirrors. The index of the list are hostnames. C{timedhosts[host] = time}. @type timedhosts : List """ global timedhosts try: hostfile = file(hostfilepath) for line in hostfile.readlines(): host, time = line.split() timedhosts[host] = float(time) hostfile.close() except IOError: pass def write_timedhosts(): """ This function writes the plugin's cache file with the entries in the C{timedhosts} list. There are no parameteres for this function. It uses global variables to communicate with other functions. This function is referred by: - L{postreposetup_hook()} @param timedhosts : A list of time intervals to reach different hosts corresponding to the mirrors. The index of the list are hostnames. C{timedhosts[host] = time}. @type timedhosts : List """ global timedhosts try: hostfile = file(hostfilepath, 'w') for host in timedhosts.keys(): hostfile.write('%s %s\n' % (host, timedhosts[host])) hostfile.close() except IOError: pass def get_hostfile_age(): """ This function returns the current age of the plugin's cache file. There are no parameteres for this function. It uses global variables to communicate with other functions. This function is referred by: - L{init_hook()} @param hostfilepath : Absolute path to the plugin's cache file. @type hostfilepath : String @rtype: Integer @return: The age of the plugin's cache file. """ global hostfilepath timestamp = datetime.datetime.fromtimestamp(os.path.getmtime(hostfilepath)) return (datetime.datetime.now() - timestamp).days class FastestMirror: """ This is the helper class of B{fastestmirror} module. This class does all the processing of the response time calculation for all the mirrors of all the enabled Yum repositories. """ def __init__(self, mirrorlist): """ This is the initiliazer function of the B{L{FastestMirror}} class. @param mirrorlist : A list of mirrors for an enabled repository. @type mirrorlist : List """ self.mirrorlist = mirrorlist self.results = {} socket.setdefaulttimeout(socket_timeout) def get_mirrorlist(self): """ This function pings/polls all the mirrors in the list C{FastestMirror.mirrorlist} and returns the sorted list of mirrors according to the increasing response time of the mirrors. This function refers: - L{FastestMirror._poll_mirrors()} This function is referred by: - L{postreposetup_hook()} - L{main()} @rtype: List @return: The list of mirrors sorted according to the increasing response time. """ self._poll_mirrors() mirrors = [(v, k) for k, v in self.results.items()] mirrors.sort() return [x[1] for x in mirrors] def _poll_mirrors(self): """ This function uses L{PollThread} class to ping/poll individual mirror in parallel. This function refers: - L{PollThread.run()} This function is referred by: - L{FastestMirror.get_mirrorlist()} """ for mirror in self.mirrorlist: AsyncMirrorConn(self, mirror) count = len(self.mirrorlist) if count > 10: count = 10 asyncore.loop(timeout=socket_timeout, count=count) class AsyncMirrorConn(asyncore.dispatcher): def __init__(self, parent, mirror): asyncore.dispatcher.__init__(self) self.parent = parent self.mirror = mirror self.host = urlparse.urlparse(mirror)[1] self.create_socket(socket.AF_INET, socket.SOCK_STREAM) self.time_before = time.time() try: self.connect((self.host, 80)) except: if verbose: print " * %s : dead" % self.host self.close() def handle_connect(self): result = time.time() - self.time_before self.handle_close() self._add_result(self.mirror, self.host, result) def handle_close(self): self.close() def handle_read(self): pass def handle_write(self): pass def _add_result(self, mirror, host, time): """ This function is called by L{PollThread.run()} to add details of a mirror in C{FastestMirror.results} dictionary. This function is referred by: - L{PollThread.run()} @param mirror : The mirror that was polled for response time. @type mirror : String @param host : The hostname of the mirror. @type host : String @param time : The response time of the mirror. @type time : Integer @param timedhosts : A list of time intervals to reach different hosts corresponding to the mirrors. The index of the list are hostnames. @type timedhosts : List """ global timedhosts if verbose: print " * %s : %f secs" % (host, time) self.parent.results[mirror] = time timedhosts[host] = time def main(): """ This is the main function for B{fastestmirror} module. This function explains the usage of B{fastestmirror} module. Also parses the command line arguments. This function refers: - L{FastestMirror.get_mirrorlist()} """ global verbose verbose = True if len(sys.argv) == 1: print "Usage: %s <mirror1> [mirror2] ... [mirrorN]" % sys.argv[0] sys.exit(-1) del(sys.argv[0]) mirrorlist = [] for arg in sys.argv: mirrorlist.append(arg) print "Result: " + str(FastestMirror(mirrorlist).get_mirrorlist()) if __name__ == '__main__': main() �������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/fastestmirror/fastestmirror.conf�������������������������������������������0000664�0000000�0000000�00000000427�11620520663�0023711�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 verbose=0 always_print_best_host = true socket_timeout=3 # Relative paths are relative to the cachedir (and so works for users as well # as root). hostfilepath=timedhosts.txt maxhostfileage=10 maxthreads=15 #exclude=.gov, facebook #include_only=.nl,.de,.uk,.ie �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/fastestmirror/fastestmirror.py���������������������������������������������0000664�0000000�0000000�00000043760�11620520663�0023423�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/python # # Version: 0.3.3 # # A plugin for the Yellowdog Updater Modified which sorts each repo's # mirrorlist by connection speed prior to download. # # To install this plugin, just drop it into /usr/lib/yum-plugins, and # make sure you have 'plugins=1' in your /etc/yum.conf. You also need to # create the following configuration file, if not installed through an RPM: # # /etc/yum/pluginconf.d/fastestmirror.conf: # [main] # enabled=1 # verbose=1 # socket_timeout=3 # hostfilepath=timedhosts # maxhostfileage=10 # maxthreads=15 # #exclude=.gov, facebook # #include_only=.nl,.de,.uk,.ie # #prefer=your.favourite.mirror # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # (C) Copyright 2005 Luke Macken <lmacken@redhat.com> # """ B{FastestMirror} is a Yum plugin which sorts each repository's mirrorlist according to connection speed prior to download. """ import os import sys import time import socket import string import urlparse import datetime import threading import re from yum.plugins import TYPE_CORE requires_api_version = '2.5' plugin_type = (TYPE_CORE,) verbose = False always_print_best_host = True socket_timeout = 3 timedhosts = {} hostfilepath = '' maxhostfileage = 10 loadcache = False maxthreads = 15 exclude = None include_only = None prefer = None downgrade_ftp = True done_sock_timeout = False done_repos = set() def init_hook(conduit): """ This function initiliazes the variables required for running B{fastestmirror} module. The variables are initiliazed from the main section of the plugin file. There are no parameteres for this function. It uses global variables to communicate with other functions. This function refers: - L{get_hostfile_age} @param verbose : Verbosity of output. @type verbose : Boolean @param socket_timeout : The default timeout for a socket connection. @type socket_timeout : Integer @param hostfilepath : Absolute path to the plugin's cache file. @type hostfilepath : String @param maxhostfileage : Maximum age of the plugin's cache file. @type maxhostfileage : Integer @param loadcache : Fastest Mirrors to be loaded from plugin's cache or not. @type loadcache : Boolean """ global verbose, socket_timeout, hostfilepath, maxhostfileage, loadcache global maxthreads, exclude, include_only, prefer, downgrade_ftp, always_print_best_host if hasattr(conduit, 'registerPackageName'): conduit.registerPackageName("yum-plugin-fastestmirror") verbose = conduit.confBool('main', 'verbose', default=False) always_print_best_host = conduit.confBool('main', 'always_print_best_host', default=True) socket_timeout = conduit.confInt('main', 'socket_timeout', default=3) hostfilepath = conduit.confString('main', 'hostfilepath', default='timedhosts') maxhostfileage = conduit.confInt('main', 'maxhostfileage', default=10) maxthreads = conduit.confInt('main', 'maxthreads', default=10) exclude = conduit.confString('main', 'exclude', default=None) include_only = conduit.confString('main', 'include_only', default=None) prefer = conduit.confString('main', 'prefer', default='no.prefer.mirror') downgrade_ftp = conduit.confBool('main', 'downgrade_ftp', default=True) def clean_hook(conduit): """ This function cleans the plugin cache file if exists. The function is called when C{yum [options] clean [plugins | all ]} is executed. """ global hostfilepath if hostfilepath and hostfilepath[0] != '/': hostfilepath = conduit._base.conf.cachedir + '/' + hostfilepath if os.path.exists(hostfilepath): conduit.info(2, "Cleaning up list of fastest mirrors") try: os.unlink(hostfilepath) except Exception, e: conduit.info(2, "Cleanup failed: %s" % e) # Get the hostname from a url, stripping away any usernames/passwords host = lambda mirror: mirror.split('/')[2].split('@')[-1] def _can_write_results(fname): if not os.path.exists(fname): try: hostfile = file(hostfilepath, 'w') return True except: return False return os.access(fname, os.W_OK) def _len_non_ftp(urls): ''' Count the number of urls, which aren't ftp. ''' num = 0 for url in urls: if url.startswith("ftp:"): continue num += 1 return num def postreposetup_hook(conduit): """ This function is called after Yum has initiliazed all the repository information. If cache file exists, this function will load the mirror speeds from the file, else it will determine the fastest mirrors afresh and write them back to the cache file. There are no parameteres for this function. It uses global variables to communicate with other functions. This function refers: - L{read_timedhosts()} - L{FastestMirror.get_mirrorlist()} - L{write_timedhosts()} @param loadcache : Fastest Mirrors to be loaded from plugin's cache file or not. @type loadcache : Boolean """ global loadcache, exclude, include_only, prefer, hostfilepath if hostfilepath and hostfilepath[0] != '/': hostfilepath = conduit._base.conf.cachedir + '/' + hostfilepath # If the file hostfilepath exists and is newer than the maxhostfileage, # then load the cache. if os.path.exists(hostfilepath) and get_hostfile_age() < maxhostfileage: loadcache = True opts, commands = conduit.getCmdLine() if conduit._base.conf.cache or not _can_write_results(hostfilepath): return if done_repos: conduit.info(2, "Checking for new repos for mirrors") elif loadcache: conduit.info(2, "Loading mirror speeds from cached hostfile") read_timedhosts() else: conduit.info(2, "Determining fastest mirrors") repomirrors = {} repos = conduit.getRepos() # First do all of the URLs as one big list, this way we get as much # parallelism as possible (if we need to do the network tests). all_urls = [] for repo in repos.listEnabled(): if repo.id in done_repos: continue if downgrade_ftp and _len_non_ftp(repo.urls) == 1: continue if len(repo.urls) == 1: continue all_urls.extend(repo.urls) all_urls = FastestMirror(all_urls).get_mirrorlist() # This should now just be looking up the cached times. for repo in repos.listEnabled(): if repo.id in done_repos: continue if downgrade_ftp and _len_non_ftp(repo.urls) == 1: repo.urls = sorted(repo.urls, reverse=True) # ftp comes before http continue if len(repo.urls) == 1: continue if str(repo) not in repomirrors: repomirrors[str(repo)] = FastestMirror(repo.urls).get_mirrorlist() if include_only: def includeCheck(mirror): if filter(lambda exp: re.search(exp, host(mirror)), include_only.replace(',', ' ').split()): conduit.info(2, "Including mirror: %s" % host(mirror)) return True return False repomirrors[str(repo)] = filter(includeCheck,repomirrors[str(repo)]) else: if exclude: def excludeCheck(mirror): if filter(lambda exp: re.search(exp, host(mirror)), exclude.replace(',', ' ').split()): conduit.info(2, "Excluding mirror: %s" % host(mirror)) return False return True repomirrors[str(repo)] = filter(excludeCheck,repomirrors[str(repo)]) repo.urls = repomirrors[str(repo)] if len(repo.urls): lvl = 3 if always_print_best_host: lvl = 2 conduit.info(lvl, " * %s: %s" % (str(repo), host(repo.urls[0]))) repo.failovermethod = 'priority' repo.check() repo.setupGrab() done_repos.add(repo.id) if done_sock_timeout: socket.setdefaulttimeout(None) if not loadcache: write_timedhosts() def read_timedhosts(): """ This function reads the time and hostname from the plugin's cache file and store them in C{timedhosts}. There are no parameteres for this function. It uses global variables to communicate with other functions. This function is referred by: - L{postreposetup_hook()} @param timedhosts : A list of time intervals to reach different hosts corresponding to the mirrors. The index of the list are hostnames. C{timedhosts[host] = time}. @type timedhosts : List """ global timedhosts try: hostfile = file(hostfilepath) for line in hostfile.readlines(): host, time = line.split() timedhosts[host] = float(time) hostfile.close() except IOError: pass def write_timedhosts(): """ This function writes the plugin's cache file with the entries in the C{timedhosts} list. There are no parameteres for this function. It uses global variables to communicate with other functions. This function is referred by: - L{postreposetup_hook()} @param timedhosts : A list of time intervals to reach different hosts corresponding to the mirrors. The index of the list are hostnames. C{timedhosts[host] = time}. @type timedhosts : List """ global timedhosts try: hostfile = file(hostfilepath, 'w') for host in timedhosts: hostfile.write('%s %s\n' % (host, timedhosts[host])) hostfile.close() except IOError: pass def get_hostfile_age(): """ This function returns the current age of the plugin's cache file. There are no parameteres for this function. It uses global variables to communicate with other functions. This function is referred by: - L{init_hook()} @param hostfilepath : Absolute path to the plugin's cache file. @type hostfilepath : String @rtype: Integer @return: The age of the plugin's cache file. """ global hostfilepath timestamp = datetime.datetime.fromtimestamp(os.path.getmtime(hostfilepath)) return (datetime.datetime.now() - timestamp).days class FastestMirror: """ This is the helper class of B{fastestmirror} module. This class does all the processing of the response time calculation for all the mirrors of all the enabled Yum repositories. """ def __init__(self, mirrorlist): """ This is the initiliazer function of the B{L{FastestMirror}} class. @param mirrorlist : A list of mirrors for an enabled repository. @type mirrorlist : List """ self.mirrorlist = mirrorlist self.results = {} self.threads = [] # If we don't spawn any threads, we don't need locking... def _init_lock(self): if not hasattr(self, '_results_lock'): self._results_lock = threading.Lock() global done_sock_timeout done_sock_timeout = True socket.setdefaulttimeout(socket_timeout) def _acquire_lock(self): if hasattr(self, '_results_lock'): self._results_lock.acquire() def _release_lock(self): if hasattr(self, '_results_lock'): self._results_lock.release() def get_mirrorlist(self): """ This function pings/polls all the mirrors in the list C{FastestMirror.mirrorlist} and returns the sorted list of mirrors according to the increasing response time of the mirrors. This function refers: - L{FastestMirror._poll_mirrors()} This function is referred by: - L{postreposetup_hook()} - L{main()} @rtype: List @return: The list of mirrors sorted according to the increasing response time. """ self._poll_mirrors() if not downgrade_ftp: mirrors = [(v, k) for k, v in self.results.items()] else: # False comes before True mirrors = [(k.startswith("ftp"), v, k) for k, v in self.results.items()] mirrors.sort() return [x[-1] for x in mirrors] def _poll_mirrors(self): """ This function uses L{PollThread} class to ping/poll individual mirror in parallel. This function refers: - L{PollThread.run()} This function is referred by: - L{FastestMirror.get_mirrorlist()} """ global maxthreads for mirror in self.mirrorlist: if len(self.threads) > maxthreads: if self.threads[0].isAlive(): self.threads[0].join() del self.threads[0] if mirror.startswith("file:"): mhost = "127.0.0.1" else: mhost = host(mirror) if mhost in timedhosts: result = timedhosts[mhost] if verbose: print "%s already timed: %s" % (mhost, result) self._add_result(mirror, mhost, result) elif mhost in ("127.0.0.1", "::1", "localhost", prefer): self._add_result(mirror, mhost, 0) else: # No cached info. so spawn a thread and find the info. out self._init_lock() pollThread = PollThread(self, mirror) pollThread.start() self.threads.append(pollThread) while len(self.threads) > 0: if self.threads[0].isAlive(): self.threads[0].join() del self.threads[0] def _add_result(self, mirror, host, time): """ This function is called by L{PollThread.run()} to add details of a mirror in C{FastestMirror.results} dictionary. This function is referred by: - L{PollThread.run()} @param mirror : The mirror that was polled for response time. @type mirror : String @param host : The hostname of the mirror. @type host : String @param time : The response time of the mirror. @type time : Integer @param timedhosts : A list of time intervals to reach different hosts corresponding to the mirrors. The index of the list are hostnames. @type timedhosts : List """ global timedhosts self._acquire_lock() if verbose: print " * %s : %f secs" % (host, time) self.results[mirror] = time timedhosts[host] = time self._release_lock() class PollThread(threading.Thread): """ B{PollThread} class implements C{threading.Thread} class. This class provides the functionalities to ping/poll the mirrors in parallel. """ def __init__(self, parent, mirror): """ It is initiliazer function for B{L{PollThread}} class. This function initiliazes the service ports for different webservices. @param parent : The parent class. @type parent : Class @param mirror : The mirror of a repository. @type mirror : String """ threading.Thread.__init__(self) self.parent = parent self.mirror = mirror self.host = host(mirror) uService = urlparse.urlparse(mirror)[0] if uService == "http": self.port = 80 elif uService == "https": self.port = 443 elif uService == "ftp": self.port = 21 elif uService == "file": self.host = "127.0.0.1" else: self.port = -2 def run(self): """ The C{threading.Thread.run()} function is being overridden here. This function pings/polls a mirror and add the details of that mirror to the C{FastestMirror.results} dictionary. The response time of any mirror is '99999999999' if any exception occurs during polling. This function refers: - L{FastestMirror._add_result()} This function is referred by: - L{FastestMirror._poll_mirrors()} """ try: if self.host in timedhosts: result = timedhosts[self.host] if verbose: print "%s already timed: %s" % (self.host, result) else: if self.host in ("127.0.0.1", "::1", "localhost", prefer): result = 0 else: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) uPort = string.find(self.host,":") if uPort > 0: self.port = int(self.host[uPort+1:]) self.host = self.host[:uPort] time_before = time.time() sock.connect((self.host, self.port)) result = time.time() - time_before sock.close() self.parent._add_result(self.mirror, self.host, result) except: if verbose: print " * %s : dead" % self.host self.parent._add_result(self.mirror, self.host, 99999999999) def main(): """ This is the main function for B{fastestmirror} module. This function explains the usage of B{fastestmirror} module. Also parses the command line arguments. This function refers: - L{FastestMirror.get_mirrorlist()} """ global verbose verbose = True if len(sys.argv) == 1: print "Usage: %s <mirror1> [mirror2] ... [mirrorN]" % sys.argv[0] sys.exit(-1) mirrorlist = sys.argv[1:] print "Result: " + str(FastestMirror(mirrorlist).get_mirrorlist()) if __name__ == '__main__': main() ����������������yum-utils-1.1.31/plugins/fedorakmod/����������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0017342�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/fedorakmod/README����������������������������������������������������������0000664�0000000�0000000�00000001503�11620520663�0020221�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Fedorakmod - Yum Plugin for Kernel Modules ========================================== Plugin for Yum to handle kernel modules as described by the Fedora Extras packaging standards. (Now obsolete as Fedora no longer includes kernel module packages.) http://fedoraproject.org/wiki/Obsolete/KernelModules We can install a kmod for all installed kernel versions/variants. Set installforallkernels = 1 in the conf file. The default is to turn this feature on. Set to 0 to disable. We can delay instalation of a new kernel until the needed kmods are available based on the kmods installed for the running kernel. Set pinkernels = 1 in the conf file. Any other value or a missing pinkernels line defaults to turn this functionality off. To Do ===== Hopefully nothing. Jack Neely <jjneely@ncsu.edu> -- 03/12/2008 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/fedorakmod/fedorakmod.conf�������������������������������������������������0000664�0000000�0000000�00000000073�11620520663�0022324�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled = 1 pinkernels = 0 installforallkernels = 0 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/fedorakmod/fedorakmod.py���������������������������������������������������0000664�0000000�0000000�00000026470�11620520663�0022040�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/python # fedorakmod.py - Fedora Kmod -- Yum Kernel Module Support # Copyright 2006 - 2008 NC State University # Written by Jack Neely <jjneely@ncsu.edu> # # SDG # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. import os import rpmUtils from yum import packages from yum.constants import TS_INSTALL from yum.plugins import TYPE_CORE from rpm import RPMPROB_FILTER_OLDPACKAGE requires_api_version = '2.4' plugin_type = (TYPE_CORE,) kernelProvides = set([ "kernel-%s" % a for a in rpmUtils.arch.arches.keys() ]) # We shouldn't need this if we didn't have to fake stuff so much kernelVariants = ["bigmem", "enterprise", "smp", "hugemem", "PAE", "guest", "hypervisor", "xen0", "xenU", "xen"] def getRunningKernel(): # Taken from the installonlyn.py plugin writen by Jeremy Katz # Copyright 2005 Red Hat, Inc. # Modified by Jack Neely to return a kernel provides tuple """This takes the output of uname and figures out the (version, release) tuple for the running kernel.""" ver = os.uname()[2] #for s in kernelVariants: # if ver.endswith(s): # ver = ver.replace(s, "") if ver.find("-") != -1: (v, r) = ver.split("-", 1) # XXX: Gah, this assumes epoch return ('kernel-%s' % os.uname()[4], 'EQ', ('0', v, r)) return None def _whatProvides(c, provides): """Return a list of POs of installed kernels.""" bag = [] rpmdb = c.getRpmDB() for i in provides: tuples = rpmdb.whatProvides(i, None, None) for pkgtuple in tuples: # XXX: what do we do for duplicate packages? #po = rpmdb.packagesByTuple(pkgtuple)[0] po = rpmdb.searchPkgTuple(pkgtuple)[0] bag.append(po) return bag def _getKernelDeps(po, match): reqs = po.returnPrco(match) return [ r for r in reqs if r[0] in kernelProvides ] def getInstalledKernels(c): return _whatProvides(c, kernelProvides) def getInstalledModules(c): # "kernel-modules-for-kernel" is supposed to mark things installonly, see: # https://bugzilla.redhat.com/show_bug.cgi?id=482893 return _whatProvides(c, ["kernel-modules"]) def getKernelProvides(po): """Pass in a package header. This function will return a list of tuples (name, flags, ver) representing any kernel provides. Assumed that the PO is a kernel package.""" return _getKernelDeps(po, "provides") def getKernelReqs(po): """Pass in a package header. This function will return a list of tuples (name, flags, ver) representing any kernel requires.""" return _getKernelDeps(po, "requires") def fakeName(po): """When Yum wont give us full PRCO information we yell "Say my name, bitch!" and fake it hard.""" # Normally, I should be able to pull the <name>-kmod provide fields = po.name.split('-') if fields[0] == "kmod": del fields[0] if fields[-1] in kernelVariants: del fields[-1] return ('-'.join(fields + ['kmod']), 'EQ', (po.epoch, po.version, po.release)) def resolveVersions(packageList): """The packageDict is a dict of pkgtuple -> PO We return a dict of kernel version -> list of kmod POs where the list contains only one PO for each kmod name""" pdict = {} for po in packageList: kernel = getKernelReqs(po) if len(kernel) == 0: print "Bad kmod package '%s' does not require a kernel" % po continue elif len(kernel) == 1: kernel = kernel[0] else: print "Bad kmod package: Must require only one kernel" continue # Figure out the real name of this kmod name = [] for r in po.prco["provides"]: if r[0].endswith('-kmod'): name.append(r[0]) if len(name) == 0: # Yum bug name = fakeName(po) elif len(name) != 1: print "Non compliant kmod package: %s" % po continue po.kmodName = name[0] if kernel not in pdict: pdict[kernel] = [po] else: sameName = None for tempPo in pdict[kernel]: if po.name == tempPo.name: sameName = tempPo break if sameName and packages.comparePoEVR(sameName, po) < 0: pdict[kernel].remove(sameName) pdict[kernel].append(po) elif sameName is None: pdict[kernel].append(po) return pdict def installKernelModules(c, newModules, installedModules): """Figure out what special magic needs to be done to install/upgrade this kernel module. This doesn't actually initiate an install as the module is already in the package sack to be applied.""" tsInfo = c.getTsInfo() for modpo in newModules: c.info(4, "Installing kernel module: %s" % modpo.name) # Should only ever be 1 element to this list te = tsInfo.getMembers(modpo.pkgtup)[0] tsCheck(te) kernelReqs = getKernelReqs(modpo) instPkgs = filter(lambda p: p.name == modpo.name, installedModules) for po in instPkgs: instKernelReqs = getKernelReqs(po) for r in kernelReqs: if r in instKernelReqs: # we know that an incoming kernel module requires the # same kernel as an already installed moulde of the # same name. "Upgrade" this module instead of install. tsInfo.addErase(po) c.info(2, 'Removing kernel module %s upgraded to %s' % (po, modpo)) break def pinKernels(c, newKernels, installedKernels, modules): """If we are using kernel modules, do not upgrade/install a new kernel until matching modules are available.""" runningKernel = getRunningKernel() if runningKernel is None: c.error(2, "Could not parse running kernel version.") return iKernels = [ getKernelProvides(p)[0] for p in installedKernels ] if runningKernel not in iKernels: # We have no knowledge of the running kernel -- its not installed # perhaps this is the anaconda %post environment or somebody # rpm -e'd the currently running kernel. Choose a reasonable # kernel to go with. IE, the greatest EVR we see. topkpo = None for p in installedKernels: if topkpo is None or packages.comparePoEVR(topkpo, p) < 0: topkpo = p runningKernel = getKernelProvides(topkpo)[0] c.info(2, "Unknown running kernel. Using %s instead." % \ str(runningKernel)) table = resolveVersions(modules) if runningKernel not in table: c.info(2, "Trying to mimic %s which has no kernel modules installed" \ % str(runningKernel)) return names = [ p.kmodName for p in table[runningKernel] ] c.info(2, "kmods in %s: %s" % (str(runningKernel), str(names))) for kpo in newKernels: prov = getKernelProvides(kpo)[0] if prov in table: kmods = [ po.kmodName for po in table[prov] ] else: kmods = [] if set(kmods) != set(names): c.info(2, "Removing kernel %s from install set" % str(prov)) # XXX: This wants a pkgtuple which will probably change RSN c.getTsInfo().remove(kpo.pkgtup) def installAllKmods(c, avaModules, modules, kernels): plist = [] names = [] interesting = [] rModules = resolveVersions(modules) for group in rModules.values(): for po in group: if po.kmodName not in names: names.append(po.kmodName) rAvaModules = resolveVersions(avaModules) for group in rAvaModules.values(): for po in group: if po.kmodName in names: interesting.append(po) # If We have stuff in the interesting list its most likely a kmod for # an older kernel and therefore will have a VR < a VR of a kmod that # may already be installed. RPM doesn't like installing packages # older than what's already installed. Tell it to shutup. # XXX: If we thought hard enough we could do this more exactly. if len(interesting) > 0: tsInfo = c.getTsInfo() tsInfo.probFilterFlags.append(RPMPROB_FILTER_OLDPACKAGE) table = resolveVersions(interesting + modules) for kernel in [ getKernelProvides(k)[0] for k in kernels ]: if kernel not in table: continue for po in table[kernel]: if po not in modules: c.getTsInfo().addTrueInstall(po) plist.append(po) return plist def tsCheck(te): "Make sure this transaction element is sane." if te.ts_state == 'u': te.ts_state = 'i' te.output_state = TS_INSTALL def init_hook(c): if hasattr(c, 'registerPackageName'): c.registerPackageName("yum-plugin-fedorakmod") c.info(3, "Loading Fedora Extras kernel module support.") def postresolve_hook(c): avaModules = [] for name in ("kernel-modules", "kernel-modules-for-kernel"): avaModules += c.getRepos().getPackageSack().searchProvides(name) newModules = [] newKernels = [] installedKernels = getInstalledKernels(c) installedModules = getInstalledModules(c) for te in c.getTsInfo().getMembers(): isKernel = len(kernelProvides.intersection(te.po.provides_names)) > 0 if te.ts_state == 'e' and isKernel: # If a kernel is set to be erased then we don't want to # consider it in our dep checking. c.info(2, "Excluding to be erased: " + str(te.po)) installedKernels.remove(te.po) if te.ts_state not in ('i', 'u'): continue if ("kernel-modules" in te.po.provides_names or "kernel-modules-for-kernel" in te.po.provides_names): newModules.append(te.po) for po in avaModules: if te.po.pkgtup == po.pkgtup: avaModules.remove(po) if isKernel: newKernels.append(te.po) # Install modules for all kernels if c.confInt('main', 'installforallkernels', default=1) != 0: moreModules = installAllKmods(c, avaModules, newModules + installedModules, newKernels + installedKernels) newModules = newModules + moreModules # Pin kernels if c.confInt('main', 'pinkernels', default=0) != 0: pinKernels(c, newKernels, installedKernels, newModules + installedModules) # Upgrade/Install kernel modules installKernelModules(c, newModules, installedModules) # vim:ts=4:expandtab ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/filter-data/���������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0017423�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/filter-data/filter-data.conf�����������������������������������������������0000664�0000000�0000000�00000000021�11620520663�0022457�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/filter-data/filter-data.py�������������������������������������������������0000664�0000000�0000000�00000042312�11620520663�0022173�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # # Copyright Red Hat Inc. 2007, 2008 # # Author: James Antill <james.antill@redhat.com> # # This is the compliment to the list-data plugin, allowing you to filter on # any of the information given in that plugin. # # Examples: # # yum --filter-groups='App*/Sys*' list updates from yum.plugins import TYPE_INTERACTIVE from yum.i18n import to_utf8, to_str from optparse import OptionValueError import fnmatch requires_api_version = '2.5' plugin_type = (TYPE_INTERACTIVE,) fd__unknown = lambda x: x fd__max = 9999999999999 def fd__get_data(pkg, attr, strip=True): if not hasattr(pkg, attr): return fd__unknown val = getattr(pkg, attr) if val is None: return fd__unknown if type(val) == type([]): return fd__unknown tval = to_str(val).strip() if tval == "": return fd__unknown if strip: return to_utf8(tval) return val def range_match(sz, rang): return sz >= rang[0] and sz <= rang[1] all_yum_grp_mbrs = {} def fd_make_group_data(base, opts): global all_yum_grp_mbrs for pat in opts.filter_groups: group = base.comps.return_group(pat) if not group: base.logger.critical('Warning: Group %s does not exist.', pat) continue for pkgname in group.mandatory_packages: all_yum_grp_mbrs.setdefault(pkgname, []).append(pat) for pkgname in group.default_packages: all_yum_grp_mbrs.setdefault(pkgname, []).append(pat) for pkgname in group.optional_packages: all_yum_grp_mbrs.setdefault(pkgname, []).append(pat) for pkgname, cond in group.conditional_packages.iteritems(): all_yum_grp_mbrs.setdefault(pkgname, []).append(pat) def fd_free_group_data(): global all_yum_grp_mbrs all_yum_grp_mbrs = {} def fd_should_filter_pkg(base, opts, pkg, used_map): """ Do the package filtering for. """ for (attrs, attr) in [('package-sizes', 'packagesize'), ('archive-sizes', 'archivesize'), ('installed-sizes', 'installedsize')]: rangs = getattr(opts, 'filter_' + attrs.replace('-', '_')) filt = len(rangs) if not filt: # Don't load the data needed for all the attrs. continue data = fd__get_data(pkg, attr, strip=False) for rang in rangs: if data == fd__unknown or range_match(data, rang): used_map[attrs][rang] = True filt = False break if filt: return (attrs, attr) for (attrs, attr) in [('vendors', 'vendor'), ('rpm-groups', 'group'), ('packagers', 'packager'), ('licenses', 'license'), ('arches', 'arch'), ('buildhosts', 'buildhost'), ('urls', 'url'), # The above are all in primary ('committers', 'committer')]: pats = getattr(opts, 'filter_' + attrs.replace('-', '_')) filt = len(pats) if not filt: # Don't load the data needed for all the attrs. continue data = fd__get_data(pkg, attr) for pat in pats: if data == fd__unknown or fnmatch.fnmatch(data, pat): used_map[attrs][pat] = True filt = False break if filt: return (attrs, attr) if len(opts.filter_groups): if pkg.name not in all_yum_grp_mbrs: return ('groups', None) for pat in all_yum_grp_mbrs[pkg.name]: used_map['groups'][pat] = True break return None def fd_gen_used_map(opts): used_map = {} for (attrs, attr) in [('vendors', 'vendor'), ('rpm-groups', 'group'), ('packagers', 'packager'), ('licenses', 'license'), ('arches', 'arch'), ('committers', 'committer'), ('buildhosts', 'buildhost'), ('urls', 'url'), ('package-sizes', 'packagesize'), ('archive-sizes', 'archivesize'), ('installed-sizes', 'installedsize'), ('groups', None)]: used_map[attrs] = {} vattrs = attrs.replace('-', '_') for i in getattr(opts, 'filter_' + vattrs): used_map[attrs][i] = False return used_map def fd_chk_used_map(used_map, msg): for (attrs, attr) in [('vendors', 'vendor'), ('rpm-groups', 'rpm group'), ('packagers', 'packager'), ('licenses', 'license'), ('arches', 'arch'), ('committers', 'committer'), ('buildhosts', 'buildhost'), ('urls', 'url')]: for i in used_map[attrs]: if not used_map[attrs][i]: msg(attr.capitalize() + ' wildcard \"%s\" did not match any packages' % i) for (attrs, attr) in [('package-sizes', 'packagesize'), ('archive-sizes', 'archivesize'), ('installed-sizes', 'installedsize')]: for i in used_map[attrs]: if not used_map[attrs][i]: if i[1] == fd__max: msg(attrs[:-1].capitalize() + ' range \"%d-\" did not match any packages' % i[0]) else: msg(attrs[:-1].capitalize() + ' range \"%d-%d\" did not match any packages' % i) for i in used_map['groups']: if not used_map['groups'][i]: msg('Yum group \"%s\" did not contain any packages' % i) # You might think we'd just use the exclude_hook, and call delPackage # and indeed that works for list updates etc. # # __but__ that doesn't work for dependancies on real updates # # So to fix deps. we need to do it at the preresolve stage and take the # "transaction package list" and then remove packages from that. # # __but__ that doesn't work for lists ... so we do it two ways # def fd_check_func_enter(conduit): """ Stuff we need to do in both list and update modes. """ opts, args = conduit.getCmdLine() # Quick match, so we don't do lots of work when nothing has been specified ndata = True for (attrs, attr) in [('vendors', 'vendor'), ('rpm-groups', 'group'), ('packagers', 'packager'), ('licenses', 'license'), ('arches', 'arch'), ('committers', 'committer'), ('buildhosts', 'buildhost'), ('urls', 'url'), ('package-sizes', 'packagesize'), ('archive-sizes', 'archivesize'), ('installed-sizes', 'installedsize')]: vattrs = attrs.replace('-', '_') if len(getattr(opts, 'filter_' + vattrs)): ndata = False if len(opts.filter_groups): ndata = False ret = None if len(args) >= 1: if (args[0] in ["update", "upgrade", "install"]): ret = {"skip": ndata, "list_cmd": False} if (args[0] in ["check-update"]): # Pretend it's: list updates ret = {"skip": ndata, "list_cmd": True, "ret_pkg_lists": ["updates"] + args[1:]} # FIXME: delPackage() only works for pkgSack only atm. valid_list_cmds = ["list", "info"] valid_list_sub_cmds = ["updates", "available", "recent"] for cmd in ["vendors", 'rpm-groups', 'packagers', 'licenses', 'arches', 'committers', 'buildhosts', 'baseurls', 'package-sizes', 'archive-sizes', 'installed-sizes', 'security', 'sec', 'groups']: valid_list_cmds.append("list-" + cmd) valid_list_cmds.append("info-" + cmd) if (len(args) >= 2 and args[0] in valid_list_cmds and args[1] in valid_list_sub_cmds): ret = {"skip": ndata, "list_cmd": True, "ret_pkg_lists": args[1:]} if ret: if ndata: conduit.info(2, 'Skipping filters plugin, no data') return (opts, ret) if not ndata: conduit.error(2, 'Skipping filters plugin, other command') return (opts, {"skip": True, "list_cmd": False, "msg": True}) _in_plugin = False def exclude_hook(conduit): ''' Yum Plugin Exclude Hook: Check and remove packages that don\'t align with the filters. ''' global _in_plugin opts, info = fd_check_func_enter(conduit) if info["skip"]: return if not info["list_cmd"]: return if _in_plugin: return _in_plugin = True conduit.info(2, 'Limiting package lists to filtered ones') def fd_del_pkg(pkg, which): """ Deletes a package from all trees that yum knows about """ conduit.info(3," --> %s from %s excluded (filter: %s)" % (pkg, pkg.repoid, which[0])) conduit.delPackage(pkg) used_map = fd_gen_used_map(opts) # NOTE: excludes/delPackage() doesn't work atm. for non-"list upgrades" if not info['ret_pkg_lists']: pkgs = conduit.getPackages() else: args = info['ret_pkg_lists'] special = ['updates'] pn = None pkgs = [] if len(args) >= 1 and args[0] in special: pn = args[0] args = args[1:] else: pkgs = conduit.getPackages() if not len(args): args = None if pn: data = conduit._base.doPackageLists(pkgnarrow=pn, patterns=args) pkgs.extend(data.updates) del data if opts.filter_groups: fd_make_group_data(conduit._base, opts) tot = 0 cnt = 0 for pkg in pkgs: tot += 1 which = fd_should_filter_pkg(conduit._base, opts, pkg, used_map) if which: fd_del_pkg(pkg, which) else: cnt += 1 fd_chk_used_map(used_map, lambda x: conduit.error(2, x)) if cnt: conduit.info(2, 'Left with %d of %d packages, after filters applied' % (cnt, tot)) else: conduit.info(2, 'No packages passed the filters, %d available' % tot) fd_free_group_data() _in_plugin = False def preresolve_hook(conduit): ''' Yum Plugin PreResolve Hook: Check and remove packages that don\'t align with the filters. ''' opts, info = fd_check_func_enter(conduit) if info["skip"]: return if info["list_cmd"]: return conduit.info(2, 'Limiting package lists to filtered ones') def fd_del_pkg(tspkg): """ Deletes a package within a transaction. """ conduit.info(3," --> %s from %s excluded" % (tspkg.po, tspkg.po.repoid)) tsinfo.remove(tspkg.pkgtup) if opts.filter_groups: fd_make_group_data(conduit._base, opts) tot = 0 used_map = fd_gen_used_map(opts) tsinfo = conduit.getTsInfo() tspkgs = tsinfo.getMembers() # Ok, here we keep any pkgs that pass "filter" tests, then we keep all # related pkgs ... Ie. "installed" version marked for removal. keep_pkgs = set() for tspkg in tspkgs: tot += 1 if not fd_should_filter_pkg(conduit._base, opts, tspkg.po, used_map): keep_pkgs.add(tspkg.po) scnt = len(keep_pkgs) mini_depsolve_again = True while mini_depsolve_again: mini_depsolve_again = False for tspkg in tspkgs: if tspkg.po in keep_pkgs: # Find any related pkgs, and add them: for (rpkg, reason) in tspkg.relatedto: if rpkg not in keep_pkgs: keep_pkgs.add(rpkg) mini_depsolve_again = True else: # If related to any keep pkgs, add us for (rpkg, reason) in tspkg.relatedto: if rpkg in keep_pkgs: keep_pkgs.add(tspkg.po) mini_depsolve_again = True break for tspkg in tspkgs: if tspkg.po not in keep_pkgs: fd_del_pkg(tspkg) acnt = len(keep_pkgs) fd_chk_used_map(used_map, lambda x: conduit.error(2, x)) if acnt: conduit.info(2, 'Left with %d (+%d related) of %d packages, after filters applied' % (scnt, acnt - scnt, tot)) else: conduit.info(2, 'No packages passed the filters, %d available' % tot) fd_free_group_data() def config_hook(conduit): ''' Yum Plugin Config Hook: Setup the option parser with the '--filter-*' command line options. ''' parser = conduit.getOptParser() if not parser: return parser.values.filter_vendors = [] parser.values.filter_rpm_groups = [] parser.values.filter_packagers = [] parser.values.filter_licenses = [] parser.values.filter_arches = [] parser.values.filter_committers = [] parser.values.filter_buildhosts = [] parser.values.filter_urls = [] parser.values.filter_packages_sizes = [] parser.values.filter_archive_sizes = [] parser.values.filter_installed_sizes = [] parser.values.filter_groups = [] def make_sopt(attrs): attrs = attrs.replace("-", "_") def func(opt, key, val, parser): vals = str(val).split(",") vals = filter(len, vals) getattr(parser.values, 'filter_' + attrs).extend(vals) return func def make_nopt(attrs): attrs = attrs.replace("-", "_") def func(opt, key, val, parser): vals = str(val).replace(",", " ").split() vals = filter(len, vals) getattr(parser.values, 'filter_' + attrs).extend(vals) return func def make_szopt(attrs): attrs = attrs.replace("-", "_") def func(opt, key, val, parser): def sz_int(x, empty_sz): if x == '': return empty_sz mul = 1 conv = {'k' : 1024, 'm' : 1024 * 1024, 'g' : 1024 * 1024 * 1024} if x[-1].lower() in conv: mul = conv[x[-1]] x = x[:-1] return int(x) * mul vals = str(val).replace(",", " ").split() vals = filter(len, vals) for val in vals: rang = val.split("-") if len(rang) > 2: msg = "%s was passed an invalid range: %s" % (attrs, val) raise OptionValueError(msg) if len(rang) < 2: rang = (rang[0], rang[0]) else: rang = (sz_int(rang[0], 0), sz_int(rang[1], fd__max)) getattr(parser.values, 'filter_' + attrs).append(rang) return func # These have spaces in their values, so we can't split on space for (attrs, attr) in [('vendors', 'vendor'), ('rpm-groups', 'group'), ('packagers', 'packager'), ('licenses', 'license'), ('committers', 'committer')]: parser.add_option('--filter-' + attrs, action="callback", callback=make_sopt(attrs), default=[], type="string", help='Filter to packages with a matching ' + attr) for (attrs, attr) in [('arches', 'arch'), ('buildhosts', 'buildhost'), ('urls', 'url')]: parser.add_option('--filter-' + attrs, action="callback", callback=make_nopt(attrs), default=[], type="string", help='Filter to packages with a matching ' + attr) for (attrs, attr) in [('package-sizes', 'packagesize'), ('archive-sizes', 'archivesize'), ('installed-sizes', 'installedsize')]: parser.add_option('--filter-' + attrs, action="callback", callback=make_szopt(attrs), default=[], type="string", help='Filter to packages with a %s in the given range' % attr) # This is kind of odd man out, but... parser.add_option('--filter-groups', action="callback", callback=make_sopt('groups'),default=[],type="string", help='Filter to packages within a matching yum group') if __name__ == '__main__': print "This is a plugin that is supposed to run from inside YUM" ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/fs-snapshot/���������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0017474�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/fs-snapshot/fs-snapshot.conf�����������������������������������������������0000664�0000000�0000000�00000000230�11620520663�0022603�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled = 1 [lvm] enabled = 0 # 'lvcreate_size_args' option must specify the snapshot LV size using -L or -l #lvcreate_size_args = -l 15%ORIGIN ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/fs-snapshot/fs-snapshot.py�������������������������������������������������0000664�0000000�0000000�00000026720�11620520663�0022322�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Copyright 2009-2010 Red Hat, Inc # written by Josef Bacik <josef@toxicpanda.com> # Mike Snitzer <msnitzer@fedoraproject.org> """ This plugin creates a snapshot before any yum update or yum remove operation on any btrfs filesystem that is affected by the update/remove operation. This is a giant hammer. Please be aware that if you rollback to a previous snapshot that any other changes that occured to the filesystem after the snapshot takes place will not be in the snapshot. You of course can mount the newer version elsewhere and copy the new versions of the files back to your rolled-back snapshot. You have been warned. """ from yum.plugins import TYPE_CORE, PluginYumExit from yum.constants import * import yum.misc import os import time from subprocess import Popen,PIPE requires_api_version = '2.4' plugin_type = (TYPE_CORE,) # Globals lvm_key = "create_lvm_snapshot" # avoid multiple snapshot-merge checks via inspect_volume_lvm() dm_snapshot_merge_checked = 0 dm_snapshot_merge_support = 0 def _fail(msg): raise PluginYumExit(msg) def kernel_supports_dm_snapshot_merge(): # verify the kernel provides the 'snapshot-merge' DM target # - modprobe dm-snapshot; dmsetup targets | grep -q snapshot-merge global dm_snapshot_merge_checked, dm_snapshot_merge_support if dm_snapshot_merge_checked: return dm_snapshot_merge_support os.system("modprobe dm-snapshot") p = Popen(["/sbin/dmsetup", "targets"], stdout=PIPE, stderr=PIPE) err = p.wait() if not err: output = p.communicate()[0] if not output.find("snapshot-merge") == -1: dm_snapshot_merge_support = 1 dm_snapshot_merge_checked = 1 return dm_snapshot_merge_support def inspect_volume_lvm(conduit, volume): """ If volume is an LVM logical volume: - translate /dev/mapper name for LVM command use - conditionally establish lvm_key in volume """ lvm_support = conduit.confBool('lvm', 'enabled', default=0) if not lvm_support: return 1 device = volume["device"] # Inspect DM and LVM devices if device.startswith("/dev/dm-"): conduit.info(2, "fs-snapshot: unable to snapshot DM device: " + device) return 0 if device.startswith("/dev/mapper/"): # convert /dev/mapper name to /dev/vg/lv for use with LVM2 tools # - 'dmsetup splitname' will collapse any escaped characters p = Popen(["/sbin/dmsetup", "splitname", "--separator", "/", "--noheadings", "-o", "vg_name,lv_name", device], stdout=PIPE, stderr=PIPE) err = p.wait() if err: return 0 output = p.communicate()[0] device = output.strip().replace("/dev/mapper/", "/dev/") volume["device"] = device # Check if device is managed by lvm # - FIXME filter out snapshot (and other) LVs; for now just rely # on 'lvcreate' to prevent snapshots of unsupported LV types p = Popen(["/sbin/lvs", device], stdout=PIPE, stderr=PIPE) err = p.wait() if not err: # FIXME allow creating snapshot LVs even if kernel doesn't # support snapshot-merge based system rollback? make configurable? if not kernel_supports_dm_snapshot_merge(): conduit.error(1, "fs-snapshot: skipping volume: %s, " "kernel doesn't support snapshot-merge" % device) return 0 volume[lvm_key] = 1 return 1 def inspect_volume(conduit, volume): """ Hook to check/filter volume for special characteristics. Returns 0 if volume failed inspection, otherwise 1. All inspect_volume_* methods act as filters; if they return 0 that means this volume failed inspection. """ if not inspect_volume_lvm(conduit, volume): return 0 # Additional inspect_volume_* methods may prove unnecessary but the # filtering nature of these methods would make them unavoidable; e.g. # just because a volume is LVM doesn't mean other filters should # be short-circuited return 1 def get_volumes(conduit): """ Return all volumes that may be snapshotted. Each volume is a dictionary that contains descriptive key=value pairs. All volumes will have 'device', 'mntpnt', and 'fstype' keys. Extra keys may be established as a side-effect of inspect_volume(). """ # FIXME may look to return dictionary of volume dictionaries to # allow a volume to be looked up using its path (as the key). # - when a kernel package is being installed: could prove useful to check # if "/" is an LVM volume and "/boot" is not able to be snapshotted; if # so warn user that "/boot" changes (e.g. grub's menu.lst) will need to # be manually rolled back. volumes = [] excluded_mntpnts = conduit.confString('main', 'exclude', default="").split() try: mtabfile = open('/etc/mtab', 'r') for line in mtabfile.readlines(): device, mntpnt, fstype, rest = line.split(' ', 3) volume = { "device" : device, "mntpnt" : mntpnt, "fstype" : fstype } if mntpnt in excluded_mntpnts: continue # skip bind mounts if not rest.find("bind") == -1: continue # skip any mounts whose device doesn't have a leading / # - avoids proc, sysfs, devpts, sunrpc, none, etc. if not device.find("/") == 0: continue # skip volume if it doesn't pass inspection # - inspect_volume may create additional keys in this volume if not inspect_volume(conduit, volume): continue volumes.append(volume) mtabfile.close() except Exception, e: msg = "fs-snapshot: error processing mounted volumes: %s" % e _fail(msg) return volumes def _create_snapshot(conduit, snapshot_tag, volume): """ Determines if the device is capable of being snapshotted and then calls the appropriate snapshotting function. The idea is you could add something for nilfs2 or whatever else here. Returns 0 if no snapshot was created, 1 if an error occurred, and 2 if a snapshot was created. """ if volume["fstype"] == "btrfs": return _create_btrfs_snapshot(conduit, snapshot_tag, volume) elif lvm_key in volume: return _create_lvm_snapshot(conduit, snapshot_tag, volume) return 0 def _create_btrfs_snapshot(conduit, snapshot_tag, volume): """ Runs the commands necessary for a snapshot. Basically its just btrfsctl -c /dir/to/snapshot #this syncs the fs btrfsctl -s /dir/to/snapshot/${snapshot_tag} /dir/to/snapshot and then we're done. """ mntpnt = volume["mntpnt"] #/etc/mtab doesn't have /'s at the end of the mount point, unless of course #the mountpoint is / if not mntpnt.endswith("/"): mntpnt = mntpnt + "/" snapname = mntpnt + snapshot_tag conduit.info(1, "fs-snapshot: snapshotting " + mntpnt + ": " + snapname) p = Popen(["/sbin/btrfsctl", "-c", mntpnt], stdout=PIPE, stderr=PIPE) err = p.wait() if err: return 1 p = Popen(["/sbin/btrfsctl", "-s", snapname, mntpnt], stdout=PIPE, stderr=PIPE) err = p.wait() if err: return 1 return 2 def _create_lvm_snapshot(conduit, snapshot_tag, volume): """ Create LVM snapshot LV and tag it with $snapshot_tag. - This assumes that the volume is an origin LV whose VG has enough free space to accommodate a snapshot LV. - Also assumes user has configured 'lvcreate_size_args'. """ lvcreate_size_args = conduit.confString('lvm', 'lvcreate_size_args', default=None) if not lvcreate_size_args: conduit.error(1, "fs-snapshot: 'lvcreate_size_args' was not provided " "in the '[lvm]' section of the config file") return 1 if not lvcreate_size_args.startswith("-L") and not lvcreate_size_args.startswith("-l"): conduit.error(1, "fs-snapshot: 'lvcreate_size_args' did not use -L or -l") return 1 device = volume["device"] if device.count('/') != 3: return 1 mntpnt = volume["mntpnt"] kern_inst = True # Default to saying it might be. ts = conduit._base.rpmdb.readOnlyTS() kern_pkgtup = yum.misc.get_running_kernel_pkgtup(ts) del ts if kern_pkgtup is not None: kern_inst = conduit.getTsInfo().matchNaevr(name=kern_pkgtup[0]) # We only warn about this if a kernel is being installed or removed. Note # that this doesn't show anything if you move from "kern-foo" to "kern-bar" # but yum doesn't know any more than "what is running now". if mntpnt == "/" and kern_inst: conduit.info(1, "fs-snapshot: WARNING: creating LVM snapshot of root LV. If a kernel is\n" " being altered /boot may need to be manually restored\n" " in the event that a system rollback proves necessary.\n") snap_device = device + "_" + snapshot_tag snap_lvname = snap_device.split('/')[3] conduit.info(1, "fs-snapshot: snapshotting %s (%s): %s" % (mntpnt, device, snap_lvname)) # Create snapshot LV lvcreate_cmd = ["/sbin/lvcreate", "-s", "-n", snap_lvname] lvcreate_cmd.extend(lvcreate_size_args.split()) lvcreate_cmd.append(device) p = Popen(lvcreate_cmd, stdout=PIPE, stderr=PIPE) err = p.wait() if err: conduit.error(1, "fs-snapshot: failed command: %s\n%s" % (" ".join(lvcreate_cmd), p.communicate()[1])) return 1 # Add tag ($snapshot_tag) to snapshot LV # - should help facilitate merge of all snapshot LVs created # by a yum transaction, e.g.: lvconvert --merge @snapshot_tag p = Popen(["/sbin/lvchange", "--addtag", snapshot_tag, snap_device], stdout=PIPE, stderr=PIPE) err = p.wait() if err: conduit.error(1, "fs-snapshot: couldn't add tag to snapshot: %s" % snap_device) return 1 return 2 def pretrans_hook(conduit): """ This runs before the transaction starts. Try to snapshot anything and everything that is snapshottable, since we do not know what an RPM will modify (thank you scriptlets). """ # common snapshot tag format: yum_${year}${month}${day}${hour}${minute}${sec} snapshot_tag = "yum_" + time.strftime("%Y%m%d%H%M%S") volumes = get_volumes(conduit) for volume in volumes: rc = _create_snapshot(conduit, snapshot_tag, volume) if rc == 1: _fail("fs-snapshot: error snapshotting " + volume["mntpnt"]) elif rc == 2 and hasattr(conduit, 'registerPackageName'): # A snapshot was successfully created conduit.registerPackageName("yum-plugin-fs-snapshot") ������������������������������������������������yum-utils-1.1.31/plugins/kernel-module/�������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0017772�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/kernel-module/kernel-module.conf�������������������������������������������0000664�0000000�0000000�00000000021�11620520663�0023375�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/kernel-module/kernel-module.py���������������������������������������������0000664�0000000�0000000�00000004723�11620520663�0023115�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Plugin for handling upgrades of kernel module packages named in # kernel-module-<module name>-<uname -r> style as seen for example on livna.org # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # by Panu Matilainen <pmatilai@laiskiainen.org> from yum.misc import unique from yum.plugins import TYPE_CORE requires_api_version = '2.1' plugin_type = (TYPE_CORE,) knames = ['kernel', 'kernel-smp', 'kernel-hugemen'] def kunamer(kernel): ksuff = "" tmp = kernel.name.split('-') if len(tmp) > 1: ksuff = tmp[1] return "%s-%s%s" % (kernel.version, kernel.release, ksuff) def find_kmodules(availpkgs, provides, kernels): matches = [] for pkg in availpkgs: for kern in kernels: for prov in provides: if pkg.name == "%s-%s" % (prov, kunamer(kern)): if pkg.arch == kern.arch: matches.append(pkg) return unique(matches) def preresolve_hook(conduit): if hasattr(conduit, 'registerPackageName'): conduit.registerPackageName("yum-plugin-kernel-module") ts = conduit.getTsInfo() kernels = [] for tsmem in ts.getMembers(): if tsmem.ts_state == 'u' and tsmem.name in knames: kernels.append(tsmem.po) # pkgSack isn't populated on removals so this could traceback try: pkgs = conduit.getPackages() except AttributeError: return instpkgs = conduit.getRpmDB().returnPackages() kmodprovides = [] for pkg in instpkgs: if pkg.name.startswith('kernel-module'): for prov in pkg.tagByName('providename'): kmodprovides.append(prov) mods = find_kmodules(pkgs, kmodprovides, kernels) for pkg in mods: conduit.info(2, 'Adding kernel module %s to transaction' % pkg.name) ts.addInstall(pkg) # vim:ts=4:expandtab ���������������������������������������������yum-utils-1.1.31/plugins/keys/����������������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0016202�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/keys/keys.conf�������������������������������������������������������������0000664�0000000�0000000�00000000021�11620520663�0020015�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/keys/keys.py���������������������������������������������������������������0000664�0000000�0000000�00000025047�11620520663�0017537�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # by James Antill from yum.plugins import TYPE_INTERACTIVE, PluginYumExit import rpmUtils.transaction import os import time import fnmatch import yum.pgpmsg try: import gpgme except: gpgme = None requires_api_version = '2.1' plugin_type = (TYPE_INTERACTIVE,) def match_keys(patterns, key, globs=True): for pat in patterns: if pat == key.keyid: return True if pat == "%s-%x" % (key.keyid, key.createts): return True if pat == key.sum_auth: return True if pat == key.sum_auth_name: return True if pat == key.sum_auth_email: return True if globs and fnmatch.fnmatch(key.sum_auth, pat): return True return False class Key: def __init__(self, keyid, createts, sum_type, sum_auth, data, gpgctx=None, gpgkey=None, gpgsubkey=None, repoid="installed"): self.keyid = keyid self.createts = createts self.sum_type = sum_type self.sum_auth = sum_auth self.data = data self.gpgctx = gpgctx self.gpgkey = gpgkey self.gpgsubkey = gpgsubkey self.repoid = repoid email_beg = sum_auth.rfind('<') if email_beg == -1: self.sum_auth_name = sum_auth self.sum_auth_email = "" else: self.sum_auth_name = sum_auth[:email_beg] if sum_auth[-1] == '>': self.sum_auth_email = sum_auth[email_beg+1:-1] else: self.sum_auth_email = sum_auth[email_beg:] def __cmp__(self, other): if other is None: return 1 ret = cmp(self.sum_type, other.sum_type) if ret: return ret ret = cmp(self.sum_auth, other.sum_auth) if ret: return ret ret = cmp(self.keyid, other.keyid) if ret: return ret # Never gets here on diff. keys? ret = cmp(self.createts, other.createts) return ret class KeysListCommand: def __init__(self): self.columns = None def getNames(self): return ["keys", "keys-list"] def getUsage(self): return "[key-wildcard]" def getSummary(self): return "Lists keys for signing data" def doCheck(self, base, basecmd, extcmds): pass def show_hdr(self, base): columns = zip(("Key owner", "Key email", "Repo", "Key ID"),self.columns) print base.fmtColumns(columns) def match_key(self, patterns, key): return match_keys(patterns, key) def show_key(self, base, key): columns = zip((key.sum_auth_name, key.sum_auth_email, key.repoid, ("%s-%x" % (key.keyid, key.createts))), self.columns) print base.fmtColumns(columns) def doCommand(self, base, basecmd, extcmds): if hasattr(base, 'run_with_package_names'): base.run_with_package_names.add("yum-plugin-keys") self.exit_code = 0 keys = [] ts = rpmUtils.transaction.TransactionWrapper(base.conf.installroot) for hdr in ts.dbMatch('name', 'gpg-pubkey'): keyid = hdr['version'] createts = int(hdr['release'], 16) sum_auth = hdr['summary'] sum_auth = sum_auth.strip() if not sum_auth.startswith('gpg(') or not sum_auth.endswith(')'): sum_type = "<?>" else: sum_auth = sum_auth[4:-1] sum_type = "GPG" data = hdr['description'] keys.append(Key(keyid, createts, sum_type, sum_auth, data)) if gpgme is not None: base.repos.doSetup() # Without this repo.cachedir is empty *sigh* for repo in base.repos.listEnabled(): gpgdir = '%s/gpgdir' % repo.cachedir if not os.path.exists(gpgdir): continue # Borrowed from misc.return_keyids_from_pubring() os.environ['GNUPGHOME'] = gpgdir ctx = gpgme.Context() for k in ctx.keylist(): auth = "%s <%s>" % (k.uids[0].name, k.uids[0].email) for subkey in k.subkeys: if subkey.can_sign: keyid = "%08x" % (int(subkey.keyid,16) & 0xFFFFFFFF) keys.append(Key(keyid, subkey.timestamp, "GPG", auth, "<not-implemented>", ctx, k, subkey, repo.id)) if self.columns is None and not hasattr(base, 'calcColumns'): self.columns = (-15, -22, -22, 17) elif self.columns is None: data = {'owner' : {}, 'email' : {}, 'rid' : {}, 'kid' : {}} for key in keys: if len(extcmds) and not self.match_key(extcmds, key): continue for (d, v) in (("owner", len(key.sum_auth_name)), ("email", len(key.sum_auth_email)), ("rid", len(key.repoid)), ("kid", (len(key.keyid) + 1 + len("%x" % key.createts)))): data[d].setdefault(v, 0) data[d][v] += 1 data = [data['owner'], data['email'], data['rid'], data['kid']] columns = base.calcColumns(data) self.columns = [-columns[0], -columns[1], -columns[2], columns[3]] done = False for key in sorted(keys): if not len(extcmds) or self.match_key(extcmds, key): if not done: self.show_hdr(base) done = True self.show_key(base, key) return self.exit_code, [basecmd + ' done'] def needTs(self, base, basecmd, extcmds): return False class KeysInfoCommand(KeysListCommand): def __init__(self): self.columns = [1] * 4 def getNames(self): return ["keys-info"] def getSummary(self): return "Full information keys for signing data" def show_hdr(self, base): pass def show_key(self, base, key): rpmkeyid = "%s-%x" % (key.keyid, key.createts) if key.repoid != "installed": print """\ Type : %s Rpm Key ID : %s Key owner : %s Key email : %s Repo : %s Created : %s Fingerprint: %x Key ID : %x """ % (key.sum_type, rpmkeyid, key.sum_auth_name, key.sum_auth_email, key.repoid, time.ctime(key.createts), int(key.gpgsubkey.fpr, 16), int(key.gpgsubkey.keyid, 16)) elif key.sum_type == '<?>': print """\ Type : Unknown Rpm Key ID: %s Key owner : %s Key email : %s Repo : installed Created : %s """ % (rpmkeyid, key.sum_auth_name, key.sum_auth_email, time.ctime(key.createts)) else: if yum.__version_info__ > (3, 2, 28): gpg_certs = yum.pgpmsg.decode_msg(key.data, multi=True) else: gpg_certs = [yum.pgpmsg.decode_msg(key.data)] for gpg_cert in gpg_certs: print """\ Type : %s Rpm Key ID : %s Key owner : %s Key email : %s Repo : installed Created : %s Version : PGP Public Key Certificate v%d Primary ID : %s Algorithm : %s Fingerprint: %s Key ID : %s """ % (key.sum_type, rpmkeyid, key.sum_auth_name, key.sum_auth_email, time.ctime(key.createts), gpg_cert.version, gpg_cert.user_id, yum.pgpmsg.algo_pk_to_str[gpg_cert.public_key.pk_algo], yum.pgpmsg.str_to_hex(gpg_cert.public_key.fingerprint()), yum.pgpmsg.str_to_hex(gpg_cert.public_key.key_id())) class KeysDataCommand(KeysListCommand): def __init__(self): self.columns = [1] * 4 def getNames(self): return ["keys-data"] def getSummary(self): return "Show public key block information for signing data" def show_hdr(self, base): pass def show_key(self, base, key): print """\ Type : %s Key owner: %s Key email: %s Key ID : %s Repo : %s Created : %s Raw Data : %s """ % (key.sum_type, key.sum_auth_name, key.sum_auth_email, key.keyid, key.repoid, time.ctime(key.createts), key.data.replace('\n', '\n ')) class KeysRemoveCommand(KeysListCommand): def __init__(self): self.columns = [1] * 4 def getNames(self): return ["keys-remove", "keys-erase"] def getSummary(self): return "Remove a public key block for signing data" def show_hdr(self, base): pass def show_key(self, base, key): if key.repoid == "installed": release = "%x" % key.createts if hasattr(base.rpmdb, 'returnGPGPubkeyPackages'): # New style for pkg in base.rpmdb.returnGPGPubkeyPackages(): if pkg.version == key.keyid and pkg.release == release: base.remove(po=pkg) else: base.remove(name='gpg-pubkey', version=key.keyid, release=release) self.exit_code = 2 else: print "Delete key %s-%x from %s?" % (key.keyid, key.createts, key.repoid) if base.userconfirm(): key.gpgctx.delete(key.gpgkey) def match_key(self, patterns, key): return match_keys(patterns, key, globs=False) def doCheck(self, base, basecmd, extcmds): if base.conf.uid: raise PluginYumExit('You need to be root to perform this command.') if not len(extcmds): raise PluginYumExit('You need to specify a key to remove.') if hasattr(base, 'run_with_package_names'): base.run_with_package_names.add("yum-plugin-keys") def config_hook(conduit): conduit.registerCommand(KeysListCommand()) conduit.registerCommand(KeysInfoCommand()) conduit.registerCommand(KeysDataCommand()) conduit.registerCommand(KeysRemoveCommand()) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/list-data/�����������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0017111�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/list-data/list-data.conf���������������������������������������������������0000664�0000000�0000000�00000000021�11620520663�0021633�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/list-data/list-data.py�����������������������������������������������������0000775�0000000�0000000�00000025735�11620520663�0021364�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # # Copyright Red Hat Inc. 2007, 2008 # # Author: James Antill <james.antill@redhat.com> # # Examples: # # yum list-vendors # yum list-packagers yum* # yum list-groups updates import types from yum.plugins import TYPE_INTERACTIVE import logging # for commands from yum import logginglevels # For baseurl import urlparse # Decent (UK/US English only) number formatting. import locale locale.setlocale(locale.LC_ALL, '') def loc_num(x): """ Return a string of a number in the readable "locale" format. """ return locale.format("%d", int(x), True) def to_str(obj): """ Convert something to a string, if it isn't one. """ # NOTE: unicode counts as a string just fine. We just want objects to call # their __str__ methods. if not isinstance(obj, basestring): obj = str(obj) return obj requires_api_version = '2.5' plugin_type = (TYPE_INTERACTIVE,) class ListDataCommands: unknown = "-- Unknown --" def __init__(self, name, attr, help=None): self.name = name self.attr = attr self.__help = help def cmd_beg(self): pass def cmd_end(self): pass def getNames(self): return ['list-' + self.name] def getUsage(self): return "[PACKAGE|all|installed|updates|extras|obsoletes|recent]" def _getSummary(self): if self.__help is not None: return self.__help return """\ Display aggregate data on the %s attribute of a group of packages""" % self.attr def getSummary(self): return self._getSummary() def doCheck(self, base, basecmd, extcmds): pass def show_pkgs(self, msg, gval, pkgs): pass def show_data(self, msg, pkgs, name): if not pkgs: return msg("%s %s %s" % ('=' * 20, name, '=' * 20)) pkgs.sort(key=lambda x: x.name) calc = {} for pkg in pkgs: (data, rdata) = self.get_data(pkg) if type(data) != type([]): calc.setdefault(data, []).append((pkg, rdata)) else: for sdata in data: calc.setdefault(sdata, []).append((pkg, rdata)) maxlen = 0 totlen = 0 for data in calc: val = len(data) totlen += len(calc[data]) if val > maxlen: maxlen = val fmt = "%%-%ds %%6s (%%3d%%%%)" % maxlen for data in sorted(calc): val = len(calc[data]) msg(fmt % (to_str(data), loc_num(val), (100 * val) / totlen)) self.show_pkgs(msg, data, calc[data]) # pkg.vendor has weird values, for instance def get_data(self, data, strip=True): if not hasattr(data, self.attr): return (self.unknown, self.unknown) val = getattr(data, self.attr) if val is None: return (self.unknown, self.unknown) if type(val) == type([]): return (self.unknown, self.unknown) tval = to_str(val).strip() if tval == "": return (self.unknown, self.unknown) if strip: return (tval, tval) return (val, val) def doCommand(self, base, basecmd, extcmds): self.base = base logger = logging.getLogger("yum.verbose.main") def msg(x): logger.log(logginglevels.INFO_2, x) def msg_warn(x): logger.warn(x) self.cmd_beg() ypl = base.returnPkgLists(extcmds) self.show_data(msg, ypl.installed, 'Installed Packages') self.show_data(msg, ypl.available, 'Available Packages') self.show_data(msg, ypl.extras, 'Extra Packages') self.show_data(msg, ypl.updates, 'Updated Packages') self.show_data(msg, ypl.obsoletes, 'Obsoleting Packages') self.show_data(msg, ypl.recent, 'Recent Packages') self.cmd_end() return 0, [basecmd + ' done'] def needTs(self, base, basecmd, extcmds): if len(extcmds) and extcmds[0] == 'installed': return False return True class InfoDataCommands(ListDataCommands): def getNames(self): return ['info-' + self.name] def getSummary(self): return self._getSummary() + "\nAnd list all the packages under each" def show_pkgs(self, msg, gval, pkgs): for (pkg, val) in pkgs: if gval == val: msg(" %s" % pkg) continue if type(val) == type([]): val = ", ".join(sorted(val)) linelen = len(val) + len(to_str(pkg)) if linelen < 77: msg(" %s %*s%s" % (pkg, 77 - linelen, '', val)) else: msg(" %s" % pkg) msg(" => %s" % val) msg('') if pkgs: msg('') def buildhost_get_data(self, data): # Just show the dnsname val = self.oget_data(data)[0] if val == self.unknown: return (val, val) dns_names = val.split('.') if len(dns_names) > 2: dns_names[0] = '*' return (".".join(dns_names), val) def url_get_data(self, data): # Just show the hostname val = self.oget_data(data)[0] if val == self.unknown: return (val, val) (scheme, netloc, path, query, fragid) = urlparse.urlsplit(val) return ("%s://%s/" % (scheme, netloc), val) class SizeRangeData: def __init__(self, beg, msg): self._beg = beg self._msg = msg def __cmp__(self, o): if not hasattr(o, '_beg'): return 1 return cmp(self._beg, o._beg) def __str__(self): return self._msg def __len__(self): return len(self._msg) def __hash__(self): return hash(self._msg) def _format_size(base, num, max): return "%s (%*s)" %(base.format_number(num),len(loc_num(max)),loc_num(num)) def size_get_data(self, data): val = self.oget_data(data, strip=False)[0] if val == self.unknown: return (val, val) # Even if it was sane, don't put 1GB and up here, or the alpha sorting # won't be correct. nums = (( 10 * 1024, " 10KB"), ( 25 * 1024, " 25KB"), ( 50 * 1024, " 50KB"), ( 75 * 1024, " 75KB"), (100 * 1024, "100KB"), (250 * 1024, "250KB"), (500 * 1024, "500KB"), (750 * 1024, "750KB"), ( 1 * 1024 * 1024, " 1MB"), ( 5 * 1024 * 1024, " 5MB"), ( 10 * 1024 * 1024, " 10MB"), ( 50 * 1024 * 1024, " 50MB"), (100 * 1024 * 1024, "100MB"), (500 * 1024 * 1024, "500MB"), ) pnum = (0, " 0B") if val <= pnum[0]: msg = "[ %s - %s ] " % (" " * len(pnum[1]), pnum[1]) return (SizeRangeData(pnum[0], msg), _format_size(self.base, val, pnum[0])) pnum = (1, " 1B") for num in nums: if val >= pnum[0] and val <= num[0]: msg = "[ %s - %s ] " % (pnum[1], num[1]) return (SizeRangeData(pnum[0], msg), _format_size(self.base, val, num[0])) pnum = num msg = "[ %s - %s ] " % (pnum[1], " " * len(pnum[1])) return (SizeRangeData(pnum[0], msg), _format_size(self.base, val, pnum[0] * 20)) all_yum_grp_mbrs = {} def yum_group_make_data(self): global all_yum_grp_mbrs base = self.attr installed, available = base.doGroupLists(uservisible=0) for group in installed + available: # Should use translated_name/nameByLang() for pkgname in group.mandatory_packages: all_yum_grp_mbrs.setdefault(pkgname, []).append(group.name) for pkgname in group.default_packages: all_yum_grp_mbrs.setdefault(pkgname, []).append(group.name) for pkgname in group.optional_packages: all_yum_grp_mbrs.setdefault(pkgname, []).append(group.name) for pkgname, cond in group.conditional_packages.iteritems(): all_yum_grp_mbrs.setdefault(pkgname, []).append(group.name) def yum_group_free_data(self): global all_yum_grp_mbrs all_yum_grp_mbrs = {} def yum_group_get_data(self, pkg): if pkg.name not in all_yum_grp_mbrs: return (self.unknown, self.unknown) return (all_yum_grp_mbrs[pkg.name], all_yum_grp_mbrs[pkg.name]) def _list_data_custom(conduit, data, func, beg=None, end=None, help=None): if help is not None: cmd = ListDataCommands(data[0], data[1], help=help) else: cmd = ListDataCommands(*data) cmd.oget_data = cmd.get_data cmd.get_data = types.MethodType(func, cmd) if beg: cmd.cmd_beg = types.MethodType(beg, cmd) if end: cmd.cmd_end = types.MethodType(end, cmd) conduit.registerCommand(cmd) if help is not None: cmd = InfoDataCommands(data[0], data[1], help=help) else: cmd = InfoDataCommands(*data) cmd.oget_data = cmd.get_data cmd.get_data = types.MethodType(func, cmd) if beg: cmd.cmd_beg = types.MethodType(beg, cmd) if end: cmd.cmd_end = types.MethodType(end, cmd) conduit.registerCommand(cmd) def config_hook(conduit): ''' Yum Plugin Config Hook: Add the 'list-vendors', 'list-baseurls', 'list-packagers', 'list-buildhosts' commands and the info varients. ''' for data in [('vendors', 'vendor'), ('rpm-groups', 'group'), ('packagers', 'packager'), ('licenses', 'license'), ('arches', 'arch'), ('committers', 'committer')]: conduit.registerCommand(ListDataCommands(*data)) conduit.registerCommand(InfoDataCommands(*data)) _list_data_custom(conduit, ('buildhosts', 'buildhost'), buildhost_get_data) _list_data_custom(conduit, ('baseurls', 'url'), url_get_data) _list_data_custom(conduit, ('package-sizes', 'packagesize'), size_get_data) _list_data_custom(conduit, ('archive-sizes', 'archivesize'), size_get_data) _list_data_custom(conduit, ('installed-sizes', 'installedsize'), size_get_data) _list_data_custom(conduit, ('groups', conduit._base), yum_group_get_data, beg=yum_group_make_data, end=yum_group_free_data, help='Display aggregate group data, for matching members') # Buildtime/installtime/committime? �����������������������������������yum-utils-1.1.31/plugins/local/���������������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0016321�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/local/local.conf�����������������������������������������������������������0000664�0000000�0000000�00000002015�11620520663�0020260�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 # Path to the local repository. # repodir = /var/lib/yum/plugins/local # Createreop options. See man createrepo [createrepo] # This option lets you disable createrepo command. This could be useful # for large repositories where metadata is priodically generated by cron # for example. This also has the side effect of only copying the packages # to the local repo directory. # enabled = true # If you want to speedup createrepo with the --cachedir option. Eg. # cachedir = /tmp/createrepo-local-plugin-cachedir # If you need to override the checksum with the --checksum option. Eg. # checksum = sha quiet = true verbose = false skip_stat = false unique_md_filenames = true update = true databases = true # createrepo deltarpm support - set to true to enable. # enable_deltas = false # How many delta packages to build? # deltas = 1 # Where to look for old packages? By default this is repodir. You can # also specify a different directory which holds older packages. # oldpackagedirs = /var/lib/yum/plugins/local �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/local/local.py�������������������������������������������������������������0000664�0000000�0000000�00000013357�11620520663�0017776�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # # Copyright Red Hat Inc. 2009 # # Author: James Antill <james.antill@redhat.com> # # FIXME: Doesn't copy updateinfo over # TODO: Add command to explicitly download pkgs and add them to the repo. # TODO: Some way to say "don't copy from these repos." or "only copy from these" # so we can just get updates/rawhide and not fedora (which doesn't lose # packages). import os import shutil import yum from yum.plugins import TYPE_CORE requires_api_version = '2.5' plugin_type = (TYPE_CORE,) def_local_repo_dir = '/var/lib/yum/plugins/local' local_repo_dir = '' def prereposetup_hook(conduit): global local_repo_dir local_repo_dir = conduit.confString('main', 'repodir', default=def_local_repo_dir) try: d_mtime = os.stat(local_repo_dir).st_mtime r_mtime = os.stat("%s/repodata/repomd.xml" % local_repo_dir).st_mtime if d_mtime > r_mtime: _rebuild(conduit) except: pass def postdownload_hook(conduit): if conduit.getErrors() or os.geteuid(): return reg = False done = 0 for pkg in conduit.getDownloadPackages(): fname = pkg.localPkg() if fname.startswith(local_repo_dir): reg = True continue dest = local_repo_dir + '/' + os.path.basename(fname) if os.path.exists(dest): continue if not done and not os.path.exists(local_repo_dir): os.makedirs(local_repo_dir) done += 1 shutil.copy2(fname, dest) if reg: if hasattr(conduit, 'registerPackageName'): conduit.registerPackageName("yum-plugin-local") if not done: return _rebuild(conduit, done) _reposetup(conduit) def _rebuild(conduit, done=None): enabled = conduit.confBool('createrepo', 'enabled', default=True) if not enabled: return cache_dir = conduit.confString('createrepo', 'cachedir', default=None) checksum = conduit.confString('createrepo', 'checksum', default=None) quiet = conduit.confBool('createrepo', 'quiet', default=True) verbose = conduit.confBool('createrepo', 'verbose', default=False) skip_stat = conduit.confBool('createrepo', 'skip_stat', default=False) unique_md = conduit.confBool('createrepo', 'unique_md_filenames', default=False) update = conduit.confBool('createrepo', 'update', default=True) databases = conduit.confBool('createrepo', 'databases', default=True) deltas = conduit.confBool('createrepo', 'enable_deltas', default=False) num_deltas = conduit.confInt('createrepo', 'deltas', default=None) old_package_dirs = conduit.confString('createrepo', 'oldpackagedirs', default=local_repo_dir) if conduit._base.verbose_logger.isEnabledFor(yum.logginglevels.DEBUG_3): quiet = False args = ["createrepo"] if quiet: args.append("--quiet") if verbose: args.append("--verbose") if databases: args.append("--database") if update: args.append("--update") if unique_md: args.append("--unique-md-filenames") if checksum is not None: args.append("--checksum") args.append(checksum) if skip_stat: args.append("--skip-stat") if cache_dir is not None: args.append("--cachedir") args.append(cache_dir) if deltas: args.append('--deltas') args.append('--oldpackagedirs') args.append(old_package_dirs) if num_deltas is not None: args.append('--num-deltas') args.append(num_deltas) args.append(local_repo_dir) if not quiet: if done is None: conduit.info(2, "== Rebuilding _local repo. ==") else: msg = "== Rebuilding _local repo. with %u new packages ==" % done conduit.info(2, msg) os.spawnvp(os.P_WAIT, "createrepo", args) # For the prerepo. check os.utime("%s/repodata/repomd.xml" % local_repo_dir, None) if not quiet: conduit.info(2, "== Done rebuild of _local repo. ==") def _reposetup(conduit): lrepo = [repo for repo in conduit._base.repos.listEnabled() if repo.id == "_local"] if lrepo: lrepo = lrepo[0] os.unlink("%s/cachecookie" % lrepo.cachedir) return conf_fname = '/etc/yum.repos.d/_local.repo' if os.path.exists(conf_fname): return open(conf_fname, "wb").write("""\ [_local] name=Automatic local repo. (manged by the "local" yum plugin). baseurl=file:%s enabled=1 gpgcheck=true # Metadata expire could be set to "never" because the local plugin will # automatically cause a cache refresh when new packages are added. However # it's really cheap to check, and this way people can dump stuff in whenever # and it never gets out of sync. for long. metadata_expire=1h # Make cost smaller, as we know it's "local". If you really want to be sure, # you can do this ... but the name will do pretty much the same thing, and that # way we can also see the other packages (with: --showduplicates list). # cost=500 """ % local_repo_dir) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/merge-conf/����������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0017251�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/merge-conf/merge-conf.conf�������������������������������������������������0000664�0000000�0000000�00000000142�11620520663�0022137�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 # Set to true, to always get the output (removes the cmd line arg) always=false ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/merge-conf/merge-conf.py���������������������������������������������������0000664�0000000�0000000�00000017105�11620520663�0021651�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # by Aurelien Bompard <abompard@fedoraproject.org> # # TODO: for "i" or "n" actions, check that the files are still there (they # could have been removed during a "z" action). import os, sys from yum.misc import Checksums from rpm import RPMFILE_CONFIG, RPMFILE_NOREPLACE from yum.plugins import TYPE_INTERACTIVE requires_api_version = '2.5' plugin_type = (TYPE_INTERACTIVE,) always = False def config_hook(conduit): parser = conduit.getOptParser() if parser: if conduit.confBool('main', 'always', default=False): global always always = True return parser.add_option('--merge-conf', action='store_true', dest="merge_conf", default=False, help='Merge configuration changes after installation') def posttrans_hook(conduit): opts, args = conduit.getCmdLine() # if we're not invoked or if assumeyes is set then don't run conf = conduit.getConf() if not always and not opts.merge_conf: return if conf.assumeyes: return has_prog = {"meld": False, "vimdiff": False} for d in os.getenv("PATH", "").split(":"): for prog in has_prog.keys(): if os.path.exists(os.path.join(d, prog)): has_prog[prog] = True # short circuit the search if all binaries are found if not False in has_prog.values(): break ts = conduit.getTsInfo() for tsmem in ts.getMembers(): rpmdb = conduit.getRpmDB() version = conduit.getYumVersion().replace(".", "") if int(version) >= 310: packages = rpmdb.searchNevra(tsmem.po.name, tsmem.po.epoch, tsmem.po.version, tsmem.po.release, tsmem.po.arch) else: # Somehow rpmdb.searchNevra() does not give any result on yum <= 3.0.3 all_packages = rpmdb.returnPackages() packages = [] for p in all_packages: if p.name == tsmem.po.name and p.epoch == tsmem.po.epoch and p.version == tsmem.po.version and p.release == tsmem.po.release and p.arch == tsmem.po.arch: packages.append(p) break for package in packages: hdr = package.returnLocalHeader() files = hdr["filenames"] filemodes = hdr["filemodes"] fileflags = hdr["fileflags"] filetuple = zip(files, filemodes, fileflags) for fn, mode, flags in filetuple: if flags & RPMFILE_CONFIG: if flags & RPMFILE_NOREPLACE: mergeConfFiles(tsmem.po.name, fn, True, conduit, has_prog) else: mergeConfFiles(tsmem.po.name, fn, False, conduit, has_prog) def mergeComplete(noreplace, other_file): while True: sys.stdout.write("""\nExternal merge complete, delete "%s"? (y/n) """ % other_file) delete = sys.stdin.readline().strip() if delete == "y": os.remove(other_file) print """"%s" deleted.""" % other_file break elif delete == "n": print """Keeping file "%s".""" % other_file break else: print "Unknown answer, please try again" def mergeConfFiles(pkg, fn, noreplace, conduit, has_prog): if noreplace: local_file = fn pkg_file = "%s.rpmnew" % fn final_file = local_file other_file = pkg_file if not os.path.exists(pkg_file): return p_sum = Checksums() p_sum.update(open(pkg_file, 'r').read()) l_sum = Checksums() l_sum.update(open(local_file, 'r').read()) if l_sum.hexdigest() == p_sum.hexdigest(): conduit.info(2, "Config files '%s' and '%s' are identical, I'm removing the duplicate one" % (local_file, pkg_file)) os.remove(pkg_file) return else: local_file = "%s.rpmsave" % fn pkg_file = fn final_file = pkg_file other_file = local_file if not os.path.exists(local_file): return p_sum = Checksums() p_sum.update(open(pkg_file, 'r').read()) l_sum = Checksums() l_sum.update(open(local_file, 'r').read()) if l_sum.hexdigest() == p_sum.hexdigest(): conduit.info(2, "Config files '%s' and '%s' are identical, I'm removing the duplicate one" % (local_file, pkg_file)) os.remove(local_file) return print """\nPackage %s: merging configuration for file "%s":""" % (pkg, final_file) answer = "" while answer != "q": if noreplace: print "By default, RPM would keep your local version and rename the new one to %s" % pkg_file else: print "By default, RPM would rename your local version to %s and put the package's version in place" % local_file print "What do you want to do ?" print " - diff the two versions (d)" print " - do the default RPM action (q)" if noreplace: print " - install the package's version (i)" else: print " - keep your version (n)" if has_prog["meld"]: print " - merge interactively with meld (m)" if has_prog["vimdiff"]: print " - merge interactively with vim (v)" print " - background this process and examine manually (z)" sys.stdout.write("Your answer ? ") answer = sys.stdin.readline().strip() if answer == "d": os.system("""(echo -e "---: local file\n+++: package's file\n"; diff -u '%s' '%s') | less""" % (local_file, pkg_file)) elif answer == "i": print "Installing the package's version..." if noreplace: # only useful if noreplace os.rename(local_file, local_file+".rpmsave") os.rename(pkg_file, final_file) print "Your local version has been renamed to %s.rpmsave" % local_file break elif answer == "n": print "Keeping your version..." if not noreplace: # Only useful if not noreplace os.rename(pkg_file, pkg_file+".rpmnew") os.rename(local_file, final_file) print "The package's version has been renamed to %s.rpmnew" % pkg_file break elif answer == "z": print "Type 'exit' when you're done" os.system(os.getenv("SHELL", "bash")) elif answer == "q": print "Choosing RPM's default action." elif answer == "m" and has_prog["meld"]: os.system("""meld '%s' '%s'""" % (other_file, final_file)) mergeComplete(noreplace, other_file) break elif answer == "v" and has_prog["vimdiff"]: os.system("""vimdiff '%s' '%s'""" % (final_file, other_file)) mergeComplete(noreplace, other_file) break else: print "Unknown answer, please try again" �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/nofsync/�������������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0016706�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/nofsync/nofsync.conf�������������������������������������������������������0000664�0000000�0000000�00000000022�11620520663�0021226�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/nofsync/nofsync.py���������������������������������������������������������0000664�0000000�0000000�00000002665�11620520663�0020750�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # by Panu Matilainen <pmatilai@laiskiainen.org> from yum.plugins import TYPE_INTERACTIVE requires_api_version = '2.4' plugin_type = (TYPE_INTERACTIVE,) def init_hook(conduit): parser = conduit.getOptParser() if parser: if hasattr(parser, 'plugin_option_group'): parser = parser.plugin_option_group parser.add_option('--nofsync', dest='nofsync', default=False, action='store_true', help='Disable database syncing during transaction (DANGEROUS)') def pretrans_hook(conduit): opts, args = conduit.getCmdLine() if opts and opts.nofsync: import rpm dbconf = rpm.expandMacro('%{_dbi_config_Packages} nofsync') rpm.addMacro('_dbi_config_Packages', dbconf) ���������������������������������������������������������������������������yum-utils-1.1.31/plugins/post-transaction-actions/��������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0022175�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/post-transaction-actions/post-transaction-actions.conf���������������������0000664�0000000�0000000�00000000066�11620520663�0030014�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled = 1 actiondir = /etc/yum/post-actions/ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/post-transaction-actions/post-transaction-actions.py�����������������������0000664�0000000�0000000�00000014221�11620520663�0027515�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Copyright 2008 Red Hat, Inc # written by Seth Vidal <skvidal@fedoraproject.org> """ This plugin runs actions following the transaction based on the content of the transaction. """ from yum.plugins import TYPE_CORE from yum.constants import * import yum.misc from yum.parser import varReplace from yum.packages import parsePackages import fnmatch import re import os import glob import shlex requires_api_version = '2.4' plugin_type = (TYPE_CORE,) _just_installed = {} # pkgtup = po def parse_actions(ddir, conduit): """read in .action files from ddir path. store content in a list of tuples""" action_tuples = [] # (action key, action_state, shell command) action_file_list = [] if os.access(ddir, os.R_OK): action_file_list.extend(glob.glob(ddir + "*.action")) if action_file_list: for f in action_file_list: for line in open(f).readlines(): line = line.strip() if line and line[0] != "#": try: (a_key, a_state, a_command) = line.split(':') except ValueError,e: conduit.error(2,'Bad Action Line: %s' % line) continue else: action_tuples.append((a_key, a_state, a_command)) return action_tuples def _get_installed_po(rpmdb, pkgtup): (n,a,e,v,r) = pkgtup if pkgtup in _just_installed: return _just_installed[pkgtup] return rpmdb.searchNevra(name=n, arch=a, epoch=e, ver=v, rel=r)[0] def _convert_vars(txmbr, command): """converts %options on the command to their values from the package it is running it for: takes $name, $arch, $ver, $rel, $epoch, $state, $repoid""" state_dict = { TS_INSTALL: 'install', TS_TRUEINSTALL: 'install', TS_OBSOLETING: 'obsoleting', TS_UPDATE: 'updating', TS_ERASE: 'remove', TS_OBSOLETED: 'obsoleted', TS_UPDATED: 'updated'} try: state = state_dict[txmbr.output_state] except KeyError: state = 'unknown - %s' % txmbr.output_state vardict = {'name': txmbr.name, 'arch': txmbr.arch, 'ver': txmbr.version, 'rel': txmbr.release, 'epoch': txmbr.epoch, 'repoid': txmbr.repoid, 'state': state } result = varReplace(command, vardict) return result def posttrans_hook(conduit): # we have provides/requires for everything # we do not have filelists for erasures # we have to fetch filelists for the package object for installs/updates action_dir = conduit.confString('main','actiondir','/etc/yum/post-actions/') action_tuples = parse_actions(action_dir, conduit) commands_to_run = {} ts = conduit.getTsInfo() rpmdb = conduit.getRpmDB() all = ts.getMembers() removes = ts.getMembersWithState(output_states=TS_REMOVE_STATES) installs = ts.getMembersWithState(output_states=TS_INSTALL_STATES) updates = ts.getMembersWithState(output_states=[TS_UPDATE, TS_OBSOLETING]) for (a_k, a_s, a_c) in action_tuples: #print 'if %s in state %s the run %s' %( a_k, a_s, a_c) if a_s == 'update': pkgset = updates elif a_s == 'install': pkgset = installs elif a_s == 'remove': pkgset = removes elif a_s == 'any': pkgset = all else: # no idea what this is skip it conduit.error(2,'whaa? %s' % a_s) continue if a_k.startswith('/'): if yum.misc.re_glob(a_k): restring = fnmatch.translate(a_k) c_string = re.compile(restring) for txmbr in pkgset: matched = False #print '%s - %s' % txmbr.name, txmbr.ts_state if txmbr.po.state in TS_INSTALL_STATES: thispo = _get_installed_po(rpmdb, txmbr.pkgtup) if not yum.misc.re_glob(a_k): if a_k in thispo.filelist + thispo.dirlist + thispo.ghostlist: thiscommand = _convert_vars(txmbr, a_c) commands_to_run[thiscommand] = 1 matched = True else: for name in thispo.filelist + thispo.dirlist + thispo.ghostlist: if c_string.match(name): thiscommand = _convert_vars(txmbr, a_c) commands_to_run[thiscommand] = 1 matched = True break if matched: break continue if a_k.find('/') == -1: # pkgspec pkgs = [ txmbr.po for txmbr in pkgset ] e,m,u = parsePackages(pkgs, [a_k]) if not u: for pkg in e+m: for txmbr in ts.getMembers(pkgtup=pkg.pkgtup): thiscommand = _convert_vars(txmbr, a_c) commands_to_run[thiscommand] = 1 continue for comm in commands_to_run.keys(): try: args = shlex.split(comm) except ValueError, e: conduit.error(2,"command was not parseable: %s" % comm) continue #try conduit.info(2,'Running post transaction command: %s' % comm) p = os.system(comm) #except? �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/post-transaction-actions/sample.action�������������������������������������0000664�0000000�0000000�00000001405�11620520663�0024655�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#action_key:transaction_state:command # action_key can be: pkgglob, /path/to/file (wildcards allowed) # transaction_state can be: install,update,remove,any # command can be: any shell command # the following variables are allowed to be passed to any command: # $name - package name # $arch - package arch # $ver - package version # $rel - package release # $epoch - package epoch # $repoid - package repository id # $state - text string of state of the package in the transaction set # # file matches cannot be used with removes b/c we don't have the info available *:install:touch /tmp/$name-installed zsh:remove:touch /tmp/zsh-removed zsh:install:touch /tmp/zsh-installed-also /bin/z*h:install:touch /tmp/bin-zsh-installed z*h:any:touch /tmp/bin-zsh-any �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/priorities/����������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0017420�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/priorities/ChangeLog�������������������������������������������������������0000664�0000000�0000000�00000001412�11620520663�0021170�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������* Thu Nov 8 Daniel de Kok <daniel@centos.org> - 0.0.7 - Only add an option if an option parser is returned. * Mon Nov 5 Daniel de Kok <daniel@centos.org> - 0.0.6 - Make excluding based on package name + arch optional. Default to exclusion by name. * Fri Oct 27 Tim Lauridsen <tla@rasmil.dk> - 0.0.4 - made code to work with current yum API and yum 2.4.x API - Added output of exclude packages when yum -d3 is used * Tue May 9 Daniel de Kok <danieldk@pobox.com> - 0.0.3 - Correct a loop operation (s/continue/break/). - Add a bit more documentation. * Mon May 8 Daniel de Kok <danieldk@pobox.com> - 0.0.2 - Add the 'check_obsoletes' option, which forces priority protection of obsoleted packages. * Sun May 7 Daniel de Kok <danieldk@pobox.com> - 0.0.1 - Initial release ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/priorities/README����������������������������������������������������������0000664�0000000�0000000�00000003407�11620520663�0020304�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������priorities ---------- * Introduction * This plugins is inspired by the protectbase plugin, and enables/disables packages based on a repository priority. * Enabling the plugin * You can install this plugin by copying it to /usr/lib/yum-plugins. To enable this plugin, make sure that you have 'plugins=1' in /etc/yum.conf, and create the file /etc/yum/pluginconf.d/priorities.conf with the following content: [main] enabled=1 If you also want the plugin to protect high-priority repositories against obsoletes in low-priority repositories, enable the 'check_obsoletes' bool: check_obsoletes=1 By default, this plugin excludes packages from lower priority repositories based on the package name. If you want to exclude packages based ony the package name and architecture, enable the 'only_samearch' bool: only_samearch=N You can also temporarily enable this option with the '--samearch-priorities' command-line option. * Setting repository priorities * You can add priorities to repositories by adding the line: priority=N to the repository entry, where N is an integer number. The default priority for repositories is 99. The repositories with the lowest number have the highest priority. * Bugs * Please report errors to Daniel de Kok <daniel@centos.org> * License * Copyright (c) 2006-2007 Daniel de Kok This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/priorities/priorities.conf�������������������������������������������������0000664�0000000�0000000�00000000023�11620520663�0022453�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled = 1 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/priorities/priorities.py���������������������������������������������������0000664�0000000�0000000�00000014700�11620520663�0022165�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/python # # yum-plugin-priorities 0.0.7 # # Copyright (c) 2006-2007 Daniel de Kok # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # This plugins is inspired by the protectbase plugin, and enables/disables # packages based on a repository priority. # # You can install this plugin by copying it to /usr/lib/yum-plugins. To # enable this plugin, make sure that you have 'plugins=1' in /etc/yum.conf, # and create the file /etc/yum/pluginconf.d/priorities.conf with the # following content: # # [main] # enabled=1 # # If you also want the plugin to protect high-priority repositories against # obsoletes in low-priority repositories, enable the 'check_obsoletes' bool: # # check_obsoletes=1 # # By default, this plugin excludes packages from lower priority repositories # based on the package name. If you want to exclude packages based ony the # package name and architecture, enable the 'only_samearch' bool: # # only_samearch=N # # You can add priorities to repositories, by adding the line: # # priority=N # # to the repository entry, where N is an integer number. The default # priority for repositories is 99. The repositories with the lowest # number have the highest priority. # # Please report errors to Daniel de Kok <danieldk@pobox.com> from yum.constants import * from yum.plugins import TYPE_CORE from yum import config import yum check_obsoletes = False only_samearch = False requires_api_version = '2.1' plugin_type = (TYPE_CORE,) def config_hook(conduit): global check_obsoletes global only_samearch # Plugin configuration check_obsoletes = conduit.confBool('main', 'check_obsoletes', default = False) only_samearch = conduit.confBool('main', 'only_samearch', default = False) # Repo priorities if yum.__version__ >= '2.5.0': # New style : yum >= 2.5 config.RepoConf.priority = config.IntOption(99) else: # Old add extra options style conduit.registerOpt('priority', PLUG_OPT_INT, PLUG_OPT_WHERE_REPO, 99) # Command-line options. parser = conduit.getOptParser() if parser: if hasattr(parser, 'plugin_option_group'): parser = parser.plugin_option_group parser.add_option('', '--samearch-priorities', dest='samearch', action='store_true', default = False, help="Priority-exclude packages based on name + arch") def _all_repo_priorities_same(allrepos): """ Are all repos are at the same priority """ first = None for repo in allrepos: if first is None: first = repo.priority elif first != repo.priority: return False return True def exclude_hook(conduit): global only_samearch global check_obsoletes allrepos = conduit.getRepos().listEnabled() # If they haven't done anything, don't do any work if _all_repo_priorities_same(allrepos): return # Check whether the user specified the --samearch option. opts, commands = conduit.getCmdLine() if opts and opts.samearch: only_samearch = True cnt = 0 if check_obsoletes and not conduit._base.conf.obsoletes: check_obsoletes = False if check_obsoletes: obsoletes = conduit._base.up.rawobsoletes # Build a dictionary with package priorities. Either with arch or # archless, based on the user's settings. if only_samearch: pkg_priorities = dict() if check_obsoletes or not only_samearch: pkg_priorities_archless = dict() for repo in allrepos: if repo.enabled: if only_samearch: repopkgs = _pkglist_to_dict(conduit.getPackages(repo), repo.priority, True) _mergeprioritydicts(pkg_priorities, repopkgs) if check_obsoletes or not only_samearch: repopkgs_archless = _pkglist_to_dict(conduit.getPackages(repo), repo.priority) _mergeprioritydicts(pkg_priorities_archless, repopkgs_archless) # Eliminate packages that have a low priority for repo in allrepos: if repo.enabled: for po in conduit.getPackages(repo): delPackage = False if only_samearch: key = "%s.%s" % (po.name,po.arch) if key in pkg_priorities and pkg_priorities[key] < repo.priority: delPackage = True else: key = "%s" % po.name if key in pkg_priorities_archless and pkg_priorities_archless[key] < repo.priority: delPackage = True if delPackage: conduit.delPackage(po) cnt += 1 conduit.info(3," --> %s from %s excluded (priority)" % (po,po.repoid)) # If this packages obsoletes other packages, check whether # one of the obsoleted packages is not available through # a repo with a higher priority. If so, remove this package. if check_obsoletes: if po.pkgtup in obsoletes: obsolete_pkgs = obsoletes[po.pkgtup] for obsolete_pkg in obsolete_pkgs: pkg_name = obsolete_pkg[0] if pkg_name in pkg_priorities_archless and pkg_priorities_archless[pkg_name] < repo.priority: conduit.delPackage(po) cnt += 1 conduit.info(3," --> %s from %s excluded (priority)" % (po,po.repoid)) break if cnt: conduit.info(2, '%d packages excluded due to repository priority protections' % cnt) def _pkglist_to_dict(pl, priority, addArch = False): out = dict() for p in pl: if addArch: key = "%s.%s" % (p.name,p.arch) out[key] = priority else: out[p.name] = priority return out def _mergeprioritydicts(dict1, dict2): for package in dict2.keys(): if package not in dict1 or dict2[package] < dict1[package]: dict1[package] = dict2[package] ����������������������������������������������������������������yum-utils-1.1.31/plugins/protectbase/���������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0017542�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/protectbase/protectbase.conf�����������������������������������������������0000664�0000000�0000000�00000000023�11620520663�0022717�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled = 1 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/protectbase/protectbase.py�������������������������������������������������0000664�0000000�0000000�00000004635�11620520663�0022437�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # by Menno Smits <menno@freshfoo.com> ''' This plugin allows certain repositories to be protected. Packages in the protected repositories can't be overridden by packages in non-protected repositories even if the non-protected repo has a later version. This is mainly useful for preventing 3rd party repositories from interfering with packages from core, updates, extras and livna. Enable the plugin and add 'protect=yes' to the config of all repos you want to protect. ''' from yum.plugins import TYPE_CORE from yum import config requires_api_version = '2.4' plugin_type = (TYPE_CORE,) def config_hook(conduit): '''Add options to Yum's configuration ''' config.YumConf.protect = config.BoolOption(False) config.RepoConf.protect = config.Inherit(config.YumConf.protect) def exclude_hook(conduit): '''Exclude packages from non-protected repositories that may upgrade packages from protected repositories. ''' cnt = 0 allrepos = conduit.getRepos().listEnabled() for repo1 in allrepos: if repo1.enabled and repo1.protect: repo1pkgs = _pkglisttodict(conduit.getPackages(repo1)) for repo2 in allrepos: if not repo2.enabled or repo2.protect: continue for po in conduit.getPackages(repo2): if po.name in repo1pkgs: conduit.delPackage(po) cnt += 1 if cnt: if hasattr(conduit, 'registerPackageName'): conduit.registerPackageName("yum-plugin-protectbase") conduit.info(2, '%d packages excluded due to repository protections' % cnt) def _pkglisttodict(pl): out = {} for p in pl: out[p.name] = 1 return out ���������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/ps/������������������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0015651�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/ps/ps.conf�����������������������������������������������������������������0000664�0000000�0000000�00000000021�11620520663�0017133�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/ps/ps.py�������������������������������������������������������������������0000664�0000000�0000000�00000014473�11620520663�0016656�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # # Copyright Red Hat Inc. 2010 # # Author: James Antill <james.antill@redhat.com> # # Examples: # # yum ps k\* # yum ps all import yum.misc as misc from yum.plugins import TYPE_INTERACTIVE from urlgrabber.progress import format_number try: import utils except ImportError: # This only happens when we are imported but aren't going to be run # due to being type ITERACTIVE. utils = None import fnmatch import time requires_api_version = '2.5' plugin_type = (TYPE_INTERACTIVE,) def _rpmdb_return_running_packages(self, return_pids=False): """returns a list of yum installed package objects which own a file that are currently running or in use.""" pkgs = {} for pid in misc.return_running_pids(): for fn in misc.get_open_files(pid): for pkg in self.searchFiles(fn): if pkg not in pkgs: pkgs[pkg] = set() pkgs[pkg].add(pid) if return_pids: return pkgs return sorted(pkgs.keys()) class PSCommand: def getNames(self): return ['ps'] def getUsage(self): return "[all|updates|restart] [pkgs...]" def getSummary(self): return "List processes, which are packages" def doCheck(self, base, basecmd, extcmds): pass def doCommand(self, base, basecmd, extcmds): show_all = False show_upgrades = False if extcmds and extcmds[0] == 'all': show_all = True extcmds = extcmds[1:] elif extcmds and extcmds[0] in ('updates', 'upgrades'): show_upgrades = True extcmds = extcmds[1:] elif extcmds and extcmds[0] == 'restarts': extcmds = extcmds[1:] # Call base.rpmdb.return_running_packages() eventually. pkgs = _rpmdb_return_running_packages(base.rpmdb, return_pids=True) ts = base.rpmdb.readOnlyTS() kern_pkgtup = misc.get_running_kernel_pkgtup(ts) kern_pkg = None for pkg in sorted(base.rpmdb.searchPkgTuple(kern_pkgtup)): kern_pkg = pkg if kern_pkg is not None: kern_pkgs = base.rpmdb.searchNames([kern_pkgtup[0]]) if kern_pkgs: kern_latest = sorted(kern_pkgs)[-1] if kern_latest.verGT(kern_pkg): pkgs[kern_latest] = [0] try: # Get boot time, this is what get_process_info() uses: for line in open("/proc/stat"): if line.startswith("btime "): kern_boot = int(line[len("btime "):-1]) break except: kern_boot = 0 print " %8s %-16s %8s %8s %10s %s" % ("pid", "proc", "CPU", "RSS", "State", "uptime") for pkg in sorted(pkgs): if extcmds: for cmd in extcmds: if fnmatch.fnmatch(pkg.name, cmd): break if fnmatch.fnmatch(pkg.ui_nevra, cmd): break else: continue apkgs = base.pkgSack.searchNames([pkg.name]) state = '' if not apkgs: apkgs = 'Not available!' else: apkgs = sorted(apkgs)[-1] if apkgs.verEQ(pkg): apkgs = '' state = '' elif apkgs.verGT(pkg): state = 'Upgrade' apkgs = apkgs.ui_nevra[len(apkgs.name)+1:] else: state = 'Newer' apkgs = apkgs.ui_nevra[len(apkgs.name)+1:] procs = [] for pid in pkgs[pkg]: pid = int(pid) now = int(time.time()) if pid: ps_info = utils.get_process_info(pid) if ps_info is None: ps_info = {'name' : '<Unknown>', 'start_time' : 0, 'state' : 'Unknown', 'vmrss' : 0, 'utime' : 0, 'stime' : 0} else: ps_info = {'name' : '<kernel>', 'start_time' : kern_boot, 'state' : 'Running', 'vmrss' : 0, 'utime' : 0, 'stime' : 0} procs.append((ps_info['start_time'], pid, ps_info)) oldest_proc = min([t[0] for t in procs]) if show_all: pass elif oldest_proc < pkg.installtime: pass elif show_upgrades and state == 'Upgrade': pass else: continue print "%s %s %s" % (pkg, state, apkgs) for start_time, pid, ps_info in sorted(procs): ago = utils.seconds_to_ui_time(now - start_time) nr = ' ' if start_time <= pkg.installtime: nr = '*' name = ps_info['name'] cpu = int(ps_info['utime']) + int(ps_info['stime']) cpu = "%d:%02d" % (cpu / 60, cpu % 60) rss = format_number(int(ps_info['vmrss']) * 1024) S = ps_info['state'] print " %8d %-16.16s %8s %7sB %10s: %s%s" % (pid, name, cpu, rss, S,nr, ago) rc = 0 return rc, ['%s' % basecmd] def needTs(self, base, basecmd, extcmds): return False def config_hook(conduit): ''' Yum Plugin Config Hook: And the 'ps' command. ''' conduit.registerCommand(PSCommand()) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/puppetverify/��������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0017771�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/puppetverify/puppetverify.conf���������������������������������������������0000664�0000000�0000000�00000000110�11620520663�0023372�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 puppet_state_file = /var/lib/puppet/state/state.yaml ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/puppetverify/puppetverify.py�����������������������������������������������0000664�0000000�0000000�00000004425�11620520663�0023112�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Copyright 2011 Red Hat, Inc # written by Seth Vidal <skvidal@fedoraproject.org> # this plugin will modify the verify checks with the checksums # from the files in puppet - so you don't get false positives versus # what puppet thinks the file should be. from yum.plugins import TYPE_CORE from yum.constants import * import yaml import os def generic_string_constructor(loader, node): return loader.construct_scalar(node) yaml.add_constructor(u'!ruby/sym', generic_string_constructor) requires_api_version = '2.4' plugin_type = (TYPE_CORE,) yaml_data = {} def get_checksum(thisfn): global yaml_data if os.path.exists(puppet_state_file): if not yaml_data: yaml_data = yaml.load(open(puppet_state_file, 'r').read()) p_fn = "File[%s]" % thisfn if p_fn not in yaml_data: return v = yaml_data[p_fn] if 'checksums' in v: if 'md5' in v['checksums']: # are puppet checksums in anything else? csum = v['checksums']['md5'].replace('{md5}', '') return ('md5', csum) def verify_package_hook(conduit): for i in conduit.verify_package: results = get_checksum(i.filename) if not results: continue i.digest = results # tuple(csumtype, csum) # you can set other values like file mode, size, date, etc here def config_hook(conduit): ''' Yum Plugin Config Hook: ''' global puppet_state_file puppet_state_file = conduit.confString('main', 'puppet_state_file', default='/var/lib/puppet/state/state.yaml') �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/refresh-updatesd/����������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0020474�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/refresh-updatesd/README����������������������������������������������������0000664�0000000�0000000�00000000536�11620520663�0021360�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is refresh-updatesd, a plugin for Yum. refresh-updatesd tells yum-updatesd to check for updates when yum exits. This way, if you run 'yum update' and install all available updates, puplet will almost instantly update itself to reflect this. The plugin is very dumb, It should probably send a message when yum detects updated packages as well. ������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/refresh-updatesd/refresh-updatesd.conf�������������������������������������0000664�0000000�0000000�00000000021�11620520663�0024601�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/refresh-updatesd/refresh-updatesd.py���������������������������������������0000664�0000000�0000000�00000003502�11620520663�0024313�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# A plugin for yum which notifies yum-updatesd to refresh its data # # Written by James Bowes <jbowes@redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # version 0.0.5 import os import dbus from yum.plugins import TYPE_CORE requires_api_version = '2.5' plugin_type = TYPE_CORE def posttrans_hook(conduit): """ Tell yum-updatesd to refresh its state. Run only after an rpm transaction. """ if os.geteuid(): # If we aren't root, we _can't_ have updated anything return try: bus = dbus.SystemBus() except dbus.DBusException, e: conduit.info(2, "Unable to connect to dbus") conduit.info(6, "%s" %(e,)) return try: o = bus.get_object('org.freedesktop.DBus', '/') o = dbus.Interface(o, "org.freedesktop.DBus") if not o.NameHasOwner("edu.duke.linux.yum"): conduit.info(2, "yum-updatesd not on the bus") return except dbus.DBusException, e: conduit.info(2, "Unable to look at what's on dbus") conduit.info(6, "%s" %(e,)) return try: updatesd_proxy = bus.get_object('edu.duke.linux.yum', '/Updatesd') updatesd_iface = dbus.Interface(updatesd_proxy, 'edu.duke.linux.yum') updatesd_iface.CheckNow() except dbus.DBusException, e: conduit.info(2, "Unable to send message to yum-updatesd") conduit.info(6, "%s" %(e,)) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/remove-with-leaves/��������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0020752�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/remove-with-leaves/remove-with-leaves.conf���������������������������������0000664�0000000�0000000�00000000067�11620520663�0025347�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled = 1 #exclude_bin = 1 #remove_always = 1 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/remove-with-leaves/remove-with-leaves.py�����������������������������������0000664�0000000�0000000�00000012577�11620520663�0025063�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Copyright 2008 Red Hat, Inc # written by Seth Vidal <skvidal@fedoraproject.org> #FIXME: # When two requirements of a pkg being removed mutually require each other # there's no way to have one know about the other and have this know to remove both # ex: foo is being removed. it requires bar. bar requires baz. baz requires bar. # nothing other than foo and baz require bar. """ This plugin allows packages to clean up dependencies they pulled in which are not in use by any other package. """ from yum.plugins import TYPE_CORE from yum.constants import * requires_api_version = '2.4' plugin_type = (TYPE_CORE,) _requires_cache = {} ignore_list = ['glibc', 'bash', 'libgcc'] exclude_bin = False remove_always = False def _requires_this_package(rpmdb, pkg): if pkg in _requires_cache: return _requires_cache[pkg] requirers = {} for prov in pkg.provides: for req_pkg in rpmdb.getRequires(prov[0], prov[1], prov[2]): if req_pkg == pkg: continue requirers[req_pkg.pkgtup] = 1 # do filelists, too :( for prov in pkg.filelist + pkg.dirlist + pkg.ghostlist: for req_pkg in rpmdb.getRequires(prov): if req_pkg == pkg: continue requirers[req_pkg.pkgtup] = 1 _requires_cache[pkg] = requirers.keys() return requirers.keys() def postresolve_hook(conduit): global exclude_bin, remove_always opts, commands = conduit.getCmdLine() if opts and hasattr(opts,'exclude_bin'): if exclude_bin or opts.exclude_bin: exclude_bin = True if (opts and opts.remove_leaves) or remove_always: # get all the items in tsInfo = conduit.getTsInfo() rpmdb = conduit.getRpmDB() oldlen = 0 while oldlen != len(tsInfo): oldlen = len(tsInfo) for txmbr in tsInfo.getMembersWithState(output_states=[TS_ERASE]): if conduit._base.allowedMultipleInstalls(txmbr.po): # these make everything dodgy, skip it continue for req in txmbr.po.requires: if req[0].startswith('rpmlib('): continue for pkg in rpmdb.getProvides(req[0], req[1], req[2]): if pkg.pkgtup in [ txmbr.po.pkgtup for txmbr in tsInfo.getMembersWithState(output_states=[TS_ERASE]) ]: continue # skip ones already marked for remove, kinda pointless if pkg.name in ignore_list: # there are some pkgs which are NEVER going to be leafremovals continue # Skip manually installed packages. if pkg.yumdb_info.get('reason') == 'user': continue non_removed_requires = [] for req_pkgtup in _requires_this_package(rpmdb,pkg): pkgtups = [ txmbr.po.pkgtup for txmbr in tsInfo.getMembersWithState(output_states=[TS_ERASE]) ] if req_pkgtup not in pkgtups: non_removed_requires.append(req_pkgtup) if exclude_bin: # if this pkg is a binary of some kind, skip it is_bin=False for file_name in pkg.filelist: if file_name.find('bin') != -1: is_bin = True if is_bin: continue if not non_removed_requires: if hasattr(conduit, 'registerPackageName'): conduit.registerPackageName("yum-plugin-remove-with-leaves") conduit.info(2, 'removing %s. It is not required by anything else.' % pkg) conduit._base.remove(pkg) def config_hook(conduit): global exclude_bin, remove_always exclude_bin = conduit.confBool('main', 'exclude_bin', default=False) remove_always = conduit.confBool('main', 'remove_always', default=False) parser = conduit.getOptParser() if parser: if hasattr(parser, 'plugin_option_group'): parser = parser.plugin_option_group parser.add_option("", "--leaves-exclude-bin", dest="exclude_bin", action="store_true", default=False, help="do not remove leaf packages which contain executable binaries") parser.add_option('', '--remove-leaves', dest='remove_leaves', action='store_true', default=False, help="remove dependencies no longer needed by any other packages") ���������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/rpm-warm-cache/������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0020032�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/rpm-warm-cache/rpm-warm-cache.conf�����������������������������������������0000664�0000000�0000000�00000000023�11620520663�0023477�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled = 1 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/rpm-warm-cache/rpm-warm-cache.py�������������������������������������������0000664�0000000�0000000�00000003440�11620520663�0023210�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # by Ralf Ertzinger <ralf@skytale.net> # # This plugin reads the complete RPM database into the buffer cache # in order to improve database reads later on. # Don't use this if you're short on memory, anyways. from yum.plugins import TYPE_CORE from os import walk, path requires_api_version = '2.1' plugin_type = (TYPE_CORE,) def postreposetup_hook(conduit): opts, commands = conduit.getCmdLine() if commands: cmd = commands[0] else: # No command given, do it as it's cheap enough cmd = 'install' if (cmd in ('upgrade', 'install', 'remove', 'search') or cmd.startswith('list') or cmd.startswith('info')): try: for root, dirs, files in walk('/var/lib/rpm'): for fn in files: f = open(path.join(root, fn)) d = f.read(1024*1024) while(len(d) > 0): d = f.read(1024*1024) f.close() except: # Do nothing in case something fails, caching is entirely # optional. pass ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/security/������������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0017076�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/security/security.conf�����������������������������������������������������0000664�0000000�0000000�00000000021�11620520663�0021605�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/security/security.py�������������������������������������������������������0000775�0000000�0000000�00000100720�11620520663�0021322�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # # Copyright Red Hat Inc. 2007, 2008 # # Author: James Antill <james.antill@redhat.com> # # Examples: # # yum --security info updates # yum --security list updates # yum --security check-update # yum --security update # # yum --cve CVE-2007-1667 <cmd> # yum --bz 235374 --bz 234688 <cmd> # yum --advisory FEDORA-2007-420 --advisory FEDORA-2007-346 <cmd> # # yum list-updateinfo # yum list-updateinfo bugzillas / bzs # yum list-updateinfo cves # yum list-updateinfo security / sec # yum list-updateinfo new # # yum summary-updateinfo # # yum update-minimal --security import yum import fnmatch from yum.plugins import TYPE_INTERACTIVE from yum.update_md import UpdateMetadata import logging # for commands from yum.constants import * import rpmUtils.miscutils requires_api_version = '2.5' plugin_type = (TYPE_INTERACTIVE,) __package_name__ = "yum-plugin-security" # newpackages is weird, in that we'll never display that because we filter to # things relevant to installed pkgs... __update_info_types__ = ("security", "bugfix", "enhancement", "recommended", "newpackage") def _rpm_tup_vercmp(tup1, tup2): """ Compare two "std." tuples, (n, a, e, v, r). """ return rpmUtils.miscutils.compareEVR((tup1[2], tup1[3], tup1[4]), (tup2[2], tup2[3], tup2[4])) class CliError(yum.Errors.YumBaseError): """ Command line interface related Exception. """ def __init__(self, args=''): yum.Errors.YumBaseError.__init__(self) self.args = args def ysp_gen_metadata(repos): """ Generate the info. from the updateinfo.xml files. """ md_info = UpdateMetadata() for repo in repos: if not repo.enabled: continue try: # attempt to grab the updateinfo.xml.gz from the repodata md_info.add(repo) except yum.Errors.RepoMDError: continue # No metadata found for this repo return md_info def ysp__safe_refs(refs): """ Sometimes refs == None, if so return the empty list here. So we don't have to check everywhere. """ if refs == None: return [] return refs def _match_sec_cmd(sec_cmds, pkgname, notice): for i in sec_cmds: if fnmatch.fnmatch(pkgname, i): return i if notice['update_id'] == i: return i return None def _has_id(used_map, refs, ref_type, ref_ids): ''' Check if the given ID is a match. ''' for ref in ysp__safe_refs(refs): if ref['type'] != ref_type: continue if ref['id'] not in ref_ids: continue used_map[ref_type][ref['id']] = True return ref return None def ysp_should_filter_pkg(opts, pkgname, notice, used_map): """ Do the package filtering for should_show and should_keep. """ rcmd = _match_sec_cmd(opts.sec_cmds, pkgname, notice) if rcmd: used_map['cmd'][rcmd] = True return True elif opts.advisory and notice['update_id'] in opts.advisory: used_map['id'][notice['update_id']] = True return True elif (opts.severity and notice['type'] == 'security' and notice['severity'] in opts.severity): used_map['sev'][notice['severity']] = True return True elif opts.cve and _has_id(used_map, notice['references'], "cve", opts.cve): return True elif opts.bz and _has_id(used_map, notice['references'],"bugzilla",opts.bz): return True # FIXME: Add opts for enhancement/etc.? -- __update_info_types__ elif (opts.security and notice['type'] == 'security' and (not opts.severity or 'severity' not in notice or not notice['severity'])): return True elif opts.bugfixes and notice['type'] == 'bugfix': return True elif not (opts.advisory or opts.cve or opts.bz or opts.security or opts.bugfixes or opts.sec_cmds or opts.severity): return True # This is only possible from should_show_pkg return False def ysp_has_info_md(rname, md): if rname in __update_info_types__: if md['type'] == rname: return md for ref in ysp__safe_refs(md['references']): if ref['type'] != rname: continue return md def ysp_gen_used_map(opts): used_map = {'bugzilla' : {}, 'cve' : {}, 'id' : {}, 'cmd' : {}, 'sev' : {}} for i in opts.sec_cmds: used_map['cmd'][i] = False for i in opts.advisory: used_map['id'][i] = False for i in opts.bz: used_map['bugzilla'][i] = False for i in opts.cve: used_map['cve'][i] = False for i in opts.severity: used_map['sev'][i] = False return used_map def ysp_chk_used_map(used_map, msg): for i in used_map['cmd']: if not used_map['cmd'][i]: msg('No update information found for \"%s\"' % i) for i in used_map['id']: if not used_map['id'][i]: msg('Advisory \"%s\" not found applicable for this system' % i) for i in used_map['bugzilla']: if not used_map['bugzilla'][i]: msg('BZ \"%s\" not found applicable for this system' % i) for i in used_map['cve']: if not used_map['cve'][i]: msg('CVE \"%s\" not found applicable for this system' % i) for i in used_map['sev']: if not used_map['sev'][i]: msg('Severity \"%s\" not found applicable for this system' % i) class UpdateinfoCommand: # Old command names... direct_cmds = {'list-updateinfo' : 'list', 'list-security' : 'list', 'list-sec' : 'list', 'info-updateinfo' : 'info', 'info-security' : 'info', 'info-sec' : 'info', 'summary-updateinfo' : 'summary'} # Note that this code (instead of using inheritance and multiple # cmd classes) means that "yum help" only displays the updateinfo command. # Which is what we want, because the other commands are just backwards # compatible gunk we don't want the user using). def getNames(self): return ['updateinfo'] + sorted(self.direct_cmds.keys()) def getUsage(self): return "[info|list|...] [security|...] [installed|available|all] [pkgs|id]" def getSummary(self): return "Acts on repository update information" def doCheck(self, base, basecmd, extcmds): pass def list_show_pkgs(self, base, md_info, list_type, show_type, iname2tup, data, msg): n_maxsize = 0 r_maxsize = 0 t_maxsize = 0 for (notice, pkgtup, pkg) in data: n_maxsize = max(len(notice['update_id']), n_maxsize) tn = notice['type'] if tn == 'security' and notice['severity']: tn = notice['severity'] + '/Sec.' t_maxsize = max(len(tn), t_maxsize) if show_type: for ref in ysp__safe_refs(notice['references']): if ref['type'] != show_type: continue r_maxsize = max(len(str(ref['id'])), r_maxsize) for (notice, pkgtup, pkg) in data: mark = '' if list_type == 'all': mark = ' ' if _rpm_tup_vercmp(iname2tup[pkgtup[0]], pkgtup) >= 0: mark = 'i ' tn = notice['type'] if tn == 'security' and notice['severity']: tn = notice['severity'] + '/Sec.' if show_type and ysp_has_info_md(show_type, notice): for ref in ysp__safe_refs(notice['references']): if ref['type'] != show_type: continue msg("%s %-*s %-*s %s" % (mark, r_maxsize, str(ref['id']), t_maxsize, tn, pkg)) elif hasattr(pkg, 'name'): print base.fmtKeyValFill("%s: " % pkg.name, base._enc(pkg.summary)) else: msg("%s%-*s %-*s %s" % (mark, n_maxsize, notice['update_id'], t_maxsize, tn, pkg)) def info_show_pkgs(self, base, md_info, list_type, show_type, iname2tup, data, msg): show_pkg_info_done = {} for (notice, pkgtup, pkg) in data: if notice['update_id'] in show_pkg_info_done: continue show_pkg_info_done[notice['update_id']] = notice if hasattr(notice, 'text'): debug_log_lvl = yum.logginglevels.DEBUG_3 vlog = logging.getLogger("yum.verbose.main") if vlog.isEnabledFor(debug_log_lvl): obj = notice.text(skip_data=[]) else: obj = notice.text() else: # Python-2.4.* doesn't understand str(x) returning unicode obj = notice.__str__() if list_type == 'all': if _rpm_tup_vercmp(iname2tup[pkgtup[0]], pkgtup) >= 0: obj = obj + "\n Installed : true" else: obj = obj + "\n Installed : false" msg(obj) def summary_show_pkgs(self, base, md_info, list_type, show_type, iname2tup, data, msg): def _msg(x): print x counts = {} sev_counts = {} show_pkg_info_done = {} for (notice, pkgtup, pkg) in data: if notice['update_id'] in show_pkg_info_done: continue show_pkg_info_done[notice['update_id']] = notice counts[notice['type']] = counts.get(notice['type'], 0) + 1 if notice['type'] == 'security': sev = notice['severity'] if sev is None: sev = '' sev_counts[sev] = sev_counts.get(sev, 0) + 1 maxsize = 0 for T in ('newpackage', 'security', 'bugfix', 'enhancement'): if T not in counts: continue size = len(str(counts[T])) if maxsize < size: maxsize = size if not maxsize: _check_running_kernel(base, md_info, _msg) return outT = {'newpackage' : 'New Package', 'security' : 'Security', 'bugfix' : 'Bugfix', 'enhancement' : 'Enhancement'} print "Updates Information Summary:", list_type for T in ('newpackage', 'security', 'bugfix', 'enhancement'): if T not in counts: continue n = outT[T] if T == 'security' and len(sev_counts) == 1: sn = sev_counts.keys()[0] if sn != '': n = sn + " " + n print " %*u %s notice(s)" % (maxsize, counts[T], n) if T == 'security' and len(sev_counts) != 1: def _sev_sort_key(key): # We want these in order, from "highest" to "lowest". # Anything unknown is "higher". meh. return {'Critical' : "zz1", 'Important': "zz2", 'Moderate' : "zz3", 'Low' : "zz4", }.get(key, key) for sn in sorted(sev_counts, key=_sev_sort_key): args = (maxsize, sev_counts[sn],sn or '?', outT['security']) print " %*u %s %s notice(s)" % args _check_running_kernel(base, md_info, _msg) self.show_pkg_info_done = {} def _get_new_pkgs(self, md_info): for notice in md_info.notices: if notice['type'] != "newpackage": continue for upkg in notice['pkglist']: for pkg in upkg['packages']: pkgtup = (pkg['name'], pkg['arch'], pkg['epoch'] or '0', pkg['version'], pkg['release']) yield (notice, pkgtup) _cmd2filt = {"bugzillas" : "bugzilla", "bugzilla" : "bugzilla", "bzs" : "bugzilla", "bz" : "bugzilla", "sec" : "security", "cves" : "cve", "cve" : "cve", "newpackages" : "newpackage", "new-packages" : "newpackage", "newpackage" : "newpackage", "new-package" : "newpackage", "new" : "newpackage"} for filt_type in __update_info_types__: _cmd2filt[filt_type] = filt_type def doCommand(self, base, basecmd, extcmds): if basecmd in self.direct_cmds: subcommand = self.direct_cmds[basecmd] elif extcmds and extcmds[0] in ('list', 'info', 'summary'): subcommand = extcmds[0] extcmds = extcmds[1:] elif extcmds and extcmds[0] in self._cmd2filt: subcommand = 'list' elif extcmds: subcommand = 'info' else: subcommand = 'summary' if subcommand == 'list': return self.doCommand_li(base, 'updateinfo list', extcmds, self.list_show_pkgs) if subcommand == 'info': return self.doCommand_li(base, 'updateinfo info', extcmds, self.info_show_pkgs) if subcommand == 'summary': return self.doCommand_li(base, 'updateinfo summary', extcmds, self.summary_show_pkgs) def doCommand_li_new(self, base, list_type, extcmds, md_info, msg, show_pkgs): done_pkgs = set() data = [] for (notice, pkgtup) in sorted(self._get_new_pkgs(md_info), key=lambda x: x[1][0]): if extcmds and not _match_sec_cmd(extcmds, pkgtup[0], notice): continue n = pkgtup[0] if n in done_pkgs: continue ipkgs = list(reversed(sorted(base.rpmdb.searchNames([n])))) if list_type in ('installed', 'updates') and not ipkgs: done_pkgs.add(n) continue if list_type == 'available' and ipkgs: done_pkgs.add(n) continue pkgs = base.pkgSack.searchPkgTuple(pkgtup) if not pkgs: continue if list_type == "updates" and pkgs[0].verLE(ipkgs[0]): done_pkgs.add(n) continue done_pkgs.add(n) data.append((notice, pkgtup, pkgs[0])) show_pkgs(base, md_info, list_type, None, {}, data, msg) def _parse_extcmds(self, extcmds): filt_type = None show_type = None if len(extcmds) >= 1: filt_type = None if extcmds[0] in self._cmd2filt: filt_type = self._cmd2filt[extcmds.pop(0)] show_type = filt_type if filt_type and filt_type in __update_info_types__: show_type = None return extcmds, show_type, filt_type def doCommand_li(self, base, basecmd, extcmds, show_pkgs): self.repos = base.repos md_info = ysp_gen_metadata(self.repos.listEnabled()) def msg(x): # Don't use: logger.log(logginglevels.INFO_2, x) # or -q deletes everything. print x opts, cmdline = base.plugins.cmdline extcmds, show_type, filt_type = self._parse_extcmds(extcmds) list_type = "available" if extcmds and extcmds[0] in ("updates","available","installed", "all"): list_type = extcmds.pop(0) if filt_type == "newpackage": # No filtering here, as we want what isn't installed... self.doCommand_li_new(base, list_type, extcmds, md_info, msg, show_pkgs) return 0, [basecmd + ' new done'] opts.sec_cmds = extcmds used_map = ysp_gen_used_map(opts) iname2tup = {} if False: pass elif list_type in ('installed', 'all'): name2tup = _get_name2allpkgtup(base) iname2tup = _get_name2instpkgtup(base) elif list_type == 'updates': name2tup = _get_name2oldpkgtup(base) elif list_type == 'available': name2tup = _get_name2instpkgtup(base) def _show_pkgtup(pkgtup): name = pkgtup[0] notices = reversed(md_info.get_applicable_notices(pkgtup)) for (pkgtup, notice) in notices: if filt_type and not ysp_has_info_md(filt_type, notice): continue if list_type == 'installed': # Remove any that are newer than what we have installed if _rpm_tup_vercmp(iname2tup[name], pkgtup) < 0: continue if ysp_should_filter_pkg(opts, name, notice, used_map): yield (pkgtup, notice) data = [] for pkgname in sorted(name2tup): for (pkgtup, notice) in _show_pkgtup(name2tup[pkgname]): d = {} (d['n'], d['a'], d['e'], d['v'], d['r']) = pkgtup if d['e'] == '0': d['epoch'] = '' else: d['epoch'] = "%s:" % d['e'] data.append((notice, pkgtup, "%(n)s-%(epoch)s%(v)s-%(r)s.%(a)s" % d)) show_pkgs(base, md_info, list_type, show_type, iname2tup, data, msg) ysp_chk_used_map(used_map, msg) return 0, [basecmd + ' done'] # "Borrowed" from yumcommands.py def yumcommands_checkRootUID(base): """ Verify that the program is being run by the root user. @param base: a YumBase object. """ if base.conf.uid != 0: base.logger.critical('You need to be root to perform this command.') raise CliError def yumcommands_checkGPGKey(base): if not base.gpgKeyCheck(): for repo in base.repos.listEnabled(): if repo.gpgcheck != 'false' and repo.gpgkey == '': msg = """ You have enabled checking of packages via GPG keys. This is a good thing. However, you do not have any GPG public keys installed. You need to download the keys for packages you wish to install and install them. You can do that by running the command: rpm --import public.gpg.key Alternatively you can specify the url to the key you would like to use for a repository in the 'gpgkey' option in a repository section and yum will install it for you. For more information contact your distribution or package provider. """ base.logger.critical(msg) raise CliError def _get_name2pkgtup(base, pkgtups): name2tup = {} for pkgtup in pkgtups: # Get the latest "old" pkgtups if (pkgtup[0] in name2tup and _rpm_tup_vercmp(name2tup[pkgtup[0]], pkgtup) > 0): continue name2tup[pkgtup[0]] = pkgtup return name2tup def _get_name2oldpkgtup(base): """ Get the pkgtups for all installed pkgs. which have an update. """ oupdates = map(lambda x: x[1], base.up.getUpdatesTuples()) return _get_name2pkgtup(base, oupdates) def _get_name2instpkgtup(base): """ Get the pkgtups for all installed pkgs. """ return _get_name2pkgtup(base, base.rpmdb.simplePkgList()) def _get_name2allpkgtup(base): """ Get the pkgtups for all installed pkgs. and munge that to be the first possible pkgtup. """ ofirst = [(pt[0], pt[1], '0','0','0') for pt in base.rpmdb.simplePkgList()] return _get_name2pkgtup(base, ofirst) class SecurityUpdateCommand: def getNames(self): return ['update-minimal'] def getUsage(self): return "[PACKAGE-wildcard]" def getSummary(self): return "Works like update, but goes to the 'newest' package match which fixes a problem that affects your system" def doCheck(self, base, basecmd, extcmds): yumcommands_checkRootUID(base) yumcommands_checkGPGKey(base) def doCommand(self, base, basecmd, extcmds): if hasattr(base, 'run_with_package_names'): base.run_with_package_names.add(__package_name__) md_info = ysp_gen_metadata(base.repos.listEnabled()) opts = base.plugins.cmdline[0] opts.sec_cmds = [] used_map = ysp_gen_used_map(opts) ndata = not (opts.security or opts.bugfixes or opts.advisory or opts.bz or opts.cve or opts.severity) # NOTE: Not doing obsoletes processing atm. ... maybe we should? -- # Also worth pointing out we don't go backwards for obsoletes in the: # update --security case etc. # obsoletes = base.up.getObsoletesTuples(newest=False) # for (obsoleting, installed) in sorted(obsoletes, key=lambda x: x[0]): # pass # Tuples == (n, a, e, v, r) oupdates = map(lambda x: x[1], base.up.getUpdatesTuples()) for oldpkgtup in sorted(oupdates): data = md_info.get_applicable_notices(oldpkgtup) if ndata: # No options means pick the oldest update data.reverse() for (pkgtup, notice) in data: name = pkgtup[0] if extcmds and not _match_sec_cmd(extcmds, name, notice): continue if (not ndata and not ysp_should_filter_pkg(opts, name, notice, used_map)): continue base.update(name=pkgtup[0], arch=pkgtup[1], epoch=pkgtup[2], version=pkgtup[3], release=pkgtup[4]) break if len(base.tsInfo) > 0: msg = '%d packages marked for minimal Update' % len(base.tsInfo) return 2, [msg] else: return 0, ['No Packages marked for minimal Update'] def config_hook(conduit): ''' Yum Plugin Config Hook: Setup the option parser with the '--advisory', '--bz', '--cve', '--security' and '--severity' command line options. Also the 'updateinfo' and 'update-minimal' commands. ''' parser = conduit.getOptParser() if not parser: return if hasattr(parser, 'plugin_option_group'): parser = parser.plugin_option_group conduit.registerCommand(UpdateinfoCommand()) conduit.registerCommand(SecurityUpdateCommand()) def osec(opt, key, val, parser): # CVE is a subset of --security on RHEL, but not on Fedora parser.values.security = True def obug(opt, key, val, parser): parser.values.bugfixes = True def ocve(opt, key, val, parser): parser.values.cve.extend(val.split(',')) def obz(opt, key, val, parser): parser.values.bz.append(str(val)) def oadv(opt, key, val, parser): parser.values.advisory.extend(val.split(',')) def osev(opt, key, val, parser): parser.values.severity.extend(val.split(',')) parser.add_option('--security', action="callback", callback=osec, dest='security', default=False, help='Include security relevant packages') parser.add_option('--bugfixes', action="callback", callback=obug, dest='bugfixes', default=False, help='Include bugfix relevant packages') parser.add_option('--cve', action="callback", type="string", callback=ocve, dest='cve', default=[], help='Include packages needed to fix the given CVE') parser.add_option('--bz', action="callback", callback=obz, dest='bz', default=[], type="int", help='Include packages needed to fix the given BZ') parser.add_option('--sec-severity', action="callback", callback=osev, dest='severity', default=[], type="string", help='Include security relevant packages, of this severity') parser.add_option('--advisory', action="callback", callback=oadv, dest='advisory', default=[], type="string", help='Include packages needed to fix the given advisory') # You might think we'd just use the exclude_hook, and call delPackage # and indeed that works for list updates etc. # # __but__ that doesn't work for dependancies on real updates # # So to fix deps. we need to do it at the preresolve stage and take the # "transaction package list" and then remove packages from that. # # __but__ that doesn't work for lists ... so we do it two ways # def ysp_should_keep_pkg(opts, pkgtup, md_info, used_map): """ Do we want to keep this package to satisfy the security limits. """ name = pkgtup[0] for (pkgtup, notice) in md_info.get_applicable_notices(pkgtup): if ysp_should_filter_pkg(opts, name, notice, used_map): return True return False def ysp_check_func_enter(conduit): """ Stuff we need to do in both list and update modes. """ opts, args = conduit.getCmdLine() ndata = not (opts.security or opts.bugfixes or opts.advisory or opts.bz or opts.cve or opts.severity) ret = None if len(args) >= 2: if ((args[0] == "list") and (args[1] in ("obsoletes", "updates"))): ret = {"skip": ndata, "list_cmd": True} if ((args[0] == "info") and (args[1] in ("obsoletes", "updates"))): ret = {"skip": ndata, "list_cmd": True} if len(args): # All the args. stuff is done in our command: if (args[0] == "update-minimal"): return (opts, {"skip": True, "list_cmd": False, "msg": True}) if (args[0] == "check-update"): ret = {"skip": ndata, "list_cmd": True} if (args[0] in ["update", "upgrade"]): ret = {"skip": ndata, "list_cmd": False} if args[0] == 'updateinfo': return (opts, {"skip": True, "list_cmd": True}) if (args[0] in UpdateinfoCommand.direct_cmds): return (opts, {"skip": True, "list_cmd": True}) if ret: return (opts, ret) if not ndata: conduit.error(2, 'Skipping security plugin, other command') return (opts, {"skip": True, "list_cmd": False, "msg": True}) def exclude_hook(conduit): ''' Yum Plugin Exclude Hook: Check and remove packages that don\'t align with the security config. ''' opts, info = ysp_check_func_enter(conduit) if info["skip"]: return if not info["list_cmd"]: return if hasattr(conduit, 'registerPackageName'): conduit.registerPackageName(__package_name__) conduit.info(2, 'Limiting package lists to security relevant ones') md_info = ysp_gen_metadata(conduit.getRepos().listEnabled()) def ysp_del_pkg(pkg): """ Deletes a package from all trees that yum knows about """ conduit.info(3," --> %s from %s excluded (non-security)" % (pkg,pkg.repoid)) conduit.delPackage(pkg) opts.sec_cmds = [] used_map = ysp_gen_used_map(opts) # The official API is: # # pkgs = conduit.getPackages() # # ...however that is _extremely_ slow, deleting all packages. So we ask # for the list of update packages, which is all we care about. upds = conduit._base.doPackageLists(pkgnarrow='updates') pkgs = upds.updates # In theory we don't need to do this in some cases, but meh. upds = conduit._base.doPackageLists(pkgnarrow='obsoletes') pkgs += upds.obsoletes name2tup = _get_name2oldpkgtup(conduit._base) tot = 0 cnt = 0 for pkg in pkgs: tot += 1 name = pkg.name if (name not in name2tup or not ysp_should_keep_pkg(opts, name2tup[name], md_info, used_map)): ysp_del_pkg(pkg) continue cnt += 1 ysp_chk_used_map(used_map, lambda x: conduit.error(2, x)) if cnt: conduit.info(2, '%d package(s) needed for security, out of %d available' % (cnt, tot)) else: conduit.info(2, 'No packages needed for security; %d packages available' % tot) _check_running_kernel(conduit._base, md_info, lambda x: conduit.info(2, x)) def _check_running_kernel(yb, md_info, msg): if not hasattr(yum.misc, 'get_running_kernel_pkgtup'): return # Back compat. kern_pkgtup = yum.misc.get_running_kernel_pkgtup(yb.ts) if kern_pkgtup[0] is None: return found_sec = False for (pkgtup, notice) in md_info.get_applicable_notices(kern_pkgtup): if found_sec or notice['type'] != 'security': continue found_sec = True ipkg = yb.rpmdb.searchPkgTuple(pkgtup) if not ipkg: continue # Not installed ipkg = ipkg[0] e = '' if kern_pkgtup[2] != '0': e = '%s:' % kern_pkgtup[2] rpkg = '%s-%s%s-%s.%s' % (kern_pkgtup[0], e, kern_pkgtup[3], kern_pkgtup[4], kern_pkgtup[1]) msg('Security: %s is an installed security update' % ipkg) msg('Security: %s is the currently running version' % rpkg) break def preresolve_hook(conduit): ''' Yum Plugin PreResolve Hook: Check and remove packages that don\'t align with the security config. ''' opts, info = ysp_check_func_enter(conduit) if info["skip"]: return if info["list_cmd"]: return if hasattr(conduit, 'registerPackageName'): conduit.registerPackageName(__package_name__) conduit.info(2, 'Limiting packages to security relevant ones') md_info = ysp_gen_metadata(conduit.getRepos().listEnabled()) def ysp_del_pkg(tspkg): """ Deletes a package within a transaction. """ conduit.info(3," --> %s from %s excluded (non-security)" % (tspkg.po,tspkg.po.repoid)) tsinfo.remove(tspkg.pkgtup) tot = 0 cnt = 0 opts.sec_cmds = [] used_map = ysp_gen_used_map(opts) tsinfo = conduit.getTsInfo() tspkgs = tsinfo.getMembers() # Ok, here we keep any pkgs that pass "ysp" tests, then we keep all # related pkgs ... Ie. "installed" version marked for removal. keep_pkgs = set() count_states = set(TS_INSTALL_STATES + [TS_ERASE]) count_pkgs = set() for tspkg in tspkgs: if tspkg.output_state in count_states: count_pkgs.add(tspkg.po) name2tup = _get_name2oldpkgtup(conduit._base) for tspkg in tspkgs: if tspkg.output_state in count_states: tot += 1 name = tspkg.po.name if (name not in name2tup or not ysp_should_keep_pkg(opts, name2tup[name], md_info, used_map)): continue if tspkg.output_state in count_states: cnt += 1 keep_pkgs.add(tspkg.po) scnt = cnt mini_depsolve_again = True while mini_depsolve_again: mini_depsolve_again = False for tspkg in tspkgs: if tspkg.po in keep_pkgs: # Find any related pkgs, and add them: for (rpkg, reason) in tspkg.relatedto: if rpkg not in keep_pkgs: if rpkg in count_pkgs: cnt += 1 keep_pkgs.add(rpkg) mini_depsolve_again = True else: # If related to any keep pkgs, add us for (rpkg, reason) in tspkg.relatedto: if rpkg in keep_pkgs: if rpkg in count_pkgs: cnt += 1 keep_pkgs.add(tspkg.po) mini_depsolve_again = True break for tspkg in tspkgs: if tspkg.po not in keep_pkgs: ysp_del_pkg(tspkg) ysp_chk_used_map(used_map, lambda x: conduit.error(2, x)) if cnt: conduit.info(2, '%d package(s) needed (+%d related) for security, out of %d available' % (scnt, cnt - scnt, tot)) else: conduit.info(2, 'No packages needed for security; %d packages available' % tot) if __name__ == '__main__': print "This is a plugin that is supposed to run from inside YUM" ������������������������������������������������yum-utils-1.1.31/plugins/show-leaves/���������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0017464�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/show-leaves/show-leaves.conf�����������������������������������������������0000664�0000000�0000000�00000000022�11620520663�0022562�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/show-leaves/show-leaves.py�������������������������������������������������0000664�0000000�0000000�00000003331�11620520663�0022273�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (c) 2009 Ville Skyttä <ville.skytta at iki.fi> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. """ B{show-leaves} is a Yum plugin which shows newly installed leaf packages and packages that became leaves after a transaction. """ from yum.plugins import TYPE_INTERACTIVE requires_api_version = '2.4' plugin_type = (TYPE_INTERACTIVE,) _old_leaves = None _new_leaves = None def _get_installed_leaves(conduit): ret = set() for po in conduit.getRpmDB().returnLeafNodes(): ret.add((po.name, po.arch)) return ret def pretrans_hook(conduit): global _old_leaves _old_leaves = _get_installed_leaves(conduit) def posttrans_hook(conduit): global _new_leaves _new_leaves = _get_installed_leaves(conduit) def close_hook(conduit): global _old_leaves, _new_leaves if _old_leaves is None or _new_leaves is None: return newleaves = _new_leaves - _old_leaves if newleaves: conduit.info(2, "New leaves:") for leaf in sorted(newleaves): conduit.info(2, " %s.%s" % leaf) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/tmprepo/�������������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0016715�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/tmprepo/tmprepo.conf�������������������������������������������������������0000664�0000000�0000000�00000000641�11620520663�0021253�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 # You can uncomment this to allow tmporary repositories to disable/alter # gpg checking. This is not recommended. # You might want to use pkgs_gpgcheck=false, but if you do understand # what the security implications are. Here are the defaults: # # pkgs_gpgcheck=True # repo_gpgcheck=False # pkgs_local_gpgcheck=true # Inherits from: pkgs_gpgcheck # repo_local_gpgcheck=False # # cleanup=false �����������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/tmprepo/tmprepo.py���������������������������������������������������������0000664�0000000�0000000�00000023740�11620520663�0020763�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Copyright Red Hat Inc. 2007, 2008 # # Author: James Antill <james@fedoraproject.com> # Examples: # # yum --tmprepo=http://example.com/foo/bar.repo ... from yum.plugins import TYPE_INTERACTIVE import logging # for commands import urlgrabber.grabber import tempfile import os import shutil import time requires_api_version = '2.5' plugin_type = (TYPE_INTERACTIVE,) def make_validate(log, pkgs_gpgcheck, repo_gpgcheck): def tvalidate(repo): if pkgs_gpgcheck or repo_gpgcheck: # Don't ever allow them to set gpgcheck='false' if pkgs_gpgcheck and not repo.gpgcheck: log.warn("Repo %s tried to set gpgcheck=false" % repo) return False if (repo_gpgcheck and hasattr(repo, 'repo_gpgcheck') and not repo.repo_gpgcheck): log.warn("Repo %s tried to set repo_gpgcheck=false" % repo) return False # Don't allow them to set gpgkey=anything for key in repo.gpgkey: if not key.startswith('file:/'): log.warn("Repo %s tried to set gpgkey to %s" % (repo, repo.gpgkey)) return False return True return tvalidate dnames = [] class AutoCleanupDir: """ Given a directory ... let it exist until "the end", and then clean it up. """ def __init__(self, dname): self.dname = dname # Want it to live until python shutdown dnames.append(self) # Can't use __del__ as python doesn't dtrt. on exit def cleanup(self): shutil.rmtree(self.dname, ignore_errors=True) def close_hook(conduit): global dnames for dname in dnames: dname.cleanup() dnames = [] def add_dir_repo(base, trepo, cleanup): # Let people do it via. local directories ... we don't want this for # HTTP because people _should_ just generate .repo files, but for # local CDs of pkgs etc. we'll be nice. trepo_path = trepo[len("file:"):] trepo_data = tempfile.mkdtemp() if cleanup: AutoCleanupDir(trepo_data) else: os.chmod(trepo_data, 0755) trepo_name = os.path.basename(os.path.dirname(trepo_path)) tmp_fname = "%s/tmp-%s.repo" % (trepo_data, trepo_name) repoid = "T-%4.4s-%x" % (trepo_name, int(time.time())) tpc = 'true' if not lpgpgcheck: tpc = 'false' trc = 'true' if not lrgpgcheck: trc = 'false' open(tmp_fname, "wb").write("""\ [%(repoid)s] name=Tmp. repo. for %(path)s baseurl=file:%(dname)s enabled=1 gpgcheck=%(pkgs_gpgcheck)s repo_gpgcheck=%(repo_gpgcheck)s metadata_expire=0 # Make cost smaller, as we know it's "local" ... if this isn't good just create # your own .repo file. ... then you won't need to createrepo each run either. cost=500 """ % {'path' : trepo_path, 'repoid' : repoid, 'dname' : trepo_data, 'pkgs_gpgcheck' : tpc, 'repo_gpgcheck' : trc, }) if cleanup: print "Creating tmp. repodata for:", trepo_path else: print "Creating saved repodata for:", trepo_path print " * Result is saved here :", tmp_fname os.spawnlp(os.P_WAIT, "createrepo", "createrepo", "--database", "--baseurl", trepo, "--outputdir", trepo_data, trepo_path) AutoCleanupDir("%s/%s" % (base.conf.cachedir, repoid)) return tmp_fname def add_repomd_repo(base, repomd): # Let people do it via. poitning at the repomd.xml file ... smeg it trepo_data = tempfile.mkdtemp() AutoCleanupDir(trepo_data) trepo_name = os.path.basename(os.path.dirname(os.path.dirname(repomd))) tmp_fname = "%s/tmp-%s.repo" % (trepo_data, trepo_name) repoid = "T-%4.4s-%x" % (trepo_name, int(time.time())) pgpgcheck, rgpgcheck = rpgpgcheck, rrgpgcheck if repomd.startswith("file:"): pgpgcheck, rgpgcheck = lpgpgcheck, lrgpgcheck tpc = 'true' if not pgpgcheck: tpc = 'false' trc = 'true' if not rgpgcheck: trc = 'false' open(tmp_fname, "wb").write("""\ [%(repoid)s] name=Tmp. repo. for %(path)s baseurl=%(dname)s enabled=1 gpgcheck=%(pkgs_gpgcheck)s repo_gpgcheck=%(repo_gpgcheck)s metadata_expire=0 """ % {'path' : repomd, 'repoid' : repoid, 'dname' : repomd[:-len("repodata/repomd.xml")], 'pkgs_gpgcheck' : tpc, 'repo_gpgcheck' : trc, }) print "Creating tmp. repo for:", repomd AutoCleanupDir("%s/%s" % (base.conf.cachedir, repoid)) return tmp_fname # Note that mirrorlist also includes metalink, due to the anaconda hack. def add_mirrorlist_repo(base, mirrorlist): # Let people do it via. poitning at the repomd.xml file ... smeg it trepo_data = tempfile.mkdtemp() AutoCleanupDir(trepo_data) trepo_name = os.path.basename(mirrorlist) tmp_fname = "%s/tmp-%s.repo" % (trepo_data, trepo_name) repoid = "T-%4.4s-%x" % (trepo_name, int(time.time())) tpc = 'true' if not rpgpgcheck: tpc = 'false' trc = 'true' if not rrgpgcheck: trc = 'false' open(tmp_fname, "wb").write("""\ [%(repoid)s] name=Tmp. repo. for %(path)s mirrorlist=%(dname)s enabled=1 gpgcheck=true metadata_expire=0 """ % {'path' : mirrorlist, 'repoid' : repoid, 'dname' : mirrorlist, 'pkgs_gpgcheck' : tpc, 'repo_gpgcheck' : trc, }) print "Creating tmp. repo for:", mirrorlist AutoCleanupDir("%s/%s" % (base.conf.cachedir, repoid)) return tmp_fname def add_repos(base, log, tmp_repos, tvalidate, tlocvalidate, cleanup_dir_temp, nogpgcheck): """ Add temporary repos to yum. """ # Don't use self._splitArg()? ... or require URLs without commas? for trepo in tmp_repos: if trepo.startswith("~/"): trepo = "%s%s" % (os.environ['HOME'], trepo[1:]) if trepo.startswith("/"): trepo = "file:%s" % trepo validate = tvalidate if trepo.startswith("file:"): validate = tlocvalidate if trepo.startswith("file:") and trepo.endswith("/"): if not os.path.isdir(trepo[len("file:"):]): log.warn("Failed to find directory " + trepo[len("file:"):]) continue fname = add_dir_repo(base, trepo, cleanup_dir_temp) elif trepo.endswith("repodata/repomd.xml"): fname = add_repomd_repo(base, trepo) elif trepo.endswith(".repo"): grab = urlgrabber.grabber.URLGrabber() # Need to keep alive until fname is used gc_keep = tempfile.NamedTemporaryFile() fname = gc_keep.name try: fname = grab.urlgrab(trepo, fname) except urlgrabber.grabber.URLGrabError, e: log.warn("Failed to retrieve " + trepo) continue else: fname = add_mirrorlist_repo(base, trepo) base.getReposFromConfigFile(fname, validate=validate) if nogpgcheck: for repo in base.repos.listEnabled(): repo.gpgcheck = False repo.repo_gpgcheck = False # Just do it all again... base.setupProgressCallbacks() rpgpgcheck = True # Remote rrgpgcheck = False # Remote lpgpgcheck = True lrgpgcheck = False def_tmp_repos_cleanup = False def config_hook(conduit): ''' Yum Plugin Config Hook: Add the --tmprepo option. ''' global rpgpgcheck global rrgpgcheck global lpgpgcheck global lrgpgcheck global def_tmp_repos_cleanup parser = conduit.getOptParser() if not parser: return if hasattr(parser, 'plugin_option_group'): parser = parser.plugin_option_group parser.add_option("--tmprepo", action='append', type='string', dest='tmp_repos', default=[], help="enable one or more repositories from URLs", metavar='[url]') parser.add_option("--tmprepo-keep-created", action='store_true', dest='tmp_repos_cleanup', default=False, help="keep created direcotry based tmp. repos.") # We don't default to repository checks for repo files, because no one does # that signing. rpgpgcheck = conduit.confBool('main', 'pkgs_gpgcheck', default=True) rrgpgcheck = conduit.confBool('main', 'repo_gpgcheck', default=False) lpgpgcheck = conduit.confBool('main', 'pkgs_local_gpgcheck', default=rpgpgcheck) lrgpgcheck = conduit.confBool('main', 'repo_local_gpgcheck', default=False) def_tmp_repos_cleanup = conduit.confBool('main', 'cleanup', default=False) _tmprepo_done = False def prereposetup_hook(conduit): ''' Process the tmp repos from --tmprepos. ''' # Stupid group commands doing the explicit setup stuff... global _tmprepo_done if _tmprepo_done: return _tmprepo_done = True opts, args = conduit.getCmdLine() if not opts.tmp_repos: return if hasattr(conduit, 'registerPackageName'): conduit.registerPackageName("yum-plugin-tmprepo") log = logging.getLogger("yum.verbose.main") add_repos(conduit._base, log, opts.tmp_repos, make_validate(log, rpgpgcheck, rrgpgcheck), make_validate(log, lpgpgcheck, lrgpgcheck), not (opts.tmp_repos_cleanup or def_tmp_repos_cleanup), opts.nogpgcheck) ��������������������������������yum-utils-1.1.31/plugins/tsflags/�������������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0016672�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/tsflags/tsflags.conf�������������������������������������������������������0000664�0000000�0000000�00000000021�11620520663�0021175�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/tsflags/tsflags.py���������������������������������������������������������0000664�0000000�0000000�00000002416�11620520663�0020712�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # by Panu Matilainen <pmatilai@laiskiainen.org> from yum.plugins import TYPE_INTERACTIVE requires_api_version = '2.1' plugin_type = (TYPE_INTERACTIVE,) def init_hook(conduit): parser = conduit.getOptParser() parser.add_option('--tsflags', dest='tsflags') def postreposetup_hook(conduit): opts, args = conduit.getCmdLine() conf = conduit.getConf() if opts.tsflags: flags = opts.tsflags.split(',') for flag in flags: if flag not in conf.tsflags: conf.tsflags.append(flag) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/upgrade-helper/������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0020133�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/upgrade-helper/cleanup.xml�������������������������������������������������0000664�0000000�0000000�00000000152�11620520663�0022302�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<cleanup> <removespec pkgmatch="zsh.i386" on_arch="x86_64"/> <removespec pkgmatch="zvbi"/> </cleanup> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/upgrade-helper/upgrade-helper.conf�����������������������������������������0000664�0000000�0000000�00000000023�11620520663�0023701�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled = 1 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/upgrade-helper/upgrade-helper.py�������������������������������������������0000664�0000000�0000000�00000010447�11620520663�0023417�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Copyright 2007 Red Hat, Inc # Written by Seth Vidal # upgrade-helper plugin # cleans out orphans and impossible-to-update/obsolete-away pkgs # download list of stuff to kill from each repo, if there # parse it and load it into memory # - make sure that any pkgspec matching: a lot of things *? or * or . or what not # will be ignored #format of the file is: #<cleanup> # <removespec pkgmatch="zsh.i386" on_arch="x86_64"/> # <removespec pkgmatch="zvbi"/> #</cleanup> # for all the ones for anything in your arch # if something is installed matching it, then add it to the TS to be removed # do all this only if: # running as root # the command being run is 'update' or 'install' (or performing those functions somehow) from yum.plugins import TYPE_CORE from yum.constants import * import rpmUtils.arch from yum.repoMDObject import ns_cleanup import gzip try: from xml.etree import cElementTree except ImportError: import cElementTree iterparse = cElementTree.iterparse requires_api_version = '2.5' plugin_type = (TYPE_CORE,) myarch = rpmUtils.arch.getBaseArch() def parse_xml(xmlfile): """parse the xml file and hand back the contents in a usable form""" # store results in a dict of on_arch = list_of_pkgs results = {} results[myarch] = [] xfo = gzip.open(xmlfile, 'rt') parser = iterparse(xfo) for ev, elem in parser: for child in elem: child_name = ns_cleanup(child.tag) thisarch = myarch if child_name == 'removespec': if 'on_arch' in child.attrib: thisarch = child.attrib.get('on_arch') if 'pkgmatch' in child.attrib: thismatch = child.attrib.get('pkgmatch') if thisarch in results: if thismatch not in results[thisarch]: results[thisarch].append(thismatch) else: results[thisarch] = [thismatch] return results def stuff_to_remove(repos): toremove = [] # for repo in my repos # grab the cleanup file # parse it # merge all the results for $myarch together # return them as the toremove list for repo in repos.listEnabled(): if 'cleanup' in repo.repoXML.repoData: trf = repo.retrieveMD('cleanup') tr_dict = parse_xml(trf) # prune out things like *, ?, *.*, *.*.*.*.* # etc badmatches = ['*', '?', '*.*', 'glibc', 'kernel', 'yum', 'rpm'] for pm in tr_dict[myarch]: if pm in badmatches: continue # other tests here? toremove.append(pm) return toremove def preresolve_hook(conduit): """add all of these into the ts to be removed""" ts = conduit.getTsInfo() # only run it if we're installing/updating something, don't do it if # we're removing only runme = False for mbr in ts.getMembers(): if mbr.output_state in TS_INSTALL_STATES: runme = True break if runme: rpmdb = conduit.getRpmDB() # we should probably consider also allowing version-range packagespecs # like foo < 1.1.1-1 by using rpmdb.getProvides() with some other magic # FIXME FOR LATER for pkgglob in stuff_to_remove(conduit.getRepos()): ex, m, u = rpmdb.matchPackageNames([pkgglob]) for po in ex + m: conduit.info(1, "Setting %s to be removed due to repository metadata in cleanup plugin" % po) ts.addErase(po) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/verify/��������������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0016533�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/verify/verify.conf���������������������������������������������������������0000664�0000000�0000000�00000001223�11620520663�0020704�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled=1 # Display verify mismatches with config. files, should probably use AIDE etc. # instead, if you really want this. # configuration-files = True # # Add more colour to your life (these are the defaults): # [highlight] # # # Don't output these problems in colour: # low-priority = mtime, genchecksum, permissions-missing, state,missingok,ghost # # # Don't highlight the values of these problems # filter-old = mtime, checksum # filter-new = mtime, checksum # # # These are the default highlight values # new = reverse # # old-fg = red # # file = underline # file-fg = green # # tags = bold # tags-fg = yellow # tags-bg = black �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/verify/verify.py�����������������������������������������������������������0000664�0000000�0000000�00000037305�11620520663�0020421�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # # Copyright Red Hat Inc. 2008 # # Author: James Antill <james.antill@redhat.com> # # Examples: # # yum verify # yum verify yum* # yum verify all # yum verify extras from yum.plugins import TYPE_INTERACTIVE import logging # for commands from yum import logginglevels import time import stat requires_api_version = '2.5' plugin_type = (TYPE_INTERACTIVE,) def nevr(pkg): """ Identify a pkg without arch. """ return "%s-%s:%s-%s" % (pkg.name, pkg.epoch, pkg.version, pkg.release) def fmt_rwx(mode, r, w, x): ret = [] if w & mode: ret.append("w") else: ret.append("-") if r & mode: ret.append("r") else: ret.append("-") if x & mode: ret.append("x") else: ret.append("-") return "".join(ret) def format_mode(mode): ret = [] tmp = [] if stat.S_ISUID & mode: tmp.append("set user (setuid)") if stat.S_ISGID & mode: tmp.append("set group (setgid)") if stat.S_ISVTX & mode: tmp.append("sticky") if tmp: ret.append("/".join(tmp)) ret.append("user:" + fmt_rwx(mode, stat.S_IRUSR,stat.S_IWUSR,stat.S_IXUSR)) ret.append("group:" + fmt_rwx(mode, stat.S_IRGRP,stat.S_IWGRP,stat.S_IXGRP)) ret.append("other:" + fmt_rwx(mode, stat.S_IROTH,stat.S_IWOTH,stat.S_IXOTH)) return ", ".join(ret) import datetime def format_time_diff(x, y): frm = datetime.datetime.fromtimestamp if x > y: return str(frm(x) - frm(y)) + " later" else: return str(frm(y) - frm(x)) + " earlier" def problem_contains(problems, types): for problem in problems: if problem.type in types: return problem return None def pkg_multilib_file(data, pkg, pkgs, fname, verify_cb=None): problems = data[pkg][fname] ml_csum = problem_contains(problems, ['checksum']) ml_size = problem_contains(problems, ['size']) ml_time = problem_contains(problems, ['mtime']) if not (ml_csum or ml_size or ml_time): return False for opkg in pkgs: if opkg == pkg: continue if opkg not in data: data[opkg] = opkg.verify(callback=verify_cb) if fname not in data[opkg]: return True if problem_contains(problems, ['state', 'missingok', 'ghost']): continue problems = data[opkg][fname] srch = [] if ml_csum: srch.append('checksum') if ml_size: srch.append('size') if ml_time: srch.append('mtime') if problem_contains(problems, srch): continue return True return False # We make decisions based on these _verify_multilib = ['mtime', 'size', 'checksum'] _verify_missingok= ['missingok', 'ghost'] _verify_none = ['state'] + _verify_missingok _verify_missing = ['missing', 'permissions-missing','genchecksum']+_verify_none # These are user configurable, for output _verify_low = ['mtime', 'genchecksum', 'permissions-missing'] +_verify_none _verify_onohi = ['mtime', 'checksum'] _verify_nnohi = ['mtime', 'checksum'] _verify_configs = False class VerifyCommand: def __init__(self, names, conf, multilib=True, verify_configs_override=None, all=False, verify_callback=None): self.names = names self.conf = conf self.all = all self.multilib = multilib self.verify_configs_override = verify_configs_override self.verify_callback = verify_callback def getNames(self): return self.names def getUsage(self): return "[PACKAGE|all|extras]" def getSummary(self): return """\ Verify packages and display data on bad verifications""" def doCheck(self, base, basecmd, extcmds): pass def show_pkgs(self, msg, pkgs): pass @staticmethod def _filter_results(oresults, verify_none=None): if verify_none is None: verify_none = _verify_none results = {} for fn in oresults: probs = [] for problem in oresults[fn]: if problem.type not in verify_none: probs.append(problem) if probs: results[fn] = probs return results @staticmethod def _filter_empty(oresults): results = {} for fname in oresults: if oresults[fname]: results[fname] = oresults[fname] return results def _filter_multilib(self, data, pkg, results): for fname in results: problems = results[fname] mpkgs = self._multilib[nevr(pkg)] if not pkg_multilib_file(data, pkg, mpkgs, fname, verify_cb=self.verify_callback): continue tmp = [] for problem in problems: if problem.type in _verify_multilib: continue tmp.append(problem) results[fname] = tmp return self._filter_empty(results) def filter_data(self, msg, pkgs): data = {} for pkg in sorted(pkgs): oresults = pkg.verify(patterns=self._filename_globs, all=self.all, callback=self.verify_callback) if not _verify_configs and not self.verify_configs_override: for fn in oresults.keys(): if 'configuration' in oresults[fn][0].file_types: del oresults[fn] if self.multilib: data[pkg] = oresults else: if self.all: results = self._filter_results(oresults, _verify_missingok) else: results = self._filter_results(oresults) if results: yield (pkg, results) if not self.multilib: return ndata = {} for pkg in data: results = self._filter_results(data[pkg]) if nevr(pkg) in self._multilib: ndata[pkg] = self._filter_multilib(data, pkg, results) else: ndata[pkg] = results for pkg in sorted(pkgs): if pkg in ndata and ndata[pkg]: yield (pkg, ndata[pkg]) def _mode_except(self, base, line, problem=None, exceptions=None): if exceptions is None: exceptions = _verify_low if problem is not None and problem.type in exceptions: return ("", "") hib = "" hie = "" name = 'fg_' + line if name in self.conf and self.conf[name] in base.term.FG_COLOR: hib += base.term.FG_COLOR[self.conf[name]] name = 'bg_' + line if name in self.conf and self.conf[name] in base.term.BG_COLOR: hib += base.term.BG_COLOR[self.conf[name]] name = 'hi_' + line if name in self.conf and self.conf[name] in base.term.MODE: hib += base.term.MODE[self.conf[name]] hie = base.term.MODE['normal'] return (hib, hie) def show_problem(self, base, msg, problem, done): if done: msg("%s%s%s" % (' ' * 35, '-' * 8, ' ' * 35)) (hib, hie) = self._mode_except(base, 'prob', problem) msg(" Problem: " + hib + problem.message + hie) if problem.type not in _verify_missing: cv = problem.disk_value ov = problem.database_value if problem.type == 'mtime': cv = time.ctime(cv) + " (%s)" % format_time_diff(cv, ov) ov = time.ctime(ov) if problem.type == 'mode': cv = format_mode(cv) ov = format_mode(ov) if problem.type == 'size': cv = "%*s" % (5, base.format_number(cv)) ov = "%*s" % (5, base.format_number(ov)) if cv == ov: # ignore human units, so we can see the diff. cv = "%*s B" % (12, str(problem.disk_value)) ov = "%*s B" % (12, str(problem.database_value)) (hib, hie) = self._mode_except(base, 'new', problem, _verify_nnohi) msg(" Current: " + hib + cv + hie) (hib, hie) = self._mode_except(base, 'old', problem, _verify_onohi) msg(" Original: " + hib + ov + hie) def show_data(self, base, msg, pkgs, name): done = False mcb = lambda x: base.matchcallback(x, []) for (pkg, results) in self.filter_data(msg, pkgs): if not done: msg("%s %s %s" % ('=' * 20, name, '=' * 20)) else: msg('') done = True mcb(pkg) for fname in sorted(results): hiprobs = len(filter(lambda x: x.type not in _verify_low, results[fname])) if hiprobs: (hib, hie) = self._mode_except(base, 'file') else: (hib, hie) = ("", "") msg(" File: " + hib + fname + hie) if hiprobs: (hib, hie) = self._mode_except(base, 'tags') else: (hib, hie) = ("", "") done_prob = False for problem in sorted(results[fname]): if not done_prob and problem.file_types: tags = ", ".join(problem.file_types) msg(" Tags: " + hib + tags + hie) self.show_problem(base, msg, problem, done_prob) done_prob = True def doCommand(self, base, basecmd, extcmds): global _verify_configs logger = logging.getLogger("yum.verbose.main") def msg(x): logger.log(logginglevels.INFO_2, x) def msg_warn(x): logger.warn(x) opts = base.plugins.cmdline[0] if opts.verify_configuration_files is not None: val = opts.verify_configuration_files if False: pass elif val.lower() in ["0", "no", "false", "off"]: _verify_configs = False elif val.lower() in ["1", "yes", "true", "on"]: _verify_configs = True else: msg_warn("Ignoring bad value \"%s\" for the option %s" % (val, "--verify-configuration-files")) self._filename_globs = None if opts.verify_filenames: self._filename_globs = opts.verify_filenames subgroup = ["installed"] if len(extcmds): if extcmds[0] == "all": extcmds = extcmds[1:] elif extcmds[0] == "extras": subgroup = ["extras"] extcmds = extcmds[1:] if self.multilib: pkgs = base.returnPkgLists(["installed"]).installed self._multilib = {} for pkg in pkgs: self._multilib.setdefault(nevr(pkg), []).append(pkg) for pkg in pkgs: if len(self._multilib[nevr(pkg)]) == 1: del self._multilib[nevr(pkg)] # self._multilib is now a dict of all pkgs that have more than one # nevr() match ypl = base.returnPkgLists(subgroup + extcmds) self.show_data(base, msg, ypl.installed, 'Installed Packages') self.show_data(base, msg, ypl.extras, 'Extra Packages') return 0, [basecmd + ' done'] def needTs(self, base, basecmd, extcmds): if not len(extcmds) or extcmds[0] != 'extras': return False return True def config_hook(conduit): ''' Yum Plugin Config Hook: Add the 'verify' and 'verify-no-multilib' commands. ''' global _verify_configs global _verify_low global _verify_onohi global _verify_nnohi _verify_configs = conduit.confBool('main', 'configuration-files', default=False) low = conduit.confString('highlight', 'low-priority', default=None) if low: _verify_low = filter(len, low.replace(',', ' ').split()) fold = conduit.confString('highlight', 'filter-old', default=None) if fold: _verify_onohi = filter(len, fold.replace(',', ' ').split()) fnew = conduit.confString('highlight', 'filter-new', default=None) if fnew: _verify_nnohi = filter(len, fnew.replace(',', ' ').split()) conf = {} conf['hi_prob'] = conduit.confString('highlight', 'problem', default='bold') conf['fg_prob'] = conduit.confString('highlight', 'problem-fg',default=None) conf['bg_prob'] = conduit.confString('highlight', 'problem-bg',default=None) conf['hi_new'] = conduit.confString('highlight', 'new', default='reverse') conf['fg_new'] = conduit.confString('highlight', 'new-fg', default=None) conf['bg_new'] = conduit.confString('highlight', 'new-bg', default=None) conf['hi_old'] = conduit.confString('highlight', 'old', default=None) conf['fg_old'] = conduit.confString('highlight', 'old-fg', default='red') conf['bg_old'] = conduit.confString('highlight', 'old-bg', default=None) conf['hi_file'] = conduit.confString('highlight', 'file', default='underline') conf['fg_file'] = conduit.confString('highlight', 'file-fg', default='green') conf['bg_file'] = conduit.confString('highlight', 'file-bg', default=None) conf['hi_tags'] = conduit.confString('highlight', 'tags', default='bold') conf['fg_tags'] = conduit.confString('highlight', 'tags-fg', default='yellow') conf['bg_tags'] = conduit.confString('highlight', 'tags-bg', default='black') reg = conduit.registerCommand reg(VerifyCommand(['verify-all'], conf, multilib=False, verify_configs_override=True, all=True, verify_callback=conduit._base.verify_plugins_cb)) reg(VerifyCommand(['verify-rpm'], conf, multilib=False, verify_configs_override=True, verify_callback=conduit._base.verify_plugins_cb)) reg(VerifyCommand(['verify-multilib','verify'], conf, verify_callback=conduit._base.verify_plugins_cb)) parser = conduit.getOptParser() if not parser: return def make_nopt(attrs): attrs = attrs.replace("-", "_") def func(opt, key, val, parser): vals = str(val).replace(",", " ").split() vals = filter(len, vals) getattr(parser.values, 'verify_' + attrs).extend(vals) return func if hasattr(parser, 'plugin_option_group'): parser = parser.plugin_option_group parser.add_option('--verify-filenames', action="callback", callback=make_nopt('filenames'), default=[],type="string", help='Only verify files matching this') parser.add_option('--verify-configuration-files', action="store", type="string", help='Verify files tagged as configuration files') ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/versionlock/���������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0017565�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/versionlock/README���������������������������������������������������������0000664�0000000�0000000�00000001153�11620520663�0020445�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������The versionlock list format is NOT compatible with default 'rpm -qa' output. The locked packages and their versions need to be listed in ENVRA format: EPOCH:NAME-VERSION-RELEASE.ARCH That format can be easily generated with repoquery (also part of yum-utils) with --envra option. If for example you want to lock what's currently on the system you could use repoquery --quiet --envra --pkgnarrow=installed -a If using repoquery isn't an option for whatever reason, the following queryformat will extract ENVRA format from rpm: rpm -qa --qf "%|epoch?{%{epoch}}:{0}|:%{name}-%{version}-%{release}.%{arch}\n" ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/versionlock/versionlock.conf�����������������������������������������������0000664�0000000�0000000�00000000241�11620520663�0022767�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[main] enabled = 1 locklist = /etc/yum/pluginconf.d/versionlock.list # Uncomment this to lock out "upgrade via. obsoletes" etc. (slower) # follow_obsoletes = 1 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/versionlock/versionlock.list�����������������������������������������������0000664�0000000�0000000�00000000000�11620520663�0023006�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/plugins/versionlock/versionlock.py�������������������������������������������������0000664�0000000�0000000�00000020624�11620520663�0022501�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # by Panu Matilainen <pmatilai@laiskiainen.org> # tweaks by James Antill <james@and.org> # from yum.plugins import PluginYumExit from yum.plugins import TYPE_CORE from rpmUtils.miscutils import splitFilename from yum.packageSack import packagesNewestByName import urlgrabber import urlgrabber.grabber import os import fnmatch import tempfile import time requires_api_version = '2.1' plugin_type = (TYPE_CORE,) _version_lock_excluder_n = set() _version_lock_excluder_nevr = set() _version_lock_excluder_B_nevr = set() # In theory we could do full nevra/pkgtup ... but having foo-1.i386 and not # foo-1.x86_64 would be pretty weird. So just do "archless". # _version_lock_excluder_pkgtup = set() fileurl = None def _read_locklist(): locklist = [] try: llfile = urlgrabber.urlopen(fileurl) for line in llfile.readlines(): if line.startswith('#') or line.strip() == '': continue locklist.append(line.rstrip()) llfile.close() except urlgrabber.grabber.URLGrabError, e: raise PluginYumExit('Unable to read version lock configuration: %s' % e) return locklist class VersionLockCommand: created = 1247693044 def getNames(self): return ["versionlock"] def getUsage(self): return '[add|exclude|list|delete|clear] [PACKAGE-wildcard]' def getSummary(self): return 'Control package version locks.' def doCheck(self, base, basecmd, extcmds): pass def doCommand(self, base, basecmd, extcmds): cmd = 'list' if extcmds: if extcmds[0] not in ('add', 'exclude', 'add-!', 'add!', 'blacklist', 'list', 'del', 'delete', 'clear'): cmd = 'add' else: cmd = {'del' : 'delete', 'add-!' : 'exclude', 'add!' : 'exclude', 'blacklist' : 'exclude', }.get(extcmds[0], extcmds[0]) extcmds = extcmds[1:] filename = fileurl if fileurl.startswith("file:"): filename = fileurl[len("file:"):] if not filename.startswith('/') and cmd != 'list': print "Error: versionlock URL isn't local: " + fileurl return 1, ["versionlock %s failed" % (cmd,)] if cmd == 'add': pkgs = base.rpmdb.returnPackages(patterns=extcmds) if not pkgs: pkgs = base.pkgSack.returnPackages(patterns=extcmds) fo = open(filename, 'a') count = 0 done = set() for pkg in pkgs: # We ignore arch, so only add one entry for foo-1.i386 and # foo-1.x86_64. (n, a, e, v, r) = pkg.pkgtup a = '*' if (n, a, e, v, r) in done: continue done.add((n, a, e, v, r)) print "Adding versionlock on: %s:%s-%s-%s" % (e, n, v, r) if not count: fo.write("\n# Added locks on %s\n" % time.ctime()) count += 1 (n, a, e, v, r) = pkg.pkgtup fo.write("%s:%s-%s-%s.%s\n" % (e, n, v, r, '*')) return 0, ['versionlock added: ' + str(count)] if cmd == 'exclude': pkgs = base.pkgSack.returnPackages(patterns=extcmds) pkgs = packagesNewestByName(pkgs) fo = open(filename, 'a') count = 0 done = set() for pkg in pkgs: # We ignore arch, so only add one entry for foo-1.i386 and # foo-1.x86_64. (n, a, e, v, r) = pkg.pkgtup a = '*' if (n, a, e, v, r) in done: continue done.add((n, a, e, v, r)) print "Adding exclude on: %s:%s-%s-%s" % (e,n,v,r) if not count: fo.write("\n# Added excludes on %s\n" % time.ctime()) count += 1 (n, a, e, v, r) = pkg.pkgtup fo.write("!%s:%s-%s-%s.%s\n" % (e, n, v, r, '*')) return 0, ['versionlock added: ' + str(count)] if cmd == 'clear': open(filename, 'w') return 0, ['versionlock cleared'] if cmd == 'delete': dirname = os.path.dirname(filename) (out, tmpfilename) = tempfile.mkstemp(dir=dirname, suffix='.tmp') out = os.fdopen(out, 'w', -1) count = 0 for ent in _read_locklist(): found = False for match in extcmds: if fnmatch.fnmatch(ent, match): found = True break if found: print "Deleting versionlock for:", ent count += 1 continue out.write(ent) out.write('\n') out.close() if not count: os.unlink(tmpfilename) return 1, ['Error: versionlock delete: no matches'] os.rename(tmpfilename, filename) return 0, ['versionlock deleted: ' + str(count)] assert cmd == 'list' for ent in _read_locklist(): print ent return 0, ['versionlock list done'] def needTs(self, base, basecmd, extcmds): return False def config_hook(conduit): global fileurl fileurl = conduit.confString('main', 'locklist') if hasattr(conduit._base, 'registerCommand'): conduit.registerCommand(VersionLockCommand()) def _add_versionlock_whitelist(conduit): if hasattr(conduit, 'registerPackageName'): conduit.registerPackageName("yum-plugin-versionlock") ape = conduit._base.pkgSack.addPackageExcluder exid = 'yum-utils.versionlock.W.' ape(None, exid + str(1), 'wash.marked') ape(None, exid + str(2), 'mark.name.in', _version_lock_excluder_n) ape(None, exid + str(3), 'wash.nevr.in', _version_lock_excluder_nevr) ape(None, exid + str(4), 'exclude.marked') def _add_versionlock_blacklist(conduit): if hasattr(conduit, 'registerPackageName'): conduit.registerPackageName("yum-plugin-versionlock") ape = conduit._base.pkgSack.addPackageExcluder exid = 'yum-utils.versionlock.B.' ape(None, exid + str(1), 'wash.marked') ape(None, exid + str(2), 'mark.nevr.in', _version_lock_excluder_B_nevr) ape(None, exid + str(3), 'exclude.marked') def exclude_hook(conduit): conduit.info(3, 'Reading version lock configuration') if not fileurl: raise PluginYumExit('Locklist not set') for ent in _read_locklist(): neg = False if ent and ent[0] == '!': ent = ent[1:] neg = True (n, v, r, e, a) = splitFilename(ent) n = n.lower() v = v.lower() r = r.lower() e = e.lower() if e == '': e = '0' if neg: _version_lock_excluder_B_nevr.add("%s-%s:%s-%s" % (n, e, v, r)) continue _version_lock_excluder_n.add(n) _version_lock_excluder_nevr.add("%s-%s:%s-%s" % (n, e, v, r)) if (_version_lock_excluder_n and conduit.confBool('main', 'follow_obsoletes', default=False)): # If anything obsoletes something that we have versionlocked ... then # remove all traces of that too. for (pkgtup, instTup) in conduit._base.up.getObsoletesTuples(): if instTup[0] not in _version_lock_excluder_n: continue _version_lock_excluder_n.add(pkgtup[0].lower()) if _version_lock_excluder_n: _add_versionlock_whitelist(conduit) if _version_lock_excluder_B_nevr: _add_versionlock_blacklist(conduit) ������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/po/��������������������������������������������������������������������������������0000775�0000000�0000000�00000000000�11620520663�0014164�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/po/Makefile������������������������������������������������������������������������0000664�0000000�0000000�00000003254�11620520663�0015630�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������INSTALL= /usr/bin/install -c INSTALL_PROGRAM= ${INSTALL} INSTALL_DATA= ${INSTALL} -m 644 INSTALLNLSDIR=$(DESTDIR)/usr/share/locale top_srcdir = "." MSGMERGE = intltool-update -x --gettext-package=$(NLSPACKAGE) --dist NLSPACKAGE = yum-utils CATALOGS = $(shell ls *.po) FMTCATALOGS = $(patsubst %.po,%.mo,$(CATALOGS)) PYFILES = $(wildcard ../*.py) $(wildcard ../plugins/*/*.py) POTFILES = $(PYFILES) all: $(NLSPACKAGE).pot $(FMTCATALOGS) POTFILES.in: for file in $(POTFILES); do \ echo "$${file#../}" ; \ done > $@ $(NLSPACKAGE).pot: $(POTFILES) POTFILES.in intltool-update --gettext-package=$(NLSPACKAGE) --pot update-po: Makefile $(NLSPACKAGE).pot refresh-po refresh-po: Makefile POTFILES.in catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ lang=`basename $$cat .po`; \ cp $$lang.po $$lang.old.po; \ if $(MSGMERGE) $$lang ; then \ rm -f $$lang.old.po ; \ echo "$(MSGMERGE) of $$lang succeeded" ; \ else \ echo "$(MSGMERGE) of $$lang failed" ; \ mv $$lang.old.po $$lang.po ; \ fi \ done report: @for cat in *.po ; do \ echo -n "$$cat: "; \ msgfmt --statistics -o /dev/null $$cat; \ done clean: @rm -fv *mo *~ .depend *.autosave distclean: clean rm -f *mo .depend Makefile $(NLSPACKAGE).pot POTFILES.in depend: install: all mkdir -p $(PREFIX)/$(INSTALLNLSDIR) for n in $(CATALOGS); do \ l=`basename $$n .po`; \ mo=$$l.mo; \ if [ ! -f $$mo ]; then continue; fi; \ $(INSTALL) -m 755 -d $(PREFIX)/$(INSTALLNLSDIR)/$$l; \ $(INSTALL) -m 755 -d $(PREFIX)/$(INSTALLNLSDIR)/$$l/LC_MESSAGES; \ $(INSTALL) -m 644 $$mo \ $(PREFIX)/$(INSTALLNLSDIR)/$$l/LC_MESSAGES/$(NLSPACKAGE).mo; \ done %.mo: %.po msgfmt -o $@ $< ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/po/POTFILES.in���������������������������������������������������������������������0000664�0000000�0000000�00000002631�11620520663�0015743�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-builddep.py yum-groups-manager.py yum-complete-transaction.py verifytree.py yum-debug-dump.py yum-debug-restore.py yumdownloader.py repoquery.py needs-restarting.py repodiff.py yum-config-manager.py repo-rss.py find-repos-of-install.py repo-check.py repomanage.py show-installed.py repoclosure.py package-cleanup.py repo-graph.py debuginfo-install.py reposync.py yumdb.py repotrack.py plugins/rpm-warm-cache/rpm-warm-cache.py plugins/upgrade-helper/upgrade-helper.py plugins/fastestmirror/fastestmirror.py plugins/ps/ps.py plugins/auto-update-debuginfo/auto-update-debuginfo.py plugins/show-leaves/show-leaves.py plugins/list-data/list-data.py plugins/downloadonly/downloadonly.py plugins/allowdowngrade/allowdowngrade.py plugins/tsflags/tsflags.py plugins/merge-conf/merge-conf.py plugins/aliases/aliases.py plugins/protectbase/protectbase.py plugins/versionlock/versionlock.py plugins/security/security.py plugins/nofsync/nofsync.py plugins/tmprepo/tmprepo.py plugins/priorities/priorities.py plugins/fs-snapshot/fs-snapshot.py plugins/remove-with-leaves/remove-with-leaves.py plugins/post-transaction-actions/post-transaction-actions.py plugins/local/local.py plugins/refresh-updatesd/refresh-updatesd.py plugins/filter-data/filter-data.py plugins/keys/keys.py plugins/changelog/changelog.py plugins/verify/verify.py plugins/kernel-module/kernel-module.py plugins/fedorakmod/fedorakmod.py plugins/basearchonly/basearchonly.py �������������������������������������������������������������������������������������������������������yum-utils-1.1.31/po/da.po���������������������������������������������������������������������������0000664�0000000�0000000�00000002320�11620520663�0015105�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # Tim Lauridsen <timlau@fedoraproject.org>, 2010 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-12-30 13:46+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Tim Lauridsen <timlau@fedoraproject.org>\n" "Language-Team: Danish <da@li.org>\n" "Language: da\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../debuginfo-install.py:90 #, python-format msgid "enabling %s" msgstr "aktivere %s" #: ../plugins/aliases/aliases.py:113 #, python-format msgid "Can't open aliases file: %s" msgstr "Kan ikke finde filen med aliaser: %s" #: ../plugins/aliases/aliases.py:120 #, python-format msgid "" "\n" "# Alias added on %s\n" "%s\n" msgstr "" "\n" "# Alias tilføjet på %s\n" "%s\n" #: ../plugins/aliases/aliases.py:128 #, python-format msgid "%s, no match for %s" msgstr "%s, ingen match for %s" #: ../plugins/aliases/aliases.py:132 ../plugins/aliases/aliases.py:139 #, python-format msgid "Alias %s = %s" msgstr "Alias %s = %s" ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/po/yum-utils.pot�������������������������������������������������������������������0000664�0000000�0000000�00000002075�11620520663�0016664�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-12-30 13:46+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: ../debuginfo-install.py:90 #, python-format msgid "enabling %s" msgstr "" #: ../plugins/aliases/aliases.py:113 #, python-format msgid "Can't open aliases file: %s" msgstr "" #: ../plugins/aliases/aliases.py:120 #, python-format msgid "" "\n" "# Alias added on %s\n" "%s\n" msgstr "" #: ../plugins/aliases/aliases.py:128 #, python-format msgid "%s, no match for %s" msgstr "" #: ../plugins/aliases/aliases.py:132 ../plugins/aliases/aliases.py:139 #, python-format msgid "Alias %s = %s" msgstr "" �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/repo-check.py����������������������������������������������������������������������0000775�0000000�0000000�00000016152�11620520663�0016150�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. import sys sys.path.insert(0,'/usr/share/yum-cli') import logging from utils import YumUtilBase from yum.misc import getCacheDir, setup_locale import yum.Errors class UtilCheckBase: def __init__(self): pass def getNames(self): ''' @return the names of the check used at the command line ''' return [] def getUsage(self): """ @return: A usage string for the command, including arguments. """ raise NotImplementedError def getSummary(self): """ @return: A one line summary of what the command does. """ raise NotImplementedError def doSetupParser(self, parser): ''' Setup the check's parser options @param parser: a OptionParser instance ''' pass def doPreSetup(self, base, args, opts): ''' Setup the check before yum is setup @param base: yum base class @param args: command line args @param opts: command line options ''' pass def runCheck(self, base,args, opts): ''' Run the check @param base: yum base class @param args: command line args @param opts: command line options ''' raise NotImplementedError class TestCheck(UtilCheckBase): def __init__(self): pass def getNames(self): ''' @return the names of the check used at the command line ''' return ['test'] def getUsage(self): ''' @return: A usage string for the command, including arguments. ''' return 'test <package> [-all]' def getSummary(self): ''' @return: A one line summary of what the command does. ''' return 'Just a test check' def doSetupParser(self, parser): ''' Setup the tool and add tool cmd options @param parser: OptionParser instance so the tool can add options ''' parser.add_option("--test", default="", dest="test", help='test option') def doPreSetup(self, base, args, opts): ''' Setup the check before yum is setup @param base: yum base class @param args: command line args @param opts: command line options ''' for repo in base.repos.findRepos('*-source'): base.logger.info("Sourcerepo : %s" % repo.id) def runCheck(self, base, args, opts): ''' Run the check @param args: command line args @param opts: command line options ''' if opts.test: base.logger.info('OPTION: --test=%s is used' % opts.test) for pkg in base.pkgSack: if pkg.name.startswith('yum'): print pkg class RepoCheck(YumUtilBase): NAME = 'repo-check' VERSION = '1.0' def __init__(self): self._checks = {} # Register checks self.registerCheck(TestCheck()) # setup the base YumUtilBase.__init__(self, RepoCheck.NAME, RepoCheck.VERSION, self._makeUsage()) self.logger = logging.getLogger("yum.verbose.cli.repo-check") # get the parser self.optparser = self.getOptionParser() self.main() def do_parser_setup(self): if hasattr(self,'getOptionGroup'): # check if the group option API is available parser = self.getOptionGroup() else: parser = self.optparser # Call the checks parser setup methods for check in self._checks.values(): check.doSetupParser(parser) def main(self): self.do_parser_setup() try: opts = self.doUtilConfigSetup() except yum.Errors.RepoError, e: self.logger.error(str(e)) sys.exit(50) # Check if there is anything to do. if len(self.cmds) < 1: print self.optparser.format_help() sys.exit(0) if not self.cmds[0] in self._checks: print "\nUnknown Command : %s \n" % self.cmds[0] print self.optparser.format_help() sys.exit(0) # Make it work as non root if self.conf.uid != 0: cachedir = getCacheDir() self.logger.debug('Running as non-root, using %s as cachedir' % cachedir) if cachedir is None: self.logger.error("Error: Could not make cachedir, exiting") sys.exit(50) self.repos.setCacheDir(cachedir) # Turn off cache self.conf.cache = 0 # make sure the repos know about it, too self.repos.setCache(0) # Run the checks preSetup methods if self.cmds[0] in self._checks: check = self._checks[self.cmds[0]] args = self.cmds[1:] check.doPreSetup(self,args,opts) # Setup yum (Ts, RPM db, Repo & Sack) self.doUtilYumSetup() # Run the check if self.cmds[0] in self._checks: check = self._checks[self.cmds[0]] args = self.cmds[1:] self.logger.info("Running the %s check" % self.cmds[0]) check.runCheck(self,args,opts) def registerCheck(self, command): names = command.getNames() for name in names: if name in self._checks: self.logger.error('Command "%s" already defined' % name) self._checks[name] = command def _makeUsage(self): """ Format an attractive usage string for yum, listing subcommand names and summary usages. """ usage = 'repo-check [options] COMMAND\n\nList of Commands:\n\n' commands = yum.misc.unique(self._checks.values()) commands.sort(cmp=lambda x,y : cmp(x.getNames()[0], y.getNames()[0])) for command in commands: # XXX Remove this when getSummary is common in plugins try: summary = command.getSummary() usage += "%-14s %s\n" % (command.getNames()[0], summary) except (AttributeError, NotImplementedError): usage += "%s\n" % command.getNames()[0] return usage if __name__ == '__main__': setup_locale() util = RepoCheck() ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/repo-graph.py����������������������������������������������������������������������0000775�0000000�0000000�00000010144�11620520663�0016167�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # (c) 2005 Panu Matilainen <pmatilai@laiskiainen.org> # generates graphviz .dot's from repomd data # usage something like # $ ./repo-graph.py --repoid=base > foo.dot # $ neato -v -Gmaxiter=2000 -x -Gcenter=false -Goverlap=scale -Tps2 -o foo.ps foo.dot import yum import sys from yum.misc import getCacheDir from optparse import OptionParser default_header = """ size="20.69,25.52"; ratio="fill"; rankdir="TB"; orientation=port; node[style="filled"]; """ class yumQuiet(yum.YumBase): def doDot(self, header): maxdeps = 0 deps = self.getDeps() print 'digraph packages {', print '%s' % header for pkg in deps.keys(): if len(deps[pkg]) > maxdeps: maxdeps=len(deps[pkg]) # color calculations lifted from rpmgraph h=0.5+(0.6/23*len(deps[pkg])) s=h+0.1 b=1.0 print '"%s" [color="%s %s %s"];' % (pkg, h, s, b) print '"%s" -> {' % pkg for req in deps[pkg]: print '"%s"' % req print '} [color="%s %s %s"];\n' % (h, s, b) print "}" def getDeps(self): requires = {} prov = {} cached = 0 looked_up = 0 skip = [] for pkg in my.pkgSack.returnPackages(): xx = {} for r in pkg.returnPrco('requires'): reqname = r[0] if reqname.startswith('rpmlib'): continue if reqname in prov: provider = prov[reqname] cached += 1 else: provider = my.pkgSack.searchProvides(reqname) looked_up += 1 if not provider: #print "XXXX nothing provides", reqname continue else: provider = provider[0].name prov[reqname] = provider if provider == pkg.name: xx[provider] = None if provider in xx or provider in skip: continue else: xx[provider] = None requires[pkg.name] = xx.keys() #print >> sys.stderr, "looked up %d providers: " % looked_up #print >> sys.stderr, "%d providers from cache: " % cached return requires if __name__ == '__main__': parser = OptionParser() parser.add_option("--repoid", default=[], action="append", help="specify repositories to use") parser.add_option("-c", dest="conffile", action="store", default="/etc/yum.conf", help="config file location") #parser.add_option("--header", dest="header", action="store", # help="specify alternative .dot header") (opts, args) = parser.parse_args() my = yumQuiet() my.doConfigSetup(opts.conffile, init_plugins=False) cachedir = getCacheDir() my.repos.setCacheDir(cachedir) if len(opts.repoid) > 0: for repo in my.repos.findRepos('*'): if repo.id not in opts.repoid: repo.disable() else: repo.enable() try: my.doRepoSetup() my.doTsSetup() my.doSackSetup() my.doDot(default_header) except yum.Errors.YumBaseError, e: print "Encountered an error creating graph: %s" % e sys.exit(1) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yum-utils-1.1.31/repo-rss.py������������������������������������������������������������������������0000775�0000000�0000000�00000023761�11620520663�0015706�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # seth vidal 2005 (c) etc etc import yum import yum.Errors from yum.misc import getCacheDir, to_unicode from yum.comps import Comps, CompsException from yum.Errors import RepoMDError import sys import os import libxml2 import time from optparse import OptionParser class YumQuiet(yum.YumBase): def __init__(self): yum.YumBase.__init__(self) def getRecent(self, days=1): """return most recent packages from sack""" recent = [] now = time.time() recentlimit = now-(days*86400) ftimehash = {} if self.conf.showdupesfromrepos: avail = self.pkgSack.returnPackages() else: avail = self.pkgSack.returnNewestByNameArch() for po in avail: ftime = int(po.returnSimple('filetime')) if ftime > recentlimit: if ftime not in ftimehash: ftimehash[ftime] = [po] else: ftimehash[ftime].append(po) for sometime in ftimehash.keys(): for po in ftimehash[sometime]: recent.append(po) return recent class RepoRSS: def __init__(self, fn='repo-rss.xml'): self.description = 'Repository RSS' self.link = 'http://yum.baseurl.org' self.title = 'Recent Packages' self.doFile(fn) self.doDoc() def doFile(self, fn): if fn[0] != '/': cwd = os.getcwd() self.fn = os.path.join(cwd, fn) else: self.fn = fn try: self.fo = open(self.fn, 'w') except IOError, e: print >> sys.stderr, "Error opening file %s: %s" % (self.fn, e) sys.exit(1) def doDoc(self): """sets up our doc and rssnode attribute initially, rssnode will be redfined as we move along""" self.doc = libxml2.newDoc('1.0') self.xmlescape = self.doc.encodeEntitiesReentrant rss = self.doc.newChild(None, 'rss', None) rss.setProp('version', '2.0') self.rssnode = rss.newChild(None, 'channel', None) def startRSS(self): """return string representation of rss preamble""" rfc822_format = "%a, %d %b %Y %X GMT" now = time.strftime(rfc822_format, time.gmtime()) rssheader = """<?xml version="1.0" encoding="utf-8"?> <rss version="2.0"> <channel> <title>%s %s %s %s Yum """ % (self.title, self.link, self.description, now) self.fo.write(rssheader) def doPkg(self, pkg, url): item = self.rsspkg(pkg, url) self.fo.write(item.serialize("utf-8", 1)) item.unlinkNode() item.freeNode() del item def rsspkg(self, pkg, url): """takes a pkg object and repourl for the pkg object""" rfc822_format = "%a, %d %b %Y %X GMT" clog_format = "%a, %d %b %Y GMT" escape = self.xmlescape item = self.rssnode.newChild(None, 'item', None) title = escape(str(pkg)) item.newChild(None, 'title', title) date = time.gmtime(float(pkg.returnSimple('buildtime'))) item.newChild(None, 'pubDate', time.strftime(rfc822_format, date)) item.newChild(None, 'guid', pkg.returnSimple('id')).setProp("isPermaLink", "false") link = url + '/' + pkg.returnSimple('relativepath') item.newChild(None, 'link', escape(link)) # build up changelog changelog = '' cnt = 0 if (pkg.changelog != None): where = pkg.changelog else: where = pkg.returnChangelog() for e in where: cnt += 1 if cnt > 3: changelog += '...' break (date, author, desc) = e date = time.strftime(clog_format, time.gmtime(float(date))) changelog += '%s - %s\n%s\n\n' % (date, author, desc) description = '

%s - %s

\n\n' % (escape(pkg.name), escape(pkg.returnSimple('summary'))) description += '

%s

\n\n

Change Log:

\n\n' % escape(pkg.returnSimple('description').encode('utf-8').replace("\n", "
\n")) description += escape('
%s
' % escape(to_unicode(changelog).encode('utf-8'))) item.newChild(None, 'description', description) return item def closeRSS(self): """end the rss output""" end="\n \n\n" self.fo.write(end) self.fo.close() del self.fo self.doc.freeDoc() del self.doc def makeFeed(filename, title, link, description, recent, my): rssobj = RepoRSS(fn=filename) rssobj.title = title rssobj.link = link rssobj.description = description rssobj.startRSS() # take recent updates only and dump to an rss compat output if len(recent) > 0: for pkg in recent: repo = my.repos.getRepo(pkg.repoid) url = repo.urls[0] rssobj.doPkg(pkg, url) rssobj.closeRSS() def main(options, args): days = options.days repoids = args my = YumQuiet() if options.config: my.doConfigSetup(init_plugins=False, fn=options.config) else: my.doConfigSetup(init_plugins=False) if os.geteuid() != 0 or options.tempcache: cachedir = getCacheDir() if cachedir is None: print "Error: Could not make cachedir, exiting" sys.exit(50) my.repos.setCacheDir(cachedir) if len(repoids) > 0: for repo in my.repos.repos.values(): if repo.id not in repoids: repo.disable() else: repo.enable() try: my._getRepos() except yum.Errors.RepoError, e: print >> sys.stderr, '%s' % e print 'Cannot continue' sys.exit(1) print 'Reading in repository metadata - please wait....' if len(options.arches): my._getSacks(archlist=options.arches) else: my._getSacks() for repo in my.repos.listEnabled(): try: my.repos.populateSack(which=[repo.id], mdtype='otherdata') except yum.Errors.RepoError, e: print >> sys.stderr, 'otherdata not available for repo: %s' % repo print >> sys.stderr, 'run as root to get changelog data' sys.exit(1) recent = my.getRecent(days=days) if options.groups: comps = Comps() for repo in my.repos.listEnabled(): try: groupsfn = repo.getGroups() except RepoMDError: # no comps.xml file groupsfn = None if not groupsfn: continue try: comps.add(groupsfn) except (AttributeError, CompsException): print 'Error parsing comps file %s !' % groupsfn print 'Multiple feed generation impossible.' sys.exit(1) for group in comps.groups: grouppkgs = group.optional_packages.keys() + group.default_packages.keys() + group.conditional_packages.keys() title = "%s - %s" % (options.title, group.name) description = "%s. %s" % (options.description, group.name) filename = "%s.xml" % group.groupid packages = [ pkg for pkg in recent if pkg.name in grouppkgs ] makeFeed(filename, title, options.link, description, packages, my) # Always make a full feed makeFeed(options.filename, options.title, options.link, options.description, recent, my) if __name__ == "__main__": usage = "repo-rss.py [options] repoid1 repoid2" parser = OptionParser(usage=usage) parser.add_option("-f", action="store", type="string", dest="filename", default='repo-rss.xml', help="filename to write rss to: %default") parser.add_option("-l", action="store", type='string', dest='link', default='http://yum.baseurl.org', help="url for rss feed link: %default") parser.add_option("-t", action='store', type='string', dest='title', default="RSS Repository - Recent Packages", help='Title for Rss feed: %default') parser.add_option("-d", action='store', type='string', dest='description', default="Most recent packages in Repositories", help='description of feed: %default') parser.add_option('-r', action='store', type='int', dest='days', default=3, help='most recent (in days): %default') parser.add_option("--tempcache", default=False, action="store_true", help="Use a temp dir for storing/accessing yum-cache") parser.add_option("-g", action='store_true', dest='groups', default=False, help="Generate one feed per package group") parser.add_option("-a", action='append', dest='arches', default=[], help="arches to use - can be listed more than once") parser.add_option("-c", action='store', dest='config', default=None, help="config file") (options, args) = parser.parse_args() main(options, args) yum-utils-1.1.31/repoclosure.py000077500000000000000000000266461162052066300165030ustar00rootroot00000000000000#!/usr/bin/python -t # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # seth vidal 2005 (c) etc etc #Read in the metadata of a series of repositories and check all the # dependencies in all packages for resolution. Print out the list of # packages with unresolved dependencies import sys import os import logging import yum import yum.Errors from yum.misc import getCacheDir from optparse import OptionParser import rpmUtils.arch import rpmUtils.updates from yum.constants import * from yum.packageSack import ListPackageSack def parseArgs(): usage = """ Read in the metadata of a series of repositories and check all the dependencies in all packages for resolution. Print out the list of packages with unresolved dependencies %s [-c ] [-a ] [-l ] [-r ] [-r ] """ % sys.argv[0] parser = OptionParser(usage=usage) parser.add_option("-c", "--config", default='/etc/yum.conf', help='config file to use (defaults to /etc/yum.conf)') parser.add_option("-a", "--arch", default=[], action='append', help='check packages of the given archs, can be specified multiple ' + 'times (default: current arch)') parser.add_option("--basearch", default=None, help="set the basearch for yum to run as") parser.add_option("-b", "--builddeps", default=False, action="store_true", help='check build dependencies only (needs source repos enabled)') parser.add_option("-l", "--lookaside", default=[], action='append', help="specify a lookaside repo id to query, can be specified multiple times") parser.add_option("-r", "--repoid", default=[], action='append', help="specify repo ids to query, can be specified multiple times (default is all enabled)") parser.add_option("-t", "--tempcache", default=False, action="store_true", help="Use a temp dir for storing/accessing yum-cache") parser.add_option("-q", "--quiet", default=0, action="store_true", help="quiet (no output to stderr)") parser.add_option("-n", "--newest", default=0, action="store_true", help="check only the newest packages in the repos") parser.add_option("--repofrompath", action="append", help="specify repoid & paths of additional repositories - unique repoid and path required, can be specified multiple times. Example. --repofrompath=myrepo,/path/to/repo") parser.add_option("-p", "--pkg", action="append", help="check closure for this package only") parser.add_option("-g", "--group", action="append", help="check closure for packages in this group only") (opts, args) = parser.parse_args() return (opts, args) # Note that this is a "real" API, used by spam-o-matic etc. # so we have to do at least some API guarantee stuff. class RepoClosure(yum.YumBase): def __init__(self, arch=[], config="/etc/yum.conf", builddeps=False, pkgonly=None, basearch=None, grouponly=None): yum.YumBase.__init__(self) if basearch: self.preconf.arch = basearch self.logger = logging.getLogger("yum.verbose.repoclosure") self.lookaside = [] self.builddeps = builddeps self.pkgonly = pkgonly self.grouponly = grouponly self.doConfigSetup(fn = config,init_plugins=False) self._rc_arches = arch if hasattr(self.repos, 'sqlite'): self.repos.sqlite = False self.repos._selectSackType() def evrTupletoVer(self,tup): """convert an evr tuple to a version string, return None if nothing to convert""" e, v, r = tup if v is None: return None val = v if e is not None: val = '%s:%s' % (e, v) if r is not None: val = '%s-%s' % (val, r) return val def readMetadata(self): self.doRepoSetup() archs = [] if not self._rc_arches: archs.extend(self.arch.archlist) else: for arch in self._rc_arches: archs.extend(self.arch.get_arch_list(arch)) if self.builddeps and 'src' not in archs: archs.append('src') self.doSackSetup(archs) for repo in self.repos.listEnabled(): self.repos.populateSack(which=[repo.id], mdtype='filelists') def getBrokenDeps(self, newest=False): unresolved = {} resolved = {} pkgs = self.pkgSack if newest: pkgs = self.pkgSack.returnNewestByNameArch() mypkgSack = ListPackageSack(pkgs) pkgtuplist = mypkgSack.simplePkgList() # toss out any of the obsoleted pkgs so we can't depsolve with them self.up = rpmUtils.updates.Updates([], pkgtuplist) self.up.rawobsoletes = mypkgSack.returnObsoletes() for pkg in pkgs: fo = self.up.checkForObsolete([pkg.pkgtup]) if fo: # useful debug to make sure the obsoletes is sane #print "ignoring obsolete pkg %s" % pkg #for i in fo[pkg.pkgtup]: # print i self.pkgSack.delPackage(pkg) # we've deleted items so remake the pkgs pkgs = self.pkgSack.returnNewestByNameArch() pkgtuplist = mypkgSack.simplePkgList() if self.builddeps: pkgs = filter(lambda x: x.arch == 'src', pkgs) pkglist = self.pkgonly if self.grouponly: if not pkglist: pkglist = [] for group in self.grouponly: groupobj = self.comps.return_group(group) if not groupobj: continue pkglist.extend(groupobj.packages) if pkglist: pkgs = filter(lambda x: x.name in pkglist, pkgs) for pkg in pkgs: if pkg.repoid in self.lookaside: # don't attempt to resolve dependancy issues for # packages from lookaside repositories continue for (req, flags, (reqe, reqv, reqr)) in pkg.returnPrco('requires'): if req.startswith('rpmlib'): continue # ignore rpmlib deps ver = self.evrTupletoVer((reqe, reqv, reqr)) if (req,flags,ver) in resolved: continue resolve_sack = [] # make it empty try: resolve_sack = self.whatProvides(req, flags, ver) except yum.Errors.RepoError, e: pass if len(resolve_sack) < 1: if pkg not in unresolved: unresolved[pkg] = [] unresolved[pkg].append((req, flags, ver)) continue if newest: resolved_by_newest = False for po in resolve_sack:# look through and make sure all our answers are newest-only if po.pkgtup in pkgtuplist: resolved_by_newest = True break if resolved_by_newest: resolved[(req,flags,ver)] = 1 else: if pkg not in unresolved: unresolved[pkg] = [] unresolved[pkg].append((req, flags, ver)) return unresolved def main(): (opts, cruft) = parseArgs() my = RepoClosure(arch=opts.arch, config=opts.config, builddeps=opts.builddeps, pkgonly=opts.pkg, grouponly=opts.group, basearch=opts.basearch) if opts.repofrompath: # setup the fake repos for repo in opts.repofrompath: repoid,repopath = tuple(repo.split(',')) if repopath.startswith('http') or repopath.startswith('ftp') or repopath.startswith('file:'): baseurl = repopath else: repopath = os.path.abspath(repopath) baseurl = 'file://' + repopath newrepo = yum.yumRepo.YumRepository(repoid) newrepo.name = repopath newrepo.baseurl = baseurl newrepo.basecachedir = my.conf.cachedir newrepo.metadata_expire = 0 newrepo.timestamp_check = False my.repos.add(newrepo) my.repos.enableRepo(newrepo.id) my.logger.info( "Added %s repo from %s" % (repoid,repopath)) if opts.repoid: for repo in my.repos.repos.values(): if ((repo.id not in opts.repoid) and (repo.id not in opts.lookaside)): repo.disable() else: repo.enable() if opts.lookaside: my.lookaside = opts.lookaside if os.geteuid() != 0 or opts.tempcache: cachedir = getCacheDir() if cachedir is None: my.logger.error("Error: Could not make cachedir, exiting") sys.exit(50) my.repos.setCacheDir(cachedir) if not opts.quiet: my.logger.info('Reading in repository metadata - please wait....') try: my.readMetadata() except yum.Errors.RepoError, e: my.logger.info(e) my.logger.info('Some dependencies may not be complete for this repository') my.logger.info('Run as root to get all dependencies or use -t to enable a user temp cache') if not opts.quiet: my.logger.info('Checking Dependencies') baddeps = my.getBrokenDeps(opts.newest) if opts.newest: num = len(my.pkgSack.returnNewestByNameArch()) else: num = len(my.pkgSack) repos = my.repos.listEnabled() if not opts.quiet: my.logger.info('Repos looked at: %s' % len(repos)) for repo in repos: my.logger.info(' %s' % repo) my.logger.info('Num Packages in Repos: %s' % num) pkgs = baddeps.keys() def sortbyname(a,b): return cmp(a.__str__(),b.__str__()) pkgs.sort(sortbyname) for pkg in pkgs: my.logger.info('package: %s from %s\n unresolved deps: ' % (pkg, pkg.repoid)) for (n, f, v) in baddeps[pkg]: req = '%s' % n if f: flag = LETTERFLAGS[f] req = '%s %s'% (req, flag) if v: req = '%s %s' % (req, v) my.logger.info(' %s' % req) if __name__ == "__main__": try: main() except (yum.Errors.YumBaseError, ValueError), e: print >> sys.stderr, str(e) sys.exit(1) yum-utils-1.1.31/repodiff.py000077500000000000000000000274641162052066300157360ustar00rootroot00000000000000#!/usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # (c) 2007 Red Hat. Written by skvidal@fedoraproject.org import yum import sys import datetime import os import locale import rpmUtils.arch from yum.i18n import to_unicode from optparse import OptionParser class DiffYum(yum.YumBase): def __init__(self): yum.YumBase.__init__(self) self.dy_repos = {'old':[], 'new':[]} self.dy_basecachedir = yum.misc.getCacheDir() self.dy_archlist = ['src'] def dy_shutdown_all_other_repos(self): # disable all the other repos self.repos.disableRepo('*') def dy_setup_repo(self, repotype, baseurl): repoid = repotype + str (len(self.dy_repos[repotype]) + 1) self.dy_repos[repotype].append(repoid) # make our new repo obj newrepo = yum.yumRepo.YumRepository(repoid) newrepo.name = repoid newrepo.baseurl = [baseurl] newrepo.basecachedir = self.dy_basecachedir newrepo.metadata_expire = 0 newrepo.timestamp_check = False # add our new repo self.repos.add(newrepo) # enable that repo self.repos.enableRepo(repoid) # setup the repo dirs/etc self.doRepoSetup(thisrepo=repoid) if '*' in self.dy_archlist: # Include all known arches arches = rpmUtils.arch.arches archlist = list(set(arches.keys()).union(set(arches.values()))) else: archlist = self.dy_archlist self._getSacks(archlist=archlist, thisrepo=repoid) def dy_diff(self, compare_arch=False): add = [] remove = [] modified = [] obsoleted = {} # obsoleted = by # Originally we did this by setting up old and new repos. ... but as # a faster way, we can just go through all the pkgs once getting the # newest pkg with a repoid prefix of "old", dito. "new", and then # compare those directly. def _next_old_new(pkgs): """ Returns latest pair of (oldpkg, newpkg) for each package name. If that name doesn't exist, then it returns None for that package. """ last = None npkg = opkg = None for pkg in sorted(pkgs): if compare_arch: key = (pkg.name, pkg.arch) else: key = pkg.name if last is None: last = key if last != key: yield opkg, npkg opkg = npkg = None last = key if pkg.repo.id.startswith('old'): opkg = pkg else: assert pkg.repo.id.startswith('new') npkg = pkg if opkg is not None or npkg is not None: yield opkg, npkg for opkg, npkg in _next_old_new(self.pkgSack.returnPackages()): if opkg is None: add.append(npkg) elif npkg is None: remove.append(opkg) elif not npkg.verEQ(opkg): modified.append((npkg, opkg)) ao = {} for pkg in add: for obs_name in set(pkg.obsoletes_names): if obs_name not in ao: ao[obs_name] = [] ao[obs_name].append(pkg) # Note that this _only_ shows something when you have an additional # package obsoleting a removed package. If the obsoleted package is # still there (somewhat "common") or the obsoleter is an update (dito) # you _don't_ get hits here. for po in remove: # Remember: Obsoletes are for package names only. poprovtup = (po.name, 'EQ', (po.epoch, po.ver, po.release)) for newpo in ao.get(po.name, []): if newpo.inPrcoRange('obsoletes', poprovtup): obsoleted[po] = newpo break ygh = yum.misc.GenericHolder() ygh.add = add ygh.remove = remove ygh.modified = modified ygh.obsoleted = obsoleted return ygh def parseArgs(args): """ Parse the command line args. return a list of 'new' and 'old' repos """ usage = """ repodiff: take 2 or more repositories and return a list of added, removed and changed packages. repodiff --old=old_repo_baseurl --new=new_repo_baseurl """ parser = OptionParser(version = "repodiff 0.2", usage=usage) # query options parser.add_option("-n", "--new", default=[], action="append", help="new baseurl[s] for repos") parser.add_option("-o", "--old", default=[], action="append", help="old baseurl[s] for repos") parser.add_option("-q", "--quiet", default=False, action='store_true') parser.add_option("-a", "--archlist", default=[], action="append", help="In addition to src.rpms, any arch you want to include") parser.add_option("--compare-arch", default=False, action='store_true', help="When comparing binary repos. also compare the arch of packages, to see if they are different") parser.add_option("-s", "--size", default=False, action='store_true', help="Output size changes for any new->old packages") parser.add_option("--simple", default=False, action='store_true', help="output simple format") (opts, argsleft) = parser.parse_args() if not opts.new or not opts.old: parser.print_usage() sys.exit(1) # sort out the comma-separated crap we somehow inherited. archlist = [] for a in opts.archlist: for arch in a.split(','): archlist.append(arch) if not archlist : archlist = ['src'] opts.archlist = archlist return opts def main(args): opts = parseArgs(args) my = DiffYum() archlist_changed = False if opts.archlist and not opts.archlist[0] == 'src': my.preconf.arch = opts.archlist[0] archlist_changed = True if opts.quiet: my.conf.debuglevel=0 my.doLoggingSetup(my.conf.debuglevel, my.conf.errorlevel) my.conf.disable_excludes = ['all'] my.dy_shutdown_all_other_repos() my.dy_archlist = opts.archlist if archlist_changed: my.dy_archlist += my.arch.archlist if not opts.quiet: print 'setting up repos' for r in opts.old: if not opts.quiet: print "setting up old repo %s" % r try: my.dy_setup_repo('old', r) except yum.Errors.RepoError, e: print "Could not setup repo at url %s: %s" % (r, e) sys.exit(1) for r in opts.new: if not opts.quiet: print "setting up new repo %s" % r try: my.dy_setup_repo('new', r) except yum.Errors.RepoError, e: print "Could not setup repo at url %s: %s" % (r, e) sys.exit(1) if not opts.quiet: print 'performing the diff' ygh = my.dy_diff(opts.compare_arch) total_sizechange = 0 add_sizechange = 0 remove_sizechange = 0 if ygh.add: for pkg in sorted(ygh.add): if opts.compare_arch: print 'New package: %s' % pkg else: print 'New package: %s-%s-%s' % (pkg.name, pkg.ver, pkg.rel) print ' %s\n' % to_unicode(pkg.summary) add_sizechange += int(pkg.size) if ygh.remove: for pkg in sorted(ygh.remove): if opts.compare_arch: print 'Removed package: %s' % pkg else: print 'Removed package: %s-%s-%s' % (pkg.name, pkg.ver,pkg.rel) if pkg in ygh.obsoleted: print 'Obsoleted by : %s' % ygh.obsoleted[pkg] remove_sizechange += (int(pkg.size)) if ygh.modified: print '\nUpdated Packages:\n' for (pkg, oldpkg) in sorted(ygh.modified): if opts.size: sizechange = int(pkg.size) - int(oldpkg.size) total_sizechange += sizechange if opts.simple: if opts.compare_arch: msg = "%s: %s -> %s" % (pkg.name, oldpkg, pkg) else: msg = "%s: %s-%s-%s -> %s-%s-%s" % (pkg.name, oldpkg.name, oldpkg.ver, oldpkg.rel, pkg.name, pkg.ver, pkg.rel) else: if opts.compare_arch: msg = "%s" % pkg else: msg = "%s-%s-%s" % (pkg.name, pkg.ver, pkg.rel) dashes = "-" * len(msg) msg += "\n%s\n" % dashes # get newest clog time from the oldpkg # for any newer clog in pkg # print it oldlogs = oldpkg.changelog if len(oldlogs): # Don't sort as that can screw the order up when time is the # same. oldtime = oldlogs[0][0] oldauth = oldlogs[0][1] oldcontent = oldlogs[0][2] for (t, author, content) in pkg.changelog: if t < oldtime: break if ((t == oldtime) and (author == oldauth) and (content == oldcontent)): break tm = datetime.date.fromtimestamp(int(t)) tm = tm.strftime("%a %b %d %Y") msg += "* %s %s\n%s\n\n" % (tm, to_unicode(author), to_unicode(content)) if opts.size: msg += "\nSize Change: %s bytes\n" % sizechange print msg if (not ygh.add and not ygh.remove and not ygh.modified and not my.pkgSack.searchNevra(arch='src')): print "** No 'src' pkgs in any repo. maybe see docs. on --archlist?" print '\nSummary:' print 'Added Packages: %s' % len(ygh.add) print 'Removed Packages: %s' % len(ygh.remove) print 'Modified Packages: %s' % len(ygh.modified) if opts.size: print 'Size of added packages: %s' % add_sizechange print 'Size change of modified packages: %s' % total_sizechange print 'Size of removed packages: %s' % remove_sizechange if __name__ == "__main__": # This test needs to be before locale.getpreferredencoding() as that # does setlocale(LC_CTYPE, "") try: locale.setlocale(locale.LC_ALL, '') except locale.Error, e: # default to C locale if we get a failure. print >> sys.stderr, 'Failed to set locale, defaulting to C' os.environ['LC_ALL'] = 'C' locale.setlocale(locale.LC_ALL, 'C') if True: # not sys.stdout.isatty(): import codecs sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout) sys.stdout.errors = 'replace' main(sys.argv[1:]) yum-utils-1.1.31/repomanage.py000077500000000000000000000156101162052066300162440ustar00rootroot00000000000000#!/usr/bin/python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # (c) Copyright Seth Vidal 2004 # need hdropen, dir traversing, version comparison, and getopt (eventually) # this should take a dir, traverse it - build a dict of foo[(name, arch)] = [/path/to/file/that/is/highest, /path/to/equalfile] import os import sys import rpm import fnmatch import string import rpmUtils from yum import misc from optparse import OptionParser def errorprint(stuff): print >> sys.stderr, stuff def getFileList(path, ext, filelist): """Return all files in path matching ext, store them in filelist, recurse dirs return list object""" extlen = len(ext) try: dir_list = os.listdir(path) except OSError, e: errorprint('Error accessing directory %s, %s' % (path, str(e))) return [] for d in dir_list: if os.path.isdir(path + '/' + d): filelist = getFileList(path + '/' + d, ext, filelist) else: if string.lower(d[-extlen:]) == '%s' % (ext): newpath = os.path.normpath(path + '/' + d) filelist.append(newpath) return filelist def trimRpms(rpms, excludeGlobs): # print 'Pre-Trim Len: %d' % len(rpms) badrpms = [] for fn in rpms: for glob in excludeGlobs: if fnmatch.fnmatch(fn, glob): # print 'excluded: %s' % fn if fn not in badrpms: badrpms.append(fn) for fn in badrpms: if fn in rpms: rpms.remove(fn) # print 'Post-Trim Len: %d' % len(rpms) return rpms def parseargs(args): usage = """ repomanage: manage a directory of rpm packages. returns lists of newest or oldest packages in a directory for easy piping to xargs or similar programs. repomanage [--old] [--new] path. """ parser = OptionParser(usage=usage) # new is only used to make sure that the user is not trying to get both # new and old, after this old and not old will be used. # (default = not old = new) parser.add_option("-o", "--old", default=False, action="store_true", help='print the older packages') parser.add_option("-n", "--new", default=False, action="store_true", help='print the newest packages') parser.add_option("-s", "--space", default=False, action="store_true", help='space separated output, not newline') parser.add_option("-k", "--keep", default=1, dest='keep', action="store", help='newest N packages to keep - defaults to 1') parser.add_option("-c", "--nocheck", default=0, action="store_true", help='do not check package payload signatures/digests') (opts, args)= parser.parse_args() if opts.new and opts.old: errorprint('\nPass either --old or --new, not both!\n') print parser.format_help() sys.exit(1) if len(args) > 1: errorprint('Error: Only one directory allowed per run.') print parser.format_help() sys.exit(1) if len(args) < 1: errorprint('Error: Must specify a directory to index.') print parser.format_help() sys.exit(1) return (opts, args) def main(args): (options, args) = parseargs(args) mydir = args[0] rpmList = [] rpmList = getFileList(mydir, '.rpm', rpmList) verfile = {} pkgdict = {} # hold all of them - put them in (n,a) = [(e,v,r),(e1,v1,r1)] keepnum = int(options.keep)*(-1) # the number of items to keep if len(rpmList) == 0: errorprint('No files to process') sys.exit(1) ts = rpm.TransactionSet() if options.nocheck: ts.setVSFlags(~(rpm._RPMVSF_NOPAYLOAD)) else: ts.setVSFlags(~(rpm.RPMVSF_NOMD5|rpm.RPMVSF_NEEDPAYLOAD)) for pkg in rpmList: try: hdr = rpmUtils.miscutils.hdrFromPackage(ts, pkg) except rpmUtils.RpmUtilsError, e: msg = "Error opening pkg %s: %s" % (pkg, str(e)) errorprint(msg) continue pkgtuple = rpmUtils.miscutils.pkgTupleFromHeader(hdr) (n,a,e,v,r) = pkgtuple del hdr if (n,a) not in pkgdict: pkgdict[(n,a)] = [] pkgdict[(n,a)].append((e,v,r)) if pkgtuple not in verfile: verfile[pkgtuple] = [] verfile[pkgtuple].append(pkg) for natup in pkgdict.keys(): evrlist = pkgdict[natup] if len(evrlist) > 1: evrlist = misc.unique(evrlist) evrlist.sort(rpmUtils.miscutils.compareEVR) pkgdict[natup] = evrlist del ts # now we have our dicts - we can return whatever by iterating over them outputpackages = [] #if new if not options.old: for (n,a) in pkgdict.keys(): evrlist = pkgdict[(n,a)] if len(evrlist) < abs(keepnum): newevrs = evrlist else: newevrs = evrlist[keepnum:] for (e,v,r) in newevrs: for pkg in verfile[(n,a,e,v,r)]: outputpackages.append(pkg) if options.old: for (n,a) in pkgdict.keys(): evrlist = pkgdict[(n,a)] if len(evrlist) < abs(keepnum): continue oldevrs = evrlist[:keepnum] for (e,v,r) in oldevrs: for pkg in verfile[(n,a,e,v,r)]: outputpackages.append(pkg) outputpackages.sort() for pkg in outputpackages: if options.space: print '%s' % pkg, else: print pkg def usage(): print """ repomanage [--old] [--new] path -o --old - print the older packages -n --new - print the newest packages -s --space - space separated output, not newline -k --keep - newest N packages to keep - defaults to 1 -c --nocheck - do not check package payload signatures/digests -h --help - duh By default it will output the full path to the newest packages in the path. """ if __name__ == "__main__": if len(sys.argv) < 1: usage() sys.exit(1) else: main(sys.argv[1:]) yum-utils-1.1.31/repoquery.py000077500000000000000000001450461162052066300161700ustar00rootroot00000000000000#!/usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # (c) pmatilai@laiskiainen.org import sys sys.path.insert(0, '/usr/share/yum-cli') import signal import re import fnmatch import time import os import os.path import exceptions import urlparse from optparse import OptionParser from optparse import SUPPRESS_HELP import logging import yum import yum.misc as misc import yum.config import yum.Errors import yum.packages from yum.i18n import to_unicode from rpmUtils.arch import getArchList, getBaseArch from rpmUtils.miscutils import formatRequire import output from urlgrabber.progress import TextMeter from urlgrabber.progress import format_number version = "0.0.11" flags = { 'EQ':'=', 'LT':'<', 'LE':'<=', 'GT':'>', 'GE':'>=', 'None':' '} std_qf = { 'nvr': '%{name}-%{version}-%{release}', 'nevra': '%{name}-%{epoch}:%{version}-%{release}.%{arch}', 'envra': '%{epoch}:%{name}-%{version}-%{release}.%{arch}', 'source': '%{sourcerpm}', 'info': """ Name : %{name} Version : %{version} Release : %{release} Architecture: %{arch} Size : %{installedsize} Packager : %{packager} Group : %{group} URL : %{url} Repository : %{repoid} Summary : %{summary} Source : %{sourcerpm} Description :\n%{description}""", } querytags = [ 'name', 'version', 'release', 'epoch', 'arch', 'summary', 'description', 'packager', 'url', 'buildhost', 'sourcerpm', 'vendor', 'group', 'license', 'buildtime', 'filetime', 'installedsize', 'archivesize', 'packagesize', 'repoid', 'requires', 'provides', 'conflicts', 'obsoletes', 'relativepath', 'hdrstart', 'hdrend', 'id', ] def sec2isodate(timestr): return time.strftime("%F %T", time.gmtime(int(timestr))) def sec2date(timestr): return to_unicode(time.ctime(int(timestr))) def sec2day(timestr): return to_unicode(time.strftime("%a %b %d %Y", time.gmtime(int(timestr)))) def _size2val(size, off, ui): size = float(size) off = 1024 if False: pass elif size >= (off * 100): return "%.0f%s" % ((size / off), ui) elif size >= (off * 10): return "%.1f%s" % ((size / off), ui) return "%.2f%s" % ((size / off), ui) def size2k(size): return _size2val(size, 1024, " k") def size2m(size): return _size2val(size, 1024 * 1024, " M") def size2g(size): return _size2val(size, 1024 * 1024 * 1024, " G") def size2t(size): return _size2val(size, 1024 * 1024 * 1024 * 1024, " T") def size2h(size): return format_number(size) convertmap = { 'date': sec2date, 'day': sec2day, 'isodate': sec2isodate, 'k': size2k, 'm': size2m, 'g': size2g, 'h': size2h, } class queryError(exceptions.Exception): def __init__(self, value=None): Exception.__init__(self) self.value = value def __str__(self): return "%s" %(self.value,) def __unicode__(self): return '%s' % to_unicode(self.value) class DotPlot(object): def __init__(self): print 'digraph packages {', print """ size="20.69,25.52"; ratio="fill"; rankdir="TB"; orientation=port; node[style="filled"]; outputorder="edgesfirst"; ranksep="1"; """ def addPackage(self, pkg, deps): # color calculations lifted from rpmgraph h=0.5+(0.6/23*len(deps)) s=h+0.1 b=1.0 print '"%s" [color="%s %s %s"];' % (pkg, h, s, b) print '"%s" -> {' % pkg for req in deps: print '"%s"' % req print '} [color="%s %s %s"];\n' % (h, s, b) def __del__(self): print "}" # abstract class class pkgQuery: """ My implementation of __getitem__ either forwards to an implementation of fmt_(name), or to self.pkg.returnSimple(), allowing subclasses to override the package's items. @type pkg: L{yum.package.YumAvailablePackage} @ivar qf: the query format for this package query @type qf: str """ def __init__(self, pkg, qf, yb=None): self.yb = yb self.pkg = pkg self.qf = qf self.name = pkg.name self.classname = None self._translated_qf = {} def __getitem__(self, item): item = item.lower() if hasattr(self, "fmt_%s" % item): return getattr(self, "fmt_%s" % item)() elif item.startswith('repo.'): repo_item = item.split('.')[1] try: return getattr(self.pkg.repo, repo_item) except AttributeError,e: raise queryError("Invalid repo querytag '%s' for %s: %s" % (repo_item, self.classname, self.pkg)) elif hasattr(self.pkg, item): return getattr(self.pkg, item) res = None convert = None tmp = item.split(':') if len(tmp) > 1: item = tmp[0] conv = tmp[1] if conv in convertmap: convert = convertmap[conv] else: raise queryError("Invalid conversion: %s" % conv) # this construct is the way it is because pkg.licenses isn't # populated before calling pkg.returnSimple() ?! try: res = self.pkg.returnSimple(item) except (KeyError, ValueError): if item == "license": res = ", ".join(self.pkg.licenses) else: raise queryError("Invalid querytag '%s' for %s: %s" % (item, self.classname, self.pkg)) if convert: res = convert(res) return res def __str__(self): return self.fmt_queryformat() def doQuery(self, method, *args, **kw): if method in std_qf: self.qf = std_qf[method] return self.fmt_queryformat() elif hasattr(self, "fmt_%s" % method): return getattr(self, "fmt_%s" % method)(*args, **kw) else: raise queryError("Invalid package query: %s" % method) def isSource(self): return self["arch"] == "src" def prco(self, what, **kw): """ Query for the provides/requires/conflicts/obsoletes of this package. @param what: one of provides, requires, conflicts, obsoletes @type what: str @rtype: list of str """ # for subclasses to implement raise NotImplementedError def fmt_queryformat(self, **kw): if not self.qf: return self.fmt_nevra() # Override .qf for fun and profit... if self.qf not in self._translated_qf: qf = self.qf qf = qf.replace("\\n", "\n") qf = qf.replace("\\t", "\t") pattern = re.compile('%([-\d]*?){([:\.\w]*?)}') fmt = re.sub(pattern, r'%(\2)\1s', qf) self._translated_qf[self.qf] = fmt return self._translated_qf[self.qf] % self def fmt_requires(self, **kw): if self.yb.options.output in ("ascii-tree", "dot-tree"): self.fmt_tree_requires(output = self.yb.options.output, tree_level = self.yb.options.tree_level, dot = self.yb.options.dot) else: return "\n".join(self.prco('requires')) def fmt_provides(self, **kw): return "\n".join(self.prco('provides')) def fmt_conflicts(self, **kw): if self.yb.options.output in ("ascii-tree", "dot-tree"): self.fmt_tree_conflicts(output = self.yb.options.output, tree_level = self.yb.options.tree_level, dot = self.yb.options.dot) else: return "\n".join(self.prco('conflicts')) def fmt_obsoletes(self, **kw): if self.yb.options.output in ("ascii-tree", "dot-tree"): self.fmt_tree_obsoletes(output = self.yb.options.output, tree_level = self.yb.options.tree_level, dot = self.yb.options.dot) else: return "\n".join(self.prco('obsoletes')) def fmt_list(self, **kw): return "\n".join(self.files()) def fmt_evr(self, **kw): return "%(epoch)s:%(version)s-%(release)s" % self def fmt_nevr(self, **kw): return "%(name)s-%(evr)s" % self def fmt_envr(self, **kw): return "%(epoch)s:%(name)s-%(version)s-%(release)s" % self def fmt_nevra(self, **kw): return "%(nevr)s.%(arch)s" % self def fmt_envra(self, **kw): return "%(envr)s.%(arch)s" % self def fmt_location(self, **kw): loc = '' repo = self.pkg.repo if self['basepath']: loc = "%(basepath)s/%(relativepath)s" % self else: repourl = repo.urls[0] if repourl[-1] != '/': repourl = repourl + '/' loc = urlparse.urljoin(repourl, self['relativepath']) return loc def tree_print_req(self, req, val, level): indent = '' if level: indent = ' | ' * (level - 1) + ' \_ ' print "%s%s [%s]" % (indent, str(req), str(val)) # These are common helpers for the --tree-* options... @staticmethod def _tree_print_req(req, val, level): indent = '' if level: indent = ' | ' * (level - 1) + ' \_ ' print "%s%s [%s]" % (indent, str(req), str(val)) def _tree_pkg2uniq(self, pkg): """ Turn a pkg into a "unique" req.""" if self.yb and self.yb.conf.showdupesfromrepos: return str(pkg) return "%s.%s" % (pkg.name, getBaseArch(pkg.arch)) def _tree_pkg2val(self, reqs, pkg): reqs = sorted(reqs[self._tree_pkg2uniq(pkg)]) return str(len(reqs)) + ": " + ", ".join(reqs) def _tree_maybe_add_pkg(self, all_reqs, loc_reqs, pkgs, pkg, val): req = self._tree_pkg2uniq(pkg) if req in loc_reqs: loc_reqs[req].add(val) return if req in all_reqs: pkgs[pkg] = None loc_reqs[req] = set([val]) return pkgs[pkg] = True loc_reqs[req] = set([val]) all_reqs[req] = True def _tree_maybe_add_pkgs(self, all_reqs, tups, tup2pkgs): rpkgs = {} loc_reqs = {} for rptup in tups: (rpn, rpf, (rp,rpv,rpr)) = rptup if rpn.startswith('rpmlib'): continue rname = yum.misc.prco_tuple_to_string(rptup) for npkg in sorted(tup2pkgs(rptup, rname), reverse=True): self._tree_maybe_add_pkg(all_reqs, loc_reqs, rpkgs, npkg, rname) return rpkgs, loc_reqs def _fmt_tree_prov(self, prco_type, **kw): pkg = kw.get('pkg', self.pkg) req = kw.get('req', 'cmd line') level = kw.get('level', 0) all_reqs = kw.get('all_reqs', {}) if kw['output'].lower() == 'dot-tree': if 'dot' not in kw.keys() or kw['dot'] is None: kw['dot'] = DotPlot() elif 'dot' not in kw.keys() or kw['dot'] is None: kw['dot'] = None if str(kw['tree_level']).lower() != 'all': try: kw['tree_level'] = int(kw['tree_level']) except ValueError, er: kw['tree_level'] = 'all' if not 'output' in kw.keys(): kw['output'] = 'ascii-tree' __req2pkgs = {} def req2pkgs(ignore, req): req = str(req) if req in __req2pkgs: return __req2pkgs[req] if self.yb is None: return [] yb = self.yb providers = [] try: # XXX rhbz#246519, for some reason returnPackagesByDep() fails # to find some root level directories while # searchPackageProvides() does... use that for now matches = self.yb.searchPackageProvides([req]) if self.yb.options.pkgnarrow == 'repos': # Sucks that we do the work, and throw it away... for provider in matches: if provider.repoid != 'installed': providers.append(provider) elif self.yb.options.pkgnarrow == 'installed': # Sucks that we do the work, and throw it away... for provider in matches: if provider.repoid == 'installed': providers.append(provider) else: # Assume "all" providers = matches.keys() except yum.Errors.YumBaseError, err: print >>sys.stderr, "No package provides %s" % req return [] __req2pkgs[req] = providers return providers dot = kw['dot'] tups = getattr(pkg, prco_type) rpkgs, loc_reqs = self._tree_maybe_add_pkgs(all_reqs, tups, req2pkgs) if dot is None: self._tree_print_req(pkg, req, level) lim = level + 1 else: dot.addPackage(pkg, rpkgs) lim = level + 2 nlevel = level + 1 if str(kw['tree_level']).lower() != 'all' and \ int(kw['tree_level']) < int(lim): return for rpkg in sorted(rpkgs): if pkg.verEQ(rpkg): continue if rpkgs[rpkg] is None: req = self._tree_pkg2val(loc_reqs, rpkg) if dot is None: self._tree_print_req(rpkg, req, nlevel) continue self._fmt_tree_prov(prco_type, pkg = rpkg, level = nlevel, all_reqs = all_reqs, req = self._tree_pkg2val(loc_reqs, rpkg), tree_level = kw['tree_level'], output = kw['output'], dot = dot) def fmt_tree_requires(self, **kw): return self._fmt_tree_prov('requires', **kw) def fmt_tree_conflicts(self, **kw): return self._fmt_tree_prov('conflicts', **kw) def fmt_tree_obsoletes(self, **kw): pkg = kw.get('pkg', self.pkg) level = kw.get('level', 0) all_reqs = kw.get('all_reqs', {}) if kw['output'].lower() == 'dot-tree': if 'dot' not in kw.keys() or kw['dot'] is None: kw['dot'] = DotPlot() elif 'dot' not in kw.keys() or kw['dot'] is None: kw['dot'] = None if str(kw['tree_level']).lower() != 'all': try: kw['tree_level'] = int(kw['tree_level']) except ValueError, er: kw['tree_level'] = 'all' if not 'output' in kw.keys(): kw['output'] = 'ascii-tree' def obs2pkgs(): if self.yb is None: return [] yb = self.yb obss = [] if self.yb.options.pkgnarrow in ('all', 'repos'): for obs_n in pkg.obsoletes_names: for opkg in yb.pkgSack.searchNevra(name=obs_n): if opkg.obsoletedBy([pkg]): obss.append(opkg) if self.yb.options.pkgnarrow in ('all', 'installed'): skip = set([opkg.pkgtup for opkg in obss]) for obs_n in pkg.obsoletes_names: for opkg in yb.rpmdb.searchNevra(name=obs_n): if opkg.pkgtup in skip: continue if opkg.obsoletedBy([pkg]): obss.append(opkg) return obss dot = kw['dot'] if level: reason = '' else: reason = 'cmd line' rpkgs = obs2pkgs() if dot is None: self._tree_print_req(pkg, reason, level) lim = level + 1 else: dot.addPackage(pkg, rpkgs) lim = level + 2 all_reqs[pkg] = None nlevel = level + 1 if str(kw['tree_level']).lower() != 'all' and \ int(kw['tree_level']) < int(lim): return for rpkg in sorted(rpkgs): if pkg.verEQ(rpkg): continue if rpkg in all_reqs and dot is None: self._tree_print_req(rpkg, '', nlevel) continue self.fmt_tree_obsoletes(pkg=rpkg, level=nlevel, all_reqs=all_reqs, tree_level = kw['tree_level'], output = kw['output'], dot = dot) def fmt_tree_what_requires(self, **kw): pkg = kw.get('pkg', self.pkg) req = kw.get('req', 'cmd line') level = kw.get('level', 0) all_reqs = kw.get('all_reqs', {}) if kw['output'].lower() == 'dot-tree': if 'dot' not in kw.keys() or kw['dot'] is None: kw['dot'] = DotPlot() if str(kw['tree_level']).lower() != 'all': try: kw['tree_level'] = int(kw['tree_level']) except ValueError, er: kw['tree_level'] = 'all' if not 'output' in kw.keys(): kw['output'] = 'ascii-tree' __prov2pkgs = {} def prov2pkgs(prov, ignore): if str(prov) in __prov2pkgs: return __prov2pkgs[str(prov)] if self.yb is None: return [] yb = self.yb arequirers = [] irequirers = [] try: skip = {} if yb.options.pkgnarrow in ('all', 'installed'): irequirers = yb.rpmdb.getRequires(prov[0],prov[1],prov[2]) irequirers = irequirers.keys() if yb.options.pkgnarrow in ('all', 'repos'): areqs = yb.pkgSack.getRequires(prov[0],prov[1],prov[2]) if not irequirers: arequirers = areqs.keys() else: skip = set([pkg.pkgtup for pkg in irequirers]) arequirers = [pkg for pkg in areqs if pkg.pkgtup not in skip] except yum.Errors.YumBaseError, err: print >>sys.stderr, "No package provides %s" % str(prov) return [] __prov2pkgs[str(prov)] = arequirers + irequirers return arequirers + irequirers filetupes = [] for n in pkg.filelist + pkg.dirlist + pkg.ghostlist: filetupes.append((n, None, (None, None, None))) tups = pkg.provides + filetupes rpkgs, loc_reqs = self._tree_maybe_add_pkgs(all_reqs, tups, prov2pkgs) dot = kw['dot'] if dot is None: self._tree_print_req(pkg, req, level) lim = level + 1 else: dot.addPackage(pkg, rpkgs) lim = level + 2 nlevel = level + 1 if str(kw['tree_level']).lower() != 'all' and \ int(kw['tree_level']) < int(lim): return for rpkg in sorted(rpkgs): if pkg.verEQ(rpkg): # Remove deps. on self. continue if rpkgs[rpkg] is None: req = self._tree_pkg2val(loc_reqs, rpkg) if dot is None: self._tree_print_req(rpkg, req, nlevel) continue self.fmt_tree_what_requires(pkg=rpkg, level=nlevel, all_reqs=all_reqs, req=self._tree_pkg2val(loc_reqs, rpkg), tree_level = kw['tree_level'], output = kw['output'], dot = dot) class repoPkgQuery(pkgQuery): """ I wrap a query of a non-installed package available in the repository. """ def __init__(self, pkg, qf, yb=None): pkgQuery.__init__(self, pkg, qf, yb) self.classname = 'repo pkg' def prco(self, what, **kw): rpdict = {} for rptup in self.pkg.returnPrco(what): (rpn, rpf, (rp,rpv,rpr)) = rptup if rpn.startswith('rpmlib'): continue rpdict[misc.prco_tuple_to_string(rptup)] = None rplist = rpdict.keys() rplist.sort() return rplist def files(self, **kw): fdict = {} for ftype in self.pkg.returnFileTypes(): for fn in self.pkg.returnFileEntries(ftype): # workaround for yum returning double leading slashes on some # directories - posix allows that but it looks a bit odd fdict[os.path.normpath('//%s' % fn)] = None files = fdict.keys() files.sort() return files def fmt_changelog(self, **kw): changelog = [] for date, author, message in self.pkg.returnChangelog(): changelog.append("* %s %s\n%s\n" % (sec2day(date), to_unicode(author), to_unicode(message))) return "\n".join(changelog) class instPkgQuery(pkgQuery): """ I wrap a query of an installed package of type L{yum.packages.YumInstalledPackage} """ # hmm, thought there'd be more things in need of mapping to rpm names :) tagmap = { 'installedsize': 'size', } def __init__(self, pkg, qf, yb=None): pkgQuery.__init__(self, pkg, qf, yb) self.classname = 'installed pkg' def __getitem__(self, item): if item in self.tagmap: return self.pkg.tagByName(self.tagmap[item]) elif item.startswith('yumdb_info.'): yumdb_item = item.split('.')[1] try: return getattr(self.pkg.yumdb_info, yumdb_item) except AttributeError,e: raise queryError("Invalid yumdb querytag '%s' for %s: %s" % (yumdb_item, self.classname, self.pkg)) else: return pkgQuery.__getitem__(self, item) def prco(self, what, **kw): prcodict = {} # rpm names are without the trailing s :) what = what[:-1] names = self.pkg.tagByName('%sname' % what) flags = self.pkg.tagByName('%sflags' % what) ver = self.pkg.tagByName('%sversion' % what) if names is not None: for (n, f, v) in zip(names, flags, ver): req = formatRequire(n, v, f) # filter out rpmlib deps if n.startswith('rpmlib'): continue prcodict[req] = None prcolist = prcodict.keys() prcolist.sort() return prcolist def files(self, **kw): return self.pkg.tagByName('filenames') def fmt_changelog(self, **kw): changelog = [] times = self.pkg.tagByName('changelogtime') if times is not None: names = self.pkg.tagByName('changelogname') texts = self.pkg.tagByName('changelogtext') for date, author, message in zip(times, names, texts): author = to_unicode(author) message = to_unicode(message) changelog.append("* %s %s\n%s\n" % (sec2day(date), author, message)) return "\n".join(changelog) class groupQuery: def __init__(self, group, grouppkgs="required"): self.grouppkgs = grouppkgs self.id = group.groupid self.name = group.name self.group = group def doQuery(self, method, *args, **kw): if hasattr(self, "fmt_%s" % method): return "\n".join(getattr(self, "fmt_%s" % method)(*args, **kw)) else: raise queryError("Invalid group query: %s" % method) # XXX temporary hack to make --group -a query work def fmt_queryformat(self): return self.fmt_nevra() def fmt_nevra(self): return ["%s - %s" % (self.id, self.name)] def fmt_list(self): pkgs = [] for t in self.grouppkgs.split(','): if t == "mandatory": pkgs.extend(self.group.mandatory_packages) elif t == "default": pkgs.extend(self.group.default_packages) elif t == "optional": pkgs.extend(self.group.optional_packages) elif t == "all": pkgs.extend(self.group.packages) else: raise queryError("Unknown group package type %s" % t) return pkgs def fmt_requires(self): return self.group.mandatory_packages def fmt_info(self): return ["%s:\n\n%s\n" % (self.name, self.group.description)] class YumBaseQuery(yum.YumBase): def __init__(self, pkgops = [], sackops = [], options = None): """ @type pkgops: list of str @type sackops: list of str @type options: L{optparse.Values} """ yum.YumBase.__init__(self) self.logger = logging.getLogger("yum.verbose.repoquery") console_stderr = logging.StreamHandler(sys.stderr) console_stderr.setFormatter(logging.Formatter("%(message)s")) self.logger.propagate = False self.logger.addHandler(console_stderr) self.options = options self.pkgops = pkgops self.sackops = sackops self._sacks = [] if self.options.pkgnarrow in ('all', 'extras', 'installed'): self._sacks.append('rpmdb') if self.options.pkgnarrow not in ('extras', 'installed'): self._sacks.append('pkgSack') def queryPkgFactory(self, pkgs, plain_pkgs=False): """ For each given package, create a query. @type pkgs: list of L{yum.package.YumAvailablePackage} @rtype: list of L{queryPkg} """ qf = self.options.queryformat or std_qf["nevra"] qpkgs = [] for pkg in pkgs: if isinstance(pkg, yum.packages.YumInstalledPackage): if self.options.pkgnarrow not in ('all', 'installed', 'extras'): continue if plain_pkgs: qpkgs.append(pkg) continue if isinstance(pkg, yum.packages.YumInstalledPackage): qpkg = instPkgQuery(pkg, qf, self) else: qpkg = repoPkgQuery(pkg, qf, self) qpkgs.append(qpkg) return qpkgs def returnByName(self, name): """ Given a name, return a list of package queries matching the name. @type name: str @rtype: list of L{queryPkg} """ pkgs = [] try: pkgs = self.returnPkgList(patterns=[name]) except yum.Errors.PackageSackError, err: self.logger.error(err) return self.queryPkgFactory(pkgs) def returnPkgList(self, **kwargs): pkgs = [] if 'patterns' in kwargs: if len(kwargs['patterns']) == 1 and kwargs['patterns'][0] == '*': kwargs['patterns'] = None if self.options.pkgnarrow == "repos": # self.pkgSack is a yum.packageSack.MetaSack if self.conf.showdupesfromrepos: pkgs = self.pkgSack.returnPackages(**kwargs) else: try: pkgs = self.pkgSack.returnNewestByNameArch(**kwargs) except yum.Errors.PackageSackError: pkgs = [] else: what = self.options.pkgnarrow ygh = self.doPackageLists(what, **kwargs) if what == "all": pkgs = ygh.available + ygh.installed elif hasattr(ygh, what): pkgs = getattr(ygh, what) else: self.logger.error("Unknown pkgnarrow method: %s" % what) return pkgs def returnPackagesByDepStr(self, depstring): provider = [] try: # XXX rhbz#246519, for some reason returnPackagesByDep() fails # to find some root level directories while # searchPackageProvides() does... use that for now matches = yum.YumBase.searchPackageProvides(self, [str(depstring)]) provider = matches.keys() # provider.extend(yum.YumBase.returnPackagesByDep(self, depstring)) except yum.Errors.YumBaseError, err: self.logger.error("No package provides %s" % depstring) return self.queryPkgFactory(provider) def returnGroups(self): grps = [] for group in self.comps.get_groups(): grp = groupQuery(group, grouppkgs = self.options.grouppkgs) grps.append(grp) return grps def matchGroups(self, items): grps = [] for grp in self.returnGroups(): for expr in items: if grp.name == expr or fnmatch.fnmatch("%s" % grp.name, expr): grps.append(grp) elif grp.id == expr or fnmatch.fnmatch("%s" % grp.id, expr): grps.append(grp) return grps def matchPkgs(self, items, plain_pkgs=False): pkgs = self.returnPkgList(patterns=items) return self.queryPkgFactory(pkgs, plain_pkgs) def matchSrcPkgs(self, items): srpms = [] for name in items: for pkg in self.returnByName(name): if pkg.isSource(): continue src = pkg["sourcerpm"][:-4] srpms.extend(self.returnByName(src)) return srpms def yum_search(self, terms): """use yum's search generator to search arbitrary fields""" pkgs = [] fields = self.options.searchfields if not fields: fields = ['name', 'summary'] try: matching = self.searchGenerator(fields, terms, searchtags=False) for (po, matched_value) in matching: if isinstance(po, yum.packages.YumInstalledPackage): if self.options.pkgnarrow not in ('all', 'installed', 'extras'): continue if isinstance(po, yum.sqlitesack.YumAvailablePackageSqlite): if self.options.pkgnarrow not in ('all', 'available', 'repos'): continue pkgs.append(po) except (yum.Errors.RepoError,ValueError), e: raise queryError("Could not run search: %s" % e) return self.queryPkgFactory(pkgs) def _at_grps(self, items): # We want to move from @foo => lists of package names here, to make # a bunch of things easier. Ie. pkgs. ops. on lists of packages from # groups. nitems = [] for item in items: if item and item[0] == '@': for grp in self.matchGroups([item[1:]]): nitems.extend(grp.group.packages) # Give warning when no matches? continue nitems.append(item) return nitems def runQuery(self, items): plain_pkgs = False if self.options.group: pkgs = self.matchGroups(items) elif self.options.groupmember: pkglist = self.matchPkgs(items, plain_pkgs=True) for pkg in sorted(pkglist): print to_unicode(pkg) for group in sorted(self.find_groupmember(pkg.name)): print to_unicode(' @%s' % group) pkgs = [] elif self.options.search: plain_pkgs = False pkgs = [] try: pkgs = self.yum_search(items) except queryError, e: self.logger.error(e) else: items = self._at_grps(items) if self.options.srpm: pkgs = self.matchSrcPkgs(items) else: pkgs = [] if not self.sackops: plain_pkgs = True try: pkgs = self.matchPkgs(items, plain_pkgs=plain_pkgs) except yum.Errors.RepoError, e: raise queryError("Could not match packages: %s" % to_unicode(e)) for prco in items: for oper in self.sackops: try: for p in self.doQuery(oper, prco): if p: pkgs.append(p) except queryError, e: self.logger.error(e) if plain_pkgs: iq = None rq = None qf = self.options.queryformat or std_qf["nevra"] pkgs = sorted(pkgs) for pkg in pkgs: if plain_pkgs: if isinstance(pkg, yum.packages.YumInstalledPackage): if iq is None: iq = instPkgQuery(pkg, qf, self) iq.pkg = pkg iq.name = pkg.name pkg = iq else: if rq is None: rq = repoPkgQuery(pkg, qf, self) rq.pkg = pkg rq.name = pkg.name pkg = rq if not self.pkgops: print to_unicode(pkg) for oper in self.pkgops: try: out = pkg.doQuery(oper, tree_level = self.options.tree_level, output = self.options.output, dot = self.options.dot) if out: print to_unicode(out) except queryError, e: self.logger.error(e) def doQuery(self, method, *args, **kw): return getattr(self, "fmt_%s" % method)(*args, **kw) def find_groupmember(self, name, **kw): grps = [] for group in self.comps.get_groups(): if name in group.packages: grps.append(group.groupid) return grps def fmt_whatprovides(self, name, **kw): return self.returnPackagesByDepStr(name) def fmt_whatrequires(self, name, **kw): pkgs = {} done = [] # keep track of names we have already visited def require_recursive(name): if name in done: return done.append(name) provs = [name] if self.options.alldeps: for pkg in self.returnByName(name): provs.extend(pkg.prco("provides")) provs.extend(pkg.files()) for prov in provs: for sackstr in self._sacks: sack = getattr(self, sackstr) for pkg in sack.searchRequires(prov): pkgs[pkg.pkgtup] = pkg if self.options.recursive: require_recursive(pkg.name) if self.options.output not in ('ascii-tree','dot-tree'): require_recursive(name) return self.queryPkgFactory(sorted(pkgs.values())) def fmt_whatobsoletes(self, name, **kw): pkgs = [] for sackstr in self._sacks: sack = getattr(self, sackstr) for pkg in sack.searchObsoletes(name): pkgs.append(pkg) return self.queryPkgFactory(pkgs) def fmt_whatconflicts(self, name, **kw): pkgs = [] for sackstr in self._sacks: sack = getattr(self, sackstr) for pkg in sack.searchConflicts(name): pkgs.append(pkg) return self.queryPkgFactory(pkgs) def fmt_requires(self, name, **kw): pkgs = {} for pkg in self.returnByName(name): for req in pkg.prco("requires"): for res in self.fmt_whatprovides(req): pkgs[(res.name, res.pkg.arch)] = res return pkgs.values() def fmt_location(self, name): loc = [] for pkg in self.returnByName(name): repo = self.repos.getRepo(pkg['repoid']) if pkg['basepath']: loc.append("%s/%s" % (pkg['basepath'], pkg['relativepath'])) else: loc.append("%s/%s" % (repo.urls[0], pkg['relativepath'])) return loc def main(args): needother = 0 needgroup = 0 needsource = 0 signal.signal(signal.SIGPIPE, signal.SIG_DFL) signal.signal(signal.SIGINT, signal.SIG_DFL) parser = OptionParser(version = "Repoquery version %s" % version) # query options parser.add_option("-l", "--list", action="store_true", help="list files in this package/group") parser.add_option("-i", "--info", action="store_true", help="list descriptive info from this package/group") parser.add_option("-f", "--file", action="store_true", help="query which package provides this file") parser.add_option("--qf", "--queryformat", dest="queryformat", help="specify a custom output format for queries") parser.add_option("--groupmember", action="store_true", help="list which group(s) this package belongs to") # dummy for rpmq compatibility parser.add_option("-q", "--query", action="store_true", help="no-op for rpmquery compatibility") parser.add_option("-a", "--all", action="store_true", help="query all packages/groups") parser.add_option("-R", "--requires", action="store_true", help="list package dependencies") parser.add_option("--provides", action="store_true", help="list capabilities this package provides") parser.add_option("--obsoletes", action="store_true", help="list other packages obsoleted by this package") parser.add_option("--conflicts", action="store_true", help="list capabilities this package conflicts with") parser.add_option("--changelog", action="store_true", help="show changelog for this package") parser.add_option("--location", action="store_true", help="show download URL for this package") parser.add_option("--nevra", action="store_true", help="show name-epoch:version-release.architecture info of package") parser.add_option("--envra", action="store_true", help="show epoch:name-version-release.architecture info of package") parser.add_option("--nvr", action="store_true", help="show name, version, release info of package") parser.add_option("-s", "--source", action="store_true", help="show package source RPM name") parser.add_option("--srpm", action="store_true", help="operate on corresponding source RPM") parser.add_option("--resolve", action="store_true", help="resolve capabilities to originating package(s)") parser.add_option("--alldeps", action="store_true", default=True, help="check non-explicit dependencies (files and Provides:) as well, defaults to on") parser.add_option("--exactdeps", dest="alldeps", action="store_false", help="check dependencies exactly as given, opposite of --alldeps") parser.add_option("--recursive", action="store_true", help="recursively query for packages (for whatrequires)") parser.add_option("--whatprovides", action="store_true", help="query what package(s) provide a capability") parser.add_option("--whatrequires", action="store_true", help="query what package(s) require a capability") parser.add_option("--whatobsoletes", action="store_true", help="query what package(s) obsolete a capability") parser.add_option("--whatconflicts", action="store_true", help="query what package(s) conflicts with a capability") # group stuff parser.add_option("-g", "--group", default=0, action="store_true", help="query groups instead of packages") parser.add_option("--grouppkgs", default="default", help="filter which packages (all,optional etc) are shown from groups") # other opts parser.add_option("--archlist", help="only query packages of certain architecture(s)") parser.add_option("--releasever", default=None, help="set value of $releasever in yum config and repo files") parser.add_option("--pkgnarrow", default="repos", help="limit query to installed / available / recent / updates / extras / all (available + installed) / repository (default) packages") parser.add_option("--installed", action="store_true", default=False, help="limit query to installed pkgs only") parser.add_option("--show-duplicates", action="store_true", dest="show_dupes", help="show all versions of packages") parser.add_option("--show-dupes", action="store_true", help=SUPPRESS_HELP) parser.add_option("--repoid", action="append", help="specify repoids to query, can be specified multiple times (default is all enabled)") parser.add_option("--enablerepo", action="append", dest="enablerepos", help="specify additional repoids to query, can be specified multiple times") parser.add_option("--disablerepo", action="append", dest="disablerepos", help="specify repoids to disable, can be specified multiple times") parser.add_option("--repofrompath", action="append", help="specify repoid & paths of additional repositories - unique repoid and complete path required, can be specified multiple times. Example. --repofrompath=myrepo,/path/to/repo") parser.add_option("--plugins", action="store_true", default=False, help="enable yum plugin support") parser.add_option("--quiet", action="store_true", help="quiet output, only error output to stderr (default enabled)", default=True) parser.add_option("--verbose", action="store_false", help="verbose output (opposite of quiet)", dest="quiet") parser.add_option("-C", "--cache", action="store_true", help="run from cache only") parser.add_option("--tempcache", action="store_true", help="use private cache (default when used as non-root)") parser.add_option("--querytags", action="store_true", help="list available tags in queryformat queries") parser.add_option("-c", "--config", dest="conffile", help="config file location") parser.add_option("--tree-requires", action="store_true", dest="tree_requires", help=SUPPRESS_HELP) parser.add_option("--tree-conflicts", action="store_true", dest="tree_conflicts", help=SUPPRESS_HELP) parser.add_option("--tree-obsoletes", action="store_true", dest="tree_obsoletes", help=SUPPRESS_HELP) parser.add_option("--tree-whatrequires", action="store_true", dest="tree_what_requires", help=SUPPRESS_HELP) parser.add_option("--level", dest="tree_level", default="all", help="levels to display (can be any number or 'all', default to 'all')") parser.add_option("--output", dest="output", default="text", help="output format to use (can be text|ascii-tree|dot-tree, default to 'text')") parser.add_option("--search", action="store_true", dest="search", default=False, help="Use yum's search to return pkgs") parser.add_option("--search-fields", action="append", dest="searchfields", default=[], help="search fields to search using --search") (opts, regexs) = parser.parse_args() if opts.querytags: querytags.sort() for tag in querytags: print tag sys.exit(0) if len(regexs) < 1: if opts.all: regexs = ['*'] else: print parser.format_help() sys.exit(1) pkgops = [] sackops = [] archlist = None if opts.info: pkgops.append("info") if opts.requires: if opts.resolve: sackops.append("requires") else: pkgops.append("requires") if opts.provides: pkgops.append("provides") if opts.obsoletes: pkgops.append("obsoletes") if opts.conflicts: pkgops.append("conflicts") if opts.changelog: needother = 1 pkgops.append("changelog") if opts.list: pkgops.append("list") if opts.envra: pkgops.append("envra") if opts.nvr: pkgops.append("nvr") if opts.source: pkgops.append("source") if opts.tree_requires: opts.output = "ascii-tree" pkgops.append("tree_requires") if opts.tree_conflicts: opts.output = "ascii-tree" pkgops.append("tree_conflicts") if opts.tree_obsoletes: opts.output = "ascii-tree" pkgops.append("tree_obsoletes") if opts.tree_what_requires: opts.output = "ascii-tree" pkgops.append("tree_what_requires") if opts.output == "dot-tree": opts.dot = DotPlot() else: opts.dot = None if opts.srpm: needsource = 1 if opts.whatrequires: sackops.append("whatrequires") if opts.output != 'text': pkgops.append("tree_what_requires") if opts.whatprovides: sackops.append("whatprovides") if opts.whatobsoletes: sackops.append("whatobsoletes") if opts.whatconflicts: sackops.append("whatconflicts") if opts.file: sackops.append("whatprovides") if opts.location: pkgops.append("location") if opts.groupmember: needgroup = 1 if opts.group: needgroup = 1 if opts.installed: opts.pkgnarrow = 'installed' opts.disablerepos = ['*'] if opts.nevra: pkgops.append("nevra") elif len(pkgops) == 0 and len(sackops) == 0: pkgops.append("queryformat") for exp in regexs: if exp.endswith('.src'): needsource = 1 break if opts.archlist: archlist = opts.archlist.split(',') elif needsource: archlist = getArchList() archlist.append('src') if opts.searchfields: opts.search = True repoq = YumBaseQuery(pkgops, sackops, opts) # silence initialisation junk from modules etc unless verbose mode initnoise = (not opts.quiet) * 2 repoq.preconf.releasever = opts.releasever if archlist and not archlist[0] == 'src': repoq.preconf.arch = archlist[0] if opts.conffile is not None: repoq.preconf.fn = opts.conffile repoq.preconf.debuglevel = initnoise repoq.preconf.init_plugins = opts.plugins repoq.conf if opts.repofrompath: # setup the fake repos for repo in opts.repofrompath: tmp = tuple(repo.split(',')) if len(tmp) != 2: repoq.logger.error("Error: Bad repofrompath argument: %s" %repo) continue repoid,repopath = tmp if repopath[0] == '/': baseurl = 'file://' + repopath else: baseurl = repopath repoq.add_enable_repo(repoid, baseurls=[baseurl], basecachedir=repoq.conf.cachedir) if not opts.quiet: repoq.logger.info( "Added %s repo from %s" % (repoid,repopath)) # Show what is going on, if --quiet is not set. if not opts.quiet and sys.stdout.isatty(): yumout = output.YumOutput() freport = ( yumout.failureReport, (), {} ) if hasattr(repoq, 'prerepoconf'): repoq.prerepoconf.progressbar = TextMeter(fo=sys.stdout) repoq.prerepoconf.callback = output.CacheProgressCallback() repoq.prerepoconf.failure_callback = freport else: repoq.repos.setProgressBar(TextMeter(fo=sys.stdout)) repoq.repos.callback = output.CacheProgressCallback() repoq.repos.setFailureCallback(freport) if not repoq.setCacheDir(opts.tempcache): repoq.logger.error("Error: Could not make cachedir, exiting") sys.exit(50) if opts.cache: repoq.conf.cache = True if not opts.quiet: repoq.logger.info('Running from cache, results might be incomplete.') if opts.show_dupes: repoq.conf.showdupesfromrepos = True if opts.repoid: found_repos = set() for repo in repoq.repos.findRepos('*'): if repo.id not in opts.repoid: repo.disable() else: found_repos.add(repo.id) repo.enable() for not_found in set(opts.repoid).difference(found_repos): repoq.logger.error('Repoid %s was not found.' % not_found) if opts.disablerepos: for repo_match in opts.disablerepos: for repo in repoq.repos.findRepos(repo_match): repo.disable() if opts.enablerepos: for repo_match in opts.enablerepos: for repo in repoq.repos.findRepos(repo_match): repo.enable() try: if not hasattr(repoq, 'arch'): repoq.doSackSetup(archlist=archlist) elif archlist is not None: repoq.arch.archlist = archlist # Don't do needfiles, because yum will do it automatically and it's # not trivial to get it "right" so we don't download them when not # needed. if needother: repoq.repos.populateSack(mdtype='otherdata') if needgroup: repoq.doGroupSetup() except (yum.Errors.RepoError, yum.Errors.GroupsError), e: repoq.logger.error(e) sys.exit(1) try: repoq.runQuery(regexs) except queryError, e: repoq.logger.error(e) if __name__ == "__main__": misc.setup_locale() main(sys.argv) # vim:sw=4:sts=4:expandtab yum-utils-1.1.31/reposync.py000077500000000000000000000322551162052066300157740ustar00rootroot00000000000000#!/usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # copyright 2006 Duke University # author seth vidal # sync all or the newest packages from a repo to the local path # TODO: # have it print out list of changes # make it work with mirrorlists (silly, really) # man page/more useful docs # deal nicely with a package changing but not changing names (ie: replacement) # criteria # if a package is not the same and smaller then reget it # if a package is not the same and larger, delete it and get it again # always replace metadata files if they're not the same. import os import sys import shutil import stat from optparse import OptionParser from urlparse import urljoin import yum import yum.Errors from yum.misc import getCacheDir from yum.constants import * from yum.packageSack import ListPackageSack import rpmUtils.arch import logging from urlgrabber.progress import TextMeter import urlgrabber # for yum 2.4.X compat def sortPkgObj(pkg1 ,pkg2): """sorts a list of yum package objects by name""" if pkg1.name > pkg2.name: return 1 elif pkg1.name == pkg2.name: return 0 else: return -1 class RepoSync(yum.YumBase): def __init__(self, opts): yum.YumBase.__init__(self) self.logger = logging.getLogger('yum.verbose.reposync') self.opts = opts def localpkgs(directory): names = os.listdir(directory) cache = {} for name in names: fn = os.path.join(directory, name) try: st = os.lstat(fn) except os.error: continue if stat.S_ISDIR(st.st_mode): subcache = localpkgs(fn) for pkg in subcache.keys(): cache[pkg] = subcache[pkg] elif stat.S_ISREG(st.st_mode) and name.endswith(".rpm"): cache[name] = { 'path': fn, 'size': st.st_size, 'device': st.st_dev } return cache def parseArgs(): usage = """ Reposync is used to synchronize a remote yum repository to a local directory using yum to retrieve the packages. %s [options] """ % sys.argv[0] parser = OptionParser(usage=usage) parser.add_option("-c", "--config", default='/etc/yum.conf', help='config file to use (defaults to /etc/yum.conf)') parser.add_option("-a", "--arch", default=None, help='act as if running the specified arch (default: current arch, note: does not override $releasever)') parser.add_option("--source", default=False, dest="source", action="store_true", help='operate on source packages') parser.add_option("-r", "--repoid", default=[], action='append', help="specify repo ids to query, can be specified multiple times (default is all enabled)") parser.add_option("-e", "--cachedir", help="directory in which to store metadata") parser.add_option("-t", "--tempcache", default=False, action="store_true", help="Use a temp dir for storing/accessing yum-cache") parser.add_option("-d", "--delete", default=False, action="store_true", help="delete local packages no longer present in repository") parser.add_option("-p", "--download_path", dest='destdir', default=os.getcwd(), help="Path to download packages to: defaults to current dir") parser.add_option("--norepopath", dest='norepopath', default=False, action="store_true", help="Don't add the reponame to the download path. Can only be used when syncing a single repository (default is to add the reponame)") parser.add_option("-g", "--gpgcheck", default=False, action="store_true", help="Remove packages that fail GPG signature checking after downloading") parser.add_option("-u", "--urls", default=False, action="store_true", help="Just list urls of what would be downloaded, don't download") parser.add_option("-n", "--newest-only", dest='newest', default=False, action="store_true", help="Download only newest packages per-repo") parser.add_option("-q", "--quiet", default=False, action="store_true", help="Output as little as possible") parser.add_option("-l", "--plugins", default=False, action="store_true", help="enable yum plugin support") parser.add_option("-m", "--downloadcomps", default=False, action="store_true", help="also download comps.xml") parser.add_option("","--download-metadata", dest="downloadmd", default=False, action="store_true", help="download all the non-default metadata") (opts, args) = parser.parse_args() return (opts, args) def main(): (opts, junk) = parseArgs() if not os.path.exists(opts.destdir) and not opts.urls: try: os.makedirs(opts.destdir) except OSError, e: print >> sys.stderr, "Error: Cannot create destination dir %s" % opts.destdir sys.exit(1) if not os.access(opts.destdir, os.W_OK) and not opts.urls: print >> sys.stderr, "Error: Cannot write to destination dir %s" % opts.destdir sys.exit(1) my = RepoSync(opts=opts) my.doConfigSetup(fn=opts.config, init_plugins=opts.plugins) # Force unprivileged users to have a private temporary cachedir # if they've not given an explicit cachedir if os.getuid() != 0 and not opts.cachedir: opts.tempcache = True if opts.tempcache: cachedir = getCacheDir() if cachedir is None: print >> sys.stderr, "Error: Could not make cachedir, exiting" sys.exit(50) my.repos.setCacheDir(cachedir) elif opts.cachedir: my.repos.setCacheDir(opts.cachedir) if len(opts.repoid) > 0: myrepos = [] # find the ones we want for glob in opts.repoid: myrepos.extend(my.repos.findRepos(glob)) # disable them all for repo in my.repos.repos.values(): repo.disable() # enable the ones we like for repo in myrepos: repo.enable() # --norepopath can only be sensibly used with a single repository: if len(my.repos.listEnabled()) > 1 and opts.norepopath: print >> sys.stderr, "Error: Can't use --norepopath with multiple repositories" sys.exit(1) # Use progress bar display when downloading repo metadata # and package files if not opts.quiet: my.repos.setProgressBar(TextMeter(fo=sys.stdout)) my.doRpmDBSetup() my.doRepoSetup() try: arches = rpmUtils.arch.getArchList(opts.arch) if opts.source: arches += ['src'] my.doSackSetup(arches) except yum.Errors.RepoError, e: print >> sys.stderr, "Error setting up repositories: %s" % e # maybe this shouldn't be entirely fatal sys.exit(1) for repo in my.repos.listEnabled(): reposack = ListPackageSack(my.pkgSack.returnPackages(repoid=repo.id)) if opts.newest: download_list = reposack.returnNewestByNameArch() else: download_list = list(reposack) if opts.norepopath: local_repo_path = opts.destdir else: local_repo_path = opts.destdir + '/' + repo.id if opts.delete and os.path.exists(local_repo_path): current_pkgs = localpkgs(local_repo_path) download_set = {} for pkg in download_list: remote = pkg.returnSimple('relativepath') rpmname = os.path.basename(remote) download_set[rpmname] = 1 for pkg in current_pkgs: if pkg in download_set: continue if not opts.quiet: my.logger.info("Removing obsolete %s", pkg) os.unlink(current_pkgs[pkg]['path']) if opts.downloadcomps or opts.downloadmd: if not os.path.exists(local_repo_path): try: os.makedirs(local_repo_path) except IOError, e: my.logger.error("Could not make repo subdir: %s" % e) my.closeRpmDB() sys.exit(1) if opts.downloadcomps: wanted_types = ['group'] if opts.downloadmd: wanted_types = repo.repoXML.fileTypes() for ftype in repo.repoXML.fileTypes(): if ftype in ['primary', 'primary_db', 'filelists', 'filelists_db', 'other', 'other_db']: continue if ftype not in wanted_types: continue try: resultfile = repo.retrieveMD(ftype) basename = os.path.basename(resultfile) if ftype == 'group' and opts.downloadcomps: # for compat with how --downloadcomps saved the comps file always as comps.xml basename = 'comps.xml' shutil.copyfile(resultfile, "%s/%s" % (local_repo_path, basename)) except yum.Errors.RepoMDError,e : if not opts.quiet: my.logger.error("Unable to fetch metadata: %s" % e) remote_size = 0 local_size = 0 if not opts.urls: for pkg in download_list: remote = pkg.returnSimple('relativepath') local = local_repo_path + '/' + remote sz = int(pkg.returnSimple('packagesize')) if os.path.exists(local) and os.path.getsize(local) == sz: continue remote_size += sz if hasattr(urlgrabber.progress, 'text_meter_total_size'): urlgrabber.progress.text_meter_total_size(remote_size) download_list.sort(sortPkgObj) n = 0 for pkg in download_list: n = n + 1 repo = my.repos.getRepo(pkg.repoid) remote = pkg.returnSimple('relativepath') local = local_repo_path + '/' + remote localdir = os.path.dirname(local) if not os.path.exists(localdir): os.makedirs(localdir) sz = int(pkg.returnSimple('packagesize')) if os.path.exists(local) and os.path.getsize(local) == sz: if not opts.quiet: my.logger.error("[%s: %-5d of %-5d ] Skipping existing %s" % (repo.id, n, len(download_list), remote)) continue if opts.urls: baseurl = None if repo.urls[0][-1] != '/': baseurl = repo.urls[0] + '/' else: baseurl = repo.urls[0] url = urljoin(baseurl,remote) print '%s' % url continue # make sure the repo subdir is here before we go on. if not os.path.exists(local_repo_path): try: os.makedirs(local_repo_path) except IOError, e: my.logger.error("Could not make repo subdir: %s" % e) my.closeRpmDB() sys.exit(1) # Disable cache otherwise things won't download repo.cache = 0 if not opts.quiet: my.logger.info( '[%s: %-5d of %-5d ] Downloading %s' % (repo.id, n, len(download_list), remote)) pkg.localpath = local # Hack: to set the localpath we want. try: path = repo.getPackage(pkg) except yum.Errors.RepoError, e: my.logger.error("Could not retrieve package %s. Error was %s" % (pkg, str(e))) local_size += sz continue local_size += sz if hasattr(urlgrabber.progress, 'text_meter_total_size'): urlgrabber.progress.text_meter_total_size(remote_size, local_size) if opts.gpgcheck: result, error = my.sigCheckPkg(pkg) if result != 0: if result == 1: my.logger.warning('Removing %s, due to missing GPG key.' % os.path.basename(remote)) elif result == 2: my.logger.warning('Removing %s due to failed signature check.' % os.path.basename(remote)) else: my.logger.warning('Removing %s due to failed signature check: %s' % (os.path.basename(remote), error)) os.unlink(path) continue if not os.path.exists(local) or not os.path.samefile(path, local): shutil.copy2(path, local) my.closeRpmDB() if __name__ == "__main__": main() yum-utils-1.1.31/repotrack.py000077500000000000000000000210441162052066300161160ustar00rootroot00000000000000#!/usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # (c) 2005 seth vidal skvidal at phy.duke.edu # helps partially track a repo. Let's you download a package + all of its # deps from any set of repos. # use: so you can keep current on any given pkg + its deps from another # repo w/o enabling that repo in your yum configuration by default # also for making partial mirrors that traverse dependencies. import os import sys import shutil from optparse import OptionParser from urlparse import urljoin import logging import yum import yum.Errors import rpmUtils from yum.misc import getCacheDir from yum.constants import * from yum.packages import parsePackages from yum.packageSack import ListPackageSack # for yum 2.4.X compat def sortPkgObj(pkg1 ,pkg2): """sorts a list of yum package objects by name""" if pkg1.name > pkg2.name: return 1 elif pkg1.name == pkg2.name: return 0 else: return -1 class RepoTrack(yum.YumBase): def __init__(self, opts): yum.YumBase.__init__(self) self.logger = logging.getLogger("yum.verbose.repotrack") self.opts = opts def findDeps(self, po): """Return the dependencies for a given package, as well possible solutions for those dependencies. Returns the deps as a dict of: dict[reqs] = [list of satisfying pkgs]""" reqs = po.returnPrco('requires') reqs.sort() pkgresults = {} for req in reqs: (r,f,v) = req if r.startswith('rpmlib('): continue pkgresults[req] = list(self.whatProvides(r, f, v)) return pkgresults def more_to_check(unprocessed_pkgs): for pkg in unprocessed_pkgs.keys(): if unprocessed_pkgs[pkg] is not None: return True return False def parseArgs(): usage = """ Repotrack: keep current on any given pkg and its deps. It will download the package(s) you want to track and all of their dependencies %s [options] package1 [package2] [package..] """ % sys.argv[0] parser = OptionParser(usage=usage) parser.add_option("-c", "--config", default='/etc/yum.conf', help='config file to use (defaults to /etc/yum.conf)') parser.add_option("-a", "--arch", default=None, help='check as if running the specified arch (default: current arch)') parser.add_option("-r", "--repoid", default=[], action='append', help="specify repo ids to query, can be specified multiple times (default is all enabled)") parser.add_option("-t", "--tempcache", default=False, action="store_true", help="Use a temp dir for storing/accessing yum-cache") parser.add_option("-p", "--download_path", dest='destdir', default=os.getcwd(), help="Path to download packages to") parser.add_option("-u", "--urls", default=False, action="store_true", help="Just list urls of what would be downloaded, don't download") parser.add_option("-n", "--newest", default=True, action="store_false", help="Toggle downloading only the newest packages(defaults to newest-only)") parser.add_option("-q", "--quiet", default=False, action="store_true", help="Output as little as possible") (opts, args) = parser.parse_args() return (opts, args) def main(): # TODO/FIXME # gpg/sha checksum them (opts, user_pkg_list) = parseArgs() if len(user_pkg_list) == 0: print >> sys.stderr, "Error: no packages specified to parse" sys.exit(1) if not os.path.exists(opts.destdir) and not opts.urls: try: os.makedirs(opts.destdir) except OSError, e: print >> sys.stderr, "Error: Cannot create destination dir %s" % opts.destdir sys.exit(1) if not os.access(opts.destdir, os.W_OK) and not opts.urls: print >> sys.stderr, "Error: Cannot write to destination dir %s" % opts.destdir sys.exit(1) my = RepoTrack(opts=opts) my.doConfigSetup(fn=opts.config,init_plugins=False) # init yum, without plugins if opts.arch: archlist = [] archlist.extend(rpmUtils.arch.getArchList(opts.arch)) else: archlist = rpmUtils.arch.getArchList() # do the happy tmpdir thing if we're not root if os.geteuid() != 0 or opts.tempcache: cachedir = getCacheDir() if cachedir is None: print >> sys.stderr, "Error: Could not make cachedir, exiting" sys.exit(50) my.repos.setCacheDir(cachedir) if len(opts.repoid) > 0: myrepos = [] # find the ones we want for glob in opts.repoid: myrepos.extend(my.repos.findRepos(glob)) # disable them all for repo in my.repos.repos.values(): repo.disable() # enable the ones we like for repo in myrepos: repo.enable() my._getSacks(archlist=archlist, thisrepo=repo.id) my.doRepoSetup() my._getSacks(archlist=archlist) unprocessed_pkgs = {} final_pkgs = {} pkg_list = [] avail = my.pkgSack.returnPackages() for item in user_pkg_list: exactmatch, matched, unmatched = parsePackages(avail, [item]) pkg_list.extend(exactmatch) pkg_list.extend(matched) if opts.newest: this_sack = ListPackageSack() this_sack.addList(pkg_list) pkg_list = this_sack.returnNewestByNameArch() del this_sack if len(pkg_list) == 0: print >> sys.stderr, "Nothing found to download matching packages specified" sys.exit(1) for po in pkg_list: unprocessed_pkgs[po.pkgtup] = po while more_to_check(unprocessed_pkgs): for pkgtup in unprocessed_pkgs.keys(): if unprocessed_pkgs[pkgtup] is None: continue po = unprocessed_pkgs[pkgtup] final_pkgs[po.pkgtup] = po deps_dict = my.findDeps(po) unprocessed_pkgs[po.pkgtup] = None for req in deps_dict.keys(): pkg_list = deps_dict[req] if opts.newest: this_sack = ListPackageSack() this_sack.addList(pkg_list) pkg_list = this_sack.returnNewestByNameArch() del this_sack for res in pkg_list: if res is not None and res.pkgtup not in unprocessed_pkgs: unprocessed_pkgs[res.pkgtup] = res download_list = final_pkgs.values() if opts.newest: this_sack = ListPackageSack() this_sack.addList(download_list) download_list = this_sack.returnNewestByNameArch() download_list.sort(sortPkgObj) for pkg in download_list: repo = my.repos.getRepo(pkg.repoid) remote = pkg.returnSimple('relativepath') local = os.path.basename(remote) local = os.path.join(opts.destdir, local) if (os.path.exists(local) and os.path.getsize(local) == int(pkg.returnSimple('packagesize'))): if not opts.quiet: my.logger.info("%s already exists and appears to be complete" % local) continue if opts.urls: url = urljoin(repo.urls[0],remote) print '%s' % url continue # Disable cache otherwise things won't download repo.cache = 0 if not opts.quiet: my.logger.info('Downloading %s' % os.path.basename(remote)) pkg.localpath = local # Hack: to set the localpath to what we want. path = repo.getPackage(pkg) if not os.path.exists(local) or not os.path.samefile(path, local): shutil.copy2(path, local) if __name__ == "__main__": main() yum-utils-1.1.31/show-changed-rco.py000077500000000000000000000231321162052066300172540ustar00rootroot00000000000000#! /usr/bin/python -tt #!/usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. import yum import os from optparse import OptionParser from optparse import SUPPRESS_HELP version = "1.0.0" def _get_npkgs(self, args): pkgs = [] for arg in args: if (arg.endswith('.rpm') and (yum.misc.re_remote_url(arg) or os.path.exists(arg))): thispkg = yum.packages.YumUrlPackage(self, self.ts, arg) pkgs.append(thispkg) elif self.conf.showdupesfromrepos: pkgs.extend(self.pkgSack.returnPackages(patterns=[arg])) else: try: pkgs.extend(self.pkgSack.returnNewestByName(patterns=[arg])) except yum.Errors.PackageSackError: pass return pkgs def _get_opkgs(self, npkgs, old_packages): if old_packages: return _get_npkgs(self, old_packages) pkg_names = set((pkg.name for pkg in npkgs)) return self.rpmdb.searchNames(pkg_names) def _get_oreqs(pkg, reqs): oreqs = {} for req in reqs: (r,f,v) = req if r.startswith('rpmlib('): continue if r not in oreqs: oreqs[r] = set([req]) else: oreqs[r].add(req) return oreqs def _get_reqs(pkg, reqs, oreqs, self_prov_check=True): nreqs = set() creqs = set() for req in reqs: (r,f,v) = req if r.startswith('rpmlib('): continue if r in oreqs and req in oreqs[r]: continue if (r in pkg.provides_names or (r[0] == '/' and r in (pkg.filelist + pkg.dirlist + pkg.ghostlist))): if not f or pkg.checkPrco('provides', req): continue if r in oreqs: creqs.add(req) else: nreqs.add(req) return nreqs, creqs def _print_reqs(yb, pkg, reqs, used_repos): out_reqs = {} for req in reqs: (r,f,v) = req seen = {} out_reqs[req] = [] for pkg in sorted(yb.rpmdb.searchProvides(req)): key = (pkg.name, pkg.arch) if key in seen and not yb.conf.showdupesfromrepos: continue seen[key] = pkg out_reqs[req].append(pkg) used_repos.append(pkg.ui_from_repo) for pkg in sorted(yb.pkgSack.searchProvides(req)): key = (pkg.name, pkg.arch) if key in seen and not yb.conf.showdupesfromrepos: continue seen[key] = pkg out_reqs[req].append(pkg) used_repos.append(pkg.ui_from_repo) done = set() for req in sorted(out_reqs): if req in done: continue done.add(req) print " ", yum.misc.prco_tuple_to_string(req) for oreq in sorted(out_reqs): if oreq in done: continue if req == oreq: continue if out_reqs[oreq] == out_reqs[req]: print " ", yum.misc.prco_tuple_to_string(oreq) done.add(oreq) for pkg in out_reqs[req]: print " ", pkg, pkg.ui_from_repo def _print_sum(title, used_repos, ind=" ", end=' '): if not used_repos: return print title crepos = {} installed = 0 available = 0 for urepo in used_repos: if urepo not in crepos: crepos[urepo] = 0 crepos[urepo] += 1 if urepo[0] == '@': installed += 1 else: available += 1 if installed: print ind, "Installed:", installed for urepo in sorted(crepos): if urepo[0] != '@': continue print "%s%s" % (ind, " "), urepo + ":", crepos[urepo] if available: print ind, "Available:", available for urepo in sorted(crepos): if urepo[0] == '@': continue print "%s%s" % (ind, " "), urepo + ":", crepos[urepo] if end: print end def main(): parser = OptionParser(version = "Depcheck version %s" % version) parser.add_option("--releasever", default=None, help="set value of $releasever in yum config and repo files") parser.add_option("--show-duplicates", action="store_true", dest="show_dupes", help="show all versions of packages") parser.add_option("--show-dupes", action="store_true", help=SUPPRESS_HELP) parser.add_option("--repoid", action="append", help="specify repoids to query, can be specified multiple times (default is all enabled)") parser.add_option("--enablerepo", action="append", dest="enablerepos", help="specify additional repoids to query, can be specified multiple times") parser.add_option("--disablerepo", action="append", dest="disablerepos", help="specify repoids to disable, can be specified multiple times") parser.add_option("--repofrompath", action="append", help="specify repoid & paths of additional repositories - unique repoid and complete path required, can be specified multiple times. Example. --repofrompath=myrepo,/path/to/repo") parser.add_option("--old-packages", action="append", help="packages to use to compare against, instead of installed") parser.add_option("--ignore-arch", action="store_true", help="ignore arch when searching for old packages") parser.add_option("--skip-new", action="store_true", help="skip packages without a matching old package") parser.add_option("-C", "--cache", action="store_true", help="run from cache only") parser.add_option("-c", "--config", dest="conffile", default=None, help="config file location") (opts, args) = parser.parse_args() yb = yum.YumBase() yb.preconf.releasever = opts.releasever if opts.conffile is not None: yb.preconf.fn = opts.conffile if opts.cache: yb.conf.cache = 1 elif not yb.setCacheDir(): yb.conf.cache = 1 if opts.show_dupes: yb.conf.showdupesfromrepos = True if opts.repoid: found_repos = set() for repo in yb.repos.findRepos('*'): if repo.id not in opts.repoid: repo.disable() else: found_repos.add(repo.id) repo.enable() for not_found in set(opts.repoid).difference(found_repos): yb.logger.error('Repoid %s was not found.' % not_found) if opts.disablerepos: for repo_match in opts.disablerepos: for repo in yb.repos.findRepos(repo_match): repo.disable() if opts.enablerepos: for repo_match in opts.enablerepos: for repo in yb.repos.findRepos(repo_match): repo.enable() npkgs = _get_npkgs(yb, args) opkgs = {} for pkg in sorted(_get_opkgs(yb, npkgs, opts.old_packages)): opkgs[(pkg.name, pkg.arch)] = pkg opkgs[pkg.name] = pkg for pkg in sorted(npkgs): opkg = None oreqs = {} oobss = {} ocons = {} if opts.ignore_arch: if pkg.name in opkgs: opkg = opkgs[pkg.name] elif (pkg.name, pkg.arch) in opkgs: opkg = opkgs[(pkg.name, pkg.arch)] if opkg is None and opts.skip_new: continue print "New-Package:", pkg, pkg.ui_from_repo if opkg is not None: print "Old-Package:", opkg, opkg.ui_from_repo oreqs = _get_oreqs(pkg, opkg.requires) ocons = _get_oreqs(pkg, opkg.conflicts) oobss = _get_oreqs(pkg, opkg.obsoletes) used_repos_reqs = [] nreqs, creqs = _get_reqs(pkg, pkg.requires, oreqs) if nreqs: print "New-Requires:" _print_reqs(yb, pkg, nreqs, used_repos_reqs) if creqs: print "Modified-Requires:" _print_reqs(yb, pkg, creqs, used_repos_reqs) _print_sum("Dep-Requires-Repos:", used_repos_reqs) used_repos_cons = [] nreqs, creqs = _get_reqs(pkg, pkg.conflicts, ocons) if nreqs: print "New-Conflicts:" _print_reqs(yb, pkg, nreqs, used_repos_cons) if creqs: print "Mod-Conflicts:" _print_reqs(yb, pkg, creqs, used_repos_cons) _print_sum("Dep-Conflicts-Repos:", used_repos_cons) used_repos_obss = [] nreqs, creqs = _get_reqs(pkg, pkg.obsoletes, oobss) if nreqs: print "New-Obsoletes:" _print_reqs(yb, pkg, nreqs, used_repos_obss) if creqs: print "Mod-Obsoletes:" _print_reqs(yb, pkg, creqs, used_repos_obss) _print_sum("Dep-Obsoletes-Repos:", used_repos_obss) _print_sum("Dep-Repos:", used_repos_reqs + used_repos_cons + used_repos_obss, end='') if __name__ == "__main__": yum.misc.setup_locale() main() yum-utils-1.1.31/show-installed.py000077500000000000000000000402731162052066300170660ustar00rootroot00000000000000#!/usr/bin/python """ TODO: * repository descriptions in kickstart format for non default repos """ import yum from optparse import OptionParser import sys __stateprefixes = { None : '# ', "mandatory" : ".", "default" : "@", "all" : "*" } def state2str(o): if isinstance(o, Group): o = o.state return __stateprefixes[o] class Group: """Additional information about a comps group""" def __init__(self, compsgroup, yum, state=None): self.id = compsgroup.groupid self.state = None self.compsgroup = compsgroup self.yum = yum self.packages = {} for n in (None, "mandatory", "default", "all"): self.packages[n] = {} for s in ("add", "exclude", "exclude_missing", "optional"): self.packages[n][s] = set() @property def add(self): """Packages that this group adds to the install""" return self.packages[self.state]["add"] @property def exclude(self): """Packages excludes from this group to match the pkg list""" return self.packages[self.state]["exclude"] @property def excludeMissing(self): """Excludes that don't have a matching pgk in the repository""" return self.packages[self.state]["exclude_missing"] @property def optional(self): """Packages in this group that are not added in the current state""" return self.packages[self.state]["optional"] @property def addons(self): """Optional packages that are not added by the group in the given state but nevertheless need to be installed""" return self.packages[self.state]["addons"] def _buildSets(self, leafpkgs, allpkgs): # handle conditionals self.conditionals = set() for name, dep in self.compsgroup.conditional_packages.iteritems(): if dep in allpkgs: self.conditionals.add(name) pkgs = self.conditionals.copy() for name, additionalpkgs in ( ("mandatory", self.compsgroup.mandatory_packages), ("default", self.compsgroup.default_packages), ("all", self.compsgroup.optional_packages)): pkgs.update(additionalpkgs) self.__checkGroup(name, pkgs, leafpkgs, allpkgs) self.__checkGroup(None, set(), leafpkgs, allpkgs) for name, d in self.packages.iteritems(): d["others"] = pkgs - d["add"] - d["exclude"] d["addons"] = d["others"] & leafpkgs def __checkGroup(self, name, pkgs, leafpkgs, allpkgs): self.packages[name]["add"] = leafpkgs & pkgs self.packages[name]["exclude"] = pkgs - allpkgs self.packages[name]["exclude_missing"] = set( pkg for pkg in self.packages[name]["exclude"] if not self.yum.pkgSack.searchNames([pkg])) return def _autodetectState(self, allowexcludes, allowed=("default",), sharedpkgs=None): """Set state of the group according to the installed packages""" win = None state = self.state for name, d in self.packages.iteritems(): if name not in allowed and name is not None: continue if not allowexcludes and d["exclude"]: continue newshared = set() if sharedpkgs: for pkg in d["add"]: if pkg in sharedpkgs and len(sharedpkgs[pkg]) > 1: newshared.add(pkg) newwin = len(d["add"]) - len(d["exclude"]) - len(newshared) - 1 if win is None or newwin > win: state = name win = newwin if win <= 0: state = None # reflect changes in sharedpkgs if state != self.state and sharedpkgs is not None: for pkg in self.packages[self.state]["add"] - self.packages[state]["add"]: if pkg in sharedpkgs: sharedpkgs[pkg].discard(self) for pkg in self.packages[state]["add"] - self.packages[self.state]["add"]: sharedpkgs.setdefault(pkg, set()).add(self) self.state = state class InstalledPackages: """Collection of packages and theit interpretation as comps groups.""" def __init__(self, yumobj=None, input=None, pkgs=None, ignore_missing=False): """ @param yumobj(optional): use this instance of YumBase @param input(optional): read package names from this file @param pkgs(optional): use this iterable of package names @param ignore_missing: exlcude packages not found in the repos """ if yumobj is None: yumobj = yum.YumBase() yumobj.preconf.debuglevel = 0 yumobj.setCacheDir() self.yum = yumobj self.groups = [] self.pkg2group = {} self.input = input self.__buildList(pkgs, ignore_missing) def __addGroup(self, group): g = Group(group, self.yum) g._buildSets(self.leaves.copy(), self.allpkgs.copy()) self.groups.append(g) def __evrTupletoVer(self,tup): """convert an evr tuple to a version string, return None if nothing to convert""" e, v, r = tup if v is None: return None val = v if e is not None: val = '%s:%s' % (e, v) if r is not None: val = '%s-%s' % (val, r) return val def __getLeaves(self, pkgnames): pkgs = set() missing = set() for name in pkgnames: try: found = self.yum.pkgSack.returnNewestByName(name) pkgs.update(found) # XXX select proper arch! except yum.Errors.PackageSackError, e: missing.add(name) nonleaves = set() for pkg in pkgs: for (req, flags, (reqe, reqv, reqr)) in pkg.returnPrco('requires'): if req.startswith('rpmlib('): continue # ignore rpmlib deps ver = self.__evrTupletoVer((reqe, reqv, reqr)) try: resolve_sack = self.yum.whatProvides(req, flags, ver) except yum.Errors.RepoError, e: continue for p in resolve_sack: if p is pkg or p.name == pkg.name: continue nonleaves.add(p.name) return pkgnames - nonleaves, missing def __buildList(self, pkgs=None, ignore_missing=False): if pkgs: self.allpkgs = frozenset(pkgs) elif self.input is None: self.allpkgs = frozenset(pkg.name for pkg in self.yum.rpmdb.returnPackages()) else: pkgs = [] for line in self.input: pkgs.extend(line.split()) pkgs = map(str.strip, pkgs) pkgs = filter(None, pkgs) self.allpkgs = frozenset(pkgs) if self.input is None and not ignore_missing and not pkgs: self.leaves = frozenset((pkg.name for pkg in self.yum.rpmdb.returnLeafNodes())) else: leaves, missing = self.__getLeaves(self.allpkgs) if ignore_missing: self.leaves = leaves - missing self.allpkgs = self.allpkgs - missing else: self.leaves = leaves self.leafcount = len(self.leaves) # check if package exist in repository self.missingpkgs = set() for pkg in self.allpkgs: if self.yum.pkgSack.searchNames([pkg]): continue self.missingpkgs.add(pkg) for group in self.yum.comps.get_groups(): self.__addGroup(group) def autodetectStates(self, allowexcludes=False, allowed=("default",)): """Check with states (None, "mandatory", "default", "all") is the best for each of the groups. @param allowexcludes: use excludes for groups not installable as a whole @param allowed: list of states that are considered """ pkg2group = {} for g in self.groups: g._autodetectState(allowexcludes, allowed) # find out which pkgs are in more than one group for pkg in g.add: pkg2group.setdefault(pkg, set()).add(g) for g in self.groups: # filter out groups which are not worth it because some of # their packages belong to other groups # This is likely a NP complete problem, but this is a very # simple algorithm. Results may be below the optimum. g._autodetectState(allowexcludes, allowed, self.pkg2group) def globalExcludes(self): """return a list of all excludes""" excludes = set() for g in self.groups: excludes.update(g.exclude) return excludes def remainingPkgs(self, all=False): """Return a list of all packages not parts of groups or required by others @param all: return the addons of the groups, too """ remaining = set(self.leaves) for g in self.groups: remaining.difference_update(g.add) if not all: remaining.difference_update(g.addons) return remaining class ListPrinter: """Writes things out. Closely coupled to the optparse object created in the main function. """ def __init__(self, pkgs, options, output=None): self.pkgs = pkgs if output is None: output = sys.stdout self.output = output self.options = options self.__seen = set() def __printPkgs(self, pkgs, prefix='', separator='\n'): pkgs = pkgs - self.__seen self.__seen.update(pkgs) pkgs = list(pkgs) pkgs.sort() for name in pkgs: self.output.write("%s%s%s" % (prefix, name, separator)) return len(pkgs) def writeWarnings(self): e = sys.stderr if self.pkgs.missingpkgs: e.write("WARNING: The following packages are installed but not in the repository:\n") for pkg in self.pkgs.missingpkgs: e.write("\t%s\n" % pkg) e.write("\n") if True: first = True for g in self.pkgs.groups: if not g.excludeMissing: continue if first: e.write("WARNING: The following groups contain packages not found in the repositories:\n") first = False e.write("%s%s\n" % ("XXX ", g.id)) for pkg in g.excludeMissing: e.write("\t%s\n" % pkg) if not first: e.write("\n") def writeList(self): self.__seen.clear() if self.options.format == "human": indent = '\t' separator = '\n' elif self.options.format == "kickstart": indent = '' separator = '\n' elif self.options.format == "yum": indent = '' separator = ' ' else: raise ValueError("Unknown format") remaining = self.pkgs.remainingPkgs(True) lines = 0 groups = 0 for group in self.pkgs.groups: addons = group.addons & remaining if not group.state and not( addons and self.options.addons_by_group and not self.options.global_addons): continue lines += 1 if group.state: groups += 1 self.output.write("%s%s%s" % (state2str(group), group.id, separator)) # exclude lines after the group if not self.options.global_excludes: pkgs = group.exclude if self.options.ignore_missing_excludes: pkgs = pkgs - group.excludeMissing lines += self.__printPkgs(pkgs, indent+'-', separator) # packages after the group if not self.options.global_addons: lines += self.__printPkgs(addons, indent, separator) if self.options.format == "human": lines += 1 self.output.write("# Others\n") # leave filtering out pkgs bmeantioned above to __printPkgs lines += self.__printPkgs(remaining, '', separator) # exclude lines at the end excludes = self.pkgs.globalExcludes() if self.options.global_excludes: lines += self.__printPkgs(excludes, '-', separator) # Stats if self.options.format == "human": lines += 3 self.output.write("# %i package names, %i leaves\n# %i groups, %i leftovers, %i excludes\n# %i lines\n" % (len(self.pkgs.allpkgs), len(self.pkgs.leaves), groups, len(remaining), len(excludes), lines)) # **************************************************************************** def __main__(): parser = OptionParser(description="Gives a compact description of the packages installed (or given) making use of the comps groups found in the repositories.") parser.add_option("-f", "--format", dest="format", choices=('kickstart','human','yum'), default="human", help='yum, kickstart or human; yum gives the result as a yum command line; kickstart the content of a %packages section; "human" readable is default.') parser.add_option("-i", "--input", dest="input", action="store", default=None, help="File to read the package list from instead of using the rpmdb. - for stdin. The file must contain package names only separated by white space (including newlines). rpm -qa --qf='%{name}\\n' produces proper output.") parser.add_option("-o", "--output", dest="output", action="store", default=None, help="File to write the result to. Stdout is used if option is omited.") parser.add_option("-q", "--quiet", dest="quiet", action="store_true", help="Do not show warnings.") parser.add_option("-e", "--no-excludes", dest="excludes", action="store_false", default=True, help="Only show groups that are installed completely. Do not use exclude lines.") parser.add_option("--global-excludes", dest="global_excludes", action="store_true", help="Print exclude lines at the end and not after the groups requiring them.") parser.add_option("--global-addons", dest="global_addons", action="store_true", help="Print package names at the end and not after the groups offering them as addon.") parser.add_option('--addons-by-group', dest="addons_by_group", action="store_true", help='Also show groups not selected to sort packages contained by them. Those groups are commented out with a "# " at the begin of the line.') parser.add_option("-m", "--allow-mandatories", dest="allowed", action="append_const", const='mandatory', default=['default'], help='Check if just installing the mandatory packages gives better results. Uses "." to mark those groups.') parser.add_option("-a", "--allow-all", dest="allowed", action='append_const', const='all', help='Check if installing all packages in the groups gives better results. Uses "*" to mark those groups.') parser.add_option("--ignore-missing", dest="ignore_missing", action="store_true", help="Ignore packages missing in the repos.") parser.add_option("--ignore-missing-excludes", dest="ignore_missing_excludes", action="store_true", help="Do not produce exclude lines for packages not in the repository.") (options, args) = parser.parse_args() if options.format != "human" and len(options.allowed)>1: print '-m, --allow-mandatories, -a, --allow-all are only allowed in "human" (readable) format as yum and anaconda do not support installing all or only mandatory packages per group. Sorry.' sys.exit(-1) input_ = None if options.input and options.input=="-": input_ = sys.stdin elif options.input: try: input_ = open(options.input) except IOError, e: print e exit -1 else: input_ = None if options.output and options.output!='-': output = open(options.output, "w") else: output = sys.stdout i = InstalledPackages(input=input_, ignore_missing=options.ignore_missing) i.autodetectStates(options.excludes, options.allowed) p = ListPrinter(i, options, output=output) if not options.quiet: p.writeWarnings() p.writeList() if __name__ == "__main__": __main__() yum-utils-1.1.31/test/000077500000000000000000000000001162052066300145255ustar00rootroot00000000000000yum-utils-1.1.31/test/test-all000077500000000000000000000002651162052066300162030ustar00rootroot00000000000000#!/bin/sh test/test-yumdownloader test/test-repo-rss test/test-package-cleanup test/test-repoquery test/test-repoclosure test/test-reposync test/test-repotrack test/test-repo-graph yum-utils-1.1.31/test/test-package-cleanup000077500000000000000000000007021162052066300204470ustar00rootroot00000000000000#!/bin/sh # Test script to test package-cleanup echo "********************* Testing package-cleanup ***************************" echo "**** package-cleanup.py --problems" python package-cleanup.py --problems echo "*************************************************************************" echo "**** package-cleanup.py --leaves" python package-cleanup.py --leaves echo "*************************************************************************" yum-utils-1.1.31/test/test-repo-graph000077500000000000000000000003311162052066300174710ustar00rootroot00000000000000#!/bin/sh echo "********************* Testing repo-graph *******************************" echo "**** repograph" python repo-graph.py echo "*************************************************************************" yum-utils-1.1.31/test/test-repo-rss000077500000000000000000000003201162052066300171750ustar00rootroot00000000000000#!/bin/sh echo "********************* Testing repo-rss *******************************" rm repo-rss.xml python repo-rss.py echo "*************************************************************************" yum-utils-1.1.31/test/test-repoclosure000077500000000000000000000003431162052066300177720ustar00rootroot00000000000000#!/bin/sh echo "********************* Testing repoclosure *******************************" echo "**** repoclosure -n" python repoclosure.py -n echo "*************************************************************************" yum-utils-1.1.31/test/test-repoquery000077500000000000000000000010141162052066300174570ustar00rootroot00000000000000#!/bin/sh echo "********************* Testing repoquery *******************************" echo "**** repoquery -i yum" python repoquery.py -i yum echo "*************************************************************************" echo "**** repoquery -l yum" python repoquery.py -l yum echo "*************************************************************************" echo "**** repoquery -f /usr/bin/yum" python repoquery.py -f /usr/bin/yum echo "*************************************************************************" yum-utils-1.1.31/test/test-reposync000077500000000000000000000003531162052066300172730ustar00rootroot00000000000000#!/bin/sh echo "********************* Testing reposync *******************************" echo "**** repoclosure -n --urls" python reposync.py -n --urls echo "*************************************************************************" yum-utils-1.1.31/test/test-repotrack000077500000000000000000000003701162052066300174220ustar00rootroot00000000000000#!/bin/sh echo "********************* Testing repotrack *******************************" echo "**** repotrack --urls yum" rm yum*.rpm python repotrack.py --urls yum echo "*************************************************************************" yum-utils-1.1.31/test/test-yumdownloader000077500000000000000000000017031162052066300203220ustar00rootroot00000000000000#!/bin/sh # Test script to test yumdownloader echo "********************* Testing yumdownloader ***************************" echo "**** yumdownloader.py yum (basic package download in current dir" python yumdownloader.py yum echo "*************************************************************************" echo "**** yumdownloader.py yum --source (packag source download)" python yumdownloader.py yum --source echo "*************************************************************************" echo "**** yumdownloader.py yum --destdir(packag source download)" mkdir dnl-tst python yumdownloader.py yum --destdir=dnl-tst dir dnl-tst/yum* rm -rf dnl-tst echo "*************************************************************************" echo "**** yumdownloader.py --resolve --url kdetoys (testing --resolv and --url)" python yumdownloader.py --resolve --url kdetoys echo "*************************************************************************" rm yum*.rpm yum-utils-1.1.31/test/yum-utils-pylintrc000066400000000000000000000252431162052066300202700ustar00rootroot00000000000000# lint Python modules using external checkers. # # This is the main checker controling the other ones and the reports # generation. It is itself both a raw checker and an astng checker in order # to: # * handle message activation / deactivation at the module level # * handle some basic but necessary stats'data (number of classes, methods...) # [MASTER] # Specify a configuration file. #rcfile= # Python code to execute, usually for sys.path manipulation such as # pygtk.require(). #init-hook=="execfile('test/pylint-setup.py')" # Profiled execution. profile=no # Add to the black list. It should be a base name, not a # path. You may set this option multiple times. ignore=CVS # Pickle collected data for later comparisons. persistent=yes # Set the cache size for astng objects. cache-size=500 # List of plugins (as comma separated values of python modules names) to load, # usually to register additional checkers. load-plugins= [MESSAGES CONTROL] # Enable only checker(s) with the given id(s). This option conflicts with the # disable-checker option #enable-checker= # Enable all checker(s) except those with the given id(s). This option # conflicts with the enable-checker option #disable-checker= # Enable all messages in the listed categories. #enable-msg-cat= # Disable all messages in the listed categories. disable-msg-cat=C,R # Enable the message(s) with the given id(s). #enable-msg= # Disable the message(s) with the given id(s). # E1101: *%s %r has no %r member* (The init-hook for do sys.path manipulation don't, so we cant find the utils module) # F0401: *Unable to import %r (%s)* (See above) # W0704: *Except doesn't do anything* ( Except xxxxxx,e : pass is ok) # W0612: *Unused variable %r* ( dont care if x,y,z = f() and y,z is not used) # W0212: *Access to a protected member %s of a client class* (if sucks, but we do that a lot) # W0613: *Unused argument %r* # W0602: *Using global for %r but no assigment is done* # W0511: Used when a warning note as FIXME or XXX is detected # W0401: *Wildcard import %s* # W0614: *Unused import %s from wildcard import* # W0232: *Class has no __init__ method* # W0201: *Attribute %r defined outside __init__* # W0603: *Using the global statement* # W0621: *Redefining name %r from outer scope (line %s)* # W0142: *Used * or ** magic* # W0102: *Dangerous default value %s as argument* # W0105: *String statement has no effect* # W0702: *No exception type(s) specified* # W0231: *__init__ method from base class %r is not called* # E0202: *An attribute inherited from %s hide this method* # W0622: *Redefining built-in %r* # W0403: *Relative import %r* # W0223: *Method %r is abstract in class %r but is not overridden* # W0104: *Statement seems to have no effect* # W1001: *Use of "property" on an old style class* # W0221: *Arguments number differs from %s method* # W0703: *Catch "Exception"* # W1010: *Exception doesn't inherit from standard "Exception" class* (give false positives on ex. KeyboardInterrupt) # W0631: *Using possibly undefined loop variable %r* (Gives to many false positives) disable-msg=E1101,F0401,W0704,W0612,W0212,W0613,W0602,W0511,W0401,W0614,W0232,W0201,W0603,W0621,W0142,W0102,W0105,W0702,W0231,E0202,W0622,W0403,W0223,W0104,W1001,W0221,W0703,W0631 # In latest version of pylint the disable-* has been merged to disable= disable=C,R,E1101,F0401,W0704,W0612,W0212,W0613,W0602,W0511,W0401,W0614,W0232,W0201,W0603,W0621,W0142,W0102,W0105,W0702,W0231,E0202,W0622,W0403,W0223,W0104,W1001,W0221,W0703,W0631 [REPORTS] # set the output format. Available formats are text, parseable, colorized, msvs # (visual studio) and html output-format=text # Include message's id in output include-ids=yes # Put messages in a separate file for each module / package specified on the # command line instead of printing them on stdout. Reports (if any) will be # written in a file name "pylint_global.[txt|html]". files-output=no # Tells wether to display a full report or only the messages reports=yes # Python expression which should return a note less than 10 (10 is the highest # note).You have access to the variables errors warning, statement which # respectivly contain the number of errors / warnings messages and the total # number of statements analyzed. This is used by the global evaluation report # (R0004). evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) # Add a comment according to your evaluation note. This is used by the global # evaluation report (R0004). comment=no # Enable the report(s) with the given id(s). #enable-report= # Disable the report(s) with the given id(s). #disable-report= # checks for : # * doc strings # * modules / classes / functions / methods / arguments / variables name # * number of arguments, local variables, branchs, returns and statements in # functions, methods # * required module attributes # * dangerous default values as arguments # * redefinition of function / method / class # * uses of the global statement # [BASIC] # Required attributes for module, separated by a comma required-attributes= # Regular expression which should only match functions or classes name which do # not require a docstring no-docstring-rgx=__.*__ # Regular expression which should only match correct module names module-rgx=(([a-z_][a-z0-9_\-]*)|([A-Z][a-zA-Z0-9]+))$ # Regular expression which should only match correct module level names const-rgx=(([A-Z_a-z][A-Z1-9_a-z]*)|(__.*__))$ # Regular expression which should only match correct class names class-rgx=[A-Z_][a-zA-Z0-9]+$ # Regular expression which should only match correct function names function-rgx=[a-z_][a-z0-9_A-Z]{2,30}$ # Regular expression which should only match correct method names method-rgx=[a-z_][a-z0-9_A-Z]{2,30}$ # Regular expression which should only match correct instance attribute names attr-rgx=[a-z_][a-z0-9_A-Z]{2,30}$ # Regular expression which should only match correct argument names argument-rgx=[a-z_][a-z0-9_A-Z]{0,30}$ # Regular expression which should only match correct variable names variable-rgx=[a-z_][a-z0-9_A-Z]{0,30}$ # Regular expression which should only match correct list comprehension / # generator expression variable names inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ # Good variable names which should always be accepted, separated by a comma good-names=i,j,k,ex,Run,_,n,e,r,v,a,po,f,m,u,h,l # Bad variable names which should always be refused, separated by a comma bad-names=foo,bar,baz,toto,tutu,tata # List of builtins function names that should not be used, separated by a comma bad-functions=input # checks for # * unused variables / imports # * undefined variables # * redefinition of variable from builtins or from an outer scope # * use of variable before assigment # [VARIABLES] # Tells wether we should check for unused import in __init__ files. init-import=no # A regular expression matching names used for dummy variables (i.e. not used). dummy-variables-rgx=_|dummy # List of additional names supposed to be defined in builtins. Remember that # you should avoid to define new builtins when possible. additional-builtins= # try to find bugs in the code using type inference # [TYPECHECK] # Tells wether missing members accessed in mixin class should be ignored. A # mixin class is detected if its name ends with "mixin" (case insensitive). ignore-mixin-members=yes # List of classes names for which member attributes should not be checked # (useful for classes with attributes dynamicaly set). ignored-classes=SQLObject,NullTranslations # When zope mode is activated, consider the acquired-members option to ignore # access to some undefined attributes. zope=no # List of members which are usually get through zope's acquisition mecanism and # so shouldn't trigger E0201 when accessed (need zope=yes to be considered). acquired-members=REQUEST,acl_users,aq_parent # checks for # * external modules dependencies # * relative / wildcard imports # * cyclic imports # * uses of deprecated modules # [IMPORTS] # Deprecated modules which should not be used, separated by a comma deprecated-modules=regsub,TERMIOS,Bastion,rexec # Create a graph of every (i.e. internal and external) dependencies in the # given file (report R0402 must not be disabled) import-graph= # Create a graph of external dependencies in the given file (report R0402 must # not be disabled) ext-import-graph= # Create a graph of internal dependencies in the given file (report R0402 must # not be disabled) int-import-graph= # checks for : # * methods without self as first argument # * overridden methods signature # * access only to existant members via self # * attributes not defined in the __init__ method # * supported interfaces implementation # * unreachable code # [CLASSES] # List of interface methods to ignore, separated by a comma. This is used for # instance to not check methods defines in Zope's Interface base class. ignore-iface-methods=interrupt_callback # List of method names used to declare (i.e. assign) instance attributes. defining-attr-methods=__init__,__new__,setUp # checks for sign of poor/misdesign: # * number of methods, attributes, local variables... # * size, complexity of functions, methods # [DESIGN] # Maximum number of arguments for function / method max-args=5 # Maximum number of locals for function / method body max-locals=30 # Maximum number of return / yield for function / method body max-returns=10 # Maximum number of branch for function / method body max-branchs=25 # Maximum number of statements in function / method body max-statements=100 # Maximum number of parents for a class (see R0901). max-parents=7 # Maximum number of attributes for a class (see R0902). max-attributes=7 # Minimum number of public methods for a class (see R0903). min-public-methods=2 # Maximum number of public methods for a class (see R0904). max-public-methods=100 # checks for : # * unauthorized constructions # * strict indentation # * line length # * use of <> instead of != # [FORMAT] # Maximum number of characters on a single line. max-line-length=80 # Maximum number of lines in a module max-module-lines=1000 # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 # tab). indent-string=' ' # checks for similarities and duplicated code. This computation may be # memory / CPU intensive, so you should disable it if you experiments some # problems. # [SIMILARITIES] # Minimum lines number of a similarity. min-similarity-lines=4 # Ignore comments when computing similarities. ignore-comments=yes # Ignore docstrings when computing similarities. ignore-docstrings=yes # checks for: # * warning notes in the code like FIXME, XXX # * PEP 263: source code with non ascii character but no encoding declaration # [MISCELLANEOUS] # List of note tags to take in consideration, separated by a comma. notes=FIXME,XXX,TODO yum-utils-1.1.31/tools/000077500000000000000000000000001162052066300147065ustar00rootroot00000000000000yum-utils-1.1.31/tools/README000066400000000000000000000004671162052066300155750ustar00rootroot00000000000000The Tools directory contains tools to support the Makefile. The tools is not included in the tarball, they only exist in the repository TOOLS: git2cl ====== git2cl is a tool to create GNU Changelog from a git repository. Homepage: http://josefsson.org/git2cl/ git Repository: http://repo.or.cz/w/git2cl.gityum-utils-1.1.31/tools/git2cl000077500000000000000000000207001162052066300160170ustar00rootroot00000000000000#!/usr/bin/perl # Copyright (C) 2007 Simon Josefsson. # # The functions mywrap, last_line_len, wrap_log_entry are derived from # the cvs2cl tool, see : # Copyright (C) 2001,2002,2003,2004 Martyn J. Pearce # Copyright (C) 1999 Karl Fogel # # git2cl is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # git2cl is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with git2cl; see the file COPYING. If not, write to the Free # Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. use strict; use Date::Parse qw(strptime); use POSIX qw(strftime); use Text::Wrap qw(wrap); use constant EMPTY_LOG_MESSAGE => '*** empty log message ***'; sub mywrap { my ($indent1, $indent2, @text) = @_; # If incoming text looks preformatted, don't get clever my $text = Text::Wrap::wrap($indent1, $indent2, @text); if ( grep /^\s+/m, @text ) { return $text; } my @lines = split /\n/, $text; $indent2 =~ s!^((?: {8})+)!"\t" x (length($1)/8)!e; $lines[0] =~ s/^$indent1\s+/$indent1/; s/^$indent2\s+/$indent2/ for @lines[1..$#lines]; my $newtext = join "\n", @lines; $newtext .= "\n" if substr($text, -1) eq "\n"; return $newtext; } sub last_line_len { my $files_list = shift; my @lines = split (/\n/, $files_list); my $last_line = pop (@lines); return length ($last_line); } # A custom wrap function, sensitive to some common constructs used in # log entries. sub wrap_log_entry { my $text = shift; # The text to wrap. my $left_pad_str = shift; # String to pad with on the left. # These do NOT take left_pad_str into account: my $length_remaining = shift; # Amount left on current line. my $max_line_length = shift; # Amount left for a blank line. my $wrapped_text = ''; # The accumulating wrapped entry. my $user_indent = ''; # Inherited user_indent from prev line. my $first_time = 1; # First iteration of the loop? my $suppress_line_start_match = 0; # Set to disable line start checks. my @lines = split (/\n/, $text); while (@lines) # Don't use `foreach' here, it won't work. { my $this_line = shift (@lines); chomp $this_line; if ($this_line =~ /^(\s+)/) { $user_indent = $1; } else { $user_indent = ''; } # If it matches any of the line-start regexps, print a newline now... if ($suppress_line_start_match) { $suppress_line_start_match = 0; } elsif (($this_line =~ /^(\s*)\*\s+[a-zA-Z0-9]/) || ($this_line =~ /^(\s*)\* [a-zA-Z0-9_\.\/\+-]+/) || ($this_line =~ /^(\s*)\([a-zA-Z0-9_\.\/\+-]+(\)|,\s*)/) || ($this_line =~ /^(\s+)(\S+)/) || ($this_line =~ /^(\s*)- +/) || ($this_line =~ /^()\s*$/) || ($this_line =~ /^(\s*)\*\) +/) || ($this_line =~ /^(\s*)[a-zA-Z0-9](\)|\.|\:) +/)) { $length_remaining = $max_line_length - (length ($user_indent)); } # Now that any user_indent has been preserved, strip off leading # whitespace, so up-folding has no ugly side-effects. $this_line =~ s/^\s*//; # Accumulate the line, and adjust parameters for next line. my $this_len = length ($this_line); if ($this_len == 0) { # Blank lines should cancel any user_indent level. $user_indent = ''; $length_remaining = $max_line_length; } elsif ($this_len >= $length_remaining) # Line too long, try breaking it. { # Walk backwards from the end. At first acceptable spot, break # a new line. my $idx = $length_remaining - 1; if ($idx < 0) { $idx = 0 }; while ($idx > 0) { if (substr ($this_line, $idx, 1) =~ /\s/) { my $line_now = substr ($this_line, 0, $idx); my $next_line = substr ($this_line, $idx); $this_line = $line_now; # Clean whitespace off the end. chomp $this_line; # The current line is ready to be printed. $this_line .= "\n${left_pad_str}"; # Make sure the next line is allowed full room. $length_remaining = $max_line_length - (length ($user_indent)); # Strip next_line, but then preserve any user_indent. $next_line =~ s/^\s*//; # Sneak a peek at the user_indent of the upcoming line, so # $next_line (which will now precede it) can inherit that # indent level. Otherwise, use whatever user_indent level # we currently have, which might be none. my $next_next_line = shift (@lines); if ((defined ($next_next_line)) && ($next_next_line =~ /^(\s+)/)) { $next_line = $1 . $next_line if (defined ($1)); # $length_remaining = $max_line_length - (length ($1)); $next_next_line =~ s/^\s*//; } else { $next_line = $user_indent . $next_line; } if (defined ($next_next_line)) { unshift (@lines, $next_next_line); } unshift (@lines, $next_line); # Our new next line might, coincidentally, begin with one of # the line-start regexps, so we temporarily turn off # sensitivity to that until we're past the line. $suppress_line_start_match = 1; last; } else { $idx--; } } if ($idx == 0) { # We bottomed out because the line is longer than the # available space. But that could be because the space is # small, or because the line is longer than even the maximum # possible space. Handle both cases below. if ($length_remaining == ($max_line_length - (length ($user_indent)))) { # The line is simply too long -- there is no hope of ever # breaking it nicely, so just insert it verbatim, with # appropriate padding. $this_line = "\n${left_pad_str}${this_line}"; } else { # Can't break it here, but may be able to on the next round... unshift (@lines, $this_line); $length_remaining = $max_line_length - (length ($user_indent)); $this_line = "\n${left_pad_str}"; } } } else # $this_len < $length_remaining, so tack on what we can. { # Leave a note for the next iteration. $length_remaining = $length_remaining - $this_len; if ($this_line =~ /\.$/) { $this_line .= " "; $length_remaining -= 2; } else # not a sentence end { $this_line .= " "; $length_remaining -= 1; } } # Unconditionally indicate that loop has run at least once. $first_time = 0; $wrapped_text .= "${user_indent}${this_line}"; } # One last bit of padding. $wrapped_text .= "\n"; return $wrapped_text; } # main my @date; my $author; my @files; my $comment; my $merge; my $state; # 0-header 1-comment 2-files my $done = 0; $state = 0; while (<>) { #print STDERR "debug ($state, " . (@date ? (strftime "%Y-%m-%d", @date) : "") . "): `$_'\n"; if ($state == 0) { if (m,^Author: (.*),) { $author = $1; } if (m,^Date: (.*),) { @date = strptime($1); } if (m,^Merge: (.*),) { $merge = 1; } $state = 1 if (m,^$,); } elsif ($state == 1) { $state = 2 if (m,^$,); s/^ //g; s/\n/ /g; $comment = $comment . $_; } elsif ($state == 2 && $merge) { $done = 1; } elsif ($state == 2) { if (m,^([-0-9]+)\t([-0-9]+)\t(.*)$,) { push @files, $3; } elsif (m,^[^ ],) { # No file changes. $done = 1; } $done = 1 if (m,^$,); } if ($done && @date == ()) { print STDERR "warning: could not parse entry\n"; } elsif ($done) { print (strftime "%Y-%m-%d $author\n\n", @date); my $files = join (", ", @files); $files = mywrap ("\t", "\t", "* $files"), ": "; if (index($comment, EMPTY_LOG_MESSAGE) > -1 ) { $comment = "[no log message]\n"; } my $files_last_line_len = 0; $files_last_line_len = last_line_len($files) + 1; my $msg = wrap_log_entry($comment, "\t", 69-$files_last_line_len, 69); $msg =~ s/[ \t]+\n/\n/g; if ($merge) { print "\t$msg\n"; } else { print "$files: $msg\n"; } @date = (); $author = ""; @files = (); $comment = ""; $merge = 0; $state = 0; $done = 0; } } if (@files) { print (strftime "%Y-%m-%d $author\n\n", @date); my $msg = wrap_log_entry($comment, "\t", 69, 69); $msg =~ s/[ \t]+\n/\n/g; print "\t* $msg\n"; } yum-utils-1.1.31/updateonboot/000077500000000000000000000000001162052066300162515ustar00rootroot00000000000000yum-utils-1.1.31/updateonboot/Makefile000066400000000000000000000004041162052066300177070ustar00rootroot00000000000000INITD ?= /etc/rc.d/init.d install: mkdir -p $(DESTDIR)/etc/sysconfig mkdir -p $(DESTDIR)$(INITD) install -m 644 yum-updateonboot.sysconfig $(DESTDIR)/etc/sysconfig/yum-updateonboot install -m 755 yum-updateonboot.init $(DESTDIR)$(INITD)/yum-updateonboot yum-utils-1.1.31/updateonboot/README000066400000000000000000000024131162052066300171310ustar00rootroot00000000000000This script yum update on boot. This allows machines that have been turned off for an extended amount of time to become secure immediately, instead of waiting until the next early morning cron job. To install this, copy yum-updateonboot.init to /etc/init.d/yum-updateonboot and copy yum-updateonboot.sysconfig to /etc/sysconfig/yum-updateonboot After copying the files, run: /sbin/chkconfig --add yum-updateonboot There are a couple of configuration options in /etc/sysconfig/yum-updateonboot REBOOT_RPMS - any rpms listed in this variable will have their version and release numbers checked before and after the updates. If there is any change in those numbers, or in the number of installed packages with that name, the init script will immediately reboot the system. This is intended to catch kernel updates and immediately boot into the new kernel, instead of having to later schedule a downtime to do it. GROUPLIST - This is a list of groups that the init script will call 'yum groupupdate' on (its called after the 'yum update' and before the last check of rpm versions for REBOOT_RPMS). This way you will also install any updates to yum groups that you may have in your local repositories. yum-utils-1.1.31/updateonboot/yum-updateonboot.init000077500000000000000000000051411162052066300224550ustar00rootroot00000000000000#! /bin/bash # # yum-updateonboot Updates rpms on the system at boot # # chkconfig: - 30 70 # description: Runs 'yum update' at boot. Also calls 'yum groupinstall' for \ # specified groups # ### BEGIN INIT INFO # Provides: lsb-yum-updateonboot # Required-Start: $local_fs $network $remote_fs # Required-Stop: $local_fs $network $remote_fs # Should-Start: # Should-Stop: # Default-Start: # Default-Stop: # Short-Description: start the yum-updateonboot deamon # Description: Runs 'yum update' at boot. Also calls 'yum groupinstall' for \ # specified groups ### END INIT INFO # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Copyright 2005 Duke University # Written by Sean Dilda # Source function library. . /etc/init.d/functions if [ ! -f /etc/sysconfig/yum-updateonboot ]; then exit 0 fi . /etc/sysconfig/yum-updateonboot # be quiet by default [ -z "$OPTIONS" ] && OPTIONS="-q" # See how we were called. case "$1" in start) if [ "x$REBOOT_RPMS" != "x" ] ;then TMP1=`/bin/mktemp /tmp/yum-update.XXXXXX` TMP2=`/bin/mktemp /tmp/yum-update.XXXXXX` rpm -q $REBOOT_RPMS > $TMP1 fi echo -n "Updating RPMS on system: " yum -y update $OPTIONS && success || failure echo OLD_IFS=$IFS IFS=";" for group in $GROUPLIST ; do IFS=$OLD_IFS echo -n $"Updating RPMS in group $group: " yum -y groupupdate "$group" $OPTIONS && success || failure echo done IFS=$OLD_IFS if [ "x$REBOOT_RPMS" != "x" ] ;then rpm -q $REBOOT_RPMS > $TMP2 if ! diff $TMP1 $TMP2 &> /dev/null; then rm -f $TMP1 rm -f $TMP2 echo "Critical RPMs were updated.. rebooting now" /sbin/reboot fi rm -f $TMP1 rm -f $TMP2 fi ;; stop) ;; status) ;; restart|reload) cd "$CWD" $0 stop $0 start ;; usage) echo $"Usage: $0 {start|stop|restart|reload|status}" ;; *) echo $"Usage: $0 {start|stop|restart|reload|status}" exit 2 esac exit 0 yum-utils-1.1.31/updateonboot/yum-updateonboot.sysconfig000066400000000000000000000011511162052066300235100ustar00rootroot00000000000000# IF any of these rpms are updated, the yum-updateonboot init script will # reboot immediately after the yum update. To keep yum-updateonboot from # rebooting the system, comment this line out. #REBOOT_RPMS="kernel kernel-smp" # A list of groups that should be updated at boot. For each group mentioned # yum-updateonboot will call 'yum -y groupupdate' Since group names tend to # have spaces in them, used a semi-colon to separate the group names #GROUPLIST="My Group;MyOtherGroup;Some_Group;My Group 4" # Be quiet when updating by default # These options are passed to yum, default value is "-q" #OPTIONS="-q" yum-utils-1.1.31/verifytree.py000077500000000000000000000223071162052066300163130ustar00rootroot00000000000000#!/usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # copyright (c) 2008 Red Hat, Inc - written by Seth Vidal and Will Woods import yum import sys import os from yum.misc import getCacheDir, checksum import urlparse from yum import Errors from optparse import OptionParser import ConfigParser # Subclass ConfigParser so that the options don't get lowercased. This is # important given that they are path names. class LocalConfigParser(ConfigParser.ConfigParser): """A subclass of ConfigParser which does not lowercase options""" def optionxform(self, optionstr): return optionstr #### # take a file path to a repo as an option, verify all the metadata vs repomd.xml # optionally go through packages and verify them vs the checksum in the primary # Error values BAD_REPOMD = 1 BAD_METADATA = 2 BAD_COMPS = 4 BAD_PACKAGES = 8 BAD_IMAGES = 16 # Testopia case/plan numbers plan_number = 13 case_numbers = {'REPODATA': 56, 'CORE_PACKAGES': 57, 'COMPS': 58, 'BOOT_IMAGES': 59} # URL for the RELAX NG schema for comps SCHEMA = 'http://cvs.fedoraproject.org/viewcvs/*checkout*/comps/comps.rng' def testopia_create_run(plan): '''Create a run of the given test plan. Returns the run ID.''' run_id = 49 # STUB actually create the run print "Testopia: created run %i of plan %i" % (run_id,plan) return run_id def testopia_report(run,case,result): print " testopia: reporting %s for case %s in run %i" % (result, str(case),run) if type(case) == str: case = case_numbers[case] # STUB actually do the reporting def checkfileurl(pkg): pkg_path = pkg.remote_url pkg_path = pkg_path.replace('file://', '') (csum_type, csum) = pkg.returnIdSum() try: filesum = checksum(csum_type, pkg_path) except Errors.MiscError: return False if filesum != csum: return False return True def treeinfo_checksum(treeinfo): # read treeinfo file into cp # take checksums section result = 0 cp = LocalConfigParser() try: cp.read(treeinfo) except ConfigParser.MissingSectionHeaderError: # Generally this means we failed to access the file print " could not find sections in treeinfo file %s" % treeinfo return BAD_IMAGES except ConfigParser.Error: print " could not parse treeinfo file %s" % treeinfo return BAD_IMAGES if not cp.has_section('checksums'): print " no checksums section in treeinfo file %s" % treeinfo return BAD_IMAGES dir_path = os.path.dirname(treeinfo) for opt in cp.options('checksums'): fnpath = dir_path + '/%s' % opt fnpath = os.path.normpath(fnpath) csuminfo = cp.get('checksums', opt).split(':') if len(csuminfo) < 2: print " checksum information doesn't make any sense for %s." % opt result = BAD_IMAGES continue if not os.path.exists(fnpath): print " cannot find file %s listed in treeinfo" % fnpath result = BAD_IMAGES continue csum = checksum(csuminfo[0], fnpath) if csum != csuminfo[1]: print " file %s %s does not match:\n ondisk %s vs treeinfo: %s" % (opt, csuminfo[0], csum, csuminfo[1]) result = BAD_IMAGES continue return result def main(): parser = OptionParser() parser.usage = """ verifytree - verify that a local yum repository is consistent verifytree /path/to/repo""" parser.add_option("-a","--checkall",action="store_true",default=False, help="Check all packages in the repo") parser.add_option("-t","--testopia",action="store",type="int", help="Report results to the given testopia run number") parser.add_option("-r","--treeinfo", action="store_true", default=False, help="check the checksums of listed files in a .treeinfo file, if available") opts, args = parser.parse_args() if not args: print "Must provide a file url to the repo" sys.exit(1) # FIXME: check that "args" is a valid dir before proceeding # (exists, isdir, contains .treeinfo, etc) url = args[0] if url[0] == '/': url = 'file://' + url s = urlparse.urlsplit(url)[0] h,d = urlparse.urlsplit(url)[1:3] if s != 'file': print "Must be a file:// url or you will not like this" sys.exit(1) repoid = '%s/%s' % (h, d) repoid = repoid.replace('/', '_') # Bad things happen if we're missing a trailing slash here if url[-1] != '/': url += '/' basedir = url.replace('file://', '') # for a normal path thing my = yum.YumBase() my.conf.cachedir = getCacheDir() my.repos.disableRepo('*') newrepo = yum.yumRepo.YumRepository(repoid) newrepo.name = repoid newrepo.baseurl = [url] newrepo.basecachedir = my.conf.cachedir newrepo.metadata_expire = 0 newrepo.timestamp_check = False newrepo.enablegroups = 1 # we want *all* metadata newrepo.mdpolicy = 'group:all' # add our new repo my.repos.add(newrepo) # enable that repo my.repos.enableRepo(repoid) # setup the repo dirs/etc my.doRepoSetup(thisrepo=repoid) # Initialize results and reporting retval = 0 if opts.testopia: run_id = testopia_create_run(opts.testopia) report = lambda case,result: testopia_report(run_id,case,result) else: report = lambda case,result: None # Check the metadata print "Checking repodata:" try: md_types = newrepo.repoXML.fileTypes() print " verifying repomd.xml with yum" except yum.Errors.RepoError: print " failed to load repomd.xml." report('REPODATA','FAILED') report('CORE_PACKAGES','BLOCKED') report('COMPS','BLOCKED') return retval | BAD_REPOMD for md_type in md_types: try: print " verifying %s checksum" % md_type newrepo.retrieveMD(md_type) except Errors.RepoError, e: print " %s metadata missing or does not match checksum" % md_type retval = retval | BAD_METADATA if retval & BAD_METADATA: report('REPODATA','FAILED') else: report('REPODATA','PASSED') print "Checking groups (comps.xml):" try: print " verifying comps.xml with yum" b = my.comps.compscount except Errors.GroupsError, e: print ' comps file missing or unparseable' report('COMPS','FAILED') retval = retval | BAD_COMPS if not (retval & BAD_COMPS): print " verifying comps.xml grammar with xmllint" comps = newrepo.getGroups() r = os.system("xmllint --noout --nowarning --relaxng %s %s" % (SCHEMA,comps)) if r != 0: retval = retval | BAD_COMPS report('COMPS','FAILED') else: report('COMPS','PASSED') # if we've got a .treeinfo file and we are told to check it, then do so tr_path = basedir + '/.treeinfo' if opts.treeinfo and os.path.exists(tr_path): print "Checking checksums of files in .treeinfo" tr_val = treeinfo_checksum(tr_path) retval = tr_val | retval sack = [] packages_ok = True if opts.checkall: print "Checking all packages" sack = my.pkgSack elif not (retval & BAD_COMPS): print "Checking mandatory @core packages" group = my.comps.return_group('core') for pname in group.mandatory_packages: # FIXME: this pulls from pkgSack, which (I guess) is populated # based on the arch etc. of the current host.. so you can't check # the x86_64 repo from an i386 machine, f'rinstance. try: sack.extend(my.pkgSack.searchNevra(name=pname)) except yum.Errors.RepoError: print " something went wrong with the repodata." sack = [] break for pkg in sack: if checkfileurl(pkg): print " verifying %s checksum" % pkg else: print " verifying %s checksum FAILED" % pkg packages_ok = False if sack: if packages_ok is True: report('CORE_PACKAGES','PASSED') else: report('CORE_PACKAGES','FAILED') retval = retval | BAD_PACKAGES else: # we couldn't test anything report('CORE_PACKAGES','BLOCKED') # All done! if retval == 0: print "Tree verified." return retval if __name__ == "__main__": rc = main() sys.exit(rc) yum-utils-1.1.31/yum-NetworkManager-dispatcher000077500000000000000000000003341162052066300213540ustar00rootroot00000000000000#! /bin/bash # Really we should check the IP and see if it's the same, and if so # don't bother. etc. ... whatever. This should keep people happyish. [ "$2" != "up" ] && exit 0 yum clean expire-cache 2>&1 > /dev/null yum-utils-1.1.31/yum-builddep.py000077500000000000000000000207621162052066300165320ustar00rootroot00000000000000#!/usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. import sys sys.path.insert(0,'/usr/share/yum-cli') import yum from yum.misc import setup_locale import yum.Errors from utils import YumUtilBase import logging import rpmUtils import rpm # Copied from yumdownloader (need a yum-utils python module ;) # This is to fix Bug 469 # To convert from a pkg to a source pkg, we have a problem in that all we have # is "sourcerpm", which can be a different nevra ... but just to make it fun # the epoch isn't in the name. So we use rpmUtils.miscutils.splitFilename # and ignore the arch/epoch ... and hope we get the right thing. # Eg. run: # for pkg in yb.pkgSack.returnPackages(): # if pkg.version not in pkg.sourcerpm: # print pkg, pkg.sourcerpm def _best_convert_pkg2srcpkgs(self, opts, pkg): if pkg.arch == 'src': return [pkg] (n,v,r,e,a) = rpmUtils.miscutils.splitFilename(pkg.sourcerpm) src = self.pkgSack.searchNevra(name=n, ver=v, rel=r, arch='src') if src == []: self.logger.error('No source RPM found for %s' % str(pkg)) return src class YumBuildDep(YumUtilBase): NAME = 'yum-builddep' VERSION = '1.0' USAGE = 'yum-builddep [options] package1 [package2] [package..]' def __init__(self): YumUtilBase.__init__(self, YumBuildDep.NAME, YumBuildDep.VERSION, YumBuildDep.USAGE) self.logger = logging.getLogger("yum.verbose.cli.yumbuildep") # Add util commandline options to the yum-cli ones self.optparser = self.getOptionParser() self.main() def main(self): # Parse the commandline option and setup the basics. try: opts = self.doUtilConfigSetup() except yum.Errors.RepoError, e: self.logger.error("Cannot handle specific enablerepo/disablerepo options.") sys.exit(50) # turn of our local gpg checking for opening the srpm if it is turned # off for repos :) if (opts.nogpgcheck or not self.conf.localpkg_gpgcheck or not self.conf.gpgcheck): self.ts.pushVSFlags((rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS)) # Check if there is anything to do. if len(self.cmds) < 1: print self.optparser.format_help() sys.exit(0) if self.conf.uid != 0: self.logger.error("Error: You must be root to install packages") sys.exit(1) # Setup yum (Ts, RPM db, Repo & Sack) self.doUtilYumSetup() # Do the real action # solve for each srpm and put the pkgs into a ts try: self.get_build_deps(opts) except yum.Errors.MiscError, e: msg = "There was a problem getting the build deps, exiting:\n %s" % e self.logger.error(msg) sys.exit(1) if hasattr(self, 'doUtilBuildTransaction'): errc = self.doUtilBuildTransaction() if errc: sys.exit(errc) else: try: self.buildTransaction() except yum.Errors.YumBaseError, e: self.logger.critical("Error building transaction: %s" % e) sys.exit(1) if len(self.tsInfo) < 1: print 'No uninstalled build requires' sys.exit() sys.exit(self.doUtilTransaction()) def setupSourceRepos(self): # enable the -source repos for enabled primary repos archlist = rpmUtils.arch.getArchList() + ['src'] for repo in self.repos.listEnabled(): if not repo.id.endswith('-source'): srcrepo = '%s-source' % repo.id else: repo.close() self.repos.disableRepo(repo.id) srcrepo = repo.id for r in self.repos.findRepos(srcrepo): if r in self.repos.listEnabled(): continue self.logger.info('Enabling %s repository' % r.id) r.enable() # Setup the repo, without a cache r.setup(0) # Setup pkgSack with 'src' in the archlist try: self._getSacks(archlist=archlist,thisrepo=r.id) except yum.Errors.RepoError, e: print "Could not setup repo %s: %s" % (r.id, e) sys.exit(1) def install_deps(self, deplist): for dep in deplist: self.logger.debug(' REQ: %s' % dep) if dep.startswith("rpmlib("): continue instreq = self.returnInstalledPackagesByDep(dep) if instreq: self.logger.info(' --> Already installed : %s' % instreq[0]) continue try: pkg = self.returnPackageByDep(dep) self.logger.info(' --> %s' % pkg) self.install(pkg) except yum.Errors.YumBaseError, e: self.logger.error("Error: %s" % e) sys.exit(1) # go through each of the pkgs, figure out what they are/where they are # if they are not a local package then run # Setup source repos #self.setupSourceRepos() # get all of their deps # throw them into a ts # run the ts def get_build_deps(self,opts): srcnames = [] specnames = [] srpms = [] specworks = False # See if we can use spec files for buildrequires if hasattr(rpm, 'spec') and hasattr(rpm.spec, 'sourceHeader'): specworks = True for arg in self.cmds: if arg.endswith('.src.rpm'): try: srpms.append(yum.packages.YumLocalPackage(self.ts, arg)) except yum.Errors.MiscError, e: self.logger.error("Error: Could not open %s .\nTry" " running yum-builddep with the --nogpgcheck option." % arg) raise elif arg.endswith('.src'): srcnames.append(arg) elif specworks and arg.endswith('.spec'): specnames.append(arg) else: srcnames.append(arg) toActOn = [] if srcnames: self.setupSourceRepos() pkgs = self.pkgSack.returnPackages(patterns=srcnames) exact, match, unmatch = yum.packages.parsePackages(pkgs, srcnames, casematch=1) srpms += exact + match if len(unmatch): pkgs = self.rpmdb.returnPackages(patterns=unmatch) exact, match, unmatch = yum.packages.parsePackages(pkgs, unmatch, casematch=1) if len(unmatch): self.logger.error("No such package(s): %s" % ", ".join(unmatch)) sys.exit(1) toActOn = [] for newpkg in srpms: toActOn.extend(_best_convert_pkg2srcpkgs(self, opts, newpkg)) # Get the best matching srpm toActOn = self.bestPackagesFromList(toActOn, 'src') for srpm in toActOn: self.logger.info('Getting requirements for %s' % srpm) self.install_deps(srpm.requiresList()) for name in specnames: try: spec = rpm.spec(name) except ValueError: self.logger.error("Bad spec: %s" % name) continue buildreqs = [] for d in rpm.ds(spec.sourceHeader, 'requires'): buildreqs.append(d.DNEVR()[2:]) self.logger.info('Getting requirements for %s' % name) self.install_deps(buildreqs) if __name__ == '__main__': setup_locale() util = YumBuildDep() yum-utils-1.1.31/yum-complete-transaction.py000077500000000000000000000223101162052066300210640ustar00rootroot00000000000000#!/usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. import sys sys.path.insert(0,'/usr/share/yum-cli') import yum from yum.misc import setup_locale from utils import YumUtilBase import logging import os import os.path try: from yum.misc import find_unfinished_transactions, find_ts_remaining except ImportError: import glob def find_unfinished_transactions(yumlibpath='/var/lib/yum'): """returns a list of the timestamps from the filenames of the unfinished transactions remaining in the yumlibpath specified. """ timestamps = [] tsallg = '%s/%s' % (yumlibpath, 'transaction-all*') #tsdoneg = '%s/%s' % (yumlibpath, 'transaction-done*') # not used remove ? tsalls = glob.glob(tsallg) #tsdones = glob.glob(tsdoneg) # not used remove ? for fn in tsalls: trans = os.path.basename(fn) timestamp = trans.replace('transaction-all.','') timestamps.append(timestamp) timestamps.sort() return timestamps def find_ts_remaining(timestamp, yumlibpath='/var/lib/yum'): """this function takes the timestamp of the transaction to look at and the path to the yum lib dir (defaults to /var/lib/yum) returns a list of tuples(action, pkgspec) for the unfinished transaction elements. Returns an empty list if none. """ to_complete_items = [] tsallpath = '%s/%s.%s' % (yumlibpath, 'transaction-all', timestamp) tsdonepath = '%s/%s.%s' % (yumlibpath,'transaction-done', timestamp) tsdone_items = [] if not os.path.exists(tsallpath): # something is wrong, here, probably need to raise _something_ return to_complete_items if os.path.exists(tsdonepath): tsdone_fo = open(tsdonepath, 'r') tsdone_items = tsdone_fo.readlines() tsdone_fo.close() tsall_fo = open(tsallpath, 'r') tsall_items = tsall_fo.readlines() tsall_fo.close() for item in tsdone_items: # this probably shouldn't happen but it's worth catching anyway if item not in tsall_items: continue tsall_items.remove(item) for item in tsall_items: item = item.replace('\n', '') if item == '': continue (action, pkgspec) = item.split() to_complete_items.append((action, pkgspec)) return to_complete_items class YumCompleteTransaction(YumUtilBase): NAME = 'yum-complete-transactions' VERSION = '1.0' USAGE = """ yum-complete-transaction: completes unfinished yum transactions which occur due to error, failure or act of $deity usage: yum-complete-transaction """ def __init__(self): YumUtilBase.__init__(self, YumCompleteTransaction.NAME, YumCompleteTransaction.VERSION, YumCompleteTransaction.USAGE) self.logger = logging.getLogger("yum.verbose.cli.yumcompletets") # Add util commandline options to the yum-cli ones self.optparser = self.getOptionParser() if hasattr(self, 'getOptionGroup'): self.optparser_grp = self.getOptionGroup() else: self.optparser_grp = self.optparser self.addCmdOptions() self.main() def clean_up_ts_files(self, timestamp, path, disable=False): # clean up the transactions tsdone = '%s/transaction-done.%s' % (path, timestamp) tsall = '%s/transaction-all.%s' % (path, timestamp) results = [] for f in [tsall, tsdone]: if os.path.exists(f): if disable: disable_f = f + '.disabled' os.rename(f, disable_f) results.append(disable_f) else: os.unlink(f) return results def addCmdOptions(self): self.optparser_grp.add_option("--cleanup-only", default=False, action="store_true", dest="cleanup", help='Do not complete the transaction just clean up transaction journals') def main(self): # Parse the commandline option and setup the basics. try: opts = self.doUtilConfigSetup() except yum.Errors.RepoError, e: self.logger.error("Cannot handle specific enablerepo/disablerepo options.") sys.exit(50) if self.conf.uid != 0: self.logger.error("Error: You must be root to run yum-complete-transaction.") sys.exit(1) # Setup yum (Ts, RPM db, Repo & Sack) self.doUtilYumSetup() # Do the real action # get the list of transactions remaining # list the number of them # take the most recent one # populate the ts # run it self.run_with_package_names.add('yum-utils') times = [] for thistime in find_unfinished_transactions(self.conf.persistdir): if thistime.endswith('disabled'): continue # XXX maybe a check here for transactions that are just too old to try and complete? times.append(thistime) if not times: print "No unfinished transactions left." sys.exit() if opts.cleanup: print "Cleaning up unfinished transaction journals" # nuke ts files in yumlibpath for timestamp in times: print "Cleaning up %s" % timestamp self.clean_up_ts_files(timestamp, self.conf.persistdir) sys.exit() timestamp = times[-1] print "There are %d outstanding transactions to complete. Finishing the most recent one" % len(times) try: remaining = find_ts_remaining(timestamp, yumlibpath=self.conf.persistdir) except yum.Errors.MiscError, e: self.logger.error("Error: %s" % e) self.logger.error("Please report this error to: %s" % self.conf.bugtracker_url) sys.exit(1) print "The remaining transaction had %d elements left to run" % len(remaining) for (action, pkgspec) in remaining: if action == 'install': try: self.install(pattern=pkgspec) except yum.Errors.InstallError, e: pass if action == 'erase': (e, m, u) = self.rpmdb.matchPackageNames([pkgspec]) for pkg in e: self.remove(po=pkg) current_count = len(self.tsInfo) if hasattr(self, 'doUtilBuildTransaction'): errc = self.doUtilBuildTransaction(unfinished_transactions_check=False) if errc: sys.exit(errc) else: try: self.buildTransaction(unfinished_transactions_check=False) except yum.Errors.YumBaseError, e: self.logger.critical("Error building transaction: %s" % e) sys.exit(1) if current_count != len(self.tsInfo): print '\n\nTransaction size changed - this means we are not doing the\n' \ 'same transaction as we were before. Aborting and disabling\n' \ 'this transaction.' print '\nYou could try running: package-cleanup --problems\n' \ ' package-cleanup --dupes\n' \ ' rpm -Va --nofiles --nodigest' filelist = self.clean_up_ts_files(timestamp, self.conf.persistdir, disable=True) print '\nTransaction files renamed to:\n %s' % '\n '.join(filelist) sys.exit() if len(self.tsInfo) < 1: print 'Nothing in the unfinished transaction to cleanup.' print "Cleaning up completed transaction file" self.clean_up_ts_files(timestamp, self.conf.persistdir) sys.exit() else: try: if self.doUtilTransaction() == 0: print "Cleaning up completed transaction file" self.clean_up_ts_files(timestamp, self.conf.persistdir) sys.exit() else: print "Not removing old transaction files" sys.exit() except yum.Errors.YumBaseError,e: print "Error: %s" % str(e) sys.exit(1) if __name__ == '__main__': setup_locale() util = YumCompleteTransaction() yum-utils-1.1.31/yum-config-manager.py000077500000000000000000000175021162052066300176150ustar00rootroot00000000000000#!/usr/bin/python -tt import os, os.path import sys import re import yum sys.path.insert(0,'/usr/share/yum-cli') from utils import YumUtilBase import logging from iniparse import INIConfig from yum.parser import varReplace # Regular expressions to sanitise cache filenames re_url_scheme = re.compile(r'^\w+:/*(\w+:|www\.)?') re_slash = re.compile(r'[?/:&#|]+') re_initial_cruft = re.compile(r'^[,.]*') re_final_cruft = re.compile(r'[,.]*$') def sanitize_url_to_fs(url): """Return a filename suitable for the filesystem Strips dangerous and common characters to create a filename we can use to store the cache in. """ # code taken and modified from planet venus code base: # http://intertwingly.net/code/venus/LICENCE try: if re_url_scheme.match(url): if isinstance(url,str): url=url.decode('utf-8').encode('idna') else: url=url.encode('idna') except: pass if isinstance(url,unicode): url=url.encode('utf-8') url = re_url_scheme.sub("", url) url = re_slash.sub("_", url) url = re_initial_cruft.sub("", url) url = re_final_cruft.sub("", url) # limit length of url if len(url)>250: parts=url.split(',') for i in range(len(parts),0,-1): if len(','.join(parts[:i])) < 220: url = ','.join(parts[:i]) + ',' + \ yum.misc.checksum('md5', (','.join(parts[i:]))) break return url def writeRawConfigFile(filename, section_id, yumvar, cfgoptions, items, optionobj, only=None): """ From writeRawRepoFile, but so we can alter [main] too. """ ini = INIConfig(open(filename)) osection_id = section_id # b/c repoids can have $values in them we need to map both ways to figure # out which one is which if section_id not in ini._sections: for sect in ini._sections.keys(): if varReplace(sect, yumvar) == section_id: section_id = sect # Updated the ConfigParser with the changed values cfgOptions = cfgoptions(osection_id) for name,value in items(): if value is None: # Proxy continue if only is not None and name not in only: continue option = optionobj(name) ovalue = option.tostring(value) # If the value is the same, but just interpreted ... when we don't want # to keep the interpreted values. if (name in ini[section_id] and ovalue == varReplace(ini[section_id][name], yumvar)): ovalue = ini[section_id][name] if name not in cfgOptions and option.default == value: continue ini[section_id][name] = ovalue fp =file(filename, "w") fp.write(str(ini)) fp.close() NAME = 'yum-config-manager' VERSION = '1.0' USAGE = '"yum-config-manager [options] [section]' yum.misc.setup_locale() yb = YumUtilBase(NAME, VERSION, USAGE) logger = logging.getLogger("yum.verbose.cli.yum-config-manager") yb.preconf.debuglevel = 0 yb.preconf.errorlevel = 0 yb.optparser = yb.getOptionParser() if hasattr(yb, 'getOptionGroup'): # check if the group option API is available group = yb.getOptionGroup() else: group = yb.optparser group.add_option("--save", default=False, action="store_true", help='save the current options (useful with --setopt)') group.add_option("--enable", default=False, action="store_true", help='enable the specified repos (automatically saves)') group.add_option("--disable", default=False, action="store_true", help='disable the specified repos (automatically saves)') group.add_option("--add-repo", default=[], dest='addrepo', action='append', help='add (and enable) the repo from the specified file or url') try: opts = yb.doUtilConfigSetup() except yum.Errors.RepoError, e: logger.error(str(e)) sys.exit(50) if opts.save or opts.enable or opts.disable or opts.addrepo: if yb.conf.uid != 0: logger.error("You must be root to change the yum configuration.") sys.exit(50) args = set(yb.cmds) if opts.enable and opts.disable: logger.error("Error: Trying to enable and disable repos.") opts.enable = opts.disable = False if opts.enable and not args: logger.error("Error: Trying to enable already enabled repos.") opts.enable = False only = None if (not args and not opts.addrepo) or 'main' in args: print yb.fmtSection('main') print yb.conf.dump() if opts.save and hasattr(yb, 'main_setopts') and yb.main_setopts: fn = '/etc/yum/yum.conf' if not os.path.exists(fn): # Try the old default fn = '/etc/yum.conf' ybc = yb.conf writeRawConfigFile(fn, 'main', ybc.yumvar, ybc.cfg.options, ybc.iteritems, ybc.optionobj, only) if opts.enable or opts.disable: opts.save = True if not hasattr(yb, 'repo_setopts') or not yb.repo_setopts: only = ['enabled'] if args: repos = yb.repos.findRepos(','.join(args)) else: repos = yb.repos.listEnabled() if not opts.addrepo: for repo in sorted(repos): print yb.fmtSection('repo: ' + repo.id) if opts.enable and not repo.enabled: repo.enable() elif opts.disable and repo.enabled: repo.disable() print repo.dump() if (opts.save and (only or (hasattr(yb, 'repo_setopts') and repo.id in yb.repo_setopts))): writeRawConfigFile(repo.repofile, repo.id, repo.yumvar, repo.cfg.options, repo.iteritems, repo.optionobj, only) if opts.addrepo: # figure out the best reposdir by seeing which dirs exist myrepodir = None for rdir in yb.conf.reposdir: if os.path.exists(rdir): # take the first one that exists myrepodir = rdir break if not myrepodir: myrepodir = yb.conf.reposdir[0] os.makedirs(myrepodir) for url in opts.addrepo: print 'adding repo from: %s' % url if url.endswith('.repo'): # this is a .repo file - fetch it, put it in our reposdir and enable it destname = os.path.basename(url) destname = myrepodir + '/' + destname # this sucks - but take the first repo we come to that's enabled # and steal it's grabber object - it could be proxy-laden but that's the risk we take # grumbledy grumble grabber = yb.repos.listEnabled()[0].grabfunc print 'grabbing file %s to %s' % (url, destname) try: result = grabber.urlgrab(url, filename=destname, copy_local=True) except (IOError, OSError, yum.Errors.YumBaseError), e: logger.error('Could not fetch/save url %s to file %s: %s' % (url, destname, e)) continue else: print 'repo saved to %s' % result else: repoid = sanitize_url_to_fs(url) reponame = 'added from: %s' % url repofile = myrepodir + '/' + repoid + '.repo' try: thisrepo = yb.add_enable_repo(repoid, baseurl=[url], name=reponame) except yum.Errors.DuplicateRepoError, e: logger.error('Cannot add repo from %s as is a duplicate of an existing repo' % url) continue repoout = """\n[%s]\nname=%s\nbaseurl=%s\nenabled=1\n\n""" % (repoid, reponame, url) try: fo = open(repofile, 'w+') fo.write(repoout) print repoout except (IOError, OSError), e: logger.error('Could not save repo to repofile %s: %s' % (repofile, e)) continue else: fo.close() yum-utils-1.1.31/yum-debug-dump.py000077500000000000000000000166761162052066300170040ustar00rootroot00000000000000#!/usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ## (c) 2008 Red Hat. Written by skvidal@fedoraproject.org import os import subprocess import sys import time import yum from yum import Errors from yum.misc import getCacheDir from rpmUtils import miscutils import gzip import rpm from optparse import OptionParser # maybe use YumQuiet? class YumDebugDump(yum.YumBase): def __init__(self): self.file_version = '1' yum.YumBase.__init__(self) self.opts = None self.args = None self.parse_args() def parse_args(self): parser = OptionParser() parser.set_usage("yum-debug-dump [options] [filename]") parser.add_option("--norepos", action="store_true", default=False, help="do not attempt to dump the repository contents") self.opts, self.args = parser.parse_args() def dump_rpmdb(self): msg = "%%%%RPMDB\n" for po in sorted(self.rpmdb): msg += ' %s:%s-%s-%s.%s\n' % (po.epoch, po.name, po.ver,po.rel, po.arch) return msg def dump_rpmdb_versions(self): msg = "%%%%RPMDB VERSIONS\n" # This should be the same as the default [yum] group in version-groups yumcore = set(['yum', 'rpm', 'yum-metadata-parser']) yumplus = set(['glibc', 'sqlite', 'libcurl', 'nss', 'rpm', 'rpm-libs', 'rpm-python', 'python', 'python-iniparse', 'python-urlgrabber', 'python-pycurl']) yumplus.update(yumcore) groups = {'yum-core' : yumcore, 'yum' : yumplus} data = self.rpmdb.simpleVersion(False, groups=groups) msg += ' all: %s\n' % (data[0],) for grp in sorted(data[2]): msg += ' %s: %s\n' % (grp, data[2][grp]) return msg def dump_repos(self): msg = "%%%%REPOS\n" for repo in sorted(self.repos.listEnabled()): try: msg += '%%%s - %s\n' % (repo.id, repo.urls[0]) msg += " excludes: %s\n" % ",".join(repo.exclude) for po in sorted(self.pkgSack.returnPackages(repo.id)): msg += ' %s:%s-%s-%s.%s\n' % (po.epoch, po.name, po.ver,po.rel, po.arch) except Errors.RepoError, e: msg += "Error accessing repo %s: %s\n" % (repo, str(e)) continue return msg def dump_system_info(self): msg = "%%%%SYSTEM INFO\n" msg += " uname: %s, %s\n" % (os.uname()[2], os.uname()[4]) msg += " rpm ver: %s\n" % subprocess.Popen(["rpm", "--version"], stdout=subprocess.PIPE).communicate()[0].strip() msg += " python ver: %s\n" % sys.version.replace('\n', '') return msg # remove pylint false positive # Instance of 'DummyYumPlugins' has no '_plugins' member (but some types could not be inferred) # pylint: disable-msg=E1103 def dump_yum_config_info(self): msg = "%%%%YUM INFO\n" msg += " arch: %s\n" % self.conf.yumvar['arch'] msg += " basearch: %s\n" % self.conf.yumvar['basearch'] msg += " releasever: %s\n" % self.conf.yumvar['releasever'] msg += " yum ver: %s\n" % yum.__version__ msg += " enabled plugins: %s\n" % ",".join(self.plugins._plugins.keys()) msg += " global excludes: %s\n" % ",".join(self.conf.exclude) return msg # pylint: enable-msg=E1103 # FIXME: This should use rpmdb.check_*() def dump_rpm_problems(self): pkgs = {} for po in self.rpmdb.returnPackages(): tup = po.pkgtup header = po.hdr requires = zip( header[rpm.RPMTAG_REQUIRENAME], header[rpm.RPMTAG_REQUIREFLAGS], header[rpm.RPMTAG_REQUIREVERSION], ) pkgs[tup] = requires errors = [] providers = {} # To speed depsolving, don't recheck deps that have # already been checked provsomething = {} for (pkg,reqs) in sorted(pkgs.items()): for (req,flags,ver) in reqs: if ver == '': ver = None rflags = flags & 15 if req.startswith('rpmlib'): continue # ignore rpmlib deps if (req,rflags,ver) not in providers: resolve_sack = self.rpmdb.whatProvides(req,rflags,ver) else: resolve_sack = providers[(req,rflags,ver)] if len(resolve_sack) < 1: errors.append("Package %s requires %s" % (pkg[0], miscutils.formatRequire(req,ver,rflags))) else: for rpkg in resolve_sack: # Skip packages that provide something for themselves # as these can still be leaves if rpkg != pkg: provsomething[rpkg] = 1 # Store the resolve_sack so that we can re-use it if another # package has the same requirement providers[(req,rflags,ver)] = resolve_sack msg = "%%%%RPMDB PROBLEMS\n" for error in errors: msg += "%s\n" % error # possibly list all verify failures, too return msg def create_debug_file(self, fn=None): """create debug txt file and compress it, place it at yum_debug_dump.txt.gz unless fn is specified""" if not fn: now = time.strftime("%Y-%m-%d_%T", time.localtime(time.time())) fn = 'yum_debug_dump-%s-%s.txt.gz' % (os.uname()[1], now) if not fn.startswith('/'): fn = '%s/%s' % (os.getcwd(), fn) if fn.endswith('.gz'): fo = gzip.GzipFile(fn, 'w') else: fo = open(fn, 'w') msg = "yum-debug-dump version %s\n" % self.file_version fo.write(msg) fo.write(self.dump_system_info()) fo.write(self.dump_yum_config_info()) fo.write(self.dump_rpm_problems()) fo.write(self.dump_rpmdb()) if not self.opts.norepos: fo.write(self.dump_repos()) fo.write(self.dump_rpmdb_versions()) fo.close() return fn def main(): my = YumDebugDump() # make yum-debug-dump work as non root user. if my.conf.uid != 0: cachedir = getCacheDir() if cachedir is None: my.logger.error("Error: Could not make cachedir, exiting") sys.exit(50) my.repos.setCacheDir(cachedir) # Turn off cache my.conf.cache = 0 # make sure the repos know about it, too my.repos.setCache(0) filename = None if my.args: filename = my.args[0] fn = my.create_debug_file(fn=filename) print "Output written to: %s" % fn if __name__ == "__main__": main() yum-utils-1.1.31/yum-debug-restore.py000077500000000000000000000165441162052066300175140ustar00rootroot00000000000000#!/usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ## (c) 2008 Red Hat. Written by skvidal@fedoraproject.org ## james@fedoraproject.org import os import sys import gzip import tempfile from optparse import OptionParser import yum import rpmUtils.miscutils sections = ['%%%%SYSTEM INFO\n', '%%%%YUM INFO\n', '%%%%RPMDB PROBLEMS\n', '%%%%RPMDB\n', '%%%%REPOS\n'] def cmd_line(): parser = OptionParser() parser.set_usage("yum-debug-restore [options]") parser.add_option("-C", "--cache", action="store_true", help="run from cache only") parser.add_option("-c", dest="conffile", help="config file location") parser.add_option("--enablerepo", action="append", dest="enablerepos", help="specify additional repoids to query, can be specified multiple times") parser.add_option("--disablerepo", action="append", dest="disablerepos", help="specify repoids to disable, can be specified multiple times") parser.add_option("-y", dest="assumeyes", action="store_true", help="answer yes for all questions") parser.add_option("--skip-broken", action="store_true", help="skip packages with depsolving problems") parser.add_option("--output", action="store_true", help="output the yum shell commands") parser.add_option("--shell", help="output the yum shell commands to a file") parser.add_option("--install-latest", action="store_true", help="install the latest instead of specific versions") parser.add_option("--ignore-arch", action="store_true", help="ignore arch of packages, so you can dump on .i386 and restore on .x86_64") parser.add_option("--filter-types", help="Limit to: install, remove, update, downgrade") (opts, args) = parser.parse_args() if not args: parser.print_usage() sys.exit(1) return (opts, args) class OtherRpmDB: def __init__(self, fn): self.pkgtups = [] if fn.endswith(".gz"): fo = gzip.GzipFile(fn) else: fo = open(fn) if fo.readline() != 'yum-debug-dump version 1\n': print >>sys.stderr, "Bad yum debug file:", fn sys.exit(1) skip = sections[:-1] for line in fo: if skip: # Header stuff if line == skip[0]: skip.pop(0) continue if not line or line[0] != ' ': break pkgtup = rpmUtils.miscutils.splitFilename(line.strip()) n,v,r,e,a = pkgtup # grrr... pkgtup = (n,a,e,v,r) self.pkgtups.append(pkgtup) def naevr2str(n,a,e,v,r): if a is None: # Assume epoch doesn't change without release changing return "%s-%s-%s" % (n,v,r) if e in (None, '', '0'): return "%s-%s-%s.%s" % (n,v,r,a) return "%s-%s:%s-%s.%s" % (n,e,v,r,a) def pkgtup2str(pkgtup): n,a,e,v,r = pkgtup return naevr2str(n,a,e,v,r) def pkg_data2list(yb, opkgtups, opkgmaps, install_latest, ignore_arch): ret = [] npkgtups = set() npkgmaps = {} for po in sorted(yb.rpmdb.returnPackages()): arch = po.arch if ignore_arch: arch = None if False: pass elif (po.name, arch) not in opkgmaps: ret.append(("remove", str(po))) elif po.pkgtup not in opkgtups: n,a,e,v,r = opkgmaps[(po.name, arch)] pinstEVR = yum.packages.PackageEVR(e, v, r) if po.EVR == pinstEVR: assert ignore_arch and po.arch != a elif po.EVR < pinstEVR: ret.append(("upgrade", naevr2str(n,arch,e,v,r))) else: ret.append(("downgrade", naevr2str(n,arch,e,v,r))) npkgtups.add(po.pkgtup) npkgmaps[(po.name, po.arch)] = po if ignore_arch: npkgmaps[(po.name, None)] = po for name, arch in sorted(opkgmaps): if ignore_arch and arch is not None: continue if (name, arch) in npkgmaps: continue if install_latest and ignore_arch: ret.append(("install", name)) elif install_latest: ret.append(("install", "%s.%s" % (name, arch))) else: ret.append(("install", pkgtup2str(opkgmaps[(name, arch)]))) return ret def main(): (opts, args) = cmd_line() yb = yum.YumBase() yb.preconf.init_plugins = True if opts.conffile: yb.preconf.fn = opts.conffile yb.conf if opts.cache: yb.conf.cache = True if opts.disablerepos: for repo_match in opts.disablerepos: for repo in yb.repos.findRepos(repo_match): repo.disable() if opts.enablerepos: for repo_match in opts.enablerepos: for repo in yb.repos.findRepos(repo_match): repo.enable() xtra_args = [] if opts.skip_broken: xtra_args.append('--skip-broken') if opts.assumeyes: xtra_args.append('-y') fn = args[0] print "Reading from: %s" % fn orpmdb = OtherRpmDB(fn) opkgmaps = {} for pkgtup in orpmdb.pkgtups: opkgmaps[(pkgtup[0], pkgtup[1])] = pkgtup if opts.ignore_arch: n,a,e,v,r = pkgtup opkgmaps[(pkgtup[0], None)] = n,None,e,v,r if opts.output: fo = sys.stdout elif opts.shell: try: fo = open(opts.shell, "wb") except OSError, e: print >>sys.stderr, "open(%s): %s" % (opts.shell, e) sys.exit(1) else: fo = tempfile.NamedTemporaryFile() fT = None if opts.filter_types: fT = set(opts.filter_types.replace(",", " ").split()) counts = {} for T, pkg in pkg_data2list(yb, set(orpmdb.pkgtups), opkgmaps, opts.install_latest, opts.ignore_arch): if fT is not None and T not in fT: continue counts[T] = counts.get(T, 0) + 1 try: print >>fo, "%-9s %s" % (T, pkg) except IOError: if opts.output: # mainly due to | sys.exit(1) raise if opts.output: sys.exit(0) print >>fo, "run" fo.flush() if opts.shell: if counts: print "Statistics:" for T in sorted(counts): print " %9s %6u" % (T, counts[T]) print "Done" sys.exit(0) # Want to do the transaction, hacky method if xtra_args: os.system("yum shell %s %s" % (" ".join(xtra_args), fo.name)) else: os.system("yum shell %s" % fo.name) if __name__ == "__main__": main() yum-utils-1.1.31/yum-groups-manager.py000077500000000000000000000254261162052066300176730ustar00rootroot00000000000000#!/usr/bin/python -tt import os import sys import re import string import optparse import gzip import yum from yum.i18n import to_unicode import yum.comps sys.path.insert(0, '/usr/share/yum-cli') import output from urlgrabber.progress import TextMeter def setup_opts(): version = "0.0.1" vers_txt = "Manage yum groups metadata version %s" % version usage_txt = "%prog [pkg-wildcard]..." parser = optparse.OptionParser(usage = usage_txt, version = vers_txt) parser.add_option("-n", "--name", help="group name") parser.add_option("--id", help="group id") parser.add_option("--mandatory", action="store_true", help="make the package names be in the mandatory section") parser.add_option("--optional", action="store_true", help="make the package names be in the optional section") parser.add_option("--dependencies", action="store_true", help="add the dependencies for this package") parser.add_option("--user-visible", dest="user_visible", action="store_true", default=None, help="make this a user visible group (default)") parser.add_option("--not-user-visible", dest="user_visible", action="store_false", default=None, help="make this a non-user visible group") parser.add_option("--description", help="description for the group") parser.add_option("--display-order", help="sort order override") parser.add_option("--load", action="append", default=[], help="load groups metadata from file") parser.add_option("--save", action="append", default=[], help="save groups metadata to file (don't print)") parser.add_option("--merge", help="load and save groups metadata to file (don't print)") parser.add_option("--print", dest="print2stdout", action="store_true", default=None, help="print the result to stdout") parser.add_option("--remove", action="store_true", default=False, help="remove the listed package instead of adding them") parser.add_option("--translated-name", action="append", dest="i18nname", help="name for the group, translated") parser.add_option("--translated-description", action="append", dest="i18ndescription", help="description for the group, translated") # Generic options parser.add_option("--quiet", action="store_true", help="quiet (no output to stderr)", default=False) parser.add_option("--verbose", action="store_false", help="verbose output", dest="quiet") parser.add_option("--enablerepo", action="append", dest="enablerepos", help="specify repoids to query, can be specified multiple times (default is all enabled)") parser.add_option("--disablerepo", action="append", dest="disablerepos", help="specify repoids to disable, can be specified multiple times") # tmprepo etc. parser.add_option("--noplugins", action="store_false", default=True, dest="plugins", help="disable yum plugin support") parser.add_option("-C", "--cache", action="store_true", help="run from cache only") parser.add_option("--tempcache", action="store_true", help="use private cache (default when used as non-root)") parser.add_option("-c", "--config", dest="conffile", help="config file location") return parser def trans_data(yb, inp): data = inp.split(':', 2) if len(data) != 2: yb.logger.error("Error: Incorrect translated data, should be: 'lang:text'") sys.exit(50) lang, text = data alnum = string.ascii_letters + string.digits lang = re.sub('[^-' + alnum + '_.@]', '', lang) if not lang: yb.logger.error("Error: Incorrect/empty language for translated data") sys.exit(50) return lang, to_unicode(text) __req2pkgs = {} def req2pkgs(yb, req): global __req2pkgs req = str(req) if req in __req2pkgs: return __req2pkgs[req] providers = [] try: # XXX rhbz#246519, for some reason returnPackagesByDep() fails # to find some root level directories while # searchPackageProvides() does... use that for now matches = yb.searchPackageProvides([req]) providers = matches.keys() # provider.extend(yum.YumBase.returnPackagesByDep(self, depstring)) except yum.Errors.YumBaseError, err: yb.logger.error("No package provides %s" % req) return [] __req2pkgs[req] = providers return providers def txt2id(txt): groupid = txt.lower() alnum = string.ascii_lowercase + string.digits groupid = re.sub('[^-' + alnum + '_.:]', '', groupid) return groupid def main(): parser = setup_opts() (opts, args) = parser.parse_args() comps = yum.comps.Comps() # Borrowing large sections from repoquery/pkg-tree etc. initnoise = (not opts.quiet) * 2 yb = yum.YumBase() if opts.conffile is not None: yb.preconf.fn = opts.conffile yb.preconf.debuglevel = initnoise yb.preconf.init_plugins = opts.plugins yb.conf # Show what is going on, if --quiet is not set. if not opts.quiet and sys.stdout.isatty(): yb.repos.setProgressBar(TextMeter(fo=sys.stdout)) yb.repos.callback = output.CacheProgressCallback() yumout = output.YumOutput() freport = ( yumout.failureReport, (), {} ) yb.repos.setFailureCallback( freport ) if os.geteuid() != 0 or opts.tempcache: cachedir = yum.misc.getCacheDir() if cachedir is None: yb.logger.error("Error: Could not make cachedir, exiting") sys.exit(50) yb.repos.setCacheDir(cachedir) yb.conf.cache = 0 # yum set cache=1, if uid != 0 if opts.cache: yb.conf.cache = True if not opts.quiet: yb.logger.info('Running from cache, results might be incomplete.') if opts.disablerepos: for repo_match in opts.disablerepos: for repo in yb.repos.findRepos(repo_match): repo.disable() if opts.enablerepos: for repo_match in opts.enablerepos: for repo in yb.repos.findRepos(repo_match): repo.enable() try: yb.doRepoSetup() except yum.Errors.RepoError, e: yb.logger.error("Could not setup repo: %s" % (e)) sys.exit(50) archlist = None try: yb.doSackSetup(archlist=archlist) except yum.Errors.RepoError, e: yb.logger.error(e) sys.exit(1) yum.misc.setup_locale() if opts.merge: opts.load.insert(0, opts.merge) opts.save.append(opts.merge) loaded_files = False for fname in opts.load: try: if not os.path.exists(fname): yb.logger.error("File not found: %s" % fname) continue if fname.endswith('.gz'): fname = gzip.open(fname) comps.add(srcfile=fname) loaded_files = True except IOError, e: yb.logger.error(e) sys.exit(50) if not loaded_files and opts.remove: yb.logger.error("Can't remove package(s) when we havn't loaded any") sys.exit(50) group = None if opts.id: group = comps.return_group(opts.id) if group is None and opts.name: group = comps.return_group(opts.name) if group is None and opts.remove: yb.logger.error("Can't remove package(s) from non-existant group") sys.exit(50) if group is None: group = yum.comps.Group() if opts.id: groupid = txt2id(opts.id) if not groupid: yb.logger.error("No valid id for group") sys.exit(50) group.groupid = groupid group.name = groupid elif opts.name: group.groupid = txt2id(opts.name) if not group.groupid: yb.logger.error("No valid id for group") sys.exit(50) else: yb.logger.error("No name or id for group") sys.exit(50) comps.add_group(group) if opts.name: if ',' in opts.name: yb.logger.error("Group name has a comma in it") if '*' in opts.name or '?' in opts.name: yb.logger.error("Group name has a wildcard in it, ? or *") group.name = opts.name if opts.description: group.description = opts.description if opts.display_order: group.display_order = int(opts.display_order) if opts.user_visible is not None: group.user_visible = opts.user_visible for tn in opts.i18nname or []: lang, text = trans_data(yb, tn) if ',' in text: yb.logger.error("Translated group name (%s) has a comma in it"%lang) if '*' in text or '?' in text: yb.logger.error("Translated group name (%s) has a wildcard in it" ", ? or *" % lang) group.translated_name[lang] = text for td in opts.i18ndescription or []: lang, text = trans_data(yb, td) group.translated_description[lang] = text try: if args: pkgs = yb.pkgSack.returnNewestByName(patterns=args) else: pkgs = [] except yum.packageSack.PackageSackError, e: yb.logger.error(e) sys.exit(50) pkgnames = set([pkg.name for pkg in pkgs]) if opts.dependencies: for pkg in pkgs: for rptup in pkg.returnPrco('requires'): if rptup[0].startswith('rpmlib'): continue rname = yum.misc.prco_tuple_to_string(rptup) pkgnames.update([pkg.name for pkg in req2pkgs(yb, rname)]) for pkgname in pkgnames: if opts.remove: group.mandatory_packages.pop(pkgname, 0) group.optional_packages.pop(pkgname, 0) group.default_packages.pop(pkgname, 0) elif opts.mandatory: group.mandatory_packages[pkgname] = 1 elif opts.optional: group.optional_packages[pkgname] = 1 else: group.default_packages[pkgname] = 1 for fname in opts.save: try: fo = open(fname, "wb") fo.write(comps.xml()) del fo except IOError, e: yb.logger.error(e) sys.exit(50) if (opts.print2stdout or (opts.print2stdout is None and not opts.save)): # Why the to_unicode()? Why is it converting at all? # Why doesn't setup_locale() fix this? ... all good questions print to_unicode(comps.xml()) if __name__ == "__main__": main() yum-utils-1.1.31/yum-util-cli-template000066400000000000000000000040231162052066300176330ustar00rootroot00000000000000#!/usr/bin/python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Copyright 2007 Seth Vidal import sys sys.path.insert(0,'/usr/share/yum-cli/') import yum import yum.Errors from utils import YumUtilBase class MyYumUtil(YumUtilBase): NAME = 'myyumutil' VERSION = '1.0' USAGE = '"usage: myyumutil [options] package1 [package2] [package..]' def __init__(self): YumUtilBase.__init__(self, MyYumUtil.NAME, MyYumUtil.VERSION, MyYumUtil.USAGE) self.logger = logging.getLogger("yum.verbose.cli.myyumutil") self.main() def main(self): # Add util commandline options to the yum-cli ones parser = self.getOptionParser() # Parse the commandline option and setup the basics. opts = self.doUtilConfigSetup() # Check if there is anything to do. if len(self.cmds) < 1: print parser.format_help() # Stupid .print_help() commits unicide sys.exit(0) # at this point you have the entire YumBaseCli object as 'self' # you can do whatever you want # if you want to make sure to build and run a transaction based on # what you added to the tsInfo then do: #self.buildTransaction() #self.doTransaction() if __name__ == '__main__': util = MyYumUtil() yum-utils-1.1.31/yum-utils.bash000066400000000000000000000232361162052066300163630ustar00rootroot00000000000000# bash completion for yum-utils _yu_init_completion() { if declare -F _get_comp_words_by_ref &>/dev/null ; then _get_comp_words_by_ref -n = cur prev words else cur=$1 prev=$2 words=("${COMP_WORDS[@]}") fi declare -F _split_longopt &>/dev/null && _split_longopt && split=true } # repomanage _yu_repomanage() { local cur prev words=() split=false _yu_init_completion "$2" "$3" case $prev in -h|--help) return 0 ;; -k|--keep) COMPREPLY=( $( compgen -W '1 2 3 4 5 6 7 8 9' -- "$cur" ) ) return 0 ;; esac $split && return 0 if [[ $cur == -* ]] ; then COMPREPLY=( $( compgen -W '--old --new --space --keep --nocheck --help' -- "$cur" ) ) return 0 fi COMPREPLY=( $( compgen -d -- "$cur" ) ) } && complete -F _yu_repomanage -o filenames repomanage repomanage.py # package-cleanup _yu_package_cleanup() { local cur prev words=() split=false _yu_init_completion "$2" "$3" _yum_complete_baseopts "$cur" "$prev" 2>/dev/null && return 0 case $prev in --leaf-regex|--qf|--queryformat) return 0 ;; --count) COMPREPLY=( $( compgen -W '1 2 3 4 5 6 7 8 9' -- "$cur" ) ) return 0 ;; esac $split && return 0 COMPREPLY=( $( compgen -W '$( _yum_baseopts 2>/dev/null ) --problems --queryformat --orphans --dupes --cleandupes --noscripts --leaves --all --leaf-regex --exclude-devel --exclude-bin --oldkernels --count --keepdevel' -- "$cur" ) ) } && complete -F _yu_package_cleanup -o filenames package-cleanup package-cleanup.py # verifytree _yu_verifytree() { local cur prev words=() split=false _yu_init_completion "$2" "$3" case $prev in -h|--help|-t|--testopia) return 0 ;; esac $split && return 0 if [[ $cur == -* ]] ; then COMPREPLY=( $( compgen -W '--help --checkall --testopia --treeinfo' \ -- "$cur" ) ) return 0 fi COMPREPLY=( $( compgen -d -- "$cur" ) ) } && complete -F _yu_verifytree -o filenames verifytree verifytree.py # repo-graph _yu_repo_graph() { local cur prev words=() split=false _yu_init_completion "$2" "$3" case $prev in -h|--help) return 0 ;; --repoid) _yum_repolist all "$cur" 2>/dev/null return 0 ;; -c) COMPREPLY=( $( compgen -f -o plusdirs -X '!*.conf' -- "$cur" ) ) return 0 ;; esac $split && return 0 COMPREPLY=( $( compgen -W '--help --repoid -c' -- "$cur" ) ) } && complete -F _yu_repo_graph -o filenames repo-graph repo-graph.py # repo-rss _yu_repo_rss() { COMPREPLY=() case $3 in -h|--help|-l|-t|-d|-r|-a) return 0 ;; -f) COMPREPLY=( $( compgen -f -o plusdirs -X '!*.xml' -- "$cur" ) ) return 0 ;; -c) COMPREPLY=( $( compgen -f -o plusdirs -X '!*.conf' -- "$cur" ) ) return 0 ;; esac COMPREPLY=( $( compgen -W '--help -f -l -t -d -r --tempcache -g -a -c' \ -- "$2" ) ) [[ $2 == -* ]] || _yum_repolist all "$2" 2>/dev/null || return 0 } && complete -F _yu_repo_rss -o filenames repo-rss repo-rss.py # repoclosure _yu_repoclosure() { local cur prev words=() split=false _yu_init_completion "$2" "$3" case $prev in -h|--help|-a|--arch|--basearch|--repofrompath) return 0 ;; -c|--config) COMPREPLY=( $( compgen -f -o plusdirs -X '!*.conf' -- "$cur" ) ) return 0 ;; -l|--lookaside|-r|--repoid) _yum_repolist all "$cur" 2>/dev/null return 0 ;; -p|--pkg) _yum_list all "$cur" 2>/dev/null return 0 ;; -g|--group) _yum_grouplist "" "$cur" 2>/dev/null return 0 ;; esac $split && return 0 COMPREPLY=( $( compgen -W '--help --config --arch --basearch --builddeps --lookaside --repoid --tempcache --quiet --newest --repofrompath --pkg --group' -- "$cur" ) ) } && complete -F _yu_repoclosure -o filenames repoclosure repoclosure.py # repoquery _yu_repoquery() { local cur prev words=() split=false _yu_init_completion "$2" "$3" local word groupmode=false for word in "${words[@]}" ; do case $word in -g|--group) groupmode=true ; break ;; esac done case $prev in -h|--help|--version|-f|--file|--qf|--queryformat|--resolve|--archlist|\ --whatprovides|--whatrequires|--whatobsoletes|--whatconflicts|\ --repofrompath|--level|--search-fields) return 0 ;; -l|--list|-i|--info|-R|--requires) if $groupmode ; then _yum_grouplist "" "$cur" 2>/dev/null else declare -F _yum_atgroups &>/dev/null && \ _yum_atgroups "$cur" || _yum_list all "$cur" 2>/dev/null fi return 0 ;; --provides|--obsoletes|--conflicts|--groupmember|--changelog|\ --location|--nevra|--envra|--nvr|-s|--source) declare -F _yum_atgroups &>/dev/null && \ _yum_atgroups "$cur" || _yum_list all "$cur" 2>/dev/null return 0 ;; --grouppkgs) COMPREPLY=( $( compgen -W 'all default optional mandatory' \ -- "$cur" ) ) return 0 ;; --pkgnarrow) COMPREPLY=( $( compgen -W 'all available updates installed extras obsoletes recent repos' -- "$cur" ) ) return 0 ;; --repoid) _yum_repolist all "$cur" 2>/dev/null return 0 ;; --enablerepo) _yum_repolist disabled "$cur" 2>/dev/null return 0 ;; --disablerepo) _yum_repolist enabled "$cur" 2>/dev/null return 0 ;; -c|--config) COMPREPLY=( $( compgen -f -o plusdirs -X '!*.conf' -- "$cur" ) ) return 0 ;; --output) COMPREPLY=( $( compgen -W 'text ascii-tree dot-tree' -- "$cur" ) ) return 0 ;; esac $split && return 0 COMPREPLY=( $( compgen -W '--version --help --list --info --file --queryformat --groupmember --all --requires --provides --obsoletes --conflicts --changelog --location --nevra --envra --nvr --source --srpm --resolve --exactdeps --recursive --whatprovides --whatrequires --whatobsoletes --whatconflicts --group --grouppkgs --archlist --pkgnarrow --installed --show-duplicates --repoid --enablerepo --disablerepo --repofrompath --plugins --quiet --verbose --cache --tempcache --querytags --config --level --output --search --search-fields' -- "$cur" ) ) } && complete -F _yu_repoquery -o filenames repoquery repoquery.py # yumdb _yu_yumdb() { local cur prev words=() split=false _yu_init_completion "$2" "$3" case $prev in -h|--help|-version) return 0 ;; -c|--config) COMPREPLY=( $( compgen -f -o plusdirs -X '!*.conf' -- "$cur" ) ) return 0 ;; shell) COMPREPLY=( $( compgen -f -o plusdirs -- "$cur" ) ) return 0 ;; esac $split && return 0 if [ $COMP_CWORD -le 1 ] ; then COMPREPLY=( $( compgen -W 'get set del rename rename-force copy search exist unset info shell --version --help --noplugins --config' \ -- "$cur" ) ) fi } && complete -F _yu_yumdb -o filenames yumdb yumdb.py # repodiff _yu_repodiff() { local cur prev words=() split=false _yu_init_completion "$2" "$3" case $prev in -h|--help|--version|-n|--new|-o|--old|-a|--archlist) return 0 ;; esac $split && return 0 COMPREPLY=( $( compgen -W '--version --help --new --old --quiet --archlist --size --simple' -- "$cur" ) ) } && complete -F _yu_repodiff repodiff repodiff.py # yum-builddep _yu_builddep() { local cur prev words=() split=false _yu_init_completion "$2" "$3" _yum_complete_baseopts "$cur" "$prev" && return 0 $split && return 0 if [[ $cur == -* ]] ; then COMPREPLY=( $( compgen -W '$( _yum_baseopts 2>/dev/null )' -- "$cur" ) ) return 0 fi COMPREPLY=( $( compgen -f -o plusdirs -X "!*.spec" -- "$cur" ) ) [[ $cur != */* && $cur != ~* ]] && _yum_list all "$cur" 2>/dev/null } && complete -F _yu_builddep -o filenames yum-builddep yum-builddep.py # debuginfo-install _yu_debuginfo_install() { local cur prev words=() split=false _yu_init_completion "$2" "$3" _yum_complete_baseopts "$cur" "$prev" && return 0 $split && return 0 if [[ $cur == -* ]] ; then COMPREPLY=( $( compgen -W '$( _yum_baseopts 2>/dev/null ) --no-debuginfo-plugin' -- "$cur" ) ) return 0 fi _yum_list all "$cur" } && complete -F _yu_debuginfo_install debuginfo-install debuginfo-install.py # yum-debug-dump _yu_debug_dump() { COMPREPLY=() case $3 in -h|--help) return 0 ;; esac if [[ $2 == -* ]] ; then COMPREPLY=( $( compgen -W '--help --norepos' -- "$2" ) ) return 0 fi COMPREPLY=( $( compgen -f -o plusdirs -- "$cur" ) ) } && complete -F _yu_debug_dump -o filenames yum-debug-dump yum-debug-dump.py # Local variables: # mode: shell-script # sh-basic-offset: 4 # sh-indent-comment: t # indent-tabs-mode: nil # End: # ex: ts=4 sw=4 et filetype=sh yum-utils-1.1.31/yum-utils.spec000066400000000000000000000665121162052066300164040ustar00rootroot00000000000000%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 Release: 1%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz URL: http://yum.baseurl.org/download/yum-utils/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch Requires: yum >= 3.2.29 Requires: python-kitchen BuildRequires: python-devel >= 2.4 BuildRequires: gettext BuildRequires: intltool Provides: yum-utils-translations = %{version}-%{release} %description yum-utils is a collection of utilities and examples for the yum package manager. It includes utilities by different authors that make yum easier and more powerful to use. These tools include: debuginfo-install, find-repos-of-install, needs-restarting, package-cleanup, repoclosure, repodiff, repo-graph, repomanage, repoquery, repo-rss, reposync, repotrack, show-installed, show-changed-rco, verifytree, yumdownloader, yum-builddep, yum-complete-transaction, yum-config-manager, yum-debug-dump, yum-debug-restore and yum-groups-manager. %package -n yum-updateonboot Summary: Run yum update on system boot Group: System Environment/Base Requires: python, yum >= 2.4 Requires(pre): chkconfig Requires(post): chkconfig %description -n yum-updateonboot Runs yum update on system boot. This allows machines that have been turned off for an extended amount of time to become secure immediately, instead of waiting until the next early morning cron job. %package -n yum-plugin-changelog Summary: Yum plugin for viewing package changelogs before/after updating Group: System Environment/Base Provides: yum-changelog = %{version}-%{release} Obsoletes: yum-changelog < 1.1.20-0 Conflicts: yum-changelog < 1.1.20-0 # changelog requires new update_md.UpdateMetadata() API in 3.2.23 Requires: yum >= 3.2.23 Requires: python-dateutil %description -n yum-plugin-changelog This plugin adds a command line option to allow viewing package changelog deltas before or after updating packages. %package -n yum-plugin-fastestmirror Summary: Yum plugin which chooses fastest repository from a mirrorlist Group: System Environment/Base Provides: yum-fastestmirror = %{version}-%{release} Obsoletes: yum-fastestmirror < 1.1.20-0 Conflicts: yum-fastestmirror < 1.1.20-0 Requires: yum >= 3.0 %description -n yum-plugin-fastestmirror This plugin sorts each repository's mirrorlist by connection speed prior to downloading packages. %package -n yum-plugin-protectbase Summary: Yum plugin to protect packages from certain repositories. Group: System Environment/Base Provides: yum-protectbase = %{version}-%{release} Obsoletes: yum-protectbase < 1.1.20-0 Conflicts: yum-protectbase < 1.1.20-0 Requires: yum >= 3.0 %description -n yum-plugin-protectbase This plugin allows certain repositories to be protected. Packages in the protected repositories can't be overridden by packages in non-protected repositories even if the non-protected repo has a later version. %package -n yum-plugin-versionlock Summary: Yum plugin to lock specified packages from being updated Group: System Environment/Base Provides: yum-versionlock = %{version}-%{release} Obsoletes: yum-versionlock < 1.1.20-0 Conflicts: yum-versionlock < 1.1.20-0 Requires: yum >= 3.2.24 %description -n yum-plugin-versionlock This plugin takes a set of name/versions for packages and excludes all other versions of those packages (including optionally following obsoletes). This allows you to protect packages from being updated by newer versions, for example. %package -n yum-plugin-tsflags Summary: Yum plugin to add tsflags by a commandline option Group: System Environment/Base Provides: yum-tsflags = %{version}-%{release} Obsoletes: yum-tsflags < 1.1.20-0 Conflicts: yum-tsflags < 1.1.20-0 Requires: yum >= 3.0 %description -n yum-plugin-tsflags This plugin allows you to specify optional transaction flags on the yum command line %package -n yum-plugin-downloadonly Summary: Yum plugin to add downloadonly command option Group: System Environment/Base Provides: yum-downloadonly = %{version}-%{release} Obsoletes: yum-downloadonly < 1.1.20-0 Conflicts: yum-downloadonly < 1.1.20-0 Requires: yum >= 3.0 %description -n yum-plugin-downloadonly This plugin adds a --downloadonly flag to yum so that yum will only download the packages and not install/update them. %package -n yum-plugin-priorities Summary: plugin to give priorities to packages from different repos Group: System Environment/Base Provides: yum-priorities = %{version}-%{release} Obsoletes: yum-priorities < 1.1.20-0 Conflicts: yum-priorities < 1.1.20-0 Requires: yum >= 3.0 %description -n yum-plugin-priorities This plugin allows repositories to have different priorities. Packages in a repository with a lower priority can't be overridden by packages from a repository with a higher priority even if repo has a later version. %package -n yum-plugin-refresh-updatesd Summary: Tell yum-updatesd to check for updates when yum exits Group: System Environment/Base Provides: yum-refresh-updatesd = %{version}-%{release} Obsoletes: yum-refresh-updatesd < 1.1.20-0 Conflicts: yum-refresh-updatesd < 1.1.20-0 Requires: yum >= 3.0 Requires: yum-updatesd %description -n yum-plugin-refresh-updatesd yum-refresh-updatesd tells yum-updatesd to check for updates when yum exits. This way, if you run 'yum update' and install all available updates, puplet will almost instantly update itself to reflect this. %package -n yum-plugin-merge-conf Summary: Yum plugin to merge configuration changes when installing packages Group: System Environment/Base Provides: yum-merge-conf = %{version}-%{release} Obsoletes: yum-merge-conf < 1.1.20-0 Conflicts: yum-merge-conf < 1.1.20-0 Requires: yum >= 3.0 %description -n yum-plugin-merge-conf This yum plugin adds the "--merge-conf" command line option. With this option, Yum will ask you what to do with config files which have changed on updating a package. %package -n yum-plugin-security Summary: Yum plugin to enable security filters Group: System Environment/Base Provides: yum-security = %{version}-%{release} Obsoletes: yum-security < 1.1.20-0 Conflicts: yum-security < 1.1.20-0 Requires: yum >= 3.2.18 %description -n yum-plugin-security This plugin adds the options --security, --cve, --bz and --advisory flags to yum and the list-security and info-security commands. The options make it possible to limit list/upgrade of packages to specific security relevant ones. The commands give you the security information. %package -n yum-plugin-upgrade-helper Summary: Yum plugin to help upgrades to the next distribution version Group: System Environment/Base Provides: yum-upgrade-helper = %{version}-%{release} Obsoletes: yum-upgrade-helper < 1.1.20-0 Conflicts: yum-upgrade-helper < 1.1.20-0 Requires: yum >= 3.0 %description -n yum-plugin-upgrade-helper this plugin allows yum to erase specific packages on install/update based on an additional metadata file in repositories. It is used to simplify distribution upgrade hangups. %package -n yum-plugin-aliases Summary: Yum plugin to enable aliases filters Group: System Environment/Base Provides: yum-aliases = %{version}-%{release} Obsoletes: yum-aliases < 1.1.20-0 Conflicts: yum-aliases < 1.1.20-0 # Requires args_hook Requires: yum >= 3.2.23 Requires: yum-utils-translations = %{version}-%{release} %description -n yum-plugin-aliases This plugin adds the command alias, and parses the aliases config. file to enable aliases. %package -n yum-plugin-list-data Summary: Yum plugin to list aggregate package data Group: System Environment/Base Provides: yum-list-data = %{version}-%{release} Obsoletes: yum-list-data < 1.1.20-0 Conflicts: yum-list-data < 1.1.20-0 Requires: yum >= 3.0.5 %description -n yum-plugin-list-data This plugin adds the commands list- vendors, groups, packagers, licenses, arches, committers, buildhosts, baseurls, package-sizes, archive-sizes and installed-sizes. %package -n yum-plugin-filter-data Summary: Yum plugin to list filter based on package data Group: System Environment/Base Provides: yum-filter-data = %{version}-%{release} Obsoletes: yum-filter-data < 1.1.20-0 Conflicts: yum-filter-data < 1.1.20-0 Requires: yum >= 3.2.17 %description -n yum-plugin-filter-data This plugin adds the options --filter- vendors, groups, packagers, licenses, arches, committers, buildhosts, baseurls, package-sizes, archive-sizes and installed-sizes. Note that each package must match at least one pattern/range in each category, if any were specified. %package -n yum-plugin-tmprepo Summary: Yum plugin to add temporary repositories Group: System Environment/Base Provides: yum-tmprepo = %{version}-%{release} Obsoletes: yum-tmprepo < 1.1.20-0 Conflicts: yum-tmprepo < 1.1.20-0 Requires: yum >= 3.2.11 Requires: createrepo %description -n yum-plugin-tmprepo This plugin adds the option --tmprepo which takes a url to a .repo file downloads it and enables it for a single run. This plugin tries to ensure that temporary repositories are safe to use, by default, by not allowing gpg checking to be disabled. %package -n yum-plugin-verify Summary: Yum plugin to add verify command, and options Group: System Environment/Base Provides: yum-verify = %{version}-%{release} Obsoletes: yum-verify < 1.1.20-0 Conflicts: yum-verify < 1.1.20-0 Requires: yum >= 3.2.12 %description -n yum-plugin-verify This plugin adds the commands verify, verify-all and verify-rpm. There are also a couple of options. This command works like rpm -V, to verify your installation. %package -n yum-plugin-keys Summary: Yum plugin to deal with signing keys Group: System Environment/Base Provides: yum-keys = %{version}-%{release} Obsoletes: yum-keys < 1.1.20-0 Conflicts: yum-keys < 1.1.20-0 Requires: yum >= 3.2.19 %description -n yum-plugin-keys This plugin adds the commands keys, keys-info, keys-data and keys-remove. They allow you to query and remove signing keys. %package -n yum-plugin-remove-with-leaves Summary: Yum plugin to remove dependencies which are no longer used because of a removal Group: System Environment/Base Provides: yum-remove-with-leaves = %{version}-%{release} Obsoletes: yum-remove-with-leaves < 1.1.20-0 Conflicts: yum-remove-with-leaves < 1.1.20-0 Requires: yum >= 3.2.19 %description -n yum-plugin-remove-with-leaves This plugin removes any unused dependencies that were brought in by an install but would not normally be removed. It helps to keep a system clean of unused libraries and packages. %package -n yum-plugin-post-transaction-actions Summary: Yum plugin to run arbitrary commands when certain pkgs are acted on Group: System Environment/Base Provides: yum-post-transaction-actions = %{version}-%{release} Obsoletes: yum-post-transaction-actions < 1.1.20-0 Conflicts: yum-post-transaction-actions < 1.1.20-0 Requires: yum >= 3.2.19 %description -n yum-plugin-post-transaction-actions This plugin allows the user to run arbitrary actions immediately following a transaction when specified packages are changed. %package -n yum-NetworkManager-dispatcher Summary: NetworkManager script which tells yum to check it's cache on network change Group: System Environment/Base Requires: yum >= 3.2.17 %description -n yum-NetworkManager-dispatcher This NetworkManager "dispatch script" forces yum to check its cache if/when a new network connection happens in NetworkManager. Note that currently there is no checking of previous data, so if your WiFi keeps going up and down (or you suspend/resume a lot) yum will recheck its cached data a lot. %package -n yum-plugin-rpm-warm-cache Summary: Yum plugin to access the rpmdb files early to warm up access to the db Group: System Environment/Base Provides: yum-rpm-warm-cache = %{version}-%{release} Obsoletes: yum-rpm-warm-cache < 1.1.20-0 Conflicts: yum-rpm-warm-cache < 1.1.20-0 Requires: yum >= 3.2.19 %description -n yum-plugin-rpm-warm-cache This plugin reads the rpmdb files into the system cache before accessing the rpmdb directly. In some cases this should speed up access to rpmdb information %package -n yum-plugin-auto-update-debug-info # Works by searching for *-debuginfo ... so it shouldn't trigger on itself. Summary: Yum plugin to enable automatic updates to installed debuginfo packages Group: System Environment/Base Obsoletes: yum-plugin-auto-update-debuginfo < 1.1.21-0 Conflicts: yum-plugin-auto-update-debuginfo < 1.1.21-0 Provides: yum-plugin-auto-update-debuginfo = %{version}-%{release} Requires: yum >= 3.2.19 %description -n yum-plugin-auto-update-debug-info This plugin looks to see if any debuginfo packages are installed, and if there are it enables all debuginfo repositories that are "children" of enabled repositories. %package -n yum-plugin-show-leaves Summary: Yum plugin which shows newly installed leaf packages Group: System Environment/Base Requires: yum >= 3.2.23 %description -n yum-plugin-show-leaves Yum plugin which shows newly installed leaf packages and packages that became leaves after a transaction %package -n yum-plugin-local Summary: Yum plugin to automatically manage a local repo. of downloaded packages Group: System Environment/Base # Who the hell knows what version :) Requires: yum >= 3.2.22 Requires: createrepo %description -n yum-plugin-local When this plugin is installed it will automatically copy all downloaded packages to a repository on the local filesystem, and (re)build that repository. This means that anything you've downloaded will always exist, even if the original repo. removes it (and can thus. be reinstalled/downgraded/etc.). %package -n yum-plugin-fs-snapshot Summary: Yum plugin to automatically snapshot your filesystems during updates Group: System Environment/Base Requires: yum >= 3.2.22 %description -n yum-plugin-fs-snapshot When this plugin is installed it will automatically snapshot any filesystem that is touched by the packages in a yum update or yum remove. %package -n yum-plugin-ps Summary: Yum plugin to look at processes, with respect to packages Group: System Environment/Base Requires: yum >= 3.2.27 %description -n yum-plugin-ps When this plugin is installed it adds the yum command "ps", which allows you to see which running processes are accociated with which packages (and if they need rebooting, or have updates, etc.) %package -n yum-plugin-puppetverify Summary: Yum plugin to add puppet checksums to verify data Group: System Environment/Base Provides: yum-puppetverify = %{version}-%{release} Requires: yum >= 3.2.12 Requires: PyYAML >= 3.09 Requires: puppet %description -n yum-plugin-puppetverify Supplies checksums for files in packages from puppet's state file. %prep %setup -q %install rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install make -C updateonboot DESTDIR=$RPM_BUILD_ROOT install %find_lang %name # Plugins to install plugins="\ changelog \ fastestmirror \ protectbase \ versionlock \ tsflags \ downloadonly \ priorities \ refresh-updatesd \ merge-conf \ security \ upgrade-helper \ aliases \ list-data \ filter-data \ tmprepo \ verify \ keys \ remove-with-leaves \ post-transaction-actions \ rpm-warm-cache \ auto-update-debuginfo \ show-leaves \ local \ fs-snapshot \ ps \ puppetverify \ " mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ $RPM_BUILD_ROOT/usr/lib/yum-plugins/ mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/post-actions cd plugins for plug in $plugins; do install -m 644 $plug/*.conf $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ install -m 644 $plug/*.py $RPM_BUILD_ROOT/usr/lib/yum-plugins/ %{__python} -c "import compileall; compileall.compile_dir('$RPM_BUILD_ROOT/usr/lib/yum-plugins', 1)" done install -m 644 aliases/aliases $RPM_BUILD_ROOT/%{_sysconfdir}/yum/aliases.conf install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ # need for for the ghost in files section of yum-plugin-local mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum.repos.d touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo %clean rm -rf $RPM_BUILD_ROOT %post -n yum-updateonboot /sbin/chkconfig --add yum-updateonboot >/dev/null 2>&1 || :; %preun -n yum-updateonboot if [ $1 = 0 ]; then /sbin/service yum-updateonboot stop >/dev/null 2>&1 || :; /sbin/chkconfig --del yum-updateonboot >/dev/null 2>&1 || :; fi %files -f %{name}.lang %defattr(-, root, root) %doc README yum-util-cli-template %doc COPYING %doc plugins/README %{_sysconfdir}/bash_completion.d %{_bindir}/debuginfo-install %{_bindir}/find-repos-of-install %{_bindir}/needs-restarting %{_bindir}/package-cleanup %{_bindir}/repoclosure %{_bindir}/repodiff %{_bindir}/repomanage %{_bindir}/repoquery %{_bindir}/repotrack %{_bindir}/reposync %{_bindir}/repo-graph %{_bindir}/repo-rss %{_bindir}/verifytree %{_bindir}/yumdownloader %{_bindir}/yum-builddep %{_bindir}/yum-config-manager %{_bindir}/yum-debug-dump %{_bindir}/yum-groups-manager %{_bindir}/yum-debug-restore %{_bindir}/show-installed %{_bindir}/show-changed-rco %{_sbindir}/yum-complete-transaction %{_sbindir}/yumdb %{python_sitelib}/yumutils/ %{_mandir}/man1/yum-utils.1.* %{_mandir}/man1/debuginfo-install.1.* %{_mandir}/man1/package-cleanup.1.* %{_mandir}/man1/repo-rss.1.* %{_mandir}/man1/repoquery.1.* %{_mandir}/man1/repodiff.1.* %{_mandir}/man1/reposync.1.* %{_mandir}/man1/show-changed-rco.1.* %{_mandir}/man1/show-installed.1.* %{_mandir}/man1/yum-builddep.1.* %{_mandir}/man1/yum-debug-dump.1.* %{_mandir}/man8/yum-complete-transaction.8.* %{_mandir}/man1/yum-groups-manager.1.* %{_mandir}/man8/yumdb.8.* %{_mandir}/man1/yumdownloader.1.* %files -n yum-updateonboot %defattr(-, root, root) %doc updateonboot/README COPYING %config(noreplace) %{_sysconfdir}/sysconfig/yum-updateonboot %{_initrddir}/yum-updateonboot %files -n yum-plugin-changelog %defattr(-, root, root) %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/changelog.conf %doc COPYING /usr/lib/yum-plugins/changelog.* %{_mandir}/man1/yum-changelog.1.* %{_mandir}/man5/yum-changelog.conf.5.* %files -n yum-plugin-fastestmirror %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/fastestmirror.conf /usr/lib/yum-plugins/fastestmirror*.* %files -n yum-plugin-protectbase %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/protectbase.conf /usr/lib/yum-plugins/protectbase.* %files -n yum-plugin-versionlock %defattr(-, root, root) %doc plugins/versionlock/README COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/versionlock.conf %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/versionlock.list /usr/lib/yum-plugins/versionlock.* %{_mandir}/man1/yum-versionlock.1.* %{_mandir}/man5/yum-versionlock.conf.5.* %files -n yum-plugin-tsflags %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/tsflags.conf /usr/lib/yum-plugins/tsflags.* %files -n yum-plugin-downloadonly %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/downloadonly.conf /usr/lib/yum-plugins/downloadonly.* %files -n yum-plugin-priorities %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/priorities.conf /usr/lib/yum-plugins/priorities.* %files -n yum-plugin-refresh-updatesd %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/refresh-updatesd.conf /usr/lib/yum-plugins/refresh-updatesd.* %files -n yum-plugin-merge-conf %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/merge-conf.conf /usr/lib/yum-plugins/merge-conf.* %files -n yum-plugin-security %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/security.conf /usr/lib/yum-plugins/security.* %{_mandir}/man8/yum-security.8.* %files -n yum-plugin-upgrade-helper %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/upgrade-helper.conf /usr/lib/yum-plugins/upgrade-helper.* %files -n yum-plugin-aliases %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/aliases.conf %config(noreplace) %{_sysconfdir}/yum/aliases.conf /usr/lib/yum-plugins/aliases.* %{_mandir}/man1/yum-aliases.1.* %files -n yum-plugin-list-data %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/list-data.conf /usr/lib/yum-plugins/list-data.* %{_mandir}/man1/yum-list-data.1.* %files -n yum-plugin-filter-data %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/filter-data.conf /usr/lib/yum-plugins/filter-data.* %{_mandir}/man1/yum-filter-data.1.* %files -n yum-plugin-tmprepo %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/tmprepo.conf /usr/lib/yum-plugins/tmprepo.* %files -n yum-plugin-verify %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/verify.conf /usr/lib/yum-plugins/verify.* %{_mandir}/man1/yum-verify.1.* %files -n yum-plugin-keys %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/keys.conf /usr/lib/yum-plugins/keys.* %files -n yum-NetworkManager-dispatcher %defattr(-, root, root) %doc COPYING /etc/NetworkManager/dispatcher.d/* %files -n yum-plugin-remove-with-leaves %defattr(-, root, root) %doc COPYING /usr/lib/yum-plugins/remove-with-leaves.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/remove-with-leaves.conf %files -n yum-plugin-post-transaction-actions %defattr(-, root, root) %doc COPYING /usr/lib/yum-plugins/post-transaction-actions.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/post-transaction-actions.conf %doc plugins/post-transaction-actions/sample.action # Default *.action file dropping dir. %dir %{_sysconfdir}/yum/post-actions %files -n yum-plugin-rpm-warm-cache %defattr(-, root, root) %doc COPYING /usr/lib/yum-plugins/rpm-warm-cache.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/rpm-warm-cache.conf %files -n yum-plugin-auto-update-debug-info %defattr(-, root, root) %doc COPYING /usr/lib/yum-plugins/auto-update-debuginfo.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/auto-update-debuginfo.conf %files -n yum-plugin-show-leaves %defattr(-, root, root) %doc COPYING /usr/lib/yum-plugins/show-leaves.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/show-leaves.conf %files -n yum-plugin-local %defattr(-, root, root) %doc COPYING %ghost %{_sysconfdir}/yum.repos.d/_local.repo %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/local.conf /usr/lib/yum-plugins/local.* %files -n yum-plugin-fs-snapshot %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/fs-snapshot.conf /usr/lib/yum-plugins/fs-snapshot.* %{_mandir}/man1/yum-fs-snapshot.1.* %{_mandir}/man5/yum-fs-snapshot.conf.5.* %files -n yum-plugin-ps %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/ps.conf /usr/lib/yum-plugins/ps.* %files -n yum-plugin-puppetverify %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/puppetverify.conf /usr/lib/yum-plugins/puppetverify.* %changelog * Thu Aug 10 2011 Tim Lauridsen - mark as 1.1.31 * Thu Jan 13 2011 Tim Lauridsen - mark as 1.1.30 * Mon Jan 3 2011 Tim Lauridsen - Added yumutils python module * Thu Dec 30 2010 Tim Lauridsen - Added Translation support and need Requires, BuildRequires * Sun Nov 7 2010 Tim Lauridsen - mark as 1.1.29 * Tue Aug 3 2010 Seth Vidal - add COPYING docs to all the plugins to make fedora(and Tim) happy. :) * Tue Aug 3 2010 Tim Lauridsen - mark as 1.1.28 * Sun Jun 6 2010 Tim Lauridsen - mark as 1.1.27 * Wed Feb 10 2010 Tim Lauridsen - mark as 1.1.26 * Wed Jan 27 2010 Tim Lauridsen - mark as 1.1.25 - add touch /etc/yum.repos.d/_local.repo to install section - this need for for the ghost in files section of yum-plugin-local * Sun Nov 8 2009 Tim Lauridsen - remove basearchonly since all versions of yum for quite some time obsolete it - truncate changelog to last 2 years * Sat Nov 7 2009 Tim Lauridsen - mark as 1.1.24 * Wed Nov 4 2009 Seth Vidal - add needs-restarting * Mon Oct 12 2009 Seth Vidal - add python compileall to all plugins so we get .pyc/.pyo files in them - fixes https://bugzilla.redhat.com/show_bug.cgi?id=493174 * Wed Sep 2 2009 Tim Lauridsen - mark as 1.1.23 * Tue May 19 2009 Tim Lauridsen - mark as 1.1.22 * Mon May 18 2009 Seth Vidal - add show-leaves plugin from Ville Skyttä * Wed Mar 25 2009 Tim Lauridsen - mark as 1.1.21 * Mon Mar 2 2009 Tim Lauridsen - set yum require to 3.2.21 (the 3.2.21 in rawhide is patched to yum head, so it matches the need yum 3.2.22 code) - Added versioned Provides: yum- to make rpm/yum happy. - yum-updateonboot is not renamed and dont need Obsoletes/Conflicts/Provides * Sun Mar 1 2009 Tim Lauridsen - mark as 1.1.20 - rename plugins from yum-name to yum-plugin-name * Wed Feb 25 2009 Tim Lauridsen - Remove yum-kernel-module & yum-fedorakmod plugins (no obsoleting yet) - Remove yum-skip-broken plugin leftovers * Tue Feb 3 2009 James Antill - add auto-update-debuginfo plugin * Wed Dec 17 2008 Tim Lauridsen - mark as 1.1.19 * Wed Dec 10 2008 Seth Vidal - add find-repos-of-install from James' stash of misc stuff * Wed Oct 29 2008 Tim Lauridsen - mark as 1.1.18 * Mon Oct 27 2008 Seth Vidal - add rpm-warm-cache plugin * Fri Sep 19 2008 Tim Lauridsen - removed skip-broken plugin * Wed Sep 17 2008 Tim Lauridsen - mark as 1.1.17 * Mon Sep 8 2008 Seth Vidal - add yum-remove-with-leaves plugin * Wed Aug 27 2008 Tim Lauridsen - mark as 1.1.16 * Wed Aug 20 2008 James Antill - add yum-groups-manager * Thu Aug 7 2008 Tim Lauridsen - mark as 1.1.15 * Wed May 21 2008 Tim Lauridsen - add verifytree * Wed May 21 2008 Tim Lauridsen Make yum-fastestmirror %%files handle the fastestmirror-asyncore.py file * Wed May 21 2008 Tim Lauridsen - mark as 1.1.14 * Fri Apr 10 2008 James Antill - Add keys plugin * Fri Mar 31 2008 James Antill - Add yum-aliases man page * Fri Mar 21 2008 Tim Lauridsen - mark as 1.1.13 * Fri Mar 21 2008 Tim Lauridsen - mark as 1.1.12 * Tue Mar 18 2008 Shawn Starr - Add yum-utils.1 manual page - Rename yum-complete-transaction manual page to 8 - Move yum-complete-transaction to /usr/sbin * Sat Mar 1 2008 James Antill - Add verify plugin * Wed Feb 20 2008 James Antill - Add empty versionlock file * Fri Feb 1 2008 James Antill - Add filter-data plugin * Wed Jan 30 2008 Tim Lauridsen - mark as 1.1.11 * Sun Jan 13 2008 Seth Vidal - add repodiff * Thu Jan 3 2008 Tim Lauridsen - mark as 1.1.10 yum-utils-1.1.31/yumdb.py000077500000000000000000000175261162052066300152560ustar00rootroot00000000000000#!/usr/bin/python -tt import sys import optparse import fnmatch import yum import shlex parser = None def setup_opts(): version = "0.0.1" vers_txt = "Manage yum groups metadata version %s" % version usage_txt = """\ %prog ... get [pkg-wildcard]... set [pkg-wildcard]... del [pkg-wildcard]... rename [pkg-wildcard]... rename-force [pkg-wildcard]... copy [pkg-wildcard]... search ... exist? [pkg-wildcard]... unset? [pkg-wildcard]... info [pkg-wildcard]... sync [pkg-wildcard]... shell [filename]... """ parser = optparse.OptionParser(usage = usage_txt, version = vers_txt) parser.add_option("--noplugins", action="store_false", default=True, dest="plugins", help="disable yum plugin support") parser.add_option("-c", "--config", dest="conffile", help="config file location") return parser def run_cmd(yb, args, inshell=False): if False: pass elif args[0] == 'get' and len(args) > 1: args.pop(0) ykey = args.pop(0) for pkg in sorted(yb.rpmdb.returnPackages(patterns=args)): print pkg if ykey in pkg.yumdb_info: print " " * 4, ykey, '=', getattr(pkg.yumdb_info, ykey) else: print " " * 4, ykey, '' elif args[0] == 'set' and len(args) > 2: args.pop(0) ykey = args.pop(0) yval = args.pop(0) for pkg in sorted(yb.rpmdb.returnPackages(patterns=args)): setattr(pkg.yumdb_info, ykey, yval) print pkg print " " * 4, ykey, '=', getattr(pkg.yumdb_info, ykey) elif args[0] in ('copy', 'copy-f', 'copy-force') and len(args) > 2: force = args[0] in ['copy-f', 'copy-force'] args.pop(0) yokey = args.pop(0) ynkey = args.pop(0) for pkg in sorted(yb.rpmdb.returnPackages(patterns=args)): print pkg if yokey in pkg.yumdb_info: setattr(pkg.yumdb_info, ynkey, getattr(pkg.yumdb_info, yokey)) print " " * 4, ynkey, '=', getattr(pkg.yumdb_info, ynkey) elif force and ynkey in pkg.yumdb_info: delattr(pkg.yumdb_info, ynkey) print " " * 4, ynkey, '' elif ynkey in pkg.yumdb_info: print " " * 4, ynkey, '=', getattr(pkg.yumdb_info, ynkey) else: print " " * 4, ynkey, '' elif args[0] in ['rename', 'rename-f', 'rename-force'] and len(args) > 2: force = args[0] in ['rename-f', 'rename-force'] args.pop(0) yokey = args.pop(0) ynkey = args.pop(0) for pkg in sorted(yb.rpmdb.returnPackages(patterns=args)): print pkg if yokey in pkg.yumdb_info: setattr(pkg.yumdb_info, ynkey, getattr(pkg.yumdb_info, yokey)) delattr(pkg.yumdb_info, yokey) print " " * 4, ynkey, '=', getattr(pkg.yumdb_info, ynkey) elif force and ynkey in pkg.yumdb_info: delattr(pkg.yumdb_info, ynkey) print " " * 4, ynkey, '' elif ynkey in pkg.yumdb_info: print " " * 4, ynkey, '=', getattr(pkg.yumdb_info, ynkey) else: print " " * 4, ynkey, '' elif args[0] in ['del', 'delete', 'rm', 'remove'] and len(args) > 1: args.pop(0) ykey = args.pop(0) for pkg in sorted(yb.rpmdb.returnPackages(patterns=args)): if ykey in pkg.yumdb_info: delattr(pkg.yumdb_info, ykey) print pkg print " " * 4, ykey, '' elif args[0] == 'search' and len(args) > 2: args.pop(0) ykey = args.pop(0) done = False # Maybe need some API so we don't have to load everything? for pkg in sorted(yb.rpmdb.returnPackages()): if ykey not in pkg.yumdb_info: continue found = False yval = getattr(pkg.yumdb_info, ykey) for arg in args: if fnmatch.fnmatch(yval, arg): found = True break if not found: continue if done: print '' done = True print pkg print " " * 4, ykey, '=', yval elif args[0] in ['exist?', 'exist', 'exists'] and len(args) > 1: args.pop(0) ykey = args.pop(0) for pkg in sorted(yb.rpmdb.returnPackages(patterns=args)): if ykey not in pkg.yumdb_info: continue print pkg elif args[0] in ['unset?', 'unset'] and len(args) > 1: args.pop(0) ykey = args.pop(0) for pkg in sorted(yb.rpmdb.returnPackages(patterns=args)): if ykey in pkg.yumdb_info: continue print pkg elif args[0] == 'info': args.pop(0) done = False for pkg in sorted(yb.rpmdb.returnPackages(patterns=args)): if done: print '' done = True print pkg for ykey in sorted(pkg.yumdb_info): print " " * 4, ykey, '=', getattr(pkg.yumdb_info, ykey) elif args[0] in ('sync', 'synchronize', 'sync-f', 'synchronize-f', 'sync-force', 'synchronize-force'): force = args[0] in ('sync-f', 'synchronize-f', 'sync-force', 'synchronize-force') args.pop(0) done = False for pkg in sorted(yb.rpmdb.returnPackages(patterns=args)): apkg = yb.pkgSack.searchPkgTuple(pkg.pkgtup) if not apkg: continue apkg = sorted(apkg)[0] if done: print '' done = True print pkg ndata = {} ndata['releasever'] = yb.conf.yumvar['releasever'] ndata['from_repo'] = apkg.repoid csum = apkg.returnIdSum() if csum is not None: ndata['checksum_type'] = str(csum[0]) ndata['checksum_data'] = str(csum[1]) if hasattr(apkg.repo, 'repoXML'): md = apkg.repo.repoXML if md and md.revision is not None: ndata['from_repo_revision'] = str(md.revision) if md: ndata['from_repo_timestamp'] = str(md.timestamp) loginuid = yum.misc.getloginuid() if loginuid is not None: ndata['changed_by'] = str(loginuid) for ykey in ndata: if not force and hasattr(pkg.yumdb_info, ykey): continue setattr(pkg.yumdb_info, ykey, ndata[ykey]) for ykey in sorted(pkg.yumdb_info): if ykey not in ndata: continue print " " * 4, ykey, '=', getattr(pkg.yumdb_info, ykey) elif args[0] == 'shell' and not inshell: args.pop(0) if args: fos = [] for arg in args: fos.append(open(arg)) else: fos = [sys.stdin] for fo in fos: print "=" * 79 for line in fo: run_cmd(yb, shlex.split(line), inshell=True) print "-" * 79 else: print >>sys.stderr, parser.format_help() sys.exit(1) def main(): global parser parser = setup_opts() (opts, args) = parser.parse_args() yb = yum.YumBase() if opts.conffile: yb.preconf.fn = opts.conffile if not opts.plugins: yb.preconf.init_plugins = False yb.conf if len(args) < 1: print >>sys.stderr, parser.format_help() sys.exit(1) run_cmd(yb, args) if __name__ == '__main__': main() yum-utils-1.1.31/yumdownloader.py000077500000000000000000000322211162052066300170140ustar00rootroot00000000000000#!/usr/bin/python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. import sys import os import os.path sys.path.insert(0,'/usr/share/yum-cli') import yum from yum.misc import setup_locale from yum.packages import parsePackages from yum.Errors import RepoError from utils import YumUtilBase from urlparse import urljoin from urlgrabber.progress import TextMeter import shutil import rpmUtils import logging # This is to fix Bug 469 # To convert from a pkg to a source pkg, we have a problem in that all we have # is "sourcerpm", which can be a different nevra ... but just to make it fun # the epoch isn't in the name. So we use rpmUtils.miscutils.splitFilename # and ignore the arch/epoch ... and hope we get the right thing. # Eg. run: # for pkg in yb.pkgSack.returnPackages(): # if pkg.version not in pkg.sourcerpm: # print pkg, pkg.sourcerpm def _best_convert_pkg2srcpkgs(self, opts, pkg): if not opts.source or pkg.arch == 'src': return [pkg] (n,v,r,e,a) = rpmUtils.miscutils.splitFilename(pkg.sourcerpm) src = self.pkgSack.searchNevra(name=n, ver=v, rel=r, arch='src') if src == []: self.logger.error('No source RPM found for %s' % str(pkg)) return src class YumDownloader(YumUtilBase): NAME = 'yumdownloader' VERSION = '1.0' USAGE = '"yumdownloader [options] package1 [package2] [package..]' def __init__(self): YumUtilBase.__init__(self, YumDownloader.NAME, YumDownloader.VERSION, YumDownloader.USAGE) self.logger = logging.getLogger("yum.verbose.cli.yumdownloader") self.localPackages = [] # Add util commandline options to the yum-cli ones self.optparser = self.getOptionParser() self.main() def main(self): # Add command line option specific to yumdownloader self.addCmdOptions() # Parse the commandline option and setup the basics. try: opts = self.doUtilConfigSetup() except yum.Errors.RepoError, e: self.logger.error(str(e)) sys.exit(50) # Check if there is anything to do. if len(self.cmds) < 1: print self.optparser.format_help() sys.exit(0) # make yumdownloader work as non root user. if not self.setCacheDir(): self.logger.error("Error: Could not make cachedir, exiting") sys.exit(50) # Setup yum (Ts, RPM db, Repo & Sack) self.doUtilYumSetup(opts) # Setup source repos if opts.source: self.setupSourceRepos() # Do the real action self.exit_code = self.downloadPackages(opts) def setupSourceRepos(self): # enable the -source repos for enabled primary repos archlist = rpmUtils.arch.getArchList() + ['src'] # Ok, we have src and bin repos. What we want to do here is: # # 1. _enable_ source repos for which the bin repos are enabled. # 2. _disable_ the _other_ src repos. # # ...also we don't want to disable the src repos. for #1 and then # re-enable them as then we get annoying messages and call .close() on # them losing the primarydb data etc. # Get all src repos. src_repos = {} for repo in self.repos.findRepos('*-source'): src_repos[repo.id] = False # Find the enabled bin repos, and mark their respective *-source repo. # as good. for repo in self.repos.listEnabled(): if repo.id not in src_repos: srcrepo = '%s-source' % repo.id if srcrepo in src_repos: src_repos[srcrepo] = True # Toggle src repos that are set the wrong way for repo in self.repos.findRepos('*-source'): if repo.isEnabled() and not src_repos[repo.id]: repo.close() self.repos.disableRepo(repo.id) if not repo.isEnabled() and src_repos[repo.id]: self.logger.info('Enabling %s repository' % repo.id) repo.enable() # Setup the repo, without a cache repo.setup(0) try: # Setup pkgSack with 'src' in the archlist self._getSacks(archlist=archlist, thisrepo=repo.id) except yum.Errors.YumBaseError, msg: self.logger.critical(str(msg)) sys.exit(1) def downloadPackages(self,opts): toDownload = [] packages = self.cmds for pkg in packages: toActOn = [] if not pkg or pkg[0] != '@': pkgnames = [pkg] else: group_string = pkg[1:] pkgnames = set() for grp in self.comps.return_groups(group_string): if 'mandatory' in self.conf.group_package_types: pkgnames.update(grp.mandatory_packages) if 'default' in self.conf.group_package_types: pkgnames.update(grp.default_packages) if 'optional' in self.conf.group_package_types: pkgnames.update(grp.optional_packages) if self.conf.enable_group_conditionals: for condreq, cond in grp.conditional_packages.iteritems(): if self.isPackageInstalled(cond): pkgnames.add(condreq) if not pkgnames: self.logger.error('No packages for group %s' % group_string) continue pos = self.pkgSack.returnPackages(patterns=pkgnames) exactmatch, matched, unmatched = parsePackages(pos, pkgnames) installable = (exactmatch + matched) if not installable: try: installable = self.returnPackagesByDep(pkg) installable = yum.misc.unique(installable) except yum.Errors.YumBaseError, msg: self.logger.error(str(msg)) continue if not installable: # doing one at a time, apart from groups self.logger.error('No Match for argument %s' % pkg) continue for newpkg in installable: toActOn.extend(_best_convert_pkg2srcpkgs(self, opts, newpkg)) if toActOn: pkgGroups = self._groupPackages(toActOn) for group in pkgGroups: pkgs = pkgGroups[group] if opts.source: toDownload.extend(self.bestPackagesFromList(pkgs, 'src')) elif opts.archlist: for arch in opts.archlist.split(','): toDownload.extend(self.bestPackagesFromList(pkgs, arch)) else: toDownload.extend(self.bestPackagesFromList(pkgs)) # If the user supplies to --resolve flag, resolve dependencies for # all packages # note this might require root access because the headers need to be # downloaded into the cachedir (is there a way around this) if opts.resolve: self.doTsSetup() # Act as if we were to install the packages in toDownload for po in toDownload: self.tsInfo.addInstall(po) self.localPackages.append(po) # Resolve dependencies self.resolveDeps() # Add newly added packages to the toDownload list for pkg in self.tsInfo.getMembers(): if not pkg in toDownload: toDownload.append(pkg) if len(toDownload) == 0: self.logger.error('Nothing to download') sys.exit(1) exit_code = 0 for pkg in toDownload: n,a,e,v,r = pkg.pkgtup packages = self.pkgSack.searchNevra(n,e,v,r,a) packages.sort() last = None for download in packages: if download.pkgtup == last : continue last = download.pkgtup repo = self.repos.getRepo(download.repoid) remote = download.returnSimple('relativepath') if opts.urls: url = urljoin(repo.urls[0]+'/',remote) self.logger.info('%s' % url) continue local = os.path.basename(remote) if not os.path.exists(opts.destdir): os.makedirs(opts.destdir) local = os.path.join(opts.destdir, local) if (os.path.exists(local) and os.path.getsize(local) == int(download.returnSimple('packagesize'))): self.logger.error("%s already exists and appears to be complete" % local) continue # Disable cache otherwise things won't download repo.cache = 0 download.localpath = local # Hack: to set the localpath we want. try: checkfunc = (self.verifyPkg, (download, 1), {}) path = repo.getPackage(download, checkfunc=checkfunc) except IOError, e: self.logger.error("Cannot write to file %s. Error was: %s" % (local, e)) exit_code = 2 continue except RepoError, e: self.logger.error("Could not download/verify pkg %s: %s" % (download, e)) exit_code = 2 continue if not os.path.exists(local) or not os.path.samefile(path, local): progress = TextMeter() progress.start(basename=os.path.basename(local), size=os.stat(path).st_size) shutil.copy2(path, local) progress.end(progress.size) return exit_code def _groupPackages(self,pkglist): pkgGroups = {} for po in pkglist: na = '%s.%s' % (po.name,po.arch) if not na in pkgGroups: pkgGroups[na] = [po] else: pkgGroups[na].append(po) return pkgGroups # sligly modified from the one in YumUtilBase def doUtilYumSetup(self,opts): """do a default setup for all the normal/necessary yum components, really just a shorthand for testing""" try: self._getRepos(doSetup = True) # if '--source' is used the add src to the archlist if opts.source: archlist = rpmUtils.arch.getArchList() + ['src'] elif opts.archlist: archlist = [] for a in opts.archlist.split(','): archlist.extend(rpmUtils.arch.getArchList(a)) else: archlist = rpmUtils.arch.getArchList() self._getSacks(archlist=archlist) except yum.Errors.YumBaseError, msg: self.logger.critical(str(msg)) sys.exit(1) def _removeEnabledSourceRepos(self): ''' Disable all enabled *-source repos.''' for repo in self.repos.listEnabled(): if repo.id.endswith('-source'): repo.close() self.repos.disableRepo(repo.id) def addCmdOptions(self): # this if for compability with old API (utils.py from yum < 3.2.23) if hasattr(self,'getOptionGroup'): # check if the group option API is available group = self.getOptionGroup() else: group = self.optparser group.add_option("--destdir", default=".", dest="destdir", help='destination directory (defaults to current directory)') group.add_option("--urls", default=False, dest="urls", action="store_true", help='just list the urls it would download instead of downloading') group.add_option("--resolve", default=False, dest="resolve", action="store_true", help='resolve dependencies and download required packages') group.add_option("--source", default=False, dest="source", action="store_true", help='operate on source packages') group.add_option("--archlist", help="only download packages of certain architecture(s)") if __name__ == '__main__': setup_locale() util = YumDownloader() sys.exit(util.exit_code) yum-utils-1.1.31/yumutils/000077500000000000000000000000001162052066300154415ustar00rootroot00000000000000yum-utils-1.1.31/yumutils/Makefile000066400000000000000000000011101162052066300170720ustar00rootroot00000000000000PYTHON=python PACKAGE = $(shell basename `pwd`) PYFILES = $(wildcard *.py) PYVER := $(shell $(PYTHON) -c 'import sys; print "%.3s" %(sys.version)') PYSYSDIR := $(shell $(PYTHON) -c 'import sys; print sys.prefix') PYLIBDIR = $(PYSYSDIR)/lib/python$(PYVER) PKGDIR = $(PYLIBDIR)/site-packages/$(PACKAGE) all: echo "Nothing to do" clean: rm -f *.pyc *.pyo *~ install: mkdir -p $(DESTDIR)/$(PKGDIR) for p in $(PYFILES) ; do \ install -m 755 $$p $(DESTDIR)/$(PKGDIR)/$$p; \ done $(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)/$(PKGDIR)', 1, '$(PYDIR)', 1)" yum-utils-1.1.31/yumutils/__init__.py000066400000000000000000000014511162052066300175530ustar00rootroot00000000000000#!/usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. """ The yumutils pythom module for common code used by utils and plugins """ yum-utils-1.1.31/yumutils/i18n.py000066400000000000000000000027531162052066300166010ustar00rootroot00000000000000#!/usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. """ The yumutils.i18n pythom module for i18n code used by utils and plugins """ # flag to disable i18n, set it to false to enable dummy wrappers. _use_i18n = True def dummy_wrapper(str): ''' Dummy Translation wrapper, just returning the same string. ''' return str def dummyP_wrapper(str1, str2, n): ''' Dummy Plural Translation wrapper, just returning the singular or plural string. ''' if n == 1: return str1 else: return str2 if _use_i18n: try: from kitchen.i18n import easy_gettext_setup # setup the translation wrappers _, P_ = easy_gettext_setup('yum-utils') except: _ = dummy_wrapper P_ = dummyP_wrapper else: _ = dummy_wrapper P_ = dummyP_wrapper