diff options
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/tlpkg/bin/check-wrapper-consistency | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Master/tlpkg/bin/check-wrapper-consistency b/Master/tlpkg/bin/check-wrapper-consistency index 90ded4d86c2..2db7482e8db 100755 --- a/Master/tlpkg/bin/check-wrapper-consistency +++ b/Master/tlpkg/bin/check-wrapper-consistency @@ -60,27 +60,33 @@ sub main # return all symlinks starting with ".." in DIR as a hash, with symlink -# targets as the values. +# targets as the values. Check that targets are executable. # sub unx_wrapper_entries { my ($DIR) = @_; my %ret; + chomp (my $olddir = `pwd`); + chdir ($DIR) || die "chdir($DIR) failed: $!"; + local *DIR; - opendir (DIR, $DIR) || die "opendir($DIR) failed: $!"; + opendir (DIR, ".") || die "opendir($DIR) failed: $!"; while (my $ent = readdir (DIR)) { - my $file = "$DIR/$ent"; - next unless -l $file; # skip all but symlinks + next unless -l $ent; # skip all but symlinks - my $target = readlink ($file); - die "readlink($file) failed: $!" if !defined ($target); + my $target = readlink ($ent); + die "readlink($ent) failed: $!" if !defined ($target); next unless $target =~ /^\.\./; # skip all but .. symlinks next if $target =~ /ps4pdf/; # has its own .bat, sorry for special case + + # the target of the symlink should be executable. + warn "$ent: target $target not executable\n" if ! -x $target; $ret{$ent} = $target; # remember name and link target } closedir (DIR) || warn "closedir($DIR) failed: $!"; + chdir ($olddir) || die "chdir($olddir) failed: $!"; return %ret; } |