Changeset 373
- Timestamp:
- 05/18/11 23:11:46 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/trunk/web/lib/Sophie/Controller/Chat/Cmd.pm
r370 r373 96 96 } 97 97 return join(', ', @loc); 98 } 99 100 sub _fmt_question : Private { 101 my ($self, $c, $searchspec) = @_; 102 103 my $loc; 104 $loc = sprintf( 105 '(%s, %s, %s)', 106 $searchspec->{dist} || $searchspec->{distribution} || "*", 107 $searchspec->{release} || "*", 108 $searchspec->{arch} || "*", 109 ); 110 111 return $loc; 98 112 } 99 113 … … 231 245 if (!@{ $res }) { 232 246 return $c->stash->{xmlrpc} = { 233 message => [ 'Nothing matches `' . $args[0] . '\'' ] 247 message => [ "Nothing matches `$args[0]' in " 248 .$c->forward('_fmt_question', [$reqspec])], 234 249 }; 235 250 } else { 236 my @message = 'rpm name matching `' . $args[0] . '\':'; 251 my @message = "rpm name matching `$args[0]' in " 252 .$c->forward('_fmt_question', [$reqspec])." :"; 237 253 while (@{ $res }) { 238 254 my $str = ''; … … 274 290 if (@{ $res } > 100) { 275 291 return $c->stash->{xmlrpc} = { 276 message => [ 'I have ' . @{ $res } . ' results' ], 292 message => [ 'I have ' . @{ $res } . ' results in ' 293 .$c->forward('_fmt_question', [$reqspec])], 277 294 }; 278 295 } else { … … 282 299 push(@names, $info->{name}); 283 300 } 284 my @message = 'rpm name matching `' . $args[0] . '\':'; 301 my @message = "rpm name matching `$args[0]' in " 302 .$c->forward('_fmt_question', [$reqspec])." :"; 285 303 while (@names) { 286 304 my $str = ''; … … 298 316 } else { 299 317 return $c->stash->{xmlrpc} = { 300 message => [ 'No rpm description matches this keywords' ], 318 message => [ 'No rpm description matches this keywords in ' 319 .$c->forward('_fmt_question', [$reqspec])], 301 320 }; 302 321 } … … 326 345 if (!$c->forward('/distrib/exists', [ $reqspec ])) { 327 346 return $c->stash->{xmlrpc} = { 328 message => [ "I don't have such distribution" ] 347 message => [ "I don't have such distribution : " 348 .$c->forward('_fmt_question', [$reqspec])], 329 349 }; 330 350 } … … 336 356 return $c->stash->{xmlrpc} = { 337 357 message => [ 338 "There is no rpm named `$args[0]', but the word matches in " . $else 358 "There is no rpm named `$args[0]' in " 359 .$c->forward('_fmt_question', [$reqspec]) 360 .", but the word matches in " . $else 339 361 ], 340 362 } 341 363 } else { 342 364 return $c->stash->{xmlrpc} = { 343 message => [ "The rpm named `$args[0]' has not been found" ], 365 message => [ "The rpm named `$args[0]' has not been found in " 366 .$c->forward('_fmt_question', [$reqspec])], 344 367 } 345 368 } … … 702 725 if (!$c->forward('/distrib/exists', [ $reqspec ])) { 703 726 return $c->stash->{xmlrpc} = { 704 message => [ "I don't have such distribution" ] 727 message => [ "I don't have such distribution : " 728 .$c->forward('_fmt_question', [$reqspec])], 705 729 }; 706 730 } … … 712 736 return $c->stash->{xmlrpc} = { 713 737 message => [ 714 "There is no rpm named `$args[0]', but the word matches in " . $else 738 "There is no rpm named `$args[0]' in " 739 .$c->forward('_fmt_question', [$reqspec]) 740 .", but the word matches in " . $else 715 741 ], 716 742 } 717 743 } else { 718 744 return $c->stash->{xmlrpc} = { 719 message => [ "The rpm named `$args[0]' has not been found" ], 745 message => [ "The rpm named `$args[0]' has not been found in " 746 .$c->forward('_fmt_question', [$reqspec])], 720 747 } 721 748 } … … 753 780 if (!$c->forward('/distrib/exists', [ $reqspec ])) { 754 781 return $c->stash->{xmlrpc} = { 755 message => [ "I don't have such distribution" ] 782 message => [ "I don't have such distribution : " 783 .$c->forward('_fmt_question', [$reqspec])], 756 784 }; 757 785 } … … 763 791 return $c->stash->{xmlrpc} = { 764 792 message => [ 765 "There is no rpm named `$args[0]', but the word matches in " . $else 793 "There is no rpm named `$args[0]' in " 794 .$c->forward('_fmt_question', [$reqspec]) 795 .", but the word matches in " . $else 766 796 ], 767 797 } 768 798 } else { 769 799 return $c->stash->{xmlrpc} = { 770 message => [ "The rpm named `$args[0]' has not been found" ], 800 message => [ "The rpm named `$args[0]' has not been found in " 801 .$c->forward('_fmt_question', [$reqspec])], 771 802 } 772 803 } … … 800 831 if (!$c->forward('/distrib/exists', [ $reqspec ])) { 801 832 return $c->stash->{xmlrpc} = { 802 message => [ "I don't have such distribution" ] 833 message => [ "I don't have such distribution in " 834 .$c->forward('_fmt_question', [$reqspec])], 803 835 }; 804 836 } … … 809 841 return $c->stash->{xmlrpc} = { 810 842 message => [ 811 "There is no rpm named `$args[0]', but the word matches in " . $else 843 "There is no rpm named `$args[0]' in " 844 .$c->forward('_fmt_question', [$reqspec]) 845 .", but the word matches in " . $else 812 846 ], 813 847 } 814 848 } else { 815 849 return $c->stash->{xmlrpc} = { 816 message => [ "The rpm named `$args[0]' has not been found" ], 850 message => [ "The rpm named `$args[0]' has not been found in " 851 .$c->forward('_fmt_question', [$reqspec])], 817 852 } 818 853 } … … 855 890 if (!$c->forward('/distrib/exists', [ $reqspec ])) { 856 891 return $c->stash->{xmlrpc} = { 857 message => [ "I don't have such distribution" ] 892 message => [ "I don't have such distribution in " 893 .$c->forward('_fmt_question', [$reqspec])], 858 894 }; 859 895 } … … 862 898 if (!@{ $rpmlist }) { 863 899 return $c->stash->{xmlrpc} = { 864 message => [ "Sorry, no file $args[0] found" ], 900 message => [ "Sorry, no file $args[0] found in " 901 .$c->forward('_fmt_question', [$reqspec])], 865 902 } 866 903 } elsif (@{ $rpmlist } > 20) { … … 919 956 message => [ 920 957 "Package matching $depname" . ($evr ? " $sense $evr" : '') . 921 ':', 958 " in " 959 .$c->forward('_fmt_question', [$reqspec]) 960 .':', 922 961 join(' ', @name), 923 962 ], … … 925 964 } else { 926 965 return $c->stash->{xmlrpc} = { 927 message => [ 'Too many results' ], 966 message => [ 'Too many results in ' 967 .$c->forward('_fmt_question', [$reqspec])], 928 968 }; 929 969 } … … 951 991 if (!$c->forward('/distrib/exists', [ $reqspec ])) { 952 992 return $c->stash->{xmlrpc} = { 953 message => [ "I don't have such distribution" ] 993 message => [ "I don't have such distribution : " 994 .$c->forward('_fmt_question', [$reqspec])], 954 995 }; 955 996 } … … 960 1001 return $c->stash->{xmlrpc} = { 961 1002 message => [ 962 "There is no rpm named `$args[0]', but the word matches in " . $else 1003 "There is no rpm named `$args[0]' in " 1004 .$c->forward('_fmt_question', [$reqspec]) 1005 .", but the word matches in " . $else 963 1006 ], 964 1007 } 965 1008 } else { 966 1009 return $c->stash->{xmlrpc} = { 967 message => [ "The rpm named `$args[0]' has not been found" ], 1010 message => [ "The rpm named `$args[0]' has not been found in " 1011 .$c->forward('_fmt_question', [$reqspec])], 968 1012 } 969 1013 } … … 998 1042 if (!$c->forward('/distrib/exists', [ $dist ])) { 999 1043 return $c->stash->{xmlrpc} = { 1000 message => [ "I don't have such distribution" ] 1044 message => [ "I don't have such distribution : " 1045 .$c->forward('_fmt_question', [$reqspec])], 1001 1046 }; 1002 1047 } … … 1007 1052 return $c->stash->{xmlrpc} = { 1008 1053 message => [ 1009 scalar(@$maints) . " maintainers found matching `$args[0]' "1010 ]1054 scalar(@$maints) . " maintainers found matching `$args[0]' in " 1055 .$c->forward('_fmt_question', [$reqspec])], 1011 1056 }; 1012 1057 } elsif (! @$maints) { 1013 1058 return $c->stash->{xmlrpc} = { 1014 message => [ "No maintainer found matching `$args[0]'" ] 1059 message => [ "No maintainer found matching `$args[0]' in " 1060 .$c->forward('_fmt_question', [$reqspec])], 1015 1061 }; 1016 1062 } else {
Note: See TracChangeset
for help on using the changeset viewer.