Alpha |
Version: | 9.2.3 - "Suhail" |
Last update: | 2021-05-21 14:43:31 |
Introduction
This document explains how to update Alpha. It covers two different
aspects of the question:
AlphaTcl is the open-source library of Tcl scripts that implements most of
Alpha's functionality. The fact that most of Alpha's functionality is
implemented in Tcl scripts makes it easy to modify Alpha, and implementing a
new feature or fixing a bug is mostly done in AlphaTcl. For this reason,
the AlphaTcl library is frequently revised, and these revisions can easily
be retrieved and installed into your copy of Alpha, as described in this
document.
The AlphaTcl library is hosted by SourceForge inside the AlphaCocoa project and its files are controlled by
Subversion (aka svn) which is a version control system. In
order to access this repository and retrieve the most recent version, you
need the Subversion svn client installed on your machine. It comes
preinstalled with Mac OSX 10.5 or higher. To view the contents of the
repository, you can use the Subversion Repository Browser.
There are basically three methods to update the AlphaTcl library
depending on your working environment:
- using the Alpha ↣ Global Setup ↣ Update Alpha menu items from the running application as explained in this
document. This is appropriate in the case of a released version of Alpha
(probably installed in the /Applications folder). See
the AlphaTcl Update Instructions section.
- using the Makefile facility as explained in the Technical Note
TN #3: How to update AlphaTcl under development. This is appropriate in the case
of a built version of Alpha.
- using the updateAlphaTcl command line tool. This tool is
executed from a Terminal window and is able to update the library in any
Alpha binary (released, development, etc.). It is documented in the Update AlphaTcl Help file. Note that
this method may also be triggered from Alpha (transparently, as if it were
the first one) as explained in the Implementations
section.
Warning: these methods are mutually exclusive.
You should not maintain two different working copies of the AlphaTcl
library (because the one handled by the second method would corrupt the one
handled by the first method). Which one is to be preferred is discussed in
the section Pros and Cons of Updating Methods.
Check for Software Updates
Alpha has a mechanism to automatically check for software updates, that is
to say new official releases of the application. This check is performed
periodically (every two days) in the background during Alpha's
startup. This is a multi-step process running like this:
- The information about the latest release is contained in a file called
release_info.json stored on Alpha's project page at SourceForge.
This file is downloaded periodically in a background thread during startup.
The last check time is cached in the
PREFS
folder and Alpha won't
check again if this date is less than two days from now.
- Next time Alpha is launched, it reads the release info and, if it
detects that a new release is available, it proposes to download and
install it.
One may also ask manually for an immediate check for udpates by selecting the
Alpha ↣ Global Setup ↣ Update Alpha ↣ Check for Updates menu item. In that case, Alpha immediately looks for a newer
version of the application and, if it finds one, it offers to download and
install the new release, or just download it (for later installation).
Note that all these methods require an internet connection.
AlphaTcl Update Instructions
To update the AlphaTcl library, go to the submenu Update Alpha in the
application menu (Alpha ↣ Global Setup ↣ Update Alpha).
This submenu has three relevant commands:
- AlphaTcl User Update
- AlphaTcl Developer Checkout
- AlphaTcl Developer Update
If you plan to update only once, the first command is recommended.
If you plan to update frequently, use first the AlphaTcl Developer Checkout
(and subsequently AlphaTcl Developer Update).
The first time you interact with the SourceForge Subversion server, you may be
prompted to accept a server certificate, and you have to press P
to
proceed. (Don't worry about messages like "Error validating server
certificate". It isn't really an error, it just means your computer
doesn't recognise the SourceForge server, which after all is natural if it
never interacted with it before).
Technical details
Here is exactly what the menu items do:
- The AlphaTcl User Update item executes an svn export
command. This means retrieving the most recent contents of the repository
without any Subversion administrative files. This is appropriate for users
who just want a fresh version of the files and do not need to place them
under version control.
- The AlphaTcl Developer Checkout item executes an svn checkout command. This means retrieving a complete working copy including the
Subversion administrative files. This is required for developers who make
modifications in the AlphaTcl library and want the files to be under
Subversion control (in order to commit their changes to the repository),
and is also the most convenient for anyone doing frequent updates. You only
execute AlphaTcl Developer Checkout once: subsequently you use the AlphaTcl Developer Update item instead.
- The AlphaTcl Developer Update item executes an svn update
command. This is only possible if previously a checkout command has been
issued, so that the files are already under Subversion control (which means
that the administrative files are already present). This method is
efficient because the svn update command is clever and only
retrieves the files that have been modified in the repository since the
last time you updated.
Implementations
The updating functionality, available from the Alpha ↣ Global Setup ↣ Update Alpha menu item, is implemented as an xserv service and Alpha currently offers two implementations for this
service:
- from 'Alpha'
- this implementation performs the update by executing the appropriate
commands from within Alpha. A progress window is displayed and gives
feedback about the files which are received. The downside of this method
is that it does not allow any interaction and thus fails in case the user
is asked to enter a password or to confirm a certificate. Normally no
interaction should be necessary though.
- from 'Terminal'
- this implementation performs the update from a Terminal window
(which finally amounts to applying the third method from Alpha). It launches the
Terminal application and executes the appropriate command therein.
All the output is printed in the terminal window. If the user is asked to
enter a password, this is done in this window. Upon completion, you have to
switch back manually to Alpha (and usually are requested to restart the
application). This implementation makes use of the command line tool
described in the next section.
In order to choose an implementation, select the menu item Alpha ↣ Global Setup ↣ Helper Applications and look for
the UpdateAlphaTcl service in the Files category. Click on
the arrow button and, in the dialog that is displayed, select either from 'Alpha' or from 'Terminal'.
Command line tool
Since version 9.0.1, Alpha provides an extra command line tool called updateAlphaTcl to perform the AlphaTcl updates (User or Developer) from
a Terminal window, rather than from inside the application.
Some users may prefer this way of updating because the command line tool
displays a lot of information in the terminal window during its execution.
See the updateAlphaTcl Help page for more
information about this script.
Pros and Cons of Updating Methods
This section discusses the two methods available to update the AlphaTcl library: the method using the commands of the Alpha ↣ Global Setup ↣ Update Alpha menu, and the method using the
Makefile facility as explained in the Technical Note TN #3: How to update AlphaTcl under development.
Both methods are about updating the AlphaTcl library which is located
inside the application's bundle. Any file that needs to be updated will
finally have to be somehow copied to this library.
If you are just an Alpha user and have no intention of diving into the
code, your best choice is to execute the AlphaTcl User Update described
above.
If you are a developer and intend to make code changes, commit them
to the repository, etc. you need to have a working copy and you may wonder
which updating method is preferable. Recall that both methods are incompatible. You have to choose one.
Pros and cons of the first method
The first method (which is described in this document) turns the AlphaTcl
library into a working copy. So there is no need of transferring files from
the working copy to the library: they are already in place. When updating,
the files are imported directly to their final destination. This certainly
is an advantage.
On the other side, there are disadvantages:
- when you install a new release of the application, you have to
extract a new working copy.
- it is awkward to work inside an application's bundle in a deeply
buried subdirectory.
- you have only one part of Alpha's code (the library, not the core and
the rest).
- this method is not interactive. Yet it may happen that the updating
process asks for some sort of authentication or certificate confirmation.
In that case, you have no way to reply and the update will fail. If you
were updating from a Terminal window (second and third methods), you would
be able to type an answer.
Using this method, you will only be able to update the library and will not
benefit from changes made in other parts of the software. This method is an
inheritance of the old AlphaX application.
Pros and cons of the second method
This method is described in the Technical Note TN #3: How to update AlphaTcl under development. The
main drawback is that the modified files have to be copied from the working
copy to their final destination inside the application's bundle. Not really
a problem though since this is all done automatically for you by the make command when you update from the repository. On the other hand,
each time you make changes in a file locally, you must not forget to
install it in the bundle: the following make command does it for
you
make alphatcl-sync
The advantages are:
- all the code (library, core, tests, doc, etc.) is kept in a single location.
- it is easily accessible.
- this working copy remains available when a new version of the
application is released.
If you want to have the big picture and be able to look into the code of
the application's core, into the documentation's sources, into the
resources (images, icons), the tests, etc. this is the preferred method.
Pros and cons of the third method
This method is described in the Update AlphaTcl Help file.
The advantages are the same as with the second method, and
additionally you may update the AlphaTcl library in any version of Alpha
(released version as well as built version under development).
The only drawback is that it requires typing an instruction in the
Terminal and some users might find this scary. But... examples are provided
here and... Alpha is able
to type and send the instruction for you as explained in the Implementations section.
License and Disclaimer
This document has been placed in the public domain.
Copyright (c) 2021, the Alpha Community.
All rights reserved.
This software is free software and distributed under
the terms of the new BSD license:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of the Alpha Community nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ALPHA COMMUNITY BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.