ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activetcl
activetcl
[Activetcl] Proposed Teacup behaviour change
by Andreas Kupries other posts by this author
May 14 2008 11:17AM messages near this date
view in the new Beta List Site
Re: [Activetcl] Driving M$ IE | Re: [Activetcl] Proposed Teacup behaviour change
Introduction
=============

The currently documented behaviour of teacup is that it stores its
preferences aka settings aka configuration under the directory
"$HOME/.teapot/config/", and that the default hardwired locations for its
index cache and default installation repository are subdirectories of
""$HOME/.teapot/".

The major effect of this behaviour is that the settings are shared between
multiple installations of ActiveTcl. A user working with such has to
explicitly switch the location of the default installation directory during
work, and a major source of problems is forgetting to do so. In different
words, a consequence of the sharing and source of bad surprises is that a
'teacup' application of installation A will manipulate the repository of a
different installation B if the configuration was switched to point to B.
See http://bugs.activestate.com/show_bug.cgi?id=76295 for a bug coming out
this.

The recent change to ActiveTcl which moved the standard repository to
<installdir> /lib/teapot, i.e. giving multiple installations separate
repositories, while good in general, actually exacerbated the problem, or
maybe exposed it more strongly.

Proposal
========

Therefore, to continue the trend of separating the information used by
different installations of ActiveTcl, we *propose* the following changes to
the behaviour of teacup:

(1)	The most deeply hardwired default location for the installation
	repository used by teacup is changed from "$HOME/.teapot/repository"
	to
		${INSTALLDIR}/lib/teapot

	assuming that teacup is located at

		${INSTALLDIR}/bin/teacup

	I.e. the repository location is changed to be computed relative to the
	location of teacup itself.

	This makes the default location truly dependent on the location of the
	installation and will cause a teacup for installation A to manipulate
	only the repository of A, with the only exception explicit requests by
	the user, be it through --at, or changing it via 'teacup default'.

(2)	The hard-wired location of the teacup configuration is changed from

		$HOME/.teapot/config
	to
		$HOME/.teapot/$INSTALLATION_CODE/config

	where $INSTALLATION_CODE is a string dependent on the chosen INSTALLDIR
	and the platform teacup is run on. It is actually the normalized INSTALLDIR
	with colons and slashes mapped to their hex encodings, and the platform
code
	appended.

	Example:
		The configuration for a teacup installed at /usr/local/bin/teacup
		will be stored under

			$HOME/.teapot/%2fusr%2flocal-PLATFORM/config

	By keeping the location in a subdirectory of $HOME we avoid possible
	permission problems, i.e. write denied, even when the user accesses some
	global installation in admin owned directories.

	Adding in the INSTALLDIR dependent component then separates out the data
for
	multiple installations by their path. The platform dependent information is
	necessary in case a user sees multiple installations in the same path
through
	NFS mounts, dependent on the host and platform it accesses the
installations
	from.

(3)	In a similar manner the default location of the index cache is changed
	from
		$HOME/.teapot/indexcache
	to
		$HOME/.teapot/$INSTALLATION_CODE/indexcache


Compatibility and migration
===========================

(a)	Existing installations of ActiveTcl and teacup continue to operate
	unchanged.

(b)	When updating the teacup of an existing installation to a new teacup
	having the changed behaviour the new teacup will copy the existing
	configuration from
		$HOME/.teapot/config
	to
		$HOME/.teapot/$INSTALLATION_CODE/config
	and then start to work independent of it.

	I.e. it will notice on its first call that it doesn't have
	$HOME/.teapot/$INSTALLATION_CODE/config, but that there is
	$HOME/.teapot/config, and use that to trigger the migration.

(c)	If multiple installations of older ActiveTcl's exist, then
	upgrading all of their teacups and then using them in turn
	will trigger each migration.

	There the user has to check after the migration that each
	installation got the correct locations for installation
	repository and index cache from the migrated configuration,
	and adjust them if necessary.

(d)	Future releases of ActiveTcl containing teacups with the
	modified behaviour will do the same type of configuration
	migration during the installation, with the installer
	setting the repository location correctly.

	Note: With the existing behaviour the repository location
	in the shared configuration will always point to the ActiveTcl
	which was installed last. With the proposed behaviour the
	shared configuration of older ActiveTcl installations is left
	unchanged.


Closing
=======

Does anybody have any thoughts on these proposed behavior changes for
teacup?


--
	Andreas Kupries <andreask@[...].com> 
	Developer @ http://www.ActiveState.com
	Tel: +1 778-786-1122


_______________________________________________
ActiveTcl mailing list
ActiveTcl@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Andreas Kupries
Andreas Kupries
Larry W. Virden
Andreas Kupries

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved