Older rpm versions have signed tag data, which results in negative
numbers for sizes > 2G.
If your yum-metadata-parser does not have the 2d8499c and ffdcc0b fixes,
then yum will read a repo, insert negative values into the sqlite3 db,
and spacewalk-reposync will put those negative values into the database.
The sizes being negative will prevent urlgrabber to get the rpm.
Even if you apply those fixes, then the rpm headers are read directly to
generate the metadata for the channel. Even if the size is positive
(thanks to the previous fix) the payload size will be read negative from
the rpm header and will appear negative in the user interface.
The following patch to spacewalk-backend (headerSource.py) removes the
sign to this value, resulting in a cosmetic fix in the UI.
I have another workaround patch to yum yumRepo.py that removes the sign
even if the value is coming from a sqlite3 db done without the
yum-metadata-parser fix. I include it, but that is optional to apply and
only a safeguard. Not sure yet if I should upstream it (including it
here for review though)
--
Duncan Mac-Vicar P. - http://www.suse.com/
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix
Imendörffer, HRB 16746 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany
diff --git a/backend/server/importlib/headerSource.py b/backend/server/importlib/headerSource.py
index 6b016ec..9d5ff8a 100644
--- a/backend/server/importlib/headerSource.py
+++ b/backend/server/importlib/headerSource.py
@@ -57,6 +57,11 @@ class rpmPackage(IncompletePackage):
if type(val) in (IntType, LongType):
# A UNIX timestamp
val = gmtime(val)
+ if f == 'payload_size':
+ # workaround for older rpms where signed
+ # attributes go negative for size > 2G
+ if val < 0:
+ val = long(val) + 2 ** 32
elif val:
# Convert to strings
if isinstance(val, unicode):
--- yumRepo.py 2013-02-12 10:30:18.000000000 +0100
+++ yumRepo.py.fix 2013-02-08 17:03:57.000000000 +0100
@@ -857,13 +857,17 @@
return local
misc.unlink_f(local)
+ fixed_size = long(package.size)
+ if fixed_size < 0:
+ fixed_size = fixed_size + 2 ** 64
+
return self._getFile(url=basepath,
relative=remote,
local=local,
checkfunc=checkfunc,
text=text,
cache=cache,
- size=package.size,
+ size=fixed_size,
)
def getHeader(self, package, checkfunc = None, reget = 'simple',
_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel