[tex-live] TeX Live 2008 testing - problems downloading

Heiko Oberdiek oberdiek at uni-freiburg.de
Mon Jun 30 11:37:49 CEST 2008


On Sun, Jun 29, 2008 at 08:10:46PM +0200, Norbert Preining wrote:

> On So, 29 Jun 2008, Karl Berry wrote:
> >     I'm surprised that perl doesn't respect TMPDIR.
> > 
> > It's not about perl, it is about our code.  And yes, it should use
> > TMPDIR rather than hardwiring /tmp.
> 
> It should do it ...
> 
> code from TLUtils.pm:
> sub get_system_tmpdir {
>   my $systmp=0;
>   $systmp||=getenv 'TMPDIR';
>   $systmp||=getenv 'TMP';
>   $systmp||=getenv 'TEMP';
>   $systmp||='/tmp';
>   return "$systmp";
> }
> 
> SO it tries first TMPDIR, then TMP, then TEMP, then /tmp ...

I would add some sanity checks, e.g.:

sub get_check_tmpdir {
  my $tmpdir = $_[0];
  -d $tmpdir or return '';
  -w $tmpdir or return '';
  -x $tmpdir or return '';
  $tmpdir;
}

sub get_system_tmpdir {
    my $systmp = '';
    $systmp ||= get_check_tmpdir getenv 'TMPDIR';  
    $systmp ||= get_check_tmpdir getenv 'TMP'; 
    $systmp ||= get_check_tmpdir getenv 'TEMP'; 
    $systmp ||= '/tmp';
}

Yours sincerely
  Heiko <oberdiek at uni-freiburg.de>


More information about the tex-live mailing list