diff options
| author | jdennis <jdennis@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2010-11-19 20:38:34 +0000 |
|---|---|---|
| committer | jdennis <jdennis@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2010-11-19 20:38:34 +0000 |
| commit | 8cc59e74076bd92c70c6425018c21a6143ba542f (patch) | |
| tree | 55a287d4daa52bc6071631efc1f4cf807743d6a5 /pki/cmake/Modules/UseJavaClassFilelist.cmake | |
| parent | 43cccf7e4c8fa9f99ac5f0b79ab1a994223ca17d (diff) | |
Enhance file template utility: process_file_template()
The following changes were made:
1) Add a template name. Previously I had found it difficult to
correlate the output in the log file with a specific invocation of
process_file_template() in the code. The file pathnames aren't much
help because they never appear in the code as something you can search
on.
2) Be more efficient with file operations. Previously the code would:
a) read a line from the file
b) strip the newline off
c) add the newline back
d) concatenate the munged line to a string variable
That's an incredibly inefficient way to assign the contents of a file to
a string variable. Now the code just uses the standard Perl function
read_file() to assign the file contents to a string variable
3) Previously the code would claim it performed a substitution for
every substitution in the substitution table even if the substitution
was not performed, that's useless information. Now the code reports
exactly which substitutions were made along with a count of how many
times that substitution was made.
4) Optionally dump to the log the contents of the file after it was
processed for debugging purposes.
5) Update all calls to process_file_template. At the same time utilize
the new utilities for setting file properties (e.g. permission & ownership)
Example of new logging information written to log file
------------------------------------------------------
Processing PKI templates for '/var/lib/pki-ca' ...
Template (pki_cfg) "/usr/share/pki/ca/conf/CS.cfg" ==> "/etc/pki-ca/CS.cfg" ...
1 substitutions: TOMCAT_SERVER_PORT ==> "9701"
1 substitutions: PKI_RANDOM_NUMBER ==> "YLmLqrJOD10jrIdUwefc"
8 substitutions: PKI_MACHINE_NAME ==> "vm-117.idm.lab.bos.redhat.com"
7 substitutions: PKI_FLAVOR ==> "pki"
2 substitutions: PKI_EE_SECURE_PORT ==> "9444"
3 substitutions: PKI_INSTANCE_ROOT ==> "/var/lib"
68 substitutions: PKI_INSTANCE_PATH ==> "/var/lib/pki-ca"
18 substitutions: PKI_INSTANCE_ID ==> "pki-ca"
2 substitutions: PKI_EE_SECURE_CLIENT_AUTH_PORT ==> "9446"
1 substitutions: PKI_SECURE_PORT ==> "9443"
1 substitutions: PKI_SUBSYSTEM_TYPE ==> "ca"
3 substitutions: PKI_AGENT_SECURE_PORT ==> "9443"
1 substitutions: PKI_GROUP ==> "pkiuser"
1 substitutions: INSTALL_TIME ==> "Mon Oct 11 22:11:14 2010"
2 substitutions: PKI_ADMIN_SECURE_PORT ==> "9445"
1 substitutions: PKI_USER ==> "pkiuser"
2 substitutions: PKI_UNSECURE_PORT ==> "9180"
122 substitutions were made in '/etc/pki-ca/CS.cfg'
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@1546 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki/cmake/Modules/UseJavaClassFilelist.cmake')
0 files changed, 0 insertions, 0 deletions
