2 commits - java/code schema/spacewalk
by Justin Sherrill
java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml | 32 ++-
schema/spacewalk/common/views/rhnServerNeededView.sql | 32 +++
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/002-rhnServerNeededView.sql | 81 ++++++++++
3 files changed, 132 insertions(+), 13 deletions(-)
New commits:
commit 68ff7beacd9da5ab561393d46faf233528fb4d04
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Thu May 20 11:13:54 2010 -0400
585965 - adding upgrade schema for bug
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/002-rhnServerNeededView.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/002-rhnServerNeededView.sql
new file mode 100644
index 0000000..c0f3555
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/002-rhnServerNeededView.sql
@@ -0,0 +1,81 @@
+--
+-- Copyright (c) 2008 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.
+--
+
+
+-- A view that displays an uncached version of rhnServerNeededCache
+
+CREATE OR REPLACE VIEW
+rhnServerNeededView
+(
+ org_id,
+ server_id,
+ errata_id,
+ package_id,
+ package_name_id,
+ channel_id
+)
+AS
+SELECT DISTINCT S.org_id,
+ S.id as server_id,
+ ep.errata_id as errata_id,
+ P.id as package_id,
+ P.name_id as package_name_id,
+ CP.channel_id as channel_id
+FROM
+ rhnPackage P
+ inner join rhnPackageEVR P_EVR on P_EVR.id = P.evr_id
+ inner join rhnPackageEVR SP_EVR on SP_EVR.evr < P_EVR.evr
+ inner join rhnServerPackage SP on SP.name_id = P.name_id
+ and SP.evr_id = SP_EVR.id
+ AND SP.evr_id != P.evr_id
+ inner join rhnServer S on SP.server_id = S.id
+ inner join rhnServerPackageArchCompat SPAC on spac.server_arch_id = s.server_arch_id
+ AND p.package_arch_id = spac.package_arch_id
+ inner join rhnServerChannel SC on SC.server_id = S.id
+ inner join rhnChannelPackage CP on CP.package_id = P.id
+ and SC.channel_id = CP.channel_id
+ left outer join rhnErrataPackage EP on EP.package_id = P.id
+ AND EXISTS
+ (SELECT 1 from rhnChannelErrata CE where ce.channel_id = SC.channel_id
+ AND CE.errata_id = EP.errata_id)
+ where
+ --- If the channel has more than 1 package with the same NVRE but different arches
+ --- Then we need to add an additional join condition (the server's package arch id)
+ P.package_arch_id = NVL2(
+ (select distinct 1
+ from rhnPackage P2 inner join rhnChannelPackage CP2
+ on P2.id = CP2.package_id
+ where CP2.channel_id = SC.channel_id and
+ P2.id = CP2.package_id and
+ P2.name_id = P.name_id
+ group by P2.evr_id having count(*) > 1),
+ NVL(SP.package_arch_id, P.package_arch_id),
+ P.package_arch_id
+ )
+ AND
+ --- If we can use arch to find the MAX EVR, use that
+ --- Otherwise just use whatever they have
+ SP_EVR.evr =
+ NVL(
+ (SELECT MAX(PE.evr) FROM rhnServerPackage SP2, rhnPackageEvr PE
+ WHERE PE.id = SP2.evr_id AND SP2.server_id = SP.server_id AND
+ SP2.name_id = SP.name_id
+ AND NVL(SP2.package_arch_id, P.package_arch_id) = P.package_arch_id
+ ),
+ (SELECT MAX(PE.evr) FROM rhnServerPackage SP2, rhnPackageEvr PE
+ WHERE PE.id = SP2.evr_id AND SP2.server_id = SP.server_id AND
+ SP2.name_id = SP.name_id)
+ )
+/
commit 7ff5c9d737d679513732e0b570e3ed8b5147aaed
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Thu May 20 11:12:25 2010 -0400
585965 - fixing issue with multilib packages and errata-cache generation, where updating one arch of a package would indicate that the other one was updated as well
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
index fae7400..3a00d2f 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
@@ -758,20 +758,32 @@ SELECT PN.id AS id,
INNER JOIN rhnPackageEVR PE on SP.evr_id = PE.id
LEFT JOIN rhnPackageArch PA on SP.package_arch_id = PA.id,
(
- SELECT SOP.package_name_id AS name_id, MAX(PE.evr) evr,
- SP.package_arch_id as arch_id, PA.label as arch_label
- FROM rhnServerOutdatedPackages SOP
- INNER JOIN rhnServerPackage SP on SP.server_id = SOP.server_id
- INNER JOIN rhnPackageEVR PE on SOP.package_evr_id = PE.id
- LEFT JOIN rhnPackageArch PA on PA.id = SP.package_arch_id
- WHERE SOP.server_id = :sid
- AND SOP.package_name_id = SP.name_id
- GROUP BY SOP.package_name_id, SP.package_arch_id, PA.label
+ SELECT P.name_id AS name_id, MAX(PE.evr) evr,
+ P.package_arch_id as arch_id, PA.label as arch_label
+ FROM rhnServerNeededCache SNC inner join
+ rhnPackage P on SNC.package_Id = P.id inner join
+ rhnPackageEVR PE on P.evr_id = PE.id inner join
+ rhnPackageArch PA on PA.id = P.package_arch_id
+ WHERE SNC.server_id = :sid
+ GROUP BY P.name_id, P.package_arch_id, PA.label
) latest
WHERE latest.name_id = PN.id
AND SP.server_id = :sid
AND SP.name_id = PN.id
- AND (SP.package_arch_id IS NULL OR SP.package_arch_id = latest.arch_id)
+ AND (SP.package_arch_id IS NULL OR SP.package_arch_id =
+ -- If the server has more than one package of this name installed
+ -- Then group by arch, otherwise just use whever is there
+ NVL2(
+ (select 1 from rhnServerPackage sp2
+ where
+ sp2.name_id = latest.name_id and
+ sp2.server_id = :sid
+ group by sp2.name_id having count(*) > 1
+ ),
+ latest.arch_id,
+ SP.package_arch_id)
+
+ )
ORDER BY UPPER(PN.name)
</query>
<elaborator multiple="t" params="sid">
diff --git a/schema/spacewalk/common/views/rhnServerNeededView.sql b/schema/spacewalk/common/views/rhnServerNeededView.sql
index 7baaa14..c0f3555 100644
--- a/schema/spacewalk/common/views/rhnServerNeededView.sql
+++ b/schema/spacewalk/common/views/rhnServerNeededView.sql
@@ -50,6 +50,32 @@ FROM
AND EXISTS
(SELECT 1 from rhnChannelErrata CE where ce.channel_id = SC.channel_id
AND CE.errata_id = EP.errata_id)
- where SP_EVR.evr = (SELECT MAX(PE.evr) FROM rhnServerPackage SP2, rhnPackageEvr PE
- WHERE PE.id = SP2.evr_id AND SP2.server_id = SP.server_id AND
- SP2.name_id = SP.name_id);
+ where
+ --- If the channel has more than 1 package with the same NVRE but different arches
+ --- Then we need to add an additional join condition (the server's package arch id)
+ P.package_arch_id = NVL2(
+ (select distinct 1
+ from rhnPackage P2 inner join rhnChannelPackage CP2
+ on P2.id = CP2.package_id
+ where CP2.channel_id = SC.channel_id and
+ P2.id = CP2.package_id and
+ P2.name_id = P.name_id
+ group by P2.evr_id having count(*) > 1),
+ NVL(SP.package_arch_id, P.package_arch_id),
+ P.package_arch_id
+ )
+ AND
+ --- If we can use arch to find the MAX EVR, use that
+ --- Otherwise just use whatever they have
+ SP_EVR.evr =
+ NVL(
+ (SELECT MAX(PE.evr) FROM rhnServerPackage SP2, rhnPackageEvr PE
+ WHERE PE.id = SP2.evr_id AND SP2.server_id = SP.server_id AND
+ SP2.name_id = SP.name_id
+ AND NVL(SP2.package_arch_id, P.package_arch_id) = P.package_arch_id
+ ),
+ (SELECT MAX(PE.evr) FROM rhnServerPackage SP2, rhnPackageEvr PE
+ WHERE PE.id = SP2.evr_id AND SP2.server_id = SP.server_id AND
+ SP2.name_id = SP.name_id)
+ )
+/
13 years, 11 months
Branch 'yum-repo-sync' - java/code
by Shannon Hughes
java/code/webapp/WEB-INF/struts-config.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 0510b3f8b21f8b7a17846de30700eb970d9e338f
Author: Shannon Hughes <shughes(a)redhat.com>
Date: Wed May 19 15:13:29 2010 -0400
fixed incorrect url syntax for repocreate
diff --git a/java/code/webapp/WEB-INF/struts-config.xml b/java/code/webapp/WEB-INF/struts-config.xml
index 3e6dfae..a88818e 100644
--- a/java/code/webapp/WEB-INF/struts-config.xml
+++ b/java/code/webapp/WEB-INF/struts-config.xml
@@ -6620,7 +6620,7 @@
className="com.redhat.rhn.frontend.struts.RhnActionMapping">
<set-property property="acls" value="org_entitlement(rhn_provisioning); user_role(config_admin)"/>
<forward name="default"
- path="/WEB-INF/pages/channel/repo/repodetails.jsp"/>
+ path="/WEB-INF/pages/channel/manage/repo/repodetails.jsp"/>
<forward name="success"
path="/channels/manage/repo/RepoEdit.do" redirect = "true"
/>
@@ -6634,7 +6634,7 @@
className="com.redhat.rhn.frontend.struts.RhnActionMapping">
<set-property property="acls" value="org_entitlement(rhn_provisioning); user_role(config_admin)"/>
<forward name="default"
- path="/WEB-INF/pages/channel/repo/repodetails.jsp"/>
+ path="/WEB-INF/pages/channel/manage/repo/repodetails.jsp"/>
<forward name="success"
path="/channels/manage/repo/RepoEdit.do" redirect = "true"/>
</action>
13 years, 11 months
Branch 'yum-repo-sync' - java/code
by Shannon Hughes
java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java | 21 +++------
java/code/src/com/redhat/rhn/manager/channel/repo/CreateRepoCommand.java | 22 +++++++++-
2 files changed, 29 insertions(+), 14 deletions(-)
New commits:
commit 623a75b26703a258e7dceb8240560ae3f4f09240
Author: Shannon Hughes <shughes(a)redhat.com>
Date: Wed May 19 14:36:09 2010 -0400
adding repo domain creation logic to manager/action layer
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java
index 57fadd9..4f7764f 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java
@@ -29,10 +29,12 @@ import org.apache.struts.action.DynaActionForm;
import com.redhat.rhn.common.validator.ValidatorException;
import com.redhat.rhn.common.validator.ValidatorResult;
import com.redhat.rhn.domain.channel.ContentSource;
+import com.redhat.rhn.domain.org.Org;
import com.redhat.rhn.frontend.struts.RequestContext;
import com.redhat.rhn.frontend.struts.RhnAction;
import com.redhat.rhn.frontend.struts.RhnHelper;
import com.redhat.rhn.frontend.struts.RhnValidationHelper;
+import com.redhat.rhn.manager.channel.repo.CreateRepoCommand;
/**
@@ -133,21 +135,14 @@ public class RepoDetailsAction extends RhnAction {
private ContentSource submit(HttpServletRequest request, DynaActionForm form) {
RequestContext context = new RequestContext(request);
-
String label = isCreateMode(request) ?
form.getString(LABEL) : form.getString(OLD_LABEL);
+ String url = form.getString(URL);
+ Org org = context.getLoggedInUser().getOrg();
- /*
- CobblerSnippet snip = CobblerSnippet.createOrUpdate(
- isCreateMode(request),
- name,
- form.getString(CONTENTS),
- context.getLoggedInUser().getOrg());
- if (!isCreateMode(request) &&
- !form.getString(NAME).equals(form.getString(OLD_NAME))) {
- snip.rename(form.getString(NAME));
- }
- */
- return null;
+ CreateRepoCommand repoCmd = new CreateRepoCommand(label, url, org);
+ repoCmd.store();
+
+ return repoCmd.getNewRepo();
}
}
diff --git a/java/code/src/com/redhat/rhn/manager/channel/repo/CreateRepoCommand.java b/java/code/src/com/redhat/rhn/manager/channel/repo/CreateRepoCommand.java
index adec5e4..f9c1c73 100644
--- a/java/code/src/com/redhat/rhn/manager/channel/repo/CreateRepoCommand.java
+++ b/java/code/src/com/redhat/rhn/manager/channel/repo/CreateRepoCommand.java
@@ -22,6 +22,7 @@ import org.apache.log4j.Logger;
import com.redhat.rhn.common.validator.ValidatorError;
import com.redhat.rhn.domain.channel.ChannelFactory;
import com.redhat.rhn.domain.channel.ContentSource;
+import com.redhat.rhn.domain.org.Org;
/**
* CreateRepoCommand - Command to create a repo
@@ -31,6 +32,7 @@ public class CreateRepoCommand {
private String label;
private String url;
+ private Org org;
private ContentSource newRepo;
private List<ValidatorError> errors;
@@ -43,13 +45,30 @@ public class CreateRepoCommand {
* @param passwordIn to set for first user
* @param emailIn to set for first user
*/
- public CreateRepoCommand(String labelIn, String urlIn) {
+ public CreateRepoCommand(String labelIn, String urlIn, Org orgIn) {
this.label = labelIn;
this.url = urlIn;
+ this.org = orgIn;
}
/**
*
+ * @return Org of repo
+ */
+ public Org getOrg() {
+ return org;
+ }
+
+ /**
+ *
+ * @param org to set for repo
+ */
+ public void setOrg(Org org) {
+ this.org = org;
+ }
+
+ /**
+ *
* @return label for repo
*/
public String getLabel() {
@@ -94,6 +113,7 @@ public class CreateRepoCommand {
ContentSource repo = ChannelFactory.createRepo();
repo.setLabel(this.label);
repo.setSourceUrl(this.url);
+ repo.setOrg(this.org);
ChannelFactory.save(repo);
this.newRepo = repo;
}
13 years, 11 months
backend/satellite_tools backend/server
by Justin Sherrill
backend/satellite_tools/satsync.py | 8 +++++---
backend/server/importlib/backend.py | 16 ++++++++++++++--
backend/server/importlib/errataImport.py | 2 +-
backend/server/importlib/importLib.py | 9 +++++----
backend/server/importlib/packageImport.py | 2 +-
5 files changed, 26 insertions(+), 11 deletions(-)
New commits:
commit c191fcfb95e730a13666921c52ba6860669d89ac
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed May 19 10:59:33 2010 -0400
improving performance of linking packages during satellite-sync, and fixing issue where packages that are already imported, but not in the channel would not be linked
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 5f9fb35..28f479f 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -1070,7 +1070,7 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
# 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():
+ for channel, pids in self._channel_packages.items():
missing_packages[channel] = mp = []
if not pids:
@@ -1764,10 +1764,12 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
short_package_collection = sync_handlers.ShortPackageCollection()
package_collection = sync_handlers.PackageCollection()
uq_packages = {}
- for chn, package_ids in self._missing_channel_packages.items():
+ for chn, package_ids in self._channel_packages.items():
for pid in package_ids:
timestamp = short_package_collection.get_package_timestamp(pid)
- package = package_collection.get_package(pid, timestamp)
+ package = short_package_collection.get_package(pid, timestamp)
+ if not package:
+ continue
assert package is not None
channel_obj = {'label' : chn}
if uq_packages.has_key(pid):
diff --git a/backend/server/importlib/backend.py b/backend/server/importlib/backend.py
index ce874ee..68b213d 100644
--- a/backend/server/importlib/backend.py
+++ b/backend/server/importlib/backend.py
@@ -500,14 +500,26 @@ class Backend:
def lookupPackageGroups(self, hash):
self.__processHash('rhnPackageGroup', 'name', hash)
- def lookupPackages(self, packages, ignore_missing = 0):
+ def lookupPackages(self, packages, checksums, ignore_missing = 0):
# If nevra is enabled use checksum as primary key
self.validate_pks()
for package in packages:
if not isinstance(package, IncompletePackage):
raise TypeError("Expected an IncompletePackage instance, found %s" % \
str(type(package)))
- self.__lookupObjectCollection(packages, 'rhnPackage', ignore_missing)
+ for package in packages:
+ exception = None
+ for type, chksum in package['checksums'].iteritems():
+ package['checksum_id'] = checksums[(type, chksum)]
+ try:
+ self.__lookupObjectCollection([package], 'rhnPackage', ignore_missing)
+ exception = None
+ break
+ except InvalidPackageError, e:
+ exception = e
+ if exception:
+ raise exception
+
def lookupSolarisPackages(self, packages, ignore_missing=0):
for pkg in packages:
diff --git a/backend/server/importlib/errataImport.py b/backend/server/importlib/errataImport.py
index 08a023b..9eaf993 100644
--- a/backend/server/importlib/errataImport.py
+++ b/backend/server/importlib/errataImport.py
@@ -125,7 +125,7 @@ class ErrataImport(GenericPackageImport):
#fix oval info to populate the relevant dbtables
self._fix_erratum_oval_info(erratum)
- self.backend.lookupPackages(self.packages.values(), self.ignoreMissing)
+ self.backend.lookupPackages(self.packages.values(), self.checksums, self.ignoreMissing)
for erratum in self.batch:
self._fix_erratum_packages(erratum)
self._fix_erratum_file_channels(erratum)
diff --git a/backend/server/importlib/importLib.py b/backend/server/importlib/importLib.py
index 4d2601e..b439c06 100644
--- a/backend/server/importlib/importLib.py
+++ b/backend/server/importlib/importLib.py
@@ -695,10 +695,11 @@ class GenericPackageImport(Import):
if not self.package_arches.has_key(package.arch):
self.package_arches[package.arch] = None
-
- checksumTuple = (package['checksum_type'], package['checksum'])
- if not self.checksums.has_key(checksumTuple):
- self.checksums[checksumTuple] = None
+
+ for type, chksum in package['checksums'].iteritems():
+ checksumTuple = (type, chksum)
+ if not checksumTuple in self.checksums:
+ self.checksums[checksumTuple] = None
def _postprocessPackageNEVRA(self, package):
arch = self.package_arches[package.arch]
diff --git a/backend/server/importlib/packageImport.py b/backend/server/importlib/packageImport.py
index 38e1a17..8d0d1c4 100644
--- a/backend/server/importlib/packageImport.py
+++ b/backend/server/importlib/packageImport.py
@@ -113,7 +113,7 @@ class ChannelPackageSubscription(GenericPackageImport):
pass
def submit(self):
- self.backend.lookupPackages(self.batch)
+ self.backend.lookupPackages(self.batch, self.checksums)
try:
affected_channels = self.backend.subscribeToChannels(self.batch,
strict=self._strict_subscription)
13 years, 11 months
Branch 'yum-repo-sync' - 16 commits - backend/satellite_tools backend/server backend/spacewalk-backend.spec client/rhel client/tools rel-eng/packages rel-eng/rpm2pkg
by Shannon Hughes
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):
13 years, 11 months
Branch 'yum-repo-sync' - java/code
by Shannon Hughes
java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java | 43 ----------
1 file changed, 3 insertions(+), 40 deletions(-)
New commits:
commit d7c5f95ae190bb2d562bb69c57ad903cf0defaa9
Author: Shannon Hughes <shughes(a)redhat.com>
Date: Wed May 19 11:21:55 2010 -0400
pushing minor changes before master merge
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java
index 80101f9..57fadd9 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java
@@ -29,8 +29,6 @@ import org.apache.struts.action.DynaActionForm;
import com.redhat.rhn.common.validator.ValidatorException;
import com.redhat.rhn.common.validator.ValidatorResult;
import com.redhat.rhn.domain.channel.ContentSource;
-import com.redhat.rhn.domain.kickstart.cobbler.CobblerSnippet;
-import com.redhat.rhn.frontend.action.common.BadParameterException;
import com.redhat.rhn.frontend.struts.RequestContext;
import com.redhat.rhn.frontend.struts.RhnAction;
import com.redhat.rhn.frontend.struts.RhnHelper;
@@ -112,43 +110,6 @@ public class RepoDetailsAction extends RhnAction {
return Boolean.TRUE.equals(request.getAttribute(CREATE_MODE));
}
-
- /**
- * Helper method to get a cobbler snippet.. This code is in this
- * action because we need it to throw a "BadParameterException"
- * if the set up complains... Also it gets info from the request object
- * so this is the right place...
- * @param request the request
- * @param lookupParam the parameter to which the snippet name is bound..
- * @return the cobbler snippet parameter "name"
- */
- private static CobblerSnippet loadEditableSnippet(HttpServletRequest request,
- String lookupParam) {
- RequestContext context = new RequestContext(request);
- try {
- String name = context.getParam(lookupParam, true);
- return CobblerSnippet.loadEditable(name,
- context.getLoggedInUser().getOrg());
- }
- catch (ValidatorException ve) {
- LOG.error(ve);
- throw new BadParameterException(
- "The parameter " + LABEL + " is required.");
- }
- }
-
-
- /**
- * Helper method to get a cobbler snippet.. This code is in this
- * action because we need it to throw a "BadParameterException"
- * if the set up complains... Also it gets info from the request object
- * so this is the right place...
- * @param request the request
- * @return the cobbler snippet parameter "name"
- */
- static CobblerSnippet loadEditableRepo(HttpServletRequest request) {
- return loadEditableSnippet(request, LABEL);
- }
private void setupRepo(HttpServletRequest request, DynaActionForm form,
ContentSource repo) {
@@ -161,7 +122,7 @@ public class RepoDetailsAction extends RhnAction {
}
/**
- * Method to bind the cobbler snippet to a request
+ * Method to bind the repo to a request
* @param request the servlet request
* @param snip the snippet to bind
*/
@@ -171,6 +132,8 @@ public class RepoDetailsAction extends RhnAction {
private ContentSource submit(HttpServletRequest request, DynaActionForm form) {
RequestContext context = new RequestContext(request);
+
+
String label = isCreateMode(request) ?
form.getString(LABEL) : form.getString(OLD_LABEL);
13 years, 11 months
rel-eng/rpm2pkg
by Miroslav Suchý
rel-eng/rpm2pkg/rpm2pkg | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
New commits:
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
13 years, 11 months
client/rhel
by Milan Zazrivec
client/rhel/rhn-client-tools/rhn-client-tools.spec | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
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
13 years, 11 months
Changes to 'refs/tags/rhncfg-5.9.22-1'
by Michael Mraka
Tag 'rhncfg-5.9.22-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2010-05-19 09:37 +0000
Tagging package [rhncfg] version [5.9.22-1] in directory [client/tools/rhncfg/].
Changes since spacewalk-backend-1.1.15-1:
Michael Mraka (2):
593563 - fixed debug rutines according to checksum changes
Automatic commit of package [rhncfg] release [5.9.22-1].
---
client/tools/rhncfg/actions/configfiles.py | 7 +++++--
client/tools/rhncfg/rhncfg.spec | 5 ++++-
rel-eng/packages/rhncfg | 2 +-
3 files changed, 10 insertions(+), 4 deletions(-)
---
13 years, 11 months