[yum/f19] update to latest HEAD.

Zdeněk Pavlas zpavlas at fedoraproject.org
Wed Apr 10 10:37:39 UTC 2013


commit ebeb098ac0e3aef57fa6c79bd463c369515e89bb
Author: Zdenek Pavlas <zpavlas at redhat.com>
Date:   Wed Apr 10 12:37:23 2013 +0200

    update to latest HEAD.

 yum-HEAD.patch |  381 ++++++++++++++++++++++++++++++++++++++++++--------------
 yum.spec       |   11 ++-
 2 files changed, 297 insertions(+), 95 deletions(-)
---
diff --git a/yum-HEAD.patch b/yum-HEAD.patch
index 1b75dea..08237af 100644
--- a/yum-HEAD.patch
+++ b/yum-HEAD.patch
@@ -1861,7 +1861,7 @@ index 6056d38..8ea5d1f
  
 diff --git a/completion-helper.py b/completion-helper.py
 new file mode 100755
-index 0000000..999b9ad
+index 0000000..1102fd6
 --- /dev/null
 +++ b/completion-helper.py
 @@ -0,0 +1,95 @@
@@ -1935,9 +1935,9 @@ index 0000000..999b9ad
 +
 +
 +def get_pattern(extcmds):
-+    if len(extcmds) > 1 and extcmds[-1]:
++    if len(extcmds) > 1:
 +        try: return shlex.split(extcmds[-1])[0] + "*"
-+        except ValueError: pass
++        except (ValueError, IndexError): pass
 +    return "*"
 +
 +def main(args):
@@ -2623,10 +2623,19 @@ index 0000000..4d01a5a
 + the mailing list, yum at lists.baseurl.org, or consult bugzilla.
 +.fi
 diff --git a/docs/yum.8 b/docs/yum.8
-index 1a8202a..4012a7f 100644
+index 1a8202a..0af27bb 100644
 --- a/docs/yum.8
 +++ b/docs/yum.8
-@@ -43,7 +43,7 @@ gnome\-packagekit application\&.
+@@ -35,6 +35,8 @@ gnome\-packagekit application\&.
+ .br
+ .I \fR * remove | erase package1 [package2] [\&.\&.\&.]
+ .br 
++.I \fR * autoremove [package1] [\&.\&.\&.]
++.br 
+ .I \fR * list [\&.\&.\&.]
+ .br 
+ .I \fR * info [\&.\&.\&.]
+@@ -43,7 +45,7 @@ gnome\-packagekit application\&.
  .br  
  .I \fR * clean [ packages | metadata | expire-cache | rpmdb | plugins | all ]
  .br
@@ -2635,7 +2644,7 @@ index 1a8202a..4012a7f 100644
  .br
  .I \fR * groups  [\&.\&.\&.]
  .br
-@@ -52,6 +52,7 @@ gnome\-packagekit application\&.
+@@ -52,6 +54,7 @@ gnome\-packagekit application\&.
  .I \fR * shell [filename]
  .br
  .I \fR * resolvedep dep1 [dep2] [\&.\&.\&.] 
@@ -2643,7 +2652,7 @@ index 1a8202a..4012a7f 100644
  .br
  .I \fR * localinstall rpmfile1 [rpmfile2] [\&.\&.\&.] 
      (maintained for legacy reasons only - use install)
-@@ -67,9 +68,15 @@ gnome\-packagekit application\&.
+@@ -67,9 +70,15 @@ gnome\-packagekit application\&.
  .br
  .I \fR * repolist [all|enabled|disabled] 
  .br
@@ -2660,7 +2669,7 @@ index 1a8202a..4012a7f 100644
  .br
  .I \fR * check
  .br 
-@@ -86,14 +93,20 @@ Is used to install the latest version of a package or
+@@ -86,14 +95,20 @@ Is used to install the latest version of a package or
  group of packages while ensuring that all dependencies are
  satisfied\&.  (See \fBSpecifying package names\fP for more information) 
  If no package matches the given package name(s), they are assumed to be a shell 
@@ -2685,7 +2694,7 @@ index 1a8202a..4012a7f 100644
  .IP 
  .IP "\fBupdate\fP"
  If run without any packages, update will update every currently
-@@ -111,7 +124,7 @@ changes, for example: upgrading from somelinux 8.0 to somelinux 9.
+@@ -111,7 +126,7 @@ changes, for example: upgrading from somelinux 8.0 to somelinux 9.
  
  Note that "\fBupdate\fP" works on installed packages first, and only if there
  are no matches does it look for available packages. The difference is most
@@ -2694,19 +2703,38 @@ index 1a8202a..4012a7f 100644
  "\fBupdate\fP foo" if foo-1-2 is installed. You can use the "\fBupdate-to\fP"
  if you'd prefer that nothing happen in the above case.
  .IP 
-@@ -158,6 +171,11 @@ the "install" command\&.(See \fBSpecifying package names\fP for more information
+@@ -158,7 +173,30 @@ the "install" command\&.(See \fBSpecifying package names\fP for more information
  
  Note that "yum" is included in the protected_packages configuration, by default.
  So you can't accidentally remove yum itself.
 +
++The remove_leaf_only configuration changes the behaviour of this command
++to only remove packages which aren't required by something else.
++
++The clean_requirements_on_remove configuration changes the behaviour of this
++command to also remove packages that are only dependencies of this package.
++
 +Because remove does a lot of work to make it as easy as possible to use, there
 +are also a few specific remove commands "\fBremove-n\fP", "\fBremove-na\fP"
 +and "\fBremove-nevra\fP". These only work on package names, and do not process
 +wildcards etc.
  .IP 
++.IP "\fBautoremove\fP"
++.IP 
++With one or more arguments this command works like running the "\fBremove\fP"
++command with the clean_requirements_on_remove turned on. However you can also
++specify no arguments, at which point it tries to remove any packages that
++weren't installed explicitly by the user and which aren't required by
++anything (so called leaf packages).
++
++Because autoremove does a lot of work to make it as easy as possible to use,
++there are also a few specific autoremove commands "\fBautoremove-n\fP", 
++"\fBautoremove-na\fP" and "\fBautoremove-nevra\fP". These only work on package
++names, and do not process wildcards etc.
  .IP "\fBlist\fP"
  Is used to list various information about available
-@@ -191,7 +209,8 @@ the \fIClean Options\fP section below\&.
+ packages; more complete details are available in the \fIList Options\fP
+@@ -191,7 +229,8 @@ the \fIClean Options\fP section below\&.
  .IP 
  .IP "\fBmakecache\fP"
  Is used to download and make usable all the metadata for the currently enabled
@@ -2716,7 +2744,7 @@ index 1a8202a..4012a7f 100644
  .IP 
  .IP "\fBgroups\fP"
  A command, new in 3.4.2, that collects all the subcommands that act on groups together.
-@@ -209,10 +228,12 @@ installed.
+@@ -209,10 +248,12 @@ installed.
  "\fBgroup list\fP" is used to list the available groups from all \fByum\fP repos. Groups are marked
  as "installed" if all mandatory packages are installed, or if a group doesn't
  have any mandatory packages then it is installed if any of the optional or
@@ -2733,7 +2761,7 @@ index 1a8202a..4012a7f 100644
  
  "\fBgroup remove\fP" is used to remove all of the packages in a group, unlike "groupinstall" this
  will remove everything regardless of group_package_types. It is worth pointing
-@@ -224,10 +245,37 @@ to only remove packages which aren't required by something else.
+@@ -224,10 +265,37 @@ to only remove packages which aren't required by something else.
  
  "\fBgroup info\fP" is used to give the description and package list of a group (and which type
  those packages are marked as). Note that you can use the yum-filter-data and
@@ -2772,7 +2800,7 @@ index 1a8202a..4012a7f 100644
  .IP
  .IP "\fBshell\fP"
  Is used to enter the 'yum shell', when a filename is specified the contents of
-@@ -235,12 +283,13 @@ that file is executed in yum shell mode. See \fIyum-shell(8)\fP for more info
+@@ -235,12 +303,13 @@ that file is executed in yum shell mode. See \fIyum-shell(8)\fP for more info
  .IP
  .IP "\fBresolvedep\fP"
  Is used to list packages providing the specified dependencies, at most one
@@ -2788,7 +2816,7 @@ index 1a8202a..4012a7f 100644
  reasons only.
  .IP
  .IP "\fBlocalupdate\fP"
-@@ -248,7 +297,7 @@ Is used to update the system by specifying local rpm files. Only the specified
+@@ -248,7 +317,7 @@ Is used to update the system by specifying local rpm files. Only the specified
  rpm files of which an older version is already installed will be installed,
  the remaining specified packages will be ignored.
  If required the enabled repositories will be used to resolve dependencies. Note
@@ -2797,7 +2825,7 @@ index 1a8202a..4012a7f 100644
  legacy reasons only.
  .IP
  .IP "\fBreinstall\fP"
-@@ -260,10 +309,26 @@ on groups, files, provides and filelists just like the "install" command\&.
+@@ -260,10 +329,26 @@ on groups, files, provides and filelists just like the "install" command\&.
  Will try and downgrade a package from the version currently installed to the
  previously highest version (or the specified version).
  The depsolver will not necessarily work, but if you specify all the packages it
@@ -2825,7 +2853,7 @@ index 1a8202a..4012a7f 100644
  .IP "\fBdeplist\fP"
  Produces a list of all dependencies and what packages provide those
  dependencies for the given packages. As of 3.2.30 it now just shows the latest
-@@ -291,11 +356,56 @@ then yum will ignore any repo errors and output the information it can get
+@@ -291,11 +376,63 @@ then yum will ignore any repo errors and output the information it can get
  (Eg. "yum clean all; yum -C repolist" will output something, although the
  package counts/etc. will be zeroed out).
  .IP
@@ -2845,9 +2873,16 @@ index 1a8202a..4012a7f 100644
 +
 +"repository\-packages <repo> install" - Install all of the packages in the
 +repository, basicallly the same as: yum install $(repoquery --repoid=<repo> -a).
++Specific packages/wildcards can be specified.
 +
 +"repository\-packages <repo> upgrade" - Update all of the packages in the
 +repository, basicallly the same as: yum upgrade $(repoquery --repoid=<repo> -a).
++Specific packages/wildcards can be specified.
++
++"repository\-packages <repo> upgrade-to" - Update all of the packages in the
++repository, basicallly the same as: yum upgrade $(repoquery --repoid=<repo> -a).
++Without arguments it works the same as upgrade, with arguments it just
++interprets them as the versions you want to move to.
 +
 +"repository\-packages <repo> reinstall-old" - ReInstall all of the packages 
 +that are installed from the repository and available in the
@@ -2884,7 +2919,7 @@ index 1a8202a..4012a7f 100644
  packages (in sorted order), and the checksum_type/checksum_data entries from
  the yumdb. Note that this rpmdb version is now also used significantly within
  yum (esp. in yum history).
-@@ -321,26 +431,33 @@ and so takes sub-commands:
+@@ -321,26 +458,33 @@ and so takes sub-commands:
  .IP "\fBhistory\fP"
  The history command allows the user to view what has happened in past
  transactions (assuming the history_record config. option is set). You can use
@@ -2924,7 +2959,7 @@ index 1a8202a..4012a7f 100644
  A (if it is not still installed), and "rollback 1" will try to remove packages
  B and C. Note that after a "rollback 1" you will have a fourth transaction,
  although the ending rpmdb version (see: yum version) should be the same in
-@@ -349,6 +466,12 @@ transactions 1 and 4.
+@@ -349,6 +493,12 @@ transactions 1 and 4.
  The addon-info command takes a transaction ID, and the packages-list command
  takes a package (with wildcards).
  
@@ -2937,7 +2972,7 @@ index 1a8202a..4012a7f 100644
  In "history list" you can change the behaviour of the 2nd column via. the
  configuration option history_list_view.
  
-@@ -371,6 +494,20 @@ end of the package column in the packages-list command).
+@@ -371,6 +521,20 @@ end of the package column in the packages-list command).
  .I \fBs\fR - The transaction completed fine, but --skip-broken was enabled and had to skip some packages.
  .br
  
@@ -2958,7 +2993,7 @@ index 1a8202a..4012a7f 100644
  .IP
  .IP "\fBcheck\fP"
  Checks the local rpmdb and produces information on any problems it finds. You
-@@ -401,6 +538,11 @@ Assume yes; assume that the answer to any question which would be asked
+@@ -401,6 +565,11 @@ Assume yes; assume that the answer to any question which would be asked
  is yes\&.
  .br
  Configuration Option: \fBassumeyes\fP
@@ -2970,7 +3005,7 @@ index 1a8202a..4012a7f 100644
  .IP "\fB\-c, \-\-config=[config file]\fP" 
  Specifies the config file location - can take HTTP and FTP URLs and local file
  paths\&.
-@@ -420,7 +562,7 @@ Sets the error level to [number] Practical range 0 \- 10. 0 means print only cri
+@@ -420,7 +589,7 @@ Sets the error level to [number] Practical range 0 \- 10. 0 means print only cri
  .br
  Configuration Option: \fBerrorlevel\fP
  .IP "\fB\-\-rpmverbosity=[name]\fP" 
@@ -2979,7 +3014,23 @@ index 1a8202a..4012a7f 100644
  options are: 'critical', 'emergency', 'error', 'warn' and 'debug'.
  .br
  Configuration Option: \fBrpmverbosity\fP
-@@ -506,7 +648,14 @@ option will corrupt your cache (and you can use $releasever in your cachedir
+@@ -461,8 +630,13 @@ processing logic. For more information see the \fBupdate\fP command above.
+ .br
+ Configuration Option: \fBobsoletes\fP
+ .IP "\fB\-x, \-\-exclude=package\fP"
+-Exclude a specific package by name or glob from updates on all repositories.
+-Configuration Option: \fBexclude\fP
++Exclude a specific package by name or glob from all repositories, so yum works
++as if that package was never in the repositories.
++This is commonly used so a package isn't upgraded or installed accidentally, but
++can be used to remove packages in any way that "yum list" will show packages.
++
++Can be disabled using --disableexcludes.
++Configuration Option: \fBexclude\fP, \fBincludepkgs\fP
+ .br
+ .IP "\fB\-\-color=[always|auto|never]\fP"
+ Display colorized output automatically, depending on the output terminal,
+@@ -506,7 +680,14 @@ option will corrupt your cache (and you can use $releasever in your cachedir
  configuration to stop this).
  .PP 
  .IP "\fB\-t, \-\-tolerant\fP"
@@ -2995,7 +3046,7 @@ index 1a8202a..4012a7f 100644
  .br
  .IP "\fB\-\-setopt=option=value\fP"
  Set any config option in yum config or repo files. For options in the global 
-@@ -523,7 +672,7 @@ version of the package\&.
+@@ -523,7 +704,7 @@ version of the package\&.
  
  The format of the output of yum list is:
  
@@ -3004,7 +3055,7 @@ index 1a8202a..4012a7f 100644
  
  .IP "\fByum list [all | glob_exp1] [glob_exp2] [\&.\&.\&.]\fP"
  List all available and installed packages\&.
-@@ -542,6 +691,10 @@ shell\-style glob and any matches are printed\&.
+@@ -542,6 +723,10 @@ shell\-style glob and any matches are printed\&.
  List the packages installed on the system that are not available in any yum
  repository listed in the config file.
  .IP
@@ -3016,7 +3067,7 @@ index 1a8202a..4012a7f 100644
  List the packages installed on the system that are obsoleted by packages
  in any yum repository listed in the config file.
 diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
-index 515aa73..e07d38c 100644
+index 515aa73..15aaa06 100644
 --- a/docs/yum.conf.5
 +++ b/docs/yum.conf.5
 @@ -114,15 +114,27 @@ are causing problems from the transaction.
@@ -3051,7 +3102,7 @@ index 515aa73..e07d38c 100644
  .br
  
  .IP
-@@ -131,6 +143,7 @@ Either `1' or `0'. If enabled, then yum will be tolerant of errors on the
+@@ -131,15 +143,22 @@ Either `1' or `0'. If enabled, then yum will be tolerant of errors on the
  command line with regard to packages. For example: if you request to install
  foo, bar and baz and baz is installed; yum won't error out complaining that baz
  is already installed. Default to `0' (not tolerant).
@@ -3059,7 +3110,23 @@ index 515aa73..e07d38c 100644
  .br
  Command-line option: \fB\-t\fP
  
-@@ -188,12 +201,32 @@ Default is `true'.
+ .IP
+ \fBexclude\fR
+-List of packages to exclude from updates or installs. This should be a space
++List of packages to exclude from all repositories, so yum works
++as if that package was never in the repositories.. This should be a space
+ separated list.
++This is commonly used so a package isn't upgraded or installed accidentally, but
++can be used to remove packages in any way that "yum list" will show packages.
+ Shell globs using wildcards (eg. * and ?) are allowed.
+ 
++Can be disabled using --disableexcludes.
++Command-line option: \fB\-x\fP
++
+ .IP
+ \fBexactarch\fR
+ Either `1' or `0'. Set to `1' to make yum update only update the architectures
+@@ -188,12 +207,32 @@ Default is `true'.
  Command-line option: \fB\-\-obsoletes\fP
  
  .IP
@@ -3092,7 +3159,7 @@ index 515aa73..e07d38c 100644
  
  .IP
  \fBgroupremove_leaf_only \fR
-@@ -215,6 +248,30 @@ of packages in groups will be installed when 'groupinstall' is called.
+@@ -215,6 +254,30 @@ of packages in groups will be installed when 'groupinstall' is called.
  Default is: default, mandatory
  
  .IP
@@ -3123,7 +3190,7 @@ index 515aa73..e07d38c 100644
  \fBinstallroot \fR
  Specifies an alternative installroot, relative to which all packages will be
  installed. 
-@@ -300,6 +357,40 @@ with the \fBthrottle\fR option (above). If \fBthrottle\fR is a percentage and
+@@ -300,6 +363,40 @@ with the \fBthrottle\fR option (above). If \fBthrottle\fR is a percentage and
  ignored. Default is `0' (no bandwidth throttling). 
  
  .IP
@@ -3164,7 +3231,7 @@ index 515aa73..e07d38c 100644
  \fBsslcacert \fR
  Path to the directory containing the databases of the certificate authorities
  yum should use to verify SSL certificates. Defaults to none - uses system
-@@ -331,6 +422,15 @@ Path to the SSL client key yum should use to connect to repos/remote sites
+@@ -331,6 +428,15 @@ Path to the SSL client key yum should use to connect to repos/remote sites
  Defaults to none.
  
  .IP
@@ -3180,7 +3247,7 @@ index 515aa73..e07d38c 100644
  \fBhistory_record \fR
  Boolean - should yum record history entries for transactions. This takes some
  disk space, and some extra time in the transactions. But it allows how to know a
-@@ -438,6 +538,31 @@ It's also possible to use the word "never", meaning that the metadata will
+@@ -438,6 +544,31 @@ It's also possible to use the word "never", meaning that the metadata will
  never expire. Note that when using a metalink file the metalink must always
  be newer than the metadata for the repository, due to the validation, so this
  timeout also applies to the metalink file.
@@ -3212,7 +3279,7 @@ index 515aa73..e07d38c 100644
  
  .IP
  \fBmirrorlist_expire \fR
-@@ -480,6 +605,19 @@ not listed above is the other metadata, which contains the changelog information
+@@ -480,6 +611,19 @@ not listed above is the other metadata, which contains the changelog information
  which is used by yum-changelog. This is what "yum makecache" uses.
  
  .IP
@@ -3232,7 +3299,7 @@ index 515aa73..e07d38c 100644
  \fBmultilib_policy \fR
  Can be set to 'all' or 'best'. All means install all possible arches for any package you 
  want to install. Therefore yum install foo will install foo.i386 and foo.x86_64 on x86_64, 
-@@ -587,14 +725,65 @@ be downloaded. The updates list is what is printed when you run "yum update",
+@@ -587,14 +731,65 @@ be downloaded. The updates list is what is printed when you run "yum update",
  Default is `normal'.
  See color_list_installed_older for possible values.
  
@@ -3254,15 +3321,15 @@ index 515aa73..e07d38c 100644
 +\fBupgrade_requirements_on_install \fR
 +When installing/reinstalling/upgrading packages go through each package's
 +installed dependencies and check for an update.
-+Boolean (1, 0, True, False, yes,no) Defaults to False
-+
+ Boolean (1, 0, True, False, yes,no) Defaults to False
+ 
 +.IP
 +\fBrecheck_installed_requires \fR
 +When upgrading a package do we recheck any requirements that existed in the old
 +package. Turning this on shouldn't do anything but slow yum depsolving down,
 +however using rpm --nodeps etc. can break the rpmdb and then this will help.
- Boolean (1, 0, True, False, yes,no) Defaults to False
- 
++Boolean (1, 0, True, False, yes,no) Defaults to False
++
 +.IP
 +\fBreset_nice \fR
 +If set to true then yum will try to reset the nice value to zero, before
@@ -3298,7 +3365,30 @@ index 515aa73..e07d38c 100644
  
  
  .SH "[repository] OPTIONS"
-@@ -755,6 +944,16 @@ repository.
+@@ -702,12 +897,18 @@ key will be automatically imported without user confirmation.
+ Same as the [main] \fBexclude\fR option but only for this repository.
+ Substitution variables, described below, are honored here.
+ 
++Can be disabled using --disableexcludes.
++
+ .IP
+ \fBincludepkgs\fR
+-Inverse of exclude. This is a list of packages you want to use from a
+-repository. If this option lists only one package then that is all yum will
+-ever see from the repository. Defaults to an empty list.  Substitution
+-variables, described below, are honored here.
++Inverse of exclude, yum will exclude any package in the repo. that doesn't
++match this list. This works in conjunction with exclude and doesn't override it,
++so if you exclude=*.i386 and includepkgs=python* then only packages starting
++with python that do not have an i386 arch. will be seen by yum in this repo.
++
++Substitution variables, described below, are honored here.
++
++Can be disabled using --disableexcludes.
+ 
+ .IP
+ \fBenablegroups\fR
+@@ -755,6 +956,16 @@ repository.
  Overrides the \fBbandwidth\fR option from the [main] section for this
  repository.
  
@@ -3315,7 +3405,7 @@ index 515aa73..e07d38c 100644
  
  .IP
  \fBsslcacert \fR
-@@ -776,6 +975,10 @@ repository.
+@@ -776,6 +987,10 @@ repository.
  Overrides the \fBsslclientkey\fR option from the [main] section for this
  repository.
  
@@ -3326,7 +3416,7 @@ index 515aa73..e07d38c 100644
  
  .IP
  \fBmetadata_expire \fR
-@@ -783,6 +986,11 @@ Overrides the \fBmetadata_expire\fR option from the [main] section for this
+@@ -783,6 +998,11 @@ Overrides the \fBmetadata_expire\fR option from the [main] section for this
  repository.
  
  .IP
@@ -3338,7 +3428,7 @@ index 515aa73..e07d38c 100644
  \fBmirrorlist_expire \fR
  Overrides the \fBmirrorlist_expire\fR option from the [main] section for this
  repository.
-@@ -824,7 +1032,16 @@ as greater/less than any other. defaults to 1000
+@@ -824,7 +1044,16 @@ as greater/less than any other. defaults to 1000
  If set to True yum will continue running if this repository cannot be 
  contacted for any reason. This should be set carefully as all repos are consulted
  for any given command. Defaults to False.
@@ -182210,7 +182300,7 @@ index 0000000..a98341d
 +        self.assertResult( (p.installed_1, p.update_4) )
 +
 diff --git a/test/simpleobsoletestests.py b/test/simpleobsoletestests.py
-index 97a9923..5f0cdfb 100644
+index 97a9923..6cede1e 100644
 --- a/test/simpleobsoletestests.py
 +++ b/test/simpleobsoletestests.py
 @@ -244,6 +244,40 @@ class SimpleObsoletesTests(OperationsTests):
@@ -182254,7 +182344,7 @@ index 97a9923..5f0cdfb 100644
      def _MultiObsHelper(self):
          ret = {'zsh'  : FakePackage('zsh', '1', '1', '0', 'noarch'),
                 'ksh'  : FakePackage('ksh', '1', '1', '0', 'noarch'),
-@@ -588,6 +622,89 @@ class SimpleObsoletesTests(OperationsTests):
+@@ -588,6 +622,152 @@ class SimpleObsoletesTests(OperationsTests):
          # self.assert_(res=='err', msg)
          self.assertResult([])
  
@@ -182340,6 +182430,69 @@ index 97a9923..5f0cdfb 100644
 +        # Just d2 is fine too, although less likely what the user wants
 +        self.assertResult((c2,d2))
 +
++    def testRLFileReqTransObs1(self):
++        fr1 = FakePackage('fr1', '1', '1')
++        fr1.addRequires('/foo')
++        fr2 = FakePackage('fr2', '2', '2')
++
++        fp1 = FakePackage('fp1', '1', '2')
++        fp1.addFile('/foo')
++        fp2 = FakePackage('fpl2', '1', '2')
++        fp2.addFile('/foo')
++
++        ob1 = FakePackage('ob1', '1', '3')
++        ob1.addObsoletes('fp1', None, (None, None, None))
++
++        res, msg = self.runOperation(['install', 'ob1', 'fr1'], [],
++                                     [fr1, fr2, fp1, fp2, ob1])
++
++        self.assert_(res=='err', msg)
++        # Should really be:
++        # self.assertResult([ob1, fr1, fp2])
++
++    def testRLFileReqTransObs2(self):
++        fr1 = FakePackage('fr1', '1', '1')
++        fr1.addRequires('/foo')
++        fr2 = FakePackage('fr2', '2', '2')
++        fr2.addRequires('/bar')
++
++        fp1 = FakePackage('fp1', '1', '2')
++        fp1.addFile('/foo')
++        fp2 = FakePackage('fpl2', '1', '2')
++        fp2.addFile('/foo')
++
++        ob1 = FakePackage('ob1', '1', '3')
++        ob1.addObsoletes('fp1', None, (None, None, None))
++        ob1.addFile('/bar')
++
++        res, msg = self.runOperation(['install', 'fr1', 'fr2'], [],
++                                     [fr1, fr2, fp1, fp2, ob1])
++
++        self.assert_(res=='err', msg)
++        # Should really be:
++        # self.assertResult([ob1, fr1, fp2])
++
++    def testRLFileReqInstObs(self):
++        fr1 = FakePackage('fr1', '1', '1')
++        fr1.addRequires('/foo')
++        fr2 = FakePackage('fr2', '2', '2')
++
++        fp1 = FakePackage('fp1', '1', '2')
++        fp1.addFile('/foo')
++        fp2 = FakePackage('fpl2', '1', '2')
++        fp2.addFile('/foo')
++
++        ob1 = FakePackage('ob1', '1', '3')
++        ob1.addObsoletes('fp1', None, (None, None, None))
++
++        res, msg = self.runOperation(['install', 'fr1'], [ob1],
++                                     [fr1, fr2, fp1, fp2, ob1])
++        print "JDBG:", "test:", res, msg
++
++        self.assert_(res=='err', msg)
++        # Should really be:
++        # self.assertResult([ob1, fr1, fp2])
++
 +
  class GitMetapackageObsoletesTests(OperationsTests):
  
@@ -185616,7 +185769,7 @@ index c1af4ad..e3e3956 100644
      pass
      
 diff --git a/yum/__init__.py b/yum/__init__.py
-index 99039e0..a5e21fb 100644
+index 99039e0..d1ab41a 100644
 --- a/yum/__init__.py
 +++ b/yum/__init__.py
 @@ -21,6 +21,7 @@ The Yum RPM software updater.
@@ -186810,13 +186963,13 @@ index 99039e0..a5e21fb 100644
 +            pkgs.append(po)
 +
 +        # download presto metadata and use drpms
-+        presto = DeltaInfo(self, pkgs)
++        presto = DeltaInfo(self, pkgs, adderror)
 +        deltasize = rpmsize = 0
 +        for po in pkgs:
 +            if isinstance(po, DeltaPackage):
 +                if verify_local(po):
 +                    # there's .drpm already, use it
-+                    presto.rebuild(po, adderror)
++                    presto.rebuild(po)
                      continue
 -                        
 +                deltasize += po.size
@@ -186926,7 +187079,7 @@ index 99039e0..a5e21fb 100644
 -                    del errors[po]
 +                                                                  local_size[0])
 +                    if isinstance(po, DeltaPackage):
-+                        presto.rebuild(po, adderror)
++                        presto.rebuild(po)
 +                        return
 +                    else:
 +                        presto.dequeue_max()
@@ -191309,7 +191462,7 @@ index d09511f..438cb88 100644
  
          if name not in cfgOptions and option.default == value:
 diff --git a/yum/depsolve.py b/yum/depsolve.py
-index 6d744c0..d810a17 100644
+index 6d744c0..60047a9 100644
 --- a/yum/depsolve.py
 +++ b/yum/depsolve.py
 @@ -31,13 +31,15 @@ from transactioninfo import TransactionMember
@@ -191598,19 +191751,20 @@ index 6d744c0..d810a17 100644
          if not len(self.tsInfo):
              return (0, [_('Success - empty transaction')])
  
-@@ -778,6 +900,11 @@ class Depsolve(object):
+@@ -778,6 +900,12 @@ class Depsolve(object):
                      if checkdep:
                          break # The next conflict might be the same pkg
  
 +                if True: # Always have to check obsoletes...
 +                    if self._checkObsoletes():
 +                        CheckDeps = True
++                        CheckRemoves = True
 +                        self._last_req = None
 +
                  if CheckDeps:
                      if self.dsCallback: self.dsCallback.restartLoop()
                      self.verbose_logger.log(logginglevels.DEBUG_1, _('Restarting Loop'))
-@@ -920,9 +1047,12 @@ class Depsolve(object):
+@@ -920,9 +1048,12 @@ class Depsolve(object):
  
          # if this is an update, we should check what the old
          # requires were to make things faster
@@ -191625,7 +191779,7 @@ index 6d744c0..d810a17 100644
          oldreqs = set(oldreqs)
  
          ret = []
-@@ -948,7 +1078,7 @@ class Depsolve(object):
+@@ -948,7 +1079,7 @@ class Depsolve(object):
                      continue
                  for member in self.tsInfo.getMembersWithState(
                      pkgtup=po.pkgtup, output_states=TS_INSTALL_STATES):
@@ -191634,7 +191788,7 @@ index 6d744c0..d810a17 100644
  
          return ret
  
-@@ -974,12 +1104,36 @@ class Depsolve(object):
+@@ -974,12 +1105,36 @@ class Depsolve(object):
              # FIXME: This is probably the best place to fix the postfix rename
              # problem long term (post .21) ... see compare_providers.
              for pkg, hits in self.tsInfo.getRequires(*prov).iteritems():
@@ -191672,7 +191826,28 @@ index 6d744c0..d810a17 100644
                      #  We don't undo anything else here ... hopefully that's
                      # fine.
                      self.tsInfo.remove(txmbr.pkgtup)
-@@ -1149,7 +1303,74 @@ class Depsolve(object):
+@@ -1033,10 +1188,10 @@ class Depsolve(object):
+ 
+         # get file requirements from new packages
+         for txmbr in self._tsInfo.getMembersWithState(output_states=TS_INSTALL_STATES):
++            files = []
+             for name, flag, evr in txmbr.po.requires:
+                 if name.startswith('/'):
+-                    pt = txmbr.po.pkgtup
+-                    self.installedFileRequires.setdefault(pt, []).append(name)
++                    files.append(name)
+                     # check if file requires was already unresolved in update
+                     if name in self.installedUnresolvedFileRequires:
+                         already_broken = False
+@@ -1050,6 +1205,7 @@ class Depsolve(object):
+                         nfileRequires.add(name)
+                     fileRequires.add(name)
+                     reverselookup.setdefault(name, []).append(txmbr.po.pkgtup)
++            self.installedFileRequires[txmbr.po.pkgtup] = files
+ 
+         todel = []
+         for fname in self.installedFileProviders:
+@@ -1149,7 +1305,76 @@ class Depsolve(object):
          self.rpmdb.transactionCacheConflictPackages(cpkgs)
          return ret
  
@@ -191690,6 +191865,8 @@ index 6d744c0..d810a17 100644
 +            # was maybe used to resolve something ... ?
 +            self.pkgSack.delPackage(otxmbr.po)
 +            self.up.delPackage(otxmbr.pkgtup)
++            # Remove it from the installed file requires cache
++            (self.installedFileRequires or {}).pop(otxmbr.pkgtup, None)
 +
 +        for po in self.rpmdb.returnObsoletePackages():
 +            if self.tsInfo.getMembersWithState(po.pkgtup, output_states=TS_REMOVE_STATES):
@@ -191747,7 +191924,7 @@ index 6d744c0..d810a17 100644
          lst = self.tsInfo.matchNaevr(name = pkgname)
          for txmbr in lst:
              if txmbr.output_state in TS_INSTALL_STATES:
-@@ -1166,7 +1387,7 @@ class Depsolve(object):
+@@ -1166,7 +1391,7 @@ class Depsolve(object):
          return True
      _isPackageInstalled = isPackageInstalled
  
@@ -191756,7 +191933,7 @@ index 6d744c0..d810a17 100644
          """take the list of pkgs and score them based on the requesting package
             return a dictionary of po=score"""
          self.verbose_logger.log(logginglevels.DEBUG_4,
-@@ -1210,6 +1431,24 @@ class Depsolve(object):
+@@ -1210,6 +1435,24 @@ class Depsolve(object):
                  return None
              return x
  
@@ -191781,7 +191958,7 @@ index 6d744c0..d810a17 100644
          #  Actual start of _compare_providers().
  
          # Do a NameArch filtering, based on repo. __cmp__
-@@ -1332,6 +1571,26 @@ class Depsolve(object):
+@@ -1332,6 +1575,26 @@ class Depsolve(object):
                          _('common prefix of %s between %s and %s' % (cpl, po, reqpo)))
                  
                      pkgresults[po] += cpl*2
@@ -191808,7 +191985,7 @@ index 6d744c0..d810a17 100644
                  
          #  If we have more than one "best", see what would happen if we picked
          # each package ... ie. what things do they require that _aren't_ already
-@@ -1393,42 +1652,52 @@ class Depsolve(object):
+@@ -1393,42 +1656,52 @@ class Depsolve(object):
  
  
  class DepCheck(object):
@@ -191877,10 +192054,10 @@ index 6d744c0..d810a17 100644
          self.conflict = conflict # what the conflict was between them
 diff --git a/yum/drpm.py b/yum/drpm.py
 new file mode 100644
-index 0000000..058977e
+index 0000000..f9e2320
 --- /dev/null
 +++ b/yum/drpm.py
-@@ -0,0 +1,310 @@
+@@ -0,0 +1,315 @@
 +#  Integrated delta rpm support
 +#  Copyright 2013 Zdenek Pavlas
 +
@@ -191904,8 +192081,8 @@ index 0000000..058977e
 +from yum.Errors import RepoError
 +from yum.i18n import exception2msg, _
 +from yum.Errors import MiscError
-+from misc import checksum, repo_gen_decompress
-+from urlgrabber import grabber
++from yum.misc import checksum, repo_gen_decompress, unlink_f
++from urlgrabber import grabber, progress
 +async = hasattr(grabber, 'parallel_wait')
 +from xml.etree.cElementTree import iterparse
 +import os, re
@@ -191989,10 +192166,12 @@ index 0000000..058977e
 +    return unknown
 +
 +class DeltaInfo:
-+    def __init__(self, ayum, pkgs):
++    def __init__(self, ayum, pkgs, adderror):
 +        self.verbose_logger = ayum.verbose_logger
++        self.adderror = adderror
 +        self.jobs = {}
 +        self._future_jobs = []
++        self.progress = None
 +        self.limit = ayum.conf.deltarpm
 +        if self.limit < 0:
 +            nprocs = _num_cpus_online()
@@ -192121,39 +192300,42 @@ index 0000000..058977e
 +            # urlgrabber spawns child jobs, too.  But they exit synchronously,
 +            # so we should never see an unknown pid here.
 +            assert pid in self.jobs
-+            callback = self.jobs.pop(pid)
-+            callback(code)
++            po = self.jobs.pop(pid)
++            if self.progress:
++                self.done += po.rpm.size
++                self.progress.update(self.done)
++            if code != 0:
++                unlink_f(po.rpm.localpath)
++                self.adderror(po, _('Delta RPM rebuild failed'))
++            elif not po.rpm.verifyLocalPkg():
++                self.adderror(po, _('Checksum of the delta-rebuilt RPM failed'))
++            else:
++                os.unlink(po.localpath)
++                po.localpath = po.rpm.localpath # for --downloadonly
 +            num += 1
 +        return num
 +
-+    def rebuild(self, po, adderror):
++    def rebuild(self, po):
 +        """ Turn a drpm into an rpm, by adding it to the queue and trying to
 +            service the queue. """
-+        # this runs when worker finishes
-+        def callback(code):
-+            if code != 0:
-+                adderror(po, _('Delta RPM rebuild failed'))
-+                return
-+            if not po.rpm.verifyLocalPkg():
-+                adderror(po, _('Checksum of the delta-rebuilt RPM failed'))
-+                return
-+            os.unlink(po.localpath)
-+            po.localpath = po.rpm.localpath # for --downloadonly
-+
-+        args = ()
-+        if po.oldrpm: args += '-r', po.oldrpm
-+        args += po.localpath, po.rpm.localpath
-+
-+        self.queue(args, callback)
++        self._future_jobs.append(po)
 +        self.dequeue_max()
 +
-+    def queue(self, args, callback):
-+        """ Queue a delta rebuild up. """
-+        self._future_jobs.append((args, callback))
-+
 +    def dequeue_all(self):
 +        """ De-Queue all delta rebuilds and spawn the rebuild processes. """
 +
++        count = total = 0
++        for po in self.jobs.values() + self._future_jobs:
++            count += 1
++            total += po.rpm.size
++        if total:
++            self.verbose_logger.info(_('Finishing delta rebuilds of %d package(s) (%s)'),
++                                     count, progress.format_number(total))
++            if hasattr(progress, 'text_meter_total_size'):
++                progress.text_meter_total_size(0)
++            self.progress = po.repo.callback
++            self.progress.start(text='<locally rebuilding deltarpms>', size=total)
++            self.done = 0
 +        while self._future_jobs:
 +            self.dequeue()
 +
@@ -192183,14 +192365,14 @@ index 0000000..058977e
 +                return False
 +            self.wait((self.limit - len(self.jobs)) + 1)
 +
-+        args, callback = self._future_jobs.pop(0)
-+        self._spawn(args, callback)
-+
-+        return True
++        po = self._future_jobs.pop(0)
++        args = ()
++        if po.oldrpm: args += '-r', po.oldrpm
++        args += po.localpath, po.rpm.localpath
 +
-+    def _spawn(self, args, callback):
 +        pid = os.spawnl(os.P_NOWAIT, APPLYDELTA, APPLYDELTA, *args)
-+        self.jobs[pid] = callback
++        self.jobs[pid] = po
++        return True
 diff --git a/yum/failover.py b/yum/failover.py
 index bca9651..00c17ad 100644
 --- a/yum/failover.py
@@ -196648,7 +196830,7 @@ index e5e9ece..b9bf1fe 100644
          fo = None
  
 diff --git a/yumcommands.py b/yumcommands.py
-index 4dcbea7..2f789a7 100644
+index 4dcbea7..968f231 100644
 --- a/yumcommands.py
 +++ b/yumcommands.py
 @@ -22,14 +22,16 @@ Classes for subcommands of the yum command line interface.
@@ -199552,7 +199734,7 @@ index 4dcbea7..2f789a7 100644
          self.doneCommand(base, _("loading transaction from %s") % load_file)
          
          try:
-@@ -1533,5 +3262,406 @@ class LoadTransactionCommand(YumCommand):
+@@ -1533,5 +3262,417 @@ class LoadTransactionCommand(YumCommand):
  
  
      def needTs(self, base, basecmd, extcmds):
@@ -199756,6 +199938,7 @@ index 4dcbea7..2f789a7 100644
 +                 'erase-or-distribution-synchronization' : 'remove-or-sync',
 +                 'remove-or-distribution-synchronization' : 'remove-or-sync',
 +                 'upgrade' : 'update', # Hack, but meh.
++                 'upgrade-to' : 'update-to', # Hack, but meh.
 +                 }
 +        cmd = remap.get(cmd, cmd)
 +
@@ -199785,6 +199968,16 @@ index 4dcbea7..2f789a7 100644
 +                return 2, P_('%d package to update', '%d packages to update',
 +                             num)
 +
++        elif cmd == 'update-to': # update is basically the same as install...
++            for arg in args:
++                txmbrs = base.update(pattern=arg, update_to=True, repoid=repoid)
++                _add_repopkg2txmbrs(txmbrs, repoid)
++                num += len(txmbrs)
++
++            if num:
++                return 2, P_('%d package to update', '%d packages to update',
++                             num)
++
 +        elif cmd in ('reinstall-old', 'reinstall-installed'):
 +            #  We have to choose for reinstall, for "reinstall foo" do we mean:
 +            # 1. reinstall the packages that are currently installed from "foo".
diff --git a/yum.spec b/yum.spec
index db83572..85a0aa6 100644
--- a/yum.spec
+++ b/yum.spec
@@ -36,7 +36,7 @@
 Summary: RPM package installer/updater/manager
 Name: yum
 Version: 3.4.3
-Release: 81%{?dist}
+Release: 82%{?dist}
 License: GPLv2+
 Group: System Environment/Base
 Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz
@@ -394,6 +394,15 @@ exit 0
 %endif
 
 %changelog
+* Wed Apr 10 2013 Zdenek Pavlas <zpavlas at redhat.com> - 3.4.3-82
+- update to latest HEAD.
+- resolveDeps: Keep installedFileRequires in sync. BZ 920758
+- completion helper: fix the "whitespace only" case. BZ 947827
+- get rid of invalid .rpm when applydeltarpm fails.  BZ 929367
+- add a "Finishing delta rebuilds" msg and a progress meter
+- Document autoremove, also mention config. options in remove command.
+- update documentation for exclude
+
 * Thu Mar 28 2013 James Antill <james at fedoraproject.org> - 3.4.3-81
 - update to latest HEAD.
 - Fix optional packages getting installed by default. BZ 923547.


More information about the scm-commits mailing list