[yum-commits] Branch 'yum-3_2_X' - 15 commits - ChangeLog cli.py docs/yum.8 docs/yum.conf.5 Makefile output.py test/release.sh yumcommands.py yum/config.py yum/__init__.py yum/rpmsack.py yum.spec

James Antill james at osuosl.org
Fri Apr 15 18:20:59 UTC 2011


 ChangeLog       |  637 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 Makefile        |    5 
 cli.py          |   20 +
 docs/yum.8      |    3 
 docs/yum.conf.5 |   20 +
 output.py       |   41 +++
 test/release.sh |  158 +++++++++++++
 yum.spec        |    5 
 yum/__init__.py |   20 +
 yum/config.py   |    7 
 yum/rpmsack.py  |   70 ++++--
 yumcommands.py  |   17 +
 12 files changed, 961 insertions(+), 42 deletions(-)

New commits:
commit 5ec90ff7dced37026314e142fbb52d2317af9390
Author: James Antill <james at and.org>
Date:   Fri Apr 15 14:17:37 2011 -0400

    Update changelog

diff --git a/ChangeLog b/ChangeLog
index 32aa340..b92e394 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,627 @@
+2011-04-14  James Antill <james at and.org>
+
+	* docs/yum.8, docs/yum.conf.5, output.py, yum/config.py:  Add history_list_view, and change default to single-user-commands.
+	 BZ 692780.   users            = display users (old behaviour).
+	 commands         = display cmdline.  single-user-cmds = display
+	 cmdline if only a single user, and >= 50% of
+	 entries have a cmd line  ...also adds documentation to yum.conf and
+	 yum.
+
+2011-04-14  James Antill <james at and.org>
+
+	* Makefile: Add "ChangeLog" as a symonym to changelog.
+
+2011-04-14  James Antill <james at and.org>
+
+	* test/release.sh: Add "make check" to release.sh.
+
+2011-04-14  James Antill <james at and.org>
+
+	* Makefile: Fixup 'make archive', so it doesn't include random files
+	in my dir.
+
+2011-04-14  James Antill <james at and.org>
+
+	* test/release.sh, yum.spec, yum/__init__.py: Final update before
+	release, change version etc.
+
+2011-04-14  James Antill <james at and.org>
+
+	* yumcommands.py: Don't spam usage info. for missing arguments, as
+	we don't for bad commands.
+
+2011-04-14  James Antill <james at and.org>
+
+	* cli.py: Fix output for: grouplist abcd
+
+2011-04-14  James Antill <james at and.org>
+
+	* yum/rpmsack.py: umask 0777 is "empty", use umask 0 for "full".
+
+2011-04-14  James Antill <james at and.org>
+
+	* cli.py: Work around Panu's change for a single TS, breaks for
+	reinstalls.
+
+2011-04-14  James Antill <james at and.org>
+
+	* yum/rpmsack.py: Fix dropCachedDataPostTransaction() for reinstall
+	packages. BZ 696720.
+
+2011-04-14  James Antill <james at and.org>
+
+	* test/release.sh: Add release testing script.
+
+2011-04-13  James Antill <james at and.org>
+
+	* yum/rpmsack.py: Work around umask/permission problems, for yumdb
+	and rpmdb-index data.
+
+2011-04-11  James Antill <james at and.org>
+
+	* docs/yum.conf.5: Document basename checking of ssl cert. files. BZ
+	695427.
+
+2011-04-11  James Antill <james at and.org>
+
+	* yum/__init__.py: Do basename checking of ssl cert. files. BZ
+	695427.
+
+2011-04-12  Ville Skyttä <ville.skytta at iki.fi>
+
+	* etc/yum.bash: Use += to append to arrays and strings.
+
+2011-04-08  James Antill <james at and.org>
+
+	Merge branch 'yum-3_2_X' of
+	ssh://yum.baseurl.org/srv/projects/yum/git/yum into yum-3_2_X  *
+	'yum-3_2_X' of ssh://yum.baseurl.org/srv/projects/yum/git/yum:
+	Avoid unneeded file/dir/ghost list lookups and list concat when
+	dumping deps as XML.   Avoid unneeded returnFileEntries() and list
+	concat for provides_for file deps.   Fix _dump_requires() docstring.
+	Revert "Allow plugins to signal exit status, bump plugin API version
+	to 2.7."   Allow plugins to signal exit status, bump plugin API
+	version to 2.7.   Fix bugs in the skip-broken code, this should fix
+	some of the weird cases where skip-broken fails today
+
+2011-04-07  James Antill <james at and.org>
+
+	* cli.py:  Make -- work with firstParse, without breaking other options. BZ
+	 694394.
+
+2011-04-07  Ville Skyttä <ville.skytta at iki.fi>
+
+	* yum/packages.py: Avoid unneeded file/dir/ghost list lookups and
+	list concat when dumping deps as XML.
+
+2011-04-07  Ville Skyttä <ville.skytta at iki.fi>
+
+	* yum/packages.py: Avoid unneeded returnFileEntries() and list
+	concat for provides_for file deps.
+
+2011-04-07  Ville Skyttä <ville.skytta at iki.fi>
+
+	* yum/packages.py: Fix _dump_requires() docstring.
+
+2011-04-07  Ville Skyttä <ville.skytta at iki.fi>
+
+	* yum/plugins.py, yummain.py: Revert "Allow plugins to signal exit
+	status, bump plugin API version to 2.7."  This reverts commit
+	d14bdfe42073859f4c28476e4394e466047c3bfb.  (Accidentally pushed from
+	wrong local branch, oops.)
+
+2010-11-05  Ville Skyttä <ville.skytta at iki.fi>
+
+	* yum/plugins.py, yummain.py: Allow plugins to signal exit status,
+	bump plugin API version to 2.7.  Useful for example for
+	downloadonly, BZ 531323.
+
+2011-03-31  Tim Lauridsen <timlau at fedoraproject.org>
+
+	* test/skipbroken-tests.py, yum/__init__.py, yum/depsolve.py: Fix
+	bugs in the skip-broken code, this should fix some of the weird
+	cases where skip-broken fails today
+
+2011-04-01  James Antill <james at and.org>
+
+	* cli.py: Make -- work with firstParse. Eg. "install -- emacs
+	-emacs"
+
+2011-04-01  James Antill <james at and.org>
+
+	* cli.py: Don't display the 'Ignore option' warning with --version.
+	BZ 692866.
+
+2011-03-30  James Antill <james at and.org>
+
+	* test/simpleupdatetests.py, test/testbase.py, yum/packageSack.py: 
+	Add tests for update-to/upgrade-to, and fix generic code so tests
+	work.
+
+2011-03-30  James Antill <james at and.org>
+
+	* docs/yum.8: Add docs for update-to/upgrade-to, and explain
+	update/upgrade behaviour.
+
+2011-03-30  James Antill <james at and.org>
+
+	* cli.py, yum/__init__.py, yumcommands.py: Add update-to and
+	upgrade-to commands, as "hidden" alias for update/upgrade.
+
+2011-03-29  Ville Skyttä <ville.skytta at iki.fi>
+
+	* etc/yum.bash: Avoid some "yum list" invocations on strings
+	starting with ~.
+
+2011-03-29  Ville Skyttä <ville.skytta at iki.fi>
+
+	* etc/yum.bash: Trivial cleanups.
+
+2011-03-29  Ville Skyttä <ville.skytta at iki.fi>
+
+	* etc/yum.bash: Add distro-sync full|different completion.
+
+2011-03-29  James Antill <james at and.org>
+
+	* yum/__init__.py: Tweak "group X has no pkgs." warning, try to deal
+	with cond. pkgs. BZ 655281
+
+2011-03-25  James Antill <james at and.org>
+
+	* docs/yum.8: Add "distro-sync full", docs.
+
+2011-03-25  James Antill <james at and.org>
+
+	* cli.py: Add "distro-sync full", which will reinstall packages due
+	to checksums.
+
+2011-03-25  James Antill <james at and.org>
+
+	* yummain.py: Add Errors to front of YumBaseError, too many
+	spellings of the same thing :(
+
+2011-03-15  James Antill <james at and.org>
+
+	* docs/yum.8, output.py: Add sorts to deplist output, and add docs.
+
+
+2011-03-15  James Antill <james at and.org>
+
+	* output.py: Sort the pkgs. in depListOutput, also only print the
+	latest unless -v.
+
+2011-03-15  James Antill <james at and.org>
+
+	* cli.py: Use --showduplicates in deplist, don't reoutput pkgs. each
+	time around loop.
+
+2011-03-14  James Antill <james at and.org>
+
+	Merge branch 'yum-3_2_X' of
+	ssh://yum.baseurl.org/srv/projects/yum/git/yum into yum-3_2_X  *
+	'yum-3_2_X' of ssh://yum.baseurl.org/srv/projects/yum/git/yum:   add
+	'available' to yum help list output thx to Robert Day for pointing
+	this out.
+
+2011-03-14  James Antill <james at and.org>
+
+	* output.py: Add saved_tx to default_addons, for history info
+	output.
+
+2011-03-11  James Antill <james at and.org>
+
+	* yummain.py: Commit warn_checks change.
+
+2011-03-11  Seth Vidal <skvidal at fedoraproject.org>
+
+	* yumcommands.py: add 'available' to yum help list output thx to
+	Robert Day for pointing this out.
+
+2011-03-10  James Antill <james at and.org>
+
+	* yum/__init__.py: Don't update-install same version diff. arch
+	local pkgs.
+
+2011-03-10  James Antill <james at and.org>
+
+	* cli.py: Fix RHEL-5 yum-utils/yumdownloader, when using 3.2.29+.
+
+2011-03-10  James Antill <james at and.org>
+
+	* yum/config.py: Deal with yumvar interpreted values, like baseurl.
+
+
+2011-03-09  James Antill <james at and.org>
+
+	* yummain.py: Catch PackageSackError from warn checks, BZ 634595.
+
+2011-03-07  James Antill <james at and.org>
+
+	* docs/yum.8: Document --installroot a bit more, let people know
+	about --releasever=/.
+
+2011-03-05  Tim Lauridsen <timlau at fedoraproject.org>
+
+	* test/skipbroken-tests.py, yum/depsolve.py: Add a unit test to make
+	skip-broken go into endless loop when an installed package conflict
+	with an update. Fix the cause by in depsolve by putting the
+	conflicting po into the problem tuple, so skip-broken knows what to
+	remove from the transaction. Also show the full package in the
+	conflict message and not just the name.
+
+2011-02-25  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* cli.py: Enable the new callback mode for yum itself  API users
+	should be converted one-by-one to the new mode...
+
+2011-02-25  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* yum/depsolve.py, yum/rpmtrans.py: Add a new opt-in callback mode
+	where only txmbr is used as the key  We really only want the txmbr
+	in the key, everything else can be reached through it. This avoids
+	copying any data around as txmbrs reside in memory anyway, so the
+	key is just a cheap reference to what we already have. With the new
+	key -> txmbr helper in the callback, this is truly trivial to handle
+	there. The new mode makes life in the callback somewhat easier and
+	saves gobs of memory.
+
+2011-02-25  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* yum/rpmtrans.py: Unify callback key guessworks into helper
+	function  Add an internal helper method to deal with the changing
+	key type, and locate the associated txmbr object when possible. We
+	can't find it on erasures, but we always have a name so return
+	(name, txmbr) tuples to simplify life for callers.
+
+2011-02-25  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* yum/rpmtrans.py: Eliminate linear search for package names in
+	callback  We only care if the name has been seen so a set works for
+	the purpose just as well and is faster.
+
+2011-02-24  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* yum/rpmtrans.py: Remove unnecessary "magic number" test
+	RPMCALLBACK_TRANS_START is only issued once. That "bytes" happens to
+	be a magic value of 6 is just an artifact of truly ancient rpm
+	versions from last century issuing RPMCALLBACK_TRANS_START more than
+	once.
+
+2011-02-24  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* yum/rpmtrans.py: Simplify callback file open/close  There's never
+	more than one active file descriptor at a time so no need to collect
+	them to a dict, remove now unneeded _makeHandle(). Also use a python
+	file object and return its .fileno() instead of the lowlevel
+	os-routines.
+
+2011-02-24  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* yum/depsolve.py: Revert "Don't keep full headers in memory during
+	transaction"  This reverts commit
+	3302369486dc07edc2428c616ed2b8843562f615. The callback key isn't as
+	contained within the callback classes as I'd hoped, various places
+	are testing isinstance(h, rpm.hdr) etc. Since changing the callback
+	style is an incompatible change, it needs to be an opt-in feature
+	enabled by callers who are ready for it. And since its going to be
+	incompatible, we can do better than copy data around.
+
+2011-02-21  James Antill <james at and.org>
+
+	* yum/__init__.py: Allow only some GPG keys to be installed. BZ
+	606644.
+
+2011-02-21  James Antill <james at and.org>
+
+	* yum/__init__.py: The kernel packages are special, so skip normal
+	processing. BZ 678969
+
+2011-02-21  Ricky Zhou <ricky at fedoraproject.org>
+
+	* yum/packages.py: Remove undefined variable (done in
+	_RPMVerifyPackageFile). BZ 671198.
+
+2011-02-21  James Antill <james at and.org>
+
+	* yum/packages.py, yum/rpmsack.py: Don't preload
+	summary/desc/url/source, also _needed_ for pkgtup only pkgs.
+
+2011-02-21  James Antill <james at and.org>
+
+	* yum/rpmsack.py: Don't cache the hdr, it's just not measurable
+	speed wise and they are BIG.
+
+2011-02-21  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* cli.py, rpmUtils/transaction.py, yum/__init__.py: Move
+	yum-specific ts.check() wrapper back to YumBase private function
+	This essentially reverts commit
+	c54c9082d702b6ba45620ecf3ca5834b9b104543 which inapproppriately
+	dragged yum imports into rpmUtils space, causing recursive imports
+	and breakage for other users.
+
+2011-02-18  James Antill <james at and.org>
+
+	* yumcommands.py: Pass any check-update arguments to "list
+	obsoletes".
+
+2011-02-18  James Antill <james at and.org>
+
+	* yum/misc.py: Workaround stupid len() assert in 32bit python.
+
+2011-02-18  James Antill <james at and.org>
+
+	* yum/__init__.py: Add workaround for rhnplugin repos. setup, BZ
+	678043.
+
+2011-02-15  James Antill <james at and.org>
+
+	* yum/__init__.py:  Fix printing the obsoleters message, BZ 677666.   Happened due to
+	 the cleanup in 94d742bf395cc565cf3a0dca138608a9296b1303 giving us a
+	 bad "continue".
+
+2011-02-17  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* yum/rpmsack.py: Avoid unwanted header loads from
+	RPMInstalledPackage() __getattr__()  At least hasattr() calls for
+	_cache_prco_names_* and _prco_lookup were causing headers to be
+	loaded when not wanted at all, causing headers for all to-be updated
+	packages to be kept in memory throughout the entire transaction.
+
+2011-02-17  Seth Vidal <skvidal at fedoraproject.org>
+
+	* yum/parser.py: steps around
+	https://bugzilla.redhat.com/show_bug.cgi?id=678301  in general
+	though if we have a corrupted .repo file we error out and report it.
+
+
+2011-02-17  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* yum/depsolve.py: Don't keep full headers in memory during
+	transaction  The open/close file callbacks only need NEVRA
+	information in the "key". Copy the necessary bits into a regular
+	dict and pass that instead of the entire header, the callback wont
+	even know the difference as the header behaves like a dict. Saves
+	(tens of) megabytes of memory on large transactions.
+
+2011-02-16  Seth Vidal <skvidal at fedoraproject.org>
+
+	* cli.py: add rpmdb_only= option to _checkMaybeYouMeant() so we can
+	make sure remove foo doesn't suck down the repodata when it doesn't
+	need to
+
+2011-02-15  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* yumcommands.py: Unbreak checkGPGKey()  repo.gpgkey is a list, not
+	a string, since at least 2005
+
+2011-02-15  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* yum/rpmsack.py: Use _get_packages() instead of ts.dbMatch() in
+	rpmsack where possible  Deal with gpg-pubkey filtering and
+	auto_close centrally, eliminating the possibility of accidentally
+	leaving zombie rpmdb iterators behind and also reducing code
+	duplication.
+
+2011-02-15  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* yum/rpmsack.py: Eliminate long dead _header_from_index() internal
+	helper
+
+2011-02-15  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* yum/rpmsack.py: Generalize rpmsack _all_packages() helper to
+	accept dbMatch arguments  Rename to _get_packages() and accept
+	arguments to be passed to dbMatch(), adjust callers.
+
+2011-02-15  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* rpmUtils/transaction.py: Support additional match patterns in a
+	single call to ts.dbMatch()  Rpm-level dbmatch iterator requires
+	additional mi.pattern() calls for specifying extra match patterns.
+	Hide this behind the ts wrapper, dbMatch() now optionally takes
+	extra patterns as list of (tag, type, pattern) tuples.
+
+2011-02-14  Seth Vidal <skvidal at fedoraproject.org>
+
+	* yum/__init__.py: name it 'saved_tx' so james doesn't misread it
+	like an old man.
+
+2011-02-14  Seth Vidal <skvidal at fedoraproject.org>
+
+	* yum/__init__.py: store our yum saved transaction file content to
+	the the history addon data for this transaction.
+
+2011-02-10  James Antill <james at and.org>
+
+	* yum/update_md.py: Fix recursion problem, with safe_iterparse.
+
+2011-02-10  James Antill <james at and.org>
+
+	* yum/update_md.py: Fix identifier typo.
+
+2011-02-10  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* cli.py: Use the same transaction set all the way through  Saves
+	another round of re-populating transactions, bringing it down to
+	just one. Also move ordering earlier so we can drop unused memory
+	before the test-transaction already.
+
+2011-02-10  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* cli.py: Tell rpm to release memory it wont need for the
+	transaction  Calling ts.clean() releases memory used by dependency
+	checks and ordering. Depending on the transaction size, this can be
+	tens of megs. And yes its dumb that callers need to bother with such
+	issues...
+
+2011-02-09  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* rpmUtils/transaction.py: Save and restore original transaction
+	flags in wrapper test() method  ...and here lies the key to the
+	mystery of yum needing to repopulate the transaction after a
+	test-run, doh :)
+
+2011-02-09  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* rpmUtils/transaction.py, yum/rpmtrans.py: Make transaction
+	scriptFd setting less voodooish  In older rpm versions ts.scriptFd
+	is an invisible write-only pseudo-attribute hack, so __getattr__()
+	tricks in the transaction wrapper wont work for it. Add a new
+	wrapper method for setting it to make it less gruesome, accept any
+	file-like object as the fd argument.
+
+2011-02-09  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* rpmUtils/transaction.py: Remove cruft from transaction wrapper
+	With newer rpm versions these would just raise AttributeErrors, in
+	older versions they are broken to various degrees and yum never used
+	them for anything anyway.
+
+2011-02-09  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* cli.py, yum/__init__.py, yum/config.py, yummain.py: Make
+	ts.check() unconditional + adjust related messages  ts.check() is
+	not really an optional call, as there are dependencies which yum
+	does not check for (notably rpmlib() dependencies). Always call
+	ts.check(), looking at the return values.
+
+2011-02-09  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* cli.py, rpmUtils/transaction.py, yum/__init__.py: Move
+	_run_rpm_check_debug() functionality to the ts wrapper check()
+	Nothing in yum cares for the dependency-tuples-of-doom that the
+	rpm-level ts.check() returns, having this in transaction wrapper
+	check() method seems like a more sensible place than in yum base
+	class with a funny name
+
+2011-02-09  Panu Matilainen <pmatilai at laiskiainen.org>
+
+	* cli.py, yum/__init__.py: Eliminate an unnecessary round of
+	transaction re-population  Initialize + populate the transaction set
+	to be used for the test-run before calling rpm_check_debug to let
+	them use the same set, avoiding one round of the fairly expensive
+	re-population of the entire transaction.
+
+2011-02-04  James Antill <james at and.org>
+
+	* yum/update_md.py: Hide invalid XML errors for updateinfo, BZ
+	663378
+
+2011-01-29  James Antill <james at and.org>
+
+	* output.py: Show from_repo in history output, if available.
+
+2011-02-03  Seth Vidal <skvidal at fedoraproject.org>
+
+	* yum/packages.py: make sure we write out the sourcerpm tag even if
+	it is empty b/c yum 2.4.X and OLD y-m-p freak out otherwise
+	createrepo ticket # 12
+
+2011-01-26  James Antill <james at and.org>
+
+	* docs/yum.conf.5: Make the documentation for color in yum.conf
+	slightly better.
+
+2011-01-25  Ville Skyttä <ville.skytta at iki.fi>
+
+	* etc/yum.bash: Add history repeat completion.
+
+2011-01-25  Seth Vidal <skvidal at fedoraproject.org>
+
+	Merge branch 'yum-3_2_X' of
+	ssh://yum.baseurl.org/srv/projects/yum/git/yum into yum-3_2_X  *
+	'yum-3_2_X' of ssh://yum.baseurl.org/srv/projects/yum/git/yum:
+	Fully drop the rpmdb cache if the transaction failed, or was a test.
+	Update docs about history packages-list.   Show error message when
+	pkgs-list is given packages, but doesn't match.
+
+2011-01-25  James Antill <james at and.org>
+
+	* yum/__init__.py: Fully drop the rpmdb cache if the transaction
+	failed, or was a test.
+
+2011-01-24  James Antill <james at and.org>
+
+	* docs/yum.8: Update docs about history packages-list.
+
+2011-01-24  James Antill <james at and.org>
+
+	* output.py: Show error message when pkgs-list is given packages,
+	but doesn't match.
+
+2011-01-25  Seth Vidal <skvidal at fedoraproject.org>
+
+	* yum/__init__.py: setup the _repos_persistdir in _getConfig b/c of
+	how local repos are setup by repoquery and other tools. fixes rh
+	bug: 672588
+
+2011-01-22  Seth Vidal <skvidal at fedoraproject.org>
+
+	* yum/__init__.py: when we import CA keys - write out the keyid of
+	the ones the user has agreed to  then if we have the same ca key for
+	multiple repos we don't constantly reprompt the user
+
+2011-01-21  James Antill <james at and.org>
+
+	* yumcommands.py: Show the "first" baseurl in repolist -v (and the
+	number of other urls).
+
+2011-01-19  James Antill <james at and.org>
+
+	* yum/__init__.py: Don't traceback if we haven't setup the ts save
+	file (anaconda). BZ 670784.
+
+2011-01-16  Ville Skyttä <ville.skytta at iki.fi>
+
+	* etc/yum.bash: Update conditional use of upstream bash-completion
+	stuff to newer version.
+
+2011-01-14  Tim Lauridsen <timlau at fedoraproject.org>
+
+	* test/skipbroken-tests.py: fix skipbroken test (Sorry Seth)
+
+2011-01-14  James Antill <james at and.org>
+
+	* yum/__init__.py: Don't try to lock as a normal user, if we are
+	using root's cachedir.
+
+2011-01-14  James Antill <james at and.org>
+
+	* yum/__init__.py: Specify errno.EPERM instead of just using "1".
+	Make the pid an int.
+
+2011-01-14  James Antill <james at and.org>
+
+	* yummain.py: If we _can't_ create the lock file, don't keep trying.
+
+
+2011-01-13  Seth Vidal <skvidal at fedoraproject.org>
+
+	Merge branch 'yum-3_2_X' of
+	ssh://yum.baseurl.org/srv/projects/yum/git/yum into yum-3_2_X  *
+	'yum-3_2_X' of ssh://yum.baseurl.org/srv/projects/yum/git/yum:   Add
+	SKIPBROKEN prefix to problem depsolve debug output show we can grep
+	"SKIPBROKEN" to filter the yum debug output to see what problems
+	skip-broken tries to resolve. I removed the _(), translation of
+	debug messages is not needed (my mistake :) )
+
+2011-01-13  Seth Vidal <skvidal at fedoraproject.org>
+
+	* yum.spec: config(noreplace) on the .yum files so you can modify
+	them at your leisure
+
+2011-01-12  Tim Lauridsen <timlau at fedoraproject.org>
+
+	* yum/depsolve.py: Add SKIPBROKEN prefix to problem depsolve debug
+	output show we can grep "SKIPBROKEN" to filter the yum debug output
+	to see what problems skip-broken tries to resolve. I removed the
+	_(), translation of debug messages is not needed (my mistake :) )
+
+2011-01-13  Seth Vidal <skvidal at fedoraproject.org>
+
+	* ChangeLog: changelog update
+
 2011-01-13  Seth Vidal <skvidal at fedoraproject.org>
 
 	* yum.spec: fix plugin name to be correct
@@ -14712,16 +15336,5 @@
 
 2007-05-16  Seth Vidal <skvidal at linux.duke.edu>
 
-	* yum.spec, yum/__init__.py: mark as 3.2.0
-
-2007-05-16  Seth Vidal <skvidal at linux.duke.edu>
-
-	* fix from Christoph Thiel and Jan Matejek "The problem is that when
-	precompiling python files, the compiler needs to know their "base
-	path" which will be used in debug outputs (such as the backtrace).
-	Without this patch, makefile sets $(PYDIR) as the base path, but
-	$(PYDIR) isn't defined and the base path stays empty. (some of our
-	python builds apparently can't deal with it and use PIL's base path
-	instead) The patch replaces $(PYDIR) with correct value, $(PKGDIR)."
-
+	* mark as 3.2.0
 
commit ab4d2c5a52c571928313eb8ffeafed17b4101260
Author: James Antill <james at and.org>
Date:   Thu Apr 14 14:02:05 2011 -0400

     Add history_list_view, and change default to single-user-commands. BZ 692780.
    
     users            = display users (old behaviour).
     commands         = display cmdline.
     single-user-cmds = display cmdline if only a single user, and >= 50% of
                        entries have a cmd line
    
    ...also adds documentation to yum.conf and yum.

diff --git a/docs/yum.8 b/docs/yum.8
index 39c7253..522f15f 100644
--- a/docs/yum.8
+++ b/docs/yum.8
@@ -345,6 +345,9 @@ an offset from the last transaction (Eg. if you've done 250 transactions,
 The addon-info command takes a transaction ID, and the packages-list command
 takes a package (with wildcards).
 
+In "history list" you can change the behaviour of the 2nd column via. the
+configuration option history_list_view.
+
 In "history list" output the Altered column also gives some extra information
 if there was something not good with the transaction (this is also shown at the
 end of the package column in the packages-list command).
diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
index 2e0d6ea..e6037c2 100644
--- a/docs/yum.conf.5
+++ b/docs/yum.conf.5
@@ -357,6 +357,19 @@ normally be necessary to add packages here. Not that this is also used for the
 packages to look for in \-\-version. Defaults to rpm, yum, yum-metadata-parser.
 
 .IP
+\fBhistory_list_view \fR
+Which column of information to display in the "yum history list" command. There
+are currently three options: users, cmds (or commands), auto.
+
+Older versions of yum acted like "users", which always outputs the user who
+initiated the yum transaction. You can now specify "commands" which will instead
+always output the command line of the transaction. You can also specify
+"single-user-commands" which will display the users if there are more than one,
+otherwise it will display the command line.
+
+You can also specify "default" which currently selects "single-user-commands".
+
+.IP
 \fBcommands\fR
 List of functional commands to run if no functional commands are specified
 on the command line (eg. "update foo bar baz quux").  None of the short options
diff --git a/output.py b/output.py
index 85b21f8..cf541f8 100755
--- a/output.py
+++ b/output.py
@@ -1441,24 +1441,53 @@ to exit.
         if tids is None:
             return 1, ['Failed history list']
 
+        limit = 20
+        if printall:
+            limit = None
+
+        old_tids = self.history.old(tids, limit=limit)
+        done = 0
+        if self.conf.history_list_view == 'users':
+            uids = [1,2]
+        elif self.conf.history_list_view == 'commands':
+            uids = [1]
+        else:
+            assert self.conf.history_list_view == 'single-user-commands'
+            uids = set()
+            blanks = 0
+            for old in old_tids:
+                if not printall and done >= limit:
+                    break
+
+                done += 1
+                if old.cmdline is None:
+                    blanks += 1
+                uids.add(old.loginuid)
+            if len(uids) == 1 and blanks > (done / 2):
+                uids.add('blah')
+
         fmt = "%s | %s | %s | %s | %s"
+        if len(uids) == 1:
+            name = _("Command line")
+        else:
+            name = _("Login user")
         print fmt % (utf8_width_fill(_("ID"), 6, 6),
-                     utf8_width_fill(_("Login user"), 24, 24),
+                     utf8_width_fill(name, 24, 24),
                      utf8_width_fill(_("Date and time"), 16, 16),
                      utf8_width_fill(_("Action(s)"), 14, 14),
                      utf8_width_fill(_("Altered"), 7, 7))
         print "-" * 79
         fmt = "%6u | %s | %-16.16s | %s | %4u"
         done = 0
-        limit = 20
-        if printall:
-            limit = None
-        for old in self.history.old(tids, limit=limit):
+        for old in old_tids:
             if not printall and done >= limit:
                 break
 
             done += 1
-            name = self._pwd_ui_username(old.loginuid, 24)
+            if len(uids) == 1:
+                name = old.cmdline or ''
+            else:
+                name = self._pwd_ui_username(old.loginuid, 24)
             tm = time.strftime("%Y-%m-%d %H:%M",
                                time.localtime(old.beg_timestamp))
             num, uiacts = self._history_uiactions(old.trans_data)
diff --git a/yum/config.py b/yum/config.py
index 8c966f8..d09511f 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -746,6 +746,13 @@ class YumConf(StartupConf):
     loadts_ignorerpm = BoolOption(False)
     
     clean_requirements_on_remove = BoolOption(False)
+
+
+    history_list_view = SelectionOption('single-user-commands',
+                                        ('single-user-commands', 'users',
+                                         'commands'),
+                                     mapper={'cmds'          : 'commands',
+                                             'default' :'single-user-commands'})
     _reposlist = []
 
     def dump(self):
commit 6a1f68efb85e9f77943fb5b83e90b6d35d9a66ec
Author: James Antill <james at and.org>
Date:   Thu Apr 14 16:49:40 2011 -0400

    Add "ChangeLog" as a symonym to changelog.

diff --git a/Makefile b/Makefile
index b9ecbcc..740b616 100644
--- a/Makefile
+++ b/Makefile
@@ -77,8 +77,9 @@ pylint:
 pylint-short:
 	@pylint -r n --rcfile=test/yum-pylintrc --ignore=$(PYLINT_IGNORE) $(PYLINT_MODULES) 2>/dev/null
 
+ChangeLog: changelog
 changelog:
-	git log --since=2007-05-16 --pretty --numstat --summary | git2cl  > ChangeLog
+	git log --since=2007-05-16 --pretty --numstat --summary | git2cl | cat > ChangeLog
 
 testnewbehavior:
 	@NEW_BEHAVIOR=1 nosetests -i ".*test" test
commit 0ef0b467b149e91cb441b60901a3e68ee75b220a
Author: James Antill <james at and.org>
Date:   Thu Apr 14 16:49:13 2011 -0400

    Add "make check" to release.sh.

diff --git a/test/release.sh b/test/release.sh
index 15daf6c..4a2d130 100755
--- a/test/release.sh
+++ b/test/release.sh
@@ -109,6 +109,16 @@ utst yum resolvedep /usr/bin/zzcat
 stst yum deplist yum
 utst yum deplist zzuf
 
+echo
+echo
+python -c 'print "*" * 79'
+echo "Running 'make check', this should work but meh:"
+python -c 'print "*" * 79'
+make check
+echo
+echo
+
+sleep 8
 
 echo
 echo
commit 5c1b4a0b4f63d41bd357156216e29a75187607ab
Author: James Antill <james at and.org>
Date:   Thu Apr 14 16:29:06 2011 -0400

    Fixup 'make archive', so it doesn't include random files in my dir.

diff --git a/Makefile b/Makefile
index 20f5629..b9ecbcc 100644
--- a/Makefile
+++ b/Makefile
@@ -92,7 +92,7 @@ daily: _archive
 _archive:
 	@rm -rf ${PKGNAME}-%{VERSION}.tar.gz
 	@rm -rf /tmp/${PKGNAME}-$(VERSION) /tmp/${PKGNAME}
-	@dir=$$PWD; cd /tmp; cp -a $$dir ${PKGNAME}
+	@dir=$$PWD; cd /tmp; git clone $$dir ${PKGNAME}
 	lynx -dump 'http://yum.baseurl.org/wiki/WritingYumPlugins?format=txt' > /tmp/${PKGNAME}/PLUGINS
 	lynx -dump 'http://yum.baseurl.org/wiki/Faq?format=txt' > /tmp/${PKGNAME}/FAQ
 	@rm -f /tmp/${PKGNAME}/$(remove_spec)
commit 17e89b6c9ce3d8ca02dc2ac266e65fe5337206dd
Author: James Antill <james at and.org>
Date:   Thu Apr 14 16:07:09 2011 -0400

    Final update before release, change version etc.

diff --git a/test/release.sh b/test/release.sh
index 8a22494..15daf6c 100755
--- a/test/release.sh
+++ b/test/release.sh
@@ -17,7 +17,7 @@ function ebanner
 function utst
 {
    bbanner "Testing (user):" $@
-   $@
+   "$@"
    ebanner "Does that look fine? For (user):" $@
    sleep 8
 }
@@ -25,7 +25,7 @@ function utst
 function stst
 {
    bbanner "Testing (root):" $@
-   sudo $@
+   sudo "$@"
    ebanner "Does that look fine? For (root):" $@
    sleep 8
 }
@@ -34,36 +34,52 @@ stst yum version nogroups
 utst yum version nogroups
 stst yum history list
 stst yum history new
+stst yum history new
 
 utst yum list zzuf
 
+stst yum version nogroups
 stst yum install zzuf
+stst yum version nogroups
 stst yum reinstall zzuf
+stst yum version nogroups
 stst yum remove zzuf
-stst yum install yourmom
+stst yum version nogroups
+stst yum install yourmom || true
 stst yum install -y zzuf | tee /tmp/yum-release-testing-install-y-zzuf
 stst cat /tmp/yum-release-testing-install-y-zzuf
+stst yum version nogroups
 stst yum remove -y zzuf | tee /tmp/yum-release-testing-remove-y-zzuf
 stst cat /tmp/yum-release-testing-remove-y-zzuf
+stst yum version nogroups
 
 stst yum history list
 
-stst yum localinstall
-stst yum localinstall yourmom
+stst yum localinstall || true
+stst yum localinstall yourmom  || true
 
 stst yum list updates
 stst yum list obsoletes
 stst yum list available
 stst yum list installed
-stst yum check-update
-# stst yum update
+stst yum check-update || true
+
+echo | stst yum update || true
 
 stst yum groupinstall 'News Server'
 stst yum groupremove 'News Server'
+stst yum groupinstall -y 'News Server'
+stst yum groupremove --setopt=clean_requirements_on_remove=true -y 'News Server'
+# News server has a bunch of deps.
+stst yum groupinstall -y 'News Server'
+
+stst yum history undo last-4 -y
+
+stst yum history list
 
 utst yum grouplist
 utst yum grouplist not_a_group
-utst yum groupinfo
+utst yum groupinfo || true
 utst yum groupinfo not_a_group
 
 stst yum info zzuf
@@ -74,14 +90,11 @@ utst yum makecache
 stst yum clean all
 utst yum clean all
 
-stst yum -d0 -e0 install
+stst yum -d0 -e0 install || true
 
 utst yum --version
 
-
-stst yum search
-utst yum search
-
+utst yum search || true
 
 stst yum provides zzuf
 stst yum provides /usr/bin/zzuf
@@ -97,30 +110,39 @@ stst yum deplist yum
 utst yum deplist zzuf
 
 
+echo
+echo
 python -c 'print "=" * 79'
 python -c 'print "*" * 79'
-echo "Done, good to do a release."
+echo "Done, good to do a release. Running git2cl:"
+make changelog || true
 python -c 'print "*" * 79'
 python -c 'print "=" * 79'
 echo "
-edit yum/__init__.py __version__ 
-edit *.spec versions
-git ci
-git push
+  Make sure you have edited yum/__init__.py:__version__ 
+                            *.spec versions
+
+  If not check --version again.
 
-make changelog
-git ci
+  ChangeLog has been updated, check with git diff, then:
+
+git commit
 git push
 
 git tag -a yum-#-#-#
 git push --tags
 
-stick it in rawhide.
+make archive
+
+  Stick a build in rawhide.
 
-update webpage
+  Update webpages:
+    Main wiki page.
+    /whatsnew
+    /releases
 
-upload tarball to yum.baseurl.org:/srv/projects/yum/web/download/x.y
+  Upload tarball to yum.baseurl.org:/srv/projects/yum/web/download/x.y
 
-Send email to user and devel mailing list.
+  Send email to user and devel mailing list.
 "
 python -c 'print "=" * 79'
diff --git a/yum.spec b/yum.spec
index 65a2397..99df5e2 100644
--- a/yum.spec
+++ b/yum.spec
@@ -1,6 +1,6 @@
 Summary: RPM installer/updater
 Name: yum
-Version: 3.2.29
+Version: 3.4.0
 Release: 0
 License: GPLv2+
 Group: System Environment/Base
@@ -212,6 +212,9 @@ exit 0
 %{_mandir}/man*/yum-updatesd*
 
 %changelog
+* Thu Apr 14 2010 James Antill <james at fedoraproject.org>
+- 3.4.0
+
 * Wed Jan 12 2011 Seth Vidal <skvidal at fedoraproject.org>
 - put yum-cron back into yum and make the subpkg. Thanks To Alec Habig for
   maintaining this so well for so long.
diff --git a/yum/__init__.py b/yum/__init__.py
index 2b1db8e..8c77c72 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -91,7 +91,7 @@ from weakref import proxy as weakref
 
 from urlgrabber.grabber import default_grabber
 
-__version__ = '3.2.29'
+__version__ = '3.4.0'
 __version_info__ = tuple([ int(num) for num in __version__.split('.')])
 
 #  Setup a default_grabber UA here that says we are yum, done using the global
commit e0f9faf170cb56c5812e65edd883bd275205d2f3
Author: James Antill <james at and.org>
Date:   Thu Apr 14 16:06:28 2011 -0400

    Don't spam usage info. for missing arguments, as we don't for bad commands.

diff --git a/yumcommands.py b/yumcommands.py
index fd69f05..8e148a9 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -33,6 +33,15 @@ from yum.i18n import utf8_width, utf8_width_fill, to_unicode
 
 import yum.config
 
+def _err_mini_usage(base, basecmd):
+    if basecmd not in base.yum_cli_commands:
+        base.usage()
+        return
+    cmd = base.yum_cli_commands[basecmd]
+    txt = base.yum_cli_commands["help"]._makeOutput(cmd)
+    base.logger.critical(_(' Mini usage:\n'))
+    base.logger.critical(txt)
+
 def checkRootUID(base):
     """
     Verify that the program is being run by the root user.
@@ -68,19 +77,19 @@ def checkPackageArg(base, basecmd, extcmds):
     if len(extcmds) == 0:
         base.logger.critical(
                 _('Error: Need to pass a list of pkgs to %s') % basecmd)
-        base.usage()
+        _err_mini_usage(base, basecmd)
         raise cli.CliError
 
 def checkItemArg(base, basecmd, extcmds):
     if len(extcmds) == 0:
         base.logger.critical(_('Error: Need an item to match'))
-        base.usage()
+        _err_mini_usage(base, basecmd)
         raise cli.CliError
 
 def checkGroupArg(base, basecmd, extcmds):
     if len(extcmds) == 0:
         base.logger.critical(_('Error: Need a group or list of groups'))
-        base.usage()
+        _err_mini_usage(base, basecmd)
         raise cli.CliError    
 
 def checkCleanArg(base, basecmd, extcmds):
@@ -94,7 +103,7 @@ def checkCleanArg(base, basecmd, extcmds):
     for cmd in extcmds:
         if cmd not in VALID_ARGS:
             base.logger.critical(_('Error: invalid clean argument: %r') % cmd)
-            base.usage()
+            _err_mini_usage(base, basecmd)
             raise cli.CliError
 
 def checkShellArg(base, basecmd, extcmds):
commit 0fb327ff5231b206b9ab4256708776f31f4113ac
Author: James Antill <james at and.org>
Date:   Thu Apr 14 16:05:48 2011 -0400

    Fix output for: grouplist abcd

diff --git a/cli.py b/cli.py
index 5304091..957c182 100644
--- a/cli.py
+++ b/cli.py
@@ -1237,6 +1237,11 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
         installed, available = self.doGroupLists(uservisible=uservisible,
                                                  patterns=userlist)
         
+        if not installed and not available:
+            self.logger.error(_('Warning: No groups match: %s'),
+                              ", ".join(userlist))
+            return 0, []
+
         def _out_grp(sect, group):
             if not done:
                 self.verbose_logger.log(yum.logginglevels.INFO_2, sect)
commit bf0279780fe29716d13d479a7eabf8bdd51ab13e
Author: James Antill <james at and.org>
Date:   Thu Apr 14 14:48:55 2011 -0400

    umask 0777 is "empty", use umask 0 for "full".

diff --git a/yum/rpmsack.py b/yum/rpmsack.py
index 3d15141..753a05e 100644
--- a/yum/rpmsack.py
+++ b/yum/rpmsack.py
@@ -40,7 +40,7 @@ import yum.depsolve
 def _open_no_umask(*args):
     """ Annoying people like to set umask's for root, which screws everything
         up for user readable stuff. """
-    oumask = os.umask(0777)
+    oumask = os.umask(0)
     try:
         ret = open(*args)
     finally:
commit 8ed64022f29e3226dc750a6940eadf00e7831bea
Author: James Antill <james at and.org>
Date:   Thu Apr 14 13:59:33 2011 -0400

    Work around Panu's change for a single TS, breaks for reinstalls.

diff --git a/cli.py b/cli.py
index aefb841..5304091 100644
--- a/cli.py
+++ b/cli.py
@@ -574,6 +574,21 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
         
         ts_st = time.time()
 
+        #  Reinstalls broke in: 7115478c527415cb3c8317456cdf50024de89a94 ... 
+        # I assume there's a "better" fix, but this fixes reinstalls and lets
+        # other options continue as is (and they seem to work).
+        have_reinstalls = False
+        for txmbr in self.tsInfo.getMembers():
+            if txmbr.reinstall:
+                have_reinstalls = True
+                break
+        if have_reinstalls:
+            self.initActionTs() # make a new, blank ts to populate
+            self.populateTs(keepold=0) # populate the ts
+            self.ts.check() #required for ordering
+            self.ts.order() # order
+            self.ts.clean() # release memory not needed beyond this point
+
         # put back our depcheck callback
         self.dsCallback = dscb
         # setup our rpm ts callback
commit e93daebccacc1581b31c63880d1c68f40c0dd395
Author: James Antill <james at and.org>
Date:   Thu Apr 14 13:48:27 2011 -0400

    Fix dropCachedDataPostTransaction() for reinstall packages. BZ 696720.

diff --git a/yum/rpmsack.py b/yum/rpmsack.py
index 5c18c7c..3d15141 100644
--- a/yum/rpmsack.py
+++ b/yum/rpmsack.py
@@ -343,6 +343,18 @@ class RPMDBPackageSack(PackageSackBase):
             if txmbr.output_state in constants.TS_INSTALL_STATES:
                 self._pkgname_fails.discard(txmbr.name)
                 precache.append(txmbr)
+                if txmbr.reinstall:
+                    #  For reinstall packages we have:
+                    #
+                    # 1. one txmbr: the new install.
+                    # 2. two rpmdb entries: the new; the old;
+                    #
+                    # ...so we need to remove the old one, given only the new
+                    # one.
+                    ipo = self._tup2pkg[txmbr.pkgtup]
+                    _safe_del(self._idx2pkg, ipo.idx)
+                    _safe_del(self._tup2pkg, txmbr.pkgtup)
+
             if txmbr.output_state in constants.TS_REMOVE_STATES:
                 _safe_del(self._idx2pkg, txmbr.po.idx)
                 _safe_del(self._tup2pkg, txmbr.pkgtup)
commit 6ea6b4583e9288bf87b4bac81d57fb93615cfc7d
Author: James Antill <james at and.org>
Date:   Thu Apr 14 11:19:03 2011 -0400

    Add release testing script.

diff --git a/test/release.sh b/test/release.sh
new file mode 100755
index 0000000..8a22494
--- /dev/null
+++ b/test/release.sh
@@ -0,0 +1,126 @@
+#! /bin/sh -e
+
+function bbanner
+{
+   python -c 'print "=" * 79'
+   echo $@
+   python -c 'print "-" * 79'
+}
+function ebanner
+{
+   python -c 'print "-" * 79'
+   echo $@
+   python -c 'print "=" * 79'
+}
+
+
+function utst
+{
+   bbanner "Testing (user):" $@
+   $@
+   ebanner "Does that look fine? For (user):" $@
+   sleep 8
+}
+
+function stst
+{
+   bbanner "Testing (root):" $@
+   sudo $@
+   ebanner "Does that look fine? For (root):" $@
+   sleep 8
+}
+
+stst yum version nogroups
+utst yum version nogroups
+stst yum history list
+stst yum history new
+
+utst yum list zzuf
+
+stst yum install zzuf
+stst yum reinstall zzuf
+stst yum remove zzuf
+stst yum install yourmom
+stst yum install -y zzuf | tee /tmp/yum-release-testing-install-y-zzuf
+stst cat /tmp/yum-release-testing-install-y-zzuf
+stst yum remove -y zzuf | tee /tmp/yum-release-testing-remove-y-zzuf
+stst cat /tmp/yum-release-testing-remove-y-zzuf
+
+stst yum history list
+
+stst yum localinstall
+stst yum localinstall yourmom
+
+stst yum list updates
+stst yum list obsoletes
+stst yum list available
+stst yum list installed
+stst yum check-update
+# stst yum update
+
+stst yum groupinstall 'News Server'
+stst yum groupremove 'News Server'
+
+utst yum grouplist
+utst yum grouplist not_a_group
+utst yum groupinfo
+utst yum groupinfo not_a_group
+
+stst yum info zzuf
+utst yum info zzuf
+stst yum makecache
+utst yum makecache
+
+stst yum clean all
+utst yum clean all
+
+stst yum -d0 -e0 install
+
+utst yum --version
+
+
+stst yum search
+utst yum search
+
+
+stst yum provides zzuf
+stst yum provides /usr/bin/zzuf
+stst yum provides /usr/bin/yum
+utst yum provides /usr/share/man/man1/zzuf.1.gz
+utst yum provides '/usr/share/man/man*/zzuf.*.gz'
+stst yum provides '/usr/share/man/man1/zzcat.*.gz'
+utst yum provides '/usr/share/man/man*/zzcat.*.gz'
+utst yum resolvedep /usr/bin/zzcat
+
+
+stst yum deplist yum
+utst yum deplist zzuf
+
+
+python -c 'print "=" * 79'
+python -c 'print "*" * 79'
+echo "Done, good to do a release."
+python -c 'print "*" * 79'
+python -c 'print "=" * 79'
+echo "
+edit yum/__init__.py __version__ 
+edit *.spec versions
+git ci
+git push
+
+make changelog
+git ci
+git push
+
+git tag -a yum-#-#-#
+git push --tags
+
+stick it in rawhide.
+
+update webpage
+
+upload tarball to yum.baseurl.org:/srv/projects/yum/web/download/x.y
+
+Send email to user and devel mailing list.
+"
+python -c 'print "=" * 79'
commit cbaf99fddabc2f96a87a329dbf078dec95164e04
Author: James Antill <james at and.org>
Date:   Wed Apr 13 17:28:17 2011 -0400

    Work around umask/permission problems, for yumdb and rpmdb-index data.

diff --git a/yum/rpmsack.py b/yum/rpmsack.py
index e93df20..5c18c7c 100644
--- a/yum/rpmsack.py
+++ b/yum/rpmsack.py
@@ -37,6 +37,26 @@ import constants
 
 import yum.depsolve
 
+def _open_no_umask(*args):
+    """ Annoying people like to set umask's for root, which screws everything
+        up for user readable stuff. """
+    oumask = os.umask(0777)
+    try:
+        ret = open(*args)
+    finally:
+        os.umask(oumask)
+
+    return ret
+
+def _iopen(*args):
+    """ IOError wrapper BS for open, stupid exceptions. """
+    try:
+        ret = open(*args)
+    except IOError, e:
+        return None, e
+    return ret, None
+
+
 class RPMInstalledPackage(YumInstalledPackage):
 
     def __init__(self, rpmhdr, index, rpmdb):
@@ -635,7 +655,7 @@ class RPMDBPackageSack(PackageSackBase):
             return
 
         conflicts_fname = self._cachedir + '/conflicts'
-        fo = open(conflicts_fname + '.tmp', 'w')
+        fo = _open_no_umask(conflicts_fname + '.tmp', 'w')
         fo.write("%s\n" % rpmdbv)
         fo.write("%u\n" % len(pkgs))
         for pkg in sorted(pkgs):
@@ -677,10 +697,9 @@ class RPMDBPackageSack(PackageSackBase):
             return fo.readline()[:-1]
 
         conflict_fname = self._cachedir + '/conflicts'
-        if not os.path.exists(conflict_fname):
+        fo, e = _iopen(conflict_fname)
+        if fo is None:
             return None
-
-        fo = open(conflict_fname)
         frpmdbv = fo.readline()
         rpmdbv = self.simpleVersion(main_only=True)[0]
         if not frpmdbv or rpmdbv != frpmdbv[:-1]:
@@ -766,11 +785,12 @@ class RPMDBPackageSack(PackageSackBase):
             return fo.readline()[:-1]
 
         assert self.__cache_rpmdb__
-        if not os.path.exists(self._cachedir + '/file-requires'):
+
+        fo, e = _iopen(self._cachedir + '/file-requires')
+        if fo is None:
             return None, None
 
         rpmdbv = self.simpleVersion(main_only=True)[0]
-        fo = open(self._cachedir + '/file-requires')
         frpmdbv = fo.readline()
         if not frpmdbv or rpmdbv != frpmdbv[:-1]:
             return None, None
@@ -889,7 +909,7 @@ class RPMDBPackageSack(PackageSackBase):
         if installedUnresolvedFileRequires:
             return
 
-        fo = open(self._cachedir + '/file-requires.tmp', 'w')
+        fo = _open_no_umask(self._cachedir + '/file-requires.tmp', 'w')
         fo.write("%s\n" % rpmdbversion)
 
         fo.write("%u\n" % len(installedFileRequires))
@@ -923,14 +943,14 @@ class RPMDBPackageSack(PackageSackBase):
         if not self.__cache_rpmdb__:
             return
 
-        if not os.path.exists(self._cachedir + '/pkgtups-checksums'):
-            return
-
         def _read_str(fo):
             return fo.readline()[:-1]
 
+        fo, e = _iopen(self._cachedir + '/pkgtups-checksums')
+        if fo is None:
+            return
+
         rpmdbv = self.simpleVersion(main_only=True)[0]
-        fo = open(self._cachedir + '/pkgtups-checksums')
         frpmdbv = fo.readline()
         if not frpmdbv or rpmdbv != frpmdbv[:-1]:
             return
@@ -991,7 +1011,7 @@ class RPMDBPackageSack(PackageSackBase):
             return
 
         pkg_checksum_tups = data
-        fo = open(self._cachedir + '/pkgtups-checksums.tmp', 'w')
+        fo = _open_no_umask(self._cachedir + '/pkgtups-checksums.tmp', 'w')
         fo.write("%s\n" % rpmdbversion)
         fo.write("%u\n" % len(pkg_checksum_tups))
         for pkgtup, TD in sorted(pkg_checksum_tups):
@@ -1024,7 +1044,10 @@ class RPMDBPackageSack(PackageSackBase):
             nmtime = os.path.getmtime(rpmdbvfname)
             omtime = os.path.getmtime(rpmdbfname)
             if omtime <= nmtime:
-                rpmdbv = open(rpmdbvfname).readline()[:-1]
+                fo, e = _iopen(rpmdbvfname)
+                if fo is None:
+                    return None
+                rpmdbv = fo.readline()[:-1]
                 self._have_cached_rpmdbv_data  = rpmdbv
         return self._have_cached_rpmdbv_data
 
@@ -1057,7 +1080,7 @@ class RPMDBPackageSack(PackageSackBase):
             except (IOError, OSError), e:
                 return
 
-        fo = open(rpmdbvfname + ".tmp", "w")
+        fo = _open_no_umask(rpmdbvfname + ".tmp", "w")
         fo.write(self._have_cached_rpmdbv_data)
         fo.write('\n')
         fo.close()
@@ -1694,7 +1717,8 @@ class RPMDBAdditionalDataPackage(object):
 
         # Default write()+rename()... hardlink -c can still help.
         misc.unlink_f(fn + '.tmp')
-        fo = open(fn + '.tmp', 'w')
+
+        fo = _open_no_umask(fn + '.tmp', 'w')
         try:
             fo.write(value)
         except (OSError, IOError), e:
@@ -1727,7 +1751,9 @@ class RPMDBAdditionalDataPackage(object):
                 self._auto_cache(attr, self._yumdb_cache[key], fn, info)
                 return self._read_cached_data[attr]
 
-        fo = open(fn, 'r')
+        fo, e = _iopen(fn)
+        if fo is None: # This really sucks, don't do that.
+            return '<E:%d>' % e.errno
         value = fo.read()
         fo.close()
         del fo
commit 0f965d9f1f6440a3a916a9d959ed5d47ada96a37
Author: James Antill <james at and.org>
Date:   Mon Apr 11 13:31:55 2011 -0400

    Document basename checking of ssl cert. files. BZ 695427.

diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
index a535b79..2e0d6ea 100644
--- a/docs/yum.conf.5
+++ b/docs/yum.conf.5
@@ -318,6 +318,13 @@ is not registered.
 Path to the SSL client certificate yum should use to connect to repos/remote sites
 Defaults to none.
 
+Note that if you are using curl compiled against NSS (default in Fedora/RHEL),
+curl treats sslclientcert values with the same basename as _identical_. This
+version of yum will check that this isn't true and output an error when the
+repositories "foo" and "bar" violate this, like so:
+
+sslclientcert basename shared between foo and bar
+
 .IP
 \fBsslclientkey \fR
 Path to the SSL client key yum should use to connect to repos/remote sites
commit 94315ceebe59462f1312fabf656e8d87e389d8d8
Author: James Antill <james at and.org>
Date:   Mon Apr 11 13:22:58 2011 -0400

    Do basename checking of ssl cert. files. BZ 695427.

diff --git a/yum/__init__.py b/yum/__init__.py
index cf4d827..2b1db8e 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -597,6 +597,24 @@ class YumBase(depsolve.Depsolve):
 
 
         if doSetup:
+            if (hasattr(urlgrabber, 'grabber') and
+                hasattr(urlgrabber.grabber, 'pycurl')):
+                # Must do basename checking, on cert. files...
+                cert_basenames = {}
+                for repo in self._repos.listEnabled():
+                    if not repo.sslclientcert:
+                        continue
+                    bn = os.path.basename(repo.sslclientcert)
+                    if bn not in cert_basenames:
+                        cert_basenames[bn] = repo
+                        continue
+                    if repo.sslclientcert == cert_basenames[bn].sslclientcert:
+                        # Exactly the same path is fine too
+                        continue
+
+                    msg = 'sslclientcert basename shared between %s and %s'
+                    raise Errors.ConfigError, msg % (repo, cert_basenames[bn])
+
             repo_st = time.time()        
             self._repos.doSetup(thisrepo)
             self.verbose_logger.debug('repo time: %0.3f' % (time.time() - repo_st))        


More information about the Yum-commits mailing list