Subversion Repositories gelsvn

Rev

Rev 107 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 107 Rev 198
Line 28... Line 28...
28
  if (defined $cyg) {
28
  if (defined $cyg) {
29
    $cyg =~ s/\\/\//g;
29
    $cyg =~ s/\\/\//g;
30
    chop($cwd = $cyg);
30
    chop($cwd = $cyg);
31
  }
31
  }
32
}
32
}
-
 
33
elsif ($^O eq 'VMS') {
-
 
34
  $cwd = unixify($cwd);
-
 
35
}
33
my($start) = $cwd;
36
my($start) = $cwd;
34
 
37
 
35
# ************************************************************
38
# ************************************************************
36
# Subroutine Section
39
# Subroutine Section
37
# ************************************************************
40
# ************************************************************
Line 50... Line 53...
50
    ## If the new directory contains a relative directory
53
    ## If the new directory contains a relative directory
51
    ## then we just get the real working directory
54
    ## then we just get the real working directory
52
    if ($dir =~ /\.\./) {
55
    if ($dir =~ /\.\./) {
53
      $cwd = Cwd::getcwd();
56
      $cwd = Cwd::getcwd();
54
      if ($^O eq 'cygwin' && $cwd !~ /[A-Za-z]:/) {
57
      if ($^O eq 'cygwin' && $cwd !~ /[A-Za-z]:/) {
55
         my($cyg) = `cygpath -w $cwd`;
58
        my($cyg) = `cygpath -w $cwd`;
56
         if (defined $cyg) {
59
        if (defined $cyg) {
57
           $cyg =~ s/\\/\//g;
60
          $cyg =~ s/\\/\//g;
58
           chop($cwd = $cyg);
61
          chop($cwd = $cyg);
59
         }
62
        }
-
 
63
      }
-
 
64
      elsif ($^O eq 'VMS') {
-
 
65
        $cwd = unixify($cwd);
60
       }
66
      }
61
    }
67
    }
62
    else {
68
    else {
63
      if ($dir =~ /^(\/|[a-z]:)/i) {
69
      if ($dir =~ /^(\/|[a-z]:)/i) {
64
        $cwd = $dir;
70
        $cwd = $dir;
65
      }
71
      }
Line 84... Line 90...
84
}
90
}
85
 
91
 
86
sub mpc_dirname {
92
sub mpc_dirname {
87
  my($self) = shift;
93
  my($self) = shift;
88
  my($dir)  = shift;
94
  my($dir)  = shift;
-
 
95
 
89
  return ($^O ne 'VMS' ? File::Basename::dirname($dir) :
96
  if ($^O eq 'VMS') {
-
 
97
    if ($dir =~ /\//) {
90
                         unixify(File::Basename::dirname($dir)));
98
      return unixify(dirname($dir));
-
 
99
    }
-
 
100
    else {
-
 
101
      return '.';
-
 
102
    }
-
 
103
  }
-
 
104
  else {
-
 
105
    return dirname($dir);
-
 
106
  }
91
}
107
}
92
 
108
 
93
 
109
 
-
 
110
sub mpc_glob {
-
 
111
  my($self)    = shift;
-
 
112
  my($pattern) = shift;
-
 
113
  my(@files)   = ();
-
 
114
 
-
 
115
  ## glob() provided by OpenVMS does not understand [] within
-
 
116
  ## the pattern.  So, we implement our own through recursive calls
-
 
117
  ## to mpc_glob().
-
 
118
  if ($^O eq 'VMS' && $pattern =~ /(.*)\[([^\]]+)\](.*)/) {
-
 
119
    my($pre)  = $1;
-
 
120
    my($mid)  = $2;
-
 
121
    my($post) = $3;
-
 
122
    for(my $i = 0; $i < length($mid); $i++) {
-
 
123
      my($p) = $pre . substr($mid, $i, 1) . $post;
-
 
124
      my(@new) = $self->mpc_glob($p);
-
 
125
      foreach my $new ($self->mpc_glob($p)) {
-
 
126
        my($found) = undef;
-
 
127
        foreach my $file (@files) {
-
 
128
          if ($file eq $new) {
-
 
129
            $found = 1;
-
 
130
            last;
-
 
131
          }
-
 
132
        }
-
 
133
        if (!$found) {
-
 
134
          push(@files, $new);
-
 
135
        }
-
 
136
      }
-
 
137
    }
-
 
138
  }
-
 
139
  else {
-
 
140
    push(@files, glob($pattern));
-
 
141
  }
-
 
142
 
-
 
143
  return @files;
-
 
144
}
-
 
145
 
94
# ************************************************************
146
# ************************************************************
95
# Virtual Methods To Be Overridden
147
# Virtual Methods To Be Overridden
96
# ************************************************************
148
# ************************************************************
97
 
149
 
98
sub convert_slashes {
150
sub convert_slashes {