summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/check-wrapper-consistency
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-05-13 23:34:31 +0000
committerKarl Berry <karl@freefriends.org>2008-05-13 23:34:31 +0000
commit037a3a651e8cc24fbb7baef316bd5268cc4b5cf4 (patch)
tree477b93dc15e7ae576c133a9edc4fb275c2a15e2f /Master/tlpkg/bin/check-wrapper-consistency
parent326c15dd974901ca61cfffa47322292edd39de52 (diff)
(unx_wrapper_entries): check that targets are executable.
git-svn-id: svn://tug.org/texlive/trunk@8118 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin/check-wrapper-consistency')
-rwxr-xr-xMaster/tlpkg/bin/check-wrapper-consistency18
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;
}