Check-in [4279f5771d]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:perltidy with 100 max chars p/line
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:4279f5771d3698d9795af014fb76c634d49493e2
User & Date: cfuhrman 2015-08-18 20:09:08
Context
2015-08-19
16:19
Merge open leaf check-in: 8ac2e092d1 user: cfuhrman tags: trunk
2015-08-18
20:09
perltidy with 100 max chars p/line check-in: 4279f5771d user: cfuhrman tags: trunk
19:34
Perltidy check-in: 689e787a2b user: cfuhrman tags: trunk
Changes

Changes to db/ora2mysql.pl.

290
291
292
293
294
295
296

297
298
299
300
301
302
303
304

sub oraStruc
{

        my $dbh_ora = shift;

        # Classes

        my $sth_class = $dbh_ora->prepare("select cdr_code, layout, cdrtable from cdr_class order by cdrtable, layout");

        die $DBI::errstr unless $sth_class;

        # Fields
        my $sth_fields = $dbh_ora->prepare(
                "select field_name, vstart,
    vlength, type, outformat from cdr_fields where layout=? order by vstart");







>
|







290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305

sub oraStruc
{

        my $dbh_ora = shift;

        # Classes
        my $sth_class =
            $dbh_ora->prepare("select cdr_code, layout, cdrtable from cdr_class order by cdrtable, layout");

        die $DBI::errstr unless $sth_class;

        # Fields
        my $sth_fields = $dbh_ora->prepare(
                "select field_name, vstart,
    vlength, type, outformat from cdr_fields where layout=? order by vstart");

Changes to db/ora2pg.pl.

286
287
288
289
290
291
292

293
294
295
296
297
298
299
300
...
503
504
505
506
507
508
509

510
511
512
513
514
515
516
517
...
524
525
526
527
528
529
530

531
532
533
534
535
536
537
538
                }

                # print primary keys
                printf("    PRIMARY KEY ( %s )", join(", ", @{ $tabs->{$tab}->{keys} }));

                # print foreign keys, if any
                foreach my $fk (keys %{ $tabs->{$tab}->{foreign} }) {

                        printf("\n    , FOREIGN KEY ( %s ) REFERENCES %s", join(", ", @{ $tabs->{$tab}->{foreign}->{$fk} }), $fk);
                }

                # close things up
                printf("\n);\n\n");
        }

}          # tableCreate()
................................................................................
        # grab configuration
        my $gen = $cfg->param(-block => 'general');
        my $ora = $cfg->param(-block => 'oracle');

        # build list of fields to extract
        foreach my $fld (@{ $tab->{cols} }) {


                push( @{$flds}, ($fld->{type} eq "DATE")
                      ? sprintf("TO_CHAR( %s, '%s' )", $fld->{name}, ORA_DATE_FORMAT)
                      : $fld->{name});

                next if $df;

                # if this is a prime date field, store it
                foreach my $prm (@{ $gen->{timefields} }) {
................................................................................
        }

        # build the where clause if we need to
        my $where = ($df) ? "WHERE $df >= SYSDATE - " . $gen->{datarange} : ""
            if $gen->{datarange};

        # Finally, return the newly built SQL string

        return sprintf("SELECT %s from %s.%s %s", join(", ", @{$flds}), $ora->{schema}, $tab->{name}, $where);

}          # sqlBuild()

# ----------------------------------------------------------------------

main:
{







>
|







 







>
|







 







>
|







286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
...
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
...
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
                }

                # print primary keys
                printf("    PRIMARY KEY ( %s )", join(", ", @{ $tabs->{$tab}->{keys} }));

                # print foreign keys, if any
                foreach my $fk (keys %{ $tabs->{$tab}->{foreign} }) {
                        printf("\n    , FOREIGN KEY ( %s ) REFERENCES %s",
                                join(", ", @{ $tabs->{$tab}->{foreign}->{$fk} }), $fk);
                }

                # close things up
                printf("\n);\n\n");
        }

}          # tableCreate()
................................................................................
        # grab configuration
        my $gen = $cfg->param(-block => 'general');
        my $ora = $cfg->param(-block => 'oracle');

        # build list of fields to extract
        foreach my $fld (@{ $tab->{cols} }) {

                push( @{$flds},
                      ($fld->{type} eq "DATE")
                      ? sprintf("TO_CHAR( %s, '%s' )", $fld->{name}, ORA_DATE_FORMAT)
                      : $fld->{name});

                next if $df;

                # if this is a prime date field, store it
                foreach my $prm (@{ $gen->{timefields} }) {
................................................................................
        }

        # build the where clause if we need to
        my $where = ($df) ? "WHERE $df >= SYSDATE - " . $gen->{datarange} : ""
            if $gen->{datarange};

        # Finally, return the newly built SQL string
        return
            sprintf("SELECT %s from %s.%s %s", join(", ", @{$flds}), $ora->{schema}, $tab->{name}, $where);

}          # sqlBuild()

# ----------------------------------------------------------------------

main:
{

Changes to scm/add-cvs-revnum.pl.

62
63
64
65
66
67
68

69
70
71
72
73
74
75
76
..
77
78
79
80
81
82
83
84

85
86
87
88
89
90
91
92

93
94
95
96
97
98
99
100
101
102
103
104
105
106
107

108
109
110
111
112
113
114
             and $node->has_properties()
             and $node->has_property('svn:date')) {
                $lastrevnum  = $node->revnum();
                $lastrevdate = date $node->property('svn:date');
        }

        if (     $node->has_contents()

             and $node->content() =~ /\$Id: (.*?,v) ([1-9]+\.[0-9.]+) (\d{4}\/\d{2}\/\d{2}) (\d{2}:\d{2}:\d{2}) (\w+) Exp \$/) {

                my $cvsrev = $2;
                my $date   = $3;
                my $time   = $4;
                $date =~ s/\//\-/g;
                my $nodedate = date "$date $time";

................................................................................
                if (defined $lastrevnum
                     and abs($lastrevdate - $nodedate) <= (3 * 60)) {

                        my $counter = 0;
                        $node->properties->add("cvs2svn:cvs-rev", $cvsrev,  $counter++);
                        $node->properties->add("svn:eol-style",   "native", $counter++);
                        $node->properties->add("svn:executable",
                                               $node->property("svn:executable") || $filenames{ $node->header('Node-path') }->{executable}, $counter++)

                            if ($node->has_property("svn:executable")
                                or defined $filenames{ $node->header('Node-path') }->{executable});

                        $node->properties->del("svn:keywords");
                        $node->changed;

                        $filenames{ $node->header('Node-path') } = {
                                               cvsrev     => $cvsrev,

                                               executable => $node->property("svn:executable") || $filenames{ $node->header('Node-path') }->{executable}
                            }
                            if $node->has_header('Node-path');

                }

        } elsif (    $node->has_headers()
                 and $node->has_header('Node-path')
                 and defined $filenames{ $node->header('Node-path') }
                 and $node->has_contents()) {

                my $counter = 0;
                $node->properties->add("svn:eol-style", "native", $counter++);
                $node->properties->add("svn:executable",
                                       $node->property("svn:executable") || $filenames{ $node->header('Node-path') }->{executable}, $counter++)

                    if ($node->has_property("svn:executable")
                        or defined $filenames{ $node->header('Node-path') }->{executable});

                $node->properties->add("svn:keywords", $keywords, $counter++);
                $node->properties->del("cvs2svn:cvs-rev");
                $node->changed;








>
|







 







|
>







|
>
|
<












|
>







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
..
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96

97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
             and $node->has_properties()
             and $node->has_property('svn:date')) {
                $lastrevnum  = $node->revnum();
                $lastrevdate = date $node->property('svn:date');
        }

        if (     $node->has_contents()
             and $node->content() =~
             /\$Id: (.*?,v) ([1-9]+\.[0-9.]+) (\d{4}\/\d{2}\/\d{2}) (\d{2}:\d{2}:\d{2}) (\w+) Exp \$/) {

                my $cvsrev = $2;
                my $date   = $3;
                my $time   = $4;
                $date =~ s/\//\-/g;
                my $nodedate = date "$date $time";

................................................................................
                if (defined $lastrevnum
                     and abs($lastrevdate - $nodedate) <= (3 * 60)) {

                        my $counter = 0;
                        $node->properties->add("cvs2svn:cvs-rev", $cvsrev,  $counter++);
                        $node->properties->add("svn:eol-style",   "native", $counter++);
                        $node->properties->add("svn:executable",
                                      $node->property("svn:executable") || $filenames{ $node->header('Node-path') }->{executable},
                                      $counter++)
                            if ($node->has_property("svn:executable")
                                or defined $filenames{ $node->header('Node-path') }->{executable});

                        $node->properties->del("svn:keywords");
                        $node->changed;

                        $filenames{ $node->header('Node-path') } = {
                                                                     cvsrev     => $cvsrev,
                                                                     executable => $node->property("svn:executable")
                                                                         || $filenames{ $node->header('Node-path') }->{executable} }

                            if $node->has_header('Node-path');

                }

        } elsif (    $node->has_headers()
                 and $node->has_header('Node-path')
                 and defined $filenames{ $node->header('Node-path') }
                 and $node->has_contents()) {

                my $counter = 0;
                $node->properties->add("svn:eol-style", "native", $counter++);
                $node->properties->add("svn:executable",
                              $node->property("svn:executable") || $filenames{ $node->header('Node-path') }->{executable},
                              $counter++)
                    if ($node->has_property("svn:executable")
                        or defined $filenames{ $node->header('Node-path') }->{executable});

                $node->properties->add("svn:keywords", $keywords, $counter++);
                $node->properties->del("cvs2svn:cvs-rev");
                $node->changed;