[Bps-public-commit] r20114 - RT-Extension-rt_cpan_org/bin

ruz at bestpractical.com ruz at bestpractical.com
Thu Aug 20 01:19:23 EDT 2009


Author: ruz
Date: Thu Aug 20 01:19:21 2009
New Revision: 20114

Modified:
   RT-Extension-rt_cpan_org/bin/pull-live
   RT-Extension-rt_cpan_org/bin/rt-cpan-export-db

Log:
* s/queue/distribution/ in exporter
* export lc severity

Modified: RT-Extension-rt_cpan_org/bin/pull-live
==============================================================================
--- RT-Extension-rt_cpan_org/bin/pull-live	(original)
+++ RT-Extension-rt_cpan_org/bin/pull-live	Thu Aug 20 01:19:21 2009
@@ -68,10 +68,10 @@
 }
 
 # adjust bugs-per-dist.data and queue-addresses
-foreach my $path (qw(/local/html/Public/bugs-per-dist.data /local/html/NoAuth/cpan/queue-addresses)) {
+foreach my $path (qw(/local/html/Public/bugs-per-dist.data /local/html/NoAuth/cpan)) {
     my $f = $root . $path;
     `touch $f` unless -e $f;
-    ($_ = `chown rtcpan:rtcpan $f`)
+    ($_ = `chown -R rtcpan:rtcpan $f`)
         or !$? or die "$_\n\nCouldn't change owner of '$f'";
 }
 

Modified: RT-Extension-rt_cpan_org/bin/rt-cpan-export-db
==============================================================================
--- RT-Extension-rt_cpan_org/bin/rt-cpan-export-db	(original)
+++ RT-Extension-rt_cpan_org/bin/rt-cpan-export-db	Thu Aug 20 01:19:21 2009
@@ -49,7 +49,7 @@
 $dbh->do(<<'END_SQL');
 CREATE TABLE ticket (
     id INTEGER NOT NULL PRIMARY KEY,
-    queue TEXT NOT NULL,
+    distribution TEXT NOT NULL,
     subject TEXT NOT NULL,
     status TEXT NOT NULL,
     severity TEXT,
@@ -65,7 +65,7 @@
 
 # Generate the indexes on the table
 $dbh->do("CREATE INDEX ticket__id       on ticket ( id       )");
-$dbh->do("CREATE INDEX ticket__queue    on ticket ( queue    )");
+$dbh->do("CREATE INDEX ticket__distribution    on ticket ( distribution    )");
 $dbh->do("CREATE INDEX ticket__subject  on ticket ( subject  )");
 $dbh->do("CREATE INDEX ticket__status   on ticket ( status   )");
 $dbh->do("CREATE INDEX ticket__severity on ticket ( severity )");
@@ -91,9 +91,9 @@
 my $count = 0;
 sub insert_ticket {
     my %col = @_;
-    $dbh->do("INSERT INTO ticket ( id, queue, subject, status, severity, created, updated ) VALUES ( ?, ?, ?, ?, ?, ?, ? )", {},
+    $dbh->do("INSERT INTO ticket ( id, distribution, subject, status, severity, created, updated ) VALUES ( ?, ?, ?, ?, ?, ?, ? )", {},
         $col{id},
-        $col{queue},
+        $col{distribution},
         $col{subject},
         $col{status},
         $col{severity},
@@ -116,16 +116,16 @@
 
     while ( my $ticket = fetch_next() ) {
         my $tmp = $severity->ValuesForObject( $ticket )->First;
-        $tmp = $tmp->Content if $tmp;
+        $tmp = lc $tmp->Content if $tmp;
         # Create a ticket
         insert_ticket (
-            id       => $ticket->id,
-            queue    => $ticket->QueueObj->Name,
-            subject  => $ticket->Subject,
-            status   => $ticket->Status,
-            severity => $tmp,
-            created  => $ticket->Created,
-            updated  => $ticket->LastUpdated,
+            id           => $ticket->id,
+            distribution => $ticket->QueueObj->Name,
+            subject      => $ticket->Subject,
+            status       => $ticket->Status,
+            severity     => $tmp,
+            created      => $ticket->Created,
+            updated      => $ticket->LastUpdated,
         );
     }
 }



More information about the Bps-public-commit mailing list