backend/satellite_tools/satsync.py | 79 ++++--
backend/satellite_tools/syncCache.py | 16 -
backend/satellite_tools/sync_handlers.py | 3
backend/satellite_tools/xmlSource.py | 12
backend/server/importlib/backendLib.py | 2
backend/server/importlib/headerSource.py | 1
backend/spacewalk-backend.spec | 8
client/rhel/rhn-client-tools/Makefile.rhn-client-tools | 2
client/rhel/rhn-client-tools/rhn-client-tools.spec | 13 -
client/rhel/rhn-client-tools/setuptool.d/99rhn_register | 1
client/rhel/rhn-client-tools/setuptool.d/Makefile | 20 +
client/rhel/rhn-client-tools/src/up2date_client/hwdata.py | 173 --------------
client/tools/rhncfg/actions/configfiles.py | 7
client/tools/rhncfg/rhncfg.spec | 16 +
client/tools/rhnpush/rhnpush.spec | 11
rel-eng/packages/rhncfg | 2
rel-eng/packages/rhnpush | 2
rel-eng/packages/spacewalk-backend | 2
rel-eng/rpm2pkg/rpm2pkg | 5
19 files changed, 152 insertions(+), 223 deletions(-)
New commits:
commit b3102209d293b4d57b692fd0e6f75c2360bf19fd
Merge: d7c5f95... 52a0e8d...
Author: Shannon Hughes <shughes(a)redhat.com>
Date: Wed May 19 11:26:10 2010 -0400
Merge branch 'master' into repo
commit 52a0e8db39fd2f01ecbf02f2d6f9e695079f5261
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed May 19 14:27:45 2010 +0200
remove dist tag from file name and from pkginfo
diff --git a/rel-eng/rpm2pkg/rpm2pkg b/rel-eng/rpm2pkg/rpm2pkg
index ca02a98..61c5d88 100755
--- a/rel-eng/rpm2pkg/rpm2pkg
+++ b/rel-eng/rpm2pkg/rpm2pkg
@@ -135,7 +135,10 @@ PKG_NAME=RHAT$2
if [ "$RPM_ARCH" == 'sparc64' ] ; then RPM_ARCH='sparce' ; fi
read RPM_SUMMARY
} < <( rpm -qp --nosignature --qf
'%{name}\n%{version}\n%{release}\n%{arch}\n%{summary}\n' $RPM_FILE )
-PKG_FILE=$( echo $RPM_FILE | sed -e 's!\.noarch\.rpm$!.rpm!' -e
"s!^.*\(-.*-.*\)\.rpm\$!$PKG_NAME\1.pkg!" )
+PKG_FILE=$( echo $RPM_FILE | sed -e 's!\.noarch\.rpm$!.rpm!' -e
"s!^.*\(-.*-[0-9]*\)[^-]*\.rpm\$!$PKG_NAME\1.pkg!" )
+
+# remove dist tag
+RPM_RELEASE=$( echo RPM_RELEASE | sed -e 's!^\([0-9]*\).*!\1!' )
STAMP=$( date '+%Y%m%d-%H%M%S' )
if [ -f $PKG_FILE ] ; then
commit 4c16ad766fbad4924c54a64657cb0dc32e1890e5
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Wed May 19 13:46:43 2010 +0200
580489 - fix requires for rhn-setup-gnome
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec
b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index 1afa4bf..d84b63b 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -75,8 +75,14 @@ Group: System Environment/Base
Requires: %{name} = %{version}-%{release}
Requires: rhn-setup = %{version}-%{release}
Requires: pam >= 0.72
-Requires: pygtk2 pygtk2-libglade gnome-python2 gnome-python2-canvas
+Requires: pygtk2 pygtk2-libglade gnome-python2 gnome-python2-canvas
Requires: usermode-gtk
+%if 0%{?fedora} > 9 || 0%{?rhel} > 5
+Requires: gnome-python2-gnome gnome-python2-bonobo
+%endif
+%if 0%{?fedora} > 10 || 0%{?rhel} > 5
+Requires: liberation-sans-fonts
+%endif
%description -n rhn-setup-gnome
rhn-setup-gnome contains a GTK+ graphical interface for configuring and
commit 08436e76d1ad0d655f7d5dc5077a25c3d95f5ed6
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed May 19 11:37:10 2010 +0200
Automatic commit of package [rhncfg] release [5.9.22-1].
diff --git a/client/tools/rhncfg/rhncfg.spec b/client/tools/rhncfg/rhncfg.spec
index fbff830..eedeee7 100644
--- a/client/tools/rhncfg/rhncfg.spec
+++ b/client/tools/rhncfg/rhncfg.spec
@@ -8,7 +8,7 @@ Group: Applications/System
License: GPLv2 and Python
URL:
https://fedorahosted.org/spacewalk
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 5.9.21
+Version: 5.9.22
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -97,6 +97,9 @@ rm -rf $RPM_BUILD_ROOT
# $Id$
%changelog
+* Wed May 19 2010 Michael Mraka <michael.mraka(a)redhat.com> 5.9.22-1
+- 593563 - fixed debug rutines according to checksum changes
+
* Tue May 18 2010 Miroslav Suchý <msuchy(a)redhat.com> 5.9.21-1
- 515637 - add newline at the end so solaris will not strip last line
- 515637 - add newline at the end of file
diff --git a/rel-eng/packages/rhncfg b/rel-eng/packages/rhncfg
index 2d37d74..2cb0285 100644
--- a/rel-eng/packages/rhncfg
+++ b/rel-eng/packages/rhncfg
@@ -1 +1 @@
-5.9.21-1 client/tools/rhncfg/
+5.9.22-1 client/tools/rhncfg/
commit 0add7db89d13269547a8e9c0b9247bcc4ec3472f
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed May 19 11:33:57 2010 +0200
593563 - fixed debug rutines according to checksum changes
diff --git a/client/tools/rhncfg/actions/configfiles.py
b/client/tools/rhncfg/actions/configfiles.py
index ecbc1bf..8abcfbd 100755
--- a/client/tools/rhncfg/actions/configfiles.py
+++ b/client/tools/rhncfg/actions/configfiles.py
@@ -343,7 +343,8 @@ def format_file_string(file_list, keylist):
outstr
for key in keylist:
formatstr = "\n%s: %s"
- outstr = outstr + formatstr % (key, afile[key])
+ if key in afile:
+ outstr = outstr + formatstr % (key, afile[key])
outstr = outstr + "\n"
return outstr
@@ -366,6 +367,8 @@ def create_key_list():
'delim_start',
'delim_end',
'md5sum',
+ 'checksum_type',
+ 'checksum',
'file_contents',
]
#This dictionary associates each debug level (the key) with the index into key_list
(the value) at which
@@ -376,7 +379,7 @@ def create_key_list():
2 : 6,
3 : 8,
4 : 10,
- 5 : 12,
+ 5 : 14,
}
curr_debug = get_debug_level()
if curr_debug > 5:
commit f738a34cd0a65cb641a31c43a8e9d487f672aa9f
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed May 19 10:21:45 2010 +0200
Automatic commit of package [spacewalk-backend] release [1.1.15-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index c4793a7..5633e56 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -8,7 +8,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2
-Version: 1.1.14
+Version: 1.1.15
Release: 1%{?dist}
URL:
https://fedorahosted.org/spacewalk
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -632,6 +632,9 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Wed May 19 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.15-1
+- 589299 - excluded checksum_list from headers
+
* Tue May 18 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.14-1
- satellite-sync optimization
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 78f1d52..bb15411 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.1.14-1 backend/
+1.1.15-1 backend/
commit 535d853d0af87dc7f778770da6ee76ff5dbfabb1
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed May 19 10:16:03 2010 +0200
589299 - checksum_list field is used only in xml dump import not in direct rpm import
diff --git a/backend/server/importlib/headerSource.py
b/backend/server/importlib/headerSource.py
index edce53a..9fed42f 100644
--- a/backend/server/importlib/headerSource.py
+++ b/backend/server/importlib/headerSource.py
@@ -35,6 +35,7 @@ class rpmPackage(IncompletePackage):
# We set them differently
'checksum' : None,
'checksum_type' : None,
+ 'checksum_list' : None,
'sigchecksum' : None,
'sigchecksum_type' : None,
}
commit eda61dcd1f23769a4572220a89202096197d1046
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed May 19 09:32:06 2010 +0200
python-hwdata finaly made it into Fedora and Epel so we can remove from this package
and depend on python-hwdata
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec
b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index 1060818..1afa4bf 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -21,7 +21,7 @@ Requires: sh-utils
Requires: dbus-python
%if 0%{?fedora} > 12 || 0%{?rhel} > 5
Requires: python-gudev
-Requires: hwdata
+Requires: python-hwdata
%else
Requires: hal >= 0.5.8.1-52
%endif
@@ -164,7 +164,6 @@ make -f Makefile.rhn-client-tools test
%{_datadir}/rhn/up2date_client/config.*
%{_datadir}/rhn/up2date_client/haltree.*
%{_datadir}/rhn/up2date_client/hardware*
-%{_datadir}/rhn/up2date_client/hwdata.*
%{_datadir}/rhn/up2date_client/up2dateUtils.*
%{_datadir}/rhn/up2date_client/up2dateLog.*
%{_datadir}/rhn/up2date_client/up2dateErrors.*
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/hwdata.py
b/client/rhel/rhn-client-tools/src/up2date_client/hwdata.py
deleted file mode 100644
index 0dd8c38..0000000
--- a/client/rhel/rhn-client-tools/src/up2date_client/hwdata.py
+++ /dev/null
@@ -1,173 +0,0 @@
-#
-# Copyright (c) 1999--2010 Red Hat Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-#
http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-""" Query hwdata database and return decription of vendor and/or device.
"""
-
-class USB:
- """ Interace to usb.ids from hwdata package """
- filename = '/usr/share/hwdata/usb.ids'
- devices = None
-
- def __init__(self, filename=None):
- """ Load pci.ids from file to internal data structure.
- parameter 'filename' can specify location of this file
- """
- if filename:
- self.filename = filename
- else:
- self.filename = USB.filename
- self.cache = 1
-
- if self.cache and not USB.devices:
- # parse usb.ids
- USB.devices = {}
- for line in open(self.filename).readlines():
- l = line.split()
- if line.startswith('#'):
- if line.startswith('# List of known device classes, subclasses
and protocols'):
- break # end of database of devices, rest is protocols, types
etc.
- else:
- continue
- elif len(l) == 0:
- continue
- elif line.startswith('\t\t'):
- interface_id = l[0].lower()
- if len(l) > 2:
- interface_name = ' '.join(l[1:])
- else:
- interface_name = ''
- USB.devices[vendor][1][device][0][interface_id] = interface_name
- elif line.startswith('\t'):
- device = l[0].lower()
- device_name = ' '.join(l[1:])
- USB.devices[vendor][1][device] = [device_name, {}]
- else:
- vendor = l[0].lower()
- vendor_name = ' '.join(l[1:])
- if not USB.devices.has_key(vendor):
- USB.devices[vendor] = [vendor_name, {}]
- else: # this should not happen
- USB.devices[vendor][0] = vendor_name
-
- def get_vendor(self, vendor):
- """ Return description of vendor. Parameter is two byte code in
hexa.
- If vendor is unknown None is returned.
- """
- vendor = vendor.lower()
- if self.cache:
- if USB.devices.has_key(vendor):
- return USB.devices[vendor][0]
- else:
- return None
- else:
- raise # not implemented yet
-
- def get_device(self, vendor, device):
- """ Return description of device. Parameters are two byte code
variables in hexa.
- If device is unknown None is returned.
- """
- vendor = vendor.lower()
- device = device.lower()
- if self.cache:
- if USB.devices.has_key(vendor):
- if USB.devices[vendor][1].has_key(device):
- return USB.devices[vendor][1][device][0]
- else:
- return None
- else:
- return None
- else:
- raise # not implemented yet
-
-class PCI:
- """ Interace to pci.ids from hwdata package """
- filename = '/usr/share/hwdata/pci.ids'
- devices = None
-
- def __init__(self, filename=None):
- """ Load pci.ids from file to internal data structure.
- parameter 'filename' can specify location of this file
- """
- if filename:
- self.filename = filename
- else:
- self.filename = PCI.filename
- self.cache = 1
-
- if self.cache and not PCI.devices:
- # parse pci.ids
- pcirec = {}
- PCI.devices = {}
- for line in open(self.filename).readlines():
- l = line.split()
- if line.startswith('#'):
- continue
- elif len(l) == 0:
- continue
- elif line.startswith('\t\t'):
- subvendor = l[0].lower()
- if len(l) > 2:
- subdevice = l[1].lower()
- else:
- subdevice = ''
- if len(l) > 3:
- subsystem_name = ' '.join(l[2:])
- else:
- subsystem_name = ''
- if not PCI.devices.has_key(subvendor):
- PCI.devices[subvendor] = [vendor_name, {subdevice:
subsystem_name}]
- else: # this should not happen
- PCI.devices[subvendor][1][subdevice] = subsystem_name
- elif line.startswith('\t'):
- device = l[0].lower()
- device_name = ' '.join(l[1:])
- PCI.devices[vendor][1][device] = device_name
- else:
- vendor = l[0].lower()
- vendor_name = ' '.join(l[1:])
- if not PCI.devices.has_key(vendor):
- PCI.devices[vendor] = [vendor_name, {}]
- else: # this should not happen
- PCI.devices[vendor][0] = vendor_name
-
- def get_vendor(self, vendor):
- """ Return description of vendor. Parameter is two byte code in
hexa.
- If vendor is unknown None is returned.
- """
- vendor = vendor.lower()
- if self.cache:
- if PCI.devices.has_key(vendor):
- return PCI.devices[vendor][0]
- else:
- return None
- else:
- raise # not implemented yet
-
- def get_device(self, vendor, device):
- """ Return description of device. Parameters are two byte code
variables in hexa.
- If device is unknown None is returned.
- """
- vendor = vendor.lower()
- device = device.lower()
- if self.cache:
- if PCI.devices.has_key(vendor):
- if PCI.devices[vendor][1].has_key(device):
- return PCI.devices[vendor][1][device]
- else:
- return None
- else:
- return None
- else:
- raise # not implemented yet
commit 4b9f6b78c44f13ef8770937d5f37f2a8e54c03a5
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 18 14:08:15 2010 +0200
593194 - 99rhn_register to add RHN Register to setup's list of tools.
diff --git a/client/rhel/rhn-client-tools/Makefile.rhn-client-tools
b/client/rhel/rhn-client-tools/Makefile.rhn-client-tools
index d0ac0bb..f8a38b0 100644
--- a/client/rhel/rhn-client-tools/Makefile.rhn-client-tools
+++ b/client/rhel/rhn-client-tools/Makefile.rhn-client-tools
@@ -6,7 +6,7 @@ PREFIX ?=
MANPATH ?= /usr/share/man
# Dirs we need to walk into
-SUBDIRS = data etc-conf man po src
+SUBDIRS = data etc-conf man po setuptool.d src
# Handy defines
VERSION := $(shell echo `grep ^Version: rhn-client-tools.spec | awk '{ print
$$2 }'`)
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec
b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index fdfa1cb..1060818 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -225,6 +225,8 @@ make -f Makefile.rhn-client-tools test
%{_datadir}/rhn/up2date_client/tui.*
%{_datadir}/rhn/up2date_client/rhnreg_constants.*
+%{_datadir}/setuptool/setuptool.d/99rhn_register
+
%files -n rhn-setup-gnome
%defattr(-,root,root,-)
%{_datadir}/rhn/up2date_client/messageWindow.*
diff --git a/client/rhel/rhn-client-tools/setuptool.d/99rhn_register
b/client/rhel/rhn-client-tools/setuptool.d/99rhn_register
new file mode 100644
index 0000000..9a85330
--- /dev/null
+++ b/client/rhel/rhn-client-tools/setuptool.d/99rhn_register
@@ -0,0 +1 @@
+/usr/sbin/rhn_register|RHN Register
diff --git a/client/rhel/rhn-client-tools/setuptool.d/Makefile
b/client/rhel/rhn-client-tools/setuptool.d/Makefile
new file mode 100644
index 0000000..8953637
--- /dev/null
+++ b/client/rhel/rhn-client-tools/setuptool.d/Makefile
@@ -0,0 +1,20 @@
+
+PREFIX ?=
+
+DIR = /usr/share/setuptool/setuptool.d
+
+# INSTALL scripts
+INSTALL = install -p --verbose
+INSTALL_DIR = $(INSTALL) -m 755 -d
+INSTALL_DATA = $(INSTALL) -m 644
+
+all::
+
+$(DIR):
+ @$(INSTALL_DIR) $(PREFIX)$@
+
+install:: $(DIR)
+ $(INSTALL_DATA) 99rhn_register $(PREFIX)$(DIR)
+
+clean::
+
commit b0a7d5dc55f4347fe89bd0429759e4c05ba13514
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue May 18 17:05:01 2010 +0200
Automatic commit of package [rhnpush] release [5.5.1-1].
diff --git a/client/tools/rhnpush/rhnpush.spec b/client/tools/rhnpush/rhnpush.spec
index 5a62b85..6edb084 100644
--- a/client/tools/rhnpush/rhnpush.spec
+++ b/client/tools/rhnpush/rhnpush.spec
@@ -5,7 +5,7 @@ Summary: Common programs needed to be installed on the RHN
servers/proxies
Group: Applications/System
License: GPLv2
URL:
http://fedorahosted.org/spacewalk
-Version: 5.4.14
+Version: 5.5.1
Release: 1%{?dist}
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -50,6 +50,15 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man8/solaris2mpm.8*
%changelog
+* Tue May 18 2010 Miroslav Suchý <msuchy(a)redhat.com> 5.5.1-1
+- 470154 - arch can be optional, do not freak out if it is not present
+- 514805 - recognize X86 arch as i386
+- 516898 - workaround for patches which do not have packed most top directory
+- no need to copy file, we can operate directly on original
+- do not read one file twice
+- 559092 - recognize new sun patch cluster format
+- 569946 - normalize solaris "x86" value to rhn known value
+
* Mon Apr 19 2010 Michael Mraka <michael.mraka(a)redhat.com> 5.4.14-1
- 563630 - Enable proxy support for rhnpush
diff --git a/rel-eng/packages/rhnpush b/rel-eng/packages/rhnpush
index 76504b0..4cf6b1f 100644
--- a/rel-eng/packages/rhnpush
+++ b/rel-eng/packages/rhnpush
@@ -1 +1 @@
-5.4.14-1 client/tools/rhnpush/
+5.5.1-1 client/tools/rhnpush/
commit fb33af46f247e926e02759edbcb6139b369ee4d5
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue May 18 17:00:19 2010 +0200
Automatic commit of package [rhncfg] release [5.9.21-1].
diff --git a/client/tools/rhncfg/rhncfg.spec b/client/tools/rhncfg/rhncfg.spec
index 65d794a..fbff830 100644
--- a/client/tools/rhncfg/rhncfg.spec
+++ b/client/tools/rhncfg/rhncfg.spec
@@ -8,7 +8,7 @@ Group: Applications/System
License: GPLv2 and Python
URL:
https://fedorahosted.org/spacewalk
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 5.9.20
+Version: 5.9.21
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -97,6 +97,17 @@ rm -rf $RPM_BUILD_ROOT
# $Id$
%changelog
+* Tue May 18 2010 Miroslav Suchý <msuchy(a)redhat.com> 5.9.21-1
+- 515637 - add newline at the end so solaris will not strip last line
+- 515637 - add newline at the end of file
+- Add new rhncfg-client verify --only option to manpage
+ (joshua.roys(a)gtri.gatech.edu)
+- 587285 - provide a useful error message when lsetfilecon fails
+ (joshua.roys(a)gtri.gatech.edu)
+- Add an 'only' mode of operation to rhncfg-client verify
+ (joshua.roys(a)gtri.gatech.edu)
+- Make rhncfg-client verify use lstat (joshua.roys(a)gtri.gatech.edu)
+
* Mon Apr 19 2010 Michael Mraka <michael.mraka(a)redhat.com> 5.9.20-1
- More support for symlinks in rhncfg tools
- Add selinux output to rhncfg-client verify
diff --git a/rel-eng/packages/rhncfg b/rel-eng/packages/rhncfg
index b28f459..2d37d74 100644
--- a/rel-eng/packages/rhncfg
+++ b/rel-eng/packages/rhncfg
@@ -1 +1 @@
-5.9.20-1 client/tools/rhncfg/
+5.9.21-1 client/tools/rhncfg/
commit 8bb634e661667bb71323670f74b2fee648704144
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue May 18 16:41:24 2010 +0200
Automatic commit of package [spacewalk-backend] release [1.1.14-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 9178385..c4793a7 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -8,7 +8,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2
-Version: 1.1.13
+Version: 1.1.14
Release: 1%{?dist}
URL:
https://fedorahosted.org/spacewalk
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -632,6 +632,9 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Tue May 18 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.14-1
+- satellite-sync optimization
+
* Fri May 14 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.13-1
- fixed performance issue in satellite-sync
- update po files
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 72946a2..78f1d52 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.1.13-1 backend/
+1.1.14-1 backend/
commit dd70feb83dec51eb7b96b68cf34a17c738f6ec06
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue May 18 14:07:01 2010 +0200
exceptions are very expensive; if instance(..) is 60% faster
diff --git a/backend/satellite_tools/xmlSource.py b/backend/satellite_tools/xmlSource.py
index 7901f13..4b77fbd 100644
--- a/backend/satellite_tools/xmlSource.py
+++ b/backend/satellite_tools/xmlSource.py
@@ -342,18 +342,18 @@ def _stringify(data):
# Accelerate the most common cases
if isinstance(data, types.StringType):
return data
- try: return data.encode('UTF8')
- except AttributeError: pass
+ elif isinstance(data, types.UnicodeType):
+ return data.encode('UTF8')
return str(data)
def _dict_to_utf8(d):
# Convert the dictionary to have non-unocide key-value pairs
ret = {}
for k, v in d.items():
- try: k = k.encode('UTF8')
- except AttributeError: pass
- try: v = v.encode('UTF8')
- except AttributeError: pass
+ if isinstance(k,types.UnicodeType):
+ k = k.encode('UTF8')
+ if isinstance(v, types.UnicodeType):
+ v = v.encode('UTF8')
ret[k] = v
return ret
commit c1af4b827cbbd2d7347541aa34d58b1d8f6cac73
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue May 18 10:39:37 2010 +0200
time.strftime is 25% faster
save couple of minutes here
diff --git a/backend/server/importlib/backendLib.py
b/backend/server/importlib/backendLib.py
index f3f890d..260b2e5 100644
--- a/backend/server/importlib/backendLib.py
+++ b/backend/server/importlib/backendLib.py
@@ -31,7 +31,7 @@ def localtime(timestamp):
return _format_time(time.localtime(float(timestamp)))
def _format_time(time_tuple):
- return "%d-%02d-%02d %02d:%02d:%02d" % time_tuple[:6]
+ return time.strftime("%Y-%m-%d %H:%M:%S", time_tuple)
# Database datatypes
class DBtype:
commit 8dfcb8bdcc0bc86295532832a8ffc9a135e553b4
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 14 22:21:28 2010 +0200
made _hash_object_id 3 times faster
diff --git a/backend/satellite_tools/syncCache.py b/backend/satellite_tools/syncCache.py
index 2d7c0b5..c8662fb 100644
--- a/backend/satellite_tools/syncCache.py
+++ b/backend/satellite_tools/syncCache.py
@@ -56,17 +56,13 @@ class BaseCache:
def _hash_object_id(self, object_id, factor):
"""Given an object id (assumed to be
<label>-<number>), returns the
- last few digits for the number. For instance, (812345, 1000) should
+ last few digits for the number. For instance, (812345, 3) should
return 345"""
- object_id = str(object_id)
- # Compute the number of digits we need from the hash
- format = int(math.ceil(math.log10(factor)))
- # Format the template
- format = '%0' + str(format) + 'd'
# Grab the digits after -
num_id = string.split(object_id, '-')[-1]
- num_id = int(num_id) % factor
- return format % num_id
+ # get last 'factor' numbers
+ num_id = num_id[-factor:]
+ return num_id.rjust(factor,'0')
class ChannelCache(BaseCache):
def _get_key(self, object_id):
@@ -75,7 +71,7 @@ class ChannelCache(BaseCache):
class BasePackageCache(BaseCache):
_subdir = "__unknown__"
def _get_key(self, object_id):
- hash_val = self._hash_object_id(object_id, 100)
+ hash_val = self._hash_object_id(object_id, 2)
return os.path.join("satsync", self._subdir, hash_val, str(object_id))
class ShortPackageCache(BasePackageCache):
@@ -91,7 +87,7 @@ class SourcePackageCache(BasePackageCache):
class ErratumCache(BaseCache):
_subdir = "errata"
def _get_key(self, object_id):
- hash_val = self._hash_object_id(object_id, 10)
+ hash_val = self._hash_object_id(object_id, 1)
return os.path.join("satsync", self._subdir, hash_val, str(object_id))
class KickstartableTreesCache(BaseCache):
commit dddbef429d26067d482df5ade2909c276cacee56
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue May 18 16:03:50 2010 +0200
partially reverted commit 9ad7fbe8fd05accec78d8de5e65fb192e1ba4f6f
and ressurected short_packages
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 8c8adef..5f9fb35 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -88,6 +88,7 @@ class Runner:
'channels' : ['channel-families'],
'channel-families' : ['blacklists'],
'blacklists' : ['arches'],
+ 'short' : [''],
'download-errata' : ['errata'],
'download-packages' : [''],
'download-source-packages' : [''],
@@ -102,6 +103,7 @@ class Runner:
'arches',
'channels',
'blacklists',
+ 'short',
'download-packages',
'rpms',
'packages',
@@ -298,6 +300,16 @@ class Runner:
def _step_blacklists(self):
return self.syncer.processBlacklists()
+ def _step_short(self):
+ try:
+ return self.syncer.processShortPackages()
+ except xmlDiskSource.MissingXmlDiskSourceFileError, e:
+ msg= "ERROR: The dump is missing package data, use --no-rpms to skip
this step or fix the content to include package data."
+ log2disk(-1, msg)
+ log2stderr(-1, msg, cleanYN=1)
+ sys.exit(25)
+
+
def _step_download_packages(self):
return self.syncer.download_package_metadata()
@@ -840,6 +852,37 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
self._channel_packages[chn] = package_ids
self._avail_channel_packages[chn] = avail_package_ids
+ def processShortPackages(self):
+ log(1, ["", "Retrieving short package metadata (used for
indexing)"])
+
+ # Compute the unique packages and populate self._channel_packages
+ self._compute_unique_packages()
+
+ h = sync_handlers.get_short_package_handler()
+ stream_loader = StreamProducer(h)
+ if self.mountpoint:
+ s = xmlDiskSource.ShortPackageDiskSource(self.mountpoint)
+ stream_loader.set_disk_loader(s)
+ else:
+ s = self.xmlWireServer.getChannelShortPackagesXmlStream
+ stream_loader.set_wire_loader(s)
+
+ # OK, now uq_channel_packages only has the unique packages
+ for channel_label, package_ids in self._channel_packages.items():
+ # Pretend we fetch all packages
+ log(1, " Retrieving / parsing short package metadata: %s (%s)" %
+ (channel_label, len(package_ids)))
+
+ lm = self._channel_collection.get_channel_timestamp(channel_label)
+ channel_last_modified = int(rhnLib.timestamp(lm))
+
+ stream_loader.set_args(channel_label, channel_last_modified)
+ stream_loader.process(package_ids)
+
+ h.close()
+
+ self._diff_packages()
+
_query_compare_packages = """
select p.id, c.checksum_type, c.checksum, p.path, p.package_size,
TO_CHAR(p.last_modified, 'YYYYMMDDHH24MISS') last_modified
@@ -853,7 +896,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
"""
# XXX the "is null" condition will have to change in multiorg satellites
def _diff_packages(self):
- package_collection = sync_handlers.PackageCollection()
+ package_collection = sync_handlers.ShortPackageCollection()
h = rhnSQL.prepare(self._query_compare_packages)
missing_channel_packages = {}
@@ -987,6 +1030,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
if errcode:
# file doesn't match
fs_package = package_id
+ channel_package = package_id
path = db_path
else:
# upload package and reimport metadata
@@ -1024,6 +1068,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
missing_packages = {}
# First, determine what has to be downloaded
+ short_package_collection = sync_handlers.ShortPackageCollection()
package_collection = sync_handlers.PackageCollection()
for channel, pids in self._missing_channel_packages.items():
missing_packages[channel] = mp = []
@@ -1034,7 +1079,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
for pid in pids:
# XXX Catch errors
- timestamp = package_collection.get_package_timestamp(pid)
+ timestamp = short_package_collection.get_package_timestamp(pid)
if not package_collection.has_package(pid, timestamp):
# not in the cache
mp.append(pid)
@@ -1042,9 +1087,9 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
return missing_packages
def download_package_metadata(self):
-
- # Compute the unique packages and populate self._channel_packages
- self._compute_unique_packages()
+ log(1, ["", "Downloading package metadata"])
+ # Get the missing but uncached packages
+ missing_packages = self._missing_not_cached_packages()
h = sync_handlers.get_package_handler()
stream_loader = StreamProducer(h)
@@ -1055,12 +1100,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
s = self.xmlWireServer.getPackageXmlStream
stream_loader.set_wire_loader(s)
- log(1, ["", "Downloading package metadata"])
- # Get the missing but uncached packages
-# missing_packages = self._missing_not_cached_packages()
-
-
- for channel, pids in self._channel_packages.items():
+ for channel, pids in missing_packages.items():
package_count = len(pids)
log(1, messages.package_parsing % (channel,
@@ -1075,9 +1115,6 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
pb.redrawYN = 0
pb.printAll(1)
- lm = self._channel_collection.get_channel_timestamp(channel)
- channel_last_modified = int(rhnLib.timestamp(lm))
-
ss = SequenceServer(pids[:], nevermorethan=self._batch_size)
while not ss.doneYN():
chunk = ss.getChunk()
@@ -1090,8 +1127,6 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
h.close()
- self._diff_packages()
-
# Double-check that we got all the packages
missing_packages = self._missing_not_cached_packages()
for channel, pids in missing_packages.items():
@@ -1726,11 +1761,12 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
def _link_channel_packages(self):
log(1, ["", messages.link_channel_packages])
+ short_package_collection = sync_handlers.ShortPackageCollection()
package_collection = sync_handlers.PackageCollection()
uq_packages = {}
for chn, package_ids in self._missing_channel_packages.items():
for pid in package_ids:
- timestamp = package_collection.get_package_timestamp(pid)
+ timestamp = short_package_collection.get_package_timestamp(pid)
package = package_collection.get_package(pid, timestamp)
assert package is not None
channel_obj = {'label' : chn}
@@ -1764,13 +1800,14 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
""" short-circuit the most common case"""
if not chunk:
return []
+ short_package_collection = sync_handlers.ShortPackageCollection()
if sources:
package_collection = sync_handlers.SourcePackageCollection()
else:
package_collection = sync_handlers.PackageCollection()
batch = []
for pid in chunk:
- timestamp = package_collection.get_package_timestamp(pid)
+ timestamp = short_package_collection.get_package_timestamp(pid)
package = package_collection.get_package(pid, timestamp)
if package is None:
# not in the cache
@@ -1817,7 +1854,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
def _fix_erratum(self, erratum):
""" Replace the list of packages with references to short
packages"""
- sp_coll = sync_handlers.PackageCollection()
+ sp_coll = sync_handlers.ShortPackageCollection()
pids = unique(erratum['packages'])
# map all the pkgs objects to the erratum
packages = []
@@ -1873,6 +1910,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
def _fetch_packages(self, channel, missing_fs_packages, sources=0):
+ short_package_collection = sync_handlers.ShortPackageCollection()
if sources:
# acronym = "SRPM"
package_collection = sync_handlers.SourcePackageCollection()
@@ -1887,7 +1925,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
cfg = config.initUp2dateConfig()
for package_id, path in missing_fs_packages:
pkg_current = pkg_current + 1
- timestamp = package_collection.get_package_timestamp(package_id)
+ timestamp = short_package_collection.get_package_timestamp(package_id)
package = package_collection.get_package(package_id, timestamp)
checksum_type = package['checksum_type']
@@ -2351,6 +2389,7 @@ def processCommandline():
if actionDict['no-packages']:
actionDict['packages'] = 0
+ actionDict['short'] = 0
actionDict['download-packages'] = 0
actionDict['rpms'] = 0
diff --git a/backend/satellite_tools/sync_handlers.py
b/backend/satellite_tools/sync_handlers.py
index 59c74f8..7e79c3c 100644
--- a/backend/satellite_tools/sync_handlers.py
+++ b/backend/satellite_tools/sync_handlers.py
@@ -288,6 +288,9 @@ class PackageCollection(ShortPackageCollection):
def _init_cache(self):
self._cache = syncCache.PackageCache()
+ def get_package_timestamp(self, package_id):
+ raise NotImplementedError
+
class PackageContainer(xmlSource.PackageContainer):
def endItemCallback(self):