Changeset 24

Show
Ignore:
Timestamp:
12/15/06 13:54:48 (2 years ago)
Author:
ingy
Message:
 r2328@skinny:  ingy | 2006-12-15 13:10:36 -0800
 move old kwiki script out of the way
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bin/kwiki

    r22 r24  
    88use Config; 
    99 
    10 sub valid_base { 
    11     my $base = shift; 
    12     -d $base and 
    13     -d "$base/core/Kwiki" and 
    14     -d "$base/plugins"; 
    15 } 
    16  
    1710sub find_base { 
    1811    return $ENV{KWIKI_BASE} 
    1912      if defined $ENV{KWIKI_BASE}; 
     13 
    2014    my $base = $FindBin::Bin; 
    2115    my $bin = $0; 
     
    2822    } 
    2923    $base = abs_path("$base/.."); 
    30     return $base if valid_base($base); 
     24    return $base if -d "$base/lib/Kwiki"; 
     25 
     26    if ($ENV{HOME}) { 
     27        $base = abs_path("$ENV{HOME}/.kwiki"); 
     28        return $base 
     29          if (-d $base and -w $base); 
     30    } 
     31 
    3132    die <<'...'; 
    32 Can't locate Kwiki repository.  
    33 Try setting the KWIKI_BASE environment variable. 
     33 
     34*ERROR*: Can't locate Kwiki base repository. 
     35 
     36Try setting the KWIKI_BASE environment variable to a writable directory 
     37where Kwiki can store site information. Alternately you can create a 
     38~/.kwiki/ directory for this purpose. 
     39 
     40If you install Kwiki from SVN (http://svn.2.kwiki.org/kwiki/trunk/) or 
     41from a Kwiki download tarball (instead of CPAN), then Kwiki will use 
     42that directory as the base. 
     43 
     44NOTE: Installing Kwiki from SVN is recommended. It makes installing and 
     45      updating Kwiki trivial. 
     46 
    3447... 
    3548}  
    3649 
     50# Add $KWIKI_BASE/lib to @INC; 
    3751BEGIN { 
    38     my $base = find_base(); 
    39     die "$base is an invalid Kwiki source code repository" 
    40       unless valid_base($base); 
    41     eval "use lib '$base/lib'; 1" 
    42       or die $@; 
    43 #     $ENV{KWIKI_TEST} = 1; 
     52    $ENV{KWIKI_TEST} = 1; 
    4453    if ($ENV{KWIKI_TEST}) { 
    4554        @INC = ( 
    46             "$base/lib", 
    4755            $Config::Config{privlib}, 
    4856            $Config::Config{archlib}, 
    4957        );  
     58    } 
     59 
     60    my $base = find_base(); 
     61    if (-e "$base/lib") { 
     62        eval "use lib '$base/lib'; 1" 
     63          or die $@; 
    5064    } 
    5165    $ENV{KWIKI_BASE} = $base; 
     
    6074=head1 NAME 
    6175 
    62 kwiki - The Kwiki Command Line Tool for Checked Out Code 
     76kwiki - The Kwiki Command Line Tool 
    6377 
    6478=head1 USAGE 
    6579 
    66     > # Get the source code and put 'kwiki' in your path 
    67     > svn co http://svn.kwiki.org/kwiki ~/src/kwiki 
    68     > export PATH=$PATH:~/src/kwiki/bin 
     80    > kwiki -new /path/to/cgi-bin/my-kwiki 
    6981 
    70     > # Make a new Kwiki site 
    71     > mkdir ~/kwiki 
    72     > cd ~/kwiki 
    73     > kwiki -new my-first-kwiki 
    74     > cd my-first-kwiki 
    75     > kwiki -update 
     82    Kwiki software installed! Point your browser at this location. 
    7683 
    7784=head1 DESCRIPTION 
    7885 
    79 This script does the same thing as the C<kwiki> command line program 
    80 that is normally installed when you install C<Kwiki.pm> from CPAN. 
     86Kwiki is a simple extendable wiki framework, written in Perl. 
    8187 
    82 Use this script instead, when you are getting the Kwiki related modules 
    83 from C<http://svn.kwiki.org/kwiki/> instead of CPAN. 
     88See L<Kwiki::Command> for more information on using this command line tool. 
     89 
     90=head1 NOTE 
     91 
     92If you are on Mac OS X, use the command C<perldoc Kwiki.pm> to get the 
     93Kwiki B<module> documentation. 
    8494 
    8595=head1 AUTHOR 
    8696 
    87 Brian Ingerson <ingy@cpan.org> 
     97Ingy döt Net <ingy@cpan.org> 
    8898 
    8999=head1 COPYRIGHT 
    90100 
    91 Copyright (c) 2005. Brian Ingerson. All rights reserved. 
     101Copyright (c) 2004-2005. Brian Ingerson. All rights reserved. 
     102Copyright (c) 2006. Ingy döt Net. All rights reserved. 
    92103 
    93104This program is free software; you can redistribute it and/or modify it