Changeset 827
- Timestamp:
- 11/20/08 13:04:58 (3 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 15 edited
- 1 copied
- 3 moved
-
BuildContrib/data/System (moved) (moved from trunk/BuildContrib/data/TWiki)
-
BuildContrib/data/System/BuildContrib.txt (modified) (22 diffs)
-
BuildContrib/lib/Foswiki (moved) (moved from trunk/BuildContrib/lib/TWiki)
-
BuildContrib/lib/Foswiki/Contrib/Build.pm (modified) (59 diffs)
-
BuildContrib/lib/Foswiki/Contrib/BuildContrib/BaseBuild.pm (modified) (4 diffs)
-
BuildContrib/lib/Foswiki/Contrib/BuildContrib/MANIFEST (modified) (1 diff)
-
BuildContrib/lib/Foswiki/Contrib/BuildContrib/TEMPLATE_installer.pl (modified) (3 diffs)
-
BuildContrib/lib/Foswiki/Contrib/BuildContrib/build.pl (modified) (2 diffs)
-
BuildContrib/pub/System (moved) (moved from trunk/BuildContrib/pub/TWiki)
-
PreferencesPlugin/data/System/DefaultPreferencesForm.txt (modified) (1 diff)
-
TWikiCompatibilityPlugin/data/TWiki/WebPreferences.txt (copied) (copied from trunk/core/data/TWiki/WebPreferences.txt)
-
TWikiCompatibilityPlugin/lib/TWiki/Func.pm (modified) (1 diff)
-
TWikiCompatibilityPlugin/lib/TWiki/Plugins.pm (modified) (1 diff)
-
core/data/TWiki (deleted)
-
core/lib/Foswiki.pm (modified) (1 diff)
-
core/lib/Foswiki/Plugins.pm (modified) (1 diff)
-
core/lib/MANIFEST (modified) (1 diff)
-
core/pseudo-install.pl (modified) (8 diffs)
-
core/pub/TWiki (deleted)
-
core/tools/extender.pl (modified) (8 diffs)
-
t2fos.sh (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BuildContrib/data/System/BuildContrib.txt
r672 r827 1 ---+!! NextWiki Developer Environment1 ---+!! Foswiki Developer Environment 2 2 <div style="float:right"> 3 3 <a href="http://wikiring.com"><img src="%ATTACHURLPATH%/logo.gif" title="WikiRing: Professional Wiki Innovation and Support" /></a> … … 21 21 !BuildContrib can be used to create a build script for your extension. 22 22 It is inspired by the Java ANT build tool developed by the Apache project, 23 but is targeted specifically at building NextWiki (and TWiki™) extensions. It is also24 used for NextWiki release builds. The advantage of using !BuildContrib is that it23 but is targeted specifically at building Foswiki (and TWiki™) extensions. It is also 24 used for Foswiki release builds. The advantage of using !BuildContrib is that it 25 25 dictates a standard structure and build procedure, which makes your extension 26 26 easier for you, and others, to build and maintain. … … 62 62 63 63 ---++ Standard directory structure 64 !BuildContrib is used to build the NextWiki core, as well as most extensions. This64 !BuildContrib is used to build the Foswiki core, as well as most extensions. This 65 65 document will focus on its use for building extensions. See the 66 66 =tools/build.pl= file in a subversion checkout for information on building … … 74 74 installation tree. Every plugin has some _key files_: 75 75 * =lib/= 76 * = TWiki/=76 * =Foswiki/= 77 77 * =Plugins/= 78 78 * <code><i>name</i>.pm</code> - code file for the plugin, usually derived … … 87 87 * =Config.spec= - =configure= setup for this extension 88 88 * =data/= 89 * = TWiki/=89 * =System/= 90 90 * <code><i>name</i>.txt</code> - your plugin/contrib topic 91 91 * =test/= … … 94 94 extension 95 95 * =pub/= 96 * = TWiki/=96 * =System/= 97 97 * <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 under98 Contribs are held in the =lib/TWiki/Contrib= directory instead of =lib/Foswiki/Plugins= but otherwise in exactly work the same way. 99 100 Other directories normally found in a Foswiki installation may also exist under 101 101 a root directory e.g. =bin=, =templates= etc. 102 102 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.103 While 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. 104 104 105 105 ---++ Setting up for Development … … 114 114 ---+++ Environment Variables 115 115 116 Your build script has to know how to find the NextWiki libraries, so it can117 pick up the components of the build system. Set = TWIKI_LIBS= (which is a116 Your build script has to know how to find the Foswiki libraries, so it can 117 pick up the components of the build system. Set =FOSWIKI_LIBS= (which is a 118 118 path, 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 build119 Foswiki. =$FOSWIKI_LIBS= is used to extend @INC _for the duration of the build 120 120 only_, so it won't mask problems during testing. 121 121 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).122 The approach we _recommend_ is to set =FOSWIKI_LIBS= in your login script (e.g. =.login=, =.csh=, =.profile= depending on what shell you prefer). 123 123 124 124 <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. 126 126 </blockquote> 127 127 … … 154 154 The 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. 155 155 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 158 156 ---+++ The =build= target 159 157 Does 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. … … 168 166 ---+++ The =tidy= target 169 167 This target runs Perl::Tidy (with default formatting options) over your 170 source code. This reformats the code consistently with the NextWiki168 source code. This reformats the code consistently with the Foswiki 171 169 coding standards. 172 170 … … 203 201 For example, 204 202 <verbatim> 205 data/ TWiki/BathPlugin.txt 0664 Plugin description topic206 lib/ TWiki/Plugins/BathPlugin.pm 0444 Plugin code module203 data/System/BathPlugin.txt 0664 Plugin description topic 204 lib/Foswiki/Plugins/BathPlugin.pm 0444 Plugin code module 207 205 </verbatim> 208 206 If no permissions are given, permissions are guessed from the permissions on … … 226 224 * unit tests 227 225 228 MANIFESTs can also include other extensions that have been package susing226 MANIFESTs can also include other extensions that have been packaged using 229 227 !BuildContrib. For example, 230 228 <verbatim> 231 !include twikiplugins/WysiwygPlugin/lib/TWiki/Plugins/WysiwygPlugin229 !include WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin 232 230 </verbatim> 233 231 This will include the !WysiwygPlugin in the release package. 234 232 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.233 Note 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. 236 234 237 235 ---++ DEPENDENCIES … … 248 246 The installer script written by the build process uses the dependency type 249 247 to 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=248 from 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= 252 250 or =$PLUGINS_URL=). 253 251 … … 255 253 When 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. 256 254 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>></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.255 When 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>></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. 258 256 259 257 When 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_. … … 276 274 File::Munge,>0,cpan,... 277 275 ONLYIF ($File::Munge::VERSION < 1.025) 278 TWiki::FixOldFileFind, >=1.000, perl, Optional, only required if we have an old version of File::Munge.276 MyPackage::FixOldFileFind, >=1.000, perl, Optional, only required if we have an old version of File::Munge. 279 277 </verbatim> 280 278 The =ONLYIF= only applies to the next dependency in the file. … … 286 284 * =perl create_new_extension.pl BathPlugin= 287 285 * 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 your286 1 Edit =lib/Foswiki/Plugins/BathPlugin.pm= as required to create your 289 287 plugin functionality 290 1 Edit =lib/ TWiki/Plugins/BathPlugin/MANIFEST= and make sure it lists288 1 Edit =lib/Foswiki/Plugins/BathPlugin/MANIFEST= and make sure it lists 291 289 all the files you want to include in the release package 292 290 During development we recommend you use the =pseudo-install.pl= script to … … 310 308 These optional files are embedded into the template install script 311 309 at 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) 313 311 to see how they fit in. The POD comments in that module indicate the functions 314 312 that are most likely to be useful to anyone writing a script extension. … … 330 328 When you are almost ready to release, you should 331 329 1 Build a release package and installer 332 * =cd twikiplugins/BathPlugin/lib/TWiki/Plugins/BathPlugin=330 * =cd BathPlugin/lib/TWiki/Plugins/BathPlugin= 333 331 * =perl build.pl release= 334 332 1 Remove the softlinked version from your dev install … … 337 335 1 Install the release package you just built: 338 336 * =cd= _dev install_ 339 * =perl twikiplugins/BathPlugin/BathPlugin_installer=337 * =perl BathPlugin/BathPlugin_installer= 340 338 1 Test. 341 339 … … 344 342 and in the installer script. The following tokens are supported: 345 343 * =%$<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' => 0775344 * =%$<nop>FILES%= - hash keyed on file name mapping to permissions i.e. 'data/System/ThsiTopic.txt' => 0664, 'lib/TWiki/Plugins/BlahPlugin.pm' => 0775 347 345 * =%$<nop>DEPENDENCIES%= - list of dependencies from DEPENDENCIES 348 346 * =%$<nop>VERSION%= value of $VERSION … … 363 361 When you are happy the release package is built correctly, you can 364 362 upload it. 365 * =cd twikiplugins/BathPlugin/lib/TWiki/Plugins/BathPlugin=363 * =cd BathPlugin/lib/TWiki/Plugins/BathPlugin= 366 364 * =perl build.pl upload= 367 By default the =upload= target will upload to NextWiki.org. You will be prompted365 By default the =upload= target will upload to Foswiki.org. You will be prompted 368 366 to enter an alternate upload target, should you require it (e.g. to upload to 369 367 private corporate repository). The upload updates the topic and any associated … … 377 375 The installer script shipped with the package is very simple. By default all 378 376 it does is to check the dependencies you list, and if necessary download and 379 install any missing NextWiki and CPAN modules. Other dependencies are simply380 checked. In TWiki-4.0 and later releases, topics shipped with the377 install any missing Foswiki and CPAN modules. Other dependencies are simply 378 checked. Topics shipped with the 381 379 module are automatically merged into any existing local copies, ensuring 382 380 histories are preserved. … … 389 387 390 388 ---++ 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]].389 You are strongly recommended to use this Contrib to help split your code development away from your live Foswiki environment, as described [[#DevelopmentModel][above]]. 392 390 393 391 %$INSTALL_INSTRUCTIONS% 394 392 395 393 ---++ 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__!394 Another 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__! 397 395 398 396 TWiki™ is a trademark of Peter Thoeny. -
trunk/BuildContrib/lib/Foswiki/Contrib/Build.pm
r603 r827 13 13 # http://www.gnu.org/copyleft/gpl.html 14 14 # 15 package TWiki::Contrib::Build;16 17 use TWiki::Contrib::BuildContrib::BaseBuild;15 package Foswiki::Contrib::Build; 16 17 use Foswiki::Contrib::BuildContrib::BaseBuild; 18 18 use Error qw(:try); 19 19 use CGI qw(:any); 20 20 21 =begin twiki22 23 ---++ Package TWiki::Contrib::Build24 25 This is a base class used for making build scripts for TWiki packages.21 =begin foswiki 22 23 ---++ Package Foswiki::Contrib::Build 24 25 This is a base class used for making build scripts for Foswiki packages. 26 26 27 27 ---+++ Methods … … 48 48 # It is *not* used by the build automation tools, but is reported as part 49 49 # of the version number in PLUGINDESCRIPTIONS. 50 our $RELEASE = ' NextWiki-1';50 our $RELEASE = 'Foswiki-1'; 51 51 52 52 our $SHORTDESCRIPTION = 53 53 'Automate build process for Plugins, Add-ons and Contrib modules'; 54 54 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";55 my $UPLOADSITEPUB = 'http://foswiki.org/pub'; 56 my $UPLOADSITESCRIPT = 'http://foswiki.org/bin'; 57 my $UPLOADSITESUFFIX = ''; 58 my $UPLOADSITEBUGS = 'http://foswiki.org/Tasks'; 59 my $UPLOADSITEEXTENSIONSWEB = "Extensions"; 60 60 61 61 my $GLACIERMELT = 10; # number of seconds to sleep between uploads, 62 62 # to reduce average load on server 63 64 my $targetProject = 'Foswiki';# May change to 'TWiki' 63 65 64 66 my $collector; # general purpose handle for collecting stuff … … 96 98 97 99 # 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; 100 106 $libpath =~ s#/[^/]*$##; 101 107 … … 103 109 $basedir =~ s#/[^/]*$##; 104 110 105 if ( $ENV{TWIKI_LIBS} ) { 111 my $env = $ENV{uc($targetProject).'_LIBS'}; 112 if ( $env ) { 106 113 my %known; 107 114 map { $known{$_} = 1 } split( /:/, @INC ); 108 foreach my $pc ( reverse split( /:/, $ ENV{TWIKI_LIBS}) ) {115 foreach my $pc ( reverse split( /:/, $env ) ) { 109 116 unless ( $known{$pc} ) { 110 117 unshift( @INC, $pc ); … … 117 124 } 118 125 119 =begin twiki126 =begin foswiki 120 127 121 128 ---++++ new($project) … … 134 141 135 142 # Constants with internet paths 136 $this->{BUGSURL} = $ TWIKIORGBUGS;143 $this->{BUGSURL} = $UPLOADSITEBUGS; 137 144 138 145 $this->{project} = $project; … … 160 167 $this->{basedir} = $basedir; 161 168 162 # The following paths are all relative to the root of the twiki169 # The following paths are all relative to the root of the 163 170 # installation 164 171 … … 167 174 $this->{libdir} = $libpath; 168 175 if ( $this->{project} =~ /Plugin$/ ) { 169 $this->{libdir} .= '/TWiki/Plugins';176 $this->{libdir} .= "/$targetProject/Plugins"; 170 177 } 171 178 elsif ( $this->{project} =~ /(Contrib|Skin)$/ ) { 172 $this->{libdir} .= '/TWiki/Contrib';179 $this->{libdir} .= "/$targetProject/Contrib"; 173 180 } 174 181 … … 178 185 179 186 my $stubpath = $this->{pm}; 180 $stubpath =~ s/.*[\\\/]( TWiki[\\\/].*)\.pm/$1/;187 $stubpath =~ s/.*[\\\/]($targetProject[\\\/].*)\.pm/$1/; 181 188 $stubpath =~ s/[\\\/]/::/g; 182 189 183 190 # where data files live 184 $this->{data_twiki} = 'data/TWiki'; 191 $this->{data_systemdir} = 192 ($targetProject eq 'TWiki') ? 'data/TWiki' : 'data/System'; 185 193 186 194 # 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}; 188 196 189 197 ############################################################## … … 192 200 my $manifest = _findRelativeTo( $buildpldir, 'MANIFEST' ); 193 201 if (!defined($manifest)) { 194 #the twikicore MANIFEST is in the lib dir, not the tools dir202 #the core MANIFEST is in the lib dir, not the tools dir 195 203 $manifest = _findRelativeTo( $libpath, 'MANIFEST' ); 196 204 } 197 205 ( $this->{files}, $this->{other_modules} ) = 198 TWiki::Contrib::BuildContrib::BaseBuild::readManifest( $this->{basedir},206 Foswiki::Contrib::BuildContrib::BaseBuild::readManifest( $this->{basedir}, 199 207 '', $manifest, sub { exit(1) } ); 200 208 201 # Generate a TWikitable representing the manifest contents209 # Generate a table representing the manifest contents 202 210 # and a hash table representing the files 203 211 my $mantable = ''; … … 221 229 my $dependancies = _findRelativeTo( $buildpldir, 'DEPENDENCIES' ); 222 230 if (!defined($dependancies)) { 223 #the twikicore DEPENDENCIES is in the lib dir, not the tools dir231 #the core DEPENDENCIES is in the lib dir, not the tools dir 224 232 $dependancies = _findRelativeTo( $libpath, 'DEPENDENCIES' ); 225 233 } … … 297 305 } 298 306 else { 299 $this->{UPLOADTARGETPUB} = $ TWIKIORGPUB307 $this->{UPLOADTARGETPUB} = $UPLOADSITEPUB 300 308 unless defined $this->{UPLOADTARGETPUB}; 301 $this->{UPLOADTARGETSCRIPT} = $ TWIKIORGSCRIPT309 $this->{UPLOADTARGETSCRIPT} = $UPLOADSITESCRIPT 302 310 unless defined $this->{UPLOADTARGETSCRIPT}; 303 $this->{UPLOADTARGETSUFFIX} = $ TWIKIORGSUFFIX311 $this->{UPLOADTARGETSUFFIX} = $UPLOADSITESUFFIX 304 312 unless defined $this->{UPLOADTARGETSUFFIX}; 305 $this->{UPLOADTARGETWEB} = $ TWIKIORGEXTENSIONSWEB313 $this->{UPLOADTARGETWEB} = $UPLOADSITEEXTENSIONSWEB 306 314 unless defined $this->{UPLOADTARGETWEB}; 307 315 } … … 504 512 } 505 513 506 =begin twiki514 =begin foswiki 507 515 508 516 ---++++ pushd($dir) … … 523 531 } 524 532 525 =begin twiki533 =begin foswiki 526 534 527 535 ---++++ popd() … … 544 552 } 545 553 546 =begin twiki554 =begin foswiki 547 555 548 556 ---++++ rm($file) … … 567 575 } 568 576 569 =begin twiki577 =begin foswiki 570 578 571 579 ---++++ makepath($to) … … 580 588 } 581 589 582 =begin twiki590 =begin foswiki 583 591 584 592 ---++++ cp($from, $to) … … 617 625 } 618 626 619 =begin twiki627 =begin foswiki 620 628 621 629 ---++++ prot($perms, $file) … … 632 640 } 633 641 634 =begin twiki642 =begin foswiki 635 643 636 644 ---++++ sys_action(@params) … … 656 664 } 657 665 658 =begin twiki666 =begin foswiki 659 667 660 668 ---++++ perl_action($cmd) … … 675 683 } 676 684 677 =begin twiki685 =begin foswiki 678 686 679 687 ---++++ target_build … … 686 694 } 687 695 688 =begin twiki696 =begin foswiki 689 697 690 698 ---++++ target_compress … … 715 723 } 716 724 717 =begin twiki725 =begin foswiki 718 726 719 727 ---++++ target_tidy … … 762 770 } 763 771 764 =begin twiki772 =begin foswiki 765 773 766 774 ---++++ target_test … … 814 822 } 815 823 816 =begin twiki824 =begin foswiki 817 825 818 826 ---++++ filter_txt … … 834 842 835 843 # Replace the SVN revision with rev 1. 836 # In TWikibuilds this gets replaced by latest revision later.844 # In release builds this gets replaced by latest revision later. 837 845 $text =~ s/^(%META:TOPICINFO{.*)\$Rev:.*\$(.*}%)$/${1}1$2/m; 838 846 $text =~ s/%\$(\w+)%/&_expand($this,$1)/geo; … … 861 869 } 862 870 863 =begin twiki871 =begin foswiki 864 872 865 873 ---++++ build_js … … 904 912 } 905 913 906 =begin twiki914 =begin foswiki 907 915 908 916 ---++++ build_css … … 947 955 } 948 956 949 =begin twiki957 =begin foswiki 950 958 951 959 ---++++ filter_pm($from, $to) … … 974 982 } 975 983 976 =begin twiki984 =begin foswiki 977 985 978 986 ---++++ target_release … … 1000 1008 } 1001 1009 1002 =begin twiki1010 =begin foswiki 1003 1011 1004 1012 ---++++ target_stage … … 1029 1037 } 1030 1038 } 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', 1033 1041 $this->{basedir} . '/' . $project . '.txt' ); 1034 1042 } … … 1040 1048 print STDERR "Installing $module in $this->{tmpDir}\n"; 1041 1049 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 twiki1050 `export FOSWIKI_HOME=$this->{tmpDir}; export FOSWIKI_LIBS=$libs; cd $basedir/$module; perl build.pl handsoff_install`; 1051 } 1052 } 1053 } 1054 1055 =begin foswiki 1048 1056 1049 1057 ---++++ target_archive … … 1119 1127 } 1120 1128 1121 =begin twiki1129 =begin foswiki 1122 1130 1123 1131 ---++++ copy_fileset … … 1146 1154 } 1147 1155 1148 =begin twiki1156 =begin foswiki 1149 1157 1150 1158 ---++++ apply_perms … … 1164 1172 } 1165 1173 1166 =begin twiki1174 =begin foswiki 1167 1175 1168 1176 ---++++ target_handsoff_install 1169 Install target, installs to local twiki pointed at by TWIKI_HOME.1177 Install target, installs to local install pointed at by FOSWIKI_HOME. 1170 1178 1171 1179 Does not run the installer script. … … 1177 1185 $this->build('release'); 1178 1186 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); 1182 1190 $this->sys_action( 'tar', 'zxpf', 1183 1191 $this->{basedir} . '/' . $this->{project} . '.tgz' ); 1184 1192 1185 1193 # kill off the module installer 1186 $this->rm( $ twiki. '/' . $this->{project} . '_installer' );1194 $this->rm( $home . '/' . $this->{project} . '_installer' ); 1187 1195 $this->popd(); 1188 1196 } 1189 1197 1190 =begin twiki1198 =begin foswiki 1191 1199 1192 1200 ---++++ target_install 1193 Install target, installs to local twiki pointed at by TWIKI_HOME.1201 Install target, installs to local twiki pointed at by FOSWIKI_HOME. 1194 1202 1195 1203 Uses the installer script written by target_installer … … 1203 1211 } 1204 1212 1205 =begin twiki1213 =begin foswiki 1206 1214 1207 1215 ---++++ target_uninstall 1208 Uninstall target, uninstall from local twiki pointed at by TWIKI_HOME.1216 Uninstall target, uninstall from local twiki pointed at by FOSWIKI_HOME. 1209 1217 1210 1218 Uses the installer script written by target_installer … … 1214 1222 sub target_uninstall { 1215 1223 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); 1219 1227 $this->sys_action( 'perl', $this->{project} . '_installer', 'uninstall' ); 1220 1228 $this->popd(); … … 1223 1231 { 1224 1232 1225 package TWiki::Contrib::Build::UserAgent;1233 package Foswiki::Contrib::Build::UserAgent; 1226 1234 use base qw(LWP::UserAgent); 1227 1235 … … 1296 1304 } 1297 1305 1298 =begin twiki1306 =begin foswiki 1299 1307 1300 1308 ---++++ target_upload … … 1351 1359 $this->build('release'); 1352 1360 my $userAgent = 1353 new TWiki::Contrib::Build::UserAgent( $this->{UPLOADTARGETSCRIPT},1361 new Foswiki::Contrib::Build::UserAgent( $this->{UPLOADTARGETSCRIPT}, 1354 1362 $this ); 1355 1363 $userAgent->agent( 'ContribBuild/' . $VERSION . ' ' ); … … 1393 1401 $newform{'text'} = <IN_FILE>; 1394 1402 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, Item34541399 $newform{'text'} =~ s/^%META:TOPICINFO{.*}%$//m;1400 1403 } 1401 1404 else { … … 1410 1413 1411 1414 # Upload any 'Var*.txt' topics published by the extension 1412 my $dataDir = $this->{basedir} . '/data/ TWiki';1415 my $dataDir = $this->{basedir} . '/data/System'; 1413 1416 if ( opendir( DIR, $dataDir ) ) { 1414 1417 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 ) ) 1416 1419 { 1417 1420 %newform = ( text => <IN_FILE> ); … … 1445 1448 1446 1449 $this->_uploadAttachment( $userAgent, $user, $pass, $name, 1447 $this->{basedir} . '/pub/ TWiki/' . $this->{project} . '/' . $name,1450 $this->{basedir} . '/pub/System/' . $this->{project} . '/' . $name, 1448 1451 $comment, $attrs =~ /h/ ? 1 : 0 ); 1449 1452 $uploaded{$name} = 1; … … 1475 1478 1476 1479 If you want to report an error in the topic, please raise a report at 1477 http:// nextwiki.org/view/Tasks/$this->{project}1480 http://foswiki.org/view/Tasks/$this->{project} 1478 1481 --> 1479 1482 EXTRA … … 1556 1559 # is intended for use by developers only. 1557 1560 1558 # POD text in =.pm= files should use T Wikisyntax or HTML. Packages should be1561 # POD text in =.pm= files should use TML syntax or HTML. Packages should be 1559 1562 # introduced with a level 1 header, ---+, and each method in the package by 1560 1563 # a level 2 header, ---++. Make sure you document any global variables used … … 1588 1591 } 1589 1592 1590 =begin twiki1593 =begin foswiki 1591 1594 1592 1595 ---++++ target_POD 1593 1596 1594 1597 Print POD documentation. This target does not modify any files, it simply 1595 prints the (T Wikiformat) POD.1596 1597 POD text in =.pm= files should use T Wikisyntax or HTML. Packages should be1598 prints the (TML format) POD. 1599 1600 POD text in =.pm= files should use TML syntax or HTML. Packages should be 1598 1601 introduced with a level 1 header, ---+, and each method in the package by 1599 1602 a level 2 header, ---++. Make sure you document any global variables used … … 1608 1611 } 1609 1612 1610 =begin twiki1613 =begin foswiki 1611 1614 1612 1615 ---++++ target_installer 1613 1616 1614 1617 Write an install/uninstall script that checks dependencies, and optionally 1615 downloads and installs required zips from twiki.org.1618 downloads and installs required zips from foswiki.org. 1616 1619 1617 1620 The install script is templated from =contrib/TEMPLATE_installer= and … … 1622 1625 1623 1626 The install script works using the dependency type and version fields. 1624 It will try to download from twiki.org to satisfy any missing dependencies.1627 It will try to download from foswiki.org to satisfy any missing dependencies. 1625 1628 Downloaded modules are automatically installed. 1626 1629 1627 1630 Note that the dependencies will only work if the module depended on follows 1628 1631 the 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.1632 foswiki.org and have the same name as the topic, and must be a zip file. 1630 1633 1631 1634 Dependencies on CPAN modules are also checked (type perl) but no attempt … … 1668 1671 chop($dir); 1669 1672 my $file = 1670 $dir . '/lib/ TWiki/Contrib/BuildContrib/TEMPLATE_installer.pl';1673 $dir . '/lib/Foswiki/Contrib/BuildContrib/TEMPLATE_installer.pl'; 1671 1674 if ( -f $file ) { 1672 1675 $template = $file; … … 1712 1715 } 1713 1716 1714 =begin twiki1717 =begin foswiki 1715 1718 1716 1719 ---++++ build($target) … … 1738 1741 } 1739 1742 1740 =begin twiki1743 =begin foswiki 1741 1744 1742 1745 ---++++ target_manifest … … 1781 1784 1782 1785 sub _manicollect { 1783 if (/^(CVS|\.svn |twikiplugins)$/) {1786 if (/^(CVS|\.svn)$/) { 1784 1787 $File::Find::prune = 1; 1785 1788 } … … 1798 1801 } 1799 1802 1800 =begin twiki1803 =begin foswiki 1801 1804 1802 1805 #HistoryTarget … … 1812 1815 my $this = shift; 1813 1816 1814 my $f = $this->{basedir} . '/' . $this->{ data_twiki_module} . '.txt';1817 my $f = $this->{basedir} . '/' . $this->{topic_root} . '.txt'; 1815 1818 1816 1819 my $cmd = "cd $this->{basedir} && svn status"; … … 1947 1950 } 1948 1951 1949 =begin twiki1952 =begin foswiki 1950 1953 1951 1954 ---++++ target_dependencies … … 1966 1969 die "B::PerlReq is required for 'dependencies': $@" if $@; 1967 1970 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 ) { 1971 1984 $this->{satisfied}{$m} = 1; 1972 1985 } … … 2053 2066 automatic installer script written using the Build<nop>Contrib. 2054 2067 * 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. 2056 2069 * If you have any problems, then you can still install manually from the command-line: 2057 2070 1 Download one of the =.zip= or =.tgz= archives -
trunk/BuildContrib/lib/Foswiki/Contrib/BuildContrib/BaseBuild.pm
r14 r827 13 13 # http://www.gnu.org/copyleft/gpl.html 14 14 # 15 package TWiki::Contrib::BuildContrib::BaseBuild;15 package Foswiki::Contrib::BuildContrib::BaseBuild; 16 16 17 17 use strict; 18 18 19 =begin twiki19 =begin foswiki 20 20 21 ---++ Package TWiki::Contrib::BuildContrib::BaseBuild21 ---++ Package Foswiki::Contrib::BuildContrib::BaseBuild 22 22 23 23 This is a class used to provide all the services required for … … 31 31 my $NL = "\n"; 32 32 33 =begin twiki33 =begin foswiki 34 34 35 35 ---++++ readManifest($baseDir,$path,$file,$manifest,$noManifestFileHook) => \@files … … 46 46 optional octal permissions mask and a description; for example, 47 47 <verbatim> 48 data/ TWiki/MyPlugin.txt 0664 Plugin description topic48 data/System/MyPlugin.txt 0664 Plugin description topic 49 49 </verbatim> 50 50 If no permissions are given, permissions are guessed from the permissions … … 126 126 } 127 127 128 =begin twiki128 =begin foswiki 129 129 130 130 ---++++ findInINC($fileName) => $path -
trunk/BuildContrib/lib/Foswiki/Contrib/BuildContrib/MANIFEST
r14 r827 1 data/ TWiki/BuildContrib.txt 0444 Description2 lib/ TWiki/Contrib/Build.pm 0444 Code module3 lib/ TWiki/Contrib/BuildContrib/BaseBuild.pm 0444 Common functionality for build programs4 lib/ TWiki/Contrib/BuildContrib/build.pl 0555 Build script5 lib/ TWiki/Contrib/BuildContrib/TEMPLATE_installer.pl 0444 Installer template6 pub/ TWiki/BuildContrib/logo.gif 0444 Image1 data/System/BuildContrib.txt 0444 Description 2 lib/Foswiki/Contrib/Build.pm 0444 Code module 3 lib/Foswiki/Contrib/BuildContrib/BaseBuild.pm 0444 Common functionality for build programs 4 lib/Foswiki/Contrib/BuildContrib/build.pl 0555 Build script 5 lib/Foswiki/Contrib/BuildContrib/TEMPLATE_installer.pl 0444 Installer template 6 pub/System/BuildContrib/logo.gif 0444 Image 7 7 create_new_extension.pl 0555 Wizard for creating new extensions 8 pub/ TWiki/BuildContrib/wikiringlogo20x20.png 06608 pub/System/BuildContrib/wikiringlogo20x20.png 0660 9 9 build.pl 0750 Interface to build scripts -
trunk/BuildContrib/lib/Foswiki/Contrib/BuildContrib/TEMPLATE_installer.pl
r548 r827 3 3 # Install script for %$MODULE% 4 4 # 5 # Copyright (C) 2004-2007 NextWiki Contributors. All Rights Reserved.6 # NextWiki Contributors are listed in the AUTHORS file in the root of5 # Copyright (C) 2004-2007 Foswiki Contributors. All Rights Reserved. 6 # Foswiki Contributors are listed in the AUTHORS file in the root of 7 7 # this distribution. NOTE: Please extend that file, not this notice. 8 8 # … … 55 55 =cut 56 56 57 # This is all done in package TWiki so that reading LocalSite.cfg and TWiki.cfg57 # This is all done in package Foswiki so that reading LocalSite.cfg and Foswiki.cfg 58 58 # will put the config vars into the right namespace. 59 package TWiki;59 package Foswiki; 60 60 61 61 # The root of package URLs … … 139 139 } 140 140 141 TWiki::Extender::install( $PACKAGES_URL, '%$MODULE%', '%$ROOTMODULE%', @DATA );141 Foswiki::Extender::install( $PACKAGES_URL, '%$MODULE%', '%$ROOTMODULE%', @DATA ); 142 142 143 143 1; -
trunk/BuildContrib/lib/Foswiki/Contrib/BuildContrib/build.pl
r736 r827 4 4 # plugin or contrib and edit. 5 5 # 6 # Read the comments at the top of lib/ TWiki/Contrib/Build.pm for6 # Read the comments at the top of lib/Foswiki/Contrib/Build.pm for 7 7 # details of how the build process works, and what files you 8 8 # have to provide and where. 9 9 # 10 # Requires the environment variable TWIKI_LIBS (a colon-separated path10 # Requires the environment variable FOSWIKI_LIBS (a colon-separated path 11 11 # list) to be set to point at the build system and any required dependencies. 12 12 # Usage: ./build.pl [-n] [-v] [target] … … 16 16 # -n Don't actually do anything, just print commands 17 17 # -v Be verbose 18 #19 20 18 # Standard preamble 21 19 BEGIN { 22 unshift @INC, split( /:/, $ENV{ TWIKI_LIBS} );20 unshift @INC, split( /:/, $ENV{FOSWIKI_LIBS} ); 23 21 } 24 22 25 use TWiki::Contrib::Build;23 use Foswiki::Contrib::Build; 26 24 27 25 # Declare our build package 28 26 package BuildBuild; 29 use base qw( TWiki::Contrib::Build );27 use base qw( Foswiki::Contrib::Build ); 30 28 31 29 sub new { -
trunk/PreferencesPlugin/data/System/DefaultPreferencesForm.txt
r693 r827 18 18 | ATTACHEDIMAGEFORMAT | textarea | | \t* $comment: <br /><img src="%ATTACHURLPATH%/$name" alt="$comment" $size /> | Text | S | 19 19 | 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 | 21 21 | WEBLOGOIMG | text | 30 | %PUBURL%/%BASEWEB%/%WEBPREFSTOPIC%/%WEBLOGONAME% | URL of a logo image | S | 22 22 | WEBLOGOURL | text | 30 | %SCRIPTURL%/view%SCRIPTSUFFIX%/%BASEWEB%/%HOMETOPIC% | URL under the logo | S | 23 23 | WEBLOGOALT | text | 30 | Home | Logo tooltip text of the logo | S | 24 24 | 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 | 26 26 | WIKILOGOALT | text | 30 | Powered by TWiki | Logo tooltip text of the logo | S | 27 27 | 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 2 package TWiki::Func; 3 4 # Bridge between TWiki::Func and Foswiki::Func 5 6 use strict; 7 8 use Foswiki::Func; 9 10 sub getSkin { Foswiki::Func::getSkin(@_) } 11 sub getUrlHost { Foswiki::Func::getUrlHost(@_) } 12 sub getScriptUrl { Foswiki::Func::getScriptUrl(@_) } 13 sub getViewUrl { Foswiki::Func::getViewUrl(@_) } 14 sub getPubUrlPath { Foswiki::Func::getPubUrlPath(@_) } 15 sub getExternalResource { Foswiki::Func::getExternalResource(@_) } 16 sub getCgiQuery { Foswiki::Func::getCgiQuery(@_) } 17 sub getSessionKeys { Foswiki::Func::getSessionKeys(@_) } 18 sub getSessionValue { Foswiki::Func::getSessionValue(@_) } 19 sub setSessionValue { Foswiki::Func::setSessionValue(@_) } 20 sub clearSessionValue { Foswiki::Func::clearSessionValue(@_) } 21 sub getContext { Foswiki::Func::getContext(@_) } 22 sub pushTopicContext { Foswiki::Func::pushTopicContext(@_) } 23 sub popTopicContext { Foswiki::Func::popTopicContext(@_) } 24 sub getPreferencesValue { Foswiki::Func::getPreferencesValue(@_) } 25 sub getPluginPreferencesValue { Foswiki::Func::getPluginPreferencesValue(@_) } 26 sub getPreferencesFlag { Foswiki::Func::getPreferencesFlag(@_) } 27 sub getPluginPreferencesFlag { Foswiki::Func::getPluginPreferencesFlag(@_) } 28 sub setPreferencesValue { Foswiki::Func::setPreferencesValue(@_) } 29 sub getDefaultUserName { Foswiki::Func::getDefaultUserName(@_) } 30 sub getCanonicalUserID { Foswiki::Func::getCanonicalUserID(@_) } 31 sub getWikiName { Foswiki::Func::getWikiName(@_) } 32 sub getWikiUserName { Foswiki::Func::getWikiUserName(@_) } 33 sub wikiToUserName { Foswiki::Func::wikiToUserName(@_) } 34 sub userToWikiName { Foswiki::Func::userToWikiName(@_) } 35 sub emailToWikiNames { Foswiki::Func::emailToWikiNames(@_) } 36 sub wikinameToEmails { Foswiki::Func::wikinameToEmails(@_) } 37 sub isGuest { Foswiki::Func::isGuest(@_) } 38 sub isAnAdmin { Foswiki::Func::isAnAdmin(@_) } 39 sub isGroupMember { Foswiki::Func::isGroupMember(@_) } 40 sub eachUser { Foswiki::Func::eachUser(@_) } 41 sub eachMembership { Foswiki::Func::eachMembership(@_) } 42 sub eachGroup { Foswiki::Func::eachGroup(@_) } 43 sub isGroup { Foswiki::Func::isGroup(@_) } 44 sub eachGroupMember { Foswiki::Func::eachGroupMember(@_) } 45 sub checkAccessPermission { Foswiki::Func::checkAccessPermission(@_) } 46 sub getListOfWebs { Foswiki::Func::getListOfWebs(@_) } 47 sub webExists { Foswiki::Func::webExists(@_) } 48 sub createWeb { Foswiki::Func::createWeb(@_) } 49 sub moveWeb { Foswiki::Func::moveWeb(@_) } 50 sub eachChangeSince { Foswiki::Func::eachChangeSince(@_) } 51 sub getTopicList { Foswiki::Func::getTopicList(@_) } 52 sub topicExists { Foswiki::Func::topicExists(@_) } 53 sub checkTopicEditLock { Foswiki::Func::checkTopicEditLock(@_) } 54 sub setTopicEditLock { Foswiki::Func::setTopicEditLock(@_) } 55 sub saveTopic { Foswiki::Func::saveTopic(@_) } 56 sub saveTopicText { Foswiki::Func::saveTopicText(@_) } 57 sub moveTopic { Foswiki::Func::moveTopic(@_) } 58 sub getRevisionInfo { Foswiki::Func::getRevisionInfo(@_) } 59 sub getRevisionAtTime { Foswiki::Func::getRevisionAtTime(@_) } 60 sub readTopic { Foswiki::Func::readTopic(@_) } 61 sub readTopicText { Foswiki::Func::readTopicText(@_) } 62 sub attachmentExists { Foswiki::Func::attachmentExists(@_) } 63 sub readAttachment { Foswiki::Func::readAttachment(@_) } 64 sub saveAttachment { Foswiki::Func::saveAttachment(@_) } 65 sub moveAttachment { Foswiki::Func::moveAttachment(@_) } 66 sub readTemplate { Foswiki::Func::readTemplate(@_) } 67 sub loadTemplate { Foswiki::Func::loadTemplate(@_) } 68 sub expandTemplate { Foswiki::Func::expandTemplate(@_) } 69 sub writeHeader { Foswiki::Func::writeHeader(@_) } 70 sub redirectCgiQuery { Foswiki::Func::redirectCgiQuery(@_) } 71 sub addToHEAD { Foswiki::Func::addToHEAD(@_) } 72 sub expandCommonVariables { Foswiki::Func::expandCommonVariables(@_) } 73 sub renderText { Foswiki::Func::renderText(@_) } 74 sub internalLink { Foswiki::Func::internalLink(@_) } 75 sub sendEmail { Foswiki::Func::sendEmail(@_) } 76 sub wikiToEmail { Foswiki::Func::wikiToEmail(@_) } 77 sub expandVariablesOnTopicCreation { Foswiki::Func::expandVariablesOnTopicCreation(@_) } 78 sub registerTagHandler { Foswiki::Func::registerTagHandler(@_) } 79 sub registerRESTHandler { Foswiki::Func::registerRESTHandler(@_) } 80 sub decodeFormatTokens { Foswiki::Func::decodeFormatTokens(@_) } 81 sub searchInWebContent { Foswiki::Func::searchInWebContent(@_) } 82 sub getWorkArea { Foswiki::Func::getWorkArea(@_) } 83 sub readFile { Foswiki::Func::readFile(@_) } 84 sub saveFile { Foswiki::Func::saveFile(@_) } 85 sub getRegularExpression { Foswiki::Func::getRegularExpression(@_) } 86 sub normalizeWebTopicName { Foswiki::Func::normalizeWebTopicName(@_) } 87 sub sanitizeAttachmentName { Foswiki::Func::sanitizeAttachmentName(@_) } 88 sub spaceOutWikiWord { Foswiki::Func::spaceOutWikiWord(@_) } 89 sub writeWarning { Foswiki::Func::writeWarning(@_) } 90 sub writeDebug { Foswiki::Func::writeDebug(@_) } 91 sub formatTime { Foswiki::Func::formatTime(@_) } 92 sub isTrue { Foswiki::Func::isTrue(@_) } 93 sub isValidWikiWord { Foswiki::Func::isValidWikiWord(@_) } 94 sub extractParameters { Foswiki::Func::extractParameters(@_) } 95 sub extractNameValuePair { Foswiki::Func::extractNameValuePair(@_) } 96 sub getScriptUrlPath { Foswiki::Func::getScriptUrlPath(@_) } 97 sub getWikiToolName { Foswiki::Func::getWikiToolName(@_) } 98 sub getMainWebname { Foswiki::Func::getMainWebname(@_) } 99 sub getTwikiWebname { Foswiki::Func::getTwikiWebname(@_) } 100 sub getOopsUrl { Foswiki::Func::getOopsUrl(@_) } 101 sub permissionsSet { Foswiki::Func::permissionsSet(@_) } 102 sub getPublicWebList { Foswiki::Func::getPublicWebList(@_) } 103 sub formatGmTime { Foswiki::Func::formatGmTime(@_) } 104 sub getDataDir { Foswiki::Func::getDataDir(@_) } 105 sub getPubDir { Foswiki::Func::getPubDir(@_) } 106 sub checkDependencies { Foswiki::Func::checkDependencies(@_) } 5 107 6 108 1; 109 110 __DATA__ 111 112 Module of Foswiki - The Free Open Source Wiki, http://foswiki.org/, http://Foswiki.org/ 113 114 Copyright (C) 2000-2007 Peter Thoeny, peter@thoeny.org 115 and Foswiki Contributors. All Rights Reserved. Foswiki Contributors 116 are listed in the AUTHORS file in the root of this distribution. 117 NOTE: Please extend that file, not this notice. 118 119 This program is free software; you can redistribute it and/or 120 modify it under the terms of the GNU General Public License 121 as published by the Free Software Foundation; either version 2 122 of the License, or (at your option) any later version. For 123 more details read LICENSE in the root of this distribution. 124 125 This program is distributed in the hope that it will be useful, 126 but WITHOUT ANY WARRANTY; without even the implied warranty of 127 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 128 129 As per the GPL, removal of this notice is prohibited. 130 131 1; -
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'; 1 package TWiki::Plugins; 2 3 use Foswiki::Plugins; 4 5 # Compatible version of TWiki::Plugins 6 our $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 16 tie($TWiki::Plugins::SESSION, 'TWiki::Plugins::SESSION_TIE'); 5 17 6 18 1; -
trunk/core/lib/Foswiki.pm
r812 r827 50 50 use Error qw( :try ); 51 51 use CGI; # Always required to get html generation tags; 52 53 BEGIN { $Package::Alias::BRAVE = 1 }54 use Package::Alias55 'TWiki::Plugins' => 'Foswiki::Plugins',56 'TWiki::Func' => 'Foswiki::Func';57 52 58 53 use Foswiki::Response; -
trunk/core/lib/Foswiki/Plugins.pm
r812 r827 77 77 use Assert; 78 78 79 use Package::Alias 'TWiki::Plugins' => 'Foswiki::Plugins';80 81 79 require Foswiki::Plugin; 82 80 -
trunk/core/lib/MANIFEST
r810 r827 17 17 !include ../TinyMCEPlugin/lib/Foswiki/Plugins/TinyMCEPlugin 18 18 !include ../TopicUserMappingContrib/lib/Foswiki/Contrib/TopicUserMappingContrib 19 !include ../TWikiCompatibilityPlugin/lib/TWiki/Plugins/TWikiCompatibilityPlugin20 19 !include ../TwistyContrib/lib/Foswiki/Contrib/TwistyContrib 21 20 !include ../TwistyPlugin/lib/Foswiki/Plugins/TwistyPlugin 22 21 !include ../WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin 22 !include ../TWikiCompatibilityPlugin/lib/TWiki/Plugins/TWikiCompatibilityPlugin 23 23 !include ../core/lib/Foswiki/Contrib/core 24 -
trunk/core/pseudo-install.pl
r809 r827 11 11 our $install; 12 12 our $basedir; 13 our @ twikiplugins_path;13 our @extensions_path; 14 14 our $CAN_LINK; 15 15 our $force; … … 19 19 $basedir = $FindBin::Bin; # core dir 20 20 $parentdir = "$basedir/.."; 21 my $path = $ENV{ TWIKI_EXTENSIONS} || '';21 my $path = $ENV{FOSWIKI_EXTENSIONS} || ''; 22 22 $path .= $Config::Config{path_sep}."$basedir/twikiplugins" 23 23 .$Config::Config{path_sep}.'.' 24 24 .$Config::Config{path_sep}.$parentdir; 25 @ twikiplugins_path =25 @extensions_path = 26 26 grep(-d $_, split(/$Config::Config{path_sep}/, $path)); 27 27 … … 54 54 55 55 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>...] 61 60 -f[orce] - force an action to complete even if there are warnings 62 61 -e[nable] - automatically enable installed plugins in LocalSite.cfg … … 68 67 all - install all extensions 69 68 default - install extensions listed in lib/MANIFEST 69 developer - default + key developer environment 70 70 <module>... one or more extensions to install 71 71 … … 97 97 my $moduleDir; 98 98 99 foreach my $dir (@ twikiplugins_path) {99 foreach my $dir (@extensions_path) { 100 100 if (-d "$dir/$module/") { 101 101 $moduleDir = "$dir/$module"; … … 211 211 print STDERR "ERROR $path$c is in the way\n"; 212 212 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 }; 213 220 } else { 214 221 my $tgt = _cleanPath("$base$path$c"); … … 313 320 314 321 if ($ARGV[0] eq "all") { 315 foreach my $dir (@ twikiplugins_path) {322 foreach my $dir (@extensions_path) { 316 323 opendir(D, $dir) || next; 317 324 push(@modules, grep(/(Tag|Plugin|Contrib|Skin|AddOn)$/, readdir(D))); … … 325 332 grep { /^!include/ } <F>; 326 333 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'); 327 344 } else { 328 345 @modules = @ARGV; -
trunk/core/tools/extender.pl
r809 r827 40 40 my $reuseOK = 0; 41 41 my $inactive = 0; 42 my $twiki; 43 my $twiki4OrMore; 42 my $session; 44 43 my %available; 45 44 my $lwp; 46 45 my @archTypes = ( '.tgz', '.tar.gz', '.zip' ); 47 my %cfg;48 46 my $installationRoot; 49 47 my $MODULE; … … 69 67 -d 'bin' && 70 68 -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'; 72 70 } 73 71 # read setlib.cfg … … 75 73 require 'setlib.cfg'; 76 74 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); 110 87 111 88 if( &$check_perl_module( 'LWP' )) { … … 117 94 } 118 95 119 =pod120 121 ---+ StaticMethod remap ($file ) -> $file122 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 write130 and test the mappings for Cairo.131 132 =cut133 134 96 sub remap { 135 97 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 142 120 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/#; 152 131 } 153 132 } … … 234 213 DONE 235 214 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; 239 219 $packname .= $pack if( $pack eq 'Contrib' && $packname !~ /Contrib$/); 240 220 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?'); 242 222 if( $reply ) { 243 223 return installPackage( $packname ); … … 347 327 } 348 328 return $reply; 349 }350 351 # DEPRECATED - do not use - install a .spec instead352 # ---++ StaticMethod getConfig( $major, $minor, $cairo ) -> $string353 # * =$major= name of major key.354 # * =$minor= if undefined, there is no minor key355 # * =$cairo= expression that when evaled will get the cairo style config var356 # Get the value of a config var, trying first the Dakar option and357 # 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 instead385 # ---++ StaticMethod commentConfig( $comment )386 # * $comment - comment to insert in LocalSite.cfg, usually before a setConfig387 # Inserts a comment into LocalSite.cfg. The comment will usually describe a following setConfig; for example,388 # <verbatim>389 # commentConfig( <<HERE390 # #---++ Cars Plugin391 # # **STRING 30**392 # # Name of manufacturer393 # HERE394 # );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 instead406 # ---++ 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 keys408 # * =...= list of minorkey=>value pairs409 # Set the given configuration variables in LocalSite.cfg. =$value= must be410 # complete with all syntactic sugar, including quotes.411 # The valued are written to $Foswiki::cfg{major key}{setting} if a major412 # 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 write418 # <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 key429 $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 there440 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 include464 # LocalSite.cfg from TWiki.cfg465 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 }478 329 } 479 330 … … 727 578 my $err = 1; 728 579 729 if( $ twiki) {580 if( $session ) { 730 581 if( $file ) { 731 582 my $origfile = $Foswiki::cfg{PubDir} . '/' . $web . '/' . $topic . '/' . $file; … … 929 780 my $path = $MODULE; 930 781 931 if ($path !~ /^Foswiki::/) { 782 if ($path !~ /^(Foswiki|TWiki)::/) { 783 my $source = $1; 932 784 my $type = 'Contrib'; 933 785 if ($path =~ /Plugin$/) { 934 786 $type = 'Plugins'; 935 787 } 936 $path = 'Foswiki::'.$type.'::'.$rootModule;788 $path = $source.'::'.$type.'::'.$rootModule; 937 789 } 938 790 -
trunk/t2fos.sh
r811 r827 6 6 [ -f $1 -a "$1" != "mapname.sh" ] && { \ 7 7 grep -s -q "TWiki" $1 && { 8 sed -e 's.data/TWiki/.data/System/.g' | \8 sed -e 's.data/TWiki/.data/System/.g' $1 | \ 9 9 sed -e 's.pub/TWiki/.pub/System/.g' | \ 10 10 sed -e 's/TWiki::/Foswiki::/g' $1 | \
Note: See TracChangeset
for help on using the changeset viewer.
