backend/satellite_tools/satsync.py | 3 --
backend/satellite_tools/xmlSource.py | 17 ++++++++++++++
backend/server/Makefile | 2 -
backend/server/handlers/app/packages.py | 4 ++-
backend/server/importlib/headerSource.py | 7 ++++-
backend/server/importlib/packageImport.py | 8 ------
backend/server/importlib/test/test_solaris.py | 3 +-
backend/spacewalk-backend.spec | 1
web/modules/rhn/RHN/DB/DataSource/xml/General_queries.xml | 2 -
9 files changed, 31 insertions(+), 16 deletions(-)
New commits:
commit 4ab9be8003b04976fbef05789bc4ca3338945956
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Sat Jan 9 00:49:39 2010 +0100
added apache.py to specfile
diff --git a/backend/server/Makefile b/backend/server/Makefile
index 1f91e5f..f94f387 100644
--- a/backend/server/Makefile
+++ b/backend/server/Makefile
@@ -9,7 +9,7 @@ TOP = ..
SUBDIR = server
FILES = __init__ \
apacheServer apacheHandler apacheAuth apacheRequest \
- apacheUploadServer \
+ apache apacheUploadServer \
byterange \
configFilesHandler \
rhnAuthPAM rhnCapability rhnChannel rhnDatabaseCache \
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 8c6d9b8..7d52d4a 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -337,6 +337,7 @@ rm -f %{rhnconf}/rhnSecret.py*
%files server
%defattr(-,root,root)
# modules
+%{rhnroot}/server/apache.py*
%{rhnroot}/server/apacheAuth.py*
%{rhnroot}/server/apacheHandler.py*
%{rhnroot}/server/apacheRequest.py*
commit 82fd3605f72f09f095c266fec5e4e9340444b6a6
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Sat Jan 9 00:10:21 2010 +0100
fixed rpm*File import from old dumps
diff --git a/backend/satellite_tools/xmlSource.py b/backend/satellite_tools/xmlSource.py
index 9362589..d34ac1e 100644
--- a/backend/satellite_tools/xmlSource.py
+++ b/backend/satellite_tools/xmlSource.py
@@ -613,6 +613,15 @@ class FileItem(BaseItem):
'rhn-package-file-verifyflags': 'verifyflags',
'rhn-package-file-lang' : 'lang',
}
+ def populate(self, attributes, elements):
+ item = BaseItem.populate(self, attributes, elements)
+ if 'md5' in item:
+ # xml dumps < 3.5 (pre-sha256)
+ # if md5 is empty set empty checksum - e.g. for dirs and links
+ item['checksum_type'] = 'md5'
+ item['checksum'] = item['md5']
+ del(item['md5'])
+ return item
addItem(FileItem)
class DistItem(BaseItem):
commit 82c5fbe87f9c5bb3fd84a27d8cec1ca5e24e852d
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Sat Jan 9 00:02:13 2010 +0100
handling of md5sum in KickstartFile moved to xml parsing part
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index a100e31..10caff1 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -1423,9 +1423,6 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
relative_path = f['relative_path']
dest_path = os.path.join(base_path, relative_path)
timestamp = rhnLib.timestamp(f['last_modified'])
- if 'md5sum' in f: # old pre-sha256 kickstart export
- f['checksum_type'] = 'md5'
- f['checksum'] = f['md5sum']
file_size = f['file_size']
(errcode, ret_path) = self._verify_file(dest_path,
timestamp, file_size, f['checksum_type'],
f['checksum'])
diff --git a/backend/satellite_tools/xmlSource.py b/backend/satellite_tools/xmlSource.py
index bcbda5b..9362589 100644
--- a/backend/satellite_tools/xmlSource.py
+++ b/backend/satellite_tools/xmlSource.py
@@ -739,6 +739,14 @@ class KickstartFileItem(BaseItem):
'file-size' : 'file_size',
'last-modified' : 'last_modified',
}
+ def populate(self, attributes, elements):
+ item = BaseItem.populate(self, attributes, elements)
+ if item['md5sum']:
+ # xml dumps < 3.5 (pre-sha256)
+ item['checksum_type'] = 'md5'
+ item['checksum'] = item['md5sum']
+ del(item['md5sum'])
+ return item
addItem(KickstartFileItem)
#
commit c15c2f2c09e201f5e24bb4edea3b81a52cd3550d
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Jan 8 23:57:14 2010 +0100
Revert "moved md5sum->checksum transofmation from IncompletePackageItem to
BaseItem"
This reverts commit 958ed16f5b2cd8ab3608b803aad2fc9379275ec8.
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 10caff1..a100e31 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -1423,6 +1423,9 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
relative_path = f['relative_path']
dest_path = os.path.join(base_path, relative_path)
timestamp = rhnLib.timestamp(f['last_modified'])
+ if 'md5sum' in f: # old pre-sha256 kickstart export
+ f['checksum_type'] = 'md5'
+ f['checksum'] = f['md5sum']
file_size = f['file_size']
(errcode, ret_path) = self._verify_file(dest_path,
timestamp, file_size, f['checksum_type'],
f['checksum'])
diff --git a/backend/satellite_tools/xmlSource.py b/backend/satellite_tools/xmlSource.py
index d390726..bcbda5b 100644
--- a/backend/satellite_tools/xmlSource.py
+++ b/backend/satellite_tools/xmlSource.py
@@ -289,13 +289,6 @@ class BaseItem:
self.populateFromAttributes(item, attributes)
# Populate the item from sub-elements
self.populateFromElements(item, elements)
-
- if 'md5sum' in item:
- if item['md5sum']:
- # xml dumps < 3.5 (pre-sha256)
- item['checksum_type'] = 'md5'
- item['checksum'] = item['md5sum']
- del(item['md5sum'])
return item
@@ -484,6 +477,15 @@ class IncompletePackageItem(BaseItem):
'org-id' : 'org_id',
'checksum-type' : 'checksum_type', # xml dump 3.5
(sha256)
}
+
+ def populate(self, attributes, elements):
+ item = BaseItem.populate(self, attributes, elements)
+ if item['md5sum']:
+ # xml dumps < 3.5 (pre-sha256)
+ item['checksum_type'] = 'md5'
+ item['checksum'] = item['md5sum']
+ del(item['md5sum'])
+ return item
addItem(IncompletePackageItem)
class PackageItem(IncompletePackageItem):
commit 1df4bd1ebbd6b8670d0c81379adad790cdf9c0f9
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Jan 8 23:51:43 2010 +0100
directories and links were missing in file list
because the have checksum_id = NULL
diff --git a/web/modules/rhn/RHN/DB/DataSource/xml/General_queries.xml
b/web/modules/rhn/RHN/DB/DataSource/xml/General_queries.xml
index b30ed2c..cfe388b 100644
--- a/web/modules/rhn/RHN/DB/DataSource/xml/General_queries.xml
+++ b/web/modules/rhn/RHN/DB/DataSource/xml/General_queries.xml
@@ -113,7 +113,7 @@ SELECT C.name,
rhnChecksumView Cs
WHERE F.package_id = :pid
AND F.capability_id = C.id
- AND CS.id = F.checksum_id
+ AND CS.id (+) = F.checksum_id
ORDER BY UPPER(C.name)
</query>
</mode>
commit 213aa470e238e3c55e2e9ec92ed24a208e441ce2
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Jan 8 14:54:34 2010 +0100
one more forgotten checksum tuple
diff --git a/backend/server/importlib/test/test_solaris.py
b/backend/server/importlib/test/test_solaris.py
index a46bf8e..33d9c76 100644
--- a/backend/server/importlib/test/test_solaris.py
+++ b/backend/server/importlib/test/test_solaris.py
@@ -242,7 +242,8 @@ solaris_patch_sets = [
'version': '20050323',
},
size=1024,
- chekcsum=('md5','somecrap'),
+ checksum_type='md5',
+ checksum='somecrap',
path='/dev/null',
org_id=1,
channels=['solaris']
commit 0e189de90d11e55557e018d2ba4708bb21490dea
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Jan 8 14:49:20 2010 +0100
moved filedigest handling into rpmFile
diff --git a/backend/server/importlib/headerSource.py
b/backend/server/importlib/headerSource.py
index 2504bee..be39b30 100644
--- a/backend/server/importlib/headerSource.py
+++ b/backend/server/importlib/headerSource.py
@@ -23,7 +23,7 @@ import string
from importLib import File, Dependency, ChangeLog, Channel, \
IncompletePackage, Package, SourcePackage
from backendLib import gmtime, localtime
-from types import ListType, TupleType, IntType
+from types import ListType, TupleType, IntType, StringType
from common import log_debug
from spacewalk.common.checksum import getFileChecksum
@@ -229,6 +229,8 @@ class rpmBinaryPackage(Package, rpmPackage):
# duplicate dep, ignore
continue
else:
+ if tag == 'files':
+ hash['checksum_type'] = self['checksum_type']
obj.populate(hash)
self[tag].append(obj)
@@ -301,6 +303,9 @@ class rpmFile(File, ChangeLog):
if tm is not None and isinstance(tm, IntType):
# A UNIX timestamp
self['mtime'] = gmtime(tm)
+ if type(self['filedigest']) == StringType:
+ self['checksum'] = self['filedigest']
+ del(self['filedigest'])
class rpmProvides(Dependency):
# More mappings
diff --git a/backend/server/importlib/packageImport.py
b/backend/server/importlib/packageImport.py
index 33bf6c1..c6a5b1e 100644
--- a/backend/server/importlib/packageImport.py
+++ b/backend/server/importlib/packageImport.py
@@ -259,14 +259,6 @@ class PackageImport(ChannelPackageSubscription):
f['capability'] = nv
if not self.capabilities.has_key(nv):
self.capabilities[nv] = None
- if type(f['md5']) == StringType:
- # xml dumps < 3.5 (pre-sha256)
- f['checksum_type'] = 'md5'
- f['checksum'] = f['md5']
- elif type(f['filedigest']) == StringType:
- # import via spacewalk-repo-sync
- f['checksum_type'] = package['checksum_type']
- f['checksum'] = f['filedigest']
fchecksumTuple = (f['checksum_type'], f['checksum'])
if not self.checksums.has_key(fchecksumTuple):
self.checksums[fchecksumTuple] = None
commit 2b123e33ea0070ced515b77a431c9d5ec54692fa
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Jan 8 12:27:04 2010 +0100
moved md5sum->checksum transofmation from IncompletePackageItem to BaseItem
which allowed removing similar code from KickstartFile sync handler
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index a100e31..10caff1 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -1423,9 +1423,6 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
relative_path = f['relative_path']
dest_path = os.path.join(base_path, relative_path)
timestamp = rhnLib.timestamp(f['last_modified'])
- if 'md5sum' in f: # old pre-sha256 kickstart export
- f['checksum_type'] = 'md5'
- f['checksum'] = f['md5sum']
file_size = f['file_size']
(errcode, ret_path) = self._verify_file(dest_path,
timestamp, file_size, f['checksum_type'],
f['checksum'])
diff --git a/backend/satellite_tools/xmlSource.py b/backend/satellite_tools/xmlSource.py
index bcbda5b..d390726 100644
--- a/backend/satellite_tools/xmlSource.py
+++ b/backend/satellite_tools/xmlSource.py
@@ -289,6 +289,13 @@ class BaseItem:
self.populateFromAttributes(item, attributes)
# Populate the item from sub-elements
self.populateFromElements(item, elements)
+
+ if 'md5sum' in item:
+ if item['md5sum']:
+ # xml dumps < 3.5 (pre-sha256)
+ item['checksum_type'] = 'md5'
+ item['checksum'] = item['md5sum']
+ del(item['md5sum'])
return item
@@ -477,15 +484,6 @@ class IncompletePackageItem(BaseItem):
'org-id' : 'org_id',
'checksum-type' : 'checksum_type', # xml dump 3.5
(sha256)
}
-
- def populate(self, attributes, elements):
- item = BaseItem.populate(self, attributes, elements)
- if item['md5sum']:
- # xml dumps < 3.5 (pre-sha256)
- item['checksum_type'] = 'md5'
- item['checksum'] = item['md5sum']
- del(item['md5sum'])
- return item
addItem(IncompletePackageItem)
class PackageItem(IncompletePackageItem):
commit 1561ae057eb71452747224e6f3c20c2d6544749d
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Jan 8 11:58:04 2010 +0100
one more forgotten checksum tuple
fixed pushing packages via old rhnpush:
While running 'packages.getPackageMD5sumBySession': caught
exceptions.KeyError : 'checksum_type'
diff --git a/backend/server/handlers/app/packages.py
b/backend/server/handlers/app/packages.py
index 2a24b63..b95f866 100644
--- a/backend/server/handlers/app/packages.py
+++ b/backend/server/handlers/app/packages.py
@@ -574,7 +574,9 @@ class Packages(RPC_Base):
pkg_infos = info.get('packages')
for pkg in pkg_infos.keys():
if pkg_infos[pkg].has_key('md5sum'):
- pkg_infos[pkg]['checksum'] = ('md5',
pkg_infos[pkg]['md5sum'])
+ pkg_infos[pkg]['checksum_type'] = 'md5'
+ pkg_infos[pkg]['checksum'] = pkg_infos[pkg]['md5sum']
+ del(pkg_infos[pkg]['md5sum'])
def _Checksum2MD5sum_list(self, checksum_list):
log_debug(5)