VERSION.sh | 2
admserv/cgi-src40/help.c | 9 +++-
admserv/newinst/src/25rebrand.pl.in | 16 ++++++-
admserv/newinst/src/30updateglobalpref.pl.in | 5 --
admserv/newinst/src/AdminMigration.pm.in | 12 +----
admserv/newinst/src/AdminServer.pm.in | 6 --
admserv/newinst/src/AdminUtil.pm.in | 55 +++++++++++++++++----------
7 files changed, 66 insertions(+), 39 deletions(-)
New commits:
commit 4848fc256024f31c4c2f2d9bfa4f52f5ed6d8fd8
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Tue Jun 21 15:36:37 2011 -0600
bump version to 1.1.18
diff --git a/VERSION.sh b/VERSION.sh
index 3eaae20..e0c9283 100644
--- a/VERSION.sh
+++ b/VERSION.sh
@@ -11,7 +11,7 @@
vendorurl=http://port389.org
# PACKAGE_VERSION is constructed from these
VERSION_MAJOR=1
VERSION_MINOR=1
-VERSION_MAINT=17
+VERSION_MAINT=18
# if this is a PRERELEASE, set VERSION_PREREL
# otherwise, comment it out
# be sure to include the dot prefix in the prerel
commit eca6d8ae721eb605ec5620ceb2dcc80457b91ed0
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Jun 20 19:24:37 2011 -0600
skip rebranding current brand
if the current brand is the same as the new brand,
skip rebranding
the branding information is now in the skin .inf file,
so get the brand information using getInfs
Reviewed by: nkinder (Thanks!)
diff --git a/admserv/newinst/src/25rebrand.pl.in b/admserv/newinst/src/25rebrand.pl.in
index 75f4b23..0619211 100644
--- a/admserv/newinst/src/25rebrand.pl.in
+++ b/admserv/newinst/src/25rebrand.pl.in
@@ -13,15 +13,22 @@ my @old_brands = ({cap => 'Red Hat',
norm => 'fedora',
vend => 'Fedora Project'});
-my $newbrand = {cap => "@capbrand@",
- norm => "@brand@",
- vend => "@vendor@"};
+my $admininf = (getInfs("admin"))[0];
+
+my $newbrand = {cap => $admininf->{admin}->{Brand},
+ norm => $admininf->{admin}->{NormBrand},
+ vend => $admininf->{admin}->{Vendor}};
my @attrs = ("*", 'aci');
my $nsrootdn = "o=NetscapeRoot";
my $myhost = "";
my @mapoldnew = ();
+sub sameBrand {
+ my ($old, $new) = @_;
+ return $old->{norm} eq $new->{norm};
+}
+
sub replaceOldNewEntry {
my ($ent, @ary) = @_;
my $changes = 0;
@@ -231,6 +238,7 @@ sub rebrandSieAndIsie {
# search for old brands
for my $oldbrand (@old_brands) {
+ next if (sameBrand($oldbrand, $newbrand));
my @ents = ($isie, $sie);
my $sieconf = "cn=configuration," . $siedn;
for ($ent = $conn->search($sieconf, "sub",
"objectclass=*", 0, @attrs);
@@ -293,6 +301,7 @@ sub rebrandConfFiles {
my $count = 0; # reset
while (my ($key, $val) = each %{$admConf}) {
for my $oldbrand (@old_brands) {
+ next if (sameBrand($oldbrand, $newbrand));
$count += ($val =~ s/cn=$oldbrand->{cap}/cn=$newbrand->{cap}/g); # fix
DNs
$count += ($val =~
s/\@$oldbrand->{norm}-admin/\@$newbrand->{norm}-admin/g); # fix jar names
$count += ($val =~ s/\@$oldbrand->{norm}-ds/\@$newbrand->{norm}-ds/g);
# fix jar names
@@ -313,6 +322,7 @@ sub rebrandConfFiles {
$count = 0; # reset
for my $line (@lines) {
for my $oldbrand (@old_brands) {
+ next if (sameBrand($oldbrand, $newbrand));
$count += ($line =~ s/cn=$oldbrand->{cap}/cn=$newbrand->{cap}/g); #
fix DNs
$count += ($line =~
s/\@$oldbrand->{norm}-admin/\@$newbrand->{norm}-admin/g); # fix jar names
$count += ($line =~
s/\@$oldbrand->{norm}-ds/\@$newbrand->{norm}-ds/g); # fix jar names
commit f7bf2c3fd6f80dc0d55ff6ffd8c7c784beedd8c9
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Thu Jun 16 12:24:31 2011 -0600
add support for different skins
These changes add support for different brand/version/other versions of
this and console packages. The main place we get brand/version information
is from the .inf files. The code will first look for a branded .inf file,
then for the default .inf file, for a given product. This will allow
the skin version to override the default version.
Added support for a skinned help file. The help cgi will first look for
skin-header.html, then fall back to header.html.
Reviewed by: nhosoi (Thanks!)
diff --git a/admserv/cgi-src40/help.c b/admserv/cgi-src40/help.c
index 1d59ba1..c136083 100644
--- a/admserv/cgi-src40/help.c
+++ b/admserv/cgi-src40/help.c
@@ -75,6 +75,7 @@
#define HELPWIN_VAR "HelpWindow"
#define TOKEN_FILE "index.map"
#define HEADER_FILE "header.html"
+#define SKIN_HEADER_FILE "skin-header.html"
#define FOOTER_FILE "footer.html"
#define HEAD_BLOCK "<head>"
#define FRAME_BLOCK "<frame "
@@ -289,10 +290,16 @@ no_frame_help(char *name[], char *val[], int cnt, char *product,
char *content)
}
/* read and flush the header to stdout */
+ /* try to read the "skin" header file first, then fall back to the default
*/
safe_snprintf(path, sizeof(path), "%s%c%s%c%s%c%s", MANUALDIR, FILE_SEP,
locale, FILE_SEP,
- product, FILE_SEP, HEADER_FILE);
+ product, FILE_SEP, SKIN_HEADER_FILE);
if (!(file = fopen(path, "r")))
{
+ safe_snprintf(path, sizeof(path), "%s%c%s%c%s%c%s", MANUALDIR, FILE_SEP,
locale, FILE_SEP,
+ product, FILE_SEP, HEADER_FILE);
+ }
+ if (!file && (!(file = fopen(path, "r"))))
+ {
safe_snprintf(base, sizeof(base), "unable to open file: %s", path);
if (debugPrintout)
{
diff --git a/admserv/newinst/src/30updateglobalpref.pl.in
b/admserv/newinst/src/30updateglobalpref.pl.in
index cb5e86a..14dc910 100644
--- a/admserv/newinst/src/30updateglobalpref.pl.in
+++ b/admserv/newinst/src/30updateglobalpref.pl.in
@@ -29,8 +29,7 @@ use Mozilla::LDAP::API qw(:constant ldap_url_parse ldap_explode_dn);
sub post {
my ($inf, $configdir) = @_;
- my $setupinf = new Inf("@infdir(a)/setup.inf");
- my $admininf = new Inf("@infdir(a)/admin.inf");
+ my @infs = getInfs("setup", "admin");
# there are several tokens in the map that we don't
# use for 02globalpreferences - so just add dummy
# values setupinf to make the map happy
@@ -40,7 +39,7 @@ sub post {
my $upd = { path => '@ldifdir(a)/02globalpreferences.ldif.tmpl',
mapper => "@infdir(a)/configdsroot.map",
- infary => [ $setupinf, $admininf ]
+ infary => \@infs
};
return DSUpdate::applyLDIFUpdate($upd, $inf->{configdsconn}, $inf);
diff --git a/admserv/newinst/src/AdminMigration.pm.in
b/admserv/newinst/src/AdminMigration.pm.in
index 5cfed1c..4ee9ab4 100644
--- a/admserv/newinst/src/AdminMigration.pm.in
+++ b/admserv/newinst/src/AdminMigration.pm.in
@@ -177,12 +177,11 @@ sub migratePset {
"@ldifdir(a)/21astasks.ldif.tmpl",
"@ldifdir(a)/22ascommands.ldif.tmpl"
);
- my $setupinf = new Inf("@infdir(a)/setup.inf");
- my $admininf = new Inf("@infdir(a)/admin.inf");
+ my @infs = getInfs("admin", "setup");
my $mapper = new Inf("@infdir(a)/asmigrate.map");
- $mapper = process_maptbl($mapper, \@errs, $inf, $admininf, $setupinf);
+ $mapper = process_maptbl($mapper, \@errs, $inf, @infs);
if (!$mapper) {
$mig->msg(@errs);
$mig->msg($FATAL, 'error_creating_asmigration_maptbl');
@@ -263,13 +262,10 @@ sub updateConsoleInfo {
# update the console info
my @ldiffiles = ("@ldifdir(a)/02globalpreferences.ldif.tmpl"
);
- my $setupinf = new Inf("@infdir(a)/setup.inf");
- my $admininf = new Inf("@infdir(a)/admin.inf");
- my $dsinf = new Inf("@infdir(a)/slapd.inf");
-
+ my @infs = getInfs("admin", "slapd", "setup");
my $mapper = new Inf("@infdir(a)/updateconsoleinfo.map");
- $mapper = process_maptbl($mapper, \@errs, $inf, $admininf, $dsinf, $setupinf);
+ $mapper = process_maptbl($mapper, \@errs, $inf, @infs);
if (!$mapper) {
$mig->msg(@errs);
$mig->msg($FATAL, 'error_creating_updateconsole_maptbl');
diff --git a/admserv/newinst/src/AdminServer.pm.in
b/admserv/newinst/src/AdminServer.pm.in
index 853fdd7..2056aa3 100644
--- a/admserv/newinst/src/AdminServer.pm.in
+++ b/admserv/newinst/src/AdminServer.pm.in
@@ -306,12 +306,10 @@ sub registerASWithConfigDS {
"@ldifdir(a)/21astasks.ldif.tmpl",
"@ldifdir(a)/22ascommands.ldif.tmpl"
);
- my $setupinf = new Inf("@infdir(a)/setup.inf");
- my $admininf = new Inf("@infdir(a)/admin.inf");
-
+ my @infs = getInfs("admin", "setup");
my $mapper = new Inf("@infdir(a)/adminserver.map");
- $mapper = process_maptbl($mapper, \@errs, $inf, $admininf, $setupinf);
+ $mapper = process_maptbl($mapper, \@errs, $inf, @infs);
if (!$mapper or @errs) {
$conn->close();
$setup->msg(@errs);
diff --git a/admserv/newinst/src/AdminUtil.pm.in b/admserv/newinst/src/AdminUtil.pm.in
index 368983c..496e1ed 100644
--- a/admserv/newinst/src/AdminUtil.pm.in
+++ b/admserv/newinst/src/AdminUtil.pm.in
@@ -23,13 +23,13 @@ require Exporter;
updateAdmConf updateAdmpw updateLocalConf importCACert
getLocalConfigDS getPset registerDSWithConfigDS
registerManyDSWithConfigDS createSubDSNoConn
- registerScatteredDSWithConfigDS
+ registerScatteredDSWithConfigDS getInfs
unregisterDSWithConfigDS isConfigDS addConfigACIsToSubDS);
@EXPORT_OK = qw(getAdmConf getConfigDSConn createConfigDS createSubDS
updateAdmConf updateAdmpw updateLocalConf importCACert
getLocalConfigDS getPset registerDSWithConfigDS
registerManyDSWithConfigDS createSubDSNoConn
- registerScatteredDSWithConfigDS
+ registerScatteredDSWithConfigDS getInfs
unregisterDSWithConfigDS isConfigDS addConfigACIsToSubDS);
# load perldap
@@ -287,12 +287,10 @@ sub createConfigDS {
'@ldifdir(a)/14dsmonitor.mod.tmpl',
'@ldifdir(a)/16dssuffixadmin.mod.tmpl'
);
- my $setupinf = new Inf("@infdir(a)/setup.inf");
- my $admininf = new Inf("@infdir(a)/admin.inf");
- my $dsinf = new Inf("@infdir(a)/slapd.inf");
+ my @infs = getInfs("slapd", "admin", "setup");
my $mapper = new Inf("@infdir(a)/configdsroot.map");
- $mapper = process_maptbl($mapper, $errs, $inf, $dsinf, $admininf, $setupinf);
+ $mapper = process_maptbl($mapper, $errs, $inf, @infs);
if (!$mapper or @{$errs}) {
$conn->close();
if (!@{$errs}) {
@@ -335,12 +333,10 @@ sub internalCreateSubDS {
push @ldiffiles, '@ldifdir(a)/15dspta.mod.tmpl';
}
- my $setupinf = new Inf("@infdir(a)/setup.inf");
- my $admininf = new Inf("@infdir(a)/admin.inf");
- my $dsinf = new Inf("@infdir(a)/slapd.inf");
+ my @infs = getInfs("slapd", "admin", "setup");
my $mapper = new Inf("@infdir(a)/dirserver.map");
- $mapper = process_maptbl($mapper, $errs, $inf, $dsinf, $admininf, $setupinf);
+ $mapper = process_maptbl($mapper, $errs, $inf, @infs);
if (!$mapper or @{$errs}) {
$conn->close();
if (!@{$errs}) {
@@ -418,12 +414,10 @@ sub addConfigACIsToSubDS {
}
my @ldiffiles = ('@ldifdir(a)/16dssuffixadmin.mod.tmpl');
- my $setupinf = new Inf("@infdir(a)/setup.inf");
- my $admininf = new Inf("@infdir(a)/admin.inf");
- my $dsinf = new Inf("@infdir(a)/slapd.inf");
+ my @infs = getInfs("slapd", "admin", "setup");
my $mapper = new Inf("@infdir(a)/dssuffixadmin.map");
- $mapper = process_maptbl($mapper, $errs, $inf, $dsinf, $admininf, $setupinf);
+ $mapper = process_maptbl($mapper, $errs, $inf, @infs);
if (!$mapper or @{$errs}) {
$conn->close();
if (!@{$errs}) {
@@ -868,13 +862,10 @@ sub registerDSWithConfigDSExt {
# remove the Admin Server configuration entries
@ldiffiles = ("@ldifdir(a)/10rm_dsdata.ldif.tmpl");
}
- my $setupinf = new Inf("@infdir(a)/setup.inf");
- my $slapdinf = new Inf("@infdir(a)/slapd.inf");
- my $admininf = new Inf("@infdir(a)/admin.inf");
-
+ my @infs = getInfs("slapd", "setup", "admin");
my $mapper = new Inf("@infdir(a)/dirserver.map");
- $mapper = process_maptbl($mapper, $errs, $inf, $instinf, $slapdinf, $setupinf,
$admininf);
+ $mapper = process_maptbl($mapper, $errs, $inf, $instinf, @infs);
if (!$mapper or @{$errs}) {
if ($needclose) {
$conn->close();
@@ -892,6 +883,32 @@ sub registerDSWithConfigDSExt {
return @{$errs} ? 0 : 1;
}
+# return Inf objects for the given names - the names correspond
+# to .inf file names in the infdir - the list will be ordered
+# so that brand specific names come before generic names -
+# it is assumed in .inf processing that if a value is found
+# in an earlier Inf later Infs will be ignored
+sub getInfs {
+ my @names = @_;
+ my @ary;
+ my @infs = glob("@infdir(a)/*.inf");
+ for my $name (@names) {
+ for my $inffile (@infs) {
+ if ($inffile =~ m,^@infdir(a)/.+-$name\.inf$,) {
+ # brand specific
+ debug(2, "Found brand specific inf file", $inffile);
+ push @ary, new Inf($inffile);
+ }
+ }
+ }
+ # added all brand specific inf files, if any - now add generic inf files
+ for my $name (@names) {
+ push @ary, new Inf("@infdir(a)/$name.inf");
+ }
+
+ return @ary;
+}
+
1;
# emacs settings
commit 71f64883131c375328a53effa7e8f07bbed49790
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Fri May 13 14:57:14 2011 -0600
bump version to 1.1.17
diff --git a/VERSION.sh b/VERSION.sh
index 719e14d..3eaae20 100644
--- a/VERSION.sh
+++ b/VERSION.sh
@@ -11,7 +11,7 @@
vendorurl=http://port389.org
# PACKAGE_VERSION is constructed from these
VERSION_MAJOR=1
VERSION_MINOR=1
-VERSION_MAINT=16
+VERSION_MAINT=17
# if this is a PRERELEASE, set VERSION_PREREL
# otherwise, comment it out
# be sure to include the dot prefix in the prerel