summaryrefslogtreecommitdiff
path: root/Master/setuptl/TLPM/pkg.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/setuptl/TLPM/pkg.pm')
-rw-r--r--Master/setuptl/TLPM/pkg.pm40
1 files changed, 21 insertions, 19 deletions
diff --git a/Master/setuptl/TLPM/pkg.pm b/Master/setuptl/TLPM/pkg.pm
index a02cc4e9b8b..d91ce764963 100644
--- a/Master/setuptl/TLPM/pkg.pm
+++ b/Master/setuptl/TLPM/pkg.pm
@@ -1,4 +1,4 @@
-# This file belongs to TLPM v2.19, TeX Live Package Manager
+# This file belongs to TLPM v2.20, TeX Live Package Manager
# Public Domain, P.Jackowski@gust.org.pl
# packages handling
@@ -64,7 +64,8 @@ sub read_pkges # used for reading both source and target packages
}
}
}
- open(INP,"<$dir$chr_dirsep$pkg") or next;
+ open(INP,"<$dir$chr_dirsep$pkg")
+ or $error{'wrong_inp'} -> ("$dir$chr_dirsep$pkg") and next;
foreach(<INP>)
{
chomp;
@@ -195,47 +196,48 @@ sub is_tl_root
foreach(@tl_roots)
{
next if &no_source($dir . $_);
- $message -> ("Welcome to TeX Live $tl_year $tl_type!");
+ $message -> ("Welcome to TeX Live $tl_year $tl_type! (release $tl_date)");
return $true;
}
return $false;
}
-sub no_source # strongly heuristic
+sub no_source # source detection heuristic
{
my $dir = shift;
+ my ($inst,$live) = ("00INST.TL","00LIVE.TL");
&norm_path($dir);
$dir = &rel2abs($dir);
- if(-f "$dir$chr_dirsep.mkisofsrc")
- {
- if(-f "$dir$chr_dirsep" . "00INST.TL")
+ #if(-f "$dir$chr_dirsep.mkisofsrc")# hidden can be easily missed while copying...
+ #{ # (Hartmut Henkel report)
+ if(-f "$dir$chr_dirsep$inst")
{
- $tl_type = 'CD';
- $tl_file = '00INST.TL';
+ $messdbg -> ("Found $inst in $dir");
+ $tl_type = 'CD'; $tl_file = $inst;
}
- elsif(-f "$dir$chr_dirsep" . "00LIVE.TL")
+ elsif(-f "$dir$chr_dirsep$live")
{
- $tl_type = 'DVD';
- $tl_file = '00LIVE.TL';
+ $messdbg -> ("Found $live in $dir");
+ $tl_type = 'DVD'; $tl_file = $live;
}
else
{
+ $messdbg -> ("Neither $inst nor $live found in $dir");
return $true;
}
- $tl_source = $dir;
- $tl_source_indeed = $true;
+ $tl_source = $dir; $tl_source_indeed = $true;
local *INP;
open(INP,"<$dir$chr_dirsep$tl_file") or return $error{'wrong_inp'} -> ($tl_file);
- my @lines = <INP>;
- close INP;
+ my @lines = <INP>; close INP;
foreach(@lines)
{
- next unless /\ARelease date: (\d{8}\.)/;
- $tl_date = $1; # meybe we will use it
+ next unless /\ARelease date: (\d{8})/;
+ $tl_date = $1;
$tl_year = substr($tl_date,0,4);
return $false;
}
- }
+ $messdbg -> ("Cannot retrieve release info from $tl_file");
+ #}
return $true;
}