Changeset 827


Ignore:
Timestamp:
11/20/08 13:04:58 (3 years ago)
Author:
CrawfordCurrie
Message:

Item175: BuildContrib now builds both Foswiki and TWiki targeted plugins. If you want to target both, then target TWiki. TWiki plugins require the TWikiCompatibilityContrib to be installed.

Location:
trunk
Files:
2 deleted
15 edited
1 copied
3 moved

Legend:

Unmodified
Added
Removed
  • trunk/BuildContrib/data/System/BuildContrib.txt

    r672 r827  
    1 ---+!! NextWiki Developer Environment 
     1---+!! Foswiki Developer Environment 
    22<div style="float:right"> 
    33<a href="http://wikiring.com"><img src="%ATTACHURLPATH%/logo.gif" title="WikiRing: Professional Wiki Innovation and Support" /></a> 
     
    2121!BuildContrib can be used to create a build script for your extension. 
    2222It is inspired by the Java ANT build tool developed by the Apache project, 
    23 but is targeted specifically at building NextWiki (and TWiki&trade;) extensions. It is also 
    24 used for NextWiki release builds. The advantage of using !BuildContrib is that it 
     23but is targeted specifically at building Foswiki (and TWiki&trade;) extensions. It is also 
     24used for Foswiki release builds. The advantage of using !BuildContrib is that it 
    2525dictates a standard structure and build procedure, which makes your extension 
    2626easier for you, and others, to build and maintain. 
     
    6262 
    6363---++ Standard directory structure 
    64 !BuildContrib is used to build the NextWiki core, as well as most extensions. This 
     64!BuildContrib is used to build the Foswiki core, as well as most extensions. This 
    6565document will focus on its use for building extensions. See the 
    6666=tools/build.pl= file in a subversion checkout for information on building 
     
    7474installation tree. Every plugin has some _key files_: 
    7575   * =lib/= 
    76       * =TWiki/= 
     76      * =Foswiki/= 
    7777         * =Plugins/= 
    7878            * <code><i>name</i>.pm</code> - code file for the plugin, usually derived 
     
    8787               * =Config.spec= - =configure= setup for this extension 
    8888   * =data/= 
    89       * =TWiki/= 
     89      * =System/= 
    9090         * <code><i>name</i>.txt</code> - your plugin/contrib topic 
    9191   * =test/= 
     
    9494           extension 
    9595   * =pub/= 
    96       * =TWiki/= 
     96      * =System/= 
    9797         * <code><i>name</i>/</code> - directory where all your images, css, and Javascript files should go 
    98 Contribs are held in the =lib/TWiki/Contrib= directory instead of =lib/TWiki/Plugins= but otherwise in exactly work the same way. 
    99  
    100 Other directories normally found in a NextWiki installation may also exist under 
     98Contribs are held in the =lib/TWiki/Contrib= directory instead of =lib/Foswiki/Plugins= but otherwise in exactly work the same way. 
     99 
     100Other directories normally found in a Foswiki installation may also exist under 
    101101a root directory e.g. =bin=, =templates= etc. 
    102102 
    103 While development in a subversion checkout is *strongly* recommended, it is also possible to develop in a normal TWiki install. To do this, simply install the !BuildContrib. 
     103While development in a subversion checkout is *strongly* recommended, it is also possible to develop in a normal Foswiki install. To do this, simply install the !BuildContrib. 
    104104 
    105105---++ Setting up for Development 
     
    114114---+++ Environment Variables 
    115115 
    116 Your build script has to know how to find the NextWiki libraries, so it can 
    117 pick up the components of the build system. Set =TWIKI_LIBS= (which is a 
     116Your build script has to know how to find the Foswiki libraries, so it can 
     117pick up the components of the build system. Set =FOSWIKI_LIBS= (which is a 
    118118path, same as =PERL5LIB=) to point to your =lib= directory in your development 
    119 NextWiki. =$TWIKI_LIBS= is used to extend @INC _for the duration of the build 
     119Foswiki. =$FOSWIKI_LIBS= is used to extend @INC _for the duration of the build 
    120120only_, so it won't mask problems during testing. 
    121121 
    122 The approach we _recommend_ is to set =TWIKI_LIBS= in your login script (e.g. =.login=, =.csh=, =.profile= depending on what shell you prefer). 
     122The approach we _recommend_ is to set =FOSWIKI_LIBS= in your login script (e.g. =.login=, =.csh=, =.profile= depending on what shell you prefer). 
    123123 
    124124<blockquote style="background-color: #ddf"> 
    125 *EXPERTS* =build.pl= does *not* read =bin/setlib.cfg=. It uses =$TWIKI_LIBS= only to find the modules for the !BuildContrib. 
     125*EXPERTS* =build.pl= does *not* read =bin/setlib.cfg=. It uses =$FOSWIKI_LIBS= only to find the modules for the !BuildContrib. 
    126126</blockquote> 
    127127 
     
    154154The default target is =test=. The !BuildContrib is designed so that most common behaviour is catered for. It is also easy to _override_ any of the default targets in your =build.pl= and add extra behaviours. 
    155155 
    156 Note that there is a shortcut script, =twikiplugins/build.pl=, that can be very helpful when you are building several extensions in one session. Run the script without parameters for documentation. 
    157  
    158156---+++ The =build= target 
    159157Does nothing by default. This is the first target executed, and can be overridden by your build.pl to do something unusual - for example, executing an ANT file to build some Java. 
     
    168166---+++ The =tidy= target 
    169167This target runs Perl::Tidy (with default formatting options) over your 
    170 source code. This reformats the code consistently with the NextWiki 
     168source code. This reformats the code consistently with the Foswiki 
    171169coding standards. 
    172170 
     
    203201For example, 
    204202<verbatim> 
    205 data/TWiki/BathPlugin.txt 0664 Plugin description topic 
    206 lib/TWiki/Plugins/BathPlugin.pm 0444 Plugin code module 
     203data/System/BathPlugin.txt 0664 Plugin description topic 
     204lib/Foswiki/Plugins/BathPlugin.pm 0444 Plugin code module 
    207205</verbatim> 
    208206If no permissions are given, permissions are guessed from the permissions on 
     
    226224   * unit tests 
    227225 
    228 MANIFESTs can also include other extensions that have been packages using 
     226MANIFESTs can also include other extensions that have been packaged using 
    229227!BuildContrib. For example, 
    230228<verbatim> 
    231 !include twikiplugins/WysiwygPlugin/lib/TWiki/Plugins/WysiwygPlugin 
     229!include WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin 
    232230</verbatim> 
    233231This will include the !WysiwygPlugin in the release package. 
    234232 
    235 Note that there is a script in the NextWiki =tools= directory called =check_manifest.pl= that can be run at any time to check the contents of your MANIFEST against what is checked into Subversion. 
     233Note that there is a script in the Foswiki =tools= directory called =check_manifest.pl= that can be run at any time to check the contents of your MANIFEST against what is checked into Subversion. 
    236234 
    237235---++ DEPENDENCIES 
     
    248246The installer script written by the build process uses the dependency type 
    249247to decide how to install dependant modules. 'cpan' means 'get the module 
    250 from CPAN' and 'perl' means 'get the module from the Plugins web on NextWiki.org' 
    251 (or whatever other repositories the admin has specified using =$TWIKI_PACKAGES= 
     248from CPAN' and 'perl' means 'get the module from the Plugins web on Foswiki.org' 
     249(or whatever other repositories the admin has specified using =$FOSWIKI_PACKAGES= 
    252250or =$PLUGINS_URL=). 
    253251 
     
    255253When your module (the _depender_) depends on another module (a _dependee_), it is important to think carefully about what version of the dependee your module requires. 
    256254 
    257 When you are working with NextWiki modules (such as contribs and plugins) you should list the version number of the module that you tested with. Normally you will want to use a <code>&gt;</code> condition, so that more recent versions will also work. If a dependency on a NextWiki module fails (because the module isn't installed, for example) then the installer script will pull *the latest version* of the module from NextWiki.org, whether that is the required version or not. This is a limitation of the way plugins are stored on NextWiki.org. 
     255When you are working with Foswiki modules (such as contribs and plugins) you should list the version number of the module that you tested with. Normally you will want to use a <code>&gt;</code> condition, so that more recent versions will also work. If a dependency on a Foswiki module fails (because the module isn't installed, for example) then the installer script will pull *the latest version* of the module from Foswiki.org, whether that is the required version or not. This is a limitation of the way plugins are stored on Foswiki.org. 
    258256 
    259257When you are working with CPAN modules, you need to take account of the fact that there are *two types* of CPAN modules; _built-ins_ and _add-ons_. 
     
    276274File::Munge,>0,cpan,... 
    277275ONLYIF ($File::Munge::VERSION < 1.025) 
    278 TWiki::FixOldFileFind, >=1.000, perl, Optional, only required if we have an old version of File::Munge. 
     276MyPackage::FixOldFileFind, >=1.000, perl, Optional, only required if we have an old version of File::Munge. 
    279277</verbatim> 
    280278The =ONLYIF= only applies to the next dependency in the file. 
     
    286284      * =perl create_new_extension.pl BathPlugin= 
    287285      * if you are working in a Subversion checkout, move the directory just created up one level to be at the same level as =core=. 
    288    1 Edit =lib/TWiki/Plugins/BathPlugin.pm= as required to create your 
     286   1 Edit =lib/Foswiki/Plugins/BathPlugin.pm= as required to create your 
    289287     plugin functionality 
    290    1 Edit =lib/TWiki/Plugins/BathPlugin/MANIFEST= and make sure it lists 
     288   1 Edit =lib/Foswiki/Plugins/BathPlugin/MANIFEST= and make sure it lists 
    291289     all the files you want to include in the release package 
    292290During development we recommend you use the =pseudo-install.pl= script to 
     
    310308These optional files are embedded into the template install script 
    311309at the appropriate stage of the installation. Read 
    312 =lib/TWiki/Contrib/BuildContrib/TEMPLATE_installer.pl= (in the !BuildContrib) 
     310=lib/Foswiki/Contrib/BuildContrib/TEMPLATE_installer.pl= (in the !BuildContrib) 
    313311to see how they fit in. The POD comments in that module indicate the functions 
    314312that are most likely to be useful to anyone writing a script extension. 
     
    330328When you are almost ready to release, you should  
    331329   1 Build a release package and installer 
    332       * =cd twikiplugins/BathPlugin/lib/TWiki/Plugins/BathPlugin= 
     330      * =cd BathPlugin/lib/TWiki/Plugins/BathPlugin= 
    333331      * =perl build.pl release= 
    334332   1 Remove the softlinked version from your dev install 
     
    337335   1 Install the release package you just built: 
    338336      * =cd= _dev install_ 
    339       * =perl twikiplugins/BathPlugin/BathPlugin_installer= 
     337      * =perl BathPlugin/BathPlugin_installer= 
    340338   1 Test. 
    341339 
     
    344342and in the installer script. The following tokens are supported: 
    345343   * =%$<nop>MANIFEST%= - table of files in MANIFEST 
    346    * =%$<nop>FILES%= - hash keyed on file name mapping to permissions i.e. 'data/TWiki/ThsiTopic.txt' => 0664, 'lib/TWiki/Plugins/BlahPlugin.pm' => 0775 
     344   * =%$<nop>FILES%= - hash keyed on file name mapping to permissions i.e. 'data/System/ThsiTopic.txt' => 0664, 'lib/TWiki/Plugins/BlahPlugin.pm' => 0775 
    347345   * =%$<nop>DEPENDENCIES%= - list of dependencies from DEPENDENCIES 
    348346   * =%$<nop>VERSION%= value of $VERSION 
     
    363361When you are happy the release package is built correctly, you can 
    364362upload it. 
    365    * =cd twikiplugins/BathPlugin/lib/TWiki/Plugins/BathPlugin= 
     363   * =cd BathPlugin/lib/TWiki/Plugins/BathPlugin= 
    366364   * =perl build.pl upload= 
    367 By default the =upload= target will upload to NextWiki.org. You will be prompted 
     365By default the =upload= target will upload to Foswiki.org. You will be prompted 
    368366to enter an alternate upload target, should you require it (e.g. to upload to 
    369367private corporate repository). The upload updates the topic and any associated 
     
    377375The installer script shipped with the package is very simple. By default all 
    378376it does is to check the dependencies you list, and if necessary download and 
    379 install any missing NextWiki and CPAN modules. Other dependencies are simply 
    380 checked. In TWiki-4.0 and later releases, topics shipped with the 
     377install any missing Foswiki and CPAN modules. Other dependencies are simply 
     378checked. Topics shipped with the 
    381379module are automatically merged into any existing local copies, ensuring 
    382380histories are preserved. 
     
    389387 
    390388---++ Installation Instructions 
    391 You are strongly recommended to use this Contrib to help split your code development away from your live NextWiki environment, as described [[#DevelopmentModel][above]]. 
     389You are strongly recommended to use this Contrib to help split your code development away from your live Foswiki environment, as described [[#DevelopmentModel][above]]. 
    392390 
    393391%$INSTALL_INSTRUCTIONS% 
    394392 
    395393---++ Contrib Info 
    396 Another great NextWiki/TWiki extension from the <a style="text-decoration:none" href="http://wikiring.com"><img src="%ATTACHURLPATH%/wikiringlogo20x20.png" alt="" /> *WikiRing* </a> - __Working together to improve your wiki experience__! 
     394Another great Foswiki extension from the <a style="text-decoration:none" href="http://wikiring.com"><img src="%ATTACHURLPATH%/wikiringlogo20x20.png" alt="" /> *WikiRing* </a> - __Working together to improve your wiki experience__! 
    397395 
    398396TWiki&trade; is a trademark of Peter Thoeny. 
  • trunk/BuildContrib/lib/Foswiki/Contrib/Build.pm

    r603 r827  
    1313# http://www.gnu.org/copyleft/gpl.html 
    1414# 
    15 package TWiki::Contrib::Build; 
    16  
    17 use TWiki::Contrib::BuildContrib::BaseBuild; 
     15package Foswiki::Contrib::Build; 
     16 
     17use Foswiki::Contrib::BuildContrib::BaseBuild; 
    1818use Error qw(:try); 
    1919use CGI qw(:any); 
    2020 
    21 =begin twiki 
    22  
    23 ---++ Package TWiki::Contrib::Build 
    24  
    25 This is a base class used for making build scripts for TWiki packages. 
     21=begin foswiki 
     22 
     23---++ Package Foswiki::Contrib::Build 
     24 
     25This is a base class used for making build scripts for Foswiki packages. 
    2626 
    2727---+++ Methods 
     
    4848# It is *not* used by the build automation tools, but is reported as part 
    4949# of the version number in PLUGINDESCRIPTIONS. 
    50 our $RELEASE = 'NextWiki-1'; 
     50our $RELEASE = 'Foswiki-1'; 
    5151 
    5252our $SHORTDESCRIPTION = 
    5353  'Automate build process for Plugins, Add-ons and Contrib modules'; 
    5454 
    55 my $TWIKIORGPUB    = 'http://nextwiki.org/pub'; 
    56 my $TWIKIORGSCRIPT = 'http://nextwiki.org/bin'; 
    57 my $TWIKIORGSUFFIX = ''; 
    58 my $TWIKIORGBUGS   = 'http://nextwiki.org/Tasks'; 
    59 my $TWIKIORGEXTENSIONSWEB = "Extensions"; 
     55my $UPLOADSITEPUB    = 'http://foswiki.org/pub'; 
     56my $UPLOADSITESCRIPT = 'http://foswiki.org/bin'; 
     57my $UPLOADSITESUFFIX = ''; 
     58my $UPLOADSITEBUGS   = 'http://foswiki.org/Tasks'; 
     59my $UPLOADSITEEXTENSIONSWEB = "Extensions"; 
    6060 
    6161my $GLACIERMELT = 10;    # number of seconds to sleep between uploads, 
    6262                         # to reduce average load on server 
     63 
     64my $targetProject = 'Foswiki';# May change to 'TWiki' 
    6365 
    6466my $collector;           # general purpose handle for collecting stuff 
     
    9698 
    9799    # Find the lib root 
    98     $libpath = _findRelativeTo( $buildpldir, 'lib/TWiki' ); 
    99     die 'Could not find lib/TWiki' unless $libpath; 
     100    $libpath = _findRelativeTo( $buildpldir, 'lib/Foswiki' ); 
     101    unless ($libpath) { 
     102        $libpath = _findRelativeTo( $buildpldir, 'lib/TWiki' ); 
     103        $targetProject = 'TWiki'; 
     104    } 
     105    die 'Could not find lib/Foswiki or lib/TWiki' unless $libpath; 
    100106    $libpath =~ s#/[^/]*$##; 
    101107 
     
    103109    $basedir =~ s#/[^/]*$##; 
    104110 
    105     if ( $ENV{TWIKI_LIBS} ) { 
     111    my $env = $ENV{uc($targetProject).'_LIBS'}; 
     112    if ( $env ) { 
    106113        my %known; 
    107114        map { $known{$_} = 1 } split( /:/, @INC ); 
    108         foreach my $pc ( reverse split( /:/, $ENV{TWIKI_LIBS} ) ) { 
     115        foreach my $pc ( reverse split( /:/, $env ) ) { 
    109116            unless ( $known{$pc} ) { 
    110117                unshift( @INC, $pc ); 
     
    117124} 
    118125 
    119 =begin twiki 
     126=begin foswiki 
    120127 
    121128---++++ new($project) 
     
    134141 
    135142    # Constants with internet paths 
    136     $this->{BUGSURL} = $TWIKIORGBUGS; 
     143    $this->{BUGSURL} = $UPLOADSITEBUGS; 
    137144 
    138145    $this->{project} = $project; 
     
    160167    $this->{basedir} = $basedir; 
    161168 
    162     # The following paths are all relative to the root of the twiki 
     169    # The following paths are all relative to the root of the  
    163170    # installation 
    164171 
     
    167174    $this->{libdir} = $libpath; 
    168175    if ( $this->{project} =~ /Plugin$/ ) { 
    169         $this->{libdir} .= '/TWiki/Plugins'; 
     176        $this->{libdir} .= "/$targetProject/Plugins"; 
    170177    } 
    171178    elsif ( $this->{project} =~ /(Contrib|Skin)$/ ) { 
    172         $this->{libdir} .= '/TWiki/Contrib'; 
     179        $this->{libdir} .= "/$targetProject/Contrib"; 
    173180    } 
    174181 
     
    178185 
    179186    my $stubpath = $this->{pm}; 
    180     $stubpath =~ s/.*[\\\/](TWiki[\\\/].*)\.pm/$1/; 
     187    $stubpath =~ s/.*[\\\/]($targetProject[\\\/].*)\.pm/$1/; 
    181188    $stubpath =~ s/[\\\/]/::/g; 
    182189 
    183190    # where data files live 
    184     $this->{data_twiki} = 'data/TWiki'; 
     191    $this->{data_systemdir} = 
     192      ($targetProject eq 'TWiki') ? 'data/TWiki' : 'data/System'; 
    185193 
    186194    # the root of the name of data files 
    187     $this->{data_twiki_module} = $this->{data_twiki} . '/' . $this->{project}; 
     195    $this->{topic_root} = $this->{data_systemdir} . '/' . $this->{project}; 
    188196 
    189197    ############################################################## 
     
    192200    my $manifest = _findRelativeTo( $buildpldir, 'MANIFEST' ); 
    193201    if (!defined($manifest)) { 
    194         #the twiki core MANIFEST is in the lib dir, not the tools dir 
     202        #the core MANIFEST is in the lib dir, not the tools dir 
    195203        $manifest = _findRelativeTo( $libpath, 'MANIFEST' ); 
    196204    } 
    197205    ( $this->{files}, $this->{other_modules} ) = 
    198       TWiki::Contrib::BuildContrib::BaseBuild::readManifest( $this->{basedir}, 
     206      Foswiki::Contrib::BuildContrib::BaseBuild::readManifest( $this->{basedir}, 
    199207        '', $manifest, sub { exit(1) } ); 
    200208 
    201     # Generate a TWiki table representing the manifest contents 
     209    # Generate a table representing the manifest contents 
    202210    # and a hash table representing the files 
    203211    my $mantable  = ''; 
     
    221229    my $dependancies = _findRelativeTo( $buildpldir, 'DEPENDENCIES' ); 
    222230    if (!defined($dependancies)) { 
    223         #the twiki core DEPENDENCIES is in the lib dir, not the tools dir 
     231        #the core DEPENDENCIES is in the lib dir, not the tools dir 
    224232        $dependancies = _findRelativeTo( $libpath, 'DEPENDENCIES' ); 
    225233    } 
     
    297305    } 
    298306    else { 
    299         $this->{UPLOADTARGETPUB} = $TWIKIORGPUB 
     307        $this->{UPLOADTARGETPUB} = $UPLOADSITEPUB 
    300308          unless defined $this->{UPLOADTARGETPUB}; 
    301         $this->{UPLOADTARGETSCRIPT} = $TWIKIORGSCRIPT 
     309        $this->{UPLOADTARGETSCRIPT} = $UPLOADSITESCRIPT 
    302310          unless defined $this->{UPLOADTARGETSCRIPT}; 
    303         $this->{UPLOADTARGETSUFFIX} = $TWIKIORGSUFFIX 
     311        $this->{UPLOADTARGETSUFFIX} = $UPLOADSITESUFFIX 
    304312          unless defined $this->{UPLOADTARGETSUFFIX}; 
    305         $this->{UPLOADTARGETWEB} = $TWIKIORGEXTENSIONSWEB 
     313        $this->{UPLOADTARGETWEB} = $UPLOADSITEEXTENSIONSWEB 
    306314          unless defined $this->{UPLOADTARGETWEB}; 
    307315    } 
     
    504512} 
    505513 
    506 =begin twiki 
     514=begin foswiki 
    507515 
    508516---++++ pushd($dir) 
     
    523531} 
    524532 
    525 =begin twiki 
     533=begin foswiki 
    526534 
    527535---++++ popd() 
     
    544552} 
    545553 
    546 =begin twiki 
     554=begin foswiki 
    547555 
    548556---++++ rm($file) 
     
    567575} 
    568576 
    569 =begin twiki 
     577=begin foswiki 
    570578 
    571579---++++ makepath($to) 
     
    580588} 
    581589 
    582 =begin twiki 
     590=begin foswiki 
    583591 
    584592---++++ cp($from, $to) 
     
    617625} 
    618626 
    619 =begin twiki 
     627=begin foswiki 
    620628 
    621629---++++ prot($perms, $file) 
     
    632640} 
    633641 
    634 =begin twiki 
     642=begin foswiki 
    635643 
    636644---++++ sys_action(@params) 
     
    656664} 
    657665 
    658 =begin twiki 
     666=begin foswiki 
    659667 
    660668---++++ perl_action($cmd) 
     
    675683} 
    676684 
    677 =begin twiki 
     685=begin foswiki 
    678686 
    679687---++++ target_build 
     
    686694} 
    687695 
    688 =begin twiki 
     696=begin foswiki 
    689697 
    690698---++++ target_compress 
     
    715723} 
    716724 
    717 =begin twiki 
     725=begin foswiki 
    718726 
    719727---++++ target_tidy 
     
    762770} 
    763771 
    764 =begin twiki 
     772=begin foswiki 
    765773 
    766774---++++ target_test 
     
    814822} 
    815823 
    816 =begin twiki 
     824=begin foswiki 
    817825 
    818826---++++ filter_txt 
     
    834842 
    835843    # Replace the SVN revision with rev 1. 
    836     # In TWiki builds this gets replaced by latest revision later. 
     844    # In release builds this gets replaced by latest revision later. 
    837845    $text =~ s/^(%META:TOPICINFO{.*)\$Rev:.*\$(.*}%)$/${1}1$2/m; 
    838846    $text =~ s/%\$(\w+)%/&_expand($this,$1)/geo; 
     
    861869} 
    862870 
    863 =begin twiki 
     871=begin foswiki 
    864872 
    865873---++++ build_js 
     
    904912} 
    905913 
    906 =begin twiki 
     914=begin foswiki 
    907915 
    908916---++++ build_css 
     
    947955} 
    948956 
    949 =begin twiki 
     957=begin foswiki 
    950958 
    951959---++++ filter_pm($from, $to) 
     
    974982} 
    975983 
    976 =begin twiki 
     984=begin foswiki 
    977985 
    978986---++++ target_release 
     
    10001008} 
    10011009 
    1002 =begin twiki 
     1010=begin foswiki 
    10031011 
    10041012---++++ target_stage 
     
    10291037        } 
    10301038    } 
    1031     if ( -e $this->{tmpDir} . '/' . $this->{data_twiki_module} . '.txt' ) { 
    1032         $this->cp( $this->{tmpDir} . '/' . $this->{data_twiki_module} . '.txt', 
     1039    if ( -e $this->{tmpDir} . '/' . $this->{topic_root} . '.txt' ) { 
     1040        $this->cp( $this->{tmpDir} . '/' . $this->{topic_root} . '.txt', 
    10331041            $this->{basedir} . '/' . $project . '.txt' ); 
    10341042    } 
     
    10401048            print STDERR "Installing $module in $this->{tmpDir}\n"; 
    10411049            print 
    1042 `export TWIKI_HOME=$this->{tmpDir}; export TWIKI_LIBS=$libs; cd $basedir/$module; perl build.pl handsoff_install`; 
    1043         } 
    1044     } 
    1045 } 
    1046  
    1047 =begin twiki 
     1050`export FOSWIKI_HOME=$this->{tmpDir}; export FOSWIKI_LIBS=$libs; cd $basedir/$module; perl build.pl handsoff_install`; 
     1051        } 
     1052    } 
     1053} 
     1054 
     1055=begin foswiki 
    10481056 
    10491057---++++ target_archive 
     
    11191127} 
    11201128 
    1121 =begin twiki 
     1129=begin foswiki 
    11221130 
    11231131---++++ copy_fileset 
     
    11461154} 
    11471155 
    1148 =begin twiki 
     1156=begin foswiki 
    11491157 
    11501158---++++ apply_perms 
     
    11641172} 
    11651173 
    1166 =begin twiki 
     1174=begin foswiki 
    11671175 
    11681176---++++ target_handsoff_install 
    1169 Install target, installs to local twiki pointed at by TWIKI_HOME. 
     1177Install target, installs to local install pointed at by FOSWIKI_HOME. 
    11701178 
    11711179Does not run the installer script. 
     
    11771185    $this->build('release'); 
    11781186 
    1179     my $twiki = $ENV{TWIKI_HOME}; 
    1180     die 'TWIKI_HOME not set' unless $twiki; 
    1181     $this->pushd($twiki); 
     1187    my $home = $ENV{FOSWIKI_HOME}; 
     1188    die 'FOSWIKI_HOME not set' unless $home; 
     1189    $this->pushd($home); 
    11821190    $this->sys_action( 'tar', 'zxpf', 
    11831191        $this->{basedir} . '/' . $this->{project} . '.tgz' ); 
    11841192 
    11851193    # kill off the module installer 
    1186     $this->rm( $twiki . '/' . $this->{project} . '_installer' ); 
     1194    $this->rm( $home . '/' . $this->{project} . '_installer' ); 
    11871195    $this->popd(); 
    11881196} 
    11891197 
    1190 =begin twiki 
     1198=begin foswiki 
    11911199 
    11921200---++++ target_install 
    1193 Install target, installs to local twiki pointed at by TWIKI_HOME. 
     1201Install target, installs to local twiki pointed at by FOSWIKI_HOME. 
    11941202 
    11951203Uses the installer script written by target_installer 
     
    12031211} 
    12041212 
    1205 =begin twiki 
     1213=begin foswiki 
    12061214 
    12071215---++++ target_uninstall 
    1208 Uninstall target, uninstall from local twiki pointed at by TWIKI_HOME. 
     1216Uninstall target, uninstall from local twiki pointed at by FOSWIKI_HOME. 
    12091217 
    12101218Uses the installer script written by target_installer 
     
    12141222sub target_uninstall { 
    12151223    my $this  = shift; 
    1216     my $twiki = $ENV{TWIKI_HOME}; 
    1217     die 'TWIKI_HOME not set' unless $twiki; 
    1218     $this->pushd($twiki); 
     1224    my $home = $ENV{FOSWIKI_HOME}; 
     1225    die 'FOSWIKI_HOME not set' unless $home; 
     1226    $this->pushd($home); 
    12191227    $this->sys_action( 'perl', $this->{project} . '_installer', 'uninstall' ); 
    12201228    $this->popd(); 
     
    12231231{ 
    12241232 
    1225     package TWiki::Contrib::Build::UserAgent; 
     1233    package Foswiki::Contrib::Build::UserAgent; 
    12261234    use base qw(LWP::UserAgent); 
    12271235 
     
    12961304} 
    12971305 
    1298 =begin twiki 
     1306=begin foswiki 
    12991307 
    13001308---++++ target_upload 
     
    13511359    $this->build('release'); 
    13521360    my $userAgent = 
    1353       new TWiki::Contrib::Build::UserAgent( $this->{UPLOADTARGETSCRIPT}, 
     1361      new Foswiki::Contrib::Build::UserAgent( $this->{UPLOADTARGETSCRIPT}, 
    13541362        $this ); 
    13551363    $userAgent->agent( 'ContribBuild/' . $VERSION . ' ' ); 
     
    13931401        $newform{'text'} = <IN_FILE>; 
    13941402        close(IN_FILE); 
    1395  
    1396         # Hack to avoid revisions being overwritten on twiki.org. 
    1397         # Can be removed when twiki.org is upgraded to 4.1.0. 
    1398         # Item3216, Item3454 
    1399         $newform{'text'} =~ s/^%META:TOPICINFO{.*}%$//m; 
    14001403    } 
    14011404    else { 
     
    14101413 
    14111414    # Upload any 'Var*.txt' topics published by the extension 
    1412     my $dataDir = $this->{basedir} . '/data/TWiki'; 
     1415    my $dataDir = $this->{basedir} . '/data/System'; 
    14131416    if ( opendir( DIR, $dataDir ) ) { 
    14141417        foreach my $f ( grep( /^Var\w+\.txt$/, readdir DIR ) ) { 
    1415             if ( open( IN_FILE, '<' . $this->{basedir} . '/data/TWiki/' . $f ) ) 
     1418            if ( open( IN_FILE, '<' . $this->{basedir} . '/data/System/' . $f ) ) 
    14161419            { 
    14171420                %newform = ( text => <IN_FILE> ); 
     
    14451448 
    14461449            $this->_uploadAttachment( $userAgent, $user, $pass, $name, 
    1447                 $this->{basedir} . '/pub/TWiki/' . $this->{project} . '/' . $name, 
     1450                $this->{basedir} . '/pub/System/' . $this->{project} . '/' . $name, 
    14481451                $comment, $attrs =~ /h/ ? 1 : 0 ); 
    14491452            $uploaded{$name} = 1; 
     
    14751478 
    14761479If you want to report an error in the topic, please raise a report at 
    1477 http://nextwiki.org/view/Tasks/$this->{project} 
     1480http://foswiki.org/view/Tasks/$this->{project} 
    14781481--> 
    14791482EXTRA 
     
    15561559# is intended for use by developers only. 
    15571560 
    1558 # POD text in =.pm= files should use TWiki syntax or HTML. Packages should be 
     1561# POD text in =.pm= files should use TML syntax or HTML. Packages should be 
    15591562# introduced with a level 1 header, ---+, and each method in the package by 
    15601563# a level 2 header, ---++. Make sure you document any global variables used 
     
    15881591} 
    15891592 
    1590 =begin twiki 
     1593=begin foswiki 
    15911594 
    15921595---++++ target_POD 
    15931596 
    15941597Print POD documentation. This target does not modify any files, it simply 
    1595 prints the (TWiki format) POD. 
    1596  
    1597 POD text in =.pm= files should use TWiki syntax or HTML. Packages should be 
     1598prints the (TML format) POD. 
     1599 
     1600POD text in =.pm= files should use TML syntax or HTML. Packages should be 
    15981601introduced with a level 1 header, ---+, and each method in the package by 
    15991602a level 2 header, ---++. Make sure you document any global variables used 
     
    16081611} 
    16091612 
    1610 =begin twiki 
     1613=begin foswiki 
    16111614 
    16121615---++++ target_installer 
    16131616 
    16141617Write an install/uninstall script that checks dependencies, and optionally 
    1615 downloads and installs required zips from twiki.org. 
     1618downloads and installs required zips from foswiki.org. 
    16161619 
    16171620The install script is templated from =contrib/TEMPLATE_installer= and 
     
    16221625 
    16231626The install script works using the dependency type and version fields. 
    1624 It will try to download from twiki.org to satisfy any missing dependencies. 
     1627It will try to download from foswiki.org to satisfy any missing dependencies. 
    16251628Downloaded modules are automatically installed. 
    16261629 
    16271630Note that the dependencies will only work if the module depended on follows 
    16281631the naming standards for zips i.e. it must be attached to the topic in 
    1629 twiki.org and have the same name as the topic, and must be a zip file. 
     1632foswiki.org and have the same name as the topic, and must be a zip file. 
    16301633 
    16311634Dependencies on CPAN modules are also checked (type perl) but no attempt 
     
    16681671        chop($dir); 
    16691672        my $file = 
    1670           $dir . '/lib/TWiki/Contrib/BuildContrib/TEMPLATE_installer.pl'; 
     1673          $dir . '/lib/Foswiki/Contrib/BuildContrib/TEMPLATE_installer.pl'; 
    16711674        if ( -f $file ) { 
    16721675            $template = $file; 
     
    17121715} 
    17131716 
    1714 =begin twiki 
     1717=begin foswiki 
    17151718 
    17161719---++++ build($target) 
     
    17381741} 
    17391742 
    1740 =begin twiki 
     1743=begin foswiki 
    17411744 
    17421745---++++ target_manifest 
     
    17811784 
    17821785sub _manicollect { 
    1783     if (/^(CVS|\.svn|twikiplugins)$/) { 
     1786    if (/^(CVS|\.svn)$/) { 
    17841787        $File::Find::prune = 1; 
    17851788    } 
     
    17981801} 
    17991802 
    1800 =begin twiki 
     1803=begin foswiki 
    18011804 
    18021805#HistoryTarget 
     
    18121815    my $this = shift; 
    18131816 
    1814     my $f = $this->{basedir} . '/' . $this->{data_twiki_module} . '.txt'; 
     1817    my $f = $this->{basedir} . '/' . $this->{topic_root} . '.txt'; 
    18151818 
    18161819    my $cmd = "cd $this->{basedir} && svn status"; 
     
    19471950} 
    19481951 
    1949 =begin twiki 
     1952=begin foswiki 
    19501953 
    19511954---++++ target_dependencies 
     
    19661969    die "B::PerlReq is required for 'dependencies': $@" if $@; 
    19671970 
    1968     foreach my $m 
    1969       qw(strict vars diagnostics base bytes constant integer locale overload warnings Assert TWiki) 
    1970     { 
     1971    foreach my $m ( 
     1972        'strict', 
     1973        'vars', 
     1974        'diagnostics', 
     1975        'base', 
     1976        'bytes', 
     1977        'constant', 
     1978        'integer', 
     1979        'locale', 
     1980        'overload', 
     1981        'warnings', 
     1982        'Assert', 
     1983        $targetProject ) { 
    19711984        $this->{satisfied}{$m} = 1; 
    19721985    } 
     
    20532066automatic installer script written using the Build<nop>Contrib. 
    20542067   * If you have TWiki 4.2 or later, you can install from the =configure= interface (Go to Plugins->Find More Extensions) 
    2055       * See the [[http://nextwiki.org/Extensions/BuildContribInstallationSupplement][installation supplement]] on TWiki.org for more information. 
     2068      * See the [[http://foswiki.org/Extensions/BuildContribInstallationSupplement][installation supplement]] on TWiki.org for more information. 
    20562069   * If you have any problems, then you can still install manually from the command-line: 
    20572070      1 Download one of the =.zip= or =.tgz= archives 
  • trunk/BuildContrib/lib/Foswiki/Contrib/BuildContrib/BaseBuild.pm

    r14 r827  
    1313# http://www.gnu.org/copyleft/gpl.html 
    1414# 
    15 package TWiki::Contrib::BuildContrib::BaseBuild; 
     15package Foswiki::Contrib::BuildContrib::BaseBuild; 
    1616 
    1717use strict; 
    1818 
    19 =begin twiki 
     19=begin foswiki 
    2020 
    21 ---++ Package TWiki::Contrib::BuildContrib::BaseBuild 
     21---++ Package Foswiki::Contrib::BuildContrib::BaseBuild 
    2222 
    2323This is a class used to provide all the services required for 
     
    3131my $NL = "\n"; 
    3232 
    33 =begin twiki 
     33=begin foswiki 
    3434 
    3535---++++ readManifest($baseDir,$path,$file,$manifest,$noManifestFileHook) => \@files 
     
    4646optional octal permissions mask and a description; for example, 
    4747<verbatim> 
    48 data/TWiki/MyPlugin.txt 0664 Plugin description topic 
     48data/System/MyPlugin.txt 0664 Plugin description topic 
    4949</verbatim> 
    5050If no permissions are given, permissions are guessed from the permissions 
     
    126126} 
    127127 
    128 =begin twiki 
     128=begin foswiki 
    129129 
    130130---++++ findInINC($fileName) => $path 
  • trunk/BuildContrib/lib/Foswiki/Contrib/BuildContrib/MANIFEST

    r14 r827  
    1 data/TWiki/BuildContrib.txt 0444 Description 
    2 lib/TWiki/Contrib/Build.pm 0444 Code module 
    3 lib/TWiki/Contrib/BuildContrib/BaseBuild.pm 0444 Common functionality for build programs 
    4 lib/TWiki/Contrib/BuildContrib/build.pl 0555 Build script 
    5 lib/TWiki/Contrib/BuildContrib/TEMPLATE_installer.pl 0444 Installer template 
    6 pub/TWiki/BuildContrib/logo.gif 0444 Image 
     1data/System/BuildContrib.txt 0444 Description 
     2lib/Foswiki/Contrib/Build.pm 0444 Code module 
     3lib/Foswiki/Contrib/BuildContrib/BaseBuild.pm 0444 Common functionality for build programs 
     4lib/Foswiki/Contrib/BuildContrib/build.pl 0555 Build script 
     5lib/Foswiki/Contrib/BuildContrib/TEMPLATE_installer.pl 0444 Installer template 
     6pub/System/BuildContrib/logo.gif 0444 Image 
    77create_new_extension.pl 0555 Wizard for creating new extensions 
    8 pub/TWiki/BuildContrib/wikiringlogo20x20.png 0660 
     8pub/System/BuildContrib/wikiringlogo20x20.png 0660 
    99build.pl 0750 Interface to build scripts 
  • trunk/BuildContrib/lib/Foswiki/Contrib/BuildContrib/TEMPLATE_installer.pl

    r548 r827  
    33# Install script for %$MODULE% 
    44# 
    5 # Copyright (C) 2004-2007 NextWiki Contributors. All Rights Reserved. 
    6 # NextWiki Contributors are listed in the AUTHORS file in the root of 
     5# Copyright (C) 2004-2007 Foswiki Contributors. All Rights Reserved. 
     6# Foswiki Contributors are listed in the AUTHORS file in the root of 
    77# this distribution. NOTE: Please extend that file, not this notice. 
    88# 
     
    5555=cut 
    5656 
    57 # This is all done in package TWiki so that reading LocalSite.cfg and TWiki.cfg 
     57# This is all done in package Foswiki so that reading LocalSite.cfg and Foswiki.cfg 
    5858# will put the config vars into the right namespace. 
    59 package TWiki; 
     59package Foswiki; 
    6060 
    6161# The root of package URLs 
     
    139139} 
    140140 
    141 TWiki::Extender::install( $PACKAGES_URL, '%$MODULE%', '%$ROOTMODULE%', @DATA ); 
     141Foswiki::Extender::install( $PACKAGES_URL, '%$MODULE%', '%$ROOTMODULE%', @DATA ); 
    142142 
    1431431; 
  • trunk/BuildContrib/lib/Foswiki/Contrib/BuildContrib/build.pl

    r736 r827  
    44# plugin or contrib and edit. 
    55# 
    6 # Read the comments at the top of lib/TWiki/Contrib/Build.pm for 
     6# Read the comments at the top of lib/Foswiki/Contrib/Build.pm for 
    77# details of how the build process works, and what files you 
    88# have to provide and where. 
    99# 
    10 # Requires the environment variable TWIKI_LIBS (a colon-separated path 
     10# Requires the environment variable FOSWIKI_LIBS (a colon-separated path 
    1111# list) to be set to point at the build system and any required dependencies. 
    1212# Usage: ./build.pl [-n] [-v] [target] 
     
    1616# -n Don't actually do anything, just print commands 
    1717# -v Be verbose 
    18 # 
    19  
    2018# Standard preamble 
    2119BEGIN { 
    22     unshift @INC, split( /:/, $ENV{TWIKI_LIBS} ); 
     20    unshift @INC, split( /:/, $ENV{FOSWIKI_LIBS} ); 
    2321} 
    2422 
    25 use TWiki::Contrib::Build; 
     23use Foswiki::Contrib::Build; 
    2624 
    2725# Declare our build package 
    2826package BuildBuild; 
    29 use base qw( TWiki::Contrib::Build ); 
     27use base qw( Foswiki::Contrib::Build ); 
    3028 
    3129sub new { 
  • trunk/PreferencesPlugin/data/System/DefaultPreferencesForm.txt

    r693 r827  
    1818| ATTACHEDIMAGEFORMAT | textarea | | \t* $comment: <br /><img src="%ATTACHURLPATH%/$name" alt="$comment" $size /> | Text | S | 
    1919| WIKITOOLNAME | text | 30 | TWiki | Site name | S | 
    20 | WEBLOGONAME | text | 30 | T-logo-158x45.gif | Filename of a logo image | S | 
     20| WEBLOGONAME | text | 30 | banner.gif | Filename of a logo image | S | 
    2121| WEBLOGOIMG | text | 30 | %PUBURL%/%BASEWEB%/%WEBPREFSTOPIC%/%WEBLOGONAME% | URL of a logo image | S | 
    2222| WEBLOGOURL | text | 30 | %SCRIPTURL%/view%SCRIPTSUFFIX%/%BASEWEB%/%HOMETOPIC% | URL under the logo | S | 
    2323| WEBLOGOALT | text | 30 | Home | Logo tooltip text of the logo | S | 
    2424| WIKILOGOIMG | text | 30 | %PUBURL%/%SYSTEMWEB%/ProjectLogos/horzTWiki.gif | URL of a logo image | S | 
    25 | WIKILOGOURL | text | 30 | http://TWiki.org/ | URL under the logo| S | 
     25| WIKILOGOURL | text | 30 | http://Foswiki.org/ | URL under the logo| S | 
    2626| WIKILOGOALT | text | 30 | Powered by TWiki | Logo tooltip text of the logo | S | 
    2727| WIKIWEBLIST | textarea | | [[%MAINWEB%.%HOMETOPIC%][%MAINWEB%]] %SEP% [[%SYSTEMWEB%.%HOMETOPIC%][%SYSTEMWEB%]] %SEP% [[Sandbox.%HOMETOPIC%][Sandbox]] | | S | 
  • trunk/TWikiCompatibilityPlugin/lib/TWiki/Func.pm

    r811 r827  
    1 BEGIN { $Package::Alias::BRAVE = 1 } 
    2 use Package::Alias 
    3   'TWiki::Plugins' => 'Foswiki::Plugins', 
    4   'TWiki::Func' => 'Foswiki::Func'; 
     1# See bottom of file for license and copyright information 
     2package TWiki::Func; 
     3 
     4# Bridge between TWiki::Func and Foswiki::Func 
     5 
     6use strict; 
     7 
     8use Foswiki::Func; 
     9 
     10sub getSkin { Foswiki::Func::getSkin(@_) } 
     11sub getUrlHost { Foswiki::Func::getUrlHost(@_) } 
     12sub getScriptUrl { Foswiki::Func::getScriptUrl(@_) } 
     13sub getViewUrl { Foswiki::Func::getViewUrl(@_) } 
     14sub getPubUrlPath { Foswiki::Func::getPubUrlPath(@_) } 
     15sub getExternalResource { Foswiki::Func::getExternalResource(@_) } 
     16sub getCgiQuery { Foswiki::Func::getCgiQuery(@_) } 
     17sub getSessionKeys { Foswiki::Func::getSessionKeys(@_) } 
     18sub getSessionValue { Foswiki::Func::getSessionValue(@_) } 
     19sub setSessionValue { Foswiki::Func::setSessionValue(@_) } 
     20sub clearSessionValue { Foswiki::Func::clearSessionValue(@_) } 
     21sub getContext { Foswiki::Func::getContext(@_) } 
     22sub pushTopicContext { Foswiki::Func::pushTopicContext(@_) } 
     23sub popTopicContext { Foswiki::Func::popTopicContext(@_) } 
     24sub getPreferencesValue { Foswiki::Func::getPreferencesValue(@_) } 
     25sub getPluginPreferencesValue { Foswiki::Func::getPluginPreferencesValue(@_) } 
     26sub getPreferencesFlag { Foswiki::Func::getPreferencesFlag(@_) } 
     27sub getPluginPreferencesFlag { Foswiki::Func::getPluginPreferencesFlag(@_) } 
     28sub setPreferencesValue { Foswiki::Func::setPreferencesValue(@_) } 
     29sub getDefaultUserName { Foswiki::Func::getDefaultUserName(@_) } 
     30sub getCanonicalUserID { Foswiki::Func::getCanonicalUserID(@_) } 
     31sub getWikiName { Foswiki::Func::getWikiName(@_) } 
     32sub getWikiUserName { Foswiki::Func::getWikiUserName(@_) } 
     33sub wikiToUserName { Foswiki::Func::wikiToUserName(@_) } 
     34sub userToWikiName { Foswiki::Func::userToWikiName(@_) } 
     35sub emailToWikiNames { Foswiki::Func::emailToWikiNames(@_) } 
     36sub wikinameToEmails { Foswiki::Func::wikinameToEmails(@_) } 
     37sub isGuest { Foswiki::Func::isGuest(@_) } 
     38sub isAnAdmin { Foswiki::Func::isAnAdmin(@_) } 
     39sub isGroupMember { Foswiki::Func::isGroupMember(@_) } 
     40sub eachUser { Foswiki::Func::eachUser(@_) } 
     41sub eachMembership { Foswiki::Func::eachMembership(@_) } 
     42sub eachGroup { Foswiki::Func::eachGroup(@_) } 
     43sub isGroup { Foswiki::Func::isGroup(@_) } 
     44sub eachGroupMember { Foswiki::Func::eachGroupMember(@_) } 
     45sub checkAccessPermission { Foswiki::Func::checkAccessPermission(@_) } 
     46sub getListOfWebs { Foswiki::Func::getListOfWebs(@_) } 
     47sub webExists { Foswiki::Func::webExists(@_) } 
     48sub createWeb { Foswiki::Func::createWeb(@_) } 
     49sub moveWeb { Foswiki::Func::moveWeb(@_) } 
     50sub eachChangeSince { Foswiki::Func::eachChangeSince(@_) } 
     51sub getTopicList { Foswiki::Func::getTopicList(@_) } 
     52sub topicExists { Foswiki::Func::topicExists(@_) } 
     53sub checkTopicEditLock { Foswiki::Func::checkTopicEditLock(@_) } 
     54sub setTopicEditLock { Foswiki::Func::setTopicEditLock(@_) } 
     55sub saveTopic { Foswiki::Func::saveTopic(@_) } 
     56sub saveTopicText { Foswiki::Func::saveTopicText(@_) } 
     57sub moveTopic { Foswiki::Func::moveTopic(@_) } 
     58sub getRevisionInfo { Foswiki::Func::getRevisionInfo(@_) } 
     59sub getRevisionAtTime { Foswiki::Func::getRevisionAtTime(@_) } 
     60sub readTopic { Foswiki::Func::readTopic(@_) } 
     61sub readTopicText { Foswiki::Func::readTopicText(@_) } 
     62sub attachmentExists { Foswiki::Func::attachmentExists(@_) } 
     63sub readAttachment { Foswiki::Func::readAttachment(@_) } 
     64sub saveAttachment { Foswiki::Func::saveAttachment(@_) } 
     65sub moveAttachment { Foswiki::Func::moveAttachment(@_) } 
     66sub readTemplate { Foswiki::Func::readTemplate(@_) } 
     67sub loadTemplate { Foswiki::Func::loadTemplate(@_) } 
     68sub expandTemplate { Foswiki::Func::expandTemplate(@_) } 
     69sub writeHeader { Foswiki::Func::writeHeader(@_) } 
     70sub redirectCgiQuery { Foswiki::Func::redirectCgiQuery(@_) } 
     71sub addToHEAD { Foswiki::Func::addToHEAD(@_) } 
     72sub expandCommonVariables { Foswiki::Func::expandCommonVariables(@_) } 
     73sub renderText { Foswiki::Func::renderText(@_) } 
     74sub internalLink { Foswiki::Func::internalLink(@_) } 
     75sub sendEmail { Foswiki::Func::sendEmail(@_) } 
     76sub wikiToEmail { Foswiki::Func::wikiToEmail(@_) } 
     77sub expandVariablesOnTopicCreation { Foswiki::Func::expandVariablesOnTopicCreation(@_) } 
     78sub registerTagHandler { Foswiki::Func::registerTagHandler(@_) } 
     79sub registerRESTHandler { Foswiki::Func::registerRESTHandler(@_) } 
     80sub decodeFormatTokens { Foswiki::Func::decodeFormatTokens(@_) } 
     81sub searchInWebContent { Foswiki::Func::searchInWebContent(@_) } 
     82sub getWorkArea { Foswiki::Func::getWorkArea(@_) } 
     83sub readFile { Foswiki::Func::readFile(@_) } 
     84sub saveFile { Foswiki::Func::saveFile(@_) } 
     85sub getRegularExpression { Foswiki::Func::getRegularExpression(@_) } 
     86sub normalizeWebTopicName { Foswiki::Func::normalizeWebTopicName(@_) } 
     87sub sanitizeAttachmentName { Foswiki::Func::sanitizeAttachmentName(@_) } 
     88sub spaceOutWikiWord { Foswiki::Func::spaceOutWikiWord(@_) } 
     89sub writeWarning { Foswiki::Func::writeWarning(@_) } 
     90sub writeDebug { Foswiki::Func::writeDebug(@_) } 
     91sub formatTime { Foswiki::Func::formatTime(@_) } 
     92sub isTrue { Foswiki::Func::isTrue(@_) } 
     93sub isValidWikiWord { Foswiki::Func::isValidWikiWord(@_) } 
     94sub extractParameters { Foswiki::Func::extractParameters(@_) } 
     95sub extractNameValuePair { Foswiki::Func::extractNameValuePair(@_) } 
     96sub getScriptUrlPath { Foswiki::Func::getScriptUrlPath(@_) } 
     97sub getWikiToolName { Foswiki::Func::getWikiToolName(@_) } 
     98sub getMainWebname { Foswiki::Func::getMainWebname(@_) } 
     99sub getTwikiWebname { Foswiki::Func::getTwikiWebname(@_) } 
     100sub getOopsUrl { Foswiki::Func::getOopsUrl(@_) } 
     101sub permissionsSet { Foswiki::Func::permissionsSet(@_) } 
     102sub getPublicWebList { Foswiki::Func::getPublicWebList(@_) } 
     103sub formatGmTime { Foswiki::Func::formatGmTime(@_) } 
     104sub getDataDir { Foswiki::Func::getDataDir(@_) } 
     105sub getPubDir { Foswiki::Func::getPubDir(@_) } 
     106sub checkDependencies { Foswiki::Func::checkDependencies(@_) } 
    5107 
    61081; 
     109 
     110__DATA__ 
     111 
     112Module of Foswiki - The Free Open Source Wiki, http://foswiki.org/, http://Foswiki.org/ 
     113 
     114Copyright (C) 2000-2007 Peter Thoeny, peter@thoeny.org 
     115and Foswiki Contributors. All Rights Reserved. Foswiki Contributors 
     116are listed in the AUTHORS file in the root of this distribution. 
     117NOTE: Please extend that file, not this notice. 
     118 
     119This program is free software; you can redistribute it and/or 
     120modify it under the terms of the GNU General Public License 
     121as published by the Free Software Foundation; either version 2 
     122of the License, or (at your option) any later version. For 
     123more details read LICENSE in the root of this distribution. 
     124 
     125This program is distributed in the hope that it will be useful, 
     126but WITHOUT ANY WARRANTY; without even the implied warranty of 
     127MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
     128 
     129As per the GPL, removal of this notice is prohibited. 
     130 
     1311; 
  • trunk/TWikiCompatibilityPlugin/lib/TWiki/Plugins.pm

    r811 r827  
    1 BEGIN { $Package::Alias::BRAVE = 1 } 
    2 use Package::Alias 
    3   'TWiki::Plugins' => 'Foswiki::Plugins', 
    4   'TWiki::Func' => 'Foswiki::Func'; 
     1package TWiki::Plugins; 
     2 
     3use Foswiki::Plugins; 
     4 
     5# Compatible version of TWiki::Plugins 
     6our $VERSION = 1.026; 
     7 
     8# Access to $TWiki::Plugins::SESSION is via a tie to $Foswiki::Plugins::SESSION 
     9{ 
     10    package TWiki::Plugins::SESSION_TIE; 
     11    use base 'Tie::Scalar'; 
     12 
     13    sub FETCH { return $Foswiki::Plugins::SESSION; } 
     14}; 
     15 
     16tie($TWiki::Plugins::SESSION, 'TWiki::Plugins::SESSION_TIE'); 
    517 
    6181; 
  • trunk/core/lib/Foswiki.pm

    r812 r827  
    5050use Error qw( :try ); 
    5151use CGI;    # Always required to get html generation tags; 
    52  
    53 BEGIN { $Package::Alias::BRAVE = 1 } 
    54 use Package::Alias 
    55   'TWiki::Plugins' => 'Foswiki::Plugins', 
    56   'TWiki::Func' => 'Foswiki::Func'; 
    5752 
    5853use Foswiki::Response; 
  • trunk/core/lib/Foswiki/Plugins.pm

    r812 r827  
    7777use Assert; 
    7878 
    79 use Package::Alias 'TWiki::Plugins' => 'Foswiki::Plugins'; 
    80  
    8179require Foswiki::Plugin; 
    8280 
  • trunk/core/lib/MANIFEST

    r810 r827  
    1717!include ../TinyMCEPlugin/lib/Foswiki/Plugins/TinyMCEPlugin 
    1818!include ../TopicUserMappingContrib/lib/Foswiki/Contrib/TopicUserMappingContrib 
    19 !include ../TWikiCompatibilityPlugin/lib/TWiki/Plugins/TWikiCompatibilityPlugin 
    2019!include ../TwistyContrib/lib/Foswiki/Contrib/TwistyContrib 
    2120!include ../TwistyPlugin/lib/Foswiki/Plugins/TwistyPlugin 
    2221!include ../WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin 
     22!include ../TWikiCompatibilityPlugin/lib/TWiki/Plugins/TWikiCompatibilityPlugin 
    2323!include ../core/lib/Foswiki/Contrib/core 
    24  
  • trunk/core/pseudo-install.pl

    r809 r827  
    1111our $install; 
    1212our $basedir; 
    13 our @twikiplugins_path; 
     13our @extensions_path; 
    1414our $CAN_LINK; 
    1515our $force; 
     
    1919    $basedir = $FindBin::Bin; # core dir 
    2020    $parentdir = "$basedir/.."; 
    21     my $path = $ENV{TWIKI_EXTENSIONS} || ''; 
     21    my $path = $ENV{FOSWIKI_EXTENSIONS} || ''; 
    2222    $path .= $Config::Config{path_sep}."$basedir/twikiplugins" 
    2323      .$Config::Config{path_sep}.'.' 
    2424      .$Config::Config{path_sep}.$parentdir; 
    25     @twikiplugins_path = 
     25    @extensions_path = 
    2626      grep(-d $_, split(/$Config::Config{path_sep}/, $path)); 
    2727 
     
    5454 
    5555 It picks up the extensions to be installed from a path defined in the 
    56  environment variable TWIKI_EXTENSIONS, or if it is not defined, 
    57  from the twikiplugins directory in the current checkout, or from the 
    58  parent directory of the current checkout. 
    59  
    60  Usage: pseudo-install.pl -felc [all|default|<module>...] 
     56 environment variable FOSWIKI_EXTENSIONS, or if it is not defined, 
     57 from the parent directory of the current checkout. 
     58 
     59 Usage: pseudo-install.pl -felc [all|default|developer|<module>...] 
    6160    -f[orce] - force an action to complete even if there are warnings 
    6261    -e[nable] - automatically enable installed plugins in LocalSite.cfg 
     
    6867    all - install all extensions 
    6968    default - install extensions listed in lib/MANIFEST 
     69    developer - default + key developer environment 
    7070    <module>... one or more extensions to install 
    7171 
     
    9797    my $moduleDir; 
    9898 
    99     foreach my $dir (@twikiplugins_path) { 
     99    foreach my $dir (@extensions_path) { 
    100100        if (-d "$dir/$module/") { 
    101101            $moduleDir = "$dir/$module"; 
     
    211211            print STDERR "ERROR $path$c is in the way\n"; 
    212212            last; 
     213        } elsif ( $c eq 'TWiki') { 
     214            # Special case 
     215            $path .= "$c/"; 
     216            if (!mkdir("$path$c")) { 
     217                print STDERR "Could not mkdir $path\n"; 
     218                last; 
     219            }; 
    213220        } else { 
    214221            my $tgt = _cleanPath("$base$path$c"); 
     
    313320 
    314321if ($ARGV[0] eq "all") { 
    315     foreach my $dir (@twikiplugins_path) { 
     322    foreach my $dir (@extensions_path) { 
    316323        opendir(D, $dir) || next; 
    317324        push(@modules, grep(/(Tag|Plugin|Contrib|Skin|AddOn)$/, readdir(D))); 
     
    325332        grep { /^!include/ } <F>; 
    326333    close(F); 
     334} elsif ($ARGV[0] eq "developer") { 
     335    open(F, "<", "lib/MANIFEST") || die "Could not open MANIFEST: $!"; 
     336    local $/ = "\n"; 
     337    @modules = 
     338      map { /(\w+)$/; $1 } 
     339        grep { /^!include/ } <F>; 
     340    close(F); 
     341    push(@modules, 'BuildContrib'); 
     342    push(@modules, 'TestFixturePlugin'); 
     343    push(@modules, 'UnitTestContrib'); 
    327344} else { 
    328345    @modules = @ARGV; 
  • trunk/core/tools/extender.pl

    r809 r827  
    4040my $reuseOK = 0; 
    4141my $inactive = 0; 
    42 my $twiki; 
    43 my $twiki4OrMore; 
     42my $session; 
    4443my %available; 
    4544my $lwp; 
    4645my @archTypes = ( '.tgz', '.tar.gz', '.zip' ); 
    47 my %cfg; 
    4846my $installationRoot; 
    4947my $MODULE; 
     
    6967             -d 'bin' && 
    7068             -e 'bin/setlib.cfg' ) { 
    71         die 'This installer must be run from the root directory of a TWiki installation'; 
     69        die 'This installer must be run from the root directory of a Foswiki installation'; 
    7270    } 
    7371    # read setlib.cfg 
     
    7573    require 'setlib.cfg'; 
    7674 
    77     # See if we can make a TWiki. If we can, then we can save topic 
    78     # and attachment histories. Key off Foswiki::Merge because it was 
    79     # added in Dakar. 
    80     if( &$check_perl_module( 'Foswiki::Merge' )) { 
    81         eval { 
    82             require Foswiki; 
    83             # We have to get the admin user, as a guest user may be blocked. 
    84             # TWiki 4.2 has AdminUserLogin; for earlier releases, we need to 
    85             # do something a bit different. 
    86             my $user = $Foswiki::cfg{AdminUserLogin} || 'admin'; 
    87             $twiki = new Foswiki($user); 
    88             # Compatibility with 4.0 <= Foswiki::VERSION < 4.2 
    89             if ($twiki->{users}->can('findUser')) { 
    90                 $Foswiki::Plugins::SESSION = $twiki; 
    91                 $twiki->{user} = 
    92                   $twiki->{users}->findUser( 
    93                       $Foswiki::cfg{AdminUserWikiName}, 
    94                       $Foswiki::cfg{AdminUserWikiName}); 
    95             } 
    96             chdir($installationRoot); 
    97             $twiki4OrMore = 1; 
    98         }; # if it fails, fall back to old behaviour 
    99     } else { 
    100         # Not TWiki-4 
    101         chdir($installationRoot); 
    102         no strict; 
    103         do 'lib/TWiki.cfg'; 
    104         if( -e 'lib/LocalSite.cfg') { 
    105             do 'lib/LocalSite.cfg'; 
    106         } 
    107         use strict; 
    108         $twiki4OrMore = 0; 
    109     } 
     75    # See if we can make a Foswiki. If we can, then we can save topic 
     76    # and attachment histories. Key off Foswiki::Merge because it is 
     77    # fairly new and fairly unique. 
     78    unless( &$check_perl_module( 'Foswiki::Merge' )) { 
     79        die "Can't find Foswiki: $@"; 
     80    } 
     81 
     82    require Foswiki; 
     83    # We have to get the admin user, as a guest user may be blocked. 
     84    my $user = $Foswiki::cfg{AdminUserLogin}; 
     85    $session = new Foswiki($user); 
     86    chdir($installationRoot); 
    11087 
    11188    if( &$check_perl_module( 'LWP' )) { 
     
    11794} 
    11895 
    119 =pod 
    120  
    121 ---+ StaticMethod remap ($file ) -> $file 
    122 Given a "canonical" path, convert it using the remappings in LocalSite.cfg to a site- 
    123 specific path. For example, if a site defines: 
    124 <verbatim> 
    125 $Foswiki::cfg{UsersWebName} = 'Users'; 
    126 </verbatim> 
    127 then this function will convert =data/Main/Burble.txt= to =data/Users/Burble.txt=. 
    128  
    129 Note: remapping only works for TWiki 4 and later. Anyone who cares enough can write 
    130 and test the mappings for Cairo. 
    131  
    132 =cut 
    133  
    13496sub remap { 
    13597    my $file = shift; 
    136     if (defined $cfg{SitePrefsTopicName}) { 
    137         $file =~ s#^data/(TWiki|Main)/TWikiPreferences\.txt(.*)$#data/$1/$cfg{SitePrefsTopicName}.txt$2#; 
    138     } 
    139     if (defined $cfg{UsersTopicName}) { 
    140         $file =~ s#(Main)/WikiUsers\.txt(.*)$#$1/$cfg{UsersTopicName}.txt$2#; 
    141     } 
     98 
     99    if ($Foswiki::cfg{SystemWebName} ne 'System') { 
     100        $file =~ s#^data/System/#data/$Foswiki::cfg{SystemWebName}/#; 
     101        $file =~ s#^pub/System/#pub/$Foswiki::cfg{SystemWebName}/#; 
     102    } 
     103 
     104    if ($Foswiki::cfg{TrashWebName} ne 'Trash') { 
     105        $file =~ s#^data/Trash/#data/$Foswiki::cfg{TrashWebName}/#; 
     106        $file =~ s#^pub/Trash/#pub/$Foswiki::cfg{TrashWebName}/#; 
     107    } 
     108 
     109    if ($Foswiki::cfg{UsersWebName} ne 'Main') { 
     110        $file =~ s#^data/Main/#data/$Foswiki::cfg{UsersWebName}/#; 
     111        $file =~ s#^pub/Main/#pub/$Foswiki::cfg{UsersWebName}/#; 
     112    } 
     113 
     114    if ($Foswiki::cfg{UsersWebName} ne 'Users') { 
     115        $file =~ s#^data/Users/#data/$Foswiki::cfg{UsersWebName}/#; 
     116        $file =~ s#^pub/Users/#pub/$Foswiki::cfg{UsersWebName}/#; 
     117    } 
     118 
     119    # Canonical symbol mappings 
    142120    foreach my $w qw( SystemWebName TrashWebName UsersWebName ) { 
    143         if (defined $cfg{$w}) { 
    144             $file =~ s#^data/$w/#data/$cfg{$w}/#; 
    145             $file =~ s#^pub/$w/#pub/$cfg{$w}/#; 
    146         } 
    147     } 
    148     foreach my $t qw( NotifyTopicName HomeTopicName WebPrefsTopicName MimeTypesFileName ) { 
    149         if (defined $cfg{$t}) { 
    150             $file =~ s#^data/(.*)/$t\.txt(,v)?#data/$1/$cfg{$t}.txt$2/#; 
    151             $file =~ s#^pub/(.*)/$t/([^/]*)$#pub/$1/$cfg{$t}/$2/#; 
     121        if (defined $Foswiki::cfg{$w}) { 
     122            $file =~ s#^data/$w/#data/$Foswiki::cfg{$w}/#; 
     123            $file =~ s#^pub/$w/#pub/$Foswiki::cfg{$w}/#; 
     124        } 
     125    } 
     126    foreach my $t qw( NotifyTopicName HomeTopicName WebPrefsTopicName 
     127                      MimeTypesFileName ) { 
     128        if (defined $Foswiki::cfg{$t}) { 
     129            $file =~ s#^data/(.*)/$t\.txt(,v)?#data/$1/$Foswiki::cfg{$t}.txt$2/#; 
     130            $file =~ s#^pub/(.*)/$t/([^/]*)$#pub/$1/$Foswiki::cfg{$t}/$2/#; 
    152131        } 
    153132    } 
     
    234213DONE 
    235214 
    236     if( $dep->{name} =~ m/^Foswiki::(Contrib|Plugins)::(\w*)/ ) { 
    237         my $pack = $1; 
    238         my $packname = $2; 
     215    if( $dep->{name} =~ m/^(Foswiki|TWiki)::(Contrib|Plugins)::(\w*)/ ) { 
     216        my $type = $1; 
     217        my $pack = $2; 
     218        my $packname = $3; 
    239219        $packname .= $pack if( $pack eq 'Contrib' && $packname !~ /Contrib$/); 
    240220        if (!$noconfirm || ($noconfirm && $downloadOK)) { 
    241             my $reply = ask('Would you like me to try to download and install the latest version of '.$packname.' from twiki.org?'); 
     221            my $reply = ask('Would you like me to try to download and install the latest version of '.$packname.' from foswiki.org?'); 
    242222            if( $reply ) { 
    243223                return installPackage( $packname ); 
     
    347327    } 
    348328    return $reply; 
    349 } 
    350  
    351 # DEPRECATED - do not use - install a .spec instead 
    352 # ---++ StaticMethod getConfig( $major, $minor, $cairo ) -> $string 
    353 #    * =$major= name of major key. 
    354 #    * =$minor= if undefined, there is no minor key 
    355 #    * =$cairo= expression that when evaled will get the cairo style config var 
    356 # Get the value of a config var, trying first the Dakar option and 
    357 # then if that fails, the Cairo name (if any). 
    358 # Example: 
    359 # =getConfig("Name")= 
    360 # will get the value of =$Foswiki::cfg{Name}=. 
    361 # =getConfig("MyPlugin", "Name")= 
    362 # will get the value of =$Foswiki::cfg{Name}=. 
    363 # =getConfig("HomeTopicName", undef, '$mainTopicname')= 
    364 # will get the name of the WebHome topic on Dakar and Cairo. 
    365 # 
    366 # See setConfig for more information on major/minor keys. 
    367  
    368 sub getConfig { 
    369     my( $major, $minor, $cairo ) = @_; 
    370  
    371     if( $minor && defined $Foswiki::cfg{$major}{$minor} ) { 
    372         return getFoswikiCfg("{$major}{$minor}"); 
    373     } 
    374     if (!$minor && defined $Foswiki::cfg{$major}) { 
    375         return getFoswikiCfg("{$minor}"); 
    376     } 
    377  
    378     if( defined $cairo ) { 
    379         return eval $cairo; 
    380     } 
    381     return undef; 
    382 } 
    383  
    384 # DEPRECATED - do not use - install a .spec instead 
    385 # ---++ StaticMethod commentConfig( $comment ) 
    386 #    * $comment - comment to insert in LocalSite.cfg, usually before a setConfig 
    387 # Inserts a comment into LocalSite.cfg. The comment will usually describe a following setConfig; for example, 
    388 # <verbatim> 
    389 # commentConfig( <<HERE 
    390 # #---++ Cars Plugin 
    391 # # **STRING 30** 
    392 # # Name of manufacturer 
    393 # HERE 
    394 # ); 
    395 # setConfig( 'CarsPlugin', Manufacturer => 'Mercedes' ); 
    396 # </verbatim> 
    397  
    398 sub commentConfig { 
    399     open(F, ">>lib/LocalSite.cfg") || 
    400               die "Failed to open lib/LocalSite.cfg for write"; 
    401     print F $_[0]; 
    402     close(F); 
    403 } 
    404  
    405 # DEPRECATED - do not use - install a .spec instead 
    406 # ---++ StaticMethod setConfig( $major, ... ) 
    407 #    * =$major= if defined, name of major key. If not given, there is no major key and the minorkeys are treated as major keys 
    408 #    * =...= list of minorkey=>value pairs 
    409 # Set the given configuration variables in LocalSite.cfg. =$value= must be 
    410 # complete with all syntactic sugar, including quotes. 
    411 # The valued are written to $Foswiki::cfg{major key}{setting} if a major 
    412 # key is given (recommended, use the plugin name) or $Foswiki::cfg{setting} otherwise. Example: 
    413 # <verbatim> 
    414 # setConfig( 'CarsPlugin', Name=>"'Mercedes'" }; 
    415 # setConfig( Tools => "qw(hammer saw screwdriver)" }; 
    416 # </verbatim> 
    417 # will write 
    418 # <verbatim> 
    419 # $Foswiki::cfg{CarsPlugin}{Best} = 'Mercedes'; 
    420 # $Foswiki::cfg{Tools} = qw(hammer saw screwdriver); 
    421 # </verbatim> 
    422  
    423 sub setConfig { 
    424     my @settings = @_; 
    425     my $txt; 
    426     my $key; 
    427     if (scalar(@settings) % 2) { 
    428         # pluck the first odd parameter off to be the major key 
    429         $key = shift @settings; 
    430     } 
    431     my %keys = @settings; 
    432     if( -e "lib/LocalSite.cfg" ) { 
    433         open(F, "<lib/LocalSite.cfg") || 
    434           die "Failed to open lib/LocalSite.cfg for read"; 
    435         local $/ = undef; 
    436         $txt = <F>; 
    437         close(F); 
    438         $txt =~ s/\n+1;\s*//gs; 
    439         # kill the old settings (and previous comment) if any are there 
    440         foreach my $setting ( keys %keys ) { 
    441             if( $key ) { 
    442                 $txt =~ s/(# \*\*.*?\n(#.*?\n))?\$Foswiki::cfg{$key}{$setting}\s*=.*;\r?\n//s; 
    443             } else { 
    444                 $txt =~ s/(# \*\*.*?\n(#.*?\n))?\$Foswiki::cfg{$setting}\s*=.*;\r?\n//s; 
    445             } 
    446         } 
    447     } 
    448     $txt .= "\n" unless $txt =~ /\n$/s; 
    449     open(F, ">lib/LocalSite.cfg") || 
    450       die "Failed to open lib/LocalSite.cfg for write"; 
    451     print F $txt if $txt; 
    452     foreach my $setting ( keys %keys ) { 
    453         if( defined $key ) { 
    454             print F '$Foswiki::cfg{'.$key.'}{'.$setting.'} = '; 
    455         } else { 
    456             print F '$Foswiki::cfg{'.$setting.'} = '; 
    457         } 
    458         print F $keys{$setting}, ";\n"; 
    459     } 
    460     print F "1;\n"; 
    461     close(F); 
    462  
    463     # is this Cairo or earlier? If it is, we need to include 
    464     # LocalSite.cfg from TWiki.cfg 
    465     unless( $twiki4OrMore ) { 
    466         open(F, "<lib/TWiki.cfg"); 
    467         undef $/; 
    468         $txt = <F>; 
    469         close(F); 
    470         unless( $txt =~ /^do.*LocalSite\.cfg/m ) { 
    471             $txt =~ s/^\s*1\s*;\s*$//m; 
    472             open(F, ">lib/TWiki.cfg") || 
    473               die "Failed to open lib/TWiki.cfg for write"; 
    474             print F "$txt\ndo 'LocalSite.cfg';\n1;\n"; 
    475             close(F); 
    476         } 
    477     } 
    478329} 
    479330 
     
    727578    my $err = 1; 
    728579 
    729     if( $twiki ) { 
     580    if( $session ) { 
    730581        if( $file ) { 
    731582            my $origfile = $Foswiki::cfg{PubDir} . '/' . $web . '/' . $topic . '/' . $file; 
     
    929780    my $path = $MODULE; 
    930781 
    931     if ($path !~ /^Foswiki::/) { 
     782    if ($path !~ /^(Foswiki|TWiki)::/) { 
     783        my $source = $1; 
    932784        my $type = 'Contrib'; 
    933785        if ($path =~ /Plugin$/) { 
    934786            $type = 'Plugins'; 
    935787        } 
    936         $path = 'Foswiki::'.$type.'::'.$rootModule; 
     788        $path = $source.'::'.$type.'::'.$rootModule; 
    937789    } 
    938790 
  • trunk/t2fos.sh

    r811 r827  
    66    [ -f $1 -a "$1" != "mapname.sh" ] && { \ 
    77        grep -s -q "TWiki" $1 && { 
    8             sed -e 's.data/TWiki/.data/System/.g' | \ 
     8            sed -e 's.data/TWiki/.data/System/.g' $1 | \ 
    99            sed -e 's.pub/TWiki/.pub/System/.g' | \ 
    1010            sed -e 's/TWiki::/Foswiki::/g' $1 | \ 
Note: See TracChangeset for help on using the changeset viewer.