[Midnightbsd-cvs] mports [20485] trunk/Tools/magus/www/data/magus/index.cgi: fix definition

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri Oct 9 20:45:50 EDT 2015


Revision: 20485
          http://svnweb.midnightbsd.org/mports/?rev=20485
Author:   laffer1
Date:     2015-10-09 20:45:50 -0400 (Fri, 09 Oct 2015)
Log Message:
-----------
fix definition

Modified Paths:
--------------
    trunk/Tools/magus/www/data/magus/index.cgi

Modified: trunk/Tools/magus/www/data/magus/index.cgi
===================================================================
--- trunk/Tools/magus/www/data/magus/index.cgi	2015-10-10 00:40:22 UTC (rev 20484)
+++ trunk/Tools/magus/www/data/magus/index.cgi	2015-10-10 00:45:50 UTC (rev 20485)
@@ -16,8 +16,8 @@
 # the search_where() method into Magus::DBI here...
 #
 {
-  package Magus::DBI;
-  use Class::DBI::AbstractSearch;
+    package Magus::DBI;
+    use Class::DBI::AbstractSearch;
 }
 
 while (my $p = CGI::Fast->new) {
@@ -475,36 +475,41 @@
 }
   
 sub browse {
-  my ($p, $path) = @_;
-  
-  if ($path =~ m:(.*?)/(.+):) {
-    return search($p, 
-      "name:$path status:any", 
-      {title => '<a href="'.$p->script_name . qq[/browse/$1">$1</a>/$2]} 
-    );
-  }
-  
-  # $path is a category
+    my ($p, $path) = @_;
+    my $cat;
+
+    if ($path =~ m:(.*?)/(.+):) {
+        return search($p,
+        "name:$path status:any",
+        {title => '<a href="'.$p->script_name . qq[/browse/$1">$1</a>/$2]}
+        );
+    }
+
+    # $path is a category
     eval {
-        my $cat = Magus::Category->retrieve(category => $path) || die "No such category: $path\n";
+        $cat = Magus::Category->retrieve(category => $path) || die "No such category: $path\n";
     };
     if ($@) {
         print $p->header(
-            -type=>'text/plain',
-            -status=> '404 Not Found'
+            -type => 'text/plain',
+            -status => '404 Not Found'
         );
         print "404 Not Found\n";
         exit;
     }
 
-  my $tmpl = template($p, "category.tmpl");
-  $tmpl->param(
-    title    => "Magus // Browse // $path",
-    ports    => [map {{ port => $_ }} sort @{$cat->distinct_ports}],
-    category => $path,
-  );
-  
-  print $p->header. $tmpl->output;
+    my $tmpl = template($p, "category.tmpl");
+    $tmpl->param(
+        title    => "Magus // Browse // $path",
+        ports    => [map {
+            {
+                port => $_
+            }
+        } sort @{$cat->distinct_ports}],
+        category => $path,
+    );
+
+    print $p->header. $tmpl->output;
 }
 
 sub template {



More information about the Midnightbsd-cvs mailing list