diff options
author | Norbert Preining <preining@logic.at> | 2009-05-21 12:09:41 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2009-05-21 12:09:41 +0000 |
commit | e901213bc03fd4666f0819819c6697b9e06f2884 (patch) | |
tree | 708c78bf31ff4a4be7c42be7ecd854f31005dcd8 /Master/tlpkg/TeXLive | |
parent | 960bfaf36c70481d096e0ca43c05e22a4c495cfd (diff) |
allow for empty .tlpsrc files without name and type tag by defaulting
to the name of the file as name of the package.
git-svn-id: svn://tug.org/texlive/trunk@13292 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r-- | Master/tlpkg/TeXLive/TLPSRC.pm | 15 |
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; |