From 9dee2ec20e840a05445646f2e4b1c7137700a97e Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 8 Aug 2006 14:55:14 +0000 Subject: * Ship ikiwiki executable as ikiwiki.pl in source to avoid issues on case-sensative filesystems like OSX. --- Makefile.PL | 4 +- debian/changelog | 4 +- ikiwiki | 120 ------------------------------------------------------- ikiwiki.pl | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ t/syntax.t | 2 +- 5 files changed, 126 insertions(+), 124 deletions(-) delete mode 100755 ikiwiki create mode 100755 ikiwiki.pl diff --git a/Makefile.PL b/Makefile.PL index 303116faa..7b61acc61 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -12,7 +12,7 @@ install:: extra_install pure_install:: extra_install extra_build: - ./ikiwiki doc html --templatedir=templates --underlaydir=basewiki \ + ./ikiwiki.pl doc html --templatedir=templates --underlaydir=basewiki \ --wikiname="ikiwiki" --verbose --no-rcs \ --exclude=/discussion --no-discussion \ --plugin=brokenlinks --plugin=pagecount \ @@ -50,5 +50,5 @@ extra_install: WriteMakefile( 'NAME' => 'IkiWiki', 'PM_FILTER' => 'grep -v "removed by Makefile"', - 'EXE_FILES' => ['ikiwiki'], + 'EXE_FILES' => ['ikiwiki.pl'], ); diff --git a/debian/changelog b/debian/changelog index eaa9b816f..8fc3b66db 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,8 +7,10 @@ ikiwiki (1.17) UNRELEASED; urgency=low templates but can be useful for things like making comma-delimited lists of tags or what have you. * Remove
from end of aggregate preprocessor directive output. + * Ship ikiwiki executable as ikiwiki.pl in source to avoid issues on + case-sensative filesystems like OSX. - -- Joey Hess Sat, 5 Aug 2006 17:15:12 -0400 + -- Joey Hess Tue, 8 Aug 2006 10:52:23 -0400 ikiwiki (1.16) unstable; urgency=low diff --git a/ikiwiki b/ikiwiki deleted file mode 100755 index 1342ec543..000000000 --- a/ikiwiki +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/perl -T -$ENV{PATH}="/usr/local/bin:/usr/bin:/bin"; -delete @ENV{qw{IFS CDPATH ENV BASH_ENV}}; - -package IkiWiki; -use warnings; -use strict; -use lib '.'; # For use without installation, removed by Makefile. -use IkiWiki; - -sub usage () { #{{{ - die "usage: ikiwiki [options] source dest\n"; -} #}}} - -sub getconfig () { #{{{ - if (! exists $ENV{WRAPPED_OPTIONS}) { - %config=defaultconfig(); - eval q{use Getopt::Long}; - Getopt::Long::Configure('pass_through'); - GetOptions( - "setup|s=s" => \$config{setup}, - "wikiname=s" => \$config{wikiname}, - "verbose|v!" => \$config{verbose}, - "rebuild!" => \$config{rebuild}, - "refresh!" => \$config{refresh}, - "wrappers!" => \$config{wrappers}, - "getctime" => \$config{getctime}, - "wrappermode=i" => \$config{wrappermode}, - "rcs=s" => \$config{rcs}, - "no-rcs" => sub { $config{rcs}="" }, - "anonok!" => \$config{anonok}, - "rss!" => \$config{rss}, - "cgi!" => \$config{cgi}, - "discussion!" => \$config{discussion}, - "w3mmode!" => \$config{w3mmode}, - "notify!" => \$config{notify}, - "url=s" => \$config{url}, - "cgiurl=s" => \$config{cgiurl}, - "historyurl=s" => \$config{historyurl}, - "diffurl=s" => \$config{diffurl}, - "svnrepo" => \$config{svnrepo}, - "svnpath" => \$config{svnpath}, - "adminemail=s" => \$config{adminemail}, - "timeformat=s" => \$config{timeformat}, - "exclude=s@" => sub { - $config{wiki_file_prune_regexp}=qr/$config{wiki_file_prune_regexp}|$_[1]/; - }, - "adminuser=s@" => sub { - push @{$config{adminuser}}, $_[1] - }, - "templatedir=s" => sub { - $config{templatedir}=possibly_foolish_untaint($_[1]) - }, - "underlaydir=s" => sub { - $config{underlaydir}=possibly_foolish_untaint($_[1]) - }, - "wrapper:s" => sub { - $config{wrapper}=$_[1] ? $_[1] : "ikiwiki-wrap" - }, - "plugin=s@" => sub { - push @{$config{plugin}}, $_[1]; - }, - "disable-plugin=s@" => sub { - $config{plugin}=[grep { $_ ne $_[1] } @{$config{plugin}}]; - }, - "pingurl" => sub { - push @{$config{pingurl}}, $_[1]; - } - ) || usage(); - - if (! $config{setup}) { - loadplugins(); - usage() unless @ARGV == 2; - $config{srcdir} = possibly_foolish_untaint(shift @ARGV); - $config{destdir} = possibly_foolish_untaint(shift @ARGV); - checkconfig(); - } - } - else { - # wrapper passes a full config structure in the environment - # variable - eval possibly_foolish_untaint($ENV{WRAPPED_OPTIONS}); - if ($@) { - error("WRAPPED_OPTIONS: $@"); - } - loadplugins(); - checkconfig(); - } -} #}}} - -sub main () { #{{{ - getconfig(); - - if ($config{cgi}) { - lockwiki(); - loadindex(); - require IkiWiki::CGI; - cgi(); - } - elsif ($config{setup}) { - require IkiWiki::Setup; - setup(); - } - elsif ($config{wrapper}) { - lockwiki(); - require IkiWiki::Wrapper; - gen_wrapper(); - } - else { - lockwiki(); - loadindex(); - require IkiWiki::Render; - rcs_update(); - refresh(); - rcs_notify() if $config{notify}; - saveindex(); - } -} #}}} - -main; diff --git a/ikiwiki.pl b/ikiwiki.pl new file mode 100755 index 000000000..1342ec543 --- /dev/null +++ b/ikiwiki.pl @@ -0,0 +1,120 @@ +#!/usr/bin/perl -T +$ENV{PATH}="/usr/local/bin:/usr/bin:/bin"; +delete @ENV{qw{IFS CDPATH ENV BASH_ENV}}; + +package IkiWiki; +use warnings; +use strict; +use lib '.'; # For use without installation, removed by Makefile. +use IkiWiki; + +sub usage () { #{{{ + die "usage: ikiwiki [options] source dest\n"; +} #}}} + +sub getconfig () { #{{{ + if (! exists $ENV{WRAPPED_OPTIONS}) { + %config=defaultconfig(); + eval q{use Getopt::Long}; + Getopt::Long::Configure('pass_through'); + GetOptions( + "setup|s=s" => \$config{setup}, + "wikiname=s" => \$config{wikiname}, + "verbose|v!" => \$config{verbose}, + "rebuild!" => \$config{rebuild}, + "refresh!" => \$config{refresh}, + "wrappers!" => \$config{wrappers}, + "getctime" => \$config{getctime}, + "wrappermode=i" => \$config{wrappermode}, + "rcs=s" => \$config{rcs}, + "no-rcs" => sub { $config{rcs}="" }, + "anonok!" => \$config{anonok}, + "rss!" => \$config{rss}, + "cgi!" => \$config{cgi}, + "discussion!" => \$config{discussion}, + "w3mmode!" => \$config{w3mmode}, + "notify!" => \$config{notify}, + "url=s" => \$config{url}, + "cgiurl=s" => \$config{cgiurl}, + "historyurl=s" => \$config{historyurl}, + "diffurl=s" => \$config{diffurl}, + "svnrepo" => \$config{svnrepo}, + "svnpath" => \$config{svnpath}, + "adminemail=s" => \$config{adminemail}, + "timeformat=s" => \$config{timeformat}, + "exclude=s@" => sub { + $config{wiki_file_prune_regexp}=qr/$config{wiki_file_prune_regexp}|$_[1]/; + }, + "adminuser=s@" => sub { + push @{$config{adminuser}}, $_[1] + }, + "templatedir=s" => sub { + $config{templatedir}=possibly_foolish_untaint($_[1]) + }, + "underlaydir=s" => sub { + $config{underlaydir}=possibly_foolish_untaint($_[1]) + }, + "wrapper:s" => sub { + $config{wrapper}=$_[1] ? $_[1] : "ikiwiki-wrap" + }, + "plugin=s@" => sub { + push @{$config{plugin}}, $_[1]; + }, + "disable-plugin=s@" => sub { + $config{plugin}=[grep { $_ ne $_[1] } @{$config{plugin}}]; + }, + "pingurl" => sub { + push @{$config{pingurl}}, $_[1]; + } + ) || usage(); + + if (! $config{setup}) { + loadplugins(); + usage() unless @ARGV == 2; + $config{srcdir} = possibly_foolish_untaint(shift @ARGV); + $config{destdir} = possibly_foolish_untaint(shift @ARGV); + checkconfig(); + } + } + else { + # wrapper passes a full config structure in the environment + # variable + eval possibly_foolish_untaint($ENV{WRAPPED_OPTIONS}); + if ($@) { + error("WRAPPED_OPTIONS: $@"); + } + loadplugins(); + checkconfig(); + } +} #}}} + +sub main () { #{{{ + getconfig(); + + if ($config{cgi}) { + lockwiki(); + loadindex(); + require IkiWiki::CGI; + cgi(); + } + elsif ($config{setup}) { + require IkiWiki::Setup; + setup(); + } + elsif ($config{wrapper}) { + lockwiki(); + require IkiWiki::Wrapper; + gen_wrapper(); + } + else { + lockwiki(); + loadindex(); + require IkiWiki::Render; + rcs_update(); + refresh(); + rcs_notify() if $config{notify}; + saveindex(); + } +} #}}} + +main; diff --git a/t/syntax.t b/t/syntax.t index 1e6b04747..2462464ef 100755 --- a/t/syntax.t +++ b/t/syntax.t @@ -3,7 +3,7 @@ use warnings; use strict; use Test; -my @progs="ikiwiki"; +my @progs="ikiwiki.pl"; my @libs="IkiWiki.pm"; push @libs, map { chomp; $_ } `find IkiWiki -type f -name \\*.pm`; -- cgit v1.2.3