backend/satellite_tools/reposync.py
| 3
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
backend/server/rhnLib.py
| 2
client/rhel/rhn-client-tools/data/Makefile
| 19 +-
client/rhel/rhn-client-tools/data/gui.glade
| 16 -
client/rhel/rhn-client-tools/rhn-client-tools.spec
| 7
client/rhel/rhn-client-tools/src/up2date_client/Makefile
| 2
client/rhel/rhn-client-tools/src/up2date_client/hardware_gudev.py
| 17 +-
client/solaris/smartpm/build.py.props
| 3
client/solaris/smartpm/smartpm.spec
| 9 -
java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
| 32 ++-
java/code/src/com/redhat/rhn/domain/errata/Cve.hbm.xml
| 6
java/code/src/com/redhat/rhn/domain/errata/CveFactory.java
| 76 +++++++++
java/code/src/com/redhat/rhn/domain/errata/impl/UnpublishedErrata.hbm.xml
| 4
java/code/src/com/redhat/rhn/frontend/action/rhnpackage/ssm/SchedulePackageUpgradeAction.java
| 11 -
java/code/src/com/redhat/rhn/frontend/xmlrpc/errata/ErrataHandler.java
| 23 ++
rel-eng/packages/smartpm
| 2
schema/spacewalk/common/views/rhnServerNeededView.sql
| 32 +++
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/002-rhnServerNeededView.sql
| 81 ++++++++++
23 files changed, 327 insertions(+), 55 deletions(-)
New commits:
commit 71a8409f4d5fd1d6fa28b23998daa8217da9f470
Merge: 4adb574... 8c3dfa3...
Author: Shannon Hughes <shughes(a)redhat.com>
Date: Mon May 24 10:21:12 2010 -0400
Merge branch 'master' into repo
commit 8c3dfa382410941995ca798e85343a30ada1bdb2
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Mon May 24 15:12:44 2010 +0200
We don't need hwdata target anymore
This is to avoid build errors:
make[2]: *** No rule to make target `hwdata.py', needed by `all'. Stop.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/Makefile
b/client/rhel/rhn-client-tools/src/up2date_client/Makefile
index 876ba03..6f060e7 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/Makefile
+++ b/client/rhel/rhn-client-tools/src/up2date_client/Makefile
@@ -4,7 +4,7 @@
# rhn-client-tools and not here.
FILES := config gui hardware progress \
- haltree hardware_hal hardware_gudev hwdata \
+ haltree hardware_hal hardware_gudev \
up2dateUtils getMethod tui \
up2dateLog rpmUtils rhnreg transaction \
up2dateErrors rpcServer up2dateAuth \
commit c9ff354a333b038ffa5e86014072cbeebcb2e6ee
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Mon May 24 15:12:25 2010 +0200
580493 - use correct product logos in rhn_register (gui)
diff --git a/client/rhel/rhn-client-tools/data/Makefile
b/client/rhel/rhn-client-tools/data/Makefile
index 427fd24..bbbbc6f 100644
--- a/client/rhel/rhn-client-tools/data/Makefile
+++ b/client/rhel/rhn-client-tools/data/Makefile
@@ -25,9 +25,20 @@ INSTALL = install -p --verbose
INSTALL_DIR = $(INSTALL) -m 755 -d
INSTALL_DATA = $(INSTALL) -m 644
-# Handy defines
-PIXMAPS = /usr/share/firstboot/pixmaps/
-SHADOWMAN = shadowman-round-48.png
+# Fedora
+ifeq ($(shell test -f /usr/share/icons/hicolor/48x48/apps/fedora-logo-icon.png &&
echo "exists" ), exists)
+LOGO = /usr/share/icons/hicolor/48x48/apps/fedora-logo-icon.png
+endif
+
+# RHEL-5
+ifeq ($(shell test -f /usr/share/pixmaps/redhat/shadowman-round-48.png && echo
"exists" ), exists)
+LOGO = /usr/share/pixmaps/redhat/shadowman-round-48.png
+endif
+
+# RHEL-6
+ifeq ($(shell test -f /usr/share/icons/hicolor/48x48/apps/system-logo-icon.png &&
echo "exists" ), exists)
+LOGO = /usr/share/icons/hicolor/48x48/apps/system-logo-icon.png
+endif
# For subdirs, required exports
@@ -48,7 +59,7 @@ install:: $(DIRS)
$(INSTALL_DATA) up2date-icons/48x48/up2date.png $(PNG48_DIR)/
# this is lame and should be dealt with in the code
- sed -i -e "s|$(SHADOWMAN)|$(PIXMAPS)/$(SHADOWMAN)|g" \
+ sed -i -e "s|@@logo@@|$(LOGO)|g" \
$(RHNSHARE_DIR)/up2date_client/*glade
# This sucks. We should be able to use PIXMAP_DIR, but then when making
# an rpm prefix is set to something different than where it'll be when
diff --git a/client/rhel/rhn-client-tools/data/gui.glade
b/client/rhel/rhn-client-tools/data/gui.glade
index cf2cacc..af92d0f 100644
--- a/client/rhel/rhn-client-tools/data/gui.glade
+++ b/client/rhel/rhn-client-tools/data/gui.glade
@@ -33,7 +33,7 @@
<widget class="GnomeDruidPageStandard" id="startPage">
<property name="visible">True</property>
<property name="title" translatable="yes">Registering for
software updates</property>
- <property name="logo">shadowman-round-48.png</property>
+ <property name="logo">@@logo@@</property>
<signal name="next" handler="onStartPageNext"/>
<signal name="prepare" handler="onStartPagePrepare"/>
@@ -56,7 +56,7 @@
<widget class="GnomeDruidPageStandard" id="chooseServerPage">
<property name="visible">True</property>
<property name="title" translatable="yes">Choose an update
location</property>
- <property name="logo">shadowman-round-48.png</property>
+ <property name="logo">@@logo@@</property>
<signal name="next" handler="onChooseServerPageNext"/>
<signal name="back" handler="onChooseServerPageBack"/>
<signal name="prepare"
handler="onChooseServerPagePrepare"/>
@@ -80,7 +80,7 @@
<widget class="GnomeDruidPageStandard" id="loginPage">
<property name="visible">True</property>
<property name="title" translatable="yes">Enter your account
information</property>
- <property name="logo">shadowman-round-48.png</property>
+ <property name="logo">@@logo@@</property>
<signal name="next" handler="onLoginPageNext"/>
<signal name="back" handler="onLoginPageBack"/>
<signal name="prepare" handler="onLoginPagePrepare"/>
@@ -104,7 +104,7 @@
<widget class="GnomeDruidPageStandard"
id="chooseChannelPage">
<property name="visible">True</property>
<property name="title" translatable="yes">Select operating
system release</property>
- <property name="logo">shadowman-round-48.png</property>
+ <property name="logo">@@logo@@</property>
<signal name="next" handler="onChooseChannelPageNext"
last_modification_time="Fri, 22 Jun 2007 16:04:40 GMT"/>
<signal name="back" handler="onChooseChannelPageBack"
last_modification_time="Fri, 22 Jun 2007 16:05:05 GMT"/>
<signal name="prepare" handler="onChooseChannelPagePrepare"
last_modification_time="Fri, 22 Jun 2007 18:48:33 GMT"/>
@@ -128,7 +128,7 @@
<widget class="GnomeDruidPageStandard"
id="createProfilePage">
<property name="visible">True</property>
<property name="title" translatable="yes">Create your system
profile</property>
- <property name="logo">shadowman-round-48.png</property>
+ <property name="logo">@@logo@@</property>
<signal name="next" handler="onCreateProfilePageNext"/>
<signal name="back" handler="onCreateProfilePageBack"/>
<signal name="prepare"
handler="onCreateProfilePagePrepare"/>
@@ -152,7 +152,7 @@
<widget class="GnomeDruidPageStandard"
id="reviewSubscriptionPage">
<property name="visible">True</property>
<property name="title" translatable="yes">Review system
subscription details</property>
- <property name="logo">shadowman-round-48.png</property>
+ <property name="logo">@@logo@@</property>
<signal name="next"
handler="onReviewSubscriptionPageNext"/>
<signal name="prepare"
handler="onReviewSubscriptionPagePrepare"/>
@@ -175,7 +175,7 @@
<widget class="GnomeDruidPageStandard"
id="provideCertificatePage">
<property name="visible">True</property>
<property name="title" translatable="yes">Provide a security
certificate</property>
- <property name="logo">shadowman-round-48.png</property>
+ <property name="logo">@@logo@@</property>
<signal name="next"
handler="onProvideCertificatePageNext"/>
<signal name="back"
handler="onProvideCertificatePageBack"/>
@@ -198,7 +198,7 @@
<widget class="GnomeDruidPageStandard" id="finishPage">
<property name="visible">True</property>
<property name="title" translatable="yes"></property>
- <property name="logo">shadowman-round-48.png</property>
+ <property name="logo">@@logo@@</property>
<signal name="finish" handler="onFinishPageFinish"/>
<signal name="prepare" handler="onFinishPagePrepare"/>
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec
b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index d84b63b..25c8dc0 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -36,6 +36,13 @@ BuildRequires: gettext
BuildRequires: intltool
BuildRequires: desktop-file-utils
+%if 0%{?fedora}
+BuildRequires: fedora-logos
+%endif
+%if 0%{?rhel} > 4
+BuildRequires: redhat-logos
+%endif
+
# The following BuildRequires are for check only
%if 0%{?fedora} >= 12
BuildRequires: python-coverage
commit e214d2a7ef9eda39c1bdc8f591b4ed5eda084212
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon May 24 14:05:56 2010 +0200
Automatic commit of package [smartpm] minor release [0.2-3].
diff --git a/client/solaris/smartpm/smartpm.spec b/client/solaris/smartpm/smartpm.spec
index 88f910b..9e6f51b 100644
--- a/client/solaris/smartpm/smartpm.spec
+++ b/client/solaris/smartpm/smartpm.spec
@@ -11,7 +11,7 @@ Name: smartpm
Source0: smartpm-%{version}.tar.gz
Epoch: 1
Version: 0.2
-Release: 2
+Release: 3
License: GPLv2
Group: Applications/System
URL:
http://www.smartpm.org/
@@ -60,6 +60,10 @@ env %{__python} setup.py build
%{python_sitearch}/rhn/actions/solarispkgs.py*
%changelog
+* Mon May 24 2010 Miroslav Suchý <msuchy(a)redhat.com> 0.2-3
+- return smartpm back to 0.2 version and bump up epoch
+- 555659 - do not freak out when SUNW_PATCHID do not have SUN format
+
* Mon Apr 19 2010 Michael Mraka <michael.mraka(a)redhat.com> 0.5-1
- updated copyrights
diff --git a/rel-eng/packages/smartpm b/rel-eng/packages/smartpm
index 7b6a387..bcdb31b 100644
--- a/rel-eng/packages/smartpm
+++ b/rel-eng/packages/smartpm
@@ -1 +1 @@
-0.5-1 client/solaris/smartpm/
+0.2-3 client/solaris/smartpm/
commit bec9de64902ff9a193944723ab9d3b2e1b051bf7
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon May 24 14:05:31 2010 +0200
return smartpm back to 0.2 version
smartpm we use is version 0.2, we should never bump up the version
we should bump up release
diff --git a/client/solaris/smartpm/build.py.props
b/client/solaris/smartpm/build.py.props
new file mode 100644
index 0000000..ccc90ea
--- /dev/null
+++ b/client/solaris/smartpm/build.py.props
@@ -0,0 +1,3 @@
+[buildconfig]
+tagger = spacewalk.releng.tagger.ReleaseTagger
+
diff --git a/client/solaris/smartpm/smartpm.spec b/client/solaris/smartpm/smartpm.spec
index 6892047..88f910b 100644
--- a/client/solaris/smartpm/smartpm.spec
+++ b/client/solaris/smartpm/smartpm.spec
@@ -9,8 +9,9 @@
Summary: Next generation package handling tool
Name: smartpm
Source0: smartpm-%{version}.tar.gz
-Version: 0.5
-Release: 1
+Epoch: 1
+Version: 0.2
+Release: 2
License: GPLv2
Group: Applications/System
URL:
http://www.smartpm.org/
commit 517914a0881a0b32a8a2342eb76d75f3f221606e
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon May 24 11:57:38 2010 +0200
557059 - do not fail on IBM-ESXS controler where ID_PATH is not set
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/hardware_gudev.py
b/client/rhel/rhn-client-tools/src/up2date_client/hardware_gudev.py
index 040f6af..cf08a0a 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/hardware_gudev.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/hardware_gudev.py
@@ -83,12 +83,17 @@ def get_devices():
result_item['prop2'] =
device.get_property('ID_MODEL_ID')
if device.has_property('ID_BUS') and
device.get_property('ID_BUS') == 'scsi':
- path = device.get_property('ID_PATH')
- m = re.search('.*-scsi-(\d+):(\d+):(\d+):(\d+)', path)
- result_item['prop1'] = m.group(1) # DEV_HOST
- result_item['prop2'] = m.group(2) # DEV_ID
- result_item['prop3'] = m.group(3) # DEV_CHANNEL
- result_item['prop4'] = m.group(4) # DEV_LUN
+ if device.has_property('ID_PATH') or
device.has_property('DEVPATH'):
+ if device.has_property('ID_PATH'):
+ path = device.get_property('ID_PATH')
+ m = re.search('.*-scsi-(\d+):(\d+):(\d+):(\d+)', path)
+ else: # device.has_property('DEVPATH')
+ path = device.get_property('DEVPATH')
+ m = re.search('.*/(\d+):(\d+):(\d+):(\d+)/block/', path)
+ result_item['prop1'] = m.group(1) # DEV_HOST
+ result_item['prop2'] = m.group(2) # DEV_ID
+ result_item['prop3'] = m.group(3) # DEV_CHANNEL
+ result_item['prop4'] = m.group(4) # DEV_LUN
result.append(result_item)
return result
commit 55eacc4dd8dca55038e6b48b45eb5f7fc3e981fa
Author: Colin Coe <colin.coe(a)gmail.com>
Date: Sat May 22 00:14:15 2010 +0800
Update errata.setDetails to allow setting CVEs
diff --git a/java/code/src/com/redhat/rhn/domain/errata/Cve.hbm.xml
b/java/code/src/com/redhat/rhn/domain/errata/Cve.hbm.xml
index 322bef9..b877e4b 100644
--- a/java/code/src/com/redhat/rhn/domain/errata/Cve.hbm.xml
+++ b/java/code/src/com/redhat/rhn/domain/errata/Cve.hbm.xml
@@ -13,4 +13,8 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
</id>
<property name="name" column="name"
type="string" length="13" />
</class>
-</hibernate-mapping>
\ No newline at end of file
+ <query name="Cve.lookupByName">
+ <![CDATA[from com.redhat.rhn.domain.errata.Cve as cve
+ where cve.name = :name]]>
+ </query>
+</hibernate-mapping>
diff --git a/java/code/src/com/redhat/rhn/domain/errata/CveFactory.java
b/java/code/src/com/redhat/rhn/domain/errata/CveFactory.java
new file mode 100644
index 0000000..37ef309
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/domain/errata/CveFactory.java
@@ -0,0 +1,76 @@
+/**
+ * Copyright (c) 2009--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.
+ */
+package com.redhat.rhn.domain.errata;
+
+import com.redhat.rhn.common.db.datasource.DataResult;
+import com.redhat.rhn.common.db.datasource.ModeFactory;
+import com.redhat.rhn.common.db.datasource.SelectMode;
+import com.redhat.rhn.common.hibernate.HibernateFactory;
+import com.redhat.rhn.frontend.listview.ListControl;
+import com.redhat.rhn.frontend.listview.PageControl;
+
+import org.apache.commons.collections.IteratorUtils;
+import org.apache.log4j.Logger;
+import org.hibernate.Session;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * ErrataFactory - the singleton class used to fetch and store
+ * com.redhat.rhn.domain.errata.Errata objects from the
+ * database.
+ * @version $Rev$
+ */
+public class CveFactory extends HibernateFactory {
+
+ private static CveFactory singleton = new CveFactory();
+ private static Logger log = Logger.getLogger(CveFactory.class);
+
+ private CveFactory() {
+ super();
+ }
+
+ /**
+ * Get the Logger for the derived class so log messages
+ * show up on the correct class
+ */
+ protected Logger getLogger() {
+ return log;
+ }
+
+ /**
+ * Lookup a CVE by name
+ * @param name Name of CVE to be retrieved
+ */
+ public static Cve lookupByName(String name) {
+ Map params = new HashMap();
+ params.put("name", name);
+ return (Cve)singleton.lookupObjectByNamedQuery("Cve.lookupByName",
params);
+ }
+
+ /**
+ * Insert or Update a CVE.
+ * @param cve CVE to be stored in database.
+ */
+ public static void save(Cve cve) {
+ singleton.saveObject(cve);
+ }
+
+}
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/errata/ErrataHandler.java
b/java/code/src/com/redhat/rhn/frontend/xmlrpc/errata/ErrataHandler.java
index 98fc044..da694e3 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/errata/ErrataHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/errata/ErrataHandler.java
@@ -22,6 +22,8 @@ import com.redhat.rhn.domain.channel.Channel;
import com.redhat.rhn.domain.channel.ChannelFactory;
import com.redhat.rhn.domain.channel.InvalidChannelRoleException;
import com.redhat.rhn.domain.errata.Bug;
+import com.redhat.rhn.domain.errata.Cve;
+import com.redhat.rhn.domain.errata.CveFactory;
import com.redhat.rhn.domain.errata.Errata;
import com.redhat.rhn.domain.errata.ErrataFactory;
import com.redhat.rhn.domain.errata.Keyword;
@@ -282,6 +284,9 @@ public class ErrataHandler extends BaseHandler {
* #prop_desc("array", "keywords",
"'keywords' is the key into the struct")
* #array_single("string", "keyword - List of keywords to
associate
* with the errata.")
+ * #prop_desc("array", "CVEs", "'cves' is
the key into the struct")
+ * #array_single("string", "cves - List of CVEs to
associate
+ * with the errata.")
* #struct_end()
*
* @xmlrpc.returntype #return_int_success()
@@ -302,6 +307,7 @@ public class ErrataHandler extends BaseHandler {
validKeys.add("solution");
validKeys.add("bugs");
validKeys.add("keywords");
+ validKeys.add("cves");
validateMap(validKeys, details);
validKeys.clear();
@@ -387,6 +393,21 @@ public class ErrataHandler extends BaseHandler {
errata.addKeyword(keyword);
}
}
+ if (details.containsKey("cves")) {
+ if (errata.getCves() != null) {
+ errata.getCves().clear();
+ HibernateFactory.getSession().flush();
+ }
+ for (String cveName : (ArrayList<String>)
details.get("cves")) {
+ Cve c = CveFactory.lookupByName(cveName);
+ if (c == null) {
+ c = new Cve();
+ c.setName(cveName);
+ CveFactory.save(c);
+ }
+ errata.getCves().add(c);
+ }
+ }
// ALWAYS change the advisory to match, as we do in the UI.
errata.setAdvisory(errata.getAdvisoryName() + "-" +
@@ -394,7 +415,7 @@ public class ErrataHandler extends BaseHandler {
//Save the errata
ErrataManager.storeErrata(errata);
-
+
return 1;
}
commit 42eac072517650377ee76564f92623c34deb2662
Author: Colin Coe <colin.coe(a)gmail.com>
Date: Wed May 19 22:15:38 2010 +0800
Allow CVEs to be set on unpublished errata
diff --git a/java/code/src/com/redhat/rhn/domain/errata/impl/UnpublishedErrata.hbm.xml
b/java/code/src/com/redhat/rhn/domain/errata/impl/UnpublishedErrata.hbm.xml
index 029cb6c..6532a93 100644
--- a/java/code/src/com/redhat/rhn/domain/errata/impl/UnpublishedErrata.hbm.xml
+++ b/java/code/src/com/redhat/rhn/domain/errata/impl/UnpublishedErrata.hbm.xml
@@ -61,6 +61,10 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
<many-to-many class="com.redhat.rhn.domain.rhnpackage.Package"
column="package_id"/>
</set>
+ <set name="cves" lazy="true"
cascade="all-delete-orphan" table="rhnErrataCve">
+ <key column="errata_id"/>
+ <many-to-many column="cve_id"
class="com.redhat.rhn.domain.errata.Cve" />
+ </set>
<joined-subclass
name="com.redhat.rhn.domain.errata.impl.UnpublishedClonedErrata"
table="rhnErrataClonedTmp">
commit 374d06dc0e64334ee4e5445d5879c0857f92bda2
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu May 20 16:42:02 2010 +0200
string.maketrans("", "") sounds like a great plan...
diff --git a/backend/server/rhnLib.py b/backend/server/rhnLib.py
index 6f06df6..53e52e7 100644
--- a/backend/server/rhnLib.py
+++ b/backend/server/rhnLib.py
@@ -28,7 +28,7 @@ from rhnMapping import check_package_arch
# Utility function that removes \n\r from a string
def removeNewlines(str):
# Remove \n and \r from the string str
- return string.translate(str, string.maketrans("", ""),
"\n\r")
+ return string.translate(str, None, "\n\r")
def computeSignature(*fields):
# Init the hash
commit 4fea33f33cd851500c53fa63385e3e3cc0e34851
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu May 20 16:03:29 2010 +0200
let's check repo only once
diff --git a/backend/satellite_tools/reposync.py b/backend/satellite_tools/reposync.py
index cbb657f..0ec6517 100644
--- a/backend/satellite_tools/reposync.py
+++ b/backend/satellite_tools/reposync.py
@@ -137,6 +137,7 @@ class RepoSync:
if len(to_download) == 0:
self.print_msg("No new packages to download.")
+ is_non_local_repo = (self.url.find("file://") < 0)
for (index, pack) in enumerate(to_download):
"""download each package"""
# try/except/finally doesn't work in python 2.4 (RHEL5), so here's a
hack
@@ -155,7 +156,7 @@ class RepoSync:
raise
continue
finally:
- if self.url.find("file://") < 0:
+ if is_non_local_repo:
os.remove(path)
def upload_package(self, package, path):
commit 5e63202fa9be8adc5e54e1573384ff7a2050ef79
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Thu May 20 13:56:28 2010 -0400
585176 - fixing issue where packages were excluded from update on SSM upgradable
packages page when the packages had multiple arches
diff --git
a/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/ssm/SchedulePackageUpgradeAction.java
b/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/ssm/SchedulePackageUpgradeAction.java
index baad10b..5bdaeb2 100644
---
a/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/ssm/SchedulePackageUpgradeAction.java
+++
b/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/ssm/SchedulePackageUpgradeAction.java
@@ -23,6 +23,7 @@ import com.redhat.rhn.domain.rhnset.RhnSet;
import com.redhat.rhn.domain.rhnset.SetCleanup;
import com.redhat.rhn.domain.rhnset.RhnSetElement;
import com.redhat.rhn.domain.user.User;
+import com.redhat.rhn.frontend.dto.PackageDto;
import com.redhat.rhn.frontend.dto.PackageListItem;
import com.redhat.rhn.frontend.events.SsmUpgradePackagesEvent;
@@ -107,13 +108,13 @@ public class SchedulePackageUpgradeAction extends RhnAction
implements Listable
// bz465892 - As the selected packages are parsed, remove duplicates
// keeping the highest EVR
- Map<Long, PackageListItem> packageNameIdsToItems =
- new HashMap<Long, PackageListItem>(data.size());
+ Map<String, PackageListItem> packageNameIdsToItems =
+ new HashMap<String, PackageListItem>(data.size());
for (String idCombo : data) {
PackageListItem item = PackageListItem.parse(idCombo);
- PackageListItem existing = packageNameIdsToItems.get(item.getIdOne());
+ PackageListItem existing = packageNameIdsToItems.get(item.getIdOne() +
"|"+ item.getIdThree());
if (existing != null) {
String[] existingParts = splitEvr(existing.getNvre());
String[] itemParts = splitEvr(item.getNvre());
@@ -129,11 +130,11 @@ public class SchedulePackageUpgradeAction extends RhnAction
implements Listable
itemEvr.setRelease(itemParts[2]);
if (existingEvr.compareTo(itemEvr) < 0) {
- packageNameIdsToItems.put(item.getIdOne(), item);
+ packageNameIdsToItems.put(item.getIdOne() + "|"+
item.getIdThree(), item);
}
}
else {
- packageNameIdsToItems.put(item.getIdOne(), item);
+ packageNameIdsToItems.put(item.getIdOne() + "|"+
item.getIdThree(), item);
}
}
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)
+ )
+/
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)