2 commits - backend/server client/rhel
by Miroslav Suchý
backend/server/rhnVirtualization.py | 5 +----
client/rhel/rhn-client-tools/src/up2date_client/hardware.py | 7 ++++++-
2 files changed, 7 insertions(+), 5 deletions(-)
New commits:
commit ac5fcb7a2182101aaccb9b4bdad5f817056a2bb0
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Feb 1 16:51:11 2010 +0100
Revert "543509 - do not fail if machine has not uuid set (like qemu)"
This reverts commit 7cdd2dd93f7fe05da6aab3e8b104bb3aa0d23801.
It is wrong to fix this issue in server. It should be fixed in client
(previous commit) by not sending such value at all.
diff --git a/backend/server/rhnVirtualization.py b/backend/server/rhnVirtualization.py
index 1927e83..c3e95a1 100644
--- a/backend/server/rhnVirtualization.py
+++ b/backend/server/rhnVirtualization.py
@@ -752,10 +752,7 @@ class VirtualizationEventHandler:
if properties.has_key(PropertyType.UUID):
uuid = properties[PropertyType.UUID]
if uuid:
- if uuid == 'Not Settable':
- uuid_as_number = 0
- else:
- uuid_as_number = string.atol(uuid, 16)
+ uuid_as_number = string.atol(uuid, 16)
if uuid_as_number == 0:
# If the UUID is a bunch of null bytes, we will convert it
commit aba5721839f341dfabcf27ebe01e22c739ceb9ad
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Feb 1 16:50:06 2010 +0100
543509 - do not send string "Not Settable" or "Not Present" when guest have no UUID"
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/hardware.py b/client/rhel/rhn-client-tools/src/up2date_client/hardware.py
index e5f045d..f55f48a 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/hardware.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/hardware.py
@@ -163,7 +163,12 @@ def dmi_system_uuid():
""" Return UUID from dmidecode system information.
If this value could not be fetch, returns empty string.
"""
- return get_dmi_data('/dmidecode/SystemInfo/SystemUUID')
+ # if guest was created manualy it can have empty UUID, in this
+ # case dmidecode set attribute unavailable to 1
+ uuid = get_dmi_data("/dmidecode/SystemInfo/SystemUUID[not(@unavailable='1')]")
+ if uuid = '':
+ uuid = 0
+ return uuid
# read_hal()
#
14 years, 2 months
Changes to 'refs/tags/spacewalk-web-0.8.11-1'
by Jan Pazdziora
Tag 'spacewalk-web-0.8.11-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2010-02-01 15:31 +0000
Tagging package [spacewalk-web] version [0.8.11-1] in directory [web/].
Changes since spacewalk-monitoring-selinux-0.8.3-1:
Jan Pazdziora (37):
recent-errata.pxt is not usable due to empty rhnProductChannel table; removing as dead code.
Removal of recent-errata.pxt made Sniglets::RSS unused, removing.
Removal of Sniglets::RSS made rss_recent_errata not needed, removing.
Removal of Sniglets::RSS made affected_product_lines not needed, removing.
492161 - web/html/errata is not supported in Spacewalk/Satellite.
Removal of web/html/errata made public-errata-list-vs-details and public_errata_list_vs_details unused, removing.
Removal of public_errata_list_vs_details made errata_in_db not called, removing.
The other errata_in_db does not seem to be used either.
Removal of public_errata_list_vs_details made /errata_hidden/login.pxi not used, removing.
Removal of public_errata_list_vs_details made /errata_hidden/details.pxi not used, removing.
Removal of public_errata_list_vs_details made errata_not_found.pxt not used, removing.
Removal of public_errata_list_vs_details made /errata_hidden/list.pxi not used, removing.
Removal of /errata_hidden/details.pxi made public-errata-details and thus public_errata_details unused, removing.
Removal of /errata_hidden/details.pxi made public-errata-affected-products and thus public_errata_affected_products unused, removing.
Removal of /errata_hidden/details.pxi made public-errata-cves and thus public_errata_cves unused, removing.
Removal of /errata_hidden/list.pxi made public-errata-product-name and public_errata_product_name unused, removing.
Removal of /errata_hidden/list.pxi made public-errata-filter and public_errata_filter unused, removing.
Removal of /errata_hidden/list.pxi made public-errata-filter-type-url and public_errata_filter_type_url unused, removing.
Removal of /errata_hidden/list.pxi made public-errata-list and public_errata_list unused, removing.
Removal of public_errata_product_name made name_by_label unused, removing.
Removal of public_errata_list made errata_list_by_product unused, removing.
web/html/cve not used, access to it just shows the pxt source, removing.
Removal of web/html/cve made public-cve-list and thus public_cve_list unused, removing.
Removal of public_cve_list made product_list.pxi unused, removing.
Removal of public_cve_list made cve_details.pxi unused, removing.
Removal of public_cve_list made cve_not_found.pxt unused, removing.
Removal of public_cve_list made file_not_found.pxt unused, removing.
Previous removals made Sniglets::PublicErrata not called, removing.
Previous removals made public-secure-links-if-logged-in and secure_links_if_logged_in unused, removing.
Previous removal made rh_template.pxt and thus the whole web/html/errata_hidden unused, removing.
Removal of Sniglets::PublicErrata::cve_in_db made find_by_cve unused, removing.
Removal of Sniglets::PublicErrata::public_errata_product_list made products_by_line unused, removing.
Removal of Sniglets::PublicErrata::render_file_entry made rhn_download_url unused, removing.
Removal of Sniglets::PublicErrata::updated_packages made RHN::DB::Errata::is_protected unused, removing.
Removal of Sniglets::PublicErrata::updated_packages made RHN::DB::Errata::files unused, removing.
Removal of rh_template.pxt made public_errata.xml unused, removing.
Automatic commit of package [spacewalk-web] release [0.8.11-1].
Michael Mraka (2):
removed dead code; no more python 1.5
removed dead code; no more python 1.5...
---
backend/common/rhnLib.py | 8
backend/server/rhnChannel.py | 5
client/tools/rhnpush/rhnpush_config.py | 17
rel-eng/packages/spacewalk-web | 2
web/html/cve | 56 -
web/html/cve_not_found.pxt | 85 --
web/html/errata | 53 -
web/html/errata_hidden/.htaccess | 8
web/html/errata_hidden/cve_details.pxi | 30
web/html/errata_hidden/details.pxi | 137 ---
web/html/errata_hidden/list.pxi | 80 --
web/html/errata_hidden/login.pxi | 90 --
web/html/errata_hidden/product_list.pxi | 26
web/html/errata_hidden/rh_template.pxt | 26
web/html/errata_not_found.pxt | 85 --
web/html/file_not_found.pxt | 64 -
web/html/nav/public_errata.xml | 10
web/html/rpc/.htaccess | 10
web/html/rpc/recent-errata.pxt | 1
web/modules/rhn/RHN/DB/Errata.pm | 293 --------
web/modules/rhn/RHN/DB/Product.pm | 60 -
web/modules/sniglets/Sniglets/Downloads.pm | 8
web/modules/sniglets/Sniglets/Errata.pm | 13
web/modules/sniglets/Sniglets/PublicErrata.pm | 919 --------------------------
web/modules/sniglets/Sniglets/RSS.pm | 83 --
web/modules/sniglets/Sniglets/Users.pm | 21
web/spacewalk-web.spec | 7
27 files changed, 10 insertions(+), 2187 deletions(-)
---
14 years, 2 months
rel-eng/packages web/spacewalk-web.spec
by Jan Pazdziora
rel-eng/packages/spacewalk-web | 2 +-
web/spacewalk-web.spec | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
New commits:
commit 2b06d9ee39c75e2da8bc4f657f331e95f527e825
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 16:31:11 2010 +0100
Automatic commit of package [spacewalk-web] release [0.8.11-1].
diff --git a/rel-eng/packages/spacewalk-web b/rel-eng/packages/spacewalk-web
index 65924b9..4e26fe9 100644
--- a/rel-eng/packages/spacewalk-web
+++ b/rel-eng/packages/spacewalk-web
@@ -1 +1 @@
-0.8.10-1 web/
+0.8.11-1 web/
diff --git a/web/spacewalk-web.spec b/web/spacewalk-web.spec
index ace8270..baa9841 100644
--- a/web/spacewalk-web.spec
+++ b/web/spacewalk-web.spec
@@ -2,7 +2,7 @@ Name: spacewalk-web
Summary: Spacewalk Web site packages
Group: Applications/Internet
License: GPLv2
-Version: 0.8.10
+Version: 0.8.11
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -269,6 +269,11 @@ rm -rf $RPM_BUILD_ROOT
# $Id$
%changelog
+* Mon Feb 01 2010 Jan Pazdziora 0.8.11-1
+- Removed RSS unused code.
+- 492161 - removed web/html/errata.
+- Removed a lot of code made unused by above removals.
+
* Fri Jan 29 2010 Miroslav Suchý <msuchy(a)redhat.com> 0.8.10-1
- No XMLRPC/SOAP processing in the web/Perl stack,
removing. (jpazdziora(a)redhat.com)
14 years, 2 months
web/html
by Jan Pazdziora
web/html/nav/public_errata.xml | 10 ----------
1 file changed, 10 deletions(-)
New commits:
commit 55246dcdb1d83aa183531c139e728a7ffe304beb
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 16:24:12 2010 +0100
Removal of rh_template.pxt made public_errata.xml unused, removing.
diff --git a/web/html/nav/public_errata.xml b/web/html/nav/public_errata.xml
deleted file mode 100644
index fe977f1..0000000
--- a/web/html/nav/public_errata.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf8"?>
-<rhn-navi-tree xmlns:xi="http://www.w3.org/2001/XInclude" label="sitenav" title-depth="0">
- <rhn-tab name="Errata" url="/errata/">
-<rhn-tab-directory>/errata/</rhn-tab-directory>
-</rhn-tab>
-<rhn-tab name="Sign In" url="/index.pxt" acl="not user_authenticated()" active-image="tab-sign_in-selected.gif" inactive-image="tab-sign_in.gif">
- </rhn-tab>
- <rhn-tab name="About" url="/help/about.pxt" active-image="tab-about_rhn-selected.gif" inactive-image="tab-about_rhn.gif" >
- </rhn-tab>
-</rhn-navi-tree>
14 years, 2 months
5 commits - web/modules
by Jan Pazdziora
web/modules/rhn/RHN/DB/Errata.pm | 155 -----------------------------
web/modules/rhn/RHN/DB/Product.pm | 39 -------
web/modules/sniglets/Sniglets/Downloads.pm | 8 -
3 files changed, 202 deletions(-)
New commits:
commit c4a2d2ac5ba938aeef7dfab4b4ca661c7ac2eb99
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 16:19:21 2010 +0100
Removal of Sniglets::PublicErrata::updated_packages made RHN::DB::Errata::files unused, removing.
diff --git a/web/modules/rhn/RHN/DB/Errata.pm b/web/modules/rhn/RHN/DB/Errata.pm
index 24b959e..4cbb35e 100644
--- a/web/modules/rhn/RHN/DB/Errata.pm
+++ b/web/modules/rhn/RHN/DB/Errata.pm
@@ -101,103 +101,6 @@ EOQ
}
-# returns all the files associated with an errata,
-# plus xtra info (like per-file obsoletion by other errata ...)
-# NOTE: gotta figure out the obsoletion of the srpm's based from the binary ones (in perl)...
-sub files {
- my $self = shift;
-
- die "not a red hat errata!" unless not $self->org_id;
-
- my $dbh = RHN::DB->connect;
-
- my $query;
- my $sth;
-
- $query = <<EOQ;
-SELECT DISTINCT
- EF.id AS ID,
- Csum.checksum AS MD5SUM,
- EF.filename AS FILENAME,
- EFP.package_id AS PACKAGE_ID,
- P1.path AS RHN_PACKAGE_PATH,
- PA.name AS PACKAGE_ARCH,
- PS1.source_rpm_id AS PACKAGE_SOURCE_RPM_ID,
- PS2.path AS RHN_PACKAGE_SOURCE_PATH,
- EFPS.package_id AS PACKAGE_SOURCE_ID,
- PS2.source_rpm_id AS PACKAGE_SOURCE_SOURCE_RPM_ID,
- EFT.label AS FILE_TYPE,
- CA.name AS CHANNEL_ARCH_NAME,
- CA.label AS CHANNEL_ARCH_LABEL,
- SA.name AS SERVER_ARCH_NAME,
- SA.label AS SERVER_ARCH_LABEL,
- Prod.name AS PRODUCT,
- (
-SELECT MAX(E.advisory_name)
- FROM rhnErrata E,
- rhnErrataPackage EP,
- rhnChannelErrata CE,
- rhnChannelNewestPackage CNP,
- rhnPackage P
- WHERE P.id = EFP.package_id
- AND CNP.channel_id = EFC.channel_id
- AND CNP.name_id = P.name_id
- AND CNP.package_arch_id = P.package_arch_id
- AND CNP.package_id != P.id
- AND CNP.channel_id = CE.channel_id
- AND CE.errata_id = EP.errata_id
- AND EP.package_id = CNP.package_id
- AND EP.errata_id = E.id
- AND E.org_id IS NULL
- ) AS PACKAGE_OUTDATED_BY
- FROM rhnPackageSource PS2,
- rhnPackageSource PS1,
- rhnPackageArch PA,
- rhnPackage P1,
- rhnErrataFilePackageSource EFPS,
- rhnErrataFilePackage EFP,
- rhnProduct Prod,
- rhnProductChannel PC,
- rhnServerArch SA,
- rhnServerChannelArchCompat SCAC,
- rhnChannelArch CA,
- rhnChannel C,
- rhnErrataFileChannel EFC,
- rhnErrataFileType EFT,
- rhnErrataFile EF,
- rhnChecksum Csum
- WHERE EF.errata_id = ?
- AND EF.type = EFT.id
- AND EF.id = EFC.errata_file_id (+)
- AND EFC.channel_id = PC.channel_id (+)
- AND EFC.channel_id = C.id (+)
- AND C.channel_arch_id = CA.id (+)
- AND CA.id = SCAC.channel_arch_id (+)
- AND SCAC.server_arch_id = SA.id (+)
- AND PC.product_id = Prod.id (+)
- AND EF.id = EFP.errata_file_id (+)
- AND EF.id = EFPS.errata_file_id (+)
- AND EFP.package_id = P1.id (+)
- AND P1.source_rpm_id = PS1.source_rpm_id (+)
- AND P1.package_arch_id = PA.id (+)
- AND EFPS.package_id = PS2.id (+)
- AND EF.checksum_id = Csum.id
-ORDER BY UPPER(Prod.name), UPPER(PA.name), UPPER(EF.filename)
-EOQ
-
- $sth = $dbh->prepare($query);
- $sth->execute($self->id);
-
- my @ret;
-
- while (my $row = $sth->fetchrow_hashref) {
- push @ret, $row;
- }
- $sth->finish;
-
- return @ret;
-}
-
sub related_cves {
my $self_or_id = shift;
my $id;
commit 43c49b08a67fcd625af6792aae035d607d424d39
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 16:16:52 2010 +0100
Removal of Sniglets::PublicErrata::updated_packages made RHN::DB::Errata::is_protected unused, removing.
diff --git a/web/modules/rhn/RHN/DB/Errata.pm b/web/modules/rhn/RHN/DB/Errata.pm
index 567cd9a..24b959e 100644
--- a/web/modules/rhn/RHN/DB/Errata.pm
+++ b/web/modules/rhn/RHN/DB/Errata.pm
@@ -276,37 +276,6 @@ EOQ
return 1;
}
-# protected means is a red hat errata and has private packages.
-sub is_protected {
- my $self = shift;
-
- my $dbh = RHN::DB->connect;
-
- my $query;
- my $sth;
-
- $query = <<EOQ;
-SELECT 1
- FROM rhnPrivateChannelFamily PCF, rhnChannelFamilyMembers CFM, rhnChannelErrata CE
- WHERE CE.errata_id = ?
- AND CE.channel_id = CFM.channel_id
- AND CFM.channel_family_id = PCF.channel_family_id
- AND ROWNUM = 1
-EOQ
-
- $sth = $dbh->prepare($query);
- $sth->execute($self->id);
-
- my $has_priv_perms;
-
- ($has_priv_perms) = $sth->fetchrow;
- $sth->finish;
-
- return if (!$has_priv_perms);
-
- return (defined $self->org_id ? undef : 1);
-}
-
sub lookup {
my $class = shift;
my %params = validate(@_, {id => 0, advisory_name => 0, transaction => 0});
commit a573928e35699848c6e8c7052fc4ad3785a8bd07
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 16:14:59 2010 +0100
Removal of Sniglets::PublicErrata::render_file_entry made rhn_download_url unused, removing.
diff --git a/web/modules/sniglets/Sniglets/Downloads.pm b/web/modules/sniglets/Sniglets/Downloads.pm
index 1624a61..9c7c00a 100644
--- a/web/modules/sniglets/Sniglets/Downloads.pm
+++ b/web/modules/sniglets/Sniglets/Downloads.pm
@@ -34,14 +34,6 @@ sub register_tags {
$pxt->register_tag('rhn-ftp-download', \&ftp_download, 4);
}
-# non-tag access to RHN download links
-sub rhn_download_url {
- my $class = shift;
- my %params = validate(@_, { pxt => 1, path => 1, label => 1, location => { default => "local" }});
-
- return ftp_download($params{pxt}, (-location => $params{location}, -path => $params{path}, __block__ => $params{label}));
-}
-
sub ftp_download {
my $pxt = shift;
my %params = validate(@_, { path => 1, location => { default => "local" },
commit dd4023391ca89c38abc654a131772e98cb16d843
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 16:13:31 2010 +0100
Removal of Sniglets::PublicErrata::public_errata_product_list made products_by_line unused, removing.
diff --git a/web/modules/rhn/RHN/DB/Product.pm b/web/modules/rhn/RHN/DB/Product.pm
index 20f1954..8f77931 100644
--- a/web/modules/rhn/RHN/DB/Product.pm
+++ b/web/modules/rhn/RHN/DB/Product.pm
@@ -110,43 +110,4 @@ EOQ
return $name;
}
-sub products_by_line {
- my $class = shift;
- my $line_label = shift;
- my $order = shift;
-
- die "no line label" unless $line_label;
-
- my $order_by_str = '';
-
- if ($order and (lc $order eq 'desc')) {
- $order_by_str = 'DESC';
- }
-
- my $dbh = RHN::DB->connect;
- my $query;
- my $sth;
- $query = <<EOQ;
-SELECT DISTINCT P.id, P.label, P.name,
- (SELECT MIN (rhn_channel.channel_priority(PC.channel_id))
- FROM rhnProductChannel PC
- WHERE P.id = PC.product_id) as priority
- FROM rhnProduct P,
- rhnProductLine PL
- WHERE PL.label = :product_line_label
- AND PL.id = P.product_line_id
-ORDER BY priority ASC, UPPER(P.name) $order_by_str
-EOQ
-
- $sth = $dbh->prepare($query);
- $sth->execute_h(product_line_label => $line_label);
-
- my @ret;
- while(my $row = $sth->fetchrow_hashref) {
- push @ret, $row;
- }
-
- return @ret;
-}
-
1;
commit 02880376fd49d4b6a5c370abdce0b735ee93f114
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 16:12:38 2010 +0100
Removal of Sniglets::PublicErrata::cve_in_db made find_by_cve unused, removing.
diff --git a/web/modules/rhn/RHN/DB/Errata.pm b/web/modules/rhn/RHN/DB/Errata.pm
index 800a3ce..567cd9a 100644
--- a/web/modules/rhn/RHN/DB/Errata.pm
+++ b/web/modules/rhn/RHN/DB/Errata.pm
@@ -769,33 +769,6 @@ EOQ
}
-# Returns a list of errata for a given CVE
-sub find_by_cve {
- my $class = shift;
- my $cve = shift;
-
- my $query = <<EOQ;
-SELECT product, advisory
- FROM rhnErrata e, rhnCVE c, rhnErrataCVE ec
- WHERE c.name LIKE ? AND
- c.id = ec.cve_id AND
- ec.errata_id = e.id
-ORDER BY product ASC
-EOQ
-
- my $dbh = RHN::DB->connect;
- my $sth = $dbh->prepare($query);
-
- #$sth->bind_param( 1, $cve );
- $sth->execute("%" . $cve);
- my @ret;
- while (my ($prod, $adv) = $sth->fetchrow ) {
- push @ret, [$prod, $adv];
- }
-
- return @ret;
-}
-
sub find_by_advisory {
my $class = shift;
my %params = @_;
14 years, 2 months
9 commits - web/html web/modules
by Jan Pazdziora
web/html/cve | 56 ---
web/html/cve_not_found.pxt | 85 ----
web/html/errata_hidden/.htaccess | 8
web/html/errata_hidden/cve_details.pxi | 30 -
web/html/errata_hidden/product_list.pxi | 26 -
web/html/errata_hidden/rh_template.pxt | 26 -
web/html/file_not_found.pxt | 64 ---
web/modules/sniglets/Sniglets/PublicErrata.pm | 461 --------------------------
web/modules/sniglets/Sniglets/Users.pm | 21 -
9 files changed, 777 deletions(-)
New commits:
commit 27bc816b4e01081d1a05baa46383da678f02125a
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 15:14:37 2010 +0100
Previous removal made rh_template.pxt and thus the whole web/html/errata_hidden unused, removing.
diff --git a/web/html/errata_hidden/.htaccess b/web/html/errata_hidden/.htaccess
deleted file mode 100644
index a1f3909..0000000
--- a/web/html/errata_hidden/.htaccess
+++ /dev/null
@@ -1,8 +0,0 @@
-AuthType Basic
-AuthName "RHN Org Admin Area"
-
-PerlModule PXT::ApacheHandler
-PerlModule PXT::ApacheAuth
-PerlAuthenHandler PXT::ApacheAuth
-require no-access
-
diff --git a/web/html/errata_hidden/rh_template.pxt b/web/html/errata_hidden/rh_template.pxt
deleted file mode 100644
index bcc9dcd..0000000
--- a/web/html/errata_hidden/rh_template.pxt
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf8"?>
-<pxt-passthrough>
-
-<pxt-use class="Sniglets::Navi" />
-<pxt-use class="Sniglets::HTML" />
-<pxt-use class="Grail::Frame" />
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <title>rhn.redhat.com | Red Hat Support</title>
- <pxt-include-late file="/templates/header.pxt" />
-
- <body>
-
- <div id="wrap">
-
- <rhn-navi-nav depth="0" style="topnav" file="/nav/public_errata.xml"/>
-
- <grail-canvas mode="main" />
-
- <pxt-include-late file="/templates/footer.pxt" />
-
- </div>
-
-</body>
-</html>
-</pxt-passthrough>
commit 620ac77cc0be00386f6ff0325c35261d6f84cb45
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 15:13:16 2010 +0100
Previous removals made public-secure-links-if-logged-in and secure_links_if_logged_in unused, removing.
diff --git a/web/modules/sniglets/Sniglets/Users.pm b/web/modules/sniglets/Sniglets/Users.pm
index 5484a11..0cc1119 100644
--- a/web/modules/sniglets/Sniglets/Users.pm
+++ b/web/modules/sniglets/Sniglets/Users.pm
@@ -51,8 +51,6 @@ sub register_tags {
my $class = shift;
my $pxt = shift;
- $pxt->register_tag('public-secure-links-if-logged-in' => \&secure_links_if_logged_in, 101);
-
$pxt->register_tag('rhn-login-form', \&rhn_login_form);
$pxt->register_tag('rhn-require' => \&rhn_require, -1000);
@@ -71,25 +69,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:user_prefs_edit_cb' => \&user_prefs_edit_cb);
}
-# secures *all* intraserver links and all links to specified exterior servers
-sub secure_links_if_logged_in {
- my $pxt = shift;
- my %params = @_;
-
- return $params{__block__} unless $pxt->user;
-
- # intra server ones...
- #$params{__block__} =~ s/href="(http:\/\/.*?)"/'href="' . $pxt->derelative_url($1, 'https') . '"'/egism;
-
- # inter server ones
- foreach my $server_str (split /[|]/, $params{servers}) {
- $params{__block__} =~ s{http://($server_str)}{https://$1}gism;
- }
-
- return $params{__block__};
-}
-
-
commit 2481f569467d3a25f81cda3c97993f56ef63c108
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 15:09:16 2010 +0100
Previous removals made Sniglets::PublicErrata not called, removing.
diff --git a/web/modules/sniglets/Sniglets/PublicErrata.pm b/web/modules/sniglets/Sniglets/PublicErrata.pm
deleted file mode 100644
index ccda8d7..0000000
--- a/web/modules/sniglets/Sniglets/PublicErrata.pm
+++ /dev/null
@@ -1,433 +0,0 @@
-#
-# Copyright (c) 2008--2009 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.
-#
-
-use strict;
-
-package Sniglets::PublicErrata;
-
-use Data::Dumper;
-use File::Spec;
-use Params::Validate qw/validate/;
-use Time::HiRes;
-
-use PXT::Utils;
-use PXT::HTML;
-
-use RHN::Access;
-use RHN::Errata;
-use RHN::DB::Errata;
-use RHN::Exception;
-use RHN::Product;
-
-use Sniglets::Downloads;
-
-
-sub register_tags {
- my $class = shift;
- my $pxt = shift;
-
- # for www.redhat.com'ish public errata display
- $pxt->register_tag('public-errata-product-list' => \&public_errata_product_list);
- $pxt->register_tag('public-errata-type' => \&public_errata_type);
- $pxt->register_tag('public-cve-details' => \&public_cve_details);
- $pxt->register_tag('public-cve-heading' => \&public_cve_heading);
-}
-
-
-my %e_icons = ('Security Advisory' => { image => '/img/rhn-icon-security.gif',
- white => '/img/wrh-security.gif',
- grey => '/img/wrh-security.gif',
- big => '/img/rhn-icon-security.gif',
- alt => 'Security Advisory' },
- 'Enhancement Advisory' => { image => '/img/rhn-icon-enhancement.gif',
- white => "/img/wrh_feature-white.gif",
- grey => "/img/wrh_feature-grey.gif",
- big => '/img/rhn-icon-enhancement.gif',
- alt => "Enhancement Advisory" },
- 'Product Enhancement Advisory' => { image => '/img/rhn-icon-enhancement.gif',
- white => "/img/wrh-product.gif",
- grey => "/img/wrh-product.gif",
- big => '/img/rhn-icon-enhancement.gif',
- alt => "Enhancement Advisory" },
- 'Bug Fix Advisory' => { image => '/img/rhn-icon-bug.gif',
- white => "/img/wrh-bug.gif",
- grey => "/img/wrh-bug.gif",
- big => '/img/rhn-icon-bug.gif',
- alt => "Bug Fix Advisory" } );
-
-
-my %errata_types = (bug_fixes => ["Bug Fixes", "Bug Fix Advisory"],
- security => ["Security", "Security Advisory"],
- enhancements => ["Enhancements", "Product Enhancement Advisory"]);
-
-my %errata_types_reverse = ('Bug Fix Advisory' => 'bug_fix', 'Security Advisory' => 'security', 'Product Enhancement Advisory' => 'enhancement');
-
-
-# labeling errata lists...
-sub public_errata_type {
- my $pxt = shift;
- my $path_info = $pxt->path_info;
-
- if ($path_info) {
-
- if ($path_info =~ m/security/) {
- return 'Security';
- }
- elsif ($path_info =~ m/bugfixes/) {
- return 'Bug Fix';
- }
- elsif ($path_info =~ m/updates/) {
- return 'Product Enhancement';
- }
- }
-
- return "General";
-}
-
-# looks to see if cve exists in db.
-sub cve_in_db {
- my $path_info = shift;
- $path_info =~ m/\/(CAN|CVE)(.*?)\.html/;
- # only care about the second part
- my $type = $2;
- my $errata = RHN::Errata->find_by_cve($type);
-
- return $errata;
-}
-
-sub public_errata_product_list {
- my $pxt = shift;
- my %params = @_;
-
- die "no product line specified!" unless $params{product_line};
-
- my @products = RHN::Product->products_by_line($params{product_line}, $params{order});
-
- my $ret = '';
- foreach my $product (@products) {
- $ret .= "<li>" . PXT::HTML->link("/errata/$product->{LABEL}-errata.html", $product->{NAME}) . "</li>\n";
- }
-
- return $ret;
-}
-
-
-# messy little function that decides what html to render the filename link as
-sub render_file_entry {
- my $pxt = shift;
- my %params = validate(@_, { -file => 1,
- -errata_is_protected => 1 ,
- -paid_user => 1} );
-
- my $file = $params{-file};
- my $errata_is_protected = $params{-errata_is_protected};
- my $paid_user = $params{-paid_user};
-
- my $file_entry = '';
-
-
- if ($file->{OUTDATED_BY}) {
-
- my $advisory_name_url = $file->{OUTDATED_BY};
- $advisory_name_url =~ s{(RH[BES]A)-(\d\d\d\d):((\d{4})|(\d{3}))}{$1-$2-$3.html};
- $file_entry = (split /[\/]/, $file->{FILENAME})[-1] . "<br />\n" . "<font color=\"#990000\">File outdated by:  </font><a href=\"/errata/$advisory_name_url\">" . $file->{OUTDATED_BY} . "</a>";
- }
- elsif ($errata_is_protected) {
-
- $file_entry = (split /[\/]/, $file->{FILENAME})[-1];
- }
- elsif (-e File::Spec->catfile(PXT::Config->get('mount_point'), 'redhat', 'linux', 'updates', $file->{FILENAME})) {
-
-
- $file_entry = (split /[\/]/, $file->{FILENAME})[-1] . "<br />\n<a href=\"ftp://updates.redhat.com/" . $file->{FILENAME} . "\">[ via FTP ]</a>"
- . " <a href=\"http://updates.redhat.com/" . $file->{FILENAME} . "\">[ via HTTP ]</a>";
-
- if ($paid_user and $file->{RHN_PATH} and -e File::Spec->catfile(PXT::Config->get('mount_point'), $file->{RHN_PATH})) {
- $file_entry .= " ". Sniglets::Downloads->rhn_download_url(-pxt => $pxt,
- -path => $file->{RHN_PATH},
- -label => "[ via Red Hat Network ]");
- }
- }
- else {
- # CRAP. Missing file that shouldn't be missing.
- PXT::Debug->log(7, "missing: " . File::Spec->catfile(PXT::Config->get('mount_point'), 'redhat', 'linux', 'updates', $file->{FILENAME}));
- $file_entry = "ftp://updates.redhat.com/" . $file->{FILENAME} . "<br />\n<font color=\"#990000\">Missing file</font>";
- }
-
- return $file_entry;
-}
-
-# given a filename, guess the product
-# (only do this for really really really old crap, like 5.1 or 6.1 files...)
-sub guess_product {
- my $filename = shift;
-
- my $product = 'Other';
-
- if ($filename =~ m{^(\d\.\d)/.*?/.*?$}) {
- # 6.1/alpha/foo.rpm
- $product = "Red Hat Linux $1";
- }
- else {
- warn "couldn't determine product for $filename";
- }
-
- PXT::Debug->log(7, "calculated product for $filename: $product") ;
- return $product;
-}
-
-
-sub _arch_sorter {
- if ($a eq 'SRPMS') {
- return -1;
- }
-
- if ($b eq 'SRPMS') {
- return 1;
- }
-
- return ($a cmp $b);
-}
-
-sub _file_sorter {
- my $new_a = (split /\//, $a->{FILENAME})[-1];
- my $new_b = (split /\//, $b->{FILENAME})[-1];
-
- return ($new_a cmp $new_b);
-}
-
-sub updated_packages {
- my $pxt = shift;
-
- my $e = shift;
- my $updated_packages_block = shift;
-
- # to be used later in calculating what urls to render, if any...
- my $errata_is_protected = $e->is_protected();
- my $paid_user = $pxt->user ? $pxt->user->org->is_paying_customer() : undef;
-
- my $updated_packages = '';
-
- # this includes rpm and non-rpm files...
- my @errata_files = $e->files();
-
- #warn Data::Dumper->Dump([(\@errata_files)]);
-
- # needed to determine the obsoleting errata for SRPMS ...
- my %source_rpm_ids;
-
- # some rhnErrataFile entries come back twice, because of the outer join on product,
- # which needs to be there to show things like 5.1 files...
- my %seen_ef_id;
-
-
- # product->arch->filename, this is the data structure we render off of ...
- my %prod_arch_file;
-
- foreach my $file (@errata_files) {
- if ($file->{FILE_TYPE} eq 'OVAL') {
- next;
- }
- # theory for calculating the obsoleting errata for an SRPM:
- # if any rpm that is generated by the srpm is outdated by an errata,
- # that srpm is outdated by that errata as well, because you can't have
- # one without the other, right? (only if a srpm decreases the # of rpms it creates...?)
- if (defined $file->{PACKAGE_OUTDATED_BY}) {
-
- # then it's an rpm...
- die "this should be an rpm, but isn't ... " unless $file->{FILE_TYPE} eq 'RPM';
-
- if (defined $file->{PACKAGE_SOURCE_RPM_ID}) {
- $source_rpm_ids{$file->{PACKAGE_SOURCE_RPM_ID}} = $file->{PACKAGE_OUTDATED_BY};
- }
- }
-
- # build the main data structure...
-
- # if it's an RPM, or an SRPM, there might be able to download it through RHN ...
- if ($file->{FILE_TYPE} eq 'RPM') {
- $file->{RHN_PATH} = $file->{RHN_PACKAGE_PATH};
- }
- elsif ($file->{FILE_TYPE} eq 'SRPM') {
- $file->{RHN_PATH} = $file->{RHN_PACKAGE_SOURCE_PATH};
- }
-
- # group files by channel architecture
- my $arch;
-
- # note that if package_arch is not defined, then it's either funky or an srpm
- # (where funky means i have no data about the package, munge it as best i can)
- if (defined $file->{CHANNEL_ARCH_NAME} and defined $file->{PACKAGE_ARCH}) {
- $arch = $file->{CHANNEL_ARCH_NAME};
- }
- elsif ($file->{FILE_TYPE} eq 'RPM') {
- # oddball type... never imported the package into rhn, so don't easily get
- # the arch from a query. parse it from the filename?
- my $short_filename = (split /[\/]/, $file->{FILENAME})[-1];
- $arch = (split /[\.]/, $short_filename)[-2] || 'Files';
- }
- else {
- $arch = $file->{FILE_TYPE} . 'S';
- }
-
- # some file entries come back twice, once with a good product, once with a bad one...
- # this depends upon the channels the packages are in... there's an outer join
- # on products to support things like 5.1 files
- # We *are* guaranteed to pull back the ones *with* a product 1st...
-
- # link off both id and arch in case of noarch files
- my $composite = $file->{ID} . $arch;
- unless ($seen_ef_id{$composite}) {
-
- $seen_ef_id{$composite} = 1;
-
- # for really really old stuff, like 5.1, 6.1, gotta figure out the product from
- # the filename??
- unless ($file->{PRODUCT}) {
- $file->{PRODUCT} = guess_product($file->{FILENAME});
- }
-
- push @{$prod_arch_file{$file->{PRODUCT}}->{$arch}}, $file
- }
- }
-
- #return "<pre>" . Data::Dumper->Dump([(\%prod_arch_file)]) . "</pre>";
- #warn Data::Dumper->Dump([(\%prod_arch_file)]);
-
- $pxt->pnotes(updated_packages => \%prod_arch_file);
-
- # render it...
- $updated_packages_block =~ m{<_arch>(.*?)</_arch>}ism;
- my $arch_block = $1;
- $updated_packages_block =~ m{<_file_entry>(.*?)</_file_entry>}ism;
- my $file_block = $1;
-
- my $ret = '';
-
- # iterate over the products ...
- foreach my $product (sort keys %prod_arch_file) {
-
- my $current_product_block = $updated_packages_block;
- $current_product_block =~ s/\{product\}/$product/gism;
-
- my $products_str = '';
-
- # iterate through all the arches for a product ...
- foreach my $arch (sort _arch_sorter keys %{$prod_arch_file{$product}}) {
-
- my $current_arch_block = $arch_block;
- $current_arch_block =~ s/\{arch\}/$arch/gims;
-
- my @files = @{$prod_arch_file{$product}->{$arch}};
-
- my $files_str = '';
- my $count = 1;
-
- foreach my $file (sort _file_sorter @files) {
-
- # if it's an srpm ...
- if ($file->{FILE_TYPE} eq 'SRPM') {
-
- # check to see if any of it's generated rpms have reported an outdating errata;
- # if so, that errata *should* also outdate this one...
- $file->{OUTDATED_BY} = $source_rpm_ids{$file->{PACKAGE_SOURCE_SOURCE_RPM_ID}};
- }
- elsif( $file->{FILE_TYPE} eq 'RPM') {
- $file->{OUTDATED_BY} = $file->{PACKAGE_OUTDATED_BY};
- }
-
- my %subst;
- my $entry = render_file_entry($pxt, {-file => $file, -errata_is_protected => $errata_is_protected, -paid_user => $paid_user});
-
- $subst{filename} = $entry;
- $subst{md5sum} = $file->{MD5SUM};
- $subst{color} = $count % 2 ? "#ffffff" : "#eeeeee";
-
- $files_str .= PXT::Utils->perform_substitutions($file_block, \%subst);
- $count++;
- }
-
- $current_arch_block =~ s/<_file_entry>.*?<\/_file_entry>/$files_str/gism;
- $products_str .= $current_arch_block;
- }
-
- $current_product_block =~ s/<_arch>.*?<\/_arch>/$products_str/gism;
- $ret .= $current_product_block;
- }
-
- if ($errata_is_protected) {
- $ret .= '<tr><td colspan="2">(The unlinked packages above are only available from the <a href="/">' . PXT::Config->get('product_name') . '</a>)<br /></td></tr>';
- }
-
- return $ret;
-}
-
-sub public_cve_heading {
- my $pxt = shift;
- my %params = @_;
- my $block = $params{__block__};
- my $ret = '';
- my $path_info = $pxt->path_info;
-
- my %subst;
-
- if ($path_info =~ m{(CAN|CVE)-(\d\d\d\d)-(\d+)\.html}) {
- $subst{cve_name} = "$1-$2-$3";
- }
- else {
- die "Invalid cve specified!";
- }
-
- $ret .= PXT::Utils->perform_substitutions($block, \%subst);
-
- return $ret;
-}
-
-sub public_cve_details {
- my $pxt = shift;
- my %params = @_;
- my $block = $params{__block__};
- my $errata_id;
- my $ret = '';
- my $path_info = $pxt->path_info;
- my $hostname = PXT::Config->get('public_errata_hostname');
-
- $path_info =~ m/\/(CAN|CVE)(.*?)\.html/;
- # only care about the second part
- my $type = $2;
- my @errata = RHN::Errata->find_by_cve($type);
-
- my $previous_prod = '';
- foreach my $errata (@errata) {
- my %subst;
- if ( $previous_prod ne $errata->[0] ) {
- $subst{errata_product} = $errata->[0] . ":";
- $previous_prod = $errata->[0];
- }
- else {
- $subst{errata_product} = '';
- }
- my $advisory_id = $errata->[1];
- $advisory_id =~ m/(.*?):(.*?)-/;
- $subst{errata_advisory_id_url} =
- "<a href=\"/errata/$1-$2.html\">http://$hostname/errata/$1-$2.html</a>";
- $ret .= PXT::Utils->perform_substitutions($block, \%subst);
- }
-
- return $ret;
-}
-
-
-1;
commit f30f2eedf35b3bfb703cc9bc132770022350648e
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 15:08:16 2010 +0100
Removal of public_cve_list made file_not_found.pxt unused, removing.
diff --git a/web/html/file_not_found.pxt b/web/html/file_not_found.pxt
deleted file mode 100644
index 78f908f..0000000
--- a/web/html/file_not_found.pxt
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="utf8"?>
-
-<pxt-passthrough>
-
-<pxt-use class="Grail::Frame" />
-<pxt-use class="Sniglets::Users" />
-
-<public-secure-links-if-logged-in servers="www.redhat.com|rhn.redhat.com">
-<grail-canvas-template base="/errata_hidden/rh_template.pxt" mode="main">
-
-<table border="0" cellspacing="0" cellpadding="0">
-<tr>
-<td><img src="/img/pixel.gif" width="10" height="30" border="0" alt="" /></td>
-<td width="100%">
-
-</td>
-</tr>
-<tr>
-<td colspan="2"><img src="/img/pixel.gif" width="1" height="5" border="0" alt="" /></td>
-</tr>
-</table>
-
-
-<!-- begin wrapper table -->
-<!-- main body table -->
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
-<!-- CONTROL ROW; adjust widths here -->
- <tr>
-<!-- left gutter 20px -->
- <td><img src="/img/pixel.gif" width="20" height="1" border="0" alt="" /></td>
-<!-- content is stretchy so 100% -->
- <td width="100%"><img src="/img/pixel.gif" width="1" height="1" border="0" alt="" /></td>
-<!-- right hand margin 15px -->
- <td><img src="/img/pixel.gif" width="15" height="1" border="0" alt="" /></td>
- </tr>
-<!-- CONTENT ROW -->
- <tr>
-<!-- left gutter; adjust width in control row above -->
- <td> </td>
-<!-- main body; adjust width in control row above -->
- <td valign="top">
-
-<!-- MAIN BODY TABLE is nested for scalability -->
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
-
- <td width="100%">
-
- <h1>Page Not Found (404)</h1>
-<p>We're sorry! The page you are looking for has been moved or no longer exists.</p>
-<p>Please <a href="http://www.redhat.com/apps/search/">search</a> for it, or go to the redhat.com <b><a href="http://www.redhat.com"><span style="color:#cc0000;">home page</span></a></b>.</p>
-
-
- </td>
- </tr>
- </table>
- </td>
- </tr>
-</table>
-
-
-</grail-canvas-template>
-</public-secure-links-if-logged-in>
-</pxt-passthrough>
commit 669d0071fb2e4d7b71b478b590b655a034c57aec
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 15:07:41 2010 +0100
Removal of public_cve_list made cve_not_found.pxt unused, removing.
diff --git a/web/html/cve_not_found.pxt b/web/html/cve_not_found.pxt
deleted file mode 100644
index 765683a..0000000
--- a/web/html/cve_not_found.pxt
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="utf8"?>
-<pxt-passthrough>
-
-<pxt-use class="Grail::Frame" />
-<pxt-use class="Sniglets::Users" />
-<pxt-use class="Sniglets::Errata" />
-
-
-<public-secure-links-if-logged-in servers="www.redhat.com|rhn.redhat.com">
-<grail-canvas-template base="/errata_hidden/rh_template.pxt" mode="main">
-
-
-<table border="0" cellspacing="0" cellpadding="0">
-<tr>
-<td><img src="/img/pixel.gif" width="10" height="30" border="0" alt="" /></td>
-<td width="100%">
-
-</td>
-</tr>
-<tr>
-<td colspan="2"><img src="/img/pixel.gif" width="1" height="5" border="0" alt="" /></td>
-</tr>
-</table>
-
-
-<!-- begin wrapper table -->
-<!-- main body table -->
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
-<!-- CONTROL ROW; adjust widths here -->
- <tr>
-<!-- left gutter 20px -->
- <td><img src="/img/pixel.gif" width="20" height="1" border="0" alt="" /></td>
-<!-- content is stretchy so 100% -->
- <td width="100%"><img src="/img/pixel.gif" width="1" height="1" border="0" alt="" /></td>
-<!-- right hand margin 15px -->
- <td><img src="/img/pixel.gif" width="15" height="1" border="0" alt="" /></td>
- </tr>
-<!-- CONTENT ROW -->
- <tr>
-<!-- left gutter; adjust width in control row above -->
- <td> </td>
-<!-- main body; adjust width in control row above -->
- <td valign="top">
-
-<!-- MAIN BODY TABLE is nested for scalability -->
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
-
- <td width="100%">
-
-<h1>CVE not found</h1>
-
-<p>CVE names are of the form CVE-YYYY-XXXX for common vulnerabilities
-and exposures, CAN-YYYY-XXXX for CVE candidates, where YYYY is a year and
-XXXX is a number.</p>
-
-<p>If the name you provided is in the proper format, then one of the
-following may have happened:</p>
-
-<ul>
-<li>
- We have assigned this CVE name but the issue is not yet
- public or our advisory is not yet ready. In some cases, a name may
- be used before the corresponding information has been added to the
- Red Hat web site. This may happen when a security problem is new.
-</li>
-<li>
- Your source provided or linked to an incorrect name
-</li>
-</ul>
-
-<p>Click <a href="http://www.redhat.com/apps/support/errata/">here</a> to find currently available Errata.</p>
-
-
- </td>
- </tr>
- </table>
- </td>
- </tr>
-</table>
-
-
-</grail-canvas-template>
-</public-secure-links-if-logged-in>
-</pxt-passthrough>
commit 826d2fd0344aeaf1a3452750ac4c5d4ec2198545
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 15:06:43 2010 +0100
Removal of public_cve_list made cve_details.pxi unused, removing.
diff --git a/web/html/errata_hidden/cve_details.pxi b/web/html/errata_hidden/cve_details.pxi
deleted file mode 100644
index a1283b8..0000000
--- a/web/html/errata_hidden/cve_details.pxi
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf8"?>
-<pxt-passthrough>
-
-<pxt-use class="Sniglets::PublicErrata" />
-
-<!-- cve_details.pxi -->
-<public-cve-heading>
-<p>
-<h1>{cve_name}</h1>
-</p>
-<p>
-Updated packages to correct this issue are available along with our advisory
-at the URLs below. Users of the Red Hat Network can update their systems using
-the 'up2date' tool.
-</p>
-</public-cve-heading>
-<table border="0" cellspacing="0" cellpadding="0">
- <public-cve-details>
- <tr>
- <td>{errata_product}</td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td>{errata_advisory_id_url}</td>
- </tr>
- </public-cve-details>
-</table>
-
-</pxt-passthrough>
commit 1c3b8fe177a6535fedc3913b1a20e6cef19bac38
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 14:23:16 2010 +0100
Removal of public_cve_list made product_list.pxi unused, removing.
diff --git a/web/html/errata_hidden/product_list.pxi b/web/html/errata_hidden/product_list.pxi
deleted file mode 100644
index 4c8bb45..0000000
--- a/web/html/errata_hidden/product_list.pxi
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf8"?>
-<pxt-passthrough>
-<pxt-use class="Sniglets::PublicErrata" />
-
-<h1><img src="/img/rhn-icon-errata.gif"/>Errata</h1>
-<p>Please choose which errata you wish to browse:</p>
-<div class="contentIndent">
-
-<ul>
-<public-errata-product-list product_line="rhel" order="desc" />
-</ul>
-
-<ul>
-<public-errata-product-list product_line="rhl" order="desc" />
-</ul>
-
-<ul>
-<public-errata-product-list product_line="stronghold" />
-</ul>
-
-<ul>
-<public-errata-product-list product_line="rhdb" />
-</ul>
-
-</div>
-</pxt-passthrough>
commit c5b359025a5b13048314b8a8b2f9c88b68143ce8
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 14:22:34 2010 +0100
Removal of web/html/cve made public-cve-list and thus public_cve_list unused, removing.
diff --git a/web/modules/sniglets/Sniglets/PublicErrata.pm b/web/modules/sniglets/Sniglets/PublicErrata.pm
index cce36ec..ccda8d7 100644
--- a/web/modules/sniglets/Sniglets/PublicErrata.pm
+++ b/web/modules/sniglets/Sniglets/PublicErrata.pm
@@ -41,7 +41,6 @@ sub register_tags {
# for www.redhat.com'ish public errata display
$pxt->register_tag('public-errata-product-list' => \&public_errata_product_list);
$pxt->register_tag('public-errata-type' => \&public_errata_type);
- $pxt->register_tag('public-cve-list' => \&public_cve_list);
$pxt->register_tag('public-cve-details' => \&public_cve_details);
$pxt->register_tag('public-cve-heading' => \&public_cve_heading);
}
@@ -124,33 +123,6 @@ sub public_errata_product_list {
return $ret;
}
-#
-sub public_cve_list {
- my $pxt = shift;
- my $cache_time = PXT::Config->get("public_errata_cache_time") ||
- "15 minutes";
-
- if ($pxt->path_info eq '/') {
- # make them choose a product
- return $pxt->include('/errata_hidden/product_list.pxi');
- }
- elsif ($pxt->path_info =~ m {^/(CVE|CAN)-\d\d\d\d-\d\d\d\d.*?\.html}) {
- if (cve_in_db($pxt->path_info)) {
- $pxt->cache_document_contents($cache_time);
- return $pxt->include('/errata_hidden/cve_details.pxi');
- }
- else {
- $pxt->path_info =~ m {^/((CVE|CAN).*?)\.html$};
- my $attempted_adv = $1;
- $attempted_adv = PXT::Utils->escapeURI($attempted_adv);
- $pxt->redirect("/cve_not_found.pxt?attempted_adv=$attempted_adv");
- }
- }
- else {
- $pxt->redirect("/file_not_found.pxt");
- }
-}
-
# messy little function that decides what html to render the filename link as
sub render_file_entry {
commit feb1a5a9ebf4715f577c7109f8d026e9c5b05ae1
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 14:20:03 2010 +0100
web/html/cve not used, access to it just shows the pxt source, removing.
diff --git a/web/html/cve b/web/html/cve
deleted file mode 100644
index 0133b8a..0000000
--- a/web/html/cve
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf8"?>
-<pxt-passthrough>
-<pxt-use class="Grail::Frame" />
-<pxt-use class="Sniglets::PublicErrata" />
-<pxt-use class="Sniglets::Users" />
-<pxt-use class="Sniglets::Packages" />
-
-<public-secure-links-if-logged-in servers="www.redhat.com|rhn.redhat.com">
-<grail-canvas-template base="/errata_hidden/rh_template.pxt" mode="main">
-
-<table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><img src="/img/pixel.gif" width="10" height="15" border="0" alt="" /></td>
- </tr>
- <tr>
- <td colspan="2"><img src="/img/pixel.gif" width="1" height="5" border="0" alt="" /></td>
- </tr>
-</table>
-<!-- begin wrapper table -->
-<!-- main body table -->
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
-<!-- CONTROL ROW; adjust widths here -->
- <tr>
-<!-- left gutter 20px -->
- <td><img src="/img/pixel.gif" width="20" height="1" border="0" alt="" /></td>
-<!-- content is stretchy so 100% -->
- <td width="100%"><img src="/img/pixel.gif" width="1" height="1" border="0" alt="" /></td>
-<!-- right hand margin 15px -->
- <td><img src="/img/pixel.gif" width="15" height="1" border="0" alt="" /></td>
- </tr>
-<!-- CONTENT ROW -->
- <tr>
-<!-- left gutter; adjust width in control row above -->
- <td> </td>
-<!-- main body; adjust width in control row above -->
- <td valign="top">
-
-<!-- MAIN BODY TABLE is nested for scalability -->
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
-
- <td width="100%">
-
-<public-cve-list />
-
- </td>
- </tr>
- </table>
- </td>
- </tr>
-</table>
-
-
-</grail-canvas-template>
-</public-secure-links-if-logged-in>
-</pxt-passthrough>
14 years, 2 months
2 commits - backend/common backend/server client/tools
by Michael Mraka
backend/common/rhnLib.py | 8 --------
backend/server/rhnChannel.py | 5 ++---
client/tools/rhnpush/rhnpush_config.py | 17 +----------------
3 files changed, 3 insertions(+), 27 deletions(-)
New commits:
commit 2a1ef88f0308cee27ab8164d2a869936fd7c7fa1
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Feb 1 14:35:19 2010 +0100
removed dead code; no more python 1.5...
diff --git a/client/tools/rhnpush/rhnpush_config.py b/client/tools/rhnpush/rhnpush_config.py
index 70d07e0..fc8cb75 100644
--- a/client/tools/rhnpush/rhnpush_config.py
+++ b/client/tools/rhnpush/rhnpush_config.py
@@ -104,10 +104,7 @@ class rhnpushConfigParser:
def write(self, fileobj):
try:
- if hasattr(self.settings, "write"):
- self.settings.write(fileobj)
- else:
- _write(self.settings, fileobj)
+ self.settings.write(fileobj)
except IOError, e:
print "Config File Error: line %s, file %s: $s" % (e.lineno, e.filename, e)
sys.exit(1)
@@ -148,15 +145,3 @@ class rhnpushConfigParser:
print "Option %s is being set to the default value of %s." % (thiskey, self.options_defaults[thiskey])
self.__dict__[thiskey] = self.options_defaults[thiskey]
-#Used in Python 1.5.2 because its ConfigParser class doesn't have write().
-#settings needs to be a ConfigParser object.
-#fileobj is a fileobj that's ready to be written to.
-def _write(settings, fileobj):
- all_sections = settings.sections()
-
- for sect in all_sections:
- fileobj.write("[%s]\n" % (sect))
-
- for opt in settings.options(sect):
- fileobj.write("%s = %s\n" % (opt, settings.get(sect, opt)))
-
commit 6b0967ad917635378cba38650fb3e5373c2f32e9
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Feb 1 14:49:27 2010 +0100
removed dead code; no more python 1.5
diff --git a/backend/common/rhnLib.py b/backend/common/rhnLib.py
index 12c4bd8..12c2704 100644
--- a/backend/common/rhnLib.py
+++ b/backend/common/rhnLib.py
@@ -172,11 +172,3 @@ def fix_url(url, scheme="http", path="/"):
_fragment))
return url
-
-def startswith(s, prefix):
- """
- Trivial function that I wish existed in python 1.5
- """
- return s[:len(prefix)] == prefix
-
-
diff --git a/backend/server/rhnChannel.py b/backend/server/rhnChannel.py
index e16cda9..88be7e1 100644
--- a/backend/server/rhnChannel.py
+++ b/backend/server/rhnChannel.py
@@ -24,7 +24,6 @@ from types import IntType, ListType, DictType
# common module
from common import log_debug, log_error, rhnFault, rhnException, rhnCache, rhnFlags, CFG
from common.rhnTranslate import _
-from common.rhnLib import startswith
from spacewalk.common import rhn_rpm
from rhnServer import server_lib
from rhnDependency import MakeEvrError
@@ -82,9 +81,9 @@ class BaseDatabaseObject:
self._row = None
def __getattr__(self, name):
- if startswith(name, 'get_'):
+ if name.startswith('get_'):
return rhnLib.CallableObj(name[4:], self._get)
- if startswith(name, 'set_'):
+ if name.startswith('set_'):
return rhnLib.CallableObj(name[4:], self._set)
raise AttributeError(name)
14 years, 2 months
2 commits - web/modules
by Jan Pazdziora
web/modules/rhn/RHN/DB/Errata.pm | 60 --------------------------------------
web/modules/rhn/RHN/DB/Product.pm | 21 -------------
2 files changed, 81 deletions(-)
New commits:
commit e025263b09e8fef1d80733d49788dd0143df8595
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 14:15:44 2010 +0100
Removal of public_errata_list made errata_list_by_product unused, removing.
diff --git a/web/modules/rhn/RHN/DB/Errata.pm b/web/modules/rhn/RHN/DB/Errata.pm
index e9b47e9..800a3ce 100644
--- a/web/modules/rhn/RHN/DB/Errata.pm
+++ b/web/modules/rhn/RHN/DB/Errata.pm
@@ -769,66 +769,6 @@ EOQ
}
-sub errata_list_by_product {
- my $class = shift;
- my $product = shift;
- my $errata_type = shift;
- my $order_by = shift;
-
- my $errata_type_clause = '';
- my $order_by_clause = '';
-
- $order_by = 'update_date' unless $order_by;
- $order_by = 'update_date' if ($order_by eq 'date');
-
- if ($errata_type) {
- $errata_type_clause = " AND E.advisory_type = ?"
- }
-
-
- if ($order_by eq 'synopsis') {
- $order_by_clause = "\n ORDER BY UPPER($order_by)";
- }
- elsif ($order_by eq 'advisory') {
- $order_by_clause = "\n ORDER BY IMPORTANCE, UPPER(E.advisory_name)";
- }
- elsif ($order_by eq 'severity') {
- $order_by_clause = "\n ORDER BY RANK";
- }
- else {
- $order_by_clause = "\n ORDER BY $order_by DESC";
- }
-
- my $query = <<EOQ;
-SELECT DISTINCT E.id, E.advisory_name advisory, E.synopsis synopsis, TO_CHAR(E.update_date, 'YYYY-MM-DD') update_date,
- E.advisory_type, E.description,
- DECODE(E.advisory_type, 'Security Advisory', 1, 'Bug Fix Advisory', 2, 'Product Enhancement Advisory', 3) IMPORTANCE,
- DECODE (E.severity_id, 0, 'Critical', 1, 'Important', 2, 'Moderate', 3, 'Low', ' ') SEVERITY, SEV.rank RANK
- FROM rhnErrata E,
- rhnChannelErrata CE,
- rhnProductChannel PC,
- rhnProduct P,
- rhnErrataSeverity SEV
- WHERE P.label = ?
- AND E.severity_id = SEV.id (+)
- AND P.id = PC.product_id
- AND PC.channel_id = CE.channel_id
- AND CE.errata_id = E.id $errata_type_clause $order_by_clause
-EOQ
-
- my $dbh = RHN::DB->connect;
- my $sth = $dbh->prepare($query);
-
- $sth->execute($product, $errata_type_clause ? ($errata_type) : ());
-
- my @ret;
- while (my @row = $sth->fetchrow) {
- push @ret, [ @row ];
- }
-
- return @ret;
-}
-
# Returns a list of errata for a given CVE
sub find_by_cve {
my $class = shift;
commit a4369d3b93e0617a35b7bfc61d23941938b1e09c
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 14:14:05 2010 +0100
Removal of public_errata_product_name made name_by_label unused, removing.
diff --git a/web/modules/rhn/RHN/DB/Product.pm b/web/modules/rhn/RHN/DB/Product.pm
index 308e263..20f1954 100644
--- a/web/modules/rhn/RHN/DB/Product.pm
+++ b/web/modules/rhn/RHN/DB/Product.pm
@@ -86,27 +86,6 @@ foreach my $field ($p->method_names) {
}
-sub name_by_label {
- my $class = shift;
- my $label = shift;
-
- die 'No label!' unless $label;
-
- my $dbh = RHN::DB->connect;
- my $query;
- my $sth;
- $query = <<EOQ;
-SELECT name FROM rhnProduct WHERE label = :product_label
-EOQ
-
- $sth = $dbh->prepare($query);
- $sth->execute_h(product_label => $label);
- my ($name) = $sth->fetchrow;
- $sth->finish;
-
- return $name;
-}
-
sub product_line {
my $class = shift;
my $label = shift;
14 years, 2 months
5 commits - web/modules
by Jan Pazdziora
web/modules/sniglets/Sniglets/PublicErrata.pm | 226 --------------------------
1 file changed, 226 deletions(-)
New commits:
commit d8bb6aee005825e4586e080c36d9046b16e524bd
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 14:11:36 2010 +0100
Removal of /errata_hidden/list.pxi made public-errata-list and public_errata_list unused, removing.
diff --git a/web/modules/sniglets/Sniglets/PublicErrata.pm b/web/modules/sniglets/Sniglets/PublicErrata.pm
index 7c93997..cce36ec 100644
--- a/web/modules/sniglets/Sniglets/PublicErrata.pm
+++ b/web/modules/sniglets/Sniglets/PublicErrata.pm
@@ -41,7 +41,6 @@ sub register_tags {
# for www.redhat.com'ish public errata display
$pxt->register_tag('public-errata-product-list' => \&public_errata_product_list);
$pxt->register_tag('public-errata-type' => \&public_errata_type);
- $pxt->register_tag('public-errata-list' => \&public_errata_list);
$pxt->register_tag('public-cve-list' => \&public_cve_list);
$pxt->register_tag('public-cve-details' => \&public_cve_details);
$pxt->register_tag('public-cve-heading' => \&public_cve_heading);
@@ -459,100 +458,4 @@ sub public_cve_details {
}
-sub public_errata_list {
- my $pxt = shift;
- my %params = @_;
-
- #$my $product = $pxt->param('product');
- my $path_info = $pxt->path_info;
- my $product_label;
-
- if ($path_info) {
-
- if ($path_info =~ m/\/(.*?)-errata/) {
- $product_label = $1;
- }
- elsif ($path_info =~ m/\/(.*?-powertools)/) {
- $product_label = $1;
- }
-
- }
-
- $pxt->redirect('/file_not_found.pxt') unless $product_label;
-
- my $errata_type;
- my $order_by;
-
- if ($path_info =~ m/security/) {
- $errata_type = $errata_types{'security'}->[1];
- }
- elsif ($path_info =~ m/bugfixes/) {
- $errata_type = $errata_types{'bug_fixes'}->[1];
- }
- elsif ($path_info =~ m/updates/) {
- $errata_type = $errata_types{'enhancements'}->[1];
- }
-
- if ($pxt->dirty_param('by') and grep { $pxt->dirty_param('by') eq $_ } qw/date synopsis advisory severity/) {
- $order_by = $pxt->dirty_param('by');
- }
-
- my @errata;
-
- my $product = RHN::Product->name_by_label($product_label);
- unless ($product) {
- my $uri = $pxt->uri;
- $uri =~ s|^.*/||;
- warn "Invalid product in Sniglets::public_errata_search - '$product_label'\n";
- $pxt->redirect('http://www.redhat.com/support/errata/archives/' . $uri);
- }
-
- @errata = RHN::Errata->errata_list_by_product($product_label, $errata_type, $order_by);
-
- my $num_errata = @errata;
- $pxt->pnotes(errata_total => $num_errata);
-
- my $block = $params{__block__};
- my $ret = '';
- my $counter = 1;
-
- foreach my $errata (@errata) {
- my %subst;
-
- if ($counter % 2) {
- $subst{class} = 'list-row-odd';
- }
- else {
- $subst{class} = 'list-row-even';
- }
-
- $counter++;
-
- $subst{errata_advisory_name} = $errata->[1];
- $subst{errata_synopsis} = $errata->[2];
- $subst{errata_update_date} = $errata->[3];
- $subst{errata_advisory_type} = $errata->[4];
- $subst{errata_type} = $errata_types_reverse{$errata->[4]};
- $subst{errata_description} = $errata->[5];
- $subst{severity} = $errata->[7];
-
- PXT::Utils->escapeHTML_multi(\%subst);
-
- my $color = $counter % 2 ? 'grey' : 'white';
-
- $subst{errata_icon} = PXT::HTML->img(-src => $e_icons{$errata->[4]}->{$color},
- -alt => $e_icons{$errata->[4]}->{alt},
- -align => "absmiddle");
-
- $errata->[1] =~ m/^(.*?):(.*?)$/;
- my $advisory = "$1-$2";
-
- $subst{errata_advisory_html_version} = "$advisory\.html";
-
- $ret .= PXT::Utils->perform_substitutions($block, \%subst);
- }
-
- return $ret;
-}
-
1;
commit 504a61092eef7d82269b6f3c60d5c34d49bdccef
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 14:10:27 2010 +0100
Removal of /errata_hidden/list.pxi made public-errata-filter-type-url and public_errata_filter_type_url unused, removing.
diff --git a/web/modules/sniglets/Sniglets/PublicErrata.pm b/web/modules/sniglets/Sniglets/PublicErrata.pm
index 2fafcbb..7c93997 100644
--- a/web/modules/sniglets/Sniglets/PublicErrata.pm
+++ b/web/modules/sniglets/Sniglets/PublicErrata.pm
@@ -40,7 +40,6 @@ sub register_tags {
# for www.redhat.com'ish public errata display
$pxt->register_tag('public-errata-product-list' => \&public_errata_product_list);
- $pxt->register_tag('public-errata-filter-type-url' => \&public_errata_filter_type_url);
$pxt->register_tag('public-errata-type' => \&public_errata_type);
$pxt->register_tag('public-errata-list' => \&public_errata_list);
$pxt->register_tag('public-cve-list' => \&public_cve_list);
@@ -460,19 +459,6 @@ sub public_cve_details {
}
-sub public_errata_filter_type_url {
- my $pxt = shift;
- my %params = @_;
-
- my $block = $params{__block__};
-
- foreach my $by_field (qw/date advisory synopsis severity/) {
- $block =~ s/\{$by_field\}/'<a href="\/errata' . $pxt->path_info . '?by=' . $by_field. ( $pxt->param('errata_type') ? '&errata_type=' . $pxt->param('errata_type') : '') . '">' . ucfirst $by_field . "<\/a>"/egism;
- }
-
- return $block;
-}
-
sub public_errata_list {
my $pxt = shift;
my %params = @_;
commit 5b0cd50702dbb9b653451e5d59d8665437fcbadb
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 14:09:41 2010 +0100
Removal of /errata_hidden/list.pxi made public-errata-filter and public_errata_filter unused, removing.
diff --git a/web/modules/sniglets/Sniglets/PublicErrata.pm b/web/modules/sniglets/Sniglets/PublicErrata.pm
index 8dd01da..2fafcbb 100644
--- a/web/modules/sniglets/Sniglets/PublicErrata.pm
+++ b/web/modules/sniglets/Sniglets/PublicErrata.pm
@@ -40,7 +40,6 @@ sub register_tags {
# for www.redhat.com'ish public errata display
$pxt->register_tag('public-errata-product-list' => \&public_errata_product_list);
- $pxt->register_tag('public-errata-filter' => \&public_errata_filter);
$pxt->register_tag('public-errata-filter-type-url' => \&public_errata_filter_type_url);
$pxt->register_tag('public-errata-type' => \&public_errata_type);
$pxt->register_tag('public-errata-list' => \&public_errata_list);
@@ -474,62 +473,6 @@ sub public_errata_filter_type_url {
return $block;
}
-sub public_errata_filter {
- my $pxt = shift;
- my %params = @_;
-
- my $errata_type = '';
- my $path_info = $pxt->path_info;
-
- my $product = '';
-
- my $is_powertools = '';
-
- if ($path_info) {
- if ($path_info =~ m/\/(.*?)-errata/) {
- $product = $1;
- }
- elsif ($path_info =~ m/\/(.*?-powertools)/) {
- $product = $1;
- $is_powertools = 1;
- }
-
- if ($path_info =~ m/security/) {
- $errata_type = 'security';
- }
- elsif ($path_info =~ m/bugfixes/) {
- $errata_type = 'bug_fixes';
- }
- elsif ($path_info =~ m/updates/) {
- $errata_type = 'enhancements';
- }
- }
-
- my $base_url = '/errata';
-
-
- my $all_url = $base_url . "/$product" . ($is_powertools ? "" : "-errata") . ".html";
- my $security_url = $base_url . "/$product" . ($is_powertools ? "" : "-errata") . "-security.html";
- my $bug_fix_url = $base_url . "/$product" . ($is_powertools ? "" : "-errata") . "-bugfixes.html";
- my $enhancement_url = $base_url . "/$product" . ($is_powertools ? "" : "-errata") . "-updates.html";
-
- return "<font style=\"color:#666666; font-family:helvetica; text-decoration:none; font-size:10pt;\"><strong>Jump to:</strong> [ <font color=\"black\"><strong>all</strong></font> | <strong><a href=\"$security_url\">security</a></strong> | <strong><a href=\"$bug_fix_url\">bug fixes</a></strong> | <strong><a href=\"$enhancement_url\">enhancements</a></strong> ]</font>" unless ($errata_type);
-
- if ($errata_type eq 'security') {
- return "<font style=\"color:#666666; font-family:helvetica; text-decoration:none; font-size:10pt;\"><strong>Jump to:</strong> [ <strong><a href=\"$all_url\">all</a></strong> | <font color=\"black\"><strong>security</strong></font> | <strong><a href=\"$bug_fix_url\">bug fixes</a></strong> | <strong><a href=\"$enhancement_url\">enhancements</a></strong> ]</font>";
- }
-
- if ($errata_type eq 'bug_fixes') {
- return "<font style=\"color:#666666; font-family:helvetica; text-decoration:none; font-size:10pt;\"><strong>Jump to:</strong> [ <strong><a href=\"$all_url\">all</a></strong> | <strong><a href=\"$security_url\">security</a></strong> | <font color=\"black\"><strong>bug fixes</strong></font> | <strong><a href=\"$enhancement_url\">enhancements</a></strong> ]</font>";
- }
-
- if ($errata_type eq 'enhancements') {
- return "<font style=\"color:#666666; font-family:helvetica; text-decoration:none; font-size:10pt;\"><strong>Jump to:</strong> [ <strong><a href=\"$all_url\">all</a></strong> | <strong><a href=\"$security_url\">security</a></strong> | <strong><a href=\"$bug_fix_url\">bug fixes</a></strong> | <font color=\"black\"><strong>enhancements</strong></font> ]</font>";
- }
-
- return '';
-}
-
sub public_errata_list {
my $pxt = shift;
my %params = @_;
commit ea660c7bb450408a28db8a29df79d07d840b7272
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 14:08:13 2010 +0100
Removal of /errata_hidden/list.pxi made public-errata-product-name and public_errata_product_name unused, removing.
diff --git a/web/modules/sniglets/Sniglets/PublicErrata.pm b/web/modules/sniglets/Sniglets/PublicErrata.pm
index f55e5d2..8dd01da 100644
--- a/web/modules/sniglets/Sniglets/PublicErrata.pm
+++ b/web/modules/sniglets/Sniglets/PublicErrata.pm
@@ -44,7 +44,6 @@ sub register_tags {
$pxt->register_tag('public-errata-filter-type-url' => \&public_errata_filter_type_url);
$pxt->register_tag('public-errata-type' => \&public_errata_type);
$pxt->register_tag('public-errata-list' => \&public_errata_list);
- $pxt->register_tag('public-errata-product-name' => \&public_errata_product_name);
$pxt->register_tag('public-cve-list' => \&public_cve_list);
$pxt->register_tag('public-cve-details' => \&public_cve_details);
$pxt->register_tag('public-cve-heading' => \&public_cve_heading);
@@ -462,31 +461,6 @@ sub public_cve_details {
}
-sub public_errata_product_name {
- my $pxt = shift;
- my %params = @_;
-
- my $path_info = $pxt->path_info;
- my $product;
-
- if ($path_info) {
-
- if ($path_info =~ m/\/(.*?)-errata/) {
- $product = $1;
- }
- elsif ($path_info =~ m/\/(.*?-powertools)/) {
- $product = $1;
- }
- }
-
- die "no product!" unless $product;
-
- $product = RHN::Product->name_by_label($product);
- die "no product name!" unless ($product);
-
- return $product;
-}
-
sub public_errata_filter_type_url {
my $pxt = shift;
my %params = @_;
commit 290104bd8f9ecd66f501d2428da87fe44697b592
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 14:03:47 2010 +0100
Removal of /errata_hidden/details.pxi made public-errata-cves and thus public_errata_cves unused, removing.
diff --git a/web/modules/sniglets/Sniglets/PublicErrata.pm b/web/modules/sniglets/Sniglets/PublicErrata.pm
index e05cd19..f55e5d2 100644
--- a/web/modules/sniglets/Sniglets/PublicErrata.pm
+++ b/web/modules/sniglets/Sniglets/PublicErrata.pm
@@ -45,7 +45,6 @@ sub register_tags {
$pxt->register_tag('public-errata-type' => \&public_errata_type);
$pxt->register_tag('public-errata-list' => \&public_errata_list);
$pxt->register_tag('public-errata-product-name' => \&public_errata_product_name);
- $pxt->register_tag('public-errata-cves' => \&public_errata_cves, 2); # render after public_errata_details
$pxt->register_tag('public-cve-list' => \&public_cve_list);
$pxt->register_tag('public-cve-details' => \&public_cve_details);
$pxt->register_tag('public-cve-heading' => \&public_cve_heading);
@@ -463,37 +462,6 @@ sub public_cve_details {
}
-sub public_errata_cves {
- my $pxt = shift;
- my %params = @_;
-
- my $block = $params{__block__};
-
- return '' unless ($block);
-
- my $cves_ref = $pxt->pnotes('cves');
-
- return '' unless $cves_ref;
- my @cves = @{$cves_ref};
-
- my $cve_entry_block;
- $block =~ m{<cve_entry_block>(.*?)</cve_entry_block>}ism;
- $cve_entry_block = $1;
-
- my $cves_details = '';
- foreach my $cve (@cves) {
- my $current = $cve_entry_block;
- $current =~ s{\{cve\}}{$cve}gism;
- $cves_details .= $current;
- }
-
- $block =~ s{<cve_entry_block>.*?</cve_entry_block>}{$cves_details}ism;
-
- return $block;
-}
-
-
-
sub public_errata_product_name {
my $pxt = shift;
my %params = @_;
14 years, 2 months
2 commits - web/modules
by Jan Pazdziora
web/modules/sniglets/Sniglets/PublicErrata.pm | 159 --------------------------
1 file changed, 159 deletions(-)
New commits:
commit 8be6d6e56436a1cf78ce76b68c5ad1c35e65ec80
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 14:01:51 2010 +0100
Removal of /errata_hidden/details.pxi made public-errata-affected-products and thus public_errata_affected_products unused, removing.
diff --git a/web/modules/sniglets/Sniglets/PublicErrata.pm b/web/modules/sniglets/Sniglets/PublicErrata.pm
index f824c3a..e05cd19 100644
--- a/web/modules/sniglets/Sniglets/PublicErrata.pm
+++ b/web/modules/sniglets/Sniglets/PublicErrata.pm
@@ -40,7 +40,6 @@ sub register_tags {
# for www.redhat.com'ish public errata display
$pxt->register_tag('public-errata-product-list' => \&public_errata_product_list);
- $pxt->register_tag('public-errata-affected-products' => \&public_errata_affected_products, 2);
$pxt->register_tag('public-errata-filter' => \&public_errata_filter);
$pxt->register_tag('public-errata-filter-type-url' => \&public_errata_filter_type_url);
$pxt->register_tag('public-errata-type' => \&public_errata_type);
@@ -157,20 +156,6 @@ sub public_cve_list {
}
}
-sub public_errata_affected_products {
- my $pxt = shift;
- my %params = @_;
-
- my $block = $params{__block__};
-
- my $pkgs_ref = $pxt->pnotes('updated_packages');
- my @products = sort keys %{$pkgs_ref};
-
- $block =~ s{\{affected_products\}}{ join("<br />\n", map { "<a href=\"#$_\">$_</a>" } @products) }egism;
-
- return $block;
-}
-
# messy little function that decides what html to render the filename link as
sub render_file_entry {
commit 37cb0024fada8eacc13ae7d28fa8513bcd2de7a1
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Feb 1 14:00:51 2010 +0100
Removal of /errata_hidden/details.pxi made public-errata-details and thus public_errata_details unused, removing.
diff --git a/web/modules/sniglets/Sniglets/PublicErrata.pm b/web/modules/sniglets/Sniglets/PublicErrata.pm
index 144f429..f824c3a 100644
--- a/web/modules/sniglets/Sniglets/PublicErrata.pm
+++ b/web/modules/sniglets/Sniglets/PublicErrata.pm
@@ -46,7 +46,6 @@ sub register_tags {
$pxt->register_tag('public-errata-type' => \&public_errata_type);
$pxt->register_tag('public-errata-list' => \&public_errata_list);
$pxt->register_tag('public-errata-product-name' => \&public_errata_product_name);
- $pxt->register_tag('public-errata-details' => \&public_errata_details);
$pxt->register_tag('public-errata-cves' => \&public_errata_cves, 2); # render after public_errata_details
$pxt->register_tag('public-cve-list' => \&public_cve_list);
$pxt->register_tag('public-cve-details' => \&public_cve_details);
@@ -478,149 +477,6 @@ sub public_cve_details {
return $ret;
}
-sub public_errata_details {
- my $pxt = shift;
- my %params = @_;
- my $block = $params{__block__};
-
- my $errata_id;
-
- # support for /errata/advisory/details.pxt/RHSA-2002-001.html
- # and /errata/advisory/solution.pxt/RHSA-2002-001.html
- my $path_info = $pxt->path_info;
-
- my $type;
- my $version;
-
- if ($path_info =~ m/\/(.*?)-(.*?)\.html/) {
- ($type, $version) = ($1, $2);
- $version =~ s/-/:/;
- }
- else {
- $pxt->redirect("/errata/file_not_found.pxt");
- }
-
-
- my @errata = RHN::Errata->find_by_advisory(-type => $type, -version => $version);
-
- $pxt->redirect("/errata/file_not_found.pxt")
- unless @errata;
-
- $errata_id = $errata[0]->[0];
-
- my $e = RHN::Errata->lookup(-id => $errata_id);
-
- PXT::Debug->log(9, "errata: " . Data::Dumper->Dump([($e)]));
-
- $pxt->redirect("/errata/file_not_found.pxt")
- unless $e;
-
- $pxt->redirect("/errata/file_not_found.pxt")
- unless $e->is_public();
-
- die "Non Red Hat Errata not for public display!! eid == " . $e->id if (defined $e->org_id);
-
- #$pxt->pnotes(errata => \$e);
-
- my %subst;
- # general info
- $subst{path_info} = $path_info || '';
-
- my $severity_text;
- my $oval_file_name;
- my @chunks;
- my $has_severity;
- # these will always be filled out
- $subst{errata_id} = $e->id;
- $subst{errata_advisory_id} = $e->advisory;
- $subst{errata_issue_date} = $e->issue_date;
- $subst{errata_update_date} = $e->update_date;
- $subst{errata_product} = $e->product;
-
- if ($e->severity_id == 0) {
- $severity_text = "Critical";
- }
- elsif ($e->severity_id == 1) {
- $severity_text = "Important";
- }
- elsif ($e->severity_id == 2) {
- $severity_text = "Moderate";
- }
- elsif ($e->severity_id == 3) {
- $severity_text = "Low";
- }
- else {
- $severity_text = "N/A";
- }
- $subst{severity} = $severity_text;
- $subst{errata_synopsis} = defined $e->synopsis ? $e->synopsis : "";
-
- PXT::Utils->escapeHTML_multi(\%subst);
-
- if ($e->oval_file_count == 0) {
- $subst{oval_link} = "N/A";
- }
- else {
- $oval_file_name = $e->advisory;
- $oval_file_name =~ tr/A-Z/a-z/;
- $oval_file_name =~ s/://;
- @chunks = split(/-/, $oval_file_name);
- $oval_file_name = "com.redhat." . $chunks[0] . "-" . $chunks[1] . ".xml";
- $subst{oval_link} = PXT::HTML->link("/rhn/oval?errata=" . $e->id, $oval_file_name, , "", "");
- }
-
- $subst{errata_icon} = PXT::HTML->img(-align => "absmiddle",
- -src => $e_icons{$e->advisory_type}->{big},
- -alt => $e_icons{$e->advisory_type}->{alt},
- );
- $subst{errata_icon_file} = $e_icons{$e->advisory_type}->{white};
-
- $subst{errata_advisory_type} = defined $e->advisory_type ? PXT::Utils->escapeHTML($e->advisory_type) : " ";
- $subst{errata_description} = defined $e->description ? PXT::HTML->htmlify_text($e->description) : " ";
- $subst{errata_solution} = defined $e->solution ? PXT::HTML->htmlify_text($e->solution) : " ";
-
- $block = PXT::Utils->perform_substitutions($block, \%subst);
-
- # may or may not be filled out
- $block =~ s/<errata_topic>(.*?)\{errata_topic\}(.*?)<\/errata_topic>/defined $e->topic ? $1 . PXT::HTML->htmlify_text($e->topic) . $2 : ""/eigsm;
-
- my $references_str = defined $e->refers_to ? PXT::HTML->htmlify_text($e->refers_to) : "";
-
- my @cves = $e->related_cves;
-
- $pxt->pnotes(cves => \@cves) if @cves;
-
- if (!defined $e->refers_to and !@cves) {
- $block =~ s/<errata_references>(.*?)\{errata_references\}(.*?)<\/errata_references>//igms;
- }
- else {
- $block =~ s/<errata_references>(.*?)\{errata_references\}(.*?)<\/errata_references>/$1$references_str$2/igsm;
- }
-
-
- # bugs fixed
- my @bugs_fixed = map { '<a href="http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id='
- . $_->[0] . '">' . $_->[0] . '</a> - ' . PXT::HTML->htmlify_text($_->[1]) } $e->bugs_fixed();
-
-
- PXT::Debug->log(9, "bugs fixed: " . Data::Dumper->Dump([(@bugs_fixed)]));
-
- $block =~ s/<errata_bugs_fixed>(.*?)\{errata_bugs_fixed\}(.*?)<\/errata_bugs_fixed>/@bugs_fixed ? $1 . join("<br \/>\n", @bugs_fixed) . $2 : ""/eigsm;
-
-
- # keywords
- my @keywords = $e->keywords;
- $block =~ s/<errata_keywords>(.*?)\{errata_keywords\}(.*?)<\/errata_keywords>/@keywords ? $1 . join(", ", @keywords) . $2: ""/eigsm;
-
- $block =~ m/<errata_updated_packages>(.*?)<\/errata_updated_packages>/ism;
- my $updated_packages_block = $1;
-
- my $updated_packages = updated_packages($pxt, $e, $updated_packages_block);
- $block =~ s/<errata_updated_packages>.*?<\/errata_updated_packages>/$updated_packages/gism;
-
- return $block;
-}
-
sub public_errata_cves {
my $pxt = shift;
14 years, 2 months