Compare commits

..

28 commits

Author SHA1 Message Date
Zdenek Pavlas
6d0388921c Fix a depsolver traceback. BZ 920758 2013-04-04 18:27:12 +02:00
Zdenek Pavlas
605e507300 fix bugs in package download and verify 2013-03-25 15:19:17 +01:00
Zdenek Pavlas
f14f2b26c6 ui_id: prevent TB on invalid repos with no URLs. BZ 870691 2013-03-11 11:23:32 +01:00
James Antill
c1c8e4faf3 Fix non-removal of corrupt metadata files. BZ 908870. 2013-02-19 19:44:26 -05:00
James Antill
eb9900ac1a Fix non-removal of corrupt metadata files. BZ 908870. 2013-02-19 19:43:20 -05:00
Zdenek Pavlas
1558c1c899 Revert last commit, bump the obsoleted range. BZ 905438 2013-02-19 09:32:16 +01:00
Zdenek Pavlas
0c6bada47c Conflict with yum-plugin-downloadonly. BZ 905438 2013-02-06 10:53:27 +01:00
Zdenek Pavlas
56fa7022d4 Fix a typo in select_groups(). BZ 885139 2013-01-16 15:16:49 +01:00
Zdeněk Pavlas
89bc912db7 Fix the BZ# in previous commit 2012-12-06 14:39:53 +01:00
Zdeněk Pavlas
55dc3db0ee Include langpacks when reading and writing comps. BZ 870753 2012-12-06 14:13:30 +01:00
Zdeněk Pavlas
c4c6a002e6 update yum-cron requires 2012-11-23 14:16:41 +01:00
James Antill
31cab97c3b update to latest HEAD.
- Minor upstream fixes, mainly for ppc64p7.
2012-10-23 16:52:56 -04:00
Zdeněk Pavlas
d7f313512e Update to latest HEAD 2012-10-02 13:24:53 +02:00
James Antill
ec16d690a4 update to latest HEAD.
- Write out groupid and not optionid, for environment groups.
2012-09-12 08:08:22 -04:00
James Antill
e33be8cea5 update to latest HEAD.
- Use .ui_id explicitly for backcompat. on strings, *sigh*.
2012-09-07 16:04:30 -04:00
Jesse Keating
26a29d4ff7 Fix the patch from HEAD, missing self. 2012-08-31 15:51:18 -07:00
James Antill
583723b96a update to latest HEAD.
- Don't statvfs when we aren't going to copy, and using relative.
2012-08-31 17:09:40 -04:00
James Antill
270f3be860 update to latest HEAD.
- Fix rel-eng problems when repo.repofile is None.
- Remove statvfs check for local files when we don't copy.
2012-08-30 16:15:43 -04:00
James Antill
ddff029bb3 update to latest HEAD.
- Fix rel-eng problems when repo.repofile is None.
2012-08-30 10:38:16 -04:00
Zdeněk Pavlas
75057add79 Update to latest HEAD 2012-08-29 17:40:49 +02:00
James Antill
7d4bfae15e Merge branch 'master' into f18
* master:
  update to latest HEAD.
2012-08-29 10:41:03 -04:00
James Antill
91f6da803f Merge branch 'master' into f18
* master:
  update to latest HEAD.
2012-08-28 16:19:39 -04:00
James Antill
3624839cc2 Merge in rawhide:
update to latest HEAD.

- Fix environment groups write.
- Allow merging of updateinfo.
- Add releasever/arch to repoids on output, if used in urls.
2012-08-28 16:12:51 -04:00
Zdeněk Pavlas
d98eeee7d8 Drop a local uncommited change from the previous commit 2012-08-27 11:41:33 +02:00
Zdeněk Pavlas
1acc8e5e6d Update to latest HEAD 2012-08-27 11:16:21 +02:00
Zdeněk Pavlas
93fed308e2 Fix a typo in checkfunc. BZ 850550 2012-08-22 10:47:48 +02:00
James Antill
1be1f4268b Merge remote-tracking branch 'origin/f18' into f18
* origin/f18:
  update to latest HEAD.
2012-08-16 23:17:37 -04:00
James Antill
d5b7fb97da update to latest HEAD.
- Big update, mostly for "environment groups".
2012-08-10 16:10:38 -04:00
23 changed files with 165414 additions and 1 deletions

7
.gitignore vendored Normal file
View file

@ -0,0 +1,7 @@
yum-3.2.27.tar.gz
yum-3.2.28.tar.gz
/yum-3.2.29.tar.gz
/yum-3.4.0.tar.gz
/yum-3.4.1.tar.gz
/yum-3.4.2.tar.gz
/yum-3.4.3.tar.gz

View file

@ -0,0 +1,113 @@
From yum-devel-bounces@lists.baseurl.org Thu Mar 15 04:54:11 2012
Return-Path: yum-devel-bounces@lists.baseurl.org
Received: from zmta01.collab.prod.int.phx2.redhat.com (LHLO
zmta01.collab.prod.int.phx2.redhat.com) (10.5.5.31) by
zmail17.collab.prod.int.phx2.redhat.com with LMTP; Thu, 15 Mar 2012
04:54:11 -0400 (EDT)
Received: from localhost (localhost.localdomain [127.0.0.1]) by
zmta01.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 2504011402A;
Thu, 15 Mar 2012 04:54:11 -0400 (EDT)
X-Quarantine-ID: <I+79tTMZeO4w>
Received: from zmta01.collab.prod.int.phx2.redhat.com ([127.0.0.1]) by
localhost (zmta01.collab.prod.int.phx2.redhat.com [127.0.0.1])
(amavisd-new, port 10024) with ESMTP id I+79tTMZeO4w; Thu, 15 Mar 2012
04:54:11 -0400 (EDT)
Received: from int-mx02.intmail.prod.int.phx2.redhat.com
(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by
zmta01.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id E8D74114011;
Thu, 15 Mar 2012 04:54:10 -0400 (EDT)
Received: from mx1.redhat.com (ext-mx11.extmail.prod.ext.phx2.redhat.com
[10.5.110.16]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8)
with ESMTP id q2F8sAi8004183; Thu, 15 Mar 2012 04:54:10 -0400
Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by
mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2F8s8Nd023630; Thu, 15 Mar
2012 04:54:08 -0400
Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org
(Postfix) with ESMTP id AB1CCA0378; Thu, 15 Mar 2012 08:54:08 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org
[127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JtdO5JgtXfRu; Thu, 15
Mar 2012 08:54:07 +0000 (UTC)
Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by
hemlock.osuosl.org (Postfix) with ESMTP id C4A10A036E; Thu, 15 Mar 2012
08:54:07 +0000 (UTC)
X-Original-To: yum-devel@lists.baseurl.org
Delivered-To: yum-devel@osuosl.org
Received: from whitealder.osuosl.org (whitealder.osuosl.org
[140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 3DBAC8F75B for
<yum-devel@lists.baseurl.org>; Thu, 15 Mar 2012 08:54:06 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org
(Postfix) with ESMTP id 0C5028FEF1 for <yum-devel@lists.baseurl.org>; Thu,
15 Mar 2012 08:54:06 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost
(.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id
FvpW+oEPmqRK for <yum-devel@lists.baseurl.org>; Thu, 15 Mar 2012 08:54:04
+0000 (UTC)
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by
whitealder.osuosl.org (Postfix) with ESMTP id 7D0108FBF1 for
<yum-devel@lists.baseurl.org>; Thu, 15 Mar 2012 08:54:04 +0000 (UTC)
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com
(8.14.4/8.14.4) with ESMTP id q2F8s3XU023619 (version=TLSv1/SSLv3
cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for
<yum-devel@lists.baseurl.org>; Thu, 15 Mar 2012 04:54:03 -0400
Received: from koblih.brq.redhat.com (koblih.brq.redhat.com [10.34.24.78])
by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id
q2F8s2qX018211 for <yum-devel@lists.baseurl.org>; Thu, 15 Mar 2012 04:54:03
-0400
From: =?UTF-8?q?Zden=C4=9Bk=20Pavlas?= <zpavlas@redhat.com>
To: yum-devel@lists.baseurl.org
Date: Thu, 15 Mar 2012 09:53:45 +0100
Message-Id: <1331801625-9070-1-git-send-email-zpavlas@redhat.com>
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12
X-Scanned-By: MIMEDefang 2.68 on 10.5.110.16
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
Subject: [Yum-devel] [PATCH] No "Only update available" msg when there is
not. BZ 803346
X-BeenThere: yum-devel@lists.baseurl.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: yum development <yum-devel@lists.baseurl.org>
List-Id: yum development <yum-devel.lists.baseurl.org>
List-Unsubscribe: <http://lists.baseurl.org/mailman/options/yum-devel>,
<mailto:yum-devel-request@lists.baseurl.org?subject=unsubscribe>
List-Archive: <http://lists.baseurl.org/pipermail/yum-devel>
List-Post: <mailto:yum-devel@lists.baseurl.org>
List-Help: <mailto:yum-devel-request@lists.baseurl.org?subject=help>
List-Subscribe: <http://lists.baseurl.org/mailman/listinfo/yum-devel>,
<mailto:yum-devel-request@lists.baseurl.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Errors-To: yum-devel-bounces@lists.baseurl.org
Sender: yum-devel-bounces@lists.baseurl.org
X-RedHat-Spam-Score: -2.3 (RCVD_IN_DNSWL_MED)
X-Evolution-Source: imap://jantill%40redhat.com@mail.corp.redhat.com/
Content-Transfer-Encoding: 8bit
---
yum/__init__.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/yum/__init__.py b/yum/__init__.py
index 3680356..6f7a69c 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -5075,6 +5075,8 @@ class YumBase(depsolve.Depsolve):
continue
if pkg.verGE(lipkg):
+ if pkg.verEQ(lipkg):
+ continue
if na not in warned_nas:
msg = _('Only Upgrade available on package: %s') % pkg
self.logger.critical(msg)
--
1.7.4.4
_______________________________________________
Yum-devel mailing list
Yum-devel@lists.baseurl.org
http://lists.baseurl.org/mailman/listinfo/yum-devel

View file

@ -0,0 +1,22 @@
commit 40d9d5f4c3a00b2efa6ee0b64fe4d1ec52d46a69
Author: Zdeněk Pavlas <zpavlas@redhat.com>
Date: Mon Oct 29 09:22:02 2012 +0100
ui_id: prevent TB on invalid repos with no URLs. BZ 870691.
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index e362c43..414f1d9 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -381,8 +381,10 @@ class YumRepository(Repository, config.RepoConf):
val = ini['metalink']
elif 'mirrorlist' in ini:
val = ini['mirrorlist']
- else:
+ elif 'baseurl' in ini:
val = ini['baseurl']
+ else:
+ val = ''
ret = self.id
if '$releasever' in val:
ret += '/'

View file

@ -0,0 +1,208 @@
From 6ef7823406da1e044ca188a9c96fe867a5e8c36f Mon Sep 17 00:00:00 2001
From: Daniel Mach <dmach@redhat.com>
Date: Tue, 16 Oct 2012 07:10:13 -0400
Subject: Include langpacks when reading and writing comps.
The <langpacks> comps section defines patterns used by the yum-langpacks plugin.
We want to keep them when writing comps.
---
yum/comps.py | 93 +++++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 80 insertions(+), 13 deletions(-)
diff --git a/yum/comps.py b/yum/comps.py
index 4e765ef..fe5649d 100755
--- a/yum/comps.py
+++ b/yum/comps.py
@@ -16,14 +16,14 @@
import types
import sys
-from constants import *
-from Errors import CompsException
+from yum.constants import *
+from yum.Errors import CompsException
#FIXME - compsexception isn't caught ANYWHERE so it's pointless to raise it
# switch all compsexceptions to grouperrors after api break
import fnmatch
import re
from yum.i18n import to_unicode
-from misc import get_my_lang_code
+from yum.misc import get_my_lang_code
from yum.misc import cElementTree_iterparse as iterparse
lang_attr = '{http://www.w3.org/XML/1998/namespace}lang'
@@ -281,7 +281,6 @@ class Group(CompsObj):
return msg
-
class Environment(CompsObj):
""" Environment object parsed from group data in each repo, and merged """
@@ -512,13 +511,61 @@ class Category(CompsObj):
msg += """ </category>\n"""
return msg
-
+
+class Langpacks(CompsObj):
+ def __init__(self, elem=None):
+ self.langpacks = []
+ self.name = "" # prevent CompsObj.__str__() throwing an AttributeError
+ if elem is not None:
+ self.parse(elem)
+
+ def __getitem__(self, indx):
+ return self.langpacks[indx]
+
+ def __iter__(self):
+ for i in self.langpacks:
+ yield i
+
+ def __len__(self):
+ return len(self.langpacks)
+
+ def add(self, name, install):
+ langpack = {
+ "name": name,
+ "install": install,
+ }
+ self.langpacks.append(langpack)
+
+ def parse(self, elem):
+ for child in elem:
+ if child.tag == "match":
+ langpack = {
+ "name": child.attrib.get("name"),
+ "install": child.attrib.get("install"),
+ }
+ self.langpacks.append(langpack)
+ else:
+ raise CompsException("Unexpected element in <langpacks>: %s" % child.tag)
+
+ self.name = elem.attrib.get("name")
+ self.install = elem.attrib.get("install")
+
+ def xml(self):
+ """write out an xml stanza for the Langpacks object"""
+ if not self.langpacks:
+ return ''
+ msg = ' <langpacks>\n'
+ for i in self:
+ msg += ' <match name="%s" install="%s"/>\n' % (i["name"], i["install"])
+ msg += ' </langpacks>\n'
+ return msg
class Comps(object):
def __init__(self, overwrite_groups=False):
self._groups = {}
self._environments = {}
self._categories = {}
+ self._langpacks = Langpacks()
self.compscount = 0
self.overwrite_groups = overwrite_groups
self.compiled = False # have groups been compiled into avail/installed
@@ -529,7 +576,7 @@ class Comps(object):
grps = self._groups.values()
grps.sort(key=lambda x: (x.display_order, x.name))
return grps
-
+
def get_environments(self):
environments = self._environments.values()
environments.sort(key=lambda x: (x.display_order, x.name))
@@ -539,10 +586,14 @@ class Comps(object):
cats = self._categories.values()
cats.sort(key=lambda x: (x.display_order, x.name))
return cats
+
+ def get_langpacks(self):
+ return self._langpacks
groups = property(get_groups)
environments = property(get_environments)
categories = property(get_categories)
+ langpacks = property(get_langpacks)
def has_group(self, grpid):
exists = self.return_groups(grpid)
@@ -703,6 +754,9 @@ class Comps(object):
else:
self._categories[category.categoryid] = category
+ def add_langpack(self, name, install):
+ self._langpacks.add(name, install)
+
def add(self, srcfile = None):
if not srcfile:
raise CompsException
@@ -732,6 +786,8 @@ class Comps(object):
if elem.tag == "category":
category = Category(elem)
self.add_category(category)
+ if elem.tag == "langpacks":
+ self._langpacks.parse(elem)
except SyntaxError, e:
raise CompsException, "comps file is empty/damaged"
@@ -791,7 +847,7 @@ class Comps(object):
"""returns the xml of the comps files in this class, merged"""
if not self._groups and not self._categories and \
- not self._environments:
+ not self._environments and not len(self._langpacks):
return ""
msg = """<?xml version="1.0" encoding="UTF-8"?>
@@ -805,7 +861,7 @@ class Comps(object):
msg += c.xml()
for e in self.get_environments():
msg += e.xml()
-
+ msg += self.get_langpacks().xml()
msg += """\n</comps>\n"""
return msg
@@ -820,23 +876,34 @@ def main():
for srcfile in sys.argv[1:]:
p.add(srcfile)
+ print
+ print "===== GROUPS ====="
for group in p.groups:
- print group
+ print "%s (id: %s)" % (group, group.groupid)
for pkg in group.packages:
print ' ' + pkg
-
+
+ print
+ print "===== ENVIRONMENTS ====="
for environment in p.environments:
- print environment.name
+ print "%s (id: %s)" % (environment.name, environment.environmentid)
for group in environment.groups:
print ' ' + group
for group in environment.options:
print ' *' + group
+ print
+ print "===== CATEGORIES ====="
for category in p.categories:
- print category.name
+ print "%s (id: %s)" % (category.name, category.categoryid)
for group in category.groups:
print ' ' + group
-
+
+ print
+ print "===== LANGPACKS ====="
+ for langpack in p.langpacks:
+ print ' %s (%s)' % (langpack["name"], langpack["install"])
+
except IOError:
print >> sys.stderr, "newcomps.py: No such file:\'%s\'" % sys.argv[1]
sys.exit(1)
--
1.7.4.4

View file

@ -0,0 +1,20 @@
commit 4687ffe032c1a4060da3ef670301df06d0faeb32
Author: Zdeněk Pavlas <zpavlas@redhat.com>
Date: Mon Dec 10 08:55:41 2012 +0100
selectGroup(): Fix a typo. BZ 885139
diff --git a/yum/__init__.py b/yum/__init__.py
index 6401645..63053af 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -3692,7 +3692,8 @@ much more problems).
if not upgrade and len(txmbrs_used) == old_txmbrs:
self.logger.critical(_('Warning: Group %s does not have any packages to install.'), thisgroup.groupid)
if count_cond_test:
- self.logger.critical(_('Group %s does have %u conditional packages, which may get installed.'), count_cond_test)
+ self.logger.critical(_('Group %s does have %u conditional packages, which may get installed.'),
+ thisgroup.groupid, count_cond_test)
return txmbrs_used
def deselectGroup(self, grpid, force=False):

View file

@ -0,0 +1,241 @@
commit 83fcbe745c3ee8f5f0fa29626a86c824db059b22
Author: James Antill <james@and.org>
Date: Thu Feb 7 12:58:07 2013 -0500
Fix problems with mirrors like wtfnix.com, delete bad MD files.
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index dfcf8f9..efbc42a 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -940,6 +941,7 @@ Insufficient space in download directory %s
range=(start, end),
)
except URLGrabError, e:
+ self._del_dl_file(local, size)
errstr = "failed to retrieve %s from %s\nerror was %s" % (relative, self, e)
if self.mirrorurls:
errstr +="\n You could try running: yum clean expire-cache"
@@ -961,6 +963,7 @@ Insufficient space in download directory %s
**kwargs
)
except URLGrabError, e:
+ self._del_dl_file(local, size)
errstr = "failure: %s from %s: %s" % (relative, self, e)
errors = getattr(e, 'errors', None)
raise Errors.NoMoreMirrorsRepoError(errstr, errors)
@@ -1652,6 +1655,18 @@ Insufficient space in download directory %s
raise URLGrabError(-1, 'repomd.xml does not match metalink for %s' %
self)
+ def _del_dl_file(self, local, size):
+ """ Delete a downloaded file if it's the correct size. """
+
+ sd = misc.stat_f(local)
+ if not sd: # File doesn't exist...
+ return
+
+ if size and sd.st_size < size:
+ return # Still more to get...
+
+ # Is the correct size, or too big ... delete it so we'll try again.
+ misc.unlink_f(local)
def checkMD(self, fn, mdtype, openchecksum=False):
"""check the metadata type against its checksum"""
@@ -1681,7 +1696,7 @@ Insufficient space in download directory %s
if size is not None:
size = int(size)
- if fast:
+ if fast and skip_old_DBMD_check:
fsize = misc.stat_f(file)
if fsize is None: # File doesn't exist...
return None
@@ -1756,16 +1771,21 @@ Insufficient space in download directory %s
try:
def checkfunc(obj):
- self.checkMD(obj, mdtype)
+ try:
+ self.checkMD(obj, mdtype)
+ except URLGrabError:
+ # Don't share MD among mirrors, in theory we could use:
+ # self._del_dl_file(local, int(thisdata.size))
+ # ...but this is safer.
+ misc.unlink_f(obj.filename)
+ raise
self.retrieved[mdtype] = 1
text = "%s/%s" % (self, mdtype)
if thisdata.size is None:
reget = None
else:
reget = 'simple'
- if os.path.exists(local):
- if os.stat(local).st_size >= int(thisdata.size):
- misc.unlink_f(local)
+ self._del_dl_file(local, int(thisdata.size))
local = self._getFile(relative=remote,
local=local,
copy_local=1,
commit c148eb10b798270b3d15087433c8efb2a79a69d0
Author: James Antill <james@and.org>
Date: Mon Feb 18 16:17:06 2013 -0500
Use xattr data as well as file size for "fast checksumming".
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index efbc42a..8c38093 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -52,15 +52,54 @@ import stat
import errno
import tempfile
-# If you want yum to _always_ check the MD .sqlite files then set this to
-# False (this doesn't affect .xml files or .sqilte files derived from them).
-# With this as True yum will only check when a new repomd.xml or
-# new MD is downloaded.
-# Note that with atomic MD, we can't have old MD lying around anymore so
-# the only way we need this check is if someone does something like:
-# cp primary.sqlite /var/cache/yum/blah
-# ...at which point you lose.
-skip_old_DBMD_check = True
+# This is unused now, probably nothing uses it but it was global/public.
+skip_old_DBMD_check = False
+
+try:
+ import xattr
+ if not hasattr(xattr, 'get') or not hasattr(xattr, 'set'):
+ xattr = None # This is a "newer" API.
+except ImportError:
+ xattr = None
+
+# The problem we are trying to solve here is that:
+#
+# 1. We rarely want to be downloading MD/pkgs/etc.
+# 2. We want to check those files are valid (match checksums) when we do
+# download them.
+# 3. We _really_ don't want to checksum all the files everytime we
+# run (100s of MBs).
+# 4. We can continue to download files from bad mirrors, or retry files due to
+# C-c etc.
+#
+# ...we used to solve this by just checking the file size, and assuming the
+# files had been downloaded and checksumed as correct if that matched. But that
+# was error prone on bad mirrors, so now we store the checksum in an
+# xattr ... this does mean that if you can't store xattrs (Eg. NFS) you will
+# rechecksum everything constantly.
+
+def _xattr_get_chksum(filename, chktype):
+ if not xattr:
+ return None
+
+ try:
+ ret = xattr.get(filename, 'user.yum.checksum.' + chktype)
+ except: # Documented to be "EnvironmentError", but make sure
+ return None
+
+ return ret
+
+def _xattr_set_chksum(filename, chktype, chksum):
+ if not xattr:
+ return None
+
+ try:
+ xattr.set(filename, 'user.yum.checksum.' + chktype, chksum)
+ except:
+ return False # Data too long. = IOError ... ignore everything.
+
+ return True
+
warnings.simplefilter("ignore", Errors.YumFutureDeprecationWarning)
@@ -228,7 +267,7 @@ class YumPackageSack(packageSack.PackageSack):
# get rid of all this stuff we don't need now
del repo.cacheHandler
- def _check_uncompressed_db_gen(self, repo, mdtype, fast=True):
+ def _check_uncompressed_db_gen(self, repo, mdtype):
"""return file name of db in gen/ dir if good, None if not"""
mydbdata = repo.repoXML.getData(mdtype)
@@ -238,7 +277,7 @@ class YumPackageSack(packageSack.PackageSack):
db_un_fn = mdtype + '.sqlite'
if not repo._checkMD(compressed_fn, mdtype, data=mydbdata,
- check_can_fail=fast, fast=fast):
+ check_can_fail=True):
return None
ret = misc.repo_gen_decompress(compressed_fn, db_un_fn,
@@ -261,8 +300,7 @@ class YumPackageSack(packageSack.PackageSack):
result = None
if os.path.exists(db_un_fn):
- if skip_old_DBMD_check and repo._using_old_MD:
- return db_un_fn
+
try:
repo.checkMD(db_un_fn, mdtype, openchecksum=True)
@@ -296,7 +334,6 @@ class YumRepository(Repository, config.RepoConf):
# eventually want
self.repoMDFile = 'repodata/repomd.xml'
self._repoXML = None
- self._using_old_MD = None
self._oldRepoMDData = {}
self.cache = 0
self.mirrorlistparsed = 0
@@ -1407,7 +1444,6 @@ Insufficient space in download directory %s
self._revertOldRepoXML()
return False
- self._using_old_MD = caching
if caching:
return False # Skip any work.
@@ -1673,7 +1709,7 @@ Insufficient space in download directory %s
return self._checkMD(fn, mdtype, openchecksum)
def _checkMD(self, fn, mdtype, openchecksum=False,
- data=None, check_can_fail=False, fast=False):
+ data=None, check_can_fail=False):
""" Internal function, use .checkMD() from outside yum. """
thisdata = data # So the argument name is nicer
@@ -1696,17 +1732,15 @@ Insufficient space in download directory %s
if size is not None:
size = int(size)
- if fast and skip_old_DBMD_check:
+ l_csum = _xattr_get_chksum(file, r_ctype)
+ if l_csum:
fsize = misc.stat_f(file)
- if fsize is None: # File doesn't exist...
- return None
- if size is None:
- return 1
- if size == fsize.st_size:
- return 1
- if check_can_fail:
- return None
- raise URLGrabError(-1, 'Metadata file does not match size')
+ if fsize is not None: # We just got an xattr, so it should be there
+ if size is None and l_csum == r_csum:
+ return 1
+ if size == fsize.st_size and l_csum == r_csum:
+ return 1
+ # Anything goes wrong, run the checksums as normal...
try: # get the local checksum
l_csum = self._checksum(r_ctype, file, datasize=size)
@@ -1716,6 +1750,7 @@ Insufficient space in download directory %s
raise URLGrabError(-3, 'Error performing checksum')
if l_csum == r_csum:
+ _xattr_set_chksum(file, r_ctype, l_csum)
return 1
else:
if check_can_fail:

View file

@ -0,0 +1,34 @@
diff -up yum-3.4.3/yum/depsolve.py.old yum-3.4.3/yum/depsolve.py
--- yum-3.4.3/yum/depsolve.py.old 2013-04-04 18:21:22.477786494 +0200
+++ yum-3.4.3/yum/depsolve.py 2013-04-04 18:22:48.742547795 +0200
@@ -918,6 +918,9 @@ class Depsolve(object):
self._last_req = None
self.pkgSack.delPackage(otxmbr.po)
self.up.delPackage(otxmbr.pkgtup)
+ # Update the cache and recheck file requires
+ (self.installedFileRequires or {}).pop(otxmbr.pkgtup, None)
+ CheckRemoves = True
if CheckDeps:
if self.dsCallback: self.dsCallback.restartLoop()
@@ -1177,10 +1180,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
@@ -1194,6 +1197,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:

View file

@ -0,0 +1,44 @@
commit fe21657d863708d48fe2ec4e056c37a1b676661c
Author: Zdeněk Pavlas <zpavlas@redhat.com>
Date: Wed Nov 14 09:51:26 2012 +0100
can't verify package before it's downloaded
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 6bf520f..4f5f7a6 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -993,7 +993,8 @@ Insufficient space in download directory %s
**kwargs
)
- if not package.verifyLocalPkg(): # Don't return as "success" when bad.
+ if not kwargs.get('async') and not package.verifyLocalPkg():
+ # Don't return as "success" when bad.
msg = "Downloaded package %s, from %s, but it was invalid."
msg = msg % (package, package.repo.id)
raise Errors.RepoError, msg
downloadPkgs: skip duplicated packages
diff -up yum-3.4.3/yum/__init__.py.old yum-3.4.3/yum/__init__.py
--- yum-3.4.3/yum/__init__.py.old 2013-03-25 14:45:17.125277817 +0100
+++ yum-3.4.3/yum/__init__.py 2013-03-25 14:48:31.158718960 +0100
@@ -2226,11 +2226,17 @@ much more problems).
repo_cached = False
remote_pkgs = []
remote_size = 0
+ beenthere = set() # only once, please. BZ 468401
for po in pkglist:
if hasattr(po, 'pkgtype') and po.pkgtype == 'local':
continue
local = po.localPkg()
+ if local in beenthere:
+ # This is definitely a depsolver bug. Make it fatal?
+ self.verbose_logger.warn(_("ignoring a dupe of %s") % po)
+ continue
+ beenthere.add(local)
if os.path.exists(local):
if not self.verifyPkg(local, po, False):
if po.repo.cache:

View file

@ -1 +0,0 @@
Superseded by DNF. For details, see: https://fedoraproject.org/wiki/Changes/Retire_YUM_3

16
geode-arch.patch Normal file
View file

@ -0,0 +1,16 @@
diff --git a/rpmUtils/arch.py b/rpmUtils/arch.py
index b493b6a..27c6d53 100644
--- a/rpmUtils/arch.py
+++ b/rpmUtils/arch.py
@@ -15,7 +15,7 @@ arches = {
# ia32
"athlon": "i686",
"i686": "i586",
- "geode": "i586",
+ "geode": "i686",
"i586": "i486",
"i486": "i386",
"i386": "noarch",
--
1.6.2.5

11
installonlyn-enable.patch Normal file
View file

@ -0,0 +1,11 @@
--- docs/yum.conf.5.orig 2010-06-21 17:39:17.000000000 -0400
+++ docs/yum.conf.5 2010-09-14 12:11:40.897615896 -0400
@@ -141,7 +141,7 @@
.IP
\fBinstallonly_limit \fR
Number of packages listed in installonlypkgs to keep installed at the same
-time. Setting to 0 disables this feature. Default is '0'. Note that this
+time. Setting to 0 disables this feature. Default is '3'. Note that this
functionality used to be in the "installonlyn" plugin, where this option was
altered via. tokeep.
Note that as of version 3.2.24, yum will now look in the yumdb for a installonly

28
latest-head4rawhide.sh Executable file
View file

@ -0,0 +1,28 @@
#! /bin/bash -e
done=false
if [ "x$1" = "xjames" ]; then
done=true
cvs=~/work/fedora/cvs/yum
git=~/work/rpm/private/yum
fi
if [ "x$1" = "xseth" ]; then
done=true
cvs=~/proj/fedora/yum/master
git=~/proj/yum/3.2.X
fi
if ! $done; then
echo " Usage: $0 james | seth" 1>&2
echo "" 1>&2
echo " This command copies the latest git HEAD into Fedora rawhide," 1>&2
echo " working out the versions automatically. It also makes the" 1>&2
echo " diff between HEADs as minimal as possible. " 1>&2
exit 1
fi
cd $cvs
ver=$(/usr/bin/fedpkg verrel | perl -lpe 's/-[^-]+$//' | sed s/\\\./-/g)
cd $git
git diff -r $ver..HEAD > $cvs/yum-HEAD.patch

View file

@ -0,0 +1,13 @@
--- yum/config.py~ 2009-07-22 12:47:52.000000000 -0400
+++ yum/config.py 2009-07-22 12:48:39.000000000 -0400
@@ -631,9 +631,7 @@
names_of_0=["0", "<off>"])
kernelpkgnames = ListOption(['kernel','kernel-smp', 'kernel-enterprise',
'kernel-bigmem', 'kernel-BOOT', 'kernel-PAE', 'kernel-PAE-debug'])
- exactarchlist = ListOption(['kernel', 'kernel-smp',
- 'kernel-hugemem', 'kernel-enterprise', 'kernel-bigmem',
- 'kernel-devel', 'kernel-PAE', 'kernel-PAE-debug'])
+ exactarchlist = ListOption([])
tsflags = ListOption()
assumeyes = BoolOption(False)

View file

@ -0,0 +1,21 @@
diff --git a/rpmUtils/transaction.py b/rpmUtils/transaction.py
index c5167d3..61d7ec0 100644
--- a/rpmUtils/transaction.py
+++ b/rpmUtils/transaction.py
@@ -13,7 +13,6 @@
import rpm
import miscutils
-from yum.i18n import to_str
read_ts = None
ts = None
@@ -56,7 +55,7 @@ class TransactionWrapper:
# Newer rpm (4.8.0+) has problem objects, older have just strings.
# Should probably move to using the new objects, when we can. For
# now just be compatible.
- results.append(to_str(prob))
+ results.append(str(prob))
return results

1
sources Normal file
View file

@ -0,0 +1 @@
7c8ea8beba5b4e7fe0c215e4ebaa26ed yum-3.4.3.tar.gz

163299
yum-HEAD.patch Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,11 @@
diff -up yum-3.4.3/completion-helper.py.old yum-3.4.3/completion-helper.py
--- yum-3.4.3/completion-helper.py.old 2012-08-22 17:00:47.444104234 +0200
+++ yum-3.4.3/completion-helper.py 2012-08-22 17:00:57.954647525 +0200
@@ -70,6 +70,7 @@ def get_pattern(extcmds):
def main(args):
base = cli.YumBaseCli()
+ base.setCacheDir = lambda *x: True # use the system cachedir
base.yum_cli_commands.clear()
base.registerCommand(GroupsCompletionCommand())
base.registerCommand(ListCompletionCommand())

19
yum-distro-configs.patch Normal file
View file

@ -0,0 +1,19 @@
diff -ru yum-3.4.3-orig/yum/config.py yum-3.4.3/yum/config.py
--- yum-3.4.3-orig/yum/config.py 2011-12-02 15:45:41.617448597 -0500
+++ yum-3.4.3/yum/config.py 2011-12-02 15:46:20.576285275 -0500
@@ -45,10 +45,10 @@
# Alter/patch these to change the default checking...
__pkgs_gpgcheck_default__ = False
__repo_gpgcheck_default__ = False
-__main_multilib_policy_default__ = 'all'
-__main_failovermethod_default__ = 'roundrobin'
-__main_installonly_limit_default__ = 0
-__group_command_default__ = 'compat'
+__main_multilib_policy_default__ = 'best'
+__main_failovermethod_default__ = 'priority'
+__main_installonly_limit_default__ = 3
+__group_command_default__ = 'compat'
class Option(object):
"""
Only in yum-3.4.3/yum: config.py~

83
yum-manpage-files.patch Normal file
View file

@ -0,0 +1,83 @@
commit 102915d4d402493c48d434ae1d1756225c4468e0
Author: James Antill <james@and.org>
Date: Mon Jun 14 01:15:21 2010 -0400
Port manpage files path fixups.
diff --git a/docs/yum.8 b/docs/yum.8
index d5ede0a..3bdb408 100644
--- a/docs/yum.8
+++ b/docs/yum.8
@@ -568,7 +568,7 @@ option in yum.conf. For a plugin to work, the following conditions must be met:
1. The plugin module file must be installed in the plugin path as just
described.
.LP
-2. The global \fBplugins\fP option in /etc/yum/yum.conf must be set to `1'.
+2. The global \fBplugins\fP option in /etc/yum.conf must be set to `1'.
.LP
3. A configuration file for the plugin must exist in
/etc/yum/pluginconf.d/<plugin_name>.conf and the \fBenabled\fR setting in this
@@ -584,9 +584,9 @@ configuration options.
.PP
.SH "FILES"
.nf
-/etc/yum/yum.conf
+/etc/yum.conf
/etc/yum/version-groups.conf
-/etc/yum/repos.d/
+/etc/yum.repos.d/
/etc/yum/pluginconf.d/
/var/cache/yum/
.fi
diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
index ca36103..42815b9 100644
--- a/docs/yum.conf.5
+++ b/docs/yum.conf.5
@@ -4,10 +4,10 @@
\fByum.conf\fR \- Configuration file for \fByum(8)\fR.
.SH "DESCRIPTION"
.LP
-Yum uses a configuration file at \fB/etc/yum/yum.conf\fR.
+Yum uses a configuration file at \fB/etc/yum.conf\fR.
.LP
Additional configuration files are also read from the directories set by the
-\fBreposdir\fR option (default is `/etc/yum/repos.d').
+\fBreposdir\fR option (default is `/etc/yum.repos.d').
See the \fBreposdir\fR option below for further details.
.SH "PARAMETERS"
@@ -42,10 +42,10 @@ of headers and packages after successful installation. Default is '1'
.IP
\fBreposdir\fR
A list of directories where yum should look for .repo files which define
-repositories to use. Default is `/etc/yum/repos.d'. Each
+repositories to use. Default is `/etc/yum.repos.d'. Each
file in this directory should contain one or more repository sections as
documented in \fB[repository] options\fR below. These will be merged with the
-repositories defined in /etc/yum/yum.conf to form the complete set of
+repositories defined in /etc/yum.conf to form the complete set of
repositories that yum will use.
.IP
@@ -745,8 +745,8 @@ for any given command. Defaults to False.
.SH "URL INCLUDE SYNTAX"
.LP
-The inclusion of external configuration files is supported for /etc/yum/yum.conf
-and the .repo files in the /etc/yum/repos.d directory. To include a URL, use a
+The inclusion of external configuration files is supported for /etc/yum.conf
+and the .repo files in the /etc/yum.repos.d directory. To include a URL, use a
line of the following format:
include=url://to/some/location
@@ -812,8 +812,8 @@ data in any value.
.SH "FILES"
.nf
-/etc/yum/yum.conf
-/etc/yum/repos.d/
+/etc/yum.conf
+/etc/yum.repos.d/
/etc/yum/pluginconf.d/
/etc/yum/protected.d
/etc/yum/vars

13
yum-ppc64-preferred.patch Normal file
View file

@ -0,0 +1,13 @@
diff -ru yum-3.4.3-orig/rpmUtils/arch.py yum-3.4.3/rpmUtils/arch.py
--- yum-3.4.3-orig/rpmUtils/arch.py 2011-06-28 17:01:10.009680846 -0400
+++ yum-3.4.3/rpmUtils/arch.py 2011-06-28 17:01:31.849916539 -0400
@@ -3,7 +3,7 @@
import ctypes
import struct
-_ppc64_native_is_best = False
+_ppc64_native_is_best = True
# dict mapping arch -> ( multicompat, best personality, biarch personality )
multilibArches = { "x86_64": ( "athlon", "x86_64", "athlon" ),
Only in yum-3.4.3/rpmUtils: arch.py~

15
yum-updatesd.conf.fedora Normal file
View file

@ -0,0 +1,15 @@
[main]
# how often to check for new updates (in seconds)
run_interval = 3600
# how often to allow checking on request (in seconds)
updaterefresh = 600
# how to send notifications (valid: dbus, email, syslog)
emit_via = dbus
# automatically install updates
do_update = no
# automatically download updates
do_download = no
# automatically download deps of updates
do_download_deps = no

23
yum.conf.fedora Normal file
View file

@ -0,0 +1,23 @@
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3
# This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
# It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

1172
yum.spec Normal file

File diff suppressed because it is too large Load diff