2 commits - projects/oracle-server-scripts
by Michael Mraka
projects/oracle-server-scripts/create-db.sh | 1 +
projects/oracle-server-scripts/oracle-compute-sga.sh | 4 ++--
projects/oracle-server-scripts/oracle-server-scripts.spec | 3 ++-
3 files changed, 5 insertions(+), 3 deletions(-)
New commits:
commit 3cf0ddc8fea44a0ece39df243b6339d884079664
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Nov 26 08:55:34 2010 +0100
added correct units to memory params
diff --git a/projects/oracle-server-scripts/oracle-compute-sga.sh b/projects/oracle-server-scripts/oracle-compute-sga.sh
index 149fc1a..40dbb5e 100644
--- a/projects/oracle-server-scripts/oracle-compute-sga.sh
+++ b/projects/oracle-server-scripts/oracle-compute-sga.sh
@@ -36,5 +36,5 @@ if [ $pga_target -gt $pgamax ] ; then
pga_target=$pgamax
fi
-echo sga_target=$sga_target
-echo pga_aggregate_target=$pga_target
+echo sga_target=${sga_target}M
+echo pga_aggregate_target=${pga_target}M
commit a9079e153b0668f4b539d7cb0e668584c53360e2
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Nov 25 17:06:05 2010 +0100
643368 - size oracle sga dynamicaly
diff --git a/projects/oracle-server-scripts/create-db.sh b/projects/oracle-server-scripts/create-db.sh
index 459f283..8e3f45f 100755
--- a/projects/oracle-server-scripts/create-db.sh
+++ b/projects/oracle-server-scripts/create-db.sh
@@ -286,6 +286,7 @@ db_domain = world
db_name = $db
ifile = $Oracle/admin/$OracleVersionShort/init-params.ora
+$($TOPDIR/oracle-compute-sga.sh)
EOF
}
diff --git a/projects/oracle-server-scripts/oracle-server-scripts.spec b/projects/oracle-server-scripts/oracle-server-scripts.spec
index f01bb86..453c8ad 100644
--- a/projects/oracle-server-scripts/oracle-server-scripts.spec
+++ b/projects/oracle-server-scripts/oracle-server-scripts.spec
@@ -24,6 +24,7 @@ Source10: embedded-createdb.tmpl
Source11: rhnora.m4
Source12: embedded-upgradedb.tmpl
Source13: embedded-upgradedb-10g.tmpl
+Source14: oracle-compute-sga.sh
License: Proprietary
Group: Oracle Server
BuildArch: noarch
@@ -46,7 +47,7 @@ mkdir -p $RPM_BUILD_ROOT
install -m755 -d $RPM_BUILD_ROOT%{oracle_admin}
for f in %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} \
%{SOURCE4} %{SOURCE5} %{SOURCE9} %{SOURCE10} %{SOURCE11} \
- %{SOURCE12} %{SOURCE13}; do
+ %{SOURCE12} %{SOURCE13} %{SOURCE14}; do
install -m 755 $f $RPM_BUILD_ROOT%{oracle_admin}
done
13 years, 5 months
Changes to 'refs/tags/python-gzipstream-1.4.2-1'
by Miroslav Suchý
Tag 'python-gzipstream-1.4.2-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2010-11-26 11:12 +0000
Tagging package [python-gzipstream] version [1.4.2-1] in directory [projects/python-gzipstream/].
Changes since python-gzipstream-1.4.1-1:
Miroslav Suchý (5):
correct url and source url to point to fedorahosted
correct buildroot
make setup quiet
put license into doc section
Automatic commit of package [python-gzipstream] release [1.4.2-1].
---
projects/python-gzipstream/python-gzipstream.spec | 17 ++++++++++++-----
projects/python-gzipstream/setup.py | 2 +-
rel-eng/packages/python-gzipstream | 2 +-
3 files changed, 14 insertions(+), 7 deletions(-)
---
13 years, 5 months
5 commits - projects/python-gzipstream rel-eng/packages
by Miroslav Suchý
projects/python-gzipstream/python-gzipstream.spec | 17 ++++++++++++-----
projects/python-gzipstream/setup.py | 2 +-
rel-eng/packages/python-gzipstream | 2 +-
3 files changed, 14 insertions(+), 7 deletions(-)
New commits:
commit 53fd809621d87d00765b15e458eee50067a21c0a
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Nov 26 12:12:00 2010 +0100
Automatic commit of package [python-gzipstream] release [1.4.2-1].
diff --git a/projects/python-gzipstream/python-gzipstream.spec b/projects/python-gzipstream/python-gzipstream.spec
index f7f6348..fd1f60b 100644
--- a/projects/python-gzipstream/python-gzipstream.spec
+++ b/projects/python-gzipstream/python-gzipstream.spec
@@ -2,7 +2,7 @@
Summary: Streaming zlib (gzip) support for python
Name: python-gzipstream
-Version: 1.4.1
+Version: 1.4.2
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/python-gzipstream-%{versi...
@@ -38,6 +38,12 @@ rm -rf $RPM_BUILD_ROOT
%doc LICENSE
%changelog
+* Fri Nov 26 2010 Miroslav Suchý <msuchy(a)redhat.com> 1.4.2-1
+- put license into doc section (msuchy(a)redhat.com)
+- make setup quiet (msuchy(a)redhat.com)
+- correct buildroot (msuchy(a)redhat.com)
+- correct url and source url to point to fedorahosted (msuchy(a)redhat.com)
+
* Fri Nov 26 2010 Miroslav Suchý <msuchy(a)redhat.com> 1.4.1-1
- new package built with tito
diff --git a/projects/python-gzipstream/setup.py b/projects/python-gzipstream/setup.py
index 9eedee0..7a40eb6 100644
--- a/projects/python-gzipstream/setup.py
+++ b/projects/python-gzipstream/setup.py
@@ -6,7 +6,7 @@
from distutils.core import setup
setup(name = "gzipstream",
- version = "1.4.1",
+ version = "1.4.2",
description = "Streaming zlib (gzip) support for python",
long_description = """\
A streaming gzip handler.
diff --git a/rel-eng/packages/python-gzipstream b/rel-eng/packages/python-gzipstream
index 2ebbbf1..58ea78a 100644
--- a/rel-eng/packages/python-gzipstream
+++ b/rel-eng/packages/python-gzipstream
@@ -1 +1 @@
-1.4.1-1 projects/python-gzipstream/
+1.4.2-1 projects/python-gzipstream/
commit afa61569b20f6a98321c4c98d383933583edfbb8
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Nov 26 12:04:07 2010 +0100
put license into doc section
diff --git a/projects/python-gzipstream/python-gzipstream.spec b/projects/python-gzipstream/python-gzipstream.spec
index 15eb50c..f7f6348 100644
--- a/projects/python-gzipstream/python-gzipstream.spec
+++ b/projects/python-gzipstream/python-gzipstream.spec
@@ -35,6 +35,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{python_sitelib}/*
+%doc LICENSE
%changelog
* Fri Nov 26 2010 Miroslav Suchý <msuchy(a)redhat.com> 1.4.1-1
commit 4c5a903e5c877d3961ca6546efeae109efa96a67
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Nov 26 12:02:51 2010 +0100
make setup quiet
addressing rpmlint warning:
python-gzipstream.src:23: W: setup-not-quiet
diff --git a/projects/python-gzipstream/python-gzipstream.spec b/projects/python-gzipstream/python-gzipstream.spec
index 52ba3e9..15eb50c 100644
--- a/projects/python-gzipstream/python-gzipstream.spec
+++ b/projects/python-gzipstream/python-gzipstream.spec
@@ -20,7 +20,7 @@ to allow the processing of streaming data.
%prep
-%setup
+%setup -q
%build
%{__python} setup.py build
commit 1e651d9a8c14d5e07e2454d7e7ffa69f10c6e9ee
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Nov 26 11:59:28 2010 +0100
correct buildroot
diff --git a/projects/python-gzipstream/python-gzipstream.spec b/projects/python-gzipstream/python-gzipstream.spec
index 1ace287..52ba3e9 100644
--- a/projects/python-gzipstream/python-gzipstream.spec
+++ b/projects/python-gzipstream/python-gzipstream.spec
@@ -8,7 +8,7 @@ URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/python-gzipstream-%{versi...
License: Python and GPLv2
Group: Development/Libraries
-BuildRoot: %{_tmppath}/%{name}-buildroot
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildArch: noarch
BuildRequires: python-devel
commit cb701db747a689aa268a75be31662ea86d9f37f5
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Nov 26 11:58:55 2010 +0100
correct url and source url to point to fedorahosted
diff --git a/projects/python-gzipstream/python-gzipstream.spec b/projects/python-gzipstream/python-gzipstream.spec
index 634339e..1ace287 100644
--- a/projects/python-gzipstream/python-gzipstream.spec
+++ b/projects/python-gzipstream/python-gzipstream.spec
@@ -4,13 +4,13 @@ Summary: Streaming zlib (gzip) support for python
Name: python-gzipstream
Version: 1.4.1
Release: 1%{?dist}
-Source0: gzipstream-%{version}.tar.gz
+URL: https://fedorahosted.org/spacewalk
+Source0: https://fedorahosted.org/releases/s/p/spacewalk/python-gzipstream-%{versi...
License: Python and GPLv2
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-buildroot
BuildArch: noarch
BuildRequires: python-devel
-Url: http://rhn.redhat.com
%description
@@ -20,7 +20,7 @@ to allow the processing of streaming data.
%prep
-%setup -q -n gzipstream-%{version}
+%setup
%build
%{__python} setup.py build
13 years, 5 months
3 commits - projects/python-gzipstream rel-eng/packages
by Miroslav Suchý
projects/python-gzipstream/LICENSE | 339 ++++++++
projects/python-gzipstream/Makefile | 1
projects/python-gzipstream/PKG-INFO | 13
projects/python-gzipstream/gzipstream.py | 630 ++++++++++++++++
projects/python-gzipstream/python-gzipstream.spec | 82 ++
projects/python-gzipstream/setup.py | 21
projects/python-gzipstream/test/test-gzipstream-huge.py | 49 +
projects/python-gzipstream/test/test-gzipstream-xml.py | 47 +
rel-eng/packages/python-gzipstream | 1
9 files changed, 1183 insertions(+)
New commits:
commit 7fee6c6e1a5932bd5bf2afa4cf5a45bb593cfa8f
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Nov 26 11:49:35 2010 +0100
Automatic commit of package [python-gzipstream] release [1.4.1-1].
diff --git a/projects/python-gzipstream/python-gzipstream.spec b/projects/python-gzipstream/python-gzipstream.spec
index 864749f..634339e 100644
--- a/projects/python-gzipstream/python-gzipstream.spec
+++ b/projects/python-gzipstream/python-gzipstream.spec
@@ -2,8 +2,8 @@
Summary: Streaming zlib (gzip) support for python
Name: python-gzipstream
-Version: 1.4.0
-Release: 18%{?dist}
+Version: 1.4.1
+Release: 1%{?dist}
Source0: gzipstream-%{version}.tar.gz
License: Python and GPLv2
Group: Development/Libraries
@@ -37,6 +37,9 @@ rm -rf $RPM_BUILD_ROOT
%{python_sitelib}/*
%changelog
+* Fri Nov 26 2010 Miroslav Suchý <msuchy(a)redhat.com> 1.4.1-1
+- new package built with tito
+
* Tue Jun 02 2009 Dennis Gilmore <dgilmore(a)redhat.com> 1.4.0-18
- bump release to 18 to ensure its highest nvr wise
diff --git a/projects/python-gzipstream/setup.py b/projects/python-gzipstream/setup.py
index 5b88b7a..9eedee0 100644
--- a/projects/python-gzipstream/setup.py
+++ b/projects/python-gzipstream/setup.py
@@ -6,7 +6,7 @@
from distutils.core import setup
setup(name = "gzipstream",
- version = "1.4.0",
+ version = "1.4.1",
description = "Streaming zlib (gzip) support for python",
long_description = """\
A streaming gzip handler.
diff --git a/rel-eng/packages/python-gzipstream b/rel-eng/packages/python-gzipstream
new file mode 100644
index 0000000..2ebbbf1
--- /dev/null
+++ b/rel-eng/packages/python-gzipstream
@@ -0,0 +1 @@
+1.4.1-1 projects/python-gzipstream/
commit fd55886e429db6e9dc1366aada384311f4994cf6
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Nov 26 11:38:06 2010 +0100
clarify license
diff --git a/projects/python-gzipstream/gzipstream.py b/projects/python-gzipstream/gzipstream.py
index f027678..2c92078 100644
--- a/projects/python-gzipstream/gzipstream.py
+++ b/projects/python-gzipstream/gzipstream.py
@@ -22,8 +22,8 @@ XXX: Eventually, I wish to merge this with the gzip.GzipFile somehow and
submit to the python folks.
Author: Todd Warner <taw(a)redhat.com>
-Copyright (c) 2002-2004, Red Hat, Inc.
-All rights reserved.
+Copyright (c) 2002-2010, Red Hat, Inc.
+Released under Python license and GPLv2 license
"""
# $Id: gzipstream.py,v 1.53 2004/07/08 17:49:26 taw Exp $
diff --git a/projects/python-gzipstream/python-gzipstream.spec b/projects/python-gzipstream/python-gzipstream.spec
index ae778da..864749f 100644
--- a/projects/python-gzipstream/python-gzipstream.spec
+++ b/projects/python-gzipstream/python-gzipstream.spec
@@ -5,7 +5,7 @@ Name: python-gzipstream
Version: 1.4.0
Release: 18%{?dist}
Source0: gzipstream-%{version}.tar.gz
-License: PSF
+License: Python and GPLv2
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-buildroot
BuildArch: noarch
diff --git a/projects/python-gzipstream/setup.py b/projects/python-gzipstream/setup.py
index 0c4d947..5b88b7a 100644
--- a/projects/python-gzipstream/setup.py
+++ b/projects/python-gzipstream/setup.py
@@ -17,5 +17,5 @@ to allow the processing of streaming data.
author_email = 'taw(a)redhat.com',
url = 'http://rhn.redhat.com',
py_modules = ["gzipstream"],
- license = "PSF",
+ license = "Python and GPLv2",
)
commit 0a596f3210f692851555f8125e51453aa235d6ea
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Nov 26 11:31:36 2010 +0100
import python-gzipstream
Imported from thirdparty repo.
It is not thirdparty module, we are upstream.
Proposed to upstream in:
http://bugs.python.org/issue9664
but it will be long way.
diff --git a/projects/python-gzipstream/LICENSE b/projects/python-gzipstream/LICENSE
new file mode 100644
index 0000000..d511905
--- /dev/null
+++ b/projects/python-gzipstream/LICENSE
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/projects/python-gzipstream/Makefile b/projects/python-gzipstream/Makefile
new file mode 100644
index 0000000..2f885a3
--- /dev/null
+++ b/projects/python-gzipstream/Makefile
@@ -0,0 +1 @@
+include ../../rel-eng/Makefile
diff --git a/projects/python-gzipstream/PKG-INFO b/projects/python-gzipstream/PKG-INFO
new file mode 100644
index 0000000..1f85d0b
--- /dev/null
+++ b/projects/python-gzipstream/PKG-INFO
@@ -0,0 +1,13 @@
+Metadata-Version: 1.0
+Name: gzipstream
+Version: 1.4.0
+Summary: Streaming zlib (gzip) support for python
+Home-page: http://rhn.redhat.com
+Author: Todd Warner
+Author-email: taw(a)redhat.com
+License: PSF
+Description: A streaming gzip handler.
+ gzipstream.GzipStream extends the functionality of the gzip.GzipFile class
+ to allow the processing of streaming data.
+
+Platform: UNKNOWN
diff --git a/projects/python-gzipstream/gzipstream.py b/projects/python-gzipstream/gzipstream.py
new file mode 100644
index 0000000..f027678
--- /dev/null
+++ b/projects/python-gzipstream/gzipstream.py
@@ -0,0 +1,630 @@
+"""GzipStream & GzipStreamXL Classes
+
+GzipStream (Python v1.5.2 - v2.2.*):
+ A streaming gzip handler.
+ gzipstream.GzipStream extends the functionality of the gzip.GzipFile class
+ to allow the processing of streaming data.
+ This is done by buffering the stream as it passes through (a seekable
+ object is needed).
+
+GzipStreamXL (Python v1.5.2/v2.1.* --- ie. not v2.2.*):
+ A streaming gzip handler for very large files.
+
+_StreamBuf:
+ Allow seeks on socket-like objects -- support GzipStream class.
+ Enables non-seekable file-like objects some flexibility as regards to
+ seeking. It does this via a buffer, a StringIO object. Note, because
+ it is assumed that a socket stream is being manipulated, once the buffer
+ "window" has passed over a data segment, seeking prior to that is not
+ allowed.
+
+XXX: Eventually, I wish to merge this with the gzip.GzipFile somehow and
+ submit to the python folks.
+
+Author: Todd Warner <taw(a)redhat.com>
+Copyright (c) 2002-2004, Red Hat, Inc.
+All rights reserved.
+"""
+# $Id: gzipstream.py,v 1.53 2004/07/08 17:49:26 taw Exp $
+
+#WARNING: gzipstream will wrap a file-object. The responsibility of properly
+#WARNING: destroying/closing that file-object resides outside of these
+#WARNING: classes.
+#WARNING:
+#WARNING: Also, due to issues with python 1.5.2/2.1.* garbage collection issues,
+#WARNING: responsibility of properly handling flushing IO and other expected
+#WARNING: behavior of a properly collected object *also* resides with the
+#WARNING: instantiating entity. I.e., you need to explicitely close your
+#WARNING: GzipStream object!!!
+
+
+import sys
+import gzip
+from gzip import zlib
+from types import IntType, LongType
+import struct
+import string
+try:
+ # Is this *still* needed? cStringIO supposedly works on all platforms
+ from cStringIO import StringIO
+except ImportError:
+ from StringIO import StringIO
+
+
+_DEBUG_YN = 0
+if _DEBUG_YN:
+ import time
+ try:
+ import thread
+ except:
+ pass
+
+
+def __getSysVersion():
+ """Return 1 for Python versions 1.5.* and 2.1.*
+ Return 2 for Python versions 2.2+.*
+ """
+ minor = int(string.split(string.split(sys.version)[0], '.')[1])
+ if minor < 2:
+ return 1
+ return 2
+_SYS_VERSION = __getSysVersion()
+
+
+class GzipStream(gzip.GzipFile):
+ """Handle streaming gzipped data
+
+ GzipStream extends the functionality of the gzip.GzipFile class.
+ gzip.GzipFile generally needs a seekable object. This doesn't allow for
+ streaming gzipped data to be processed easily (e.g. can't seek a socket).
+ Using the _StreamBuf class enables streaming gzipped data to be processed
+ by buffering that data at it passes through.
+
+ For Python versions 1.5.2 & 2.1.*:
+ Normal data version.
+ Normally sized data stream version == faster.
+ For very large data streams (2.5GB-ish), use GzipStreamXL.
+ """
+ VERSION = _SYS_VERSION # so garbage collector doesn't nuke it too early with
+ # older (v1.5.2-v2.1.*) python.
+
+ def __init__(self, stream=None, mode=None, compresslevel=9):
+ if stream is None:
+ stream = sys.stdout
+
+ mode = self._initModeLogic(stream, mode)
+
+ # self.stream becomes a _StreamBuf object
+ if not isinstance(stream, _StreamBuf):
+ self.stream = _StreamBuf(stream, mode)
+ else:
+ self.stream = stream
+ self._gzip = gzip # hang onto for destructive reasons
+ self._gzip.GzipFile.__init__(self, '', mode, compresslevel, self.stream)
+
+ def _initModeLogic(self, stream, mode):
+ "attempt to determine the mode"
+ _mode = None
+ _modes = ''
+ if hasattr(stream, 'mode'):
+ _mode = stream.mode
+ _modes = _mode
+ # Attributes lie, by the way, so sometimes we have to punt.
+ if not _mode and hasattr(stream, 'read'):
+ _modes = _modes + 'r'
+ if not _mode and hasattr(stream, 'write'):
+ _modes = _modes + 'w'
+ # NOTE: Async objects needs a mode set or defaults to 'rb'
+
+ if not _mode and not mode:
+ # punt
+ if 'r' in _modes:
+ mode = _mode = 'rb'
+ elif 'w' in _modes:
+ mode = _mode = 'wb'
+ elif not mode:
+ mode = _mode
+
+ if mode[0] not in _modes:
+ raise ValueError, 'Mode %s not supported' % mode
+ return mode
+
+ def _read(self, size=1024):
+ # overloaded --- one line changed.
+ # Instead of seek(0,2) to see if we are at the end of the
+ # file, just do a seek(pos+1) if the same then we are at the
+ # end of the file.
+ if self.stream is None:
+ raise EOFError, "Reached EOF"
+
+ if self._new_member:
+ # If the _new_member flag is set, we have to
+ #
+ # First, check if we're at the end of the file;
+ # if so, it's time to stop; no more members to read.
+ pos = self.stream.tell() # Save current position
+ self.stream.seek(pos+1) # Seek further... if at end, won't
+ # seek any further.
+ if pos == self.stream.tell():
+ self.stream.close()
+ self.stream = None
+ return EOFError, "Reached EOF"
+ else:
+ self.stream.seek( pos ) # Return to original position
+
+ self._init_read()
+ self._read_gzip_header()
+ self.decompress = zlib.decompressobj(-zlib.MAX_WBITS)
+ self._new_member = 0
+
+ # Read a chunk of data from the file
+ buf = self.stream.read(size)
+
+ # If the EOF has been reached, flush the decompression object
+ # and mark this object as finished.
+
+ if buf == "":
+ uncompress = self.decompress.flush()
+ self._read_eof()
+ self.stream.close()
+ self.stream = None
+ self._add_read_data( uncompress )
+ raise EOFError, 'Reached EOF'
+
+ uncompress = self.decompress.decompress(buf)
+ self._add_read_data( uncompress )
+
+ if self.decompress.unused_data != "":
+ # Ending case: we've come to the end of a member in the file,
+ # so seek back to the start of the unused data, finish up
+ # this member, and read a new gzip header.
+ # (The number of bytes to seek back is the length of the unused
+ # data, minus 8 because _read_eof() will rewind a further 8 bytes)
+ self.stream.seek( -len(self.decompress.unused_data)+8, 1)
+
+ # Check the CRC and file size, and set the flag so we read
+ # a new member on the next call
+ self._read_eof()
+ self._new_member = 1
+
+ def seek(self, offset):
+ raise IOError, 'Random access not allowed in gzip streams'
+
+ def __repr__(self):
+ ret = ''
+ if self.stream._closedYN:
+ ret = "<closed gzipstream.GzipStream instance, mode '%s' at %s>" % \
+ (self.stream.mode, id(self))
+ else:
+ ret = "<open gzipstream.GzipStream instance, mode '%s' at %s>" % \
+ (self.stream.mode, id(self))
+ return ret
+
+ ### These methods are generally only important for Python v2.2.* ###
+ def _read_eof(self):
+ # overloaded to accommodate LongType
+ if type(self.size) == LongType:
+ self._gzip.read32 = self._read32XL
+ self._gzip.GzipFile._read_eof(self)
+
+ def close(self):
+ if self.stream and self.stream._closedYN:
+ # remove this block for python v2.2.*
+ return
+ # overloaded to accommodate LongType
+ if hasattr(self, 'size'):
+ if type(self.size) == LongType:
+ self._gzip.write32 = self._gzip.write32u
+ else:
+ # write32u is the "safest" route if punting.
+ self._gzip.write32 = self._gzip.write32u
+ self._gzip.GzipFile.close(self)
+ if self.stream:
+ self.stream.close()
+
+ def _read32XL(self, input):
+ """Allow for very large files/streams to be processed.
+ Slows things down, but...
+
+ Used by Python v2.2.*.
+ Also used by Python v1.5.2/v2.1.* in inheriting class GzipStreamXL.
+ """
+ return struct.unpack("<L", input.read(4))[0]
+
+
+#
+# Python v1.5.2/v2.1.* version only class
+#
+if _SYS_VERSION == 1:
+ class GzipStreamXL(GzipStream):
+ """Handle streaming gzipped data -- large data version.
+
+ Very large sized data stream version -- slooower.
+ For normally sized data streams (< 2.5GB-ish), use GzipStream.
+ """
+ def __init__(self, stream=None, mode=None, compresslevel=9):
+ gzip.read32 = self._read32XL
+ gzip.write32 = gzip.write32u
+ GzipStream.__init__(self, stream, mode, compresslevel)
+
+
+ def _init_write(self, filename):
+ """Make size long in order to support very large files.
+ """
+ GzipStream._init_write(self, filename)
+ self.size = 0L
+
+
+ def _init_read(self):
+ """Make size a long in order to support very large files.
+ """
+ GzipStream._init_read(self)
+ self.size = 0L
+
+
+class _StreamBuf:
+ """Stream buffer for file-like objects.
+
+ Allow seeks on socket-like objects.
+ Enables non-seekable file-like objects some flexibility as regards to
+ seeking. It does this via a buffer, a StringIO object. Note, because
+ it is assumed that a socket stream is being manipulated, once the buffer
+ "window" has passed over a data segment, seeking prior to that is not
+ allowed.
+ XXX: probably reinventing the wheel.
+ """
+ __MIN_READ_SIZE = 1024 * 2 # Default = 2K
+ __MAX_BUFIO_SIZE = __MIN_READ_SIZE * 10 # Default = 20K
+ __ABS_MAX_BUFIO_SIZE = __MAX_BUFIO_SIZE * 2 # Default = 40K
+
+ ### Python versions 1.5.2 & 2.1.* only:
+ __INT_CHECK_SIZE = sys.maxint - __ABS_MAX_BUFIO_SIZE -2
+
+ VERSION = _SYS_VERSION # so garbage collector doesn't nuke it too early with
+ # older (v1.5.2-v2.1.*) python.
+
+ def __init__(self, stream=None, mode=None):
+ """Constructor.
+ stream: an open file-like object.
+ """
+ self.fo = stream
+ self._readableYN = 0
+ self._writableYN = 0
+
+ if self.fo is None:
+ self.fo = StringIO()
+ mode = 'wb'
+ self._readableYN = 1
+ self._writableYN = 1
+
+ # If mode not declared, try to figure it out.
+ if mode is None:
+ try:
+ mode = self.fo.mode
+ except:
+ pass
+
+ # Can only read or write, not both and really the 'b' is meaningless.
+ if not mode or (type(mode) == type("") \
+ and (mode[0] not in 'rw' or (len(mode) > 1 and mode[1] != 'b'))):
+ raise IOError, (22, "Invalid argument: mode=%s" % repr(mode))
+
+ if mode[0] == 'r':
+ self._readableYN = 1
+ else:
+ self._writableYN = 1
+
+ # Better be an open file-like object.
+ if self._readableYN:
+ self.fo.read # Throw AttributeError if not readable.
+ if self._writableYN:
+ self.fo.write # Throw AttributeError if not writable.
+
+ self._closedYN = 0
+ self._currFoPos = 0 # Assume at beginning of stream.
+ self._bufIO = StringIO()
+ self._lenBufIO = 0
+ self.mode = mode
+ # Threaded debug loop:
+ self.__mutexOnYN = 0
+ if _DEBUG_YN and globals().has_key('thread'):
+ thread.start_new(self.__debugThread, ())
+
+ def __del__(self):
+ "Destructor"
+ # Python v1.5.2/v2.1.* tries to run this but close doesn't always
+ # still exist. For a pure Python v2.2.*, remove the try: except:.
+ try:
+ self.close()
+ except:
+ pass
+
+ def isatty(self):
+ if self._closedYN:
+ raise ValueError, "I/O operation on closed _StreamBuf object"
+ return 0
+
+ def _read(self, size):
+ """A buffered read --- refactored.
+ """
+ if self._closedYN:
+ raise ValueError, "I/O operation on closed _StreamBuf object"
+ if not self._readableYN:
+ raise IOError, (9, "Can't read from a write only object")
+ tell = self._bufIO.tell()
+ bufIO = self._bufIO.read(size)
+ lbufIO = len(bufIO)
+ bufFo = ''
+ lbufFo = 0
+ if lbufIO < size:
+ # We read to end of buffer; read from file and tag onto buffer.
+ buf = self.fo.read(_StreamBuf.__MIN_READ_SIZE)
+ bufFo = buf
+ lbufFo = len(bufFo)
+ while buf and lbufFo + lbufIO < size:
+ buf = self.fo.read(_StreamBuf.__MIN_READ_SIZE)
+ bufFo = '%s%s' % (bufFo, buf)
+ lbufFo = len(bufFo)
+ self._bufIO.write(bufFo)
+ self.__mutexOnYN = 1
+ self._lenBufIO = self._lenBufIO + lbufFo
+ self.__mutexOnYN = 0
+ if lbufIO + lbufFo < size: # covers case that size > filelength.
+ size = lbufIO + lbufFo
+ self._bufIO.seek(tell + size)
+ if _StreamBuf.VERSION == 1:
+ self._currFoPos = self.__checkInt(self._currFoPos)
+ self._currFoPos = self._currFoPos + size
+ bufFo = bufFo[:size-lbufIO]
+ self._refactorBufIO()
+ return '%s%s' % (bufIO, bufFo)
+
+ def read(self, size=None):
+ """A buffered read.
+ """
+ if size and size < 0:
+ raise IOError, (22, "Invalid argument")
+ if not self._readableYN:
+ raise IOError, (9, "Can't read from a write only object")
+ fetchSize = _StreamBuf.__MAX_BUFIO_SIZE
+ if size:
+ fetchSize = min(fetchSize, size)
+ buf = self._read(fetchSize)
+ bufOut = buf
+ accumSize = len(buf)
+ while buf:
+ if size and accumSize >= size:
+ break
+ buf = self._read(fetchSize)
+ bufOut = '%s%s' % (bufOut, buf)
+ if _StreamBuf.VERSION == 1:
+ accumSize = self.__checkInt(accumSize)
+ accumSize = accumSize + len(buf)
+ return bufOut
+
+ def readline(self):
+ """Return one line of text: a string ending in a '\n' or EOF.
+ """
+ if self._closedYN:
+ raise ValueError, "I/O operation on closed _StreamBuf object"
+ if not self._readableYN:
+ raise IOError, (9, "Can't read from a write only object")
+ line = ''
+ buf = self.read(_StreamBuf.__MIN_READ_SIZE)
+ while buf:
+ i = string.find(buf, '\n')
+ if i >= 0:
+ i = i + 1
+ self._bufIO.seek(-(len(buf)-i), 1)
+ buf = buf[:i]
+ line = '%s%s' % (line, buf)
+ break
+ line = '%s%s' % (line, buf)
+ buf = self.read(_StreamBuf.__MIN_READ_SIZE)
+ return line
+
+ def readlines(self):
+ """Read entire file into memory! And return a list of lines of text.
+ """
+ if self._closedYN:
+ raise ValueError, "I/O operation on closed _StreamBuf object"
+ if not self._readableYN:
+ raise IOError, (9, "Can't read from a write only object")
+ lines = []
+ line = self.readline()
+ while line:
+ lines.append(line)
+ line = self.readline()
+ return lines
+
+ def _refactorBufIO(self, writeFlushYN=0):
+ """Keep the buffer window within __{MAX,ABS_MAX}_BUF_SIZE before
+ the current self._bufIO.tell() position.
+ """
+ self.__mutexOnYN = 1
+ tell = self._bufIO.tell()
+ tossed = ''
+ if writeFlushYN:
+ tossed = self._bufIO.getvalue()[:tell]
+ self._lenBufIO = self._lenBufIO - len(tossed)
+ tell = tell - len(tossed)
+ s = self._bufIO.getvalue()[tell:]
+ self._bufIO = StringIO()
+ self._bufIO.write(s)
+ self._bufIO.seek(tell)
+ elif tell >= _StreamBuf.__ABS_MAX_BUFIO_SIZE:
+ tossed = self._bufIO.getvalue()[:_StreamBuf.__MAX_BUFIO_SIZE]
+ self._lenBufIO = self._lenBufIO - _StreamBuf.__MAX_BUFIO_SIZE
+ tell = tell - _StreamBuf.__MAX_BUFIO_SIZE
+ s = self._bufIO.getvalue()[_StreamBuf.__MAX_BUFIO_SIZE:]
+ self._bufIO = StringIO()
+ self._bufIO.write(s)
+ self._bufIO.seek(tell)
+ self.__mutexOnYN = 0
+ return tossed
+
+ def _dumpValues(self):
+ """Debug code.
+ """
+ err = sys.stderr.write
+ err('self._lenBufIO: %s/%s\n' % (self._lenBufIO,
+ len(self._bufIO.getvalue())))
+ err('self._currFoPos: %s\n' % self._currFoPos)
+ err('self._readableYN: %s\n' % self._readableYN)
+ err('self._writableYN: %s\n' % self._writableYN)
+ err('self._closedYN: %s\n' % self._closedYN)
+
+ def write(self, s):
+ """Write string to stream.
+ """
+ if self._closedYN:
+ raise ValueError, "I/O operation on closed _StreamBuf object"
+ if not self._writableYN:
+ raise IOError, (9, "Can't write to a read only object")
+ self._bufIO.write(s)
+ if _StreamBuf.VERSION == 1:
+ self._currFoPos = self.__checkInt(self._currFoPos)
+ self._currFoPos = self._currFoPos + len(s)
+ self.__mutexOnYN = 1
+ self._lenBufIO = self._lenBufIO + len(s)
+ self.__mutexOnYN = 0
+ self.fo.write(self._refactorBufIO())
+
+ def writelines(self, l):
+ """Given list, concatenate and write.
+ """
+ if self._closedYN:
+ raise ValueError, "I/O operation on closed _StreamBuf object"
+ if not self._writableYN:
+ raise IOError, (9, "Can't write to a read only object")
+ for s in l:
+ self.write(s)
+
+ def seek(self, offset, where=0):
+ """A limited seek method. See class __doc__ for more details.
+ """
+ if self._closedYN:
+ raise ValueError, "I/O operation on closed _StreamBuf object"
+
+ tell = self._bufIO.tell()
+ beginBuf = self._currFoPos - tell
+ endBuf = self._lenBufIO + beginBuf - 1
+
+ # Offset from beginning?
+ if not where:
+ pass
+ # Offset from current position?
+ elif where == 1:
+ if _StreamBuf.VERSION == 1:
+ offset = self.__checkInt(offset)
+ offset = self._currFoPos + offset
+ # Offset from end?
+ elif where == 2:
+ if self._readableYN:
+ if offset < 0 and offset < _StreamBuf.__ABS_MAX_BUFIO_SIZE:
+ raise IOError, (22, "Invalid argument; can't determine %s "
+ "position due to unknown stream length" % offset)
+ # Could be ugly if, for example, a socket stream "never ends" ;)
+ while self.read(_StreamBuf.__MAX_BUFIO_SIZE):
+ pass
+ self._currFoPos = self._currFoPos + offset
+ self._bufIO.seek(offset, 2)
+ return
+ elif self._writableYN:
+ offset = endBuf + offset
+ else:
+ raise IOError, (22, "Invalid argument")
+ if self._writableYN and offset > endBuf:
+ offset = endBuf
+ #
+ # Offset reflects "from beginning of file" now.
+ #
+ if offset < 0:
+ raise IOError, (22, "Invalid argument")
+ delta = offset - self._currFoPos
+ # Before beginning of buffer -- can't do it sensibly -- data gone.
+ if offset < beginBuf:
+ raise IOError, (22, "Invalid argument; attempted seek before "
+ "beginning of buffer")
+ # After end of buffer.
+ elif offset > endBuf:
+ if self._readableYN:
+ while delta:
+ x = min(_StreamBuf.__MAX_BUFIO_SIZE, delta)
+ self.read(x)
+ delta = delta - x
+ # Within the buffer.
+ else:
+ self._bufIO.seek(tell + delta, 0)
+ if _StreamBuf.VERSION == 1:
+ self._currFoPos = self.__checkInt(self._currFoPos)
+ self._currFoPos = self._currFoPos + self._bufIO.tell() - tell
+
+ def tell(self):
+ """Return current position in the file-like object.
+ """
+ return self._currFoPos
+
+ def close(self):
+ """Flush the buffer.
+ NOTE: fileobject is NOT closed, just flushed. Mapping as closely as
+ possible to GzipFile.
+ """
+ self.flush()
+ self._closedYN = 1
+
+ def flush(self):
+ """Flush the buffer.
+ """
+ if self._closedYN:
+ raise ValueError, "I/O operation on closed _StreamBuf object"
+ if self._readableYN:
+ pass
+ if self._writableYN:
+ self.fo.write(self._refactorBufIO(1))
+ if _StreamBuf.VERSION == 1:
+ # may seem a bit redundant, but want to easily cut this
+ # stuff out someday.
+ try:
+ self.fo.flush()
+ except AttributeError:
+ pass
+ return
+ self.fo.flush()
+
+ def __repr__(self):
+ ret = ''
+ if self._closedYN:
+ ret = "<closed gzipstream._StreamBuf instance, mode '%s' at %s>" % \
+ (self.mode, id(self))
+ else:
+ ret = "<open gzipstream._StreamBuf instance, mode '%s' at %s>" % \
+ (self.mode, id(self))
+ return ret
+
+ # __private__
+
+ def __checkInt(self, i):
+ """Might be faster just to declare them longs.
+ Python versions 1.5.2 & 2.1.* ONLY!
+ """
+ if i > _StreamBuf.__INT_CHECK_SIZE and type(i) == IntType:
+ i = long(i)
+ return i
+
+ def __debugThread(self):
+ """XXX: Only used for debugging. Runs a thread that watches some
+ tell-tale warning flags that something bad is happening.
+ """
+ while not self._closedYN and not self.__mutexOnYN:
+ if self._lenBufIO != len(self._bufIO.getvalue()):
+ sys.stderr.write('XXX: ERROR! _lenBufIO != len(...): %s != %s\n'
+ % (self._lenBufIO, len(self._bufIO.getvalue())))
+ sys.stderr.write('XXX: %s\n' % repr(self))
+ if self._lenBufIO > _StreamBuf.__ABS_MAX_BUFIO_SIZE*2:
+ sys.stderr.write('XXX: ERROR! StringIO buffer WAY to big: %s\n'
+ % self._lenBufIO)
+ sys.stderr.write('XXX: %s\n' % repr(self))
+ time.sleep(1)
+
+#-------------------------------------------------------------------------------
diff --git a/projects/python-gzipstream/python-gzipstream.spec b/projects/python-gzipstream/python-gzipstream.spec
new file mode 100644
index 0000000..ae778da
--- /dev/null
+++ b/projects/python-gzipstream/python-gzipstream.spec
@@ -0,0 +1,79 @@
+%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+
+Summary: Streaming zlib (gzip) support for python
+Name: python-gzipstream
+Version: 1.4.0
+Release: 18%{?dist}
+Source0: gzipstream-%{version}.tar.gz
+License: PSF
+Group: Development/Libraries
+BuildRoot: %{_tmppath}/%{name}-buildroot
+BuildArch: noarch
+BuildRequires: python-devel
+Url: http://rhn.redhat.com
+
+
+%description
+A streaming gzip handler.
+gzipstream.GzipStream extends the functionality of the gzip.GzipFile class
+to allow the processing of streaming data.
+
+
+%prep
+%setup -q -n gzipstream-%{version}
+
+%build
+%{__python} setup.py build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+%{python_sitelib}/*
+
+%changelog
+* Tue Jun 02 2009 Dennis Gilmore <dgilmore(a)redhat.com> 1.4.0-18
+- bump release to 18 to ensure its highest nvr wise
+
+* Thu Feb 26 2009 Devan Goodwin <dgoodwin(a)redhat.com> 1.4.0-4
+- Rebuild for new rel-eng tools.
+
+* Tue Jan 27 2009 Miroslav Suchý <msuchy(a)redhat.com> 1.4.0-3
+- rename gzipstream.spec to python-gzipstream.spec
+
+* Fri Jan 23 2009 Dennis Gilmore <dennis(a)ausil.us> 1.4.0-17
+- BuildRequires python-devel
+- lots of spec file cleanups
+
+* Fri Aug 1 2008 Jan Pazdziora
+- change .spec not to use the version file
+
+* Wed May 21 2008 Jan Pazdziora - 1.4.0-15
+- rebuild in dist-cvs.
+
+* Thu Oct 14 2004 Todd Warner <taw(a)redhat.com> 1.4.0-4
+- bumped release. Fixed a garbage-collection issue.
+
+* Tue Jun 22 2004 Mihai Ibanescu <misa(a)redhat.com> 1.4.0-1
+- Rebuilding with distutils
+
+* Tue Aug 20 2002 Cristian Gafton <gafton(a)redhat.com>
+- figure out automatically what python version are we building for
+
+* Sun Mar 24 2002 Todd Warner <taw(a)redhat.com>
+- Just some v2.2 stuff commented out. (easier testing).
+
+* Sat Mar 23 2002 Todd Warner <taw(a)redhat.com>
+- PythonLib is /usr/lib/python1.5, NOT .../python1.5.2
+
+* Fri Mar 22 2002 Todd Warner <taw(a)redhat.com>
+- Only builds for Python v1.5.2 at the moment.
+- Made work with new build system.
+
+* Fri Jan 01 2002 Todd Warner <taw(a)redhat.com>
+- Initial rpm package
diff --git a/projects/python-gzipstream/setup.py b/projects/python-gzipstream/setup.py
new file mode 100644
index 0000000..0c4d947
--- /dev/null
+++ b/projects/python-gzipstream/setup.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+#
+#
+# $Id: setup.py,v 1.3 2004/10/15 01:53:29 taw Exp $
+
+from distutils.core import setup
+
+setup(name = "gzipstream",
+ version = "1.4.0",
+ description = "Streaming zlib (gzip) support for python",
+ long_description = """\
+A streaming gzip handler.
+gzipstream.GzipStream extends the functionality of the gzip.GzipFile class
+to allow the processing of streaming data.
+""",
+ author = 'Todd Warner',
+ author_email = 'taw(a)redhat.com',
+ url = 'http://rhn.redhat.com',
+ py_modules = ["gzipstream"],
+ license = "PSF",
+ )
diff --git a/projects/python-gzipstream/test/test-gzipstream-huge.py b/projects/python-gzipstream/test/test-gzipstream-huge.py
new file mode 100644
index 0000000..7bee4ce
--- /dev/null
+++ b/projects/python-gzipstream/test/test-gzipstream-huge.py
@@ -0,0 +1,49 @@
+#!/usr/bin/python -u
+""" test on huge file which tends to expose "interesting" behavior """
+import os
+import sys
+import time
+
+print "NOTE: intended to be run from the gzipstream directory in CVS"
+print
+
+from gzipstream import GzipStream
+
+INPUT = os.path.join(os.path.dirname(sys.argv[0]), 'huge-all-zeros.txt.gz')
+BUFSIZE = 1024*16
+
+t0 = time.time()
+
+print "WARNING: This test takes a while to complete as it works on a very"
+print " file. It will:"
+print " - G*un*zipStream %s and count chars" % repr(INPUT)
+print " - compare with a zcat|wc"
+print
+
+try:
+ # python 2.* only
+ class File(file):
+ seek = None
+ fin = File(INPUT, 'rb')
+ print "Opened file as file object with no seek for a 'socket-like' test."
+except:
+ print "Opened file as a normal file object."
+ fin = open(INPUT, 'rb')
+
+gzin = GzipStream(fin, 'r')
+
+sys.stderr.write('reading...\n')
+x = gzin.read(BUFSIZE)
+count = len(x)
+
+while x:
+ x = gzin.read(BUFSIZE)
+ count = count + len(x)
+
+print "GzipStream's char count:\n%s" % count
+
+print "'zcat <file> | wc -m' char count:"
+os.system('zcat %s | wc -m' % INPUT)
+print "They should match."
+
+print 'Elapsed:', (time.time() - t0)/60.0, 'mins'
diff --git a/projects/python-gzipstream/test/test-gzipstream-xml.py b/projects/python-gzipstream/test/test-gzipstream-xml.py
new file mode 100644
index 0000000..5943414
--- /dev/null
+++ b/projects/python-gzipstream/test/test-gzipstream-xml.py
@@ -0,0 +1,47 @@
+""" an inelegant test of how we work with gzipstream in a satellite-sync
+ like manner.
+"""
+
+import os
+import sys
+
+print "NOTE: intended to be run from the gzipstream directory in CVS"
+print
+
+import gzipstream
+from satellite_tools import connection
+
+INPUT = os.path.join(os.path.dirname(sys.argv[0]), "f.xml.gz")
+
+# append rhn/backend/satellite_tools
+sys.path.append('../../backend')
+
+from rhn import rpclib
+from xml.sax import saxutils, make_parser, _exceptions
+from xml.sax.handler import feature_namespaces
+
+class Foo(saxutils.DefaultHandler):
+ def startElement(self, tag, attrs):
+ print "startElement", tag
+
+ def characters(self, data):
+ pass
+
+ def endElement(self, tag):
+ print "endElement", tag
+
+
+f = open(INPUT)
+
+gz = gzipstream.GzipStream(f, "r")
+
+cs = connection.CompressedStream(gz)
+
+fi = rpclib.transports.File(cs)
+
+h = Foo()
+
+parser = make_parser(feature_namespaces)
+parser.setContentHandler(h)
+parser.setErrorHandler(h)
+parser.parse(fi)
13 years, 5 months
2 commits - java/code schema/spacewalk
by Tomas Lestach
java/code/src/com/redhat/rhn/common/db/datasource/xml/General_queries.xml | 14 -
java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml | 38 --
java/code/src/com/redhat/rhn/manager/task/TaskManager.java | 33 --
java/code/src/com/redhat/rhn/manager/task/test/TaskManagerTest.java | 56 ----
java/code/src/com/redhat/rhn/taskomatic/core/DaemonStateWriter.java | 116 --------
java/code/src/com/redhat/rhn/taskomatic/core/LoggingListener.java | 140 ----------
java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java | 1
java/code/src/com/redhat/rhn/taskomatic/core/TaskomaticConstants.java | 13
java/code/src/com/redhat/rhn/taskomatic/task/TaskHelper.java | 19 -
java/code/src/com/redhat/rhn/taskomatic/task/test/CleanCurrentAlertsTest.java | 8
schema/spacewalk/common/tables/rhnDaemonState.sql | 26 -
schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/003-rhnDaemonState.sql | 2
12 files changed, 2 insertions(+), 464 deletions(-)
New commits:
commit fa468fc01f6e4e9b2e918d1fd7998b35b62446a9
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Fri Nov 26 11:32:03 2010 +0100
drop unused rhnDaemonState table
diff --git a/schema/spacewalk/common/tables/rhnDaemonState.sql b/schema/spacewalk/common/tables/rhnDaemonState.sql
deleted file mode 100644
index b59c84b..0000000
--- a/schema/spacewalk/common/tables/rhnDaemonState.sql
+++ /dev/null
@@ -1,26 +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 TABLE rhnDaemonState
-(
- label VARCHAR2(64) NOT NULL
- CONSTRAINT rhn_daemonstate_label_pk PRIMARY KEY
- USING INDEX TABLESPACE [[64k_tbs]],
- last_poll DATE NOT NULL
-)
-ENABLE ROW MOVEMENT
-;
-
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/003-rhnDaemonState.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/003-rhnDaemonState.sql
new file mode 100644
index 0000000..0c47f33
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.2-to-spacewalk-schema-1.3/003-rhnDaemonState.sql
@@ -0,0 +1,2 @@
+DROP TABLE rhnDaemonState;
+
commit 24cfbd059725070188ab850c389efa67ea061913
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Fri Nov 26 11:11:20 2010 +0100
642285 - remove old TaskStatus related code
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/General_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/General_queries.xml
index 5552715..b73b9b6 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/General_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/General_queries.xml
@@ -309,20 +309,6 @@ ORDER BY KTZ.name
</query>
</write-mode>
-<write-mode name="remove_daemon_state">
- <query params="label">
- DELETE from rhnDaemonState
- WHERE label = :label
- </query>
-</write-mode>
-
-<write-mode name="add_daemon_state">
- <query params="label">
- INSERT into rhnDaemonState (label, last_poll)
- VALUES (:label, current_timestamp)
- </query>
-</write-mode>
-
<mode name="server_group_membership">
<query params="org_id, label">
SELECT max_members, current_members FROM rhnServerGroup sg, rhnServerGroupType sgt
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
index 5efdb13..e297fa2 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
@@ -558,44 +558,6 @@ ORDER BY next_action DESC
</query>
</mode>
-<mode name="find_task_stats">
- <query params="display_name">
- SELECT COUNT(LABEL) as stat_exists
- FROM rhnDaemonState
- WHERE LABEL = :display_name
- </query>
-</mode>
-
-<write-mode name="create_task_stats">
- <query params="display_name">
- INSERT INTO rhnDaemonState (LABEL, LAST_POLL)
- VALUES (:display_name, current_timestamp)
- </query>
-</write-mode>
-
-<write-mode name="update_task_stats">
- <query params="display_name">
- UPDATE rhnDaemonState
- SET LAST_POLL = current_timestamp
- WHERE LABEL = :display_name
- </query>
-</write-mode>
-
-<mode name="get_task_stats">
- <query params="label">
- SELECT LAST_POLL
- FROM rhnDaemonState
- WHERE label = :label
- </query>
-</mode>
-
-<mode name="get_current_time">
- <query params="">
- SELECT current_timestamp
- FROM dual
- </query>
-</mode>
-
<mode name="find_channel_in_task_queue">
<query params="cid">
SELECT task_data
diff --git a/java/code/src/com/redhat/rhn/manager/task/TaskManager.java b/java/code/src/com/redhat/rhn/manager/task/TaskManager.java
index d0cd7d8..75f7d98 100644
--- a/java/code/src/com/redhat/rhn/manager/task/TaskManager.java
+++ b/java/code/src/com/redhat/rhn/manager/task/TaskManager.java
@@ -22,7 +22,6 @@ import com.redhat.rhn.frontend.dto.PackageDto;
import com.redhat.rhn.taskomatic.task.TaskConstants;
import java.util.Collection;
-import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@@ -39,38 +38,6 @@ public class TaskManager {
}
/**
- * gets the last time a certain task was exectued
- * @param label the label of the task
- * @return the date
- */
- public static Date getTaskExecutionTime(String label) {
-
- SelectMode m = ModeFactory.getMode("Task_queries", "get_task_stats");
- Map in = new HashMap();
- in.put("label", label);
- DataResult<Map> list = m.execute(in);
-
- if (!list.isEmpty()) {
- return (Date) list.get(0).get("last_poll");
- }
- return null;
- }
-
-
- /**
- * Gets the current db time
- * @return the date
- */
- public static Object getCurrentDBTime() {
- SelectMode m = ModeFactory.getMode("Task_queries", "get_current_time");
- DataResult<Map> list = m.execute();
- if (!list.isEmpty()) {
- return list.get(0).get("current_timestamp");
- }
- return null;
- }
-
- /**
* Get the channel package list for a channel
* @param channel channel info
* @return the iterator
diff --git a/java/code/src/com/redhat/rhn/manager/task/test/TaskManagerTest.java b/java/code/src/com/redhat/rhn/manager/task/test/TaskManagerTest.java
deleted file mode 100644
index 2e69492..0000000
--- a/java/code/src/com/redhat/rhn/manager/task/test/TaskManagerTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Copyright (c) 2009--2010 Red Hat, Inc.
- *
- * This software is licensed to you under the GNU General Public License,
- * version 2 (GPLv2). There is NO WARRANTY for this software, express or
- * implied, including the implied warranties of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
- * along with this software; if not, see
- * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
- *
- * Red Hat trademarks are not licensed under GPLv2. No permission is
- * granted to use or replicate Red Hat trademarks that are incorporated
- * in this software or its documentation.
- */
-package com.redhat.rhn.manager.task.test;
-
-import com.redhat.rhn.common.db.datasource.ModeFactory;
-import com.redhat.rhn.common.db.datasource.WriteMode;
-import com.redhat.rhn.manager.task.TaskManager;
-import com.redhat.rhn.taskomatic.core.TaskomaticConstants;
-import com.redhat.rhn.testing.RhnBaseTestCase;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-
-public class TaskManagerTest extends RhnBaseTestCase {
-
-
-
-
- public void testGetTaskExecutionTime() throws Exception {
-
- String label = "errata_engine";
-
- if (TaskManager.getTaskExecutionTime(label) == null) {
- WriteMode statsQuery = ModeFactory.getWriteMode(TaskomaticConstants.MODE_NAME,
- TaskomaticConstants.DAEMON_QUERY_CREATE_STATS);
- Map params = new HashMap();
- params.put("display_name", label);
- statsQuery.executeUpdate(params);
- }
-
- Date date = TaskManager.getTaskExecutionTime(label);
- assertNotNull(date);
-
- }
-
-
- public void testGetCurrentDBTime() throws Exception {
- assertNotNull(TaskManager.getCurrentDBTime());
- }
-
-
-}
diff --git a/java/code/src/com/redhat/rhn/taskomatic/core/DaemonStateWriter.java b/java/code/src/com/redhat/rhn/taskomatic/core/DaemonStateWriter.java
deleted file mode 100644
index 3774cdb..0000000
--- a/java/code/src/com/redhat/rhn/taskomatic/core/DaemonStateWriter.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * Copyright (c) 2009--2010 Red Hat, Inc.
- *
- * This software is licensed to you under the GNU General Public License,
- * version 2 (GPLv2). There is NO WARRANTY for this software, express or
- * implied, including the implied warranties of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
- * along with this software; if not, see
- * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
- *
- * Red Hat trademarks are not licensed under GPLv2. No permission is
- * granted to use or replicate Red Hat trademarks that are incorporated
- * in this software or its documentation.
- */
-package com.redhat.rhn.taskomatic.core;
-
-import EDU.oswego.cs.dl.util.concurrent.Channel;
-
-import com.redhat.rhn.common.db.datasource.DataResult;
-import com.redhat.rhn.common.db.datasource.ModeFactory;
-import com.redhat.rhn.common.db.datasource.SelectMode;
-import com.redhat.rhn.common.db.datasource.WriteMode;
-import com.redhat.rhn.common.hibernate.HibernateFactory;
-
-import org.apache.log4j.Logger;
-import org.hibernate.Transaction;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Single-threads all writes to the RHNDAEMONSTATE table
- * to prevent locking due to table contention
- *
- * @version $Rev $
- */
-class DaemonStateWriter implements Runnable {
-
- private static final String LAST_TASK = "last_task_completed";
-
- private static Logger logger = Logger.getLogger(SchedulerKernel.class);
-
- private boolean stopped = false;
-
- private Channel stateQueue;
-
- public DaemonStateWriter(Channel queue) {
- this.stateQueue = queue;
- }
-
- /**
- * Sets the stopped flag
- * @param flag true to stop
- */
- public synchronized void isStopped(boolean flag) {
- this.stopped = flag;
- }
-
- /**
- * Returns current stop state
- * @return true if stopped, false if not
- */
- public synchronized boolean isStopped() {
- return this.stopped;
- }
-
- /**
- * {@inheritDoc}
- */
- public void run() {
- try {
- while (!isStopped()) {
- String name = (String) this.stateQueue.poll(500);
- if (name != null) {
- writeUpdate(name);
- writeUpdate(LAST_TASK);
- }
- }
- }
- catch (InterruptedException e) {
- logger.error(e.getMessage(), e);
- return;
- }
-
- }
-
- private void writeUpdate(String displayName) {
- Transaction txn = null;
- try {
- txn = HibernateFactory.getSession().beginTransaction();
- SelectMode mode = ModeFactory.getMode(TaskomaticConstants.MODE_NAME,
- TaskomaticConstants.DAEMON_QUERY_FIND_STATS);
- Map params = new HashMap();
- params.put("display_name", displayName);
- DataResult dr = mode.execute(params);
- Map row = (Map) dr.get(0);
- Long count = (Long) row.get("stat_exists");
- WriteMode statsQuery = null;
- if (count.intValue() < 1) {
- statsQuery = ModeFactory.getWriteMode(TaskomaticConstants.MODE_NAME,
- TaskomaticConstants.DAEMON_QUERY_CREATE_STATS);
- }
- else {
- statsQuery = ModeFactory.getWriteMode(TaskomaticConstants.MODE_NAME,
- TaskomaticConstants.DAEMON_QUERY_UPDATE_STATS);
- }
- statsQuery.executeUpdate(params);
- txn.commit();
- }
- catch (Throwable t) {
- txn.rollback();
- logger.error(t.getMessage(), t);
- }
- }
-
-}
diff --git a/java/code/src/com/redhat/rhn/taskomatic/core/LoggingListener.java b/java/code/src/com/redhat/rhn/taskomatic/core/LoggingListener.java
deleted file mode 100644
index 360b13e..0000000
--- a/java/code/src/com/redhat/rhn/taskomatic/core/LoggingListener.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/**
- * Copyright (c) 2009--2010 Red Hat, Inc.
- *
- * This software is licensed to you under the GNU General Public License,
- * version 2 (GPLv2). There is NO WARRANTY for this software, express or
- * implied, including the implied warranties of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
- * along with this software; if not, see
- * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
- *
- * Red Hat trademarks are not licensed under GPLv2. No permission is
- * granted to use or replicate Red Hat trademarks that are incorporated
- * in this software or its documentation.
- */
-package com.redhat.rhn.taskomatic.core;
-
-import EDU.oswego.cs.dl.util.concurrent.Channel;
-import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
-
-import org.apache.log4j.Logger;
-import org.apache.log4j.Priority;
-import org.quartz.JobExecutionContext;
-import org.quartz.Trigger;
-import org.quartz.TriggerListener;
-
-import java.lang.reflect.Field;
-
-/**
- * Quartz TriggerListener implementation which logs lifecycle events
- * for each executing Taskomatic task
- *
- * @version $Rev $
- */
-
-public class LoggingListener implements TriggerListener {
-
- private static final String NAME = "LoggingListener";
-
- private static Logger logger = Logger.getLogger(SchedulerKernel.class);
-
- private Channel msgs = new LinkedQueue();
-
- private DaemonStateWriter stateWriter = null;
-
- /**
- * Default constructor
- *
- */
- public LoggingListener() {
- stateWriter = new DaemonStateWriter(msgs);
- Thread t = new Thread(stateWriter, "Daemon State Writer");
- t.setDaemon(true);
- t.start();
- }
- /**
- * {@inheritDoc}
- */
- public String getName() {
- return NAME;
- }
-
- /**
- * {@inheritDoc}
- */
- public void triggerFired(Trigger trigger, JobExecutionContext ctx) {
- updateDB(ctx.getJobDetail().getJobClass());
- if (logger.isInfoEnabled()) {
- StringBuffer msg = new StringBuffer();
- msg.append(trigger.getJobGroup()).append(":");
- msg.append(trigger.getJobName());
- msg.append(" started");
- logger.info(msg.toString());
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean vetoJobExecution(Trigger arg0, JobExecutionContext arg1) {
- // TODO Auto-generated method stub
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public void triggerMisfired(Trigger trigger) {
- if (logger.isEnabledFor(Priority.ERROR)) {
- StringBuffer msg = new StringBuffer();
- msg.append(trigger.getJobGroup()).append(":");
- msg.append(trigger.getJobName());
- msg.append(" trigger misfired");
- logger.error(msg.toString());
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void triggerComplete(Trigger trigger, JobExecutionContext ctx, int code) {
- updateDB(ctx.getJobDetail().getJobClass());
- if (logger.isInfoEnabled()) {
- StringBuffer msg = new StringBuffer();
- msg.append(trigger.getJobGroup()).append(":");
- msg.append(trigger.getJobName());
- msg.append(" completed");
- logger.info(msg.toString());
- }
-
- }
-
- private void updateDB(Class jobClass) {
- Field displayNameField = null;
- try {
- displayNameField = jobClass.getDeclaredField(
- TaskomaticConstants.DISPLAY_NAME_CONST);
- }
- catch (NoSuchFieldException e) {
- logger.warn("Missing display name for " + jobClass.getName());
- return;
- }
-
- if (displayNameField != null) {
- try {
- String displayName = (String) displayNameField.get(null);
- this.msgs.put(displayName);
- }
- catch (Throwable t) {
- if (t instanceof InterruptedException) {
- return;
- }
- logger.error(t.getMessage(), t);
- }
-
- }
- else {
- logger.warn("Missing display name for " + jobClass.getName());
- }
- }
-}
diff --git a/java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java b/java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java
index b6f52c0..444e7fd 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java
@@ -122,7 +122,6 @@ public class SchedulerKernel {
// Setup TriggerListener chain
this.chainedTriggerListener = new ChainedListener();
this.chainedTriggerListener.addListener(new TaskEnvironmentListener());
- this.chainedTriggerListener.addListener(new LoggingListener());
try {
SchedulerKernel.scheduler.addTriggerListener(this.chainedTriggerListener);
diff --git a/java/code/src/com/redhat/rhn/taskomatic/core/TaskomaticConstants.java b/java/code/src/com/redhat/rhn/taskomatic/core/TaskomaticConstants.java
index b251653..fdcc871 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/core/TaskomaticConstants.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/core/TaskomaticConstants.java
@@ -14,17 +14,12 @@
*/
package com.redhat.rhn.taskomatic.core;
-import com.redhat.rhn.taskomatic.task.TaskConstants;
-
/**
* Various constants used by the Taskomatic daemon
* @version $Rev$
*/
public class TaskomaticConstants {
- // Quartz task group name
- public static final String TASK_GROUP = "Taskomatic Group";
-
// Various "command-line" parameters Taskomatic understands
public static final String CLI_DEBUG = "debug";
public static final String CLI_DAEMON = "daemon";
@@ -36,14 +31,6 @@ public class TaskomaticConstants {
public static final String CLI_DBUSER = "dbuser";
public static final String CLI_DBPASSWORD = "dbpassword";
- public static final String DISPLAY_NAME_CONST = "DISPLAY_NAME";
-
- public static final String MODE_NAME = TaskConstants.MODE_NAME;
- public static final String DAEMON_QUERY_FIND_STATS = "find_task_stats";
- public static final String DAEMON_QUERY_CREATE_STATS = "create_task_stats";
- public static final String DAEMON_QUERY_UPDATE_STATS = "update_task_stats";
-
-
private TaskomaticConstants() {
}
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/TaskHelper.java b/java/code/src/com/redhat/rhn/taskomatic/task/TaskHelper.java
index bafd00f..37c9349 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/TaskHelper.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/TaskHelper.java
@@ -18,7 +18,6 @@ import com.redhat.rhn.common.conf.Config;
import com.redhat.rhn.common.db.datasource.DataResult;
import com.redhat.rhn.common.db.datasource.ModeFactory;
import com.redhat.rhn.common.db.datasource.SelectMode;
-import com.redhat.rhn.common.db.datasource.WriteMode;
import com.redhat.rhn.common.localization.LocalizationService;
import com.redhat.rhn.common.messaging.Mail;
import com.redhat.rhn.common.messaging.SmtpMail;
@@ -51,24 +50,6 @@ public class TaskHelper {
}
/**
- * Logs the daemon state
- * @param label The label of the daeomon we're logging.
- */
- public static void logDaemonState(String label) {
- Map params = new HashMap();
- params.put("label", label);
-
- //Remove any entries from rhnDaemonState if they exist
- WriteMode m = ModeFactory.getWriteMode("General_queries",
- "remove_daemon_state");
- m.executeUpdate(params);
-
- //Add new entry
- m = ModeFactory.getWriteMode("General_queries", "add_daemon_state");
- m.executeUpdate(params);
- }
-
- /**
* Send an error email to the Satellite admin
* @param logger to log any errors to
* @param messageBody to send.
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/test/CleanCurrentAlertsTest.java b/java/code/src/com/redhat/rhn/taskomatic/task/test/CleanCurrentAlertsTest.java
index 360b233..cf12324 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/test/CleanCurrentAlertsTest.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/test/CleanCurrentAlertsTest.java
@@ -43,14 +43,6 @@ public class CleanCurrentAlertsTest extends RhnBaseTestCase {
int success = m.executeUpdate(params);
assertEquals(1, success);
- //remove from rhnDaemonState
- //This ensures there are no entries for clean_current_alerts there and should be
- //exactly one after our execute method runs
- m = ModeFactory.getWriteMode("General_queries", "remove_daemon_state");
- params = new HashMap();
- params.put("label", "clean_current_alerts");
- m.executeUpdate(params);
-
//Run CleanCurrentAlerts.execute()
CleanCurrentAlerts cca = new CleanCurrentAlerts();
cca.execute(null);
13 years, 5 months
java/code
by Tomas Lestach
java/code/webapp/WEB-INF/struts-config.xml | 5 -----
1 file changed, 5 deletions(-)
New commits:
commit 932d39953b6218080268c46136d6abe0324681ba
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Fri Nov 26 09:53:51 2010 +0100
removing unused SetItemSelected action
diff --git a/java/code/webapp/WEB-INF/struts-config.xml b/java/code/webapp/WEB-INF/struts-config.xml
index f34d203..7e21ad5 100644
--- a/java/code/webapp/WEB-INF/struts-config.xml
+++ b/java/code/webapp/WEB-INF/struts-config.xml
@@ -4032,11 +4032,6 @@
path="/WEB-INF/pages/systems/probes/details.jsp"/>
</action>
- <action path="/SetItemSelected"
- scope="request"
- type="com.redhat.rhn.frontend.action.rhnset.SetItemSelectionAction">
- </action>
-
<action path="/systems/details/probes/ProbeDelete"
name="probeDeleteForm"
scope="request"
13 years, 5 months
Changes to 'refs/tags/spacewalk-setup-jabberd-1.3.1-1'
by Milan Zazrivec
Tag 'spacewalk-setup-jabberd-1.3.1-1' created by Milan Zazrivec <mzazrivec(a)redhat.com> at 2010-11-25 16:49 +0000
Tagging package [spacewalk-setup-jabberd] version [1.3.1-1] in directory [spacewalk/spacewalk-setup-jabberd/].
Changes since spacewalk-backend-1.3.14-1:
Milan Zazrivec (2):
sm.xsl for jabberd ver. 2.2.11
Automatic commit of package [spacewalk-setup-jabberd] release [1.3.1-1].
---
rel-eng/packages/spacewalk-setup-jabberd | 2 -
spacewalk/spacewalk-setup-jabberd/share/jabberd/sm.xsl | 15 ++++++++++
spacewalk/spacewalk-setup-jabberd/spacewalk-setup-jabberd.spec | 5 ++-
3 files changed, 20 insertions(+), 2 deletions(-)
---
13 years, 5 months
rel-eng/packages spacewalk/spacewalk-setup-jabberd
by Milan Zazrivec
rel-eng/packages/spacewalk-setup-jabberd | 2 +-
spacewalk/spacewalk-setup-jabberd/spacewalk-setup-jabberd.spec | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 082c584f22b37c7dcc883ed591d7fb8e2a88c394
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Thu Nov 25 17:49:30 2010 +0100
Automatic commit of package [spacewalk-setup-jabberd] release [1.3.1-1].
diff --git a/rel-eng/packages/spacewalk-setup-jabberd b/rel-eng/packages/spacewalk-setup-jabberd
index bd46829..144b7d4 100644
--- a/rel-eng/packages/spacewalk-setup-jabberd
+++ b/rel-eng/packages/spacewalk-setup-jabberd
@@ -1 +1 @@
-1.2.2-1 spacewalk/spacewalk-setup-jabberd/
+1.3.1-1 spacewalk/spacewalk-setup-jabberd/
diff --git a/spacewalk/spacewalk-setup-jabberd/spacewalk-setup-jabberd.spec b/spacewalk/spacewalk-setup-jabberd/spacewalk-setup-jabberd.spec
index 1346f48..8fc0d06 100644
--- a/spacewalk/spacewalk-setup-jabberd/spacewalk-setup-jabberd.spec
+++ b/spacewalk/spacewalk-setup-jabberd/spacewalk-setup-jabberd.spec
@@ -1,5 +1,5 @@
Name: spacewalk-setup-jabberd
-Version: 1.3.0
+Version: 1.3.1
Release: 1%{?dist}
Summary: Tools to setup jabberd for Spacewalk
Group: Applications/System
@@ -58,6 +58,9 @@ rm -rf %{buildroot}
%dir %{_sysconfdir}/pki/spacewalk/jabberd
%changelog
+* Thu Nov 25 2010 Milan Zazrivec <mzazrivec(a)redhat.com> 1.3.1-1
+- sm.xsl for jabberd ver. 2.2.11
+
* Tue Nov 02 2010 Jan Pazdziora 1.2.2-1
- Update copyright years in the rest of the repo.
13 years, 5 months
spacewalk/spacewalk-setup-jabberd
by Milan Zazrivec
spacewalk/spacewalk-setup-jabberd/share/jabberd/sm.xsl | 15 +++++++++++++++
1 file changed, 15 insertions(+)
New commits:
commit b3ebafe141ceb38733adbcbfeb7ae6295d266120
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Thu Nov 25 17:46:50 2010 +0100
sm.xsl for jabberd ver. 2.2.11
New XSL template to make Spacewalk / osa-dispatcher work with jabberd
version 2.2.11:
* sm needs to use the same database backend as c2s
* we need to set /sm/local/id properly
diff --git a/spacewalk/spacewalk-setup-jabberd/share/jabberd/sm.xsl b/spacewalk/spacewalk-setup-jabberd/share/jabberd/sm.xsl
index 83ce864..2e1ded2 100644
--- a/spacewalk/spacewalk-setup-jabberd/share/jabberd/sm.xsl
+++ b/spacewalk/spacewalk-setup-jabberd/share/jabberd/sm.xsl
@@ -14,4 +14,19 @@
</xsl:copy>
</xsl:template>
+<xsl:template match="/sm/local[ not (id = '@hostname@') ]">
+ <xsl:copy>
+ <xsl:text>
+ </xsl:text>
+ <id>@hostname@</id>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="/sm/storage/driver">
+ <xsl:copy>
+ <xsl:text>db</xsl:text>
+ </xsl:copy>
+</xsl:template>
+
</xsl:stylesheet>
13 years, 5 months
Changes to 'refs/tags/spacewalk-backend-1.3.14-1'
by Lukas Zapletal
Tag 'spacewalk-backend-1.3.14-1' created by Lukas Zapletal <lzap+git(a)redhat.com> at 2010-11-25 16:09 +0000
Tagging package [spacewalk-backend] version [1.3.14-1] in directory [backend/].
Changes since spacewalk-branding-1.3.1-1:
Lukas Zapletal (2):
Fixing missing method parameter in rhn_config_management
Automatic commit of package [spacewalk-backend] release [1.3.14-1].
---
backend/server/handlers/config_mgmt/rhn_config_management.py | 28 +++++------
backend/spacewalk-backend.spec | 8 ++-
rel-eng/packages/spacewalk-backend | 2
3 files changed, 22 insertions(+), 16 deletions(-)
---
13 years, 5 months