Changes to 'refs/tags/spacewalk-schema-1.3.7-1'
by Jan Pazdziora
Tag 'spacewalk-schema-1.3.7-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2010-12-23 14:19 +0000
Tagging package [spacewalk-schema] version [1.3.7-1] in directory [schema/spacewalk/].
Changes since rhnpush-5.5.12-1:
Jan Pazdziora (10):
The rhn_package database package is not used, removing.
The rhn_package package (schema in PostgreSQL) is now gone.
Function rhn_org.find_server_group_by_type not used anywhere, removing.
Mark postgres/end.sql as equivalent to the oracle variant (even if they do different things).
View rhnUsersInOrgOverview does not use web_user_site_info, fixing the deps.
Procedure channel_name_join not used anywhere, removing (together with the channel_name_t type).
Removing vercmpCounter and vercmpResetCounter from rpm package as they are not used anywhere.
Fix PostgreSQL rpm.vercmp to handle empty string epoch gracefully.
Marking PostgreSQL rpm schema equivalent to the Oracle package.
Automatic commit of package [spacewalk-schema] release [1.3.7-1].
---
rel-eng/packages/spacewalk-schema | 2
schema/spacewalk/common/views/views.deps | 2
schema/spacewalk/oracle/packages/packages.deps | 2
schema/spacewalk/oracle/packages/rhn_org.pkb | 16
schema/spacewalk/oracle/packages/rhn_org.pks | 16
schema/spacewalk/oracle/packages/rhn_package.pkb | 63 --
schema/spacewalk/oracle/packages/rhn_package.pks | 45 -
schema/spacewalk/oracle/packages/rpm.pkb | 20
schema/spacewalk/oracle/packages/rpm.pks | 12
schema/spacewalk/oracle/procs/channel_name_join.sql | 52 --
schema/spacewalk/oracle/types/channel_name_t.sql | 29 -
schema/spacewalk/postgres/end.sql | 1
schema/spacewalk/postgres/packages/packages.deps | 2
schema/spacewalk/postgres/packages/rhn_org.pkb | 25 -
schema/spacewalk/postgres/packages/rhn_org.pks | 11
schema/spacewalk/postgres/packages/rhn_package.pkb | 56 --
schema/spacewalk/postgres/packages/rhn_package.pks | 44 -
schema/spacewalk/postgres/packages/rpm.pkb | 5
schema/spacewalk/postgres/packages/rpm.pks | 3
schema/spacewalk/spacewalk-schema.spec | 15
schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/005-rhn_package-drop.sql | 4
schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/006-rhn_org.sql | 28 +
schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/007-rhn_org-body.sql | 235 ++++++++++
schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/008-channel_name_join-drop.sql | 3
schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/009-channel_name_t-drop.sql | 3
schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/010-rpm.sql | 33 +
schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/011-rpm-body.sql | 234 +++++++++
spacewalk/setup/lib/Spacewalk/Setup.pm | 1
28 files changed, 569 insertions(+), 393 deletions(-)
---
13 years, 4 months
rel-eng/packages schema/spacewalk
by Jan Pazdziora
rel-eng/packages/spacewalk-schema | 2 +-
schema/spacewalk/spacewalk-schema.spec | 15 ++++++++++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
New commits:
commit 751bab3c02475d3bc1c7a09da2cb740a3068c231
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Thu Dec 23 15:19:37 2010 +0100
Automatic commit of package [spacewalk-schema] release [1.3.7-1].
diff --git a/rel-eng/packages/spacewalk-schema b/rel-eng/packages/spacewalk-schema
index 565a156..2630a50 100644
--- a/rel-eng/packages/spacewalk-schema
+++ b/rel-eng/packages/spacewalk-schema
@@ -1 +1 @@
-1.3.6-1 schema/spacewalk/
+1.3.7-1 schema/spacewalk/
diff --git a/schema/spacewalk/spacewalk-schema.spec b/schema/spacewalk/spacewalk-schema.spec
index b24a2ba..938c150 100644
--- a/schema/spacewalk/spacewalk-schema.spec
+++ b/schema/spacewalk/spacewalk-schema.spec
@@ -2,7 +2,7 @@ Name: spacewalk-schema
Group: Applications/Internet
Summary: Oracle SQL schema for Spacewalk server
-Version: 1.3.6
+Version: 1.3.7
Release: 1%{?dist}
Source0: %{name}-%{version}.tar.gz
@@ -59,6 +59,19 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/spacewalk-schema-upgrade*
%changelog
+* Thu Dec 23 2010 Jan Pazdziora 1.3.7-1
+- Marking PostgreSQL rpm schema equivalent to the Oracle package.
+- Fix PostgreSQL rpm.vercmp to handle empty string epoch gracefully.
+- Removing vercmpCounter and vercmpResetCounter from rpm package as they are
+ not used anywhere.
+- Procedure channel_name_join not used anywhere, removing (together with the
+ channel_name_t type).
+- View rhnUsersInOrgOverview does not use web_user_site_info, fixing the deps.
+- Mark postgres/end.sql as equivalent to the oracle variant (even if they do
+ different things).
+- Function rhn_org.find_server_group_by_type not used anywhere, removing.
+- The rhn_package database package is not used, removing.
+
* Wed Dec 22 2010 Jan Pazdziora 1.3.6-1
- Fixed the rhnPackage.build_time type on PostgreSQL to
address rhnpush error.
13 years, 4 months
3 commits - schema/spacewalk
by Jan Pazdziora
schema/spacewalk/oracle/packages/rpm.pkb | 20
schema/spacewalk/oracle/packages/rpm.pks | 12
schema/spacewalk/postgres/packages/rpm.pkb | 5
schema/spacewalk/postgres/packages/rpm.pks | 3
schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/010-rpm.sql | 33 +
schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/011-rpm-body.sql | 234 ++++++++++
6 files changed, 274 insertions(+), 33 deletions(-)
New commits:
commit 9b243141bfb15e06a1ef5a650b2286099de15ea8
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Thu Dec 23 15:09:05 2010 +0100
Marking PostgreSQL rpm schema equivalent to the Oracle package.
diff --git a/schema/spacewalk/postgres/packages/rpm.pks b/schema/spacewalk/postgres/packages/rpm.pks
index 46669d2..16d069e 100644
--- a/schema/spacewalk/postgres/packages/rpm.pks
+++ b/schema/spacewalk/postgres/packages/rpm.pks
@@ -1,5 +1,6 @@
+-- oracle equivalent source sha1 1f8b5508a1d7ce29135f848b78b6564d005747b8
--
--- Copyright (c) 2008 Red Hat, Inc.
+-- Copyright (c) 2008--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
commit 7e9717f11d60efd85391670eb922f13d7e1dc7e5
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Thu Dec 23 15:06:29 2010 +0100
Fix PostgreSQL rpm.vercmp to handle empty string epoch gracefully.
Addressing
spaceschema=# select rpm.vercmp(null, '1.2', '5.el5', '', '1.2', '5.6') from dual ;
ERROR: invalid input syntax for integer: ""
CONTEXT: PL/pgSQL function "vercmp" line 14 at assignment
spaceschema=# select rpm.vercmp('', '1.2', '5.el5', null, '1.2', '5.6') from dual ;
ERROR: invalid input syntax for integer: ""
CONTEXT: PL/pgSQL function "vercmp" line 9 at assignment
diff --git a/schema/spacewalk/postgres/packages/rpm.pkb b/schema/spacewalk/postgres/packages/rpm.pkb
index 78331cf..21803d6 100644
--- a/schema/spacewalk/postgres/packages/rpm.pkb
+++ b/schema/spacewalk/postgres/packages/rpm.pkb
@@ -1,3 +1,4 @@
+-- oracle equivalent source sha1 625d2c9b448240a736f369e7b53a386ce9c1f28a
-- create schema rpm;
--update pg_setting
@@ -153,12 +154,12 @@ $$ language 'plpgsql';
ep1 INTEGER;
ep2 INTEGER;
BEGIN
- if e1 is null then
+ if e1 is null or e1 = '' then
ep1 := 0;
else
ep1 := e1::integer;
end if;
- if e2 is null then
+ if e2 is null or e2 = '' then
ep2 := 0;
else
ep2 := e2::integer;
commit ce5bf6fe7097aa13fe556ddb5164400343c017e6
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Thu Dec 23 15:04:32 2010 +0100
Removing vercmpCounter and vercmpResetCounter from rpm package as they are not used anywhere.
diff --git a/schema/spacewalk/oracle/packages/rpm.pkb b/schema/spacewalk/oracle/packages/rpm.pkb
index e7d6ac4..6d45b30 100644
--- a/schema/spacewalk/oracle/packages/rpm.pkb
+++ b/schema/spacewalk/oracle/packages/rpm.pkb
@@ -1,5 +1,5 @@
--
--- Copyright (c) 2008 Red Hat, Inc.
+-- Copyright (c) 2008--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
@@ -18,7 +18,6 @@
-- PL/SQL version of rpmvercompare
CREATE OR REPLACE PACKAGE BODY rpm AS
- vercmp_counter NUMBER := 0;
FUNCTION isdigit(ch CHAR)
RETURN BOOLEAN
@@ -209,7 +208,6 @@ CREATE OR REPLACE PACKAGE BODY rpm AS
ep1 NUMBER;
ep2 NUMBER;
BEGIN
- vercmp_counter := vercmp_counter + 1;
if e1 is null then
ep1 := 0;
else
@@ -230,38 +228,7 @@ CREATE OR REPLACE PACKAGE BODY rpm AS
END vercmp;
- FUNCTION vercmpCounter
- RETURN NUMBER
- IS
- BEGIN
- return vercmp_counter;
- END vercmpCounter;
-
- FUNCTION vercmpResetCounter
- RETURN NUMBER
- IS
- result NUMBER;
- BEGIN
- result := vercmp_counter;
- vercmp_counter := 0;
- return result;
- END vercmpResetCounter;
END rpm;
/
SHOW ERRORS;
---
--- Revision 1.4 2003/09/02 18:03:50 pjones
--- bugzilla: none
---
--- our rpmvercmp doesn't match the "fixed" rpm way. Does now.
---
--- Revision 1.3 2002/05/10 22:08:23 pjones
--- id/log
---
--- Revision 1.2 2002/04/02 23:19:44 misa
--- Added the comparison counter and assorted functions for handling it.
---
--- Revision 1.1 2002/03/21 20:14:10 misa
--- The packaged version of the PL/SQL rpmvercmp
---
diff --git a/schema/spacewalk/oracle/packages/rpm.pks b/schema/spacewalk/oracle/packages/rpm.pks
index b622649..16a059b 100644
--- a/schema/spacewalk/oracle/packages/rpm.pks
+++ b/schema/spacewalk/oracle/packages/rpm.pks
@@ -1,5 +1,5 @@
--
--- Copyright (c) 2008 Red Hat, Inc.
+-- Copyright (c) 2008--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
@@ -26,31 +26,8 @@ CREATE OR REPLACE PACKAGE rpm AS
DETERMINISTIC
PARALLEL_ENABLE;
PRAGMA RESTRICT_REFERENCES(vercmp, WNDS, RNDS);
-
- FUNCTION vercmpCounter
- return NUMBER
- PARALLEL_ENABLE;
- PRAGMA RESTRICT_REFERENCES(vercmpCounter, WNDS, RNDS);
-
- FUNCTION vercmpResetCounter
- return NUMBER
- PARALLEL_ENABLE;
- PRAGMA RESTRICT_REFERENCES(vercmpResetCounter, WNDS, RNDS);
END rpm;
/
SHOW ERRORS;
---
--- Revision 1.4 2002/05/10 22:08:23 pjones
--- id/log
---
--- Revision 1.3 2002/04/02 23:19:44 misa
--- Added the comparison counter and assorted functions for handling it.
---
--- Revision 1.2 2002/03/21 20:21:24 misa
--- For some reason this doesn't work. I'll further investigate it.
---
--- Revision 1.1 2002/03/21 20:14:10 misa
--- The packaged version of the PL/SQL rpmvercmp
---
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/010-rpm.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/010-rpm.sql
new file mode 100644
index 0000000..16a059b
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/010-rpm.sql
@@ -0,0 +1,33 @@
+--
+-- Copyright (c) 2008--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.
+--
+--
+--
+--
+-- PL/SQL version of rpmvercompare
+--
+
+CREATE OR REPLACE PACKAGE rpm AS
+ FUNCTION vercmp(
+ e1 VARCHAR2, v1 VARCHAR2, r1 VARCHAR2,
+ e2 VARCHAR2, v2 VARCHAR2, r2 VARCHAR2)
+ RETURN NUMBER
+ DETERMINISTIC
+ PARALLEL_ENABLE;
+ PRAGMA RESTRICT_REFERENCES(vercmp, WNDS, RNDS);
+
+END rpm;
+/
+SHOW ERRORS;
+
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/011-rpm-body.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/011-rpm-body.sql
new file mode 100644
index 0000000..6d45b30
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/011-rpm-body.sql
@@ -0,0 +1,234 @@
+--
+-- Copyright (c) 2008--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.
+--
+--
+--
+--
+-- PL/SQL version of rpmvercompare
+
+CREATE OR REPLACE PACKAGE BODY rpm AS
+
+ FUNCTION isdigit(ch CHAR)
+ RETURN BOOLEAN
+ deterministic
+ IS
+ BEGIN
+ if ascii(ch) between ascii('0') and ascii('9')
+ then
+ return TRUE;
+ end if;
+ return FALSE;
+ END isdigit;
+
+
+ FUNCTION isalpha(ch CHAR)
+ RETURN BOOLEAN
+ deterministic
+ IS
+ BEGIN
+ if ascii(ch) between ascii('a') and ascii('z') or
+ ascii(ch) between ascii('A') and ascii('Z')
+ then
+ return TRUE;
+ end if;
+ return FALSE;
+ END isalpha;
+
+
+ FUNCTION isalphanum(ch CHAR)
+ RETURN BOOLEAN
+ deterministic
+ IS
+ BEGIN
+ if ascii(ch) between ascii('a') and ascii('z') or
+ ascii(ch) between ascii('A') and ascii('Z') or
+ ascii(ch) between ascii('0') and ascii('9')
+ then
+ return TRUE;
+ end if;
+ return FALSE;
+ END isalphanum;
+
+
+ FUNCTION rpmstrcmp (string1 IN VARCHAR2, string2 IN VARCHAR2)
+ RETURN NUMBER
+ deterministic
+ IS
+ digits CHAR(10) := '0123456789';
+ lc_alpha CHAR(27) := 'abcdefghijklmnopqrstuvwxyz';
+ uc_alpha CHAR(27) := 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+ alpha CHAR(54) := lc_alpha || uc_alpha;
+ str1 VARCHAR2(32767) := string1;
+ str2 VARCHAR2(32767) := string2;
+ one VARCHAR2(32767);
+ two VARCHAR2(32767);
+ isnum BOOLEAN;
+ BEGIN
+ if str1 is NULL or str2 is NULL
+ then
+ raise VALUE_ERROR;
+ end if;
+ -- easy comparison to see if versions are identical
+ if str1 = str2
+ then
+ return 0;
+ end if;
+ -- loop through each version segment of str1 and str2 and compare them
+ one := str1;
+ two := str2;
+
+ <<segment_loop>>
+ while one is not null and two is not null
+ loop
+ declare
+ segm1 VARCHAR2(32767);
+ segm2 VARCHAR2(32767);
+ begin
+ --DBMS_OUTPUT.PUT_LINE('Params: ' || one || ',' || two);
+ -- Throw out all non-alphanum characters
+ while one is not null and not isalphanum(one)
+ loop
+ one := substr(one, 2);
+ end loop;
+ while two is not null and not isalphanum(two)
+ loop
+ two := substr(two, 2);
+ end loop;
+ --DBMS_OUTPUT.PUT_LINE('new params: ' || one || ',' || two);
+
+ str1 := one;
+ str2 := two;
+
+ /* grab first completely alpha or completely numeric segment */
+ /* leave one and two pointing to the start of the alpha or numeric */
+ /* segment and walk str1 and str2 to end of segment */
+
+ if str1 is not null and isdigit(str1)
+ then
+ str1 := ltrim(str1, digits);
+ str2 := ltrim(str2, digits);
+ isnum := true;
+ else
+ str1 := ltrim(str1, alpha);
+ str2 := ltrim(str2, alpha);
+ isnum := false;
+ end if;
+
+ --DBMS_OUTPUT.PUT_LINE('Len: ' || length(str1) || ',' || length(str2));
+ -- Oracle trats the length of an empty string as null
+ if str1 is not null
+ then segm1 := substr(one, 1, length(one) - length(str1));
+ else segm1 := one;
+ end if;
+
+ if str2 is not null
+ then segm2 := substr(two, 1, length(two) - length(str2));
+ else segm2 := two;
+ end if;
+
+ --DBMS_OUTPUT.PUT_LINE('Segments: ' || segm1 || ',' || segm2);
+ --DBMS_OUTPUT.PUT_LINE('Rest: ' || str1 || ',' || str2);
+ /* take care of the case where the two version segments are */
+ /* different types: one numeric and one alpha */
+ if segm1 is null then return -1; end if; /* arbitrary */
+ if segm2 is null then
+ if isnum then
+ return 1;
+ else
+ return -1;
+ end if;
+ end if;
+
+ if isnum
+ then
+ /* this used to be done by converting the digit segments */
+ /* to ints using atoi() - it's changed because long */
+ /* digit segments can overflow an int - this should fix that. */
+
+ /* throw away any leading zeros - it's a number, right? */
+ segm1 := ltrim(segm1, '0');
+ segm2 := ltrim(segm2, '0');
+
+ /* whichever number has more digits wins */
+ -- length of empty string is null
+ if segm1 is null and segm2 is not null
+ then
+ return -1;
+ end if;
+ if segm1 is not null and segm2 is null
+ then
+ return 1;
+ end if;
+ if length(segm1) > length(segm2) then return 1; end if;
+ if length(segm2) > length(segm1) then return -1; end if;
+ end if;
+
+ /* strcmp will return which one is greater - even if the two */
+ /* segments are alpha or if they are numeric. don't return */
+ /* if they are equal because there might be more segments to */
+ /* compare */
+
+ if segm1 < segm2 then return -1; end if;
+ if segm1 > segm2 then return 1; end if;
+
+ one := str1;
+ two := str2;
+ end;
+ end loop segment_loop;
+ /* this catches the case where all numeric and alpha segments have */
+ /* compared identically but the segment sepparating characters were */
+ /* different */
+ if one is null and two is null then return 0; end if;
+
+ /* whichever version still has characters left over wins */
+ if one is null then return -1; end if;
+ return 1;
+ END rpmstrcmp;
+
+
+ FUNCTION vercmp(
+ e1 VARCHAR2, v1 VARCHAR2, r1 VARCHAR2,
+ e2 VARCHAR2, v2 VARCHAR2, r2 VARCHAR2)
+ RETURN NUMBER
+ IS
+ rc NUMBER;
+ BEGIN
+ DECLARE
+ ep1 NUMBER;
+ ep2 NUMBER;
+ BEGIN
+ if e1 is null then
+ ep1 := 0;
+ else
+ ep1 := TO_NUMBER(e1);
+ end if;
+ if e2 is null then
+ ep2 := 0;
+ else
+ ep2 := TO_NUMBER(e2);
+ end if;
+ -- Epochs are non-null; compare them
+ if ep1 < ep2 then return -1; end if;
+ if ep1 > ep2 then return 1; end if;
+ rc := rpmstrcmp(v1, v2);
+ if rc != 0 then return rc; end if;
+ return rpmstrcmp(r1, r2);
+ END;
+
+ END vercmp;
+
+END rpm;
+/
+SHOW ERRORS;
+
13 years, 4 months
schema/spacewalk
by Jan Pazdziora
schema/spacewalk/oracle/procs/channel_name_join.sql | 52 ----------
schema/spacewalk/oracle/types/channel_name_t.sql | 29 -----
schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/008-channel_name_join-drop.sql | 3
schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/009-channel_name_t-drop.sql | 3
4 files changed, 6 insertions(+), 81 deletions(-)
New commits:
commit d5849854c3aa1cc97ee0919f7de5f5a34351deca
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Thu Dec 23 14:38:47 2010 +0100
Procedure channel_name_join not used anywhere, removing (together with the channel_name_t type).
diff --git a/schema/spacewalk/oracle/procs/channel_name_join.sql b/schema/spacewalk/oracle/procs/channel_name_join.sql
deleted file mode 100644
index 5d4c537..0000000
--- a/schema/spacewalk/oracle/procs/channel_name_join.sql
+++ /dev/null
@@ -1,52 +0,0 @@
---
--- 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.
---
---
---
---
-
-create or replace function
-channel_name_join(sep_in in varchar2, ch_in in channel_name_t)
-return varchar2
-deterministic
-is
- ret varchar2(4000);
- i binary_integer;
-begin
- ret := '';
- i := ch_in.first;
-
- if i is null
- then
- return ret;
- end if;
-
- ret := ch_in(i);
- i := ch_in.next(i);
-
- while i is not null
- loop
- ret := ret || sep_in || ch_in(i);
- i := ch_in.next(i);
- end loop;
-
- return ret;
-end;
-/
-
---
--- Revision 1.3 2002/05/13 22:53:38 pjones
--- cvs id/log
--- some (note enough) readability fixes
---
diff --git a/schema/spacewalk/oracle/types/channel_name_t.sql b/schema/spacewalk/oracle/types/channel_name_t.sql
deleted file mode 100644
index 8219115..0000000
--- a/schema/spacewalk/oracle/types/channel_name_t.sql
+++ /dev/null
@@ -1,29 +0,0 @@
---
--- 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.
---
---
---
---
--- this creates the channel_name_t type
-
-create or replace type channel_name_t as table of varchar(64)
-/
-
---
--- Revision 1.2 2002/05/09 22:34:53 pjones
--- argh, ; doesn't work right here
---
--- Revision 1.1 2002/05/09 22:31:42 pjones
--- make types first-class schema
---
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/008-channel_name_join-drop.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/008-channel_name_join-drop.sql
new file mode 100644
index 0000000..4e34675
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/008-channel_name_join-drop.sql
@@ -0,0 +1,3 @@
+
+drop function channel_name_join;
+
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/009-channel_name_t-drop.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/009-channel_name_t-drop.sql
new file mode 100644
index 0000000..b33eb27
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/009-channel_name_t-drop.sql
@@ -0,0 +1,3 @@
+
+drop type channel_name_t;
+
13 years, 4 months
2 commits - schema/spacewalk
by Jan Pazdziora
schema/spacewalk/common/views/views.deps | 2 +-
schema/spacewalk/postgres/end.sql | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 600739b725e64fab90ebf239eb765fec73d96f28
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Thu Dec 23 14:16:55 2010 +0100
View rhnUsersInOrgOverview does not use web_user_site_info, fixing the deps.
diff --git a/schema/spacewalk/common/views/views.deps b/schema/spacewalk/common/views/views.deps
index e35ba78..2a1d3a7 100644
--- a/schema/spacewalk/common/views/views.deps
+++ b/schema/spacewalk/common/views/views.deps
@@ -79,7 +79,7 @@ rhnUserTypeBase :: rhnUserGroupMembers rhnUserGroupType \
rhnUsersInOrgOverview :: rhnUserServerPerms web_contact \
rhnUserManagedServerGroups \
rhnVisibleServerGroup rhnUserTypeCommaView \
- web_user_site_info web_user_personal_info
+ web_user_personal_info
rhnVisServerGroupMembership :: rhnServerGroupType rhnServerGroupMembers \
rhnVisibleServerGroup
rhnVisibleServerGroup :: rhnServerGroup
commit 2963cb1ecf11f1cb6c9bd4564b2dcb53c790ee7d
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Thu Dec 23 14:11:57 2010 +0100
Mark postgres/end.sql as equivalent to the oracle variant (even if they do different things).
diff --git a/schema/spacewalk/postgres/end.sql b/schema/spacewalk/postgres/end.sql
index 27da1ac..ded9953 100644
--- a/schema/spacewalk/postgres/end.sql
+++ b/schema/spacewalk/postgres/end.sql
@@ -1,3 +1,4 @@
+-- oracle equivalent source sha1 14209d5b6d662eb00d6a7042f32f68c8677ff9c9
--
-- Copyright (c) 2010 Red Hat, Inc.
--
13 years, 4 months
schema/spacewalk
by Jan Pazdziora
schema/spacewalk/oracle/packages/rhn_org.pkb | 16
schema/spacewalk/oracle/packages/rhn_org.pks | 16
schema/spacewalk/postgres/packages/rhn_org.pkb | 25 -
schema/spacewalk/postgres/packages/rhn_org.pks | 11
schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/006-rhn_org.sql | 28 +
schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/007-rhn_org-body.sql | 235 ++++++++++
6 files changed, 268 insertions(+), 63 deletions(-)
New commits:
commit 3d93e507f3588328ec796bee14f5d58c30dd3032
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Thu Dec 23 14:09:16 2010 +0100
Function rhn_org.find_server_group_by_type not used anywhere, removing.
diff --git a/schema/spacewalk/oracle/packages/rhn_org.pkb b/schema/spacewalk/oracle/packages/rhn_org.pkb
index da565d2..1ae6f83 100644
--- a/schema/spacewalk/oracle/packages/rhn_org.pkb
+++ b/schema/spacewalk/oracle/packages/rhn_org.pkb
@@ -18,21 +18,7 @@
CREATE OR REPLACE
PACKAGE BODY rhn_org
-IS
- body_version varchar2(100) := '';
-
- FUNCTION find_server_group_by_type(org_id_in NUMBER, group_label_in VARCHAR2)
- RETURN NUMBER
- IS
- server_group server_group_by_label%ROWTYPE;
- BEGIN
- OPEN server_group_by_label(org_id_in, group_label_in);
- FETCH server_group_by_label INTO server_group;
- CLOSE server_group_by_label;
-
- RETURN server_group.id;
- END find_server_group_by_type;
-
+IS
procedure delete_org (
org_id_in in number
)
diff --git a/schema/spacewalk/oracle/packages/rhn_org.pks b/schema/spacewalk/oracle/packages/rhn_org.pks
index eec5241..c549d48 100644
--- a/schema/spacewalk/oracle/packages/rhn_org.pks
+++ b/schema/spacewalk/oracle/packages/rhn_org.pks
@@ -1,5 +1,5 @@
--
--- Copyright (c) 2008 Red Hat, Inc.
+-- Copyright (c) 2008--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
@@ -19,20 +19,6 @@
CREATE OR REPLACE
PACKAGE rhn_org
IS
- version varchar2(100) := '';
-
- CURSOR server_group_by_label(org_id_in NUMBER, group_label_in VARCHAR2) IS
- SELECT SG.*
- FROM rhnServerGroupType SGT,
- rhnServerGroup SG
- WHERE SG.group_type = SGT.id
- AND SGT.label = group_label_in
- AND SG.org_id = org_id_in;
-
- FUNCTION find_server_group_by_type(org_id_in NUMBER,
- group_label_in VARCHAR2)
- RETURN NUMBER;
-
procedure delete_org(org_id_in in number);
procedure delete_user(user_id_in in number, deleting_org in number := 0);
@@ -40,16 +26,3 @@ END rhn_org;
/
SHOW ERRORS
---
--- Revision 1.7 2004/07/13 22:46:04 pjones
--- bugzilla: 125938 -- nothing uses update_errata_cache() any more, remove it
---
--- Revision 1.6 2004/02/10 15:05:01 pjones
--- bugzilla: none -- add version tag here
---
--- Revision 1.5 2003/02/18 16:35:45 pjones
--- delete_user
---
--- Revision 1.4 2002/05/10 22:08:23 pjones
--- id/log
---
diff --git a/schema/spacewalk/postgres/packages/rhn_org.pkb b/schema/spacewalk/postgres/packages/rhn_org.pkb
index 17f94eb..4796821 100644
--- a/schema/spacewalk/postgres/packages/rhn_org.pkb
+++ b/schema/spacewalk/postgres/packages/rhn_org.pkb
@@ -1,4 +1,4 @@
--- oracle equivalent source sha1 0cbe7350fd03e375f840735de481cf22d7b127bc
+-- oracle equivalent source sha1 78ceb7a44befb2120e46a7d40ac1cd32f1227f06
--
-- Copyright (c) 2008--2010 Red Hat, Inc.
--
@@ -19,29 +19,6 @@
-- setup search_path so that these functions are created in appropriate schema.
update pg_settings set setting = 'rhn_org,' || setting where name = 'search_path';
-CREATE OR REPLACE FUNCTION find_server_group_by_type(org_id_in NUMERIC, group_label_in VARCHAR)
- RETURNS NUMERIC
- AS
- $$
- DECLARE
- server_group_by_label CURSOR (org_id_in NUMERIC, group_label_in VARCHAR) FOR
- SELECT SG.*
- FROM rhnServerGroupType SGT,
- rhnServerGroup SG
- WHERE SG.group_type = SGT.id
- AND SGT.label = group_label_in
- AND SG.org_id = org_id_in;
-
- server_group record;
- BEGIN
- OPEN server_group_by_label(org_id_in, group_label_in);
- FETCH server_group_by_label INTO server_group;
- CLOSE server_group_by_label;
-
- RETURN server_group.id;
- END;
- $$
- LANGUAGE PLPGSQL;
create or replace function delete_org (
org_id_in in numeric
diff --git a/schema/spacewalk/postgres/packages/rhn_org.pks b/schema/spacewalk/postgres/packages/rhn_org.pks
index cdbd452..32d1ccb 100644
--- a/schema/spacewalk/postgres/packages/rhn_org.pks
+++ b/schema/spacewalk/postgres/packages/rhn_org.pks
@@ -1,5 +1,6 @@
+-- oracle equivalent source sha1 f19b747e0d9e2f2db3745679cdb0397e2be64650
--
--- Copyright (c) 2008 Red Hat, Inc.
+-- Copyright (c) 2008--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
@@ -18,14 +19,6 @@ create schema rhn_org;
-- setup search_path so that these functions are created in appropriate schema.
update pg_settings set setting = 'rhn_org,' || setting where name = 'search_path';
-CREATE OR REPLACE FUNCTION find_server_group_by_type(org_id_in NUMERIC, group_label_in VARCHAR)
-RETURNS NUMERIC
-AS $$
-BEGIN
- RAISE EXCEPTION 'Stub called, must be replaced by .pkb';
-END;
-$$ LANGUAGE PLPGSQL;
-
CREATE OR REPLACE FUNCTION delete_org (org_id_in in numeric)
RETURNS VOID
AS $$
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/006-rhn_org.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/006-rhn_org.sql
new file mode 100644
index 0000000..c549d48
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/006-rhn_org.sql
@@ -0,0 +1,28 @@
+--
+-- Copyright (c) 2008--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.
+--
+--
+--
+--
+
+CREATE OR REPLACE
+PACKAGE rhn_org
+IS
+ procedure delete_org(org_id_in in number);
+ procedure delete_user(user_id_in in number, deleting_org in number := 0);
+
+END rhn_org;
+/
+SHOW ERRORS
+
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/007-rhn_org-body.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/007-rhn_org-body.sql
new file mode 100644
index 0000000..1ae6f83
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/007-rhn_org-body.sql
@@ -0,0 +1,235 @@
+--
+-- Copyright (c) 2008--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.
+--
+--
+--
+--
+
+CREATE OR REPLACE
+PACKAGE BODY rhn_org
+IS
+ procedure delete_org (
+ org_id_in in number
+ )
+ is
+ cursor users is
+ select id
+ from web_contact
+ where org_id = org_id_in;
+
+ cursor servers(org_id_in in number) is
+ select id
+ from rhnServer
+ where org_id = org_id_in;
+
+ cursor config_channels is
+ select id
+ from rhnConfigChannel
+ where org_id = org_id_in;
+
+ cursor custom_channels is
+ select id
+ from rhnChannel
+ where org_id = org_id_in;
+
+ cursor errata is
+ select id
+ from rhnErrata
+ where org_id = org_id_in;
+
+ begin
+
+ if org_id_in = 1 then
+ rhn_exception.raise_exception('cannot_delete_base_org');
+ end if;
+
+ -- Delete all users.
+ for u in users loop
+ rhn_org.delete_user(u.id, 1);
+ end loop;
+
+ -- Delete all servers.
+ for s in servers(org_id_in) loop
+ delete_server(s.id);
+ end loop;
+
+ -- Delete all config channels.
+ for c in config_channels loop
+ rhn_config.delete_channel(c.id);
+ end loop;
+
+ -- Delete all custom channels.
+ for cc in custom_channels loop
+ delete from rhnServerChannel where channel_id = cc.id;
+ delete from rhnServerProfilePackage where server_profile_id in (
+ select id from rhnServerProfile where base_channel = cc.id
+ );
+ delete from rhnServerProfile where base_channel = cc.id;
+ end loop;
+
+ -- Delete all errata packages
+ for e in errata loop
+ delete from rhnErrataPackage where errata_id = e.id;
+ end loop;
+
+ -- Give the org's entitlements back to the main org.
+ rhn_entitlements.remove_org_entitlements(org_id_in);
+
+ -- Clean up tables where we don't have a cascading delete.
+ delete from rhnChannel where org_id = org_id_in;
+ delete from rhnDailySummaryQueue where org_id = org_id_in;
+ delete from rhnOrgQuota where org_id = org_id_in;
+ delete from rhnFileList where org_id = org_id_in;
+ delete from rhnServerGroup where org_id = org_id_in;
+ delete from rhn_check_suites where customer_id = org_id_in;
+ delete from rhn_command_target where customer_id = org_id_in;
+ delete from rhn_contact_groups where customer_id = org_id_in;
+ delete from rhn_notification_formats where customer_id = org_id_in;
+ delete from rhn_probe where customer_id = org_id_in;
+ delete from rhn_redirects where customer_id = org_id_in;
+ delete from rhn_sat_cluster where customer_id = org_id_in;
+ delete from rhn_schedules where customer_id = org_id_in;
+
+ -- Delete the org.
+ delete from web_customer where id = org_id_in;
+
+ end delete_org;
+
+ procedure delete_user(user_id_in in number, deleting_org in number := 0) is
+ cursor servergroups_needing_admins is
+ select usgp.server_group_id server_group_id
+ from rhnUserServerGroupPerms usgp
+ where 1=1
+ and usgp.user_id = user_id_in
+ and not exists (
+ select 1
+ from rhnUserServerGroupPerms sq_usgp
+ where 1=1
+ and sq_usgp.server_group_id = usgp.server_group_id
+ and sq_usgp.user_id != user_id_in
+ );
+ users number;
+ our_org_id number;
+ other_users number;
+ other_org_admin number;
+ other_user_id number;
+ is_admin number;
+ begin
+ select wc.org_id
+ into our_org_id
+ from web_contact wc
+ where id = user_id_in;
+
+ -- find any other users
+ begin
+ select id, 1
+ into other_user_id, other_users
+ from web_contact
+ where 1=1
+ and org_id = our_org_id
+ and id != user_id_in
+ and rownum = 1;
+ exception
+ when no_data_found then
+ other_users := 0;
+ end;
+
+ -- now do org admin stuff
+ if other_users != 0 then
+ -- is user admin?
+ select count(1)
+ into is_admin
+ from rhnUserGroupType ugt,
+ rhnUserGroup ug,
+ rhnUserGroupMembers ugm
+ where ugm.user_id = user_id_in
+ and ugm.user_group_id = ug.id
+ and ug.group_type = ugt.id
+ and ugt.label = 'org_admin';
+ if is_admin > 0 then
+ begin
+ select new_ugm.user_id
+ into other_org_admin
+ from rhnUserGroupMembers new_ugm,
+ rhnUserGroupType ugt,
+ rhnUserGroup ug,
+ rhnUserGroupMembers ugm
+ where ugm.user_id = user_id_in
+ and ugm.user_group_id = ug.id
+ and ug.group_type = ugt.id
+ and ugt.label = 'org_admin'
+ and ug.id = new_ugm.user_group_id
+ and new_ugm.user_id != user_id_in
+ and rownum = 1;
+ exception
+ when no_data_found then
+ -- If we're deleting the org, we don't want to raise
+ -- the exception.
+ if deleting_org = 0 then
+ rhn_exception.raise_exception('cannot_delete_user');
+ end if;
+ end;
+
+ for sg in servergroups_needing_admins loop
+ rhn_user.add_servergroup_perm(other_org_admin,
+ sg.server_group_id);
+ end loop;
+ end if;
+ end if;
+
+ -- and now things for every user
+ delete from rhn_command_queue_sessions where contact_id = user_id_in;
+ delete from rhn_contact_groups
+ where recid in (
+ select contact_group_id
+ from rhn_contact_group_members
+ where member_contact_method_id in (
+ select recid from rhn_contact_methods
+ where contact_id = user_id_in
+ )
+ )
+ and not exists (
+ select 1
+ from rhn_contact_group_members, rhn_contact_methods
+ where rhn_contact_groups.recid = rhn_contact_group_members.contact_group_id
+ and rhn_contact_group_members.member_contact_method_id = rhn_contact_methods.recid
+ and rhn_contact_methods.contact_id <> user_id_in
+ );
+ delete from rhn_contact_methods where contact_id = user_id_in;
+ delete from rhn_redirects where contact_id = user_id_in;
+ delete from rhnUserServerPerms where user_id = user_id_in;
+ delete from rhnAppInstallSession where user_id = user_id_in;
+ update rhnConfigRevision
+ set changed_by_id = NULL
+ where changed_by_id = user_id_in;
+ if other_users != 0 then
+ update rhnRegToken
+ set user_id = nvl(other_org_admin, other_user_id)
+ where org_id = our_org_id
+ and user_id = user_id_in;
+ end if;
+
+ begin
+ delete from web_contact where id = user_id_in;
+ exception
+ when others then
+ rhn_exception.raise_exception('cannot_delete_user');
+ end;
+ return;
+ end delete_user;
+
+END rhn_org;
+/
+SHOW ERRORS
+
13 years, 4 months
2 commits - schema/spacewalk spacewalk/setup
by Jan Pazdziora
schema/spacewalk/oracle/packages/packages.deps | 2
schema/spacewalk/oracle/packages/rhn_package.pkb | 63 ----------
schema/spacewalk/oracle/packages/rhn_package.pks | 45 -------
schema/spacewalk/postgres/packages/packages.deps | 2
schema/spacewalk/postgres/packages/rhn_package.pkb | 56 --------
schema/spacewalk/postgres/packages/rhn_package.pks | 44 ------
schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/005-rhn_package-drop.sql | 4
spacewalk/setup/lib/Spacewalk/Setup.pm | 1
8 files changed, 4 insertions(+), 213 deletions(-)
New commits:
commit 45c4f03e9efcabebbe8e63510657c7c2acbdeded
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Thu Dec 23 13:52:35 2010 +0100
The rhn_package package (schema in PostgreSQL) is now gone.
diff --git a/spacewalk/setup/lib/Spacewalk/Setup.pm b/spacewalk/setup/lib/Spacewalk/Setup.pm
index ab46c89..467b245 100644
--- a/spacewalk/setup/lib/Spacewalk/Setup.pm
+++ b/spacewalk/setup/lib/Spacewalk/Setup.pm
@@ -867,7 +867,6 @@ my $POSTGRESQL_CLEAR_SCHEMA = <<EOS;
drop schema rhn_channel cascade ;
drop schema rhn_config_channel cascade ;
drop schema rhn_org cascade ;
- drop schema rhn_package cascade ;
drop schema rhn_user cascade ;
drop schema public cascade ;
create schema public authorization postgres ;
commit ee9d553078ab707393636437305e2ea75c52c16b
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Thu Dec 23 13:51:11 2010 +0100
The rhn_package database package is not used, removing.
It was last used by rhnOrgPackageOverview whic we dropped for
Spacewalk 1.2.
diff --git a/schema/spacewalk/oracle/packages/packages.deps b/schema/spacewalk/oracle/packages/packages.deps
index d8c619a..c519192 100644
--- a/schema/spacewalk/oracle/packages/packages.deps
+++ b/schema/spacewalk/oracle/packages/packages.deps
@@ -57,8 +57,6 @@ rhn_org.pkb :: rhn_entitlements.pks \
rhn_probe rhn_redirects rhn_sat_cluster \
web_contact web_customer
rhn_org.pks :: rhnServerGroupType rhnServerGroup
-rhn_package.pkb :: rhnChannel rhnChannelPackage
-rhn_package.pks :: rhnChannel rhnChannelPackage
rhn_quota.pkb :: rhnConfigContent rhnConfigRevision rhnConfigFile \
rhnConfigChannel rhnOrgQuota rhn_config.pks
rhn_server.pkb :: rhnServerChannel rhnConfigFileName \
diff --git a/schema/spacewalk/oracle/packages/rhn_package.pkb b/schema/spacewalk/oracle/packages/rhn_package.pkb
deleted file mode 100644
index 1f38e1d..0000000
--- a/schema/spacewalk/oracle/packages/rhn_package.pkb
+++ /dev/null
@@ -1,63 +0,0 @@
---
--- 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.
---
---
---
---
-
-CREATE OR REPLACE
-PACKAGE BODY rhn_package
-IS
- FUNCTION canonical_name(name_in IN VARCHAR2, evr_in IN EVR_T,
- arch_in IN VARCHAR2)
- RETURN VARCHAR2
- IS
- name_out VARCHAR2(256);
- BEGIN
- name_out := name_in || '-' || evr_in.as_vre_simple();
-
- IF arch_in IS NOT NULL
- THEN
- name_out := name_out || '-' || arch_in;
- END IF;
-
- RETURN name_out;
- END canonical_name;
-
- FUNCTION channel_occupancy_string(package_id_in IN NUMBER, separator_in VARCHAR2 := ', ')
- RETURN VARCHAR2
- IS
- list_out VARCHAR2(4000);
- BEGIN
- FOR channel IN channel_occupancy_cursor(package_id_in)
- LOOP
- IF list_out IS NULL
- THEN
- list_out := channel.channel_name;
- ELSE
- list_out := channel.channel_name || separator_in || list_out;
- END IF;
- END LOOP;
-
- RETURN list_out;
- END channel_occupancy_string;
-
-END rhn_package;
-/
-SHOW ERRORS
-
---
--- Revision 1.3 2002/05/10 22:08:23 pjones
--- id/log
---
diff --git a/schema/spacewalk/oracle/packages/rhn_package.pks b/schema/spacewalk/oracle/packages/rhn_package.pks
deleted file mode 100644
index d47ce8c..0000000
--- a/schema/spacewalk/oracle/packages/rhn_package.pks
+++ /dev/null
@@ -1,45 +0,0 @@
---
--- 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.
---
---
---
---
-
-CREATE OR REPLACE
-PACKAGE rhn_package
-IS
- CURSOR channel_occupancy_cursor(package_id_in IN NUMBER) IS
- SELECT C.id channel_id, C.name channel_name
- FROM rhnChannel C,
- rhnChannelPackage CP
- WHERE C.id = CP.channel_id
- AND CP.package_id = package_id_in
- ORDER BY C.name DESC;
-
- FUNCTION canonical_name(name_in IN VARCHAR2, evr_in IN EVR_T,
- arch_in IN VARCHAR2 := NULL)
- RETURN VARCHAR2
- DETERMINISTIC;
-
- FUNCTION channel_occupancy_string(package_id_in IN NUMBER, separator_in VARCHAR2 := ', ')
- RETURN VARCHAR2;
-
-END rhn_package;
-/
-SHOW ERRORS
-
---
--- Revision 1.3 2002/05/10 22:08:23 pjones
--- id/log
---
diff --git a/schema/spacewalk/postgres/packages/packages.deps b/schema/spacewalk/postgres/packages/packages.deps
index 40d3401..59f9820 100644
--- a/schema/spacewalk/postgres/packages/packages.deps
+++ b/schema/spacewalk/postgres/packages/packages.deps
@@ -55,8 +55,6 @@ rhn_org.pkb :: rhn_entitlements.pks \
rhn_probe rhn_redirects rhn_sat_cluster \
web_contact web_customer
rhn_org.pks :: rhnServerGroupType rhnServerGroup
-rhn_package.pkb :: rhnChannel rhnChannelPackage
-rhn_package.pks :: rhnChannel rhnChannelPackage
rhn_quota.pkb :: rhnConfigContent rhnConfigRevision rhnConfigFile \
rhnConfigChannel rhnOrgQuota rhn_config.pks
rhn_server.pkb :: rhnServerChannel rhnConfigFileName \
diff --git a/schema/spacewalk/postgres/packages/rhn_package.pkb b/schema/spacewalk/postgres/packages/rhn_package.pkb
deleted file mode 100644
index ce110bd..0000000
--- a/schema/spacewalk/postgres/packages/rhn_package.pkb
+++ /dev/null
@@ -1,56 +0,0 @@
-
--- create schema rhn_package;
-
---update pg_setting
-update pg_settings set setting = 'rhn_package,' || setting where name = 'search_path';
-
-
-create or replace FUNCTION canonical_name(name_in IN VARCHAR, evr_in IN EVR_T,
- arch_in IN VARCHAR DEFAULT NULL)
- RETURNS VARCHAR as $$
- declare
- name_out VARCHAR(256);
-
- BEGIN
- name_out := name_in || '-' || evr_t_as_vre_simple(evr_in);
-
- IF arch_in <> ''
- THEN
- name_out := name_out || '-' || arch_in;
- END IF;
-
- RETURN name_out;
- END ;
- $$ language 'plpgsql';
-
-
-create or replace FUNCTION channel_occupancy_string(package_id_in IN NUMERIC, separator_in VARCHAR DEFAULT ', ')
- RETURNS VARCHAR as $$
- declare
- list_out VARCHAR(4000);
- channel_occupancy_cursor CURSOR (package_id_in numeric) for
- SELECT C.id AS channel_id, C.name AS channel_name
- FROM rhnChannel C,
- rhnChannelPackage CP
- WHERE C.id = CP.channel_id
- AND CP.package_id = package_id_in
- ORDER BY C.name DESC;
- BEGIN
- FOR channel IN channel_occupancy_cursor(package_id_in)
- LOOP
- IF list_out IS NULL
- THEN
- list_out := channel.channel_name;
- ELSE
- list_out := channel.channel_name || separator_in || list_out;
- END IF;
- END LOOP;
-
- RETURN list_out;
- END ;
- $$ language 'plpgsql';
-
--- restore the original setting
-update pg_settings set setting = overlay( setting placing '' from 1 for (length('rhn_package')+1) ) where name = 'search_path';
-
-
diff --git a/schema/spacewalk/postgres/packages/rhn_package.pks b/schema/spacewalk/postgres/packages/rhn_package.pks
deleted file mode 100644
index 7676c7f..0000000
--- a/schema/spacewalk/postgres/packages/rhn_package.pks
+++ /dev/null
@@ -1,44 +0,0 @@
---
--- 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.
-
-create schema rhn_package;
-
---update pg_setting
-update pg_settings set setting = 'rhn_package,' || setting where name = 'search_path';
-
-create or replace FUNCTION canonical_name
-(
- name_in IN VARCHAR,
- evr_in IN EVR_T,
- arch_in IN VARCHAR DEFAULT NULL
-)
-RETURNS VARCHAR
-AS $$
-BEGIN
- RAISE EXCEPTION 'Stub called, must be replaced by .pkb';
-END;
-$$
-language 'plpgsql';
-
-
-create or replace FUNCTION channel_occupancy_string(package_id_in IN NUMERIC, separator_in VARCHAR DEFAULT ', ')
-RETURNS VARCHAR
-AS $$
-BEGIN
- RAISE EXCEPTION 'Stub called, must be replaced by .pkb';
-END;
-$$ language 'plpgsql';
-
--- restore the original setting
-update pg_settings set setting = overlay( setting placing '' from 1 for (length('rhn_package')+1) ) where name = 'search_path';
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/005-rhn_package-drop.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/005-rhn_package-drop.sql
new file mode 100644
index 0000000..1b73dd5
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/005-rhn_package-drop.sql
@@ -0,0 +1,4 @@
+
+drop package body rhn_package;
+drop package rhn_package;
+
13 years, 4 months
Changes to 'refs/tags/rhnpush-5.5.12-1'
by Miroslav Suchý
Tag 'rhnpush-5.5.12-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2010-12-23 11:54 +0000
Tagging package [rhnpush] version [5.5.12-1] in directory [client/tools/rhnpush/].
Changes since rhncfg-5.9.40-1:
Miroslav Suchý (2):
648403 - use server given on command line rather than rhnParent
Automatic commit of package [rhnpush] release [5.5.12-1].
---
client/tools/rhnpush/rhnpush.py | 4 ++--
client/tools/rhnpush/rhnpush.spec | 5 ++++-
client/tools/rhnpush/uploadLib.py | 5 +++--
rel-eng/packages/rhnpush | 2 +-
4 files changed, 10 insertions(+), 6 deletions(-)
---
13 years, 4 months
2 commits - client/tools rel-eng/packages
by Miroslav Suchý
client/tools/rhnpush/rhnpush.py | 4 ++--
client/tools/rhnpush/rhnpush.spec | 5 ++++-
client/tools/rhnpush/uploadLib.py | 5 +++--
rel-eng/packages/rhnpush | 2 +-
4 files changed, 10 insertions(+), 6 deletions(-)
New commits:
commit c34a731e3cfdab91f576da60cf1d8fcd65fd4f41
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Dec 23 12:54:58 2010 +0100
Automatic commit of package [rhnpush] release [5.5.12-1].
diff --git a/client/tools/rhnpush/rhnpush.spec b/client/tools/rhnpush/rhnpush.spec
index 62819ce..c52f32e 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.5.11
+Version: 5.5.12
Release: 1%{?dist}
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -51,6 +51,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man8/solaris2mpm.8*
%changelog
+* Thu Dec 23 2010 Miroslav Suchý <msuchy(a)redhat.com> 5.5.12-1
+- 648403 - use server given on command line rather than rhnParent
+
* Mon Dec 20 2010 Miroslav Suchý <msuchy(a)redhat.com> 5.5.11-1
- 648403 - do not call getPackageChecksumBySession directly
diff --git a/rel-eng/packages/rhnpush b/rel-eng/packages/rhnpush
index 2a1f677..dcc7866 100644
--- a/rel-eng/packages/rhnpush
+++ b/rel-eng/packages/rhnpush
@@ -1 +1 @@
-5.5.11-1 client/tools/rhnpush/
+5.5.12-1 client/tools/rhnpush/
commit af438251a7af2e8c4cbb84afbe84d112f9c3c62c
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Dec 23 12:52:23 2010 +0100
648403 - use server given on command line rather than rhnParent
diff --git a/client/tools/rhnpush/rhnpush.py b/client/tools/rhnpush/rhnpush.py
index bb1c289..5a74fd6 100755
--- a/client/tools/rhnpush/rhnpush.py
+++ b/client/tools/rhnpush/rhnpush.py
@@ -534,7 +534,7 @@ class UploadClass(uploadLib.UploadClass):
# computing checksum and other info is expensive process and session
# could have expired.Make sure its re-authenticated.
self.authenticate()
- if uploadLib.exists_getPackageChecksumBySession():
+ if uploadLib.exists_getPackageChecksumBySession(self.server):
checksum_data = uploadLib.getPackageChecksumBySession(self.server, self.session.getSessionString(), info)
else:
# old server only md5 capable
@@ -547,7 +547,7 @@ class UploadClass(uploadLib.UploadClass):
# computing checksum and other info is expensive process and session
# could have expired.Make sure its re-authenticated.
self.authenticate()
- if uploadLib.exists_getPackageChecksumBySession():
+ if uploadLib.exists_getPackageChecksumBySession(self.server):
checksum_data = uploadLib.getSourcePackageChecksumBySession(self.server, self.session.getSessionString(), info)
else:
# old server only md5 capable
diff --git a/client/tools/rhnpush/uploadLib.py b/client/tools/rhnpush/uploadLib.py
index 78c04e6..cb2cbbe 100644
--- a/client/tools/rhnpush/uploadLib.py
+++ b/client/tools/rhnpush/uploadLib.py
@@ -710,12 +710,13 @@ def getServer(uri, proxy=None, username=None, password=None, ca_chain=None):
s.add_trusted_cert(ca_chain)
return s
-def exists_getPackageChecksumBySession():
+def exists_getPackageChecksumBySession(rpc_server):
""" check whether server supports getPackageChecksumBySession function"""
# unfortunatelly we do not have capability for getPackageChecksumBySession function,
# but extended_profile in version 2 has been created just 2 months before getPackageChecksumBySession
# lets use it instead
- server = rhnserver.RhnServer()
+ server = rhnserver.RhnServer()
+ server._server = rpc_server
return server.capabilities.hasCapability('xmlrpc.packages.extended_profile', 2)
# compare two package [n,v,r,e] tuples
13 years, 4 months
Changes to 'refs/tags/rhncfg-5.9.40-1'
by Jan Pazdziora
Tag 'rhncfg-5.9.40-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2010-12-22 23:15 +0000
Tagging package [rhncfg] version [5.9.40-1] in directory [client/tools/rhncfg/].
Changes since spacewalk-backend-1.3.34-1:
Jan Pazdziora (1):
Automatic commit of package [rhncfg] release [5.9.40-1].
---
client/tools/rhncfg/rhncfg.spec | 7 ++++++-
rel-eng/packages/rhncfg | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
---
13 years, 4 months