summaryrefslogtreecommitdiff
path: root/Master/tlpkg/etc
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-01-23 18:39:57 +0000
committerNorbert Preining <preining@logic.at>2009-01-23 18:39:57 +0000
commita728d3a907d5c8b0decba70740ffa1d387d0c1ce (patch)
tree9bf17a536e374095f9d00e7a73b37279eb78d8ee /Master/tlpkg/etc
parentba5a5f08e2f4c5b9e3b25a6d91a8f3a2e6e85eec (diff)
add rework setup_programs patch
git-svn-id: svn://tug.org/texlive/trunk@11952 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/etc')
-rw-r--r--Master/tlpkg/etc/dev.rework-setup-programs-with-copy.patch115
1 files changed, 115 insertions, 0 deletions
diff --git a/Master/tlpkg/etc/dev.rework-setup-programs-with-copy.patch b/Master/tlpkg/etc/dev.rework-setup-programs-with-copy.patch
new file mode 100644
index 00000000000..70b0d49e5f7
--- /dev/null
+++ b/Master/tlpkg/etc/dev.rework-setup-programs-with-copy.patch
@@ -0,0 +1,115 @@
+Index: tlpkg/TeXLive/TLUtils.pm
+===================================================================
+--- tlpkg/TeXLive/TLUtils.pm (revision 11951)
++++ tlpkg/TeXLive/TLUtils.pm (working copy)
+@@ -1265,31 +1265,44 @@
+ $::installerdir = "$bindir/../..";
+ $platform = platform();
+ }
+- $::progs{'wget'} = "$bindir/wget/wget.$platform"
+- if -x "$bindir/wget/wget.$platform";
+- $::progs{'lzmadec'} = "$bindir/lzma/lzmadec.$platform"
+- if -x "$bindir/lzma/lzmadec.$platform";
+- $::progs{'lzma'} = "$bindir/lzma/lzma.$platform"
+- if -x "$bindir/lzma/lzma.$platform";
++ our $tmp;
++ # TODO TODO TODO
++ # it seems that the -x bit checking is not enough because perl
++ # returns true on -x but still the noexec overrides that ...
++ # we need to actually execute the file to see if it works
++ sub setup_one {
++ my ($p, $def) = @_;
++ our $tmp;
++ if (-r $def) {
++ if (-x $def) {
++ $::progs{$p} = $def;
++ } else {
++ # create tmp dir only when necessary
++ chomp ($tmp = `mktemp -d`) unless defined($tmp);
++ # probably we are running from DVD and want to copy it to
++ # some temporary location
++ copy($def, $tmp);
++ my $bn = basename($def);
++ $::progs{$p} = "$tmp/$bn";
++ chmod(0755,$::progs{$p});
++ # we do not check the return value of chmod, but check whether
++ # the -x bit is now set, the only thing that counts
++ if (! -x $::progs{$p}) {
++ # hmm, something is going really bad, not even the copy is
++ # executable. Fall back to normal path element
++ $::progs{$p} = $p;
++ }
++ }
++ } else {
++ # hope that we can find in in the global PATH
++ $::progs{$p} = $p;
++ }
++ }
++ setup_one('wget', "$bindir/wget/wget.$platform");
++ setup_one('lzmadec', "$bindir/lzma/lzmadec.$platform");
++ setup_one('lzma', "$bindir/lzma/lzma.$platform");
+ }
+
+- # Check for existence of lzmadec in our directory; if so, the present
+- # platform is supported. But if it's not there, the test below for a
+- # working lzmadec could still succeed if the binary is found in $PATH.
+- #
+- # Because conv_to_w32_path possibly added quotes, strip them away for
+- # the file test. Since all other uses of conv_to_w32_path use the
+- # result in shell commands, this is the most expedient thing to do.
+- #
+- (my $lzmadec = $::progs{'lzmadec'}) =~ s/^"(.*)"/$1/;
+- my $found_lzmadec = -x $lzmadec;
+-
+- # should we do something like this?
+- #if (-r $lzmadec && ! -x $lzmadec) {
+- # warn "$lzmadec is not executable. You might want to mount the DVD without the 'noexec' option.";
+- # return 0;
+- #}
+-
+ # check if the programs are working, but do not test tar, we rely on
+ # the system having a usable one. The main point is to check the
+ # binaries we provide.
+@@ -1302,7 +1315,7 @@
+ warn "$::progs{$prog} $opt failed (status $ret): $!\n";
+ warn "Output is:\n";
+ system ("$::progs{$prog} $opt");
+- return $found_lzmadec ? 0 : -1;
++ return 0;
+ }
+ }
+
+Index: texmf/scripts/texlive/tlmgr.pl
+===================================================================
+--- texmf/scripts/texlive/tlmgr.pl (revision 11951)
++++ texmf/scripts/texlive/tlmgr.pl (working copy)
+@@ -2431,6 +2431,9 @@
+ #
+ # set global $location variable.
+ # if we cannot read tlpdb, die if arg SHOULD_I_DIE is true.
++#
++# if an argument is given and is true init_local_db will die if
++# setting up of programs failed.
+ #
+ sub init_local_db {
+ my ($should_i_die) = @_;
+@@ -2438,17 +2441,8 @@
+ die("cannot find tlpdb in $Master") unless (defined($localtlpdb));
+ # setup the programs, for w32 we need the shipped wget/lzma etc, so we
+ # pass the location of these files to setup_programs.
+- my $ret = setup_programs("$Master/tlpkg/installer",
+- $localtlpdb->option_platform);
+- if ($ret == -1) {
+- tlwarn("no binary of lzmadec for $::_platform_ detected.\n");
+- if (defined($should_i_die) && $should_i_die) {
+- exit 1;
+- } else {
+- tlwarn("Continuing anyway ...\n");
+- }
+- }
+- if (!$ret) {
++ if (!setup_programs("$Master/tlpkg/installer",
++ $localtlpdb->option_platform)) {
+ tlwarn("Couldn't set up the necessary programs.\nInstallation of packages is not supported.\nPlease report to texlive\@tug.org.\n");
+ if (defined($should_i_die) && $should_i_die) {
+ finish(1);