java/code/webapp/WEB-INF/pages/activationkeys/list.jsp | 18 +--
java/code/webapp/WEB-INF/pages/channel/manage/repo/repos.jsp | 2
java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/profile-sync.jspf | 6 -
java/code/webapp/WEB-INF/pages/kickstart/cobbler/snippets.jsp | 2
java/code/webapp/WEB-INF/pages/systems/errata.jsp | 2
spacewalk/setup/bin/spacewalk-setup | 50 +++++-----
6 files changed, 42 insertions(+), 38 deletions(-)
New commits:
commit f5ed791bb25c12a614f261f70c61d5d982de1849
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Nov 20 13:40:50 2012 +0100
Do not use Java keywords.
diff --git a/java/code/webapp/WEB-INF/pages/activationkeys/list.jsp b/java/code/webapp/WEB-INF/pages/activationkeys/list.jsp
index c000b42..8e298c8 100644
--- a/java/code/webapp/WEB-INF/pages/activationkeys/list.jsp
+++ b/java/code/webapp/WEB-INF/pages/activationkeys/list.jsp
@@ -30,7 +30,7 @@
<bean:message key="activation-keys.jsp.universal-default-text"/>
</p>
<c:choose>
- <c:when test="${not empty requestScope.default}">
+ <c:when test="${not empty requestScope['default']}">
<table class="details">
<tr>
<th>
@@ -38,12 +38,12 @@
</th>
<td>
<c:choose>
- <c:when test="${requestScope.default.note != null}">
- <a href="/rhn/activationkeys/Edit.do?tid=${requestScope.default.id}">
- <c:out value="${requestScope.default.note}"/></a>
+ <c:when test="${requestScope['default'].note != null}">
+ <a href="/rhn/activationkeys/Edit.do?tid=${requestScope['default'].id}">
+ <c:out value="${requestScope['default'].note}"/></a>
</c:when>
<c:otherwise>
- <a href="/rhn/activationkeys/Edit.do?tid=${requestScope.default.id}">
+ <a href="/rhn/activationkeys/Edit.do?tid=${requestScope['default'].id}">
<bean:message key="kickstart.activationkeys.jsp.description.none"/></a>
</c:otherwise>
</c:choose>
@@ -57,7 +57,7 @@
<bean:message key="kickstart.activationkeys.jsp.key"/>
</th>
<td>
- <c:out value="${requestScope.default.token}"/>
+ <c:out value="${requestScope['default'].token}"/>
</td>
</tr>
@@ -67,8 +67,8 @@
</th>
<td>
<c:choose>
- <c:when test="${requestScope.default.usageLimit != null}">
- <c:out value="${requestScope.default.usageLimit}"/>
+ <c:when test="${requestScope['default'].usageLimit != null}">
+ <c:out value="${requestScope['default'].usageLimit}"/>
</c:when>
<c:otherwise>
<bean:message key="kickstart.activationkeys.jsp.nousagelimit"/>
@@ -83,7 +83,7 @@
</th>
<td>
<c:choose>
- <c:when test="${not requestScope.default.disabled}">
+ <c:when test="${not requestScope['default'].disabled}">
<bean:message key="Enabled"/>
</c:when>
<c:otherwise>
diff --git a/java/code/webapp/WEB-INF/pages/channel/manage/repo/repos.jsp b/java/code/webapp/WEB-INF/pages/channel/manage/repo/repos.jsp
index 61b4fa9..01813b8 100644
--- a/java/code/webapp/WEB-INF/pages/channel/manage/repo/repos.jsp
+++ b/java/code/webapp/WEB-INF/pages/channel/manage/repo/repos.jsp
@@ -14,7 +14,7 @@
</rhn:toolbar>
<div class="page-summary">
<p><bean:message key="repos.jsp.summary"/></p>
-<c:if test="${not empty requestScope.default}">
+<c:if test="${not empty requestScope['default']}">
<rhn:note key = "repos.jsp.note.default"/>
</c:if>
</div>
diff --git a/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/profile-sync.jspf b/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/profile-sync.jspf
index baaeddd..093d3d9 100644
--- a/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/profile-sync.jspf
+++ b/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/profile-sync.jspf
@@ -27,10 +27,10 @@
<select name="targetProfile" id="syncPackageSelect"
<c:if test="${form.targetProfileType ne 'package' or empty form.syncPackages}">disabled="true"</c:if>
>
- <c:forEach var="package" items="${form.syncPackages}">
+ <c:forEach var="packagex" items="${form.syncPackages}">
<option
- <c:if test="${package.id == form.targetProfile}">selected="selected"</c:if>
- value='${package.id}'>${package.name}</option>
+ <c:if test="${packagex.id == form.targetProfile}">selected="selected"</c:if>
+ value='${packagex.id}'>${packagex.name}</option>
</c:forEach>
</select>
<br /><br />
diff --git a/java/code/webapp/WEB-INF/pages/kickstart/cobbler/snippets.jsp b/java/code/webapp/WEB-INF/pages/kickstart/cobbler/snippets.jsp
index a0b6c7d..6aee44d 100644
--- a/java/code/webapp/WEB-INF/pages/kickstart/cobbler/snippets.jsp
+++ b/java/code/webapp/WEB-INF/pages/kickstart/cobbler/snippets.jsp
@@ -16,7 +16,7 @@
renderer="com.redhat.rhn.frontend.nav.DialognavRenderer" />
<div class="page-summary">
<p><bean:message key="snippets.jsp.summary"/></p>
-<c:if test="${not empty requestScope.default}">
+<c:if test="${not empty requestScope['default']}">
<rhn:note key = "snippets.jsp.note.default"/>
</c:if>
</div>
diff --git a/java/code/webapp/WEB-INF/pages/systems/errata.jsp b/java/code/webapp/WEB-INF/pages/systems/errata.jsp
index 2c955c4..69f59f9 100644
--- a/java/code/webapp/WEB-INF/pages/systems/errata.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/errata.jsp
@@ -44,7 +44,7 @@
<select name="type">
<c:forEach items="${combo}" var="item">
<option id="${item.id}"
- <c:if test="${item.default}"> selected</c:if>
+ <c:if test="${item['default']}"> selected</c:if>
> <bean:message key="${item.name}"/>
</option>
</c:forEach>
commit 95df4d67c21ce8daf6100ee37923877c2a30bd7c
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Nov 30 14:06:12 2012 +0100
Allow tomcat config file without number.
diff --git a/spacewalk/setup/bin/spacewalk-setup b/spacewalk/setup/bin/spacewalk-setup
index 6eaf96d..e0ac463 100755
--- a/spacewalk/setup/bin/spacewalk-setup
+++ b/spacewalk/setup/bin/spacewalk-setup
@@ -525,14 +525,14 @@ sub setup_tomcat {
my $answers = shift;
my ($tomcatconf_content_orig, $tomcatconf_content);
- my $which_tomcat = qx{rpm -q --requires spacewalk-java};
- my ($tomcatX) = ($which_tomcat =~ m/\b(tomcat\d)\b/m);
- my $tomcatdir = "/etc/$tomcatX";
- my $tomcatconf = "$tomcatX.conf";
- my $webxml = "web.xml";
- my $tomcatfile = "$tomcatdir/$tomcatconf";
+ my @tomcat_confs = grep { -f $_ } glob("/etc/tomcat*/tomcat*.conf");
+ if (@tomcat_confs < 1) {
+ die "Couldn't find tomcat config file (/etc/tomcat*/tomcat*.conf).\n";
+ } elsif (@tomcat_confs > 1) {
+ die "Multiple tomcat config files found:\n @tomcat_confs\nNot sure which tomcat to use.\n";
+ }
- die "$tomcatfile does not exist.\n" unless (-f $tomcatfile);
+ my $tomcatfile = $tomcat_confs[0];
{
open FILE, '<', $tomcatfile
@@ -558,7 +558,7 @@ sub setup_tomcat {
}
if ($tomcatconf_content ne $tomcatconf_content_orig) {
- Spacewalk::Setup::backup_file($tomcatdir, $tomcatconf);
+ Spacewalk::Setup::backup_file($tomcatfile =~ m!^(.+)/(.+)$!);
open FILE, '>', $tomcatfile
or die "Error opening [$tomcatfile]: $!\n";
@@ -567,6 +567,7 @@ sub setup_tomcat {
close FILE;
}
+ my ($tomcatdir) = ($tomcatfile =~ m!^(.+)/!);
my $serverxmlfile = "$tomcatdir/server.xml";
{
local $/ = undef;
@@ -594,7 +595,8 @@ sub setup_tomcat {
my $command = "patch --silent --directory=$tomcatdir --forward -p1 --input=$web_patch";
system($command." --dry-run");
if (not $?){
- Spacewalk::Setup::backup_file($tomcatdir, $webxml);
+ Spacewalk::Setup::backup_file($tomcatdir, 'web.xml');
+
system($command);
}
return;
commit f4197ea73035b968b2fc96268015b1d21d3dd29b
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Nov 30 14:16:32 2012 +0100
Prefer three-parameter open.
diff --git a/spacewalk/setup/bin/spacewalk-setup b/spacewalk/setup/bin/spacewalk-setup
index e75a973..6eaf96d 100755
--- a/spacewalk/setup/bin/spacewalk-setup
+++ b/spacewalk/setup/bin/spacewalk-setup
@@ -535,7 +535,7 @@ sub setup_tomcat {
die "$tomcatfile does not exist.\n" unless (-f $tomcatfile);
{
- open FILE, $tomcatfile
+ open FILE, '<', $tomcatfile
or die "Error opening [$tomcatfile]: $!\n";
local $/ = undef;
$tomcatconf_content = <FILE>;
@@ -544,7 +544,7 @@ sub setup_tomcat {
}
for my $file (glob Spacewalk::Setup::SHARED_DIR . '/tomcatX.conf.[0-9]') {
- open FILE, $file or die "Error reading [$file]: $!\n";
+ open FILE, '<', $file or die "Error reading [$file]: $!\n";
my $regexp = <FILE>;
chomp $regexp;
@@ -560,7 +560,7 @@ sub setup_tomcat {
if ($tomcatconf_content ne $tomcatconf_content_orig) {
Spacewalk::Setup::backup_file($tomcatdir, $tomcatconf);
- open FILE, ">$tomcatfile"
+ open FILE, '>', $tomcatfile
or die "Error opening [$tomcatfile]: $!\n";
chmod 0644, $tomcatfile;
print FILE $tomcatconf_content;
@@ -571,7 +571,7 @@ sub setup_tomcat {
{
local $/ = undef;
local *FILE;
- open FILE, $serverxmlfile
+ open FILE, '<', $serverxmlfile
or die "Error opening [$serverxmlfile]: $!\n";
my $serverxml_content_orig = <FILE>;
close FILE;
@@ -582,7 +582,7 @@ sub setup_tomcat {
if ($serverxml_content ne $serverxml_content_orig) {
Spacewalk::Setup::backup_file($serverxmlfile =~ m!^(.+)/(.+)$!);
- open FILE, ">$serverxmlfile"
+ open FILE, '>', $serverxmlfile
or die "Error opening [$serverxmlfile]: $!\n";
chmod 0644, $serverxmlfile;
print FILE $serverxml_content;
commit 616d23233fbc73eb002f42e30c8c582c9028c67b
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Nov 30 14:15:33 2012 +0100
Stop repeated dir/file concatenation.
diff --git a/spacewalk/setup/bin/spacewalk-setup b/spacewalk/setup/bin/spacewalk-setup
index 876cada..e75a973 100755
--- a/spacewalk/setup/bin/spacewalk-setup
+++ b/spacewalk/setup/bin/spacewalk-setup
@@ -529,13 +529,14 @@ sub setup_tomcat {
my ($tomcatX) = ($which_tomcat =~ m/\b(tomcat\d)\b/m);
my $tomcatdir = "/etc/$tomcatX";
my $tomcatconf = "$tomcatX.conf";
- my $serverxml = "server.xml";
my $webxml = "web.xml";
- die "$tomcatdir/$tomcatconf does not exist.\n" unless (-f "$tomcatdir/$tomcatconf");
+ my $tomcatfile = "$tomcatdir/$tomcatconf";
+
+ die "$tomcatfile does not exist.\n" unless (-f $tomcatfile);
{
- open FILE, "$tomcatdir/$tomcatconf"
- or die "Error opening [$tomcatdir/$tomcatconf]: $!\n";
+ open FILE, $tomcatfile
+ or die "Error opening [$tomcatfile]: $!\n";
local $/ = undef;
$tomcatconf_content = <FILE>;
$tomcatconf_content_orig = $tomcatconf_content;
@@ -559,30 +560,31 @@ sub setup_tomcat {
if ($tomcatconf_content ne $tomcatconf_content_orig) {
Spacewalk::Setup::backup_file($tomcatdir, $tomcatconf);
- open FILE, ">$tomcatdir/$tomcatconf"
- or die "Error opening [$tomcatdir/$tomcatconf]: $!\n";
- chmod 0644, "$tomcatdir/$tomcatconf";
+ open FILE, ">$tomcatfile"
+ or die "Error opening [$tomcatfile]: $!\n";
+ chmod 0644, $tomcatfile;
print FILE $tomcatconf_content;
close FILE;
}
+ my $serverxmlfile = "$tomcatdir/server.xml";
{
local $/ = undef;
local *FILE;
- open FILE, "$tomcatdir/$serverxml"
- or die "Error opening $tomcatdir/$serverxml: $!\n";
+ open FILE, $serverxmlfile
+ or die "Error opening [$serverxmlfile]: $!\n";
my $serverxml_content_orig = <FILE>;
close FILE;
- my $template = Spacewalk::Setup::SHARED_DIR . "/$serverxml.xsl";
- my $serverxml_content = qx{/usr/bin/xsltproc $template $tomcatdir/$serverxml};
+ my $template = Spacewalk::Setup::SHARED_DIR . '/server.xml.xsl';
+ my $serverxml_content = qx{/usr/bin/xsltproc $template $serverxmlfile};
die "There was an error running xsltproc\n" if $?;
if ($serverxml_content ne $serverxml_content_orig) {
- Spacewalk::Setup::backup_file($tomcatdir, $serverxml);
+ Spacewalk::Setup::backup_file($serverxmlfile =~ m!^(.+)/(.+)$!);
- open FILE, ">$tomcatdir/$serverxml"
- or die "Error opening [$tomcatdir/$serverxml]: $!\n";
- chmod 0644, "$tomcatdir/$serverxml";
+ open FILE, ">$serverxmlfile"
+ or die "Error opening [$serverxmlfile]: $!\n";
+ chmod 0644, $serverxmlfile;
print FILE $serverxml_content;
close FILE;
}