summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/tlpkg/TeXLive/TLPSRC.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/Master/tlpkg/TeXLive/TLPSRC.pm b/Master/tlpkg/TeXLive/TLPSRC.pm
index 41ff0601915..aa3d2d6a8e0 100644
--- a/Master/tlpkg/TeXLive/TLPSRC.pm
+++ b/Master/tlpkg/TeXLive/TLPSRC.pm
@@ -44,6 +44,7 @@ sub from_file
my $self = shift;
die "need exactly one filename for initialization" if @_ != 1;
my $srcfile = $_[0];
+ (my $pkgname = $srcfile) =~ s/\.tlpsrc$//;
if (! -r "$srcfile") {
# if the argument is not readable as is, try looking for it in the
@@ -60,7 +61,7 @@ sub from_file
my @lines = <TMP>;
close(TMP);
- my $name = "";
+ my $name = $pkgname;
# default category = Package
my $category = "Package";
my $shortdesc = "";
@@ -69,7 +70,7 @@ sub from_file
my (@executes, @depends);
my (@runpatterns, @docpatterns, @binpatterns, @srcpatterns);
my (@postactions);
- my $started = 0;
+ my $foundnametag = 0;
my $finished = 0;
my $savedline = "";
@@ -100,10 +101,11 @@ sub from_file
# - configuration texlive specific packages: ^00texlive.*\..*$
if ($line =~ /^name\s*([-\w]+(\.win32)?|00texlive.*|texlive\..*)$/) {
$name = $1;
- $started && die "$srcfile: second name directive not allowed: $name";
- $started = 1;
+ $foundnametag && die "$srcfile: second name directive not allowed: $name";
+ $foundnametag = 1;
} else {
- $started || die "$srcfile: first directive must be `name', not $line";
+ # we default to the file name as package name
+ # $started || die "$srcfile: first directive must be `name', not $line";
if ($line =~ /^shortdesc\s*(.*)\s*$/) {
$shortdesc = $1;
next;
@@ -143,6 +145,9 @@ sub from_file
}
}
$self->_srcfile($srcfile);
+ if ($name =~ m/^[[:space:]]*$/) {
+ die "Cannot deduce name from file argument and name tag not found";
+ }
$self->name($name);
$self->category($category);
$self->catalogue($catalogue) if $catalogue;