I think we should be able to differentiate between a TWiki.org Release installation and a patched Distribution version (like the
TWikiOnDebian package)
to achieve this I would like to add a TWIKIDISTRIBUTIONVERSION variable
should this be set in TWiki.pm where TWiki::wikiVersion is set?
I have done a quick version while i was playing with the patch in
PrefsDotPm
Index: bin/testenv
===================================================================
RCS file: /cvsroot/twiki/twiki/bin/testenv,v
retrieving revision 1.56
diff -r1.56 testenv
354c354,358
< print "OK, $mod.pm found (TWiki version: <b>$mod_version</b>)";
---
>
> my $mod_distributionVersion = eval '$TWiki::distributionVersion';
> $mod_distributionVersion ||= 'unknown';
>
> print "OK, $mod.pm found (TWiki version: <b>$mod_version</b> - $mod_distributionVersion distribution)";
Index: lib/TWiki.pm
===================================================================
RCS file: /cvsroot/twiki/twiki/lib/TWiki.pm,v
retrieving revision 1.253
diff -r1.253 TWiki.pm
65c65
< $attachAsciiPath $scriptSuffix $wikiversion
---
> $attachAsciiPath $scriptSuffix $wikiversion $distributionVersion
120a121,122
> # TWiki distributionVersion
> $distributionVersion = "TWiki.org Beta";
2045a2048
> $_[0] =~ s/%WIKIDISTRIBUTIONVERSION%/$distributionVersion/g;
--
SvenDowideit - 02 Jan 2004
So far we only had the need to distinguish between Beta releases and Production releases. The
TWikiPreferences variable
WIKITOOLNAME is used for that (set to
TWiki or
TWikibeta).
A variable for the type of distribution is a logical extension, also since we will have distributions done by different parties. "Distribution Version" could be misleading since it does not contain a version number. How about calling it simply "TWiki Distribution", that is, variable
$twikiDistribution and
%TWIKIDISTRIBUTION% (set to
TWiki.org Beta,
TWiki.org Production,
TWiki Debian Stable, etc).
--
PeterThoeny - 02 Jan 2004
- yep, I'm happy to name it TWIKIDISTRIBUTION
- are you happy for it to be set in TWiki.pm, and for distributors to patch it?
TODO
- rename to TWIKIDISTRIBUTION
- needs to be a FinalPreference
- Does not apply since it is a TWiki.pm setting, not a preferences setting -- PeterThoeny - 02 Jan 2004
- add to TWiki
- docco it for Distributors..
--
SvenDowideit - 02 Jan 2004
While you're at it, can we have a standard for plugin versions as well. An xxxx_DISTRIBUTION variable would do the trick. Thanks.
--
CrawfordCurrie - 03 Jan 2004
yes, but what do you mean for the xxxx_bit?
I was thinking 0 to get the version of a plugin (using a hook, that if not there is set to
before Cairo
--
SvenDowideit - 03 Jan 2004
now that I am doing some more work on my Work's TWiki - I also want a TWIKITOPICSVERSION (or something) that tell you what version of the Man, TWiki webs etc taht you have installed. I'm going to try to figure out how to simplify the upgrade (I'm using the TWiki code from cvs, and TWiki, Main and
WebTemplate topics from a 2001 release) I think i've just noticed that
WebSearch does not work... and I want the
AdminTools topics....).
what do you guys think of using a diff&patch mechanism to update from&to different versions (is there a way to get to the rcs files on twiki.org? (i mean using http/ftp...)
--
SvenDowideit - 06 Jan 2004
Another suggestion:
- Use a numeric "build number" (678, 764, ...) perl var so that one can easily check in plugins the level of the code with simple numeric comparisons, something hard with the current
$TWiki::wikiversion ("01 Feb 2003"). For instance KoalaSkin must do things differently before and after the Dec 2003 beta, the status of the distrib (beta/alpha) being irrelevant in this case.
- Use similar %FEATUREVERSION{...}% returning a build number that would be set by any plugin/addon/patch to describe available features. Examples: %FEATUREVERSION{"Debian"}% = 3, %FEATUREVERSION{"Servertime"}% = 1. The above build number could be just another feature, as %FEATUREVERSION{"TWiki"}%
PS: I do not think having something like
%FEATUREVERSION{"Debian"}% = "stable" would be of any use, as what is
"stable" will evolve in time and so cannot be used to know exactly what is actually installed.
On installscripts: one could imagine having a directory
lib/TWiki/featureversions containing one-liners files as:
-
04Debian.pm containing: $featureVersion{"Debian"} = 3;
-
50Koalaskin.pm containing $featureVersion{"Koalaskin"} = 212;
-
03savemulti.pm containing $featureVersion{"savemulti"} = 4;
Installing would thus only:
- create / remove files in this dir
- do a
cat lib/TWiki/featureversions/[0-9]*.pm > lib/TWiki/featureversions.pm
With TWiki.pm importing
lib/TWiki/featureversions.pm, and then setting
$featureVersion{"TWiki"} (to prevent it being redefined), and mapping %FEATUREVERSION{...}% to $featureVersion{...}%
Importing
lib/TWiki/featureversions.pm would be efficient (loading only one file, only once at init with mod_perl) and flexible with its build from independant files (avoiding the problem of context in patching with diffs). Using numeric
build numbers is the only way to have manageable automatic dependency control
--
ColasNahaboo - 06 Jan 2004
Regarding Plugins, TWiki already has version numbers:
- Plugins.pm has
$TWiki::Plugins::VERSION that gets reved up when there is a change in the Plugin API. The header part of the Plugins indicate the callback functions with rev number when introduced.
- Plugin modules also have a $VERSION that can be used by Plugin dependencies.
--
PeterThoeny - 06 Jan 2004
OK, I see it. I was going to flame you for not documenting the VERSIOn protocol, but it is described in
TWikiPlugins. mea culpa. Looks like most folks are as lazy as me about updating it, though - even the author of
SpreadSheetPlugin 
- which rather limits it's usefulness. It would probably be more useful if it could be combined with that md5sum checksum that was being discussed.
--
CrawfordCurrie - 06 Jan 2004
Refactored out
PluginVersionVariable
--
PeterThoeny - 14 Aug 2004
See also the
DistributionContrib which provides a mapping between such variables.
--
MartinCleaver - 27 Sep 2004