schema/util
by Michael Mraka
schema/util/bad_cfp_members.sql | 27 --
schema/util/dedupe-email-addresses.py | 20 -
schema/util/deploy-tree-local.sh | 10
schema/util/dumper/dumper.py | 80 ------
schema/util/dumper/dumper_rhnPackageEVR.py | 77 -----
schema/util/explain.sql | 30 --
schema/util/explain_plan_for_queries.py | 333 -------------------------
schema/util/find_cascade_delete_triggers.sql | 22 -
schema/util/find_noaction_referrers.sql | 20 -
schema/util/find_references.sql | 44 ---
schema/util/find_unindexed_fks.sql | 45 ---
schema/util/findidx.sql | 11
schema/util/functions.sql | 111 --------
schema/util/generate_constraint_fixes.sql | 23 -
schema/util/idx_dump.sql | 39 --
schema/util/make-rebuilds.sql | 17 -
schema/util/makeTableColumnMap.py | 100 -------
schema/util/pjexplain.sql | 18 -
schema/util/schema_dump.sql | 73 -----
schema/util/scripts/dump_errata_maps.sql | 18 -
schema/util/scripts/fixaction.py | 84 ------
schema/util/scripts/hwreport.sql | 107 --------
schema/util/scripts/migrate_parentchannel.sql | 24 -
schema/util/scripts/multiorg.sql | 9
schema/util/scripts/ora-df.sql | 30 --
schema/util/scripts/package-profile.sql | 26 -
schema/util/scripts/server-partition-query.sql | 22 -
schema/util/scripts/stress.pl | 42 ---
schema/util/show-proc.sql | 4
schema/util/show_constraints.sql | 21 -
schema/util/show_triggers.sql | 13
schema/util/user_2_org_admin.sql | 20 -
32 files changed, 1520 deletions(-)
New commits:
commit fb3587ec64e209837595d0a36273dd9eea105972
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Apr 13 11:37:02 2010 +0200
cleaning old stuff
scripts are no more used/referenced from git or wiki
diff --git a/schema/util/bad_cfp_members.sql b/schema/util/bad_cfp_members.sql
deleted file mode 100644
index 5a1ac52..0000000
--- a/schema/util/bad_cfp_members.sql
+++ /dev/null
@@ -1,27 +0,0 @@
---
--- $Id$
---
--- this shows us where rhnChannelFamilyPermissions.current_members is wrong.
--- ts=4, fwiw.
-
-select rcfp.org_id org_id,
- rcfp.current_members bad_current_members,
- count(s.id) real_current_members
-from
- rhnServer s,
- rhnServerChannel sc,
- rhnChannelFamilyMembers rcfm,
- rhnChannelFamilyPermissions rcfp
-where 1=1
- and rcfp.channel_family_id = rcfm.channel_family_id
- and rcfm.channel_id = sc.channel_id
- and sc.server_id = s.id
- and rcfp.org_id = s.org_id
-group by
- rcfp.org_id, rcfp.current_members
-having rcfp.current_members != count(s.id)
-
--- $Log$
--- Revision 1.1 2002/11/20 22:04:35 pjones
--- query to find incorrect rhnChannelFamilyPermissions
---
diff --git a/schema/util/dedupe-email-addresses.py b/schema/util/dedupe-email-addresses.py
deleted file mode 100755
index ba78912..0000000
--- a/schema/util/dedupe-email-addresses.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/python
-
-import string, sys
-
-input = open(sys.argv[1], "r")
-output = open(sys.argv[2], "w")
-
-users = {}
-while 1:
- line = input.readline()
- if line == '':
- break
- line = line.strip("\n")
- linevals = line.split(',')
- users[linevals[3]] = line
-
-for key in users.keys() or []:
- output.write(users[key])
- output.write("\n")
-
diff --git a/schema/util/deploy-tree-local.sh b/schema/util/deploy-tree-local.sh
deleted file mode 100755
index 5da0b27..0000000
--- a/schema/util/deploy-tree-local.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-# perl 5.8 utf crap
-unset LANG
-DICT=$1
-[ -z "$DICT" ] && DICT=production/production.satcon.dict
-
-rm -vRf /tmp/satcon-local-deploy
-satcon-deploy-tree.pl $DICT . /tmp/satcon-local-deploy '[[' ']]'
-
diff --git a/schema/util/dumper/dumper.py b/schema/util/dumper/dumper.py
deleted file mode 100755
index 9c901e6..0000000
--- a/schema/util/dumper/dumper.py
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/python
-#
-# This script dumps a database into a pickle format
-#
-# $Id$
-
-import os
-import sys
-import time
-import dbhash
-import shelve
-import string
-import cPickle
-import getopt
-
-# Oracle lib
-import DCOracle
-
-# A shelve class that it is easier to work with
-class Shelve(shelve.BsdDbShelf):
- def __init__(self, filename, flag='c'):
- shelve.BsdDbShelf.__init__(self, dbhash.open(filename, flag))
-
- # make these methods more efficient
- def __getitem__(self, key):
- return cPickle.loads(self.dict[key])
- def __setitem__(self, key, value):
- self.dict[key] = cPickle.dumps(value, 1)
-
-# Globals
-Oracle = None
-Table = None
-Output = None
-
-# Parse args
-opts, args = getopt.getopt(sys.argv[1:], "t:o:",
- ["table=", "oracle="])
-for opt, arg in opts:
- if opt == "-o" or opt == "--oracle":
- Oracle = arg
- elif opt == "-t" or opt == "--table":
- Table = arg
-
-# check the args
-if Oracle is None or Table is None:
- print "ERROR: --oracle and --table need to be specified"
- sys.exit(-1)
-
-# where do we output stuff
-if args:
- Output = args[0]
-else:
- Output = "%s.dump" % Table
-out_file = Shelve(Output, "n")
-
-# attempt Oracle connection
-c = DCOracle.Connect(Oracle)
-
-# test database
-h = c.prepare("select sysdate from dual")
-h.execute()
-ret = h.fetchall_dict()
-if not ret:
- print "ERROR: could not issue sample query to database"
- sys.exit(-1)
-
-# prepare the request
-msg = "Dumping Table %s..." % Table
-h = c.prepare("select * from %s" % Table)
-h.execute()
-recno = 0
-while 1:
- ret = h.fetchone_dict()
- if not ret:
- break
- recno = recno + 1
- out_file["recno_%d" % recno] = ret
- sys.stdout.write("%s %d\r" % (msg, recno))
-out_file.close()
-print msg, recno, "records extracted into file", Output
diff --git a/schema/util/dumper/dumper_rhnPackageEVR.py b/schema/util/dumper/dumper_rhnPackageEVR.py
deleted file mode 100755
index 6a3a7bd..0000000
--- a/schema/util/dumper/dumper_rhnPackageEVR.py
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/usr/bin/python
-#
-# This script dumps a database into a pickle format
-#
-# $Id$
-
-import os
-import sys
-import time
-import dbhash
-import shelve
-import string
-import cPickle
-import getopt
-
-# Oracle lib
-import DCOracle
-
-# A shelve class that it is easier to work with
-class Shelve(shelve.BsdDbShelf):
- def __init__(self, filename, flag='c'):
- shelve.BsdDbShelf.__init__(self, dbhash.open(filename, flag))
-
- # make these methods more efficient
- def __getitem__(self, key):
- return cPickle.loads(self.dict[key])
- def __setitem__(self, key, value):
- self.dict[key] = cPickle.dumps(value, 1)
-
-# Globals
-Oracle = None
-Table = "rhnPackageEVR"
-Output = None
-
-# Parse args
-opts, args = getopt.getopt(sys.argv[1:], "t:o:", ["oracle="])
-for opt, arg in opts:
- if opt == "-o" or opt == "--oracle":
- Oracle = arg
-
-# check the args
-if Oracle is None or Table is None:
- print "ERROR: --oracle needs to be specified"
- sys.exit(-1)
-
-# where do we output stuff
-if args:
- Output = args[0]
-else:
- Output = "%s.dump" % Table
-out_file = Shelve(Output, "n")
-
-# attempt Oracle connection
-c = DCOracle.Connect(Oracle)
-
-# test database
-h = c.prepare("select sysdate from dual")
-h.execute()
-ret = h.fetchall_dict()
-if not ret:
- print "ERROR: could not issue sample query to database"
- sys.exit(-1)
-
-# prepare the request
-msg = "Dumping Table %s..." % Table
-h = c.prepare("select id, epoch, version, release from %s" % Table)
-h.execute()
-recno = 0
-while 1:
- ret = h.fetchone_dict()
- if not ret:
- break
- recno = recno + 1
- out_file["recno_%d" % recno] = ret
- sys.stdout.write("%s %d\r" % (msg, recno))
-out_file.close()
-print msg, recno, "records extracted into file", Output
diff --git a/schema/util/explain.sql b/schema/util/explain.sql
deleted file mode 100644
index 89f1fed..0000000
--- a/schema/util/explain.sql
+++ /dev/null
@@ -1,30 +0,0 @@
--- Show up what's going up in a query
---
--- $Id$
-
-set linesize 300
--- empty lines are annoying for this output
-set pagesize 0
-
-set wrap off
-column explain_id format a2
-column explain_parent_id format a2
-column explain_operation format a200
-
-set heading off;
-
-variable stmt_id varchar2(30);
-exec :stmt_id := '&name';
-
-select
- to_char(parent_id) explain_parent_id,
- to_char(id) explain_id,
- lpad(' ',2*(LEVEL-1)) || operation || ' ' || options || ' ' || object_name
- explain_operation
-from
- plan_table
-start with id = 0 and statement_id = :stmt_id
-connect by prior id = parent_id and statement_id = :stmt_id
-/
-
-
diff --git a/schema/util/explain_plan_for_queries.py b/schema/util/explain_plan_for_queries.py
deleted file mode 100644
index e3da7a0..0000000
--- a/schema/util/explain_plan_for_queries.py
+++ /dev/null
@@ -1,333 +0,0 @@
-#!/usr/bin/python
-#
-# Script to parse the files in a directory for all sql statements in
-# those files, and output their explain plans.
-#
-# Author: James Slagle
-#
-# Stuff to fix:
-# o ???
-#
-# $Id:$
-
-import sys
-import os
-import string
-import fileinput
-
-# optparse is 2.3, optik is old 2.2 style
-try:
- from optparse import OptionParser, Option
-except ImportError:
- from optik import OptionParser, Option
-
-from server import rhnSQL
-
-options_table = [
- Option("-v", "--verbose",
- action="count",
- help="Increase verbosity"),
- Option("-d","--db",
- action="store",
- help="db for execution and gathering of the explain plan"),
- Option("-q", "--querydir",
- action="store",
- help="harvest queries from files in this directory\n" \
- "(defaults to current directory)"),
- Option("-e","--excludefiles",
- action="append",
- help="exclude processing files of this name from query directory\n" \
- "(can be specified multiple times)"),
- Option("-p","--planfile",
- action="store",
- help="write the explain plan results to file instead of standard out"),
- Option("--debug",
- action="count",
- help="extra debugging info")
-]
-
-# starting work here
-def main():
-
- global options_table
- parser = OptionParser(option_list=options_table)
-
- (options, args) = parser.parse_args()
-
- global verbose
- verbose = options.verbose
-
- global debug
- debug = options.debug
-
- if debug:
- print options.excludefiles
-
- if check_options(options):
- return 0
-
- if verbose:
- print "Connecting to %s " % options.db
- sys.stdout.flush()
- rhnSQL.initDB(options.db)
-
- if not confirm_plan_table(options.db):
- return 0
-
- # get list of files in query-dir
- # for each file,
- # find a line that contains 'select...'
- # read from 'select...' to end of query
-
- if options.querydir:
- working_dir = options.querydir
- else:
- working_dir = '.'
-
- if os.path.isdir(working_dir):
- for root, dirs, files in os.walk(working_dir):
- for filename in files:
- if root.find('.') >= 0 or filename[0:1] == '.':
- continue
- else:
- process_file(os.path.join(root,filename))
- else:
- process_file(working_dir)
-
- # execute explain plan for query
- # write results of explain plan to stdout/file
-
-# harvest queries from a file and explain plan them
-def process_file(filename):
- print "\n\nQueries for file:\n %s" % filename
-
- found_query = 0
-
- for line in fileinput.input(filename):
- lowerline = line.lower()
- if debug:
- print "lowerline is" + lowerline + "and found_query is"
- print found_query
-
- if found_query:
- if debug:
- print "query is " + query
-
- query_terminator = end_of_query(0,lowerline)
- if len(query_terminator) > 0:
- if debug:
- print "found the end of the query"
- lowerline = cleanse_query(lowerline)
- query = query + lowerline[0:lowerline.find(query_terminator)]
- found_query = 0
- if debug:
- print "about to call ep on: \n" + query
- if explain_plan(query):
- print "-----------------------------"
- print query
- get_explain_plan()
- # if debug:
- # sys.exit()
- continue
- else:
- if debug:
- print "adding " + lowerline + " to query"
-
- lowerline = cleanse_query(lowerline)
-
- query = query + lowerline
- continue
-
- start = start_of_query(lowerline)
- if len(start) > 0 and lowerline.find('mode name') < 0 and lowerline.find('query name') < 0:
- if debug:
- print "found starter of " + start
- print "found first line at " + lowerline
- found_query = 1
- lowerline = cleanse_query(lowerline)
-
- # see if the query is all on one line
- query_terminator = end_of_query(lowerline.find(start), lowerline)
- if len(query_terminator) > 0:
- query = lowerline[lowerline.find(start):lowerline.find(query_terminator,lowerline.find(start))]
-
- # want to do something special here, but for now drop the query
- found_query = 0
- else:
- query = lowerline[lowerline.find(start):len(lowerline)]
-
- return 1
-
-def cleanse_query(line):
-
- # do some cleansing for datasource queries
- line = line.replace('%',':')
- line = line.replace('>','>')
- line = line.replace('<','<')
- line = line.replace('<!--','--')
- line = line.replace('?',':cleansed')
-
- return line
-
-def start_of_query(line):
- starters = (
- # 'update ',
- # 'delete ',
- 'select ',
- 'select\n',
- 'select\t',
- 'adfsfasfaf '
- )
-
- for starter in starters:
- if line.find(starter) >= 0:
- return starter
-
- return ''
-
-
-def end_of_query(start, line):
- terminators = list()
-
- # a list of all possible query terminators to search for
- terminators = (
- '</query>',
- '</elaborator>',
- # '/',
- 'eoq',
- 'eos',
- '"',
- ';'
- )
-
- for term in terminators:
- if line.find(term,start) >= 0:
-
- if term == ';':
-
- if debug:
- print 'found a semi-colon'
-
- # this is not robust at all, but i'll wait until the
- # corner case pops up to fix it
- if line.find('>',start) >= 0 or line.find('<',start) >= 0:
- continue
- else:
- comment = line.find('--',start)
- if comment < 0 or (comment >= 0 and line.find(term,start) < comment):
- if debug:
- print 'found a query terminator of %s' % term
- return term
- else:
- continue
-
- comment = line.find('--',start)
- if comment < 0 or (comment >= 0 and line.find(term,start) < comment):
- if debug:
- print 'found a query terminator of %s' % term
- return term
-
- return ''
-
-def explain_plan(query):
-
- q = rhnSQL.prepare("""
- delete from plan_table where statement_id = 'query_explain'
- """)
- q.execute()
-
- plan = """explain plan set statement_id = 'query_explain' for """
- q = rhnSQL.prepare(plan+query)
-
- try:
- q.execute()
- except rhnSQL.SQLError, e:
- print "-----------------------------"
- print query + "must not be a well formed SQL query "
- print "error message was %s\n" % e
- return 0
-
- return 1
-
-def get_explain_plan():
-
-
- q = rhnSQL.prepare("""
- select
- to_char(parent_id) explain_parent_id,
- to_char(id) explain_id,
- lpad(' ',2*(LEVEL-1)) || operation || ' ' || options || ' ' ||
- object_name
- explain_operation
- from
- plan_table
- start with id = 1 and statement_id = 'query_explain'
- connect by prior id = parent_id and statement_id = 'query_explain'
- order by id
- """)
-
- q.execute()
-
- for row in q.fetchall_dict():
- print row['explain_parent_id'] + " " + row['explain_id'] + " " + row['explain_operation']
-
- return 1
-
-
-# return 1 if options aren't valid
-def check_options(options):
- if not options.db:
- print "Missing --db"
- return 0
-
-def confirm_plan_table(db):
- if verbose:
- print "Confirming existence of plan_table..."
- q = rhnSQL.prepare("select 1 from all_tables where table_name = 'PLAN_TABLE'")
- q.execute()
- row = q.fetchall_dict()
- if row:
- if verbose:
- print "plan_table exists"
- return 1
- else:
- if verbose:
- print "plan_table doesn't exist, creating..."
- h = rhnSQL.prepare("""
- CREATE TABLE PLAN_TABLE
- (
- STATEMENT_ID VARCHAR2(30 BYTE),
- TIMESTAMP DATE,
- REMARKS VARCHAR2(80 BYTE),
- OPERATION VARCHAR2(30 BYTE),
- OPTIONS VARCHAR2(30 BYTE),
- OBJECT_NODE VARCHAR2(128 BYTE),
- OBJECT_OWNER VARCHAR2(30 BYTE),
- OBJECT_NAME VARCHAR2(30 BYTE),
- OBJECT_INSTANCE INTEGER,
- OBJECT_TYPE VARCHAR2(30 BYTE),
- OPTIMIZER VARCHAR2(255 BYTE),
- SEARCH_COLUMNS NUMBER,
- ID INTEGER,
- PARENT_ID INTEGER,
- POSITION INTEGER,
- COST INTEGER,
- CARDINALITY INTEGER,
- BYTES INTEGER,
- OTHER_TAG VARCHAR2(255 BYTE),
- PARTITION_START VARCHAR2(255 BYTE),
- PARTITION_STOP VARCHAR2(255 BYTE),
- PARTITION_ID INTEGER,
- OTHER LONG,
- DISTRIBUTION VARCHAR2(30 BYTE)
- )
- """)
- try:
- h.execute()
- except Error:
- return 0
- return 1
-
-
-if __name__ == '__main__':
- sys.exit(main() or 0)
diff --git a/schema/util/find_cascade_delete_triggers.sql b/schema/util/find_cascade_delete_triggers.sql
deleted file mode 100644
index 7443de0..0000000
--- a/schema/util/find_cascade_delete_triggers.sql
+++ /dev/null
@@ -1,22 +0,0 @@
---
--- $Id$
---
--- this finds triggers for tables with on-delete-cascade foreign keys
---
-
-select trig.table_name,
- trig.trigger_name
-from user_triggers trig,
- user_constraints cons1,
- user_constraints cons2
-where cons2.table_name = upper('&table_name_in')
- and cons1.r_constraint_name = cons2.constraint_name
- and cons1.delete_rule = 'CASCADE'
- and cons1.table_name = trig.table_name
- and trig.triggering_event = 'DELETE'
-/
-
--- $Log$
--- Revision 1.1 2002/11/22 17:02:53 pjones
--- find cascading delete triggers
---
diff --git a/schema/util/find_noaction_referrers.sql b/schema/util/find_noaction_referrers.sql
deleted file mode 100644
index 74937bf..0000000
--- a/schema/util/find_noaction_referrers.sql
+++ /dev/null
@@ -1,20 +0,0 @@
---
--- $Id$
---
--- this finds foreign key constraints with "no action"
---
-
-select cons1.table_name, cons1.constraint_name
-from user_constraints cons1,
- user_constraints cons2
-where cons2.table_name = upper('&table_name_in')
- and cons1.r_constraint_name = cons2.constraint_name
- and cons1.delete_rule = 'NO ACTION'
-/
-
---
--- $Log$
--- Revision 1.1 2004/03/15 16:39:57 pjones
--- bugzilla: none -- utility to find foreign key constraints that might need
--- a cascade
---
diff --git a/schema/util/find_references.sql b/schema/util/find_references.sql
deleted file mode 100644
index 965ce40..0000000
--- a/schema/util/find_references.sql
+++ /dev/null
@@ -1,44 +0,0 @@
---
--- $Id$
---
--- this finds foreign keys to a table which aren't supported by an index.
--- this is important for deletes -- it means the table will be locked
--- while refcounts are validated.
---
--- this doesn't always with compound foreign keys, but we barely use
--- them anywhere.
-
-column table_name format a20
-column column_name format a20
-column column_position format 9999
-select cons1.table_name,
- conscol.column_name
-from all_constraints cons1,
- all_cons_columns conscol,
- all_cons_columns conscol2,
- all_constraints cons2
-where cons2.table_name = upper('&table_name_in')
- and conscol2.constraint_name = cons2.constraint_name
- and conscol2.column_name = upper('&column_name_in')
- and cons1.r_constraint_name = cons2.constraint_name
- and cons1.constraint_type = 'R'
- and cons1.constraint_name = conscol.constraint_name
- and conscol.position = 1
-/
-
--- $Log$
--- Revision 1.1 2004/03/05 16:34:00 pjones
--- bugzilla: none -- utility to find references to a column
---
--- Revision 1.2 2004/01/27 20:54:25 pjones
--- bugzilla: none -- make this more useful; now finds anything without the
--- first column of the index being correct, so we can use it (somewhat) with
--- multicolumn foreign keys
---
--- Revision 1.1 2002/11/22 21:25:02 pjones
--- this finds foreign keys that aren't properly referenced by an index
--- if deletes are slow, this often finds the culprit
---
--- Revision 1.1 2002/11/22 17:02:53 pjones
--- find cascading delete triggers
---
diff --git a/schema/util/find_unindexed_fks.sql b/schema/util/find_unindexed_fks.sql
deleted file mode 100644
index b41b754..0000000
--- a/schema/util/find_unindexed_fks.sql
+++ /dev/null
@@ -1,45 +0,0 @@
---
--- $Id$
---
--- this finds foreign keys to a table which aren't supported by an index.
--- this is important for deletes -- it means the table will be locked
--- while refcounts are validated.
---
--- this doesn't always with compound foreign keys, but we barely use
--- them anywhere.
-
-column table_name format a20
-column column_name format a20
-column column_position format 9999
-select cons1.table_name,
- conscol.column_name
-from all_constraints cons1,
- all_cons_columns conscol,
- all_constraints cons2
-where cons2.table_name = upper('&table_name_in')
- and cons1.r_constraint_name = cons2.constraint_name
- and cons1.constraint_type = 'R'
- and cons1.constraint_name = conscol.constraint_name
- and conscol.position = 1
- and not exists (
- select 1
- from all_ind_columns indcols
- where indcols.table_name = cons1.table_name
- and indcols.column_name = conscol.column_name
- and indcols.column_position = 1
- )
-/
-
--- $Log$
--- Revision 1.2 2004/01/27 20:54:25 pjones
--- bugzilla: none -- make this more useful; now finds anything without the
--- first column of the index being correct, so we can use it (somewhat) with
--- multicolumn foreign keys
---
--- Revision 1.1 2002/11/22 21:25:02 pjones
--- this finds foreign keys that aren't properly referenced by an index
--- if deletes are slow, this often finds the culprit
---
--- Revision 1.1 2002/11/22 17:02:53 pjones
--- find cascading delete triggers
---
diff --git a/schema/util/findidx.sql b/schema/util/findidx.sql
deleted file mode 100644
index 421fce6..0000000
--- a/schema/util/findidx.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-column index_name format a30
-column column_name format a30
-select
- index_name,column_name
-from
- all_ind_columns
-where
- table_name = upper('&table')
-order by
- index_name,column_position
-/
diff --git a/schema/util/functions.sql b/schema/util/functions.sql
deleted file mode 100644
index df3b9c3..0000000
--- a/schema/util/functions.sql
+++ /dev/null
@@ -1,111 +0,0 @@
--- This fucntion returns the ordered list of index fields as a string
---
--- $Id$
-
-create or replace function
-get_index_fields_list(idx_name varchar2)
-return VARCHAR2
-is
- cursor icursor(iname varchar2) is
- select column_name
- from user_ind_columns
- where lower(index_name) = lower(iname)
- order by column_position;
- cursor tcursor(iname varchar2) is
- select table_name, uniqueness
- from user_indexes
- where lower(index_name) = lower(iname);
- result varchar2(4000);
- tmp varchar2(100);
- unqflag varchar2(100);
-begin
- result := NULL;
- open icursor(idx_name);
- loop
- fetch icursor into tmp;
- exit when icursor%NOTFOUND;
- if result is NULL then
- result := lower(tmp);
- else
- result := result || ', ' || lower(tmp);
- end if;
- end loop;
- close icursor;
- open tcursor(idx_name);
- fetch tcursor into tmp, unqflag;
- if tcursor%NOTFOUND then
- close tcursor;
- return 'NO-TABLE(' || result || ')';
- end if;
- close tcursor;
- return lower(unqflag) || ' ' || lower(tmp) || '(' || result || ')';
-end;
-/
-show errors
-
-create or replace function
-get_obj_deps_list(obj_name VARCHAR2)
-return VARCHAR2
-is
- cursor dcursor(oname VARCHAR2) is
- select referenced_type || '(' || referenced_name || ')'
- from user_dependencies
- where lower(name) = lower(oname)
- order by referenced_NAME,referenced_type;
- result VARCHAR2(4000);
- tmp VARCHAR2(1000);
-begin
- result := NULL;
- open dcursor(obj_name);
- loop
- fetch dcursor into tmp;
- exit when dcursor%NOTFOUND;
- if result is NULL then
- result := lower(tmp);
- else
- result := result || ', ' || lower(tmp);
- end if;
- end loop;
- close dcursor;
- return result;
-end;
-/
-show errors
-
-
-create or replace function
-get_table_fields_list(tab_name varchar2)
-return VARCHAR2
-is
- cursor tcursor(tname varchar2) is
- select column_name
- from user_tab_columns
- where lower(table_name) = lower(tname)
- order by column_name;
- result varchar2(4000);
- tmp varchar2(100);
-begin
- result := NULL;
- open tcursor(tab_name);
- loop
- fetch tcursor into tmp;
- exit when tcursor%NOTFOUND;
- if result is NULL then
- result := lower(tmp);
- else
- result := result || ', ' || lower(tmp);
- end if;
- end loop;
- close tcursor;
- return '(' || result || ')';
-end;
-/
-show errors
-
--- $Log$
--- Revision 1.2 2001/10/22 22:03:47 pjones
--- different ordering
---
--- Revision 1.1 2001/07/01 09:35:08 gafton
--- schema extracting tool updated
---
diff --git a/schema/util/generate_constraint_fixes.sql b/schema/util/generate_constraint_fixes.sql
deleted file mode 100644
index ad9b9f8..0000000
--- a/schema/util/generate_constraint_fixes.sql
+++ /dev/null
@@ -1,23 +0,0 @@
-select distinct
- 'alter table '||dc.owner||'.'||dc.table_name,
- ' drop constraint '||dc.constraint_name||';',
- 'alter table '||dc.owner||'.'||dc.table_name,
- ' add constraint '||dc.constraint_name,
- ' foreign key ('||dcc.column_name||
- ') references '||'rhn.rhnPackageObj(id);'
-from
- all_constraints dc,
- all_constraints ref_dc,
- all_cons_columns dcc,
- all_cons_columns ref_dcc
-where
- ref_dc.table_name = 'RHNPACKAGE'
- and ref_dcc.column_name = 'ID'
- and dc.constraint_type = 'R'
- and dc.r_owner = ref_dc.owner
- and dc.r_constraint_name = ref_dc.constraint_name
- and dc.owner = dcc.owner
- and dc.constraint_name = dcc.constraint_name
- and ref_dc.owner = ref_dcc.owner
- and ref_dc.constraint_name = ref_dcc.constraint_name
-/
diff --git a/schema/util/idx_dump.sql b/schema/util/idx_dump.sql
deleted file mode 100644
index c88acc1..0000000
--- a/schema/util/idx_dump.sql
+++ /dev/null
@@ -1,39 +0,0 @@
-DECLARE
- cursor icursor is
- select index_name, table_name, column_name
- from user_ind_columns
- order by table_name, index_name, column_position;
- oiname VARCHAR2(100);
- iname VARCHAR2(100);
- otname VARCHAR2(100);
- tname VARCHAR2(100);
- cname VARCHAR2(100);
- result VARCHAR2(4000);
-BEGIN
- result := '';
- oiname := '';
- otname := '';
- open icursor;
- dbms_output.enable(100000);
- dbms_output.put_line('Available Indexes:');
- LOOP
- fetch icursor into iname, tname, cname;
- -- dbms_output.put_line(iname || ' : ' || tname || ' : ' || cname);
- exit when icursor%NOTFOUND;
- if iname = oiname then
- -- dbms_output.put_line('Result is now: ' || result);
- result := result || ', ' || cname;
- else
- if result is not NULL then
- dbms_output.put_line('Index ' || oiname || ' on ' ||
- otname || ' (' || result || ')');
- end if;
- oiname := iname;
- otname := tname;
- result := cname;
- end if;
- end loop;
- dbms_output.put_line('End of List.');
- close icursor;
-END;
-/
diff --git a/schema/util/make-rebuilds.sql b/schema/util/make-rebuilds.sql
deleted file mode 100644
index 565505b..0000000
--- a/schema/util/make-rebuilds.sql
+++ /dev/null
@@ -1,17 +0,0 @@
-select 'alter view ' || object_name ||' compile;'
-from user_objects
-where object_type = 'VIEW' and status != 'VALID';
-
-select distinct 'alter package ' || object_name ||' compile;'
-from user_objects
-where object_type in ('PACKAGE','PACKAGE BODY') and status != 'VALID';
-
-select 'alter procedure ' || object_name || ' compile;'
-from user_objects
-where object_type = 'PROCEDURE' and status != 'VALID';
-
-select 'alter ' || object_type || ' ' || object_name || ' compile;'
-from user_objects
-where object_type != 'PACKAGE BODY' and status != 'VALID';
-
-quit
diff --git a/schema/util/makeTableColumnMap.py b/schema/util/makeTableColumnMap.py
deleted file mode 100644
index c70dc48..0000000
--- a/schema/util/makeTableColumnMap.py
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/python
-import sys
-import exceptions
-from pprint import pprint
-sys.path.append("/home/pjones/devel/rhn/devel/backend/")
-from server.rhnslib import rhns_oracle
-rhns_oracle.DEBUG=0
-
-rhns_oracle.initDB()
-db = rhns_oracle.DB
-
-class IgnoreError(exceptions.Exception):
- def __init__(self):
- pass
-
-def getTableForConstraint(constraintName):
- sql = "select table_name from user_constraints where constraint_name = :constraint_name"
- h = db.prepare(sql)
- h.execute(constraint_name = constraintName)
- val = h.fetchone_dict()
- if not val is None:
- return val['table_name']
- raise ValueError, constraintName
-
-def getConstraintsForTable(tableName):
- sql = "select * from user_constraints where table_name = :table_name and constraint_type = 'R'"
- h = db.prepare(sql)
- h.execute(table_name = tableName)
- vals = h.fetchall_dict()
- if vals is None:
- return []
- else:
- return vals
-
-def getColumnsForTable(table):
- sql = "select column_name from user_tab_columns where table_name = :table_name"
- h = db.prepare(sql)
- h.execute(table_name = table)
- vals = h.fetchall_dict()
- if vals is None:
- return []
- ret = []
- for val in vals:
- ret.append(val['column_name'])
- return ret
-
-def removeTableFromTreeVals(tree, val):
- for table in tree.keys():
- if tree[table].has_key(val):
- del tree[table][val]
- del tree[val]
-
-refConstraintTree = {}
-tableList = []
-
-h = db.prepare("select table_name from user_tables")
-h.execute()
-tables = h.fetchall_dict()
-
-for table in tables:
- tableName = table['table_name']
- refConstraintTree[tableName] = {}
- constraints = getConstraintsForTable(tableName)
- for constraint in constraints:
- refConstraintTable = None
- try:
- refConstraintTable = getTableForConstraint(constraint['r_constraint_name'])
- except ValueError, cn:
- pass
- if not refConstraintTable is None:
- refConstraintTree[tableName][refConstraintTable] = None
-
-while 1:
- pruneTable = None
- found = 0
- try:
- for table in refConstraintTree.keys():
- length = len(refConstraintTree[table].items())
- if (length == 0) or (length == 1 and refConstraintTree[table].has_key(table)):
- found = 1
- pruneTable = table
- raise IgnoreError
- else:
- break
- if found == 0:
- break
- except IgnoreError:
- tableList.append(pruneTable)
- removeTableFromTreeVals(refConstraintTree,pruneTable)
-
-for table in tableList:
- sys.stderr.write("%s:\n" % table)
- columns = getColumnsForTable(table)
- for column in columns:
- sys.stderr.write("\t%s\t" % column)
- if len(column) < 8:
- sys.stderr.write("\t")
- sys.stderr.write("%s\n" % column)
- sys.stderr.write("\n")
-
diff --git a/schema/util/pjexplain.sql b/schema/util/pjexplain.sql
deleted file mode 100644
index c836c62..0000000
--- a/schema/util/pjexplain.sql
+++ /dev/null
@@ -1,18 +0,0 @@
-set linesize 80;
-column explain_id format a2
-column explain_parent_id format a2
-column explain_operation format a16
-column explain_options format a16
-column explain_object_name format a30
-select
- to_char(id) explain_id,
- to_char(parent_id) explain_parent_id,
- operation explain_operation,
- options explain_options,
- object_name explain_object_name
-from
- plan_table
-where
- statement_id = '&foo'
-order by to_number(explain_parent_id),to_number(explain_id) asc
-/
diff --git a/schema/util/schema_dump.sql b/schema/util/schema_dump.sql
deleted file mode 100644
index f02cd7a..0000000
--- a/schema/util/schema_dump.sql
+++ /dev/null
@@ -1,73 +0,0 @@
--- Script to dump a brief summary of the schema for comparison
---
--- $Id$
-
-column obj_type format a15
-column obj_name format a30
-column obj_data format a1000
-
-select
- ' ' obj_type,
- ' ' obj_name,
- ' ' obj_data
-from dual
-UNION
-select
- lower(object_type) obj_type,
- lower(object_name) obj_name,
- ' ' obj_data
-from
- user_objects
-where
- object_type not in ('INDEX', 'VIEW', 'SYNONYM', 'TABLE', 'TRIGGER')
-UNION
-select
- lower(object_type) obj_type,
- lower(object_name) obj_name,
- get_table_fields_list(object_name) obj_data
-from
- user_objects
-where
- object_type = 'TABLE'
-UNION
-select
- lower(object_type) obj_type,
- lower(object_name) obj_name,
- get_index_fields_list(object_name) obj_data
-from
- user_objects
-where
- object_type = 'INDEX'
-UNION
-select
- 'constraint' obj_type,
- lower(constraint_name) obj_name,
- lower(table_name) ||' '|| constraint_type ||' '|| lower(r_constraint_name) obj_data
-from
- user_constraints
-UNION
-select
- 'synonym' obj_type,
- lower(synonym_name) obj_name,
- lower(table_owner) ||'.'|| lower(table_name) obj_data
-from
- user_synonyms
-UNION
-select
- 'trigger' obj_type,
- lower(trigger_name) obj_name,
- lower(table_name) ||'('|| lower(triggering_event) || ', ' ||
- lower(trigger_type) || ')' obj_data
-from
- user_triggers
-UNION
-select
- lower(object_type) obj_type,
- lower(object_name) obj_name,
- get_obj_deps_list(object_name) obj_data
-from
- user_objects
-where
- object_type = 'VIEW'
-order by obj_type, obj_name;
-
diff --git a/schema/util/scripts/dump_errata_maps.sql b/schema/util/scripts/dump_errata_maps.sql
deleted file mode 100644
index 64598b2..0000000
--- a/schema/util/scripts/dump_errata_maps.sql
+++ /dev/null
@@ -1,18 +0,0 @@
--- Script that dumps the channel maps
---
--- Use it like:
---
--- sqlplus -S user/pass@db @dump_errata_maps.sql > /tmp/channel-maps.csv < /dev/null
---
--- $Id$
-
-set pagesize 0
-set linesize 256
-set feedback off
-column x format A256
-
-select c.label || ',' || bpm.path || ',' || nvl2(is_source, 'Y', '') x
-from rhnBeehivePathMap bpm, rhnPathChannelMap pcm, rhnChannel c
-where bpm.ftp_path = pcm.path
-and pcm.channel_id = c.id
-order by c.label, bpm.path;
diff --git a/schema/util/scripts/fixaction.py b/schema/util/scripts/fixaction.py
deleted file mode 100755
index 5a5604e..0000000
--- a/schema/util/scripts/fixaction.py
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/usr/bin/python
-#
-# This script checks for duplicate actions in rhnAction and
-# eliminates the duplicates
-
-import sys
-import getopt
-import string
-
-import DCOracle
-
-# the almighty help
-def usage():
- print sys.argv[0], "<database_connect>"
-
-opts, args = getopt.getopt(sys.argv[1:], "hv",
- ["help"])
-
-if not len(args) == 1:
- usage()
- sys.exit(-1)
-
-database = args[0]
-
-DB = DCOracle.Connect(database)
-
-print "Launching SQL code..."
-
-# Get all distinct actions
-h = DB.prepare("""
-select distinct method,args,action,description,version
-from rhnAction
-""")
-# Get the ids for those actions
-h_id = DB.prepare("""
-select id from rhnAction
-where action = :action
- and method = :method
- and args = :args
- and description = :description
- and version = :version
-order by id
-""")
-# The update query
-h_upd = DB.prepare("""
-update rhnServerAction
-set actionid = :new_id
-where actionid = :old_id
-""")
-h_del = DB.prepare("delete from rhnAction where id = :del_id")
-
-print "Executing query..."
-h.execute()
-# Now the data storage
-print "Starting to read data..."
-counter = 0
-data = h.fetchone_dict()
-while data:
- counter = counter + 1
- if counter % 1000 == 0:
- print "Counter: %d relations read" % (counter,)
- apply(h_id.execute, (), data)
- data_id = h_id.fetchone_dict()
- if not data_id:
- continue
- actid = data_id["id"]
- print "Looking at action id = %d" % actid, data["method"]
- # now iterate over the others
- commit = 1
- while 1:
- dupdata = h_id.fetchone_dict()
- if not dupdata:
- break
- dupid = dupdata["id"]
- print "\tduplicate found: id = %d" % dupid, data["method"]
- h_upd.execute(new_id = actid, old_id = dupid)
- h_del.execute(del_id = dupid)
- commit = commit + 1
- if commit % 200 == 0:
- print "COMMIT update"
- DB.commit()
- DB.commit()
- data = h.fetchone_dict()
-
diff --git a/schema/util/scripts/hwreport.sql b/schema/util/scripts/hwreport.sql
deleted file mode 100644
index 61322ea..0000000
--- a/schema/util/scripts/hwreport.sql
+++ /dev/null
@@ -1,107 +0,0 @@
-set newpage none
-set pagesize 1000
-set wrap off
-set linesize 80
-set head on
-
-column cpu_model format a45
-column device_desc format a60
-
---create or replace function
---rhnCpuSpeedRangeFunc(speed NUMBER)
---return VARCHAR2
---deterministic
---as
--- begin
--- return trunc(speed/100)*100 || ' - ' || (trunc(speed/100)+1)*100;
--- end;
---/
---show errors
-
---select
--- DECODE(GROUPING(model), 1, 'All Models', model) "CPU Model",
--- DECODE(GROUPING(rhnCpuSpeedRangeFunc(mhz)), 1, 'All Speeds',
--- rhnCpuSpeedRangeFunc(mhz)) "CPU Speed",
--- count(id) "Number Profiles"
---from
--- rhnCPU
---group by ROLLUP(model, rhnCpuSpeedRangeFunc(mhz));
-
--- report on the CPUs
-select 'Registration data for PROCESSOR' report from dual;
-select
- model cpu_model,
- count(id) cpu_count,
- round(avg(mhz)) avg_speed
-from
- rhnCPU
-group by
- model
-order by
- cpu_count desc;
-
--- report the ram
-select 'Registration data for MEMORY' report from dual;
-select
- ram ram_size,
- count(id) no_profiles
-from
- rhnRAM
-group by ram
-order by ram_size desc;
-
--- report the video cards
-select 'Registration data for VIDEO cards' report from dual;
-select
- upper(description) device_desc,
- count(id) device_count
-from
- rhnDevice
-where
- class = 'VIDEO'
-group by
- upper(description)
-order by
- device_desc;
-
--- scsi
-select 'Registration data for SCSI cards' report from dual;
-select
- upper(description) device_desc,
- count(id) device_count
-from
- rhnDevice
-where
- class = 'SCSI'
-group by
- upper(description)
-order by
- device_desc;
-
--- networking
-select 'Registration data for NETWORK cards' report from dual;
-select
- upper(description) device_desc,
- count(id) device_count
-from
- rhnDevice
-where
- class = 'NETWORK'
-group by
- upper(description)
-order by
- device_desc;
-
--- audio
-select 'Registration data for AUDIO cards' report from dual;
-select
- upper(description) device_desc,
- count(id) device_count
-from
- rhnDevice
-where
- class = 'AUDIO'
-group by
- upper(description)
-order by
- device_desc;
diff --git a/schema/util/scripts/migrate_parentchannel.sql b/schema/util/scripts/migrate_parentchannel.sql
deleted file mode 100644
index 088a795..0000000
--- a/schema/util/scripts/migrate_parentchannel.sql
+++ /dev/null
@@ -1,24 +0,0 @@
-declare
- cursor channels is
- SELECT id,
- parent_channel,
- created,
- modified
- FROM rhnChannel
- WHERE parent_channel is not null;
-begin
- for ch in channels
- loop
- insert into
- rhnChannelParent (channel, parent_channel, created, modified)
- values (ch.id, ch.parent_channel, ch.created, ch.modified);
- end loop;
- --alter table rhnChannel drop column parent_channel;
- --alter table web_contact drop column oracle_contact_id;
- --alter table web_customer drop column oracle_customer_number;
- --alter table web_customer drop column oracle_customer_id;
- --alter table web_customer drop column customer_type;
- --alter table web_customer drop column credit_application_completed;
- --commit;
-end;
-/
diff --git a/schema/util/scripts/multiorg.sql b/schema/util/scripts/multiorg.sql
deleted file mode 100644
index a799169..0000000
--- a/schema/util/scripts/multiorg.sql
+++ /dev/null
@@ -1,9 +0,0 @@
--- sql statements for multiorg work
-alter table rhnChannel drop column parent_channel;
-alter table web_contact drop column oracle_contact_id;
-alter table web_customer drop column oracle_customer_number;
-alter table web_customer drop column oracle_customer_id;
-alter table web_customer drop column customer_type;
-alter table web_customer drop column credit_application_completed;
---commit;
-
diff --git a/schema/util/scripts/ora-df.sql b/schema/util/scripts/ora-df.sql
deleted file mode 100644
index 82551a0..0000000
--- a/schema/util/scripts/ora-df.sql
+++ /dev/null
@@ -1,30 +0,0 @@
--- df like utility for Oracle
---
--- Originally from andrew, hacked by others
--- $Id$
-
-select
- a.name partition,
- (a.free + b.used) size_MB,
- b.used used_MB,
- a.free free_MB,
- 100*b.used/(a.free+b.used) percentage
-from
- ( select
- tablespace_name name,
- sum(bytes)/1024/1024 free
- from user_free_space
- group by tablespace_name
- ) a,
- ( select
- tablespace_name name,
- sum(bytes)/1024/1024 used
- from user_segments
- group by tablespace_name
- ) b
- where a.name = b.name;
-
--- $Log$
--- Revision 1.1 2001/09/26 22:33:58 gafton
--- df for Oracle
---
diff --git a/schema/util/scripts/package-profile.sql b/schema/util/scripts/package-profile.sql
deleted file mode 100644
index f11d0e1..0000000
--- a/schema/util/scripts/package-profile.sql
+++ /dev/null
@@ -1,26 +0,0 @@
-set heading off;
-set lines 80;
-set pages 4000;
-
-select pn.name || ' ' ||
- pe.version || ' ' ||
- pe.release || ' ' ||
- nvl(pe.epoch,'(none)') || ' ' ||
- pa.label
-from
- rhnpackagename pn,
- rhnpackageevr pe,
- rhnpackagearch pa,
- rhnpackage p,
- rhnchannelpackage cp,
- rhnchannel c
-where
- cp.package_id = p.id
- and cp.channel_id = c.id
- and c.label = '&label'
- and p.package_arch_id = pa.id
- and p.name_id = pn.id
- and p.evr_id = pe.id
-order by
- pn.name
-/
diff --git a/schema/util/scripts/server-partition-query.sql b/schema/util/scripts/server-partition-query.sql
deleted file mode 100644
index 64814bd..0000000
--- a/schema/util/scripts/server-partition-query.sql
+++ /dev/null
@@ -1,22 +0,0 @@
--- okay this query will show you the number of servers in a given
--- block of servers (I suggest 10k-25k) that have checked in within a
--- given time period. this will help us determine what partition
--- sizes should be used. the output is the server id window, then the
--- ratio of how many have spoken to our servers within checkin_window
--- days, then the percent version of that ratio
-
-COLUMN RATIO FORMAT 999.99
-COLUMN RATIO_STRING FORMAT A30
-
-SELECT X.BLOCK_START, X.BLOCK_START + &&block_size,
- (SELECT COUNT(1) FROM rhnServerInfo SI WHERE SI.server_id BETWEEN X.BLOCK_START AND X.BLOCK_START + &&block_size AND SI.checkin > sysdate - &&checkin_window)
- || '/' ||
- (SELECT COUNT(1) FROM rhnServer S WHERE S.id BETWEEN X.BLOCK_START AND X.BLOCK_START + &&block_size) RATIO_STRING,
- 100 * (SELECT COUNT(1) FROM rhnServerInfo SI WHERE SI.server_id BETWEEN X.BLOCK_START AND X.BLOCK_START + &&block_size AND SI.checkin > sysdate - &&checkin_window)
- /
- (SELECT COUNT(1) FROM rhnServer S WHERE S.id BETWEEN X.BLOCK_START AND X.BLOCK_START + &&block_size) RATIO
- FROM (SELECT DISTINCT S.id - MOD(S.id, &&block_size) BLOCK_START
- FROM rhnServer S) X
-ORDER BY X.BLOCK_START
-
-/
diff --git a/schema/util/scripts/stress.pl b/schema/util/scripts/stress.pl
deleted file mode 100644
index 7c70d3b..0000000
--- a/schema/util/scripts/stress.pl
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-use lib '/var/www/lib';
-use RHN::DB;
-
-$0 = "stress.pl";
-
-my $forks = shift || 10;
-
-my $dbh = RHN::DB->connect("rhnsat/rhnsat\@rhnsat");
-
-print "Connected, now fetching server ids...\n";
-
-my $sth = $dbh->prepare('SELECT id FROM rhnServer');
-$sth->execute;
-my @server_ids;
-while (my ($sid) = $sth->fetchrow) {
- push @server_ids, $sid;
-}
-
-print "Servers loaded, $#server_ids found.\n";
-
-for (1 .. $forks) {
- last if fork();
-}
-print "Forks complete, now connecting...\n";
-
-$dbh = RHN::DB->connect("rhnsat/rhnsat\@rhnsat");
-$dbh->ping;
-
-while (1) {
- my $server_id = @server_ids[int rand($#server_ids)];
- print "$$: $server_id\n";
-
- my $sth;
-
- for my $table (qw/rhnServerInfo rhnRam rhnCPU rhnServerLocation rhnServerPackage rhnServerDMI rhnServerNetwork rhnDevice/) {
- $sth = $dbh->prepare("SELECT * FROM $table WHERE server_id = ?");
- $sth->execute($server_id);
- my @foo = $sth->fullfetch;
- }
-}
diff --git a/schema/util/show-proc.sql b/schema/util/show-proc.sql
deleted file mode 100644
index 6369981..0000000
--- a/schema/util/show-proc.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-set pagesize 50000
-select line||' '||text from all_source where name = upper('&name')
- and type in ('FUNCTION', 'PROCEDURE','PACKAGE BODY')
- ORDER by line;
diff --git a/schema/util/show_constraints.sql b/schema/util/show_constraints.sql
deleted file mode 100644
index 28d4464..0000000
--- a/schema/util/show_constraints.sql
+++ /dev/null
@@ -1,21 +0,0 @@
-column cname format a30
-column ctype format a6
-column crule format a15
-column clname format a20
-column clpos format 99
-
-select
- uc.constraint_name cname,
- uc.constraint_type ctype,
- uc.delete_rule crule,
- ucc.column_name clname,
- ucc.position clpos
-from
- all_constraints uc,
- all_cons_columns ucc
-where
- ucc.constraint_name = uc.constraint_name
- and uc.table_name = upper('&table')
-order by
- cname,clpos,ctype,clname
-/
diff --git a/schema/util/show_triggers.sql b/schema/util/show_triggers.sql
deleted file mode 100644
index f603b5d..0000000
--- a/schema/util/show_triggers.sql
+++ /dev/null
@@ -1,13 +0,0 @@
-column tname format a30
-column ttype format a20
-
-select
- ut.trigger_name tname,
- ut.trigger_type ttype
-from
- user_triggers ut
-where
- ut.table_name = upper('&table')
-order by
- tname,ttype
-/
diff --git a/schema/util/user_2_org_admin.sql b/schema/util/user_2_org_admin.sql
deleted file mode 100644
index 6652d23..0000000
--- a/schema/util/user_2_org_admin.sql
+++ /dev/null
@@ -1,20 +0,0 @@
-
-declare
-
- org_admin_group_id number;
- user_id number;
-
-begin
-
- select ug.id, wc.id
- into org_admin_group_id, user_id
- from web_contact wc, rhnUserGroupType ugt, rhnUserGroup ug
- where ug.group_type = ugt.id
- and ugt.label = 'org_admin'
- and wc.org_id = ug.org_id
- and wc.login = '&login';
-
- rhn_user.add_to_usergroup (user_id, org_admin_group_id);
-
-end;
-/
14 years, 2 months
monitoring/rhnmd
by Miroslav Suchý
monitoring/rhnmd/rhnmd.spec | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
New commits:
commit 0c410c0a32a66ff542a5b244097fc7fce9de08e7
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Apr 12 16:17:49 2010 +0200
578738 - obsolete all archs - we are noarch now
diff --git a/monitoring/rhnmd/rhnmd.spec b/monitoring/rhnmd/rhnmd.spec
index 19b84b3..263aacd 100644
--- a/monitoring/rhnmd/rhnmd.spec
+++ b/monitoring/rhnmd/rhnmd.spec
@@ -16,9 +16,8 @@ Group: System Environment/Daemons
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: openssh-server openssh
BuildRequires: pam-devel
-%ifarch x86_64
-Obsoletes: rhmd.i386
-%endif
+Obsoletes: rhnmd.i386
+Obsoletes: rhnmd.x86_64
%description
rhnmd enables secure ssh-based communication between the monitoring
14 years, 2 months
client/rhel
by Šimon Lukašík
client/rhel/rhnlib/test/18-split-host.py | 7 +++++++
1 file changed, 7 insertions(+)
New commits:
commit c64599b268d25a19ba0afca804c923c6634a7ef3
Author: Simon Lukasik <slukasik(a)redhat.com>
Date: Mon Apr 12 13:18:28 2010 +0200
Cleaning up, preparing for automatization
diff --git a/client/rhel/rhnlib/test/18-split-host.py b/client/rhel/rhnlib/test/18-split-host.py
old mode 100644
new mode 100755
index 1127d4f..458b8da
--- a/client/rhel/rhnlib/test/18-split-host.py
+++ b/client/rhel/rhnlib/test/18-split-host.py
@@ -17,7 +17,14 @@ tests = [
["user:pass@host", ('host', None, 'user', 'pass')],
]
+fail=0
for url, result in tests:
r = get_proxy_info(url)
if result != r:
print "Test failed", url, r, result
+ fail += 1
+
+if (not fail):
+ print "Test PASSES"
+sys.exit(fail);
+
14 years, 2 months
java/code
by Joshua Roys
java/code/src/com/redhat/rhn/domain/config/ConfigRevision.java | 10 ++++-
java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/ConfigRevisionSerializer.java | 20 ++++------
2 files changed, 17 insertions(+), 13 deletions(-)
New commits:
commit 92e66367a57dee7e3e72dfa066c60534f97a66c6
Author: Joshua Roys <joshua.roys(a)gtri.gatech.edu>
Date: Fri Apr 9 11:04:46 2010 -0400
Fix xmlrpc file-type for symlinks
configchannel.lookupFileInfo incorrectly returned 'file' for symlinks.
diff --git a/java/code/src/com/redhat/rhn/domain/config/ConfigRevision.java b/java/code/src/com/redhat/rhn/domain/config/ConfigRevision.java
index 0125422..3c074e8 100644
--- a/java/code/src/com/redhat/rhn/domain/config/ConfigRevision.java
+++ b/java/code/src/com/redhat/rhn/domain/config/ConfigRevision.java
@@ -209,7 +209,15 @@ public class ConfigRevision extends BaseDomainHelper {
public void setConfigFileType(ConfigFileType cft) {
configFileType = cft;
}
-
+
+ /**
+ * Is this revision a file?
+ * @return true if file-type is 'file'
+ */
+ public boolean isFile() {
+ return (configFileType != null && configFileType.getLabel().equals("file"));
+ }
+
/**
* Is this revision a directory?
* @return true if file-type is 'directory'
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/ConfigRevisionSerializer.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/ConfigRevisionSerializer.java
index 1759193..ca87c18 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/ConfigRevisionSerializer.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/ConfigRevisionSerializer.java
@@ -85,17 +85,9 @@ public class ConfigRevisionSerializer implements XmlRpcCustomSerializer {
throws XmlRpcException, IOException {
ConfigRevision rev = (ConfigRevision) value;
SerializerHelper helper = new SerializerHelper(builtInSerializer);
- if (rev.isDirectory()) {
- helper.add(TYPE, ConfigFileType.DIR);
- }
- else {
- helper.add(TYPE, ConfigFileType.FILE);
- if (rev.getConfigContent().isBinary()) {
- helper.add(BINARY, Boolean.TRUE);
- }
- else {
- helper.add(BINARY, Boolean.FALSE);
- }
+
+ if (rev.getConfigFileType() != null) {
+ helper.add(TYPE, rev.getConfigFileType().getLabel());
}
helper.add(PATH, rev.getConfigFile().getConfigFileName().getPath());
@@ -109,10 +101,14 @@ public class ConfigRevisionSerializer implements XmlRpcCustomSerializer {
helper.add(PERMISSIONS_MODE, new DecimalFormat("000").format(
rev.getConfigInfo().getFilemode().longValue()));
- if (!rev.isDirectory()) {
+ if (rev.isFile()) {
if (!rev.getConfigContent().isBinary()) {
+ helper.add(BINARY, Boolean.FALSE);
helper.add(CONTENTS, rev.getConfigContent().getContentsString());
}
+ else {
+ helper.add(BINARY, Boolean.TRUE);
+ }
helper.add("md5", rev.getConfigContent().getChecksum().getChecksum());
helper.add(MACRO_START, rev.getDelimStart());
helper.add(MACRO_END, rev.getDelimEnd());
14 years, 2 months
schema/spacewalk
by Jan Pazdziora
schema/spacewalk/common/data/rhn_schedule_days.sql | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
New commits:
commit 4377bb4578ab4602c744e526c4fb8f2ef2875bf8
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 9 16:30:26 2010 +0200
Retrieve the rhn_schedules(recid) instead of using the hardcoded value of 1.
diff --git a/schema/spacewalk/common/data/rhn_schedule_days.sql b/schema/spacewalk/common/data/rhn_schedule_days.sql
index 8b1f295..f8fa954 100644
--- a/schema/spacewalk/common/data/rhn_schedule_days.sql
+++ b/schema/spacewalk/common/data/rhn_schedule_days.sql
@@ -23,43 +23,50 @@
insert into rhn_schedule_days(recid,schedule_id,ord,start_1,end_1,start_2,
end_2,start_3,end_3,start_4,end_4,last_update_user,last_update_date)
- values ( rhn_schedule_days_recid_seq.nextval,1,0,
+ values ( rhn_schedule_days_recid_seq.nextval,
+ ( select recid from rhn_schedules where customer_id is null and description = '24x7' ),0,
to_date('08-SEP-2000 12:00:02 AM','DD-MON-YYYY HH:MI:SS AM'),
to_date('09-SEP-2000 12:00:00 AM','DD-MON-YYYY HH:MI:SS AM'),
null,null,null,null,null,null,'system',null);
insert into rhn_schedule_days(recid,schedule_id,ord,start_1,end_1,start_2,
end_2,start_3,end_3,start_4,end_4,last_update_user,last_update_date)
- values ( rhn_schedule_days_recid_seq.nextval,1,1,
+ values ( rhn_schedule_days_recid_seq.nextval,
+ ( select recid from rhn_schedules where customer_id is null and description = '24x7' ),1,
to_date('08-SEP-2000 12:00:09 AM','DD-MON-YYYY HH:MI:SS AM'),
to_date('09-SEP-2000 12:00:00 AM','DD-MON-YYYY HH:MI:SS AM'),
null,null,null,null,null,null,'system',null);
insert into rhn_schedule_days(recid,schedule_id,ord,start_1,end_1,start_2,
end_2,start_3,end_3,start_4,end_4,last_update_user,last_update_date)
- values ( rhn_schedule_days_recid_seq.nextval,1,2,
+ values ( rhn_schedule_days_recid_seq.nextval,
+ ( select recid from rhn_schedules where customer_id is null and description = '24x7' ),2,
to_date('08-SEP-2000 12:00:14 AM','DD-MON-YYYY HH:MI:SS AM'),
to_date('09-SEP-2000 12:00:00 AM','DD-MON-YYYY HH:MI:SS AM'),
null,null,null,null,null,null,'system',null);
insert into rhn_schedule_days(recid,schedule_id,ord,start_1,end_1,start_2,
end_2,start_3,end_3,start_4,end_4,last_update_user,last_update_date)
- values ( rhn_schedule_days_recid_seq.nextval,1,3,
+ values ( rhn_schedule_days_recid_seq.nextval,
+ ( select recid from rhn_schedules where customer_id is null and description = '24x7' ),3,
to_date('08-SEP-2000 12:00:20 AM','DD-MON-YYYY HH:MI:SS AM'),
to_date('09-SEP-2000 12:00:00 AM','DD-MON-YYYY HH:MI:SS AM'),
null,null,null,null,null,null,'system',null);
insert into rhn_schedule_days(recid,schedule_id,ord,start_1,end_1,start_2,
end_2,start_3,end_3,start_4,end_4,last_update_user,last_update_date)
- values ( rhn_schedule_days_recid_seq.nextval,1,4,
+ values ( rhn_schedule_days_recid_seq.nextval,
+ ( select recid from rhn_schedules where customer_id is null and description = '24x7' ),4,
to_date('08-SEP-2000 12:00:25 AM','DD-MON-YYYY HH:MI:SS AM'),
to_date('09-SEP-2000 12:00:00 AM','DD-MON-YYYY HH:MI:SS AM'),
null,null,null,null,null,null,'system',null);
insert into rhn_schedule_days(recid,schedule_id,ord,start_1,end_1,start_2,
end_2,start_3,end_3,start_4,end_4,last_update_user,last_update_date)
- values ( rhn_schedule_days_recid_seq.nextval,1,5,
+ values ( rhn_schedule_days_recid_seq.nextval,
+ ( select recid from rhn_schedules where customer_id is null and description = '24x7' ),5,
to_date('08-SEP-2000 12:00:31 AM','DD-MON-YYYY HH:MI:SS AM'),
to_date('09-SEP-2000 12:00:00 AM','DD-MON-YYYY HH:MI:SS AM'),
null,null,null,null,null,null,'system',null);
insert into rhn_schedule_days(recid,schedule_id,ord,start_1,end_1,start_2,
end_2,start_3,end_3,start_4,end_4,last_update_user,last_update_date)
- values ( rhn_schedule_days_recid_seq.nextval,1,6,
+ values ( rhn_schedule_days_recid_seq.nextval,
+ ( select recid from rhn_schedules where customer_id is null and description = '24x7' ),6,
to_date('08-SEP-2000 12:00:36 AM','DD-MON-YYYY HH:MI:SS AM'),
to_date('09-SEP-2000 12:00:00 AM','DD-MON-YYYY HH:MI:SS AM'),
null,null,null,null,null,null,'system',null);
14 years, 2 months
reporting/reports
by Jan Pazdziora
reporting/reports/data/inventory | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit fe46f64d07c6bcb4fa8607abb49920ce263b20e9
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 9 09:46:46 2010 +0200
580924 - There is one rhnCpu record per each rhnServer, number of CPUs is in nrcpu.
diff --git a/reporting/reports/data/inventory b/reporting/reports/data/inventory
index 7662898..2eee75f 100755
--- a/reporting/reports/data/inventory
+++ b/reporting/reports/data/inventory
@@ -63,7 +63,7 @@ sql:
) as architecture,
(
(
- select count(*) || ' CPUs' from rhncpu where rhnserver.id = rhncpu.server_id
+ select sum(nrcpu) || ' CPUs' from rhncpu where rhnserver.id = rhncpu.server_id
) || network_data.col
) as hardware
from rhnserver,
14 years, 2 months
client/rhel
by Šimon Lukašík
client/rhel/rhnlib/test/23-digest-auth.py | 92 +++++++++++++++++++++++++++---
1 file changed, 85 insertions(+), 7 deletions(-)
New commits:
commit 5e2c548d2872157d835875835790b69a02f84108
Author: Simon Lukasik <slukasik(a)redhat.com>
Date: Fri Apr 9 13:12:59 2010 +0200
Cleaning up, preparing for automatization
diff --git a/client/rhel/rhnlib/test/23-digest-auth.py b/client/rhel/rhnlib/test/23-digest-auth.py
old mode 100644
new mode 100755
index f626f55..d99fce0
--- a/client/rhel/rhnlib/test/23-digest-auth.py
+++ b/client/rhel/rhnlib/test/23-digest-auth.py
@@ -3,18 +3,96 @@
# Test case for digest authentication
#
# $Id$
-
-# To run the test: nc -l -p 1235
-# Run this script
-# You should see a 'authorization: Basic # bG9uZ3VzZXJuYW1lMDEyMzQ1Njc4OTpsb25ncGFzc3dvcmQwMTIzNDU2Nzg5' header
+#
+# USAGE: (echo -n) | $0 PORT
+#
+# Few notes about what is done here:
+# - thread AUTH sends authentication digest
+# - thread NC uses netcat and grep to see results
+# - Little hack with (echo -n) is much more easier to use,
+# than some settrace machinary
import sys
+import socket
+import os
+import httplib
+from threading import Thread
sys.path.append('..')
from rhn.rpclib import Server
-SERVER = "longusername0123456789:longpassword0123456789@localhost:1234"
+SERVER = "longusername0123456789:longpassword0123456789@localhost"
+PORT = "1234"
HANDLER = "/XMLRPC"
+try:
+ SERVER = sys.argv[1]
+except:
+ pass
+
+class killable(Thread):
+ """Just Thread with a kill() method."""
+ def __init__(self, *args, **keywords):
+ Thread.__init__(self, *args, **keywords)
+ self.killed = False
+
+ def start(self):
+ self.__run_backup = self.run
+ self.run = self.__run # Force the Thread to install our trace.
+ Thread.start(self)
+
+ def __run(self):
+ sys.settrace(self.globaltrace)
+ self.__run_backup()
+ self.run = self.__run_backup
+
+ def globaltrace(self, frame, why, arg):
+ if why == 'call':
+ return self.localtrace
+ else:
+ return None
+
+ def localtrace(self, frame, why, arg):
+ if self.killed:
+ if why == 'line':
+ raise SystemExit()
+ return self.localtrace
+
+ def kill(self):
+ self.killed = True
+
+
+def authenticate():
+ global SERVER, PORT, HANDLER
+ s = Server("http://" + SERVER + ":" + PORT + HANDLER);
+ connected = False;
+ while not connected:
+ try:
+ connected = True;
+ print s.test.method()
+ except socket.error, e:
+ # nobody is listenning, try to authenticate again
+ connected = False;
+ pass;
+ except httplib.BadStatusLine, e:
+ # This is ok, netcat does not send apropriate response
+ pass
+
+
+def netcat():
+ global auth
+ cmd = "nc -l " + PORT + " | grep authorization\:\ Basic\ bG9uZ3VzZXJuYW1lMDEyMzQ1Njc4OTpsb25ncGFzc3dvcmQwMTIzNDU2Nzg5"
+ result = os.system(cmd);
+ if (result == 0):
+ print "Tests PASSES"
+ else:
+ auth.kill();
+ print "Test FAILS"
+
if __name__ == '__main__':
- s = Server("http://%s/%s" % (SERVER, HANDLER))
- print s.test.method()
+ global nc, auth
+ nc = killable(target = netcat);
+ auth = killable(target = authenticate);
+
+ nc.start();
+ auth.start();
+
14 years, 2 months
java/buildconf java/ivy.xml
by Justin Sherrill
java/buildconf/build-props.xml | 8 ++++----
java/ivy.xml | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
New commits:
commit eb69751838831d970003c98f0ad284e7a2c98b2b
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Thu Apr 8 15:04:58 2010 -0400
adding log5j to ivy stuff, and moving the repo to parthas fedorapeople account
diff --git a/java/buildconf/build-props.xml b/java/buildconf/build-props.xml
index 0b89284..ce4f919 100644
--- a/java/buildconf/build-props.xml
+++ b/java/buildconf/build-props.xml
@@ -34,7 +34,7 @@
<property name="includehelp" value="true" />
<!-- IVY Properties -->
- <property name="ivyserver" value="http://jmrodri.fedorapeople.org" />
+ <property name="ivyserver" value="http://partha.fedorapeople.org" />
<property name="ivy.log.module.when.found" value="false"/>
<property name="ivy.log.resolved.revision" value="false"/>
@@ -57,7 +57,7 @@
jspapi log4j oro redstone-xmlrpc-client redstone-xmlrpc servletapi5 struts
bcprov bcpg jcommon stringtree-json postgresql-jdbc
jfreechart taglibs-core logdriver quartz
- commons-fileupload commons-io concurrent velocity" />
+ commons-fileupload commons-io concurrent velocity log5j" />
<property name="test.jar.dependencies"
value="antlr checkstyle dom4j emma emma_ant jdom jta junit
@@ -102,7 +102,7 @@
jspapi log4j oro redstone-xmlrpc-client redstone-xmlrpc servletapi5 struts
jcommon stringtree-json postgresql-jdbc
jfreechart taglibs-core quartz
- commons-fileupload concurrent" />
+ commons-fileupload concurrent log5j" />
<property name="dist.jar.dependencies"
value="antlr asm bcel c3p0 cglib
@@ -114,7 +114,7 @@
jfreechart jspapi jpam log4j redstone-xmlrpc-client redstone-xmlrpc
oro oscache quartz stringtree-json sitemesh struts taglibs-core
taglibs-standard tanukiwrapper postgresql-jdbc
- xalan-j2 xerces-j2 xml-commons-apis" />
+ xalan-j2 xerces-j2 xml-commons-apis log5j" />
<path id="bootjars">
<fileset dir="${boot.lib.dir}" includes="*.jar" />
diff --git a/java/ivy.xml b/java/ivy.xml
index 7ab8e43..6118cd5 100644
--- a/java/ivy.xml
+++ b/java/ivy.xml
@@ -72,6 +72,6 @@
<dependency org="redhat" name="xalan-j2" rev="2.6.0" />
<dependency org="redhat" name="xerces-j2" rev="2.6.2" />
<dependency org="redhat" name="xml-commons-apis" rev="1.0" />
-
+ <dependency org="redhat" name="log5j" rev="1.2" />
</dependencies>
</ivy-module>
14 years, 2 months
java/code
by Tomas Lestach
java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/comparesystems.jsp | 8 ++++++--
java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/syncsystem.jsp | 4 ++++
2 files changed, 10 insertions(+), 2 deletions(-)
New commits:
commit 8f3c3a3979302763e15be67e764ddd04a6181f4a
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Thu Apr 8 19:44:37 2010 +0200
576907 - making same display changes for system sync
as done for profile sync in f4d30229c16b1ad5af1e1606ec1efce4fbcb800e
diff --git a/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/comparesystems.jsp b/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/comparesystems.jsp
index 0820309..af9a2d5 100644
--- a/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/comparesystems.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/comparesystems.jsp
@@ -35,12 +35,16 @@
${current.name}
</rl:column>
+ <rl:column headerkey="packagelist.jsp.packagearch" bound="false">
+ ${current.arch}
+ </rl:column>
+
<rl:column headerkey="compare.jsp.thissystem" bound="false">
- ${current.system.evra}
+ ${current.system.evr}
</rl:column>
<rl:column headertext="${requestScope.systemname}" bound="false">
- ${current.other.evra}
+ ${current.other.evr}
</rl:column>
<rl:column headerkey="compare.jsp.difference" bound="false">
diff --git a/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/syncsystem.jsp b/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/syncsystem.jsp
index 6e756e4..ad3f948 100644
--- a/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/syncsystem.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/syncsystem.jsp
@@ -30,6 +30,10 @@
${current.name}
</rl:column>
+ <rl:column headerkey="packagelist.jsp.packagearch" bound="false">
+ ${current.arch}
+ </rl:column>
+
<rl:column headerkey="schedulesync.jsp.action" bound="false">
${current.actionStatus}
</rl:column>
14 years, 2 months
java/code java/spacewalk-java.spec selinux/spacewalk-selinux spacewalk/setup
by Joshua Roys
java/code/src/com/redhat/rhn/manager/audit/AuditManager.java | 2 +-
java/spacewalk-java.spec | 8 ++++----
selinux/spacewalk-selinux/spacewalk.fc | 2 ++
spacewalk/setup/spacewalk-setup.spec | 4 ++++
4 files changed, 11 insertions(+), 5 deletions(-)
New commits:
commit e2baa965b1f606c59d674277c8b95f4aa32a12e5
Author: Joshua Roys <joshua.roys(a)gtri.gatech.edu>
Date: Fri Apr 2 16:38:03 2010 -0400
Move systemlogs directory out of /var/satellite
Now we have our own home in /var/spacewalk.
diff --git a/java/code/src/com/redhat/rhn/manager/audit/AuditManager.java b/java/code/src/com/redhat/rhn/manager/audit/AuditManager.java
index 7f7c45d..4bef7e3 100644
--- a/java/code/src/com/redhat/rhn/manager/audit/AuditManager.java
+++ b/java/code/src/com/redhat/rhn/manager/audit/AuditManager.java
@@ -49,7 +49,7 @@ public class AuditManager /* extends BaseManager */ {
}
private static String logDirStr = Config.get().getString("web.audit.logdir",
- "/var/satellite/systemlogs");
+ "/var/spacewalk/systemlogs");
private static File logDir = new File(logDirStr);
private static File reviewFile = new File(logDirStr + "/audit-review.log");
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index 2bf4240..036488a 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -233,7 +233,7 @@ install -d -m 755 $RPM_BUILD_ROOT/%{cobprofdir}
install -d -m 755 $RPM_BUILD_ROOT/%{cobprofdirup}
install -d -m 755 $RPM_BUILD_ROOT/%{cobprofdirwiz}
install -d -m 755 $RPM_BUILD_ROOT/%{cobdirsnippets}
-install -d -m 755 $RPM_BUILD_ROOT/%{_var}/satellite/systemlogs
+install -d -m 755 $RPM_BUILD_ROOT/%{_var}/spacewalk/systemlogs
install -d -m 755 $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d
install -m 644 conf/default/rhn_hibernate.conf $RPM_BUILD_ROOT/%{_sysconfdir}/rhn/default/rhn_hibernate.conf
@@ -248,7 +248,7 @@ ln -s -f /usr/sbin/tanukiwrapper $RPM_BUILD_ROOT/%{_bindir}/taskomaticd
ln -s -f %{_javadir}/ojdbc14.jar $RPM_BUILD_ROOT%{jardir}/ojdbc14.jar
install -d -m 755 $RPM_BUILD_ROOT/%{realcobsnippetsdir}
ln -s -f %{cobdirsnippets} $RPM_BUILD_ROOT/%{realcobsnippetsdir}/spacewalk
-touch $RPM_BUILD_ROOT/%{_var}/satellite/systemlogs/audit-review.log
+touch $RPM_BUILD_ROOT/%{_var}/spacewalk/systemlogs/audit-review.log
%clean
@@ -281,8 +281,8 @@ fi
%config(noreplace) %{_sysconfdir}/tomcat6/Catalina/localhost/rhn.xml
%endif
%{realcobsnippetsdir}/spacewalk
-%attr(755, tomcat, root) %{_var}/satellite/systemlogs
-%ghost %attr(644, tomcat, root) %{_var}/satellite/systemlogs/audit-review.log
+%attr(755, tomcat, root) %{_var}/spacewalk/systemlogs
+%ghost %attr(644, tomcat, root) %{_var}/spacewalk/systemlogs/audit-review.log
%files -n spacewalk-taskomatic
%attr(755, root, root) %{_initrddir}/taskomatic
diff --git a/selinux/spacewalk-selinux/spacewalk.fc b/selinux/spacewalk-selinux/spacewalk.fc
index 8570ff4..879f0cc 100644
--- a/selinux/spacewalk-selinux/spacewalk.fc
+++ b/selinux/spacewalk-selinux/spacewalk.fc
@@ -11,6 +11,8 @@
/usr/sbin/rhn-sat-restart-silent gen_context(system_u:object_r:spacewalk_initrc_exec_t,s0)
/var/satellite(/.*)? gen_context(system_u:object_r:spacewalk_data_t,s0)
+/var/spacewalk(/.*)? gen_context(system_u:object_r:spacewalk_data_t,s0)
+
/var/cache/rhn(/.*)? gen_context(system_u:object_r:spacewalk_cache_t,s0)
/var/cache/rhn/satsync(/.*)? gen_context(system_u:object_r:var_t,s0)
diff --git a/spacewalk/setup/spacewalk-setup.spec b/spacewalk/setup/spacewalk-setup.spec
index 179eaf8..350f2dd 100644
--- a/spacewalk/setup/spacewalk-setup.spec
+++ b/spacewalk/setup/spacewalk-setup.spec
@@ -75,6 +75,9 @@ install -m 0755 share/oracle/remove-db.sh %{buildroot}/%{_datadir}/spacewalk/set
install -m 0755 share/oracle/upgrade-db.sh %{buildroot}/%{_datadir}/spacewalk/setup/oracle
install -m 0755 share/oracle/upgrade-db-10g.sh %{buildroot}/%{_datadir}/spacewalk/setup/oracle
+# create a directory for misc. Spacewalk things
+install -d -m 755 %{buildroot}/%{_var}/spacewalk
+
%check
make test
@@ -93,6 +96,7 @@ rm -rf %{buildroot}
%{_bindir}/cobbler-setup
%{_mandir}/man[13]/*.[13]*
%{_datadir}/spacewalk/*
+%attr(755, apache, root) %{_var}/spacewalk
%changelog
* Wed Mar 24 2010 Michael Mraka <michael.mraka(a)redhat.com> 0.9.3-1
14 years, 2 months