Changeset 24
- Timestamp:
- 11/23/10 15:53:42 (14 years ago)
- Location:
- server/trunk/web
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
server/trunk/web/Makefile.PL
r1 r24 16 16 requires 'Moose'; 17 17 requires 'namespace::autoclean'; 18 requires 'Catalyst::Plugin::Authentication' => '0'; 19 requires 'Catalyst::Plugin::Session' => '0'; 20 requires 'Catalyst::Plugin::Session::Store::DBI' => '0'; 21 requires 'Catalyst::Plugin::Session::State::Cookie' => '0'; 22 requires 'Catalyst::Plugin::Prototype' => '0'; 23 requires 'Catalyst::View::TT' => '0'; 24 requires 'DBD::Pg'; 18 25 requires 'Config::General'; # This should reflect the config file format you've chosen 19 26 # See Catalyst::Plugin::ConfigLoader for supported formats … … 22 29 23 30 install_script glob('script/*.pl'); 24 auto_install; 25 WriteAll; 31 32 WriteMakefile( 33 macro => { 34 DESTRPMDIR => '$(shell pwd)', 35 }, 36 ); 37 38 package MY; 39 40 sub postamble { 41 <<EOF; 42 # .PHONY .= svnmanifest 43 44 svnmanifest: 45 \tsvn ls -R| grep -v "/\$\$" > MANIFEST 46 47 ChangeLog: 48 \tsvn log > ChangeLog 49 50 \$(DISTNAME).spec: \$(DISTNAME).spec.in Makefile 51 \tsed -e 's/\@VERSION@/\$(VERSION)/' < \$< > \$@ 52 53 rpm: \$(DISTVNAME).tar.gz \$(DISTNAME).spec 54 \tmkdir \$(DESTRPMDIR)/noarch || : 55 \trpmbuild -ba --clean\\ 56 \t --define "_sourcedir `pwd`" \\ 57 \t --define "_specdir `pwd`" \\ 58 \t --define "_srcrpmdir \$(DESTRPMDIR)" \\ 59 \t --define "_rpmdir \$(DESTRPMDIR)" \\ 60 \t \$(DISTNAME).spec 61 62 svnrpm: \$(DISTVNAME).tar.gz \$(DISTNAME).spec 63 \tmkdir \$(DESTRPMDIR)/noarch || : 64 \trpmbuild -ba --clean\\ 65 \t --define "_sourcedir `pwd`" \\ 66 \t --define "_specdir `pwd`" \\ 67 \t --define "_srcrpmdir \$(DESTRPMDIR)" \\ 68 \t --define "_rpmdir \$(DESTRPMDIR)" \\ 69 \t --define "svnrelease `LC_ALL=C svn info | grep '^Revision:' | sed 's/Revision: //'`" \\ 70 \t \$(DISTNAME).spec 71 72 EOF 73 } -
server/trunk/web/lib/Sophie/Base.pm
r18 r24 19 19 my ($self) = @_; 20 20 require Config::General; 21 my $cg = Config::General->new("$Bin/../sophie.conf"); 22 my $config = { $cg->getall() }; 21 my $config; 22 foreach my $file ('sophie.conf', "$Bin/../sophie.conf") { 23 -f $file or next; 24 my $cg = Config::General->new($file); 25 $config = { $cg->getall() }; 26 } 27 $config or die "No config found"; 23 28 24 29 DBI->connect_cached( -
server/trunk/web/lib/Sophie/Controller/Rpms.pm
r16 r24 2 2 use Moose; 3 3 use namespace::autoclean; 4 use Encode::Guess; 5 use Encode; 4 6 5 7 BEGIN {extends 'Catalyst::Controller'; } … … 124 126 } 125 127 128 sub changelog : XMLRPCLocal { 129 my ($self, $c, $pkgid) = @_; 130 131 my @ch; 132 foreach ($c->model('Base')->resultset('RpmsChangelog')->search({}, 133 { 134 bind => [ $pkgid ], 135 order_by => [ 'time::int desc' ], 136 }, 137 )->all) { 138 my $chentry; 139 my $enc = guess_encoding($_->get_column('text'), qw/latin1/); 140 $chentry->{text} = $enc && ref $enc 141 ? encode('utf8', $_->get_column('text')) 142 : $_->get_column('text'); 143 $enc = guess_encoding($_->get_column('name'), qw/latin1/); 144 $chentry->{name} = $enc && ref $enc 145 ? encode('utf8', $_->get_column('name')) 146 : $_->get_column('name'); 147 $chentry->{time} = $_->get_column('time'); 148 push(@ch, $chentry); 149 } 150 151 $c->stash->{xmlrpc}{changelog} = \@ch; 152 } 153 126 154 127 155 sub rpms : Chained : PathPart {
Note: See TracChangeset
for help on using the changeset viewer.