Changeset 331 for server/trunk/web/lib/Sophie/Controller/Rpms.pm
- Timestamp:
- 01/21/11 18:06:58 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/trunk/web/lib/Sophie/Controller/Rpms.pm
r328 r331 382 382 /^analyse$/ and $c->go('analyse', [ $pkgid, @args ]); 383 383 /^dependency$/ and $c->go('dependency', [ $pkgid, @args ]); 384 /^history$/ and $c->go('history', [ $pkgid, @args ]);384 /^history$/ and $c->go('history', [ $pkgid, @args ]); 385 385 /^query$/ and $c->go('query', [ $pkgid, @args ]); 386 /^scriptlet$/ and $c->go('scriptlet', [ $pkgid, @args ]); 386 387 /./ and $c->go('/404/index'); # other subpart dont exists 387 388 } … … 511 512 } 512 513 514 sub scriptlet :Chained('rpms_') :PathPart('scriptlet') :Args(0) :XMLRPCLocal { 515 my ( $self, $c, $pkgid ) = @_; 516 $pkgid ||= $c->stash->{pkgid}; 517 $c->stash->{rpmurl} = ($c->req->path =~ m:(.*)/[^/]+:)[0]; 518 519 $c->stash->{xmlrpc} = {}; 520 foreach ( 521 [ 'PREIN', 'PREINPROG' ], 522 [ 'POSTIN', 'POSTINPROG' ], 523 [ 'PREUN', 'PREUNPROG' ], 524 [ 'POSTUN', 'POSTUNPROG' ], 525 [ 'PRETRANS', 'PRETRANSPROG' ], 526 [ 'POSTTRANS', 'POSTTRANSPROG' ], 527 ) { 528 529 my ($res) = $c->model('Base::Rpms')->search( 530 { pkgid => $pkgid }, 531 { 532 select => [ 533 qq{rpmquery("header", ?)}, 534 qq{rpmquery("header", ?)}, 535 ], 536 as => [ qw(script prog) ], 537 bind => $_, 538 } 539 )->all; 540 541 $c->stash->{xmlrpc}{$_->[0]} = { $res->get_columns } if ($res); 542 } 543 $c->stash->{xmlrpc}{triggers} = [ 544 map { { $_->get_columns } } 545 $c->model('Base::Rpms')->search( 546 { pkgid => $pkgid }, 547 { 548 select => [ 549 qq{rpmquery("header", ?)}, 550 qq{rpmquery("header", ?)}, 551 qq{rpmquery("header", ?)}, 552 qq{rpmsenseflag(rpmquery("header", ?)::int)}, 553 qq{rpmquery("header", ?)}, 554 ], 555 as => [ qw(script prog name sense version) ], 556 bind => [qw( 557 TRIGGERSCRIPTS 558 TRIGGERSCRIPTPROG 559 TRIGGERNAME 560 TRIGGERFLAGS 561 TRIGGERVERSION 562 )] 563 } 564 )->all ]; 565 566 return $c->stash->{xmlrpc}; 567 } 568 513 569 =head2 rpms.location( PKGID ) 514 570
Note: See TracChangeset
for help on using the changeset viewer.