[icedtea-web] RFC: add a command line tool to manipulate configuration
Omair Majid
omajid at redhat.com
Wed Dec 15 09:52:09 PST 2010
Hi,
The attached patch adds a tool named itweb-settings-cli (suggestions on
a better name are welcome!) to read/modify/check the deployment
configuration being used by IcedTea-Web.
The general pattern with using this tool is:
itweb-settings-cli <command> <options to command>
Sample usage:
$ ./itweb-settings-cli help
Usage:
itweb-settings-cli [list|get|set|reset|info|check] [help]
Command line tool to modify, view and check configuration. For help with
a particular command, try: itweb-settings-cli command help
$ ./itweb-settings-cli get help
Usage:
itweb-settings-cli get property-name
Shows the value for property-name
$ ./itweb-settings-cli get deployment.user.cachedir
/home/omajid/.icedtea/cache
$ ./itweb-settings-cli set help
Usage:
itweb-settings-cli set property-name value
Sets the property-name to value if possible. The value is checked for
being valid. If the administrator has locked the property, this will
have no effect
$ ./itweb-settings-cli set deployment.user.cachedir /home/omajid/temp
$ ./itweb-settings-cli get deployment.user.cachedir
/home/omajid/temp
$ ./itweb-settings-cli info deployment.user.cachedir
Description: <Unknown>
Value: /home/omajid/temp
Possible values include the absolute location of a file - it must begin
with a /
Source: /home/omajid/.icedtea/deployment.properties
$ ./itweb-settings-cli reset deployment.user.cachedir
$ ./itweb-settings-cli get deployment.user.cachedir
/home/omajid/.icedtea/cache
$ ./itweb-settings-cli set deployment.proxy.same foobar
Property "deployment.proxy.same" has incorrect value "foobar". Possible
values are true or false.
$ echo $?
1
$ ./itweb-settings-cli get deployment.proxy.same
false
$ ./itweb-settings-cli set foo bar
$ echo $?
0
$ ./itweb-settings-cli list
deployment.proxy.same: false
foo: bar
:
deployment.user.logdir: /home/omajid/.icedtea/log
deployment.user.cachedir: /home/omajid/.icedtea/cache
$ ./itweb-settings-cli check
Unknown property-name "foo"
$ echo "deployment.system.cachedir=_this_is_not_a_path" >>
~/.icedtea/deployment.properties
$ ./itweb-settings-cli check
Property "deployment.system.cachedir" has incorrect value
"_this_is_not_a_path". Possible values include the absolute location of
a file - it must begin with a /.
Unknown property-name "foo"
Any thoughts or comments?
ChangeLog:
2010-12-15 Omair Majid <omajid at redhat.com>
* Makefile.am
(CONTROLPANEL_CLI_LAUNCHER_OBJECTS): New variable.
(all-local): Add itweb-settings-cli
(install-exec-local): Install itweb-settings-cli
(uninstall-local): Uninstall itweb-settings-cli
($(NETX_DIR)/launcher/controlpanel-cli/%.o): New target.
($(NETX_DIR)/launcher/controlpanel-cli/itweb-settings-cli):
Likewise.
* netx/net/sourceforge/jnlp/config/Defaults.java
(getDefaults): Set descriptions to Unknown rather than the name.
Set source to localized form of internal
* netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java
(getProperty): Check for nulls.
(setProperty): Add unknown as description and source for new
properties.
(checkAndFixConfiguration): Fix translation constants. Remove note
about setting to default.
(parsePropertiesFile): Use unknown as description.
* netx/net/sourceforge/jnlp/controlpanel/CommandLine.java: New file
(CommandLine): New method.
(handleHelpCommand): Likewise.
(printListHelp): Likewise.
(handleListCommand): Likewise.
(printGetHelp): Likewise.
(handleGetCommand): Likewise.
(printSetHelp): Likewise.
(handleSetCommand): Likewise.
(printResetHelp): Likewise.
(handleResetCommand): Likewise.
(printInfoHelp): Likewise.
(handleInfoCommand): Likewise.
(printCheckHelp): Likewise.
(handleCheckCommand): Likewise.
(handle): Likewise.
(main): Likewise.
* netx/net/sourceforge/jnlp/resources/Messages.properties: Add
Usage, Unknown, RConfigurationFatal, DCIncorrectValue,
DCSourceInternal, DCUnknownSettingWithName, VVPossibleValues,
CLNoInfo, CLValue, CLValueSource, CLDescription, CLUnknownCommand
CLUnknownProperty, CLNoIssuesFound, CLIncorrectValue,
CLListDescription, CLGetDescription, CLSetDescription,
CLResetDescription, CLInfoDescription, CLCheckDescription and
CLHelpDescription. Remove DCErrorInSetting and
DCUnknownSettingWithVal.
Cheers,
Omair
-------------- next part --------------
A non-text attachment was scrubbed...
Name: command-line-control-panel-05.patch
Type: text/x-patch
Size: 24917 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101215/bec74b12/command-line-control-panel-05.patch
More information about the distro-pkg-dev
mailing list