ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/urxvt.pm
(Generate patch)

Comparing rxvt-unicode/src/urxvt.pm (file contents):
Revision 1.248 by root, Fri Dec 26 21:01:46 2014 UTC vs.
Revision 1.249 by root, Fri Dec 26 21:26:37 2014 UTC

1134sub scan_extensions { 1134sub scan_extensions {
1135 my ($self) = @_; 1135 my ($self) = @_;
1136 1136
1137 return if exists $self->{meta}; 1137 return if exists $self->{meta};
1138 1138
1139 my @libdirs = perl_libdirs $self; 1139 my @urxvtdirs = perl_libdirs $self;
1140 my @cpandirs = grep -d, map "$_/URxvt/Ext", @INC;
1140 1141
1141# return if $self->{meta_libdirs} eq join "\x00", @libdirs;#d#
1142
1143# $self->{meta_libdirs} = join "\x00", @libdirs;#d#
1144 $self->{meta} = \my %meta; 1142 $self->{meta} = \my %meta;
1145 1143
1146 # first gather extensions 1144 # first gather extensions
1147 for my $dir (reverse @libdirs) { 1145
1146 my $gather = sub {
1147 my ($dir, $core) = @_;
1148
1148 opendir my $fh, $dir 1149 opendir my $fh, $dir
1149 or next; 1150 or return;
1151
1150 for my $ext (readdir $fh) { 1152 for my $ext (readdir $fh) {
1151 $ext !~ /^\./ 1153 $ext !~ /^\./
1154 or next;
1155
1152 and open my $fh, "<", "$dir/$ext" 1156 open my $fh, "<", "$dir/$ext"
1157 or next;
1158
1159 -f $fh
1160 or next;
1161
1162 $ext =~ s/\.uext$// or $core
1153 or next; 1163 or next;
1154 1164
1155 my %ext = (dir => $dir); 1165 my %ext = (dir => $dir);
1156 1166
1157 while (<$fh>) { 1167 while (<$fh>) {
1170 } 1180 }
1171 } 1181 }
1172 1182
1173 $meta{ext}{$ext} = \%ext; 1183 $meta{ext}{$ext} = \%ext;
1174 } 1184 }
1175 } 1185 };
1186
1187 $gather->($_, 0) for @cpandirs;
1188 $gather->($_, 1) for @urxvtdirs;
1176 1189
1177 # and now merge resources 1190 # and now merge resources
1178 while (my ($k, $v) = each %{ $meta{ext} }) { 1191 while (my ($k, $v) = each %{ $meta{ext} }) {
1179 #TODO: should check for extensions overriding each other 1192 #TODO: should check for extensions overriding each other
1180 %{ $meta{resource} } = (%{ $meta{resource} }, %{ $v->{resource} }); 1193 %{ $meta{resource} } = (%{ $meta{resource} }, %{ $v->{resource} });

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines