| 1 | #!/usr/bin/perl | ||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use Config; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use File::Copy; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use File::Basename; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use File::Find; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=7.2
| |||||||||||
| 9 | |||||||||||
| 10 | # This is a nasty hack. SVN::Core has a bug. "perl -MSVN::Core -c -e 1" | ||||||||||
| 11 | # will dump core. Something to do with the interaction between "-c" | ||||||||||
| 12 | # running BEGIN blocks but not running END blocks, or similar. | ||||||||||
| 13 | # | ||||||||||
| 14 | # Anyway, we want to test to make sure this script compiles cleanly. | ||||||||||
| 15 | # And we want to use SVN::Web. Since the two are mutually exclusive, | ||||||||||
| 16 | # only use SVN::Web (and hence SVN::Core) if we're not compiling. | ||||||||||
| 17 | 1 | ▶ | if(!$^C) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 1 | require SVN::Web; | |||||||||
| 19 | } | ||||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | my $version = SVN::Web->VERSION(); | ||||||||||
| 23 | |||||||||||
| 24 | die "already have config.yaml" if -e 'config.yaml'; | ||||||||||
| 25 | |||||||||||
| 26 | open my $fh, '>', 'config.yaml'; | ||||||||||
| 27 | |||||||||||
| 28 | print $fh <<END; | ||||||||||
| 29 | version: $version | ||||||||||
| 30 | |||||||||||
| 31 | # Actions, the classes that implement them, and where they should appear | ||||||||||
| 32 | # in the action menu | ||||||||||
| 33 | actions: | ||||||||||
| 34 | blame: | ||||||||||
| 35 | class: SVN::Web::Blame | ||||||||||
| 36 | action_menu: | ||||||||||
| 37 | show: | ||||||||||
| 38 | - file | ||||||||||
| 39 | link_text: (view blame) | ||||||||||
| 40 | browse: | ||||||||||
| 41 | class: SVN::Web::Browse | ||||||||||
| 42 | action_menu: | ||||||||||
| 43 | show: | ||||||||||
| 44 | - directory | ||||||||||
| 45 | link_text: (browse directory) | ||||||||||
| 46 | checkout: | ||||||||||
| 47 | class: SVN::Web::Checkout | ||||||||||
| 48 | action_menu: | ||||||||||
| 49 | show: | ||||||||||
| 50 | - file | ||||||||||
| 51 | link_text: (checkout) | ||||||||||
| 52 | diff: | ||||||||||
| 53 | class: SVN::Web::Diff | ||||||||||
| 54 | list: | ||||||||||
| 55 | class: SVN::Web::List | ||||||||||
| 56 | opts: | ||||||||||
| 57 | public_repos_uri: hide_local | ||||||||||
| 58 | log: | ||||||||||
| 59 | class: SVN::Web::Log | ||||||||||
| 60 | action_menu: | ||||||||||
| 61 | show: | ||||||||||
| 62 | - file | ||||||||||
| 63 | - directory | ||||||||||
| 64 | link_text: (view revision log) | ||||||||||
| 65 | revision: | ||||||||||
| 66 | class: SVN::Web::Revision | ||||||||||
| 67 | rss: | ||||||||||
| 68 | class: SVN::Web::RSS | ||||||||||
| 69 | action_menu: | ||||||||||
| 70 | show: | ||||||||||
| 71 | - file | ||||||||||
| 72 | - directory | ||||||||||
| 73 | link_text: (rss) | ||||||||||
| 74 | head_only: 1 | ||||||||||
| 75 | icon: /css/trac/feed-icon-16x16.png | ||||||||||
| 76 | view: | ||||||||||
| 77 | class: SVN::Web::View | ||||||||||
| 78 | action_menu: | ||||||||||
| 79 | show: | ||||||||||
| 80 | - file | ||||||||||
| 81 | link_text: (view file) | ||||||||||
| 82 | |||||||||||
| 83 | # Languages. Specify the localisation files, and how they should be described | ||||||||||
| 84 | # in the web interface. You probably don't want to change this. | ||||||||||
| 85 | languages: | ||||||||||
| 86 | en: English | ||||||||||
| 87 | fr: Français | ||||||||||
| 88 | zh_cn: Chinese (Simplified) | ||||||||||
| 89 | zh_tw: Chinese (Traditional) | ||||||||||
| 90 | |||||||||||
| 91 | # Set the default language here. If not set, English is used | ||||||||||
| 92 | #default_language: fr | ||||||||||
| 93 | |||||||||||
| 94 | # Time and date formatting | ||||||||||
| 95 | timedate_format: '%Y/%m/%d %H:%M:%S' | ||||||||||
| 96 | |||||||||||
| 97 | # Timezone. Uncomment the next line to use the server's timezone instead | ||||||||||
| 98 | # of UTC. Or, specify a literal timezone (C<timezone: 'EST'> for example) | ||||||||||
| 99 | #timezone: local | ||||||||||
| 100 | |||||||||||
| 101 | # set your repository path below: | ||||||||||
| 102 | # | ||||||||||
| 103 | #repos: | ||||||||||
| 104 | # test: '/tmp/svnweb-test' | ||||||||||
| 105 | # test2: '/tmp/svnweb-test2' | ||||||||||
| 106 | # | ||||||||||
| 107 | # or a parent path contains repositories | ||||||||||
| 108 | # | ||||||||||
| 109 | #reposparent: '/path/to/repositories' | ||||||||||
| 110 | # | ||||||||||
| 111 | # if you set a parent you can block specific repositories | ||||||||||
| 112 | # like this: | ||||||||||
| 113 | # | ||||||||||
| 114 | #block: | ||||||||||
| 115 | # - 'blocked1' | ||||||||||
| 116 | # - 'blocked2' | ||||||||||
| 117 | # | ||||||||||
| 118 | |||||||||||
| 119 | END | ||||||||||
| 120 | |||||||||||
| 121 | close $fh; | ||||||||||
| 122 | |||||||||||
| 123 | # XXX: export the template too | ||||||||||
| 124 | |||||||||||
| 125 | print "SVN::Web now installed! please see config.yaml\n"; | ||||||||||
| 126 | |||||||||||
| 127 | =head1 COPYRIGHT | ||||||||||
| 128 | |||||||||||
| 129 | Copyright 2003-2004 by Chia-liang Kao C<< <clkao@clkao.org> >>. | ||||||||||
| 130 | |||||||||||
| 131 | Copyright 2005-2007 by Nik Clayton C<< <nik@FreeBSD.org> >>. | ||||||||||
| 132 | |||||||||||
| 133 | Copyright 2012 by Dean Hamstead C<< <dean@fragfest.com.au> >>. | ||||||||||
| 134 | |||||||||||
| 135 | This program is free software; you can redistribute it and/or modify it | ||||||||||
| 136 | under the same terms as Perl itself. | ||||||||||
| 137 | |||||||||||
| 138 | See L<http://www.perl.com/perl/misc/Artistic.html> | ||||||||||
| 139 | |||||||||||
| 140 | =cut | ||||||||||