Changes to 'refs/tags/spacewalk-proxy-1.8.13-1'
by Michael Mraka
Tag 'spacewalk-proxy-1.8.13-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2012-10-23 11:39 +0000
Tagging package [spacewalk-proxy] version [1.8.13-1] in directory [proxy/proxy/].
Changes since spacewalk-utils-1.8.31-1:
Michael Mraka (2):
_processFile() from uploadLib is static
Automatic commit of package [spacewalk-proxy] release [1.8.13-1].
Milan Zazrivec (1):
Expose extra packages / systems with extra packages
Tomas Kasparek (1):
WebUI improvement, adding "Search Google for errata" on package details page.
Tomas Lestach (1):
853444 - do not list custom base channel twice in the base channel combo for an activation key
---
branding/img/rhn-icon-package_extra.gif |binary
java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml | 32 +++
java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml | 31 +++
java/code/src/com/redhat/rhn/frontend/action/rhnpackage/ExtraPackagesListAction.java | 37 ++++
java/code/src/com/redhat/rhn/frontend/action/rhnpackage/RemoveExtraConfirmSetupAction.java | 29 +++
java/code/src/com/redhat/rhn/frontend/action/systems/ExtraPackagesSystemsAction.java | 51 ++++++
java/code/src/com/redhat/rhn/frontend/action/token/ActivationKeyDetailsAction.java | 4
java/code/src/com/redhat/rhn/frontend/dto/SystemOverview.java | 15 +
java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml | 31 +++
java/code/src/com/redhat/rhn/frontend/strings/nav/StringResource_en_US.xml | 7
java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/SystemOverviewSerializer.java | 1
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java | 68 ++++++++
java/code/src/com/redhat/rhn/manager/system/SystemManager.java | 34 ++++
java/code/webapp/WEB-INF/nav/sitenav-authenticated.xml | 1
java/code/webapp/WEB-INF/nav/system_detail.xml | 4
java/code/webapp/WEB-INF/pages/common/fragments/systems/system_listdisplay.jspf | 21 +-
java/code/webapp/WEB-INF/pages/rhnpackage/packagedetail.jsp | 9 +
java/code/webapp/WEB-INF/pages/systems/details/packages/extra-packages-list.jsp | 84 ++++++++++
java/code/webapp/WEB-INF/pages/systems/extra-packages-systems-list.jsp | 26 +++
java/code/webapp/WEB-INF/struts-config.xml | 39 ++++
proxy/proxy/pm/rhn_package_manager.py | 5
proxy/proxy/spacewalk-proxy.spec | 5
rel-eng/packages/spacewalk-proxy | 2
23 files changed, 521 insertions(+), 15 deletions(-)
---
11 years, 8 months
2 commits - proxy/proxy rel-eng/packages
by Michael Mraka
proxy/proxy/pm/rhn_package_manager.py | 5 +++--
proxy/proxy/spacewalk-proxy.spec | 5 ++++-
rel-eng/packages/spacewalk-proxy | 2 +-
3 files changed, 8 insertions(+), 4 deletions(-)
New commits:
commit 645b525c768f558faab83fa938f2ca36ab077394
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Oct 23 13:39:36 2012 +0200
Automatic commit of package [spacewalk-proxy] release [1.8.13-1].
diff --git a/proxy/proxy/spacewalk-proxy.spec b/proxy/proxy/spacewalk-proxy.spec
index 9032dc8..85adc6d 100644
--- a/proxy/proxy/spacewalk-proxy.spec
+++ b/proxy/proxy/spacewalk-proxy.spec
@@ -4,7 +4,7 @@ Group: Applications/Internet
License: GPLv2
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 1.8.12
+Version: 1.8.13
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: python
@@ -330,6 +330,9 @@ fi
%changelog
+* Tue Oct 23 2012 Michael Mraka <michael.mraka(a)redhat.com> 1.8.13-1
+- _processFile() from uploadLib is static
+
* Mon Oct 22 2012 Jan Pazdziora 1.8.12-1
- bump up proxy version to 5.5.0
diff --git a/rel-eng/packages/spacewalk-proxy b/rel-eng/packages/spacewalk-proxy
index defe8eb..f4afe35 100644
--- a/rel-eng/packages/spacewalk-proxy
+++ b/rel-eng/packages/spacewalk-proxy
@@ -1 +1 @@
-1.8.12-1 proxy/proxy/
+1.8.13-1 proxy/proxy/
commit 327154b8cf6beeb720a549322e052fbfdc497fef
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Oct 23 11:13:11 2012 +0200
_processFile() from uploadLib is static
W0221:243,4:UploadClass._processFile: Arguments number differs from overridden method
E1121:245,15:UploadClass._processFile: Too many positional arguments for function call
diff --git a/proxy/proxy/pm/rhn_package_manager.py b/proxy/proxy/pm/rhn_package_manager.py
index 86abeda..20f209c 100755
--- a/proxy/proxy/pm/rhn_package_manager.py
+++ b/proxy/proxy/pm/rhn_package_manager.py
@@ -240,9 +240,10 @@ class UploadClass(uploadLib.UploadClass):
nosig=self.options.nosig)
self.processPackage(fileinfo['nvrea'], filename)
- def _processFile(self, filename, relativeDir=None, source=None, nosig=None):
+ @staticmethod
+ def _processFile(filename, relativeDir=None, source=None, nosig=None):
""" call parent _processFile and add to returned has md5sum """
- info = uploadLib.UploadClass._processFile(self, filename, relativeDir, source, nosig)
+ info = uploadLib.UploadClass._processFile(filename, relativeDir, source, nosig)
checksum = getFileChecksum('md5', filename=filename)
info['md5sum'] = checksum
return info
11 years, 8 months
branding/img java/code
by Milan Zazrivec
branding/img/rhn-icon-package_extra.gif |binary
java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml | 32 +++
java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml | 31 +++
java/code/src/com/redhat/rhn/frontend/action/rhnpackage/ExtraPackagesListAction.java | 37 ++++
java/code/src/com/redhat/rhn/frontend/action/rhnpackage/RemoveExtraConfirmSetupAction.java | 29 +++
java/code/src/com/redhat/rhn/frontend/action/systems/ExtraPackagesSystemsAction.java | 51 ++++++
java/code/src/com/redhat/rhn/frontend/dto/SystemOverview.java | 15 +
java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml | 23 ++
java/code/src/com/redhat/rhn/frontend/strings/nav/StringResource_en_US.xml | 7
java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/SystemOverviewSerializer.java | 1
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java | 68 ++++++++
java/code/src/com/redhat/rhn/manager/system/SystemManager.java | 34 ++++
java/code/webapp/WEB-INF/nav/sitenav-authenticated.xml | 1
java/code/webapp/WEB-INF/nav/system_detail.xml | 4
java/code/webapp/WEB-INF/pages/common/fragments/systems/system_listdisplay.jspf | 21 +-
java/code/webapp/WEB-INF/pages/systems/details/packages/extra-packages-list.jsp | 84 ++++++++++
java/code/webapp/WEB-INF/pages/systems/extra-packages-systems-list.jsp | 26 +++
java/code/webapp/WEB-INF/struts-config.xml | 39 ++++
18 files changed, 496 insertions(+), 7 deletions(-)
New commits:
commit 8dd8609c681e750eb283f22f64203d352e146844
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Tue Oct 23 11:23:48 2012 +0200
Expose extra packages / systems with extra packages
Extra packages in this context mean packages installed on a registered
system which are not present in any of the system's subscribed channel
(with the option to remove these packages).
This change adds the following pages:
* systems/ExtraPackagesSystems
* systems/details/packages/ExtraPackagesList
* systems/details/packages/RemoveExtraConfirm
and the following two API calls:
* system.listSystemsWithExtraPackages()
* system.listExtraPackages()
This is a re-work of a code originally found in SUSE Manager 1.7.
diff --git a/branding/img/rhn-icon-package_extra.gif b/branding/img/rhn-icon-package_extra.gif
new file mode 100644
index 0000000..9291fa7
Binary files /dev/null and b/branding/img/rhn-icon-package_extra.gif differ
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 eb91858..5b48954 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
@@ -465,6 +465,38 @@ SELECT PN.id || '|' || SPE.id AS ID_COMBO,
</query>
</mode>
+<mode name="extra_packages_for_system" class="com.redhat.rhn.frontend.dto.PackageListItem">
+ <query params="serverid">
+select p.id,
+ pn.id || '|' || pe.id || '|' || pa.id as id_combo,
+ pn.name || '-' || pe.version || '-' || pe.release as nvre,
+ pn.name || '-' || evr_t_as_vre_simple(pe.evr) || '.' || pa.label as nvrea,
+ pn.name as name,
+ pe.version as version,
+ pe.release as release,
+ pe.epoch as epoch,
+ pn.id as name_id,
+ pe.id as evr_id,
+ pa.label as arch,
+ sp.installTime
+ from rhnServerPackage sp
+ left outer join rhnPackage p on (sp.name_id = p.name_id and
+ sp.evr_id = p.evr_id and
+ sp.package_arch_id = p.package_arch_id)
+ left outer join (select sc.server_id, cp.package_id
+ from rhnServerChannel sc
+ join rhnChannelPackage cp on (sc.channel_id = cp.channel_id)
+ ) scp on (scp.package_id = p.id and
+ scp.server_id = sp.server_id)
+ left outer join rhnPackageName pn on (pn.id = sp.name_id)
+ left outer join rhnPackageArch pa on (pa.id = sp.package_arch_id)
+ left outer join rhnPackageEvr pe on (pe.id = sp.evr_id)
+ where sp.server_id = :serverid and
+ (p.id is null or scp.package_id is null)
+ order by nvre
+ </query>
+</mode>
+
<mode name="packages_from_server_set" class="com.redhat.rhn.frontend.dto.SsmRemovePackageListItem">
<query params="user_id, set_label">
SELECT PN.ID || '|' || PE.ID || '|' || X.package_arch_id AS id_combo,
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
index 9914d3e..dc031dd 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
@@ -1977,5 +1977,34 @@ ORDER BY UPPER(COALESCE(S.NAME, '(none)')), S.ID
<elaborator name="system_monitoring" />
</mode>
-</datasource_modes>
+<mode name="extra_packages_systems_count"
+ class="com.redhat.rhn.frontend.dto.SystemOverview">
+ <query params="userid, orgid">
+select s.id as id,
+ s.name as name,
+ 1 as selectable,
+ count(sp.name_id) as extra_pkg_count
+ from rhnServer s
+ join rhnUserServerPerms usp on (usp.server_id = s.id and
+ usp.user_id = :userid)
+ join rhnServerPackage sp on (s.id = sp.server_id)
+ left outer join rhnPackage p on (sp.name_id = p.name_id and
+ sp.evr_id = p.evr_id and
+ sp.package_arch_id = p.package_arch_id)
+ left outer join (select sc.server_id, cp.package_id
+ from rhnServerChannel sc
+ join rhnChannelPackage cp on (sc.channel_id = cp.channel_id)
+ ) scp on (scp.package_id = p.id and
+ scp.server_id = sp.server_id)
+ where (p.id is null or scp.package_id is null) and
+ s.org_id = :orgid
+ group by s.name, s.id
+ order by name, id;
+ </query>
+ <elaborator name="system_overview" />
+ <elaborator name="entitlements" />
+ <elaborator name="is_virtual_guest" />
+ <elaborator name="is_virtual_host" />
+</mode>
+</datasource_modes>
diff --git a/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/ExtraPackagesListAction.java b/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/ExtraPackagesListAction.java
new file mode 100644
index 0000000..6f66f56
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/ExtraPackagesListAction.java
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2012 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.
+ */
+
+/**
+ * Copyright (c) 2012 Novell
+ */
+
+package com.redhat.rhn.frontend.action.rhnpackage;
+
+import com.redhat.rhn.common.db.datasource.DataResult;
+import com.redhat.rhn.domain.server.Server;
+import com.redhat.rhn.manager.system.SystemManager;
+
+/**
+ * ExtraPackagesListAction
+ */
+public class ExtraPackagesListAction extends BaseSystemPackagesAction {
+ private static final String LIST_NAME = "extraPackageList";
+ public static final String DATA_SET = "extras";
+
+ @Override
+ protected DataResult getDataResult(Server server) {
+ return SystemManager.listExtraPackages(server.getId());
+ }
+}
diff --git a/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/RemoveExtraConfirmSetupAction.java b/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/RemoveExtraConfirmSetupAction.java
new file mode 100644
index 0000000..71c2389
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/RemoveExtraConfirmSetupAction.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright (c) 2012 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.frontend.action.rhnpackage;
+
+/**
+ * RemoveExtraConfirmSetupAction
+ */
+public class RemoveExtraConfirmSetupAction extends RemoveConfirmSetupAction {
+ private static final ExtraPackagesListAction DECL_ACTION =
+ new ExtraPackagesListAction();
+
+ @Override
+ protected String getDecl(Long sid) {
+ return DECL_ACTION.getDecl(sid);
+ }
+}
diff --git a/java/code/src/com/redhat/rhn/frontend/action/systems/ExtraPackagesSystemsAction.java b/java/code/src/com/redhat/rhn/frontend/action/systems/ExtraPackagesSystemsAction.java
new file mode 100644
index 0000000..c009741
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/frontend/action/systems/ExtraPackagesSystemsAction.java
@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) 2012 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.
+ */
+
+/**
+ * Copyright (c) 2012 Novell
+ */
+
+package com.redhat.rhn.frontend.action.systems;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+
+import com.redhat.rhn.common.db.datasource.DataResult;
+import com.redhat.rhn.domain.user.User;
+import com.redhat.rhn.frontend.dto.SystemOverview;
+import com.redhat.rhn.frontend.listview.PageControl;
+import com.redhat.rhn.manager.system.SystemManager;
+
+
+/**
+ * ExtraPackagesSystemsAction
+ */
+public class ExtraPackagesSystemsAction extends BaseSystemsAction {
+ /** {@inheritDoc} */
+ public ActionForward execute(ActionMapping mapping, ActionForm formIn,
+ HttpServletRequest request, HttpServletResponse response) {
+ request.setAttribute("extraPackagesMode", Boolean.TRUE);
+ return super.execute(mapping, formIn, request, response);
+ }
+
+ protected DataResult<SystemOverview> getDataResult(User user, PageControl pc,
+ ActionForm formIn) {
+ return (DataResult<SystemOverview>) SystemManager.getExtraPackagesSystems(user, pc);
+ }
+}
diff --git a/java/code/src/com/redhat/rhn/frontend/dto/SystemOverview.java b/java/code/src/com/redhat/rhn/frontend/dto/SystemOverview.java
index 932ceb8..2be6320 100644
--- a/java/code/src/com/redhat/rhn/frontend/dto/SystemOverview.java
+++ b/java/code/src/com/redhat/rhn/frontend/dto/SystemOverview.java
@@ -71,6 +71,7 @@ public class SystemOverview extends BaseDto implements Serializable {
private String lastCheckinString;
private boolean isVirtualHost;
private boolean isVirtualGuest;
+ private Long extraPkgCount;
private static final String NONE_VALUE = "(none)";
@@ -732,5 +733,19 @@ public class SystemOverview extends BaseDto implements Serializable {
return enhancementErrata + securityErrata + bugErrata;
}
+ /**
+ * Sets a number of extra packages in the system.
+ * @param packagesCount extra packages to set
+ */
+ public void setExtraPkgCount(Long packagesCount) {
+ this.extraPkgCount = packagesCount;
+ }
+
+ /**
+ * @return Retuns the extraPkgCount
+ */
+ public Long getExtraPkgCount() {
+ return this.extraPkgCount;
+ }
}
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
index cc7993e..d284688 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
@@ -2586,6 +2586,21 @@ button below, and <b>will be unable to log back in</b>.</source>
<context context-type="sourcefile">/rhn/systems/details/packages/patches/PatchConfirm</context>
</context-group>
</trans-unit>
+
+ <trans-unit id="packagelist.jsp.extrapackages">
+<source>Extra Packages</source>
+ <context-group name="ctx">
+ <context context-type="sourcefile">/rhn/systems/details/packages/PackageList</context>
+ </context-group>
+ </trans-unit>
+
+<trans-unit id="packagelist.jsp.extrapackagessummary">
+<source>The following packages are installed on this system and are not present in any of its channels.</source>
+ <context-group name="ctx">
+ <context context-type="sourcefile">/rhn/systems/details/packages/ForeignPackages</context>
+ </context-group>
+ </trans-unit>
+
<!-- upgradable.jsp -->
<trans-unit id="upgradable.jsp.header">
<source>Upgradable Packages</source>
@@ -5132,6 +5147,14 @@ value for this entitlement, excluding the default organization's consumption.</s
</context-group>
</trans-unit>
+ <trans-unit id="extrapackagessystemslist.jsp.header">
+ <source>Systems with Extra Packages</source>
+ <context-group name="ctx">
+ <context context-type="sourcefile">/rhn/systems/ExtraPackagesSystems.do</context>
+ <context context-type="sourcefile">/rhn/systems/YourRhn.do</context>
+ </context-group>
+ </trans-unit>
+
<trans-unit id="inactivelist.jsp.header">
<source>Inactive Systems</source>
<context-group name="ctx">
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/nav/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/nav/StringResource_en_US.xml
index e3930ce..2f306f9 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/nav/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/nav/StringResource_en_US.xml
@@ -118,6 +118,13 @@ http://www.oasis-open.org/committees/xliff/documents/xliff-core-1.1.xsd"
</context-group>
</trans-unit>
+ <trans-unit id="Extra Packages">
+ <source>Extra Packages</source>
+ <context-group name="ctx">
+ <context context-type="sourcefile">Systems Navigation Menu</context>
+ </context-group>
+ </trans-unit>
+
<trans-unit id="duplicate.systems.nav.ips">
<source>Duplicate IP Address</source>
<context-group name="ctx">
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/SystemOverviewSerializer.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/SystemOverviewSerializer.java
index b4e16b0..808b2fc 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/SystemOverviewSerializer.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/SystemOverviewSerializer.java
@@ -61,6 +61,7 @@ public class SystemOverviewSerializer implements XmlRpcCustomSerializer {
helper.add("id", system.getId());
helper.add("name", system.getName());
helper.add("last_checkin", system.getLastCheckinDate());
+ helper.add("extra_pkg_count", system.getExtraPkgCount());
helper.writeTo(output);
}
}
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
index 072e62e..5d5be49 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
@@ -76,6 +76,7 @@ import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.frontend.dto.ActivationKeyDto;
import com.redhat.rhn.frontend.dto.ErrataOverview;
import com.redhat.rhn.frontend.dto.EssentialChannelDto;
+import com.redhat.rhn.frontend.dto.PackageListItem;
import com.redhat.rhn.frontend.dto.ServerPath;
import com.redhat.rhn.frontend.dto.SystemCurrency;
import com.redhat.rhn.frontend.dto.SystemOverview;
@@ -5033,4 +5034,71 @@ public class SystemHandler extends BaseHandler {
ServerFactory.removeTagFromSnapshot(server.getId(), tag);
return 1;
}
+
+ /**
+ * List systems with extra packages
+ * @param sessionKey the session key
+ * @return Array of systems with extra packages
+ *
+ * @xmlrpc.doc List systems with extra packages
+ * @xmlrpc.param #param("string", "sessionKey")
+ * @xmlrpc.returntype
+ * #array()
+ * #struct()
+ * #prop_desc("int", "id", "System ID")
+ * #prop_desc("string", "name", "System profile name")
+ * #prop_desc("int", "extra_pkg_count", "Extra packages count")
+ * #struct_end()
+ * #array_end()
+ */
+ public Object[] listSystemsWithExtraPackages(String sessionKey) {
+ User loggedInUser = getLoggedInUser(sessionKey);
+ return SystemManager.getExtraPackagesSystems(loggedInUser, null).toArray();
+ }
+
+ /**
+ * List extra packages for given system
+ * @param sessionKey Session key
+ * @param serverId Server ID
+ * @return Array of extra packages for given system
+ *
+ * @xmlrpc.doc List extra packages for a system
+ * @xmlrpc.param #param("string", "sessionKey")
+ * @xmlrpc.param #param("int", "serverId")
+ * @xmlrpc.returntype
+ * #array()
+ * #struct("package")
+ * #prop("string", "name")
+ * #prop("string", "version")
+ * #prop("string", "release")
+ * #prop_desc("string", "epoch", "returned only if non-zero")
+ * #prop("string", "arch")
+ * #prop_desc("date", "installtime", "returned only if known")
+ * #struct_end()
+ * #array_end()
+ */
+ public List listExtraPackages(String sessionKey, Integer serverId) {
+ User loggedInUser = getLoggedInUser(sessionKey);
+ DataResult dr = SystemManager.listExtraPackages(new Long(serverId));
+
+ List returnList = new ArrayList();
+
+ for (Iterator itr = dr.iterator(); itr.hasNext();) {
+ PackageListItem row = (PackageListItem) itr.next();
+ Map pkg = new HashMap();
+
+ pkg.put("name", row.getName());
+ pkg.put("version", row.getVersion());
+ pkg.put("release", row.getRelease());
+ if (row.getEpoch() != null) {
+ pkg.put("epoch", row.getEpoch());
+ }
+ pkg.put("arch", row.getArch());
+ pkg.put("installtime", row.getInstallTime());
+
+ returnList.add(pkg);
+ }
+
+ return returnList;
+ }
}
diff --git a/java/code/src/com/redhat/rhn/manager/system/SystemManager.java b/java/code/src/com/redhat/rhn/manager/system/SystemManager.java
index 2689fb6..4ed71cd 100644
--- a/java/code/src/com/redhat/rhn/manager/system/SystemManager.java
+++ b/java/code/src/com/redhat/rhn/manager/system/SystemManager.java
@@ -231,6 +231,40 @@ public class SystemManager extends BaseManager {
}
/**
+ * Returns a list of systems with extra packages installed.
+ *
+ * @param user User to check the systems for
+ * @param pc Page control
+ *
+ * @return list of SystemOverviews.
+ */
+ public static DataResult getExtraPackagesSystems(User user, PageControl pc) {
+ SelectMode m = ModeFactory.getMode("System_queries",
+ "extra_packages_systems_count");
+ Map params = new HashMap();
+ params.put("userid", user.getId());
+ params.put("orgid", user.getOrg().getId());
+
+ return makeDataResult(params, new HashMap<String, Object>(), pc, m);
+ }
+
+ /**
+ * Returns the list of extra packages for a system.
+ * @param serverId Server ID in question
+ * @return List of extra packages
+ */
+ public static DataResult listExtraPackages(Long serverId) {
+ SelectMode m = ModeFactory.getMode("Package_queries",
+ "extra_packages_for_system");
+ Map params = new HashMap();
+ params.put("serverid", serverId);
+ Map elabParams = new HashMap();
+
+ DataResult dataResult = makeDataResult(params, elabParams, null, m);
+ return dataResult;
+ }
+
+ /**
* Gets the latest upgradable packages for a system
* @param sid The id for the system we want packages for
* @return Returns a list of the latest upgradable packages for a system
diff --git a/java/code/webapp/WEB-INF/nav/sitenav-authenticated.xml b/java/code/webapp/WEB-INF/nav/sitenav-authenticated.xml
index 92248d2..97b59ac 100644
--- a/java/code/webapp/WEB-INF/nav/sitenav-authenticated.xml
+++ b/java/code/webapp/WEB-INF/nav/sitenav-authenticated.xml
@@ -42,6 +42,7 @@
<rhn-tab name="Virtual Systems" url="/rhn/systems/VirtualSystemsList.do"/>
<rhn-tab name="Out of Date" url="/rhn/systems/OutOfDate.do"/>
<rhn-tab name="Requiring Reboot" url="/rhn/systems/RequiringReboot.do"/>
+ <rhn-tab name="Extra Packages" url="/rhn/systems/ExtraPackagesSystems.do"/>
<rhn-tab name="Unentitled" url="/rhn/systems/Unentitled.do"/>
<rhn-tab name="Ungrouped" url="/rhn/systems/Ungrouped.do" acl="org_entitlement(sw_mgr_enterprise); user_role(org_admin)"/>
<rhn-tab name="Inactive" url="/rhn/systems/Inactive.do"/>
diff --git a/java/code/webapp/WEB-INF/nav/system_detail.xml b/java/code/webapp/WEB-INF/nav/system_detail.xml
index 45bdebc..ec5b11a 100644
--- a/java/code/webapp/WEB-INF/nav/system_detail.xml
+++ b/java/code/webapp/WEB-INF/nav/system_detail.xml
@@ -75,6 +75,10 @@
<rhn-tab-url>/rhn/systems/details/packages/profiles/CompareSystems.do</rhn-tab-url>
<rhn-tab-url>/rhn/systems/details/packages/profiles/CompareProfiles.do</rhn-tab-url>
</rhn-tab>
+ <rhn-tab name="Extra Packages" node-id="extra_packages_list" acl="system_feature(ftr_package_remove)">
+ <rhn-tab-url>/rhn/systems/details/packages/ExtraPackagesList.do</rhn-tab-url>
+ <rhn-tab-url>/rhn/systems/details/packages/RemoveConfirm.do</rhn-tab-url>
+ </rhn-tab>
</rhn-tab>
<rhn-tab name="Software Channels" acl="system_feature(ftr_package_updates)">
diff --git a/java/code/webapp/WEB-INF/pages/common/fragments/systems/system_listdisplay.jspf b/java/code/webapp/WEB-INF/pages/common/fragments/systems/system_listdisplay.jspf
index e18c28b..642fa7b 100644
--- a/java/code/webapp/WEB-INF/pages/common/fragments/systems/system_listdisplay.jspf
+++ b/java/code/webapp/WEB-INF/pages/common/fragments/systems/system_listdisplay.jspf
@@ -44,7 +44,7 @@
</rl:column>
- <c:if test = "${empty noUpdates}">
+ <c:if test = "${empty noUpdates and empty extraPackagesMode}">
<!--Updates Column -->
<rl:column sortable="false"
bound="false"
@@ -55,12 +55,12 @@
</rl:column>
</c:if>
- <c:if test = "${empty noMonitoring}">
+ <c:if test = "${empty noMonitoring and empty extraPackagesMode}">
<!-- Health Column -->
<%@ include file="monitoring_status_systems.jspf" %>
</c:if>
- <c:if test = "${empty noErrata}">
+ <c:if test = "${empty noErrata and empty extraPackagesMode}">
<!-- errata Column -->
<rl:column sortable="false"
bound="false"
@@ -77,7 +77,7 @@
</c:choose>
</rl:column>
</c:if>
- <c:if test = "${empty noPackages}">
+ <c:if test = "${empty noPackages and empty extraPackagesMode}">
<!-- Packages Column -->
<rl:column sortable="false"
bound="false"
@@ -95,7 +95,14 @@
</c:choose>
</rl:column>
</c:if>
- <c:if test = "${empty noConfigFiles}">
+ <!-- Extra packages column -->
+ <c:if test = "${extraPackagesMode}">
+ <rl:column sortable="false" bound="false" headerkey="systemlist.jsp.packages" styleclass="center" headerclass="thin-column">
+<c:out value="<a href='/rhn/systems/details/packages/ExtraPackagesList.do?sid=${current.id}'>${current.extraPkgCount}</a>" escapeXml="false" />
+ </rl:column>
+ </c:if>
+
+ <c:if test = "${empty noConfigFiles} and empty extraPackagesMode">
<rl:column sortable="false"
bound="false"
headerkey="systemlist.jsp.configfiles"
@@ -126,12 +133,14 @@
</rl:column>
<!-- Entitlement Column -->
+ <c:if test="${empty extraPackagesMode}">
<rl:column sortable="false"
bound="false"
headerkey="systemlist.jsp.entitlement"
styleclass="last-column">
<c:out value="${current.entitlementLevel}" escapeXml="false"/>
- </rl:column>
+ </rl:column>
+ </c:if>
diff --git a/java/code/webapp/WEB-INF/pages/systems/details/packages/extra-packages-list.jsp b/java/code/webapp/WEB-INF/pages/systems/details/packages/extra-packages-list.jsp
new file mode 100644
index 0000000..69cc56d
--- /dev/null
+++ b/java/code/webapp/WEB-INF/pages/systems/details/packages/extra-packages-list.jsp
@@ -0,0 +1,84 @@
+<%@ taglib uri="http://rhn.redhat.com/rhn" prefix="rhn" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
+<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
+<%@ taglib uri="http://rhn.redhat.com/tags/list" prefix="rl" %>
+<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
+
+
+<html:xhtml/>
+<html>
+
+<body>
+
+<%@ include file="/WEB-INF/pages/common/fragments/systems/system-header.jspf" %>
+
+<h2>
+ <img src="/img/rhn-icon-package_extra.gif" />
+ <bean:message key="packagelist.jsp.extrapackages" />
+</h2>
+
+<div class="page-summary">
+ <p><bean:message key="packagelist.jsp.extrapackagessummary" /></p>
+</div>
+
+<c:set var="pageList" value="${requestScope.all}" />
+
+<rl:listset name="packageListSet">
+ <rhn:csrf />
+ <rhn:submitted />
+
+ <rl:list dataset="pageList"
+ width="100%"
+ styleclass="list"
+ name="packageList"
+ emptykey="packagelist.jsp.nopackages"
+ alphabarcolumn="nvre">
+
+ <rl:decorator name="PageSizeDecorator"/>
+ <rl:decorator name="SelectableDecorator"/>
+ <rl:selectablecolumn value="${current.selectionKey}"
+ selected="${current.selected}"
+ disabled="${not current.selectable}"
+ styleclass="first-column"/>
+
+ <rl:column headerkey="packagelist.jsp.packagename"
+ bound="false"
+ sortattr="nvre"
+ sortable="true"
+ filterattr="nvre">${current.nvre}</rl:column>
+ <rl:column headerkey="packagelist.jsp.packagearch"
+ bound="false">
+ <c:choose>
+ <c:when test ="${not empty current.arch}">${current.arch}</c:when>
+ <c:otherwise><bean:message key="packagelist.jsp.notspecified"/></c:otherwise>
+ </c:choose>
+ </rl:column>
+ <rl:column headerkey="packagelist.jsp.installtime"
+ bound="false"
+ styleclass="last-column"
+ sortattr="installTimeObj"
+ sortable="true">
+ <c:choose>
+ <c:when test ="${not empty current.installTime}">${current.installTime}</c:when>
+ <c:otherwise><bean:message key="packagelist.jsp.notspecified"/></c:otherwise>
+ </c:choose>
+ </rl:column>
+ </rl:list>
+
+<c:if test="${not empty requestScope.all}">
+ <div align="right">
+ <rhn:submitted/>
+ <hr/>
+ <rhn:require acl="system_feature(ftr_package_remove)">
+ <input type="submit"
+ name ="dispatch"
+ value='<bean:message key="packagelist.jsp.removepackages"/>'/>
+ </rhn:require>
+ </div>
+</c:if>
+
+</rl:listset>
+</body>
+</html>
diff --git a/java/code/webapp/WEB-INF/pages/systems/extra-packages-systems-list.jsp b/java/code/webapp/WEB-INF/pages/systems/extra-packages-systems-list.jsp
new file mode 100644
index 0000000..e0ea646
--- /dev/null
+++ b/java/code/webapp/WEB-INF/pages/systems/extra-packages-systems-list.jsp
@@ -0,0 +1,26 @@
+<%@ taglib uri="http://rhn.redhat.com/rhn" prefix="rhn" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
+<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
+<%@ taglib uri="http://rhn.redhat.com/tags/list" prefix="rl" %>
+
+<html:xhtml/>
+<html>
+<head>
+ <meta name="page-decorator" content="none" />
+</head>
+<body>
+<rhn:toolbar base="h1" img="/img/rhn-icon-system.gif" imgAlt="system.common.systemAlt"
+ helpUrl="/rhn/help/reference/en-US/s1-sm-systems.jsp#s3-sm-system-list-inact">
+ <bean:message key="extrapackagessystemslist.jsp.header"/>
+</rhn:toolbar>
+
+<rl:listset name="systemListSet" legend="system">
+ <rhn:csrf />
+ <rhn:submitted />
+ <%@ include file="/WEB-INF/pages/common/fragments/systems/system_listdisplay.jspf" %>
+</rl:listset>
+
+
+</body>
+</html>
diff --git a/java/code/webapp/WEB-INF/struts-config.xml b/java/code/webapp/WEB-INF/struts-config.xml
index e59ab1e..dd3cc10 100644
--- a/java/code/webapp/WEB-INF/struts-config.xml
+++ b/java/code/webapp/WEB-INF/struts-config.xml
@@ -3038,6 +3038,18 @@
redirect="true" />
</action>
+ <action path="/systems/details/packages/ExtraPackagesList"
+ scope="request"
+ type="com.redhat.rhn.frontend.action.rhnpackage.ExtraPackagesListAction"
+ className="com.redhat.rhn.frontend.struts.RhnActionMapping">
+ <set-property property="postRequiredIfSubmitted" value="true" />
+ <forward name="default"
+ path="/WEB-INF/pages/systems/details/packages/extra-packages-list.jsp"/>
+ <forward name="confirm"
+ path="/systems/details/packages/RemoveExtraConfirm.do"
+ redirect="true" />
+ </action>
+
<action path="/systems/details/packages/RemoveConfirm"
scope="request"
name="datePickerForm"
@@ -3055,6 +3067,24 @@
redirect="true" />
</action>
+ <action path="/systems/details/packages/RemoveExtraConfirm"
+ scope="request"
+ name="datePickerForm"
+ input="/WEB-INF/pages/systems/details/packages/packageconfirm.jsp"
+ type="com.redhat.rhn.frontend.action.rhnpackage.RemoveExtraConfirmSetupAction"
+ className="com.redhat.rhn.frontend.struts.RhnActionMapping">
+ <set-property property="postRequiredIfSubmitted" value="true" />
+ <forward name="default"
+ path="/WEB-INF/pages/systems/details/packages/packageconfirm.jsp"/>
+ <forward name="confirm"
+ path="/systems/details/packages/Packages.do"
+ redirect="true" />
+ <forward name="remotecmd"
+ path="/systems/details/packages/ScheduleRemoteCommand.do"
+ redirect="true" />
+ </action>
+
+
<action path="/systems/details/packages/UpgradableList"
scope="request"
input="/WEB-INF/pages/systems/details/packages/upgradable.jsp"
@@ -7850,6 +7880,15 @@
path="/account/Credentials.do" />
</action>
+ <action path="/systems/ExtraPackagesSystems"
+ scope="request"
+ input="/WEB-INF/pages/systems/extra-packages-systems-list.jsp"
+ type="com.redhat.rhn.frontend.action.systems.ExtraPackagesSystemsAction"
+ className="com.redhat.rhn.frontend.struts.RhnActionMapping">
+ <forward name="default"
+ path="/WEB-INF/pages/systems/extra-packages-systems-list.jsp"/>
+ </action>
+
</action-mappings>
<!-- ===================================== -->
11 years, 8 months
java/code
by Tomas Lestach
java/code/src/com/redhat/rhn/frontend/action/token/ActivationKeyDetailsAction.java | 4 ----
1 file changed, 4 deletions(-)
New commits:
commit 8fd5eff5cb03e44864c30f3a9c8ccf8891986440
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Oct 23 10:29:27 2012 +0200
853444 - do not list custom base channel twice in the base channel combo for an activation key
diff --git a/java/code/src/com/redhat/rhn/frontend/action/token/ActivationKeyDetailsAction.java b/java/code/src/com/redhat/rhn/frontend/action/token/ActivationKeyDetailsAction.java
index 517709d..d295926 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/token/ActivationKeyDetailsAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/token/ActivationKeyDetailsAction.java
@@ -284,10 +284,6 @@ public class ActivationKeyDetailsAction extends RhnAction {
channelWidgets.add(lv(channel.getName(), String.valueOf(channel.getId())));
}
- List<Channel> customChannels = ChannelFactory.listCustomBaseChannels(user);
- for (Channel channel : customChannels) {
- channelWidgets.add(lv(channel.getName(), String.valueOf(channel.getId())));
- }
context.getRequest().setAttribute(POSSIBLE_CHANNELS, channelWidgets.toArray());
}
11 years, 8 months
java/code
by Tomáš Kašpárek
java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml | 8 ++++++++
java/code/webapp/WEB-INF/pages/rhnpackage/packagedetail.jsp | 9 +++++++++
2 files changed, 17 insertions(+)
New commits:
commit 9a17be852c040c96ef02806e0cdaf8d22a38124e
Author: Tomas Kasparek <tkasparek(a)redhat.com>
Date: Tue Oct 23 08:20:25 2012 +0200
WebUI improvement, adding "Search Google for errata" on package details page.
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
index ec427f5..cc7993e 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
@@ -20436,6 +20436,14 @@ given channel.</source>
<source>File Unavailable</source>
</trans-unit>
+ <trans-unit id="package.jsp.errata">
+ <source>Errata</source>
+ </trans-unit>
+
+ <trans-unit id="package.jsp.erratasearch">
+ <source>Search Google for errata</source>
+ </trans-unit>
+
<trans-unit id="package.jsp.sunosrelease">
<source>SunOs Release</source>
</trans-unit>
diff --git a/java/code/webapp/WEB-INF/pages/rhnpackage/packagedetail.jsp b/java/code/webapp/WEB-INF/pages/rhnpackage/packagedetail.jsp
index 82d8b34..9fc9967 100644
--- a/java/code/webapp/WEB-INF/pages/rhnpackage/packagedetail.jsp
+++ b/java/code/webapp/WEB-INF/pages/rhnpackage/packagedetail.jsp
@@ -236,6 +236,15 @@
</c:if>
</rhn:require>
+ <tr>
+ <th>
+ <bean:message key="package.jsp.errata" />:
+ </th>
+ <td><a href="http://www.google.com/search?q=${package_name}+inurl:errata+site:redhat.com" target="_blank">
+ <bean:message key="package.jsp.erratasearch" />
+ </a></td>
+ <tr/>
+
</div>
11 years, 8 months
Changes to 'refs/tags/spacewalk-utils-1.8.31-1'
by Jan Pazdziora
Tag 'spacewalk-utils-1.8.31-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2012-10-22 17:23 +0000
Tagging package [spacewalk-utils] version [1.8.31-1] in directory [utils/].
Changes since spacewalk-setup-1.8.21-1:
Jan Pazdziora (2):
Add support for schema transformations.
Automatic commit of package [spacewalk-utils] release [1.8.31-1].
---
rel-eng/packages/spacewalk-utils | 2
utils/spacewalk-dump-schema | 318 +++++++++++++++++++++++++++++++++++----
utils/spacewalk-utils.spec | 5
3 files changed, 294 insertions(+), 31 deletions(-)
---
11 years, 8 months
rel-eng/packages utils/spacewalk-utils.spec
by Jan Pazdziora
rel-eng/packages/spacewalk-utils | 2 +-
utils/spacewalk-utils.spec | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit a264e3faa16d1b6bf0dd190c4e4b9ab6cc5d028b
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Oct 22 19:22:59 2012 +0200
Automatic commit of package [spacewalk-utils] release [1.8.31-1].
diff --git a/rel-eng/packages/spacewalk-utils b/rel-eng/packages/spacewalk-utils
index 037a0d8..b0834be 100644
--- a/rel-eng/packages/spacewalk-utils
+++ b/rel-eng/packages/spacewalk-utils
@@ -1 +1 @@
-1.8.30-1 utils/
+1.8.31-1 utils/
diff --git a/utils/spacewalk-utils.spec b/utils/spacewalk-utils.spec
index 0a86ad1..da00943 100644
--- a/utils/spacewalk-utils.spec
+++ b/utils/spacewalk-utils.spec
@@ -1,7 +1,7 @@
%define rhnroot %{_prefix}/share/rhn
Name: spacewalk-utils
-Version: 1.8.30
+Version: 1.8.31
Release: 1%{?dist}
Summary: Utilities that may be run against a Spacewalk server.
@@ -86,6 +86,9 @@ spacewalk-pylint $RPM_BUILD_ROOT%{rhnroot}
%changelog
+* Mon Oct 22 2012 Jan Pazdziora 1.8.31-1
+- Add support for schema transformations.
+
* Mon Oct 22 2012 Jan Pazdziora 1.8.30-1
- 822907 - spacewalk-hostname-rename knows to start postgresql
11 years, 8 months
utils/spacewalk-dump-schema
by Jan Pazdziora
utils/spacewalk-dump-schema | 318 +++++++++++++++++++++++++++++++++++++++-----
1 file changed, 289 insertions(+), 29 deletions(-)
New commits:
commit ebff9f7b3eaec1b045fa4642f6e4327385bf4378
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Oct 22 19:20:42 2012 +0200
Add support for schema transformations.
diff --git a/utils/spacewalk-dump-schema b/utils/spacewalk-dump-schema
index 8bbb0d7..b307bbd 100755
--- a/utils/spacewalk-dump-schema
+++ b/utils/spacewalk-dump-schema
@@ -7,15 +7,12 @@ use Spacewalk::Setup ();
use Getopt::Long ();
use DBI ();
+my $DATA_DIR = '/etc/sysconfig/rhn/schema-dump';
my $config_file = Spacewalk::Setup::DEFAULT_RHN_CONF_LOCATION;
my %options;
Spacewalk::Setup::read_config($config_file, \%options);
-if ($options{db_backend} ne 'oracle') {
- die "The $0 is can only dump Oracle database schema.\n";
-}
-
-my ($db, $user, $password);
+my ($db, $user, $password, $raw);
sub usage {
print "$0: [--db=SID --user=USERNAME --password=PASSWORD] [ --help ]\n";
@@ -29,12 +26,17 @@ Getopt::Long::GetOptions (
'db=s' => \$db,
'user=s' => \$user,
'password=s' => \$password,
+ 'raw' => \$raw,
'help' => \&usage,
) or exit 1;
if (grep { defined $_ } $db, $user, $password) {
# Some connect parameter was specified, let's use it as new connect info
@options{qw( db_name db_user db_password )} = ( $db, $user, $password );
+} else {
+ if ($options{db_backend} ne 'oracle') {
+ die "The $0 can only dump Oracle database schema.\n";
+ }
}
$ENV{NLS_LANG} = 'AMERICAN_AMERICA.UTF8';
@@ -47,63 +49,315 @@ my $dbh = DBI->connect("dbi:Oracle:$options{db_name}", $options{db_user}, $optio
FetchHashKeyName => 'NAME_lc',
LongReadLen => 10_000_000,
LongTruncOk => 0,
+ AutoCommit => 0,
});
+$SIG{'PIPE'} = sub {
+ die "SIGPIPE received.\n";
+};
+
+process_scripts($dbh, 'pre');
+
print <<'EOS';
\set ON_ERROR_STOP on
EOS
-process_sequences($dbh);
+
+my %ROWIDS = ();
+my $SEQ = 1;
process_tables($dbh);
-$dbh->disconnect();
+process_sequences($dbh);
+if (not $raw) {
+ my $dist = `rpm -qf --qf '%{release}\n' /etc/sysconfig/rhn/schema-dump`;
+ chomp $dist;
+ $dist =~ s/^.+(\.[^\.]+)$/$1/;
+ for my $file (sort < $DATA_DIR/sql/* >) {
+ local *FILE;
+ open FILE, '<', $file or die "Error reading [$file]: $!\n";
+ while (<FILE>) {
+ s/\@\@DIST\@\@/$dist/;
+ print;
+ }
+ close FILE;
+ }
+}
exit 0;
+END {
+ return if (not defined $dbh);
+
+ process_scripts($dbh, 'post');
+ $dbh->disconnect();
+}
+
+sub get_table_scripts {
+ my $filename = shift;
+
+ return if (not -f $filename);
+
+ local $_;
+ local *FILE;
+ open FILE, '<', $filename or die "Error reading [$filename]: $!\n";
+ my $data = {};
+ my $key;
+ my $text;
+ while (<FILE>) {
+ chomp;
+ if (/^\s*$/) {
+ push @{$data->{$key}}, $text if ($text);
+ $text = '';
+ } elsif (/^\s/) {
+ $text .= $_;
+ } else {
+ $key = join ',', sort split /,/, $_;
+ $data->{$key} = ();
+ }
+ }
+ push @{$data->{$key}}, $text if ($text);
+ close FILE;
+ return $data;
+}
+
+sub process_scripts {
+ my $dbh = shift;
+ my $stage = shift;
+
+ return if ($raw or not -d "$DATA_DIR/$stage");
+
+ my $tables = $dbh->selectall_hashref(q!
+ select lower(table_name) table_name
+ from user_tables
+ where table_name <> 'PLAN_TABLE' -- plan_table is not part of our schema
+ order by table_name
+ !, 'table_name');
+
+ my %scripts;
+ {
+ local *DIR;
+ opendir DIR, "$DATA_DIR/$stage" or die "Error reading [$DATA_DIR/$stage]: $!\n";
+ while (defined($_ = readdir DIR)) {
+ next if /^\.\.?$/ or not exists $tables->{$_};
+ $scripts{$_} = get_table_scripts("$DATA_DIR/$stage/$_");
+ }
+ closedir DIR;
+ }
+
+ foreach my $table (keys %scripts) {
+ next if (not defined $tables->{$table});
+
+ my $sth = eval {
+ local $dbh->{PrintError} = 0;
+ $dbh->prepare("select * from $table");
+ };
+
+ my $columns;
+ if (defined $sth and not $@) {
+ $sth->execute();
+ my $row = $sth->fetchrow_arrayref();
+ $columns = join ',', sort @{$sth->{NAME_lc}};
+ } else {
+ die $@ if (not $DBI::err == 942);
+ }
+
+ next if (not exists $scripts{$table}{$columns});
+
+ foreach my $script (@{$scripts{$table}{$columns}}) {
+ $sth = $dbh->prepare($script);
+ $sth->execute();
+ $dbh->commit();
+ }
+ }
+}
+
+sub get_sequence_exception {
+ local $_;
+ my $name = shift;
+ my $file = "$DATA_DIR/sequences/$name";
+ if (not -f $file) {
+ return;
+ }
+ local *EXCEPTION;
+ open EXCEPTION, '<', $file or die "Error reading [$file]: $!\n";
+ my $data = '';
+ while (<EXCEPTION>) {
+ if (/^skip\s*$/) {
+ close EXCEPTION;
+ return 'skip';
+ }
+ $data .= $_;
+ }
+ close EXCEPTION;
+ return $data;
+}
+
sub process_sequences {
my $dbh = shift;
- my $sth = $dbh->prepare(q!
+ my $sequences = $dbh->selectall_hashref(q!
select lower(sequence_name) sequence_name, last_number
from user_sequences
order by sequence_name
- !);
- $sth->execute();
- while (my $row = $sth->fetchrow_hashref()) {
- print "select pg_catalog.setval('$row->{sequence_name}', $row->{last_number}, false);\n";
+ !, 'sequence_name');
+ if (not $raw and -d "$DATA_DIR/sequences") {
+ local *DIR;
+ opendir DIR, "$DATA_DIR/sequences" or die "Error reading [$DATA_DIR/sequences]: $!\n";
+ while (defined($_ = readdir DIR)) {
+ next if /^\.\.?$/;
+ $sequences->{$_} = 'missing' if not exists $sequences->{$_};
+ }
+ closedir DIR;
+ }
+ for (sort keys %$sequences) {
+ my $last_number = $sequences->{$_}{last_number} if ref $sequences->{$_};;
+ if (not $raw) {
+ my $exception = get_sequence_exception($_);
+ if (defined $exception) {
+ if ($exception =~ /^missing sequence/) {
+ if ($sequences->{$_} eq 'missing') {
+ $last_number = $SEQ;
+ }
+ } elsif ($exception eq 'skip') {
+ print "-- Skipping $_\n";
+ next;
+ } else {
+ print "select pg_catalog.setval('$_', ( $exception )::bigint);\n";
+ next;
+ }
+ }
+ }
+ $last_number = 1 if not defined $last_number;
+ print "select pg_catalog.setval('$_', $last_number, false);\n";
}
}
+sub get_table_exception {
+ local $_;
+ my $name = shift;
+ my $file = "$DATA_DIR/tables/$name";
+ if (not -f $file) {
+ return;
+ }
+ local *EXCEPTION;
+ open EXCEPTION, '<', $file or die "Error reading [$file]: $!\n";
+ my $data = {};
+ my $key;
+ while (<EXCEPTION>) {
+ if (/^skip\s*$/) {
+ close EXCEPTION;
+ return 'skip';
+ }
+ if (/^\s/) {
+ $data->{$key} .= $_;
+ } else {
+ chomp;
+ $key = join ',', sort split /,/, $_;
+ }
+ }
+ close EXCEPTION;
+ return $data;
+}
+
sub process_tables {
my $dbh = shift;
- my $tables = $dbh->selectcol_arrayref(q!
+ my $tables = $dbh->selectall_hashref(q!
select lower(table_name) table_name
from user_tables
where table_name <> 'PLAN_TABLE' -- plan_table is not part of our schema
order by table_name
- !);
- for (@$tables) {
+ !, 'table_name');
+ if (not $raw and -d "$DATA_DIR/tables") {
+ local *DIR;
+ opendir DIR, "$DATA_DIR/tables" or die "Error reading [$DATA_DIR/tables]: $!\n";
+ while (defined($_ = readdir DIR)) {
+ next if /^\.\.?$/;
+ $tables->{$_} = 'missing' if not exists $tables->{$_};
+ }
+ closedir DIR;
+ }
+ my %exceptions;
+ for (sort keys %$tables) {
+ if (not $raw) {
+ my $exception = get_table_exception($_);
+ if (defined $exception) {
+ $exceptions{$_} = $exception;
+ if ($tables->{$_} eq 'missing'
+ and ref $exceptions{$_}) {
+ if (exists $exceptions{$_}{'missing table'}) {
+ $exceptions{$_} = { 'missing table' => $exceptions{$_}{'missing table'} };
+ } else {
+ $exception = $exceptions{$_} = 'skip';
+ }
+ }
+ if ($exception eq 'skip') {
+ print "-- Skipping $_\n";
+ next;
+ }
+ }
+ }
+
print "alter table $_ disable trigger all;\n";
+ print "alter table $_ set (autovacuum_enabled = false);\n";
}
- for (@$tables) {
+ for (sort keys %$tables) {
+ if (exists $exceptions{$_} and $exceptions{$_} eq 'skip') {
+ next;
+ }
print "delete from $_;\n";
- # print "commit;\n";
}
- for (@$tables) {
+ for (sort keys %$tables) {
+ if (exists $exceptions{$_} and $exceptions{$_} eq 'skip') {
+ next;
+ }
next if /^qrtz_/; # skip the quartz tables, they get regenerated anyway
- process_table($dbh, $_);
+ process_table($dbh, $_, $exceptions{$_});
}
- for (@$tables) {
+ for (sort keys %$tables) {
+ if (exists $exceptions{$_} and $exceptions{$_} eq 'skip') {
+ next;
+ }
print "alter table $_ enable trigger all;\n";
+ print "alter table $_ set (autovacuum_enabled = true);\n";
}
}
sub process_table {
- my ($dbh, $table) = @_;
- my $sth = $dbh->prepare("select * from $table");
- $sth->execute();
- my $row = $sth->fetchrow_arrayref();
- if (not $row) {
- return;
+ my ($dbh, $table, $exception) = @_;
+ my ($row, $names, $the_names);
+ my $sth = eval {
+ local $dbh->{PrintError} = 0;
+ $dbh->prepare("select * from $table");
+ };
+ my $sorted_the_names = '';
+ if (defined $sth and not $@) {
+ $sth->execute();
+ $row = $sth->fetchrow_arrayref();
+ $names = $sth->{NAME_lc};
+ $the_names = join ',', @$names;
+ $sorted_the_names = join ',', sort @$names;
+ } else {
+ if (not $DBI::err == 942) {
+ die $@;
+ }
+ $sorted_the_names = $the_names = 'missing table';
+ }
+ if (ref $exception) {
+ if (exists $exception->{$sorted_the_names}) {
+ $sth = $dbh->prepare($exception->{$sorted_the_names});
+ $sth->execute();
+ $row = $sth->fetchrow_arrayref();
+ $names = $sth->{NAME_lc};
+ print "-- Original columns for $table: $the_names\n";
+ $the_names = join ',', @$names;
+ }
+ }
+ my @use_rowids = ();
+ for (my $i = 0; $i < @$names; $i++) {
+ if ($names->[$i] =~ s/^rowid_//) {
+ $use_rowids[$i] = 1;
+ }
+ }
+ if (@use_rowids) {
+ $the_names = join ',', @$names;
}
- my $names = $sth->{NAME_lc};
my $types = $sth->{TYPE};
my @types;
for (my $i = 0; $i < @$types; $i++) {
@@ -111,11 +365,17 @@ sub process_table {
push @types, ( defined $type ? $type : 'unknown' );
}
print "-- Types for $table: @types\n";
- print qq!copy $table(@{[ join ',', @$names ]}) from stdin;\n!;
+ print qq!copy $table($the_names) from stdin;\n!;
while ($row) {
for (my $i = 0; $i < @$row; $i++) {
print "\t" if $i;
- if (defined $row->[$i]) {
+ if (defined $use_rowids[$i]) {
+ if (not defined $ROWIDS{$row->[$i]}) {
+ $SEQ++;
+ $ROWIDS{$row->[$i]} = $SEQ;
+ }
+ print $ROWIDS{$row->[$i]};
+ } elsif (defined $row->[$i]) {
if (ref $row->[$i] and ref $row->[$i] eq 'ARRAY') { # user types
no warnings 'uninitialized';
$row->[$i] = "(@{[ join ',', @{$row->[$i]} ]})";
11 years, 8 months
Changes to 'refs/tags/spacewalk-setup-1.8.21-1'
by Jan Pazdziora
Tag 'spacewalk-setup-1.8.21-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2012-10-22 15:16 +0000
Tagging package [spacewalk-setup] version [1.8.21-1] in directory [spacewalk/setup/].
Changes since spacewalk-setup-embedded-postgresql-1.8.3-1:
Jan Pazdziora (1):
Automatic commit of package [spacewalk-setup] release [1.8.21-1].
---
rel-eng/packages/spacewalk-setup | 2 +-
spacewalk/setup/spacewalk-setup.spec | 17 ++++++++++++++++-
2 files changed, 17 insertions(+), 2 deletions(-)
---
11 years, 8 months
rel-eng/packages spacewalk/setup
by Jan Pazdziora
rel-eng/packages/spacewalk-setup | 2 +-
spacewalk/setup/spacewalk-setup.spec | 17 ++++++++++++++++-
2 files changed, 17 insertions(+), 2 deletions(-)
New commits:
commit c972ff11df8d28524a8746101cf5e81d09733a33
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Oct 22 17:16:52 2012 +0200
Automatic commit of package [spacewalk-setup] release [1.8.21-1].
diff --git a/rel-eng/packages/spacewalk-setup b/rel-eng/packages/spacewalk-setup
index 3370b18..6f73b36 100644
--- a/rel-eng/packages/spacewalk-setup
+++ b/rel-eng/packages/spacewalk-setup
@@ -1 +1 @@
-1.8.20-1 spacewalk/setup/
+1.8.21-1 spacewalk/setup/
diff --git a/spacewalk/setup/spacewalk-setup.spec b/spacewalk/setup/spacewalk-setup.spec
index 23c20b7..dae2a64 100644
--- a/spacewalk/setup/spacewalk-setup.spec
+++ b/spacewalk/setup/spacewalk-setup.spec
@@ -1,5 +1,5 @@
Name: spacewalk-setup
-Version: 1.8.20
+Version: 1.8.21
Release: 1%{?dist}
Summary: Initial setup tools for Red Hat Spacewalk
@@ -110,6 +110,21 @@ rm -rf %{buildroot}
%doc LICENSE
%changelog
+* Mon Oct 22 2012 Jan Pazdziora 1.8.21-1
+- 562287 - pass proxy configuration to spacewalk-setup to store it into
+ rhn.conf file
+- upgrade: start pg server only when migrating
+- don't restart services when upgrading
+- set upgrade_db.log size to 22M
+- don't duplicate database upgrade log
+- don't support custom db-name in an answer file
+- don't pass db-name to upgrade-db.sh
+- When not using tnsnames.ora, the full service name has to be used.
+- Revert oracle_setup_embedded_db part of "added embedded postgresql
+ installation part"
+- Installation is with embedded database if not told otherwise.
+- No migration if the ISO has embedded Oracle software.
+
* Mon Oct 22 2012 Jan Pazdziora 1.8.20-1
- don't remove Oracle stuff during oracle->postgresql migration
- run db migration in upgrade mode only
11 years, 8 months