diff options
author | Norbert Preining <preining@logic.at> | 2008-10-28 00:59:36 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-10-28 00:59:36 +0000 |
commit | d3132a68ad3c30e33a0ac6dd7e57375e5e9c5cb6 (patch) | |
tree | 1df1e124ca2e7768de77c3b9a29563f98ff33512 /Master/tlpkg | |
parent | 3763fa67896d561bf1715831807d0bf173a87736 (diff) |
update the autopatterns patch to use only one file
git-svn-id: svn://tug.org/texlive/trunk@11084 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rw-r--r-- | Master/tlpkg/etc/ready.use-autopatterns-from-dedicated-tlpsrc-files.patch | 248 |
1 files changed, 141 insertions, 107 deletions
diff --git a/Master/tlpkg/etc/ready.use-autopatterns-from-dedicated-tlpsrc-files.patch b/Master/tlpkg/etc/ready.use-autopatterns-from-dedicated-tlpsrc-files.patch index f29aa49b158..3f9dad59c2f 100644 --- a/Master/tlpkg/etc/ready.use-autopatterns-from-dedicated-tlpsrc-files.patch +++ b/Master/tlpkg/etc/ready.use-autopatterns-from-dedicated-tlpsrc-files.patch @@ -1,121 +1,23 @@ This patch adds the ability to change the auto generated patterns by -adding tlpsrc files named - 00texlive.autopatterns.<CATEGORY>.tlpsrc -and within these files the relevant src/bin/doc/run patterns. +adding one tlpsrc file named + 00texlive.autopatterns.tlpsrc +and within these files the relevant src/bin/doc/run patterns, but the FIRST +word in the pattern is the category to which the pattern applies. -This patch adds in addition the tlpsrc autopattern files - 00texlive.autopatterns.Package.tlpsrc - 00texlive.autopatterns.Documentation.tlpsrc +The included 00texlive.autopatterns.tlpsrc adds the necessary patterns to get the exact same behaviour as before. +tlpsrc2tlpdb also gets a command line --no-autopatterns if you want +to disable loading of auto patterns. + Warning: This change will make the description for maintaining separate repositories a bit outdated, since now also these autopattern files have to be added, or patterns themselves have to be specified. - -Index: tlpkg/bin/tlpsrc2tlpdb -=================================================================== ---- tlpkg/bin/tlpsrc2tlpdb (revision 11059) -+++ tlpkg/bin/tlpsrc2tlpdb (working copy) -@@ -63,9 +63,43 @@ - $tlc = TeXLive::TeXCatalogue->new ("location" => $opt_catalogue); - } - -+ # get the default patterns -+ my $tlpsrc_dir = "$opt_master/tlpkg/tlpsrc"; -+ chdir ($tlpsrc_dir) || die "chdir($tlpsrc_dir) failed: $!"; -+ my @autopatternfiles = glob ("00texlive.autopatterns.*.tlpsrc"); -+ my %autopatterns; -+ for my $ap (@autopatternfiles) { -+ (my $cat = $ap) =~ s/^00texlive\.autopatterns\.(.*)\.tlpsrc$/$1/; -+ my $tlsrc = new TeXLive::TLPSRC; -+ $tlsrc->from_file ($ap); -+ push @{$autopatterns{$cat}{"bin"}}, $tlsrc->binpatterns -+ if $tlsrc->binpatterns; -+ push @{$autopatterns{$cat}{"src"}}, $tlsrc->srcpatterns -+ if $tlsrc->srcpatterns; -+ push @{$autopatterns{$cat}{"doc"}}, $tlsrc->docpatterns -+ if $tlsrc->docpatterns; -+ push @{$autopatterns{$cat}{"run"}}, $tlsrc->runpatterns -+ if $tlsrc->runpatterns; -+ } -+ -+ for my $cat (keys %autopatterns) { -+ debug ("Category $cat\n"); -+ for my $d (@{$autopatterns{$cat}{"bin"}}) { -+ debug ("Found auto bin pattern $d\n"); -+ } -+ for my $d (@{$autopatterns{$cat}{"src"}}) { -+ debug ("Found auto src pattern $d\n"); -+ } -+ for my $d (@{$autopatterns{$cat}{"doc"}}) { -+ debug ("Found auto doc pattern $d\n"); -+ } -+ for my $d (@{$autopatterns{$cat}{"run"}}) { -+ debug ("Found auto run pattern $d\n"); -+ } -+ } -+ - # if we're regenerating the whole thing, get all our tlpsrc files. - if ($opt_all) { -- my $tlpsrc_dir = "$opt_master/tlpkg/tlpsrc"; - chdir ($tlpsrc_dir) || die "chdir($tlpsrc_dir) failed: $!"; - @ARGV = glob ("*.tlpsrc"); - } -@@ -82,11 +116,16 @@ - my $tldb = TeXLive::TLPDB->new; - my $src_count = 0; - foreach my $f (@ARGV) { -+ next if ($f =~ m/^00texlive\.autopatterns/); - $src_count++ if $opt_all; - - my $tlsrc = new TeXLive::TLPSRC; - $tlsrc->from_file ($f); -- my $tlp = $tlsrc->make_tlpobj ($tltree); -+ my $patternref; -+ if (defined($autopatterns{$tlsrc->category})) { -+ $patternref = $autopatterns{$tlsrc->category}; -+ } -+ my $tlp = $tlsrc->make_tlpobj ($tltree, $autopatterns{$tlsrc->category}); - - (my $base_f = $f) =~ s/\.tlpsrc$//; - warn "$f: package name " . $tlp->name . " does not match filename\n" -Index: tlpkg/tlpsrc/00texlive.autopatterns.Package.tlpsrc -=================================================================== ---- tlpkg/tlpsrc/00texlive.autopatterns.Package.tlpsrc (revision 0) -+++ tlpkg/tlpsrc/00texlive.autopatterns.Package.tlpsrc (revision 0) -@@ -0,0 +1,17 @@ -+name 00texlive.autopatterns.package -+category Package -+shortdesc Defines the automatically generated patterns for category Package -+runpattern t texmf-dist bibtex %NAME% -+runpattern t texmf-dist context %NAME% -+runpattern t texmf-dist dvips %NAME% -+runpattern t texmf-dist fonts %NAME% -+runpattern t texmf-dist makeindex %NAME% -+runpattern t texmf-dist metafont %NAME% -+runpattern t texmf-dist metapost %NAME% -+runpattern t texmf-dist mft %NAME% -+runpattern t texmf-dist omega %NAME% -+runpattern t texmf-dist scripts %NAME% -+runpattern t texmf-dist tex %NAME% -+runpattern t texmf-dist vtex %NAME% -+srcpattern t texmf-dist source %NAME% -+docpattern t texmf-dist doc %NAME% -Index: tlpkg/tlpsrc/00texlive.autopatterns.Documentation.tlpsrc -=================================================================== ---- tlpkg/tlpsrc/00texlive.autopatterns.Documentation.tlpsrc (revision 0) -+++ tlpkg/tlpsrc/00texlive.autopatterns.Documentation.tlpsrc (revision 0) -@@ -0,0 +1,5 @@ -+name 00texlive.autopatterns.documentation -+category Documentation -+shortdesc Defines the automatically generated patterns for category Documentation -+srcpattern t texmf-doc source %NAME% -+docpattern t texmf-doc doc %NAME% Index: tlpkg/TeXLive/TLPSRC.pm =================================================================== ---- tlpkg/TeXLive/TLPSRC.pm (revision 11059) +--- tlpkg/TeXLive/TLPSRC.pm (revision 11079) +++ tlpkg/TeXLive/TLPSRC.pm (working copy) @@ -201,7 +201,11 @@ # @@ -360,3 +262,135 @@ Index: tlpkg/TeXLive/TLPSRC.pm =over 4 +Index: tlpkg/tlpsrc/00texlive.autopatterns.tlpsrc +=================================================================== +--- tlpkg/tlpsrc/00texlive.autopatterns.tlpsrc (revision 0) ++++ tlpkg/tlpsrc/00texlive.autopatterns.tlpsrc (revision 0) +@@ -0,0 +1,21 @@ ++name 00texlive.autopatterns ++category TLCore ++shortdesc Defines the automatically generated patterns ++# auto patterns for category Package ++runpattern Package t texmf-dist bibtex %NAME% ++runpattern Package t texmf-dist context %NAME% ++runpattern Package t texmf-dist dvips %NAME% ++runpattern Package t texmf-dist fonts %NAME% ++runpattern Package t texmf-dist makeindex %NAME% ++runpattern Package t texmf-dist metafont %NAME% ++runpattern Package t texmf-dist metapost %NAME% ++runpattern Package t texmf-dist mft %NAME% ++runpattern Package t texmf-dist omega %NAME% ++runpattern Package t texmf-dist scripts %NAME% ++runpattern Package t texmf-dist tex %NAME% ++runpattern Package t texmf-dist vtex %NAME% ++srcpattern Package t texmf-dist source %NAME% ++docpattern Package t texmf-dist doc %NAME% ++# auto patterns for category Documentation ++srcpattern Documentation t texmf-doc source %NAME% ++docpattern Documentation t texmf-doc doc %NAME% +Index: tlpkg/bin/tlpsrc2tlpdb +=================================================================== +--- tlpkg/bin/tlpsrc2tlpdb (revision 11079) ++++ tlpkg/bin/tlpsrc2tlpdb (working copy) +@@ -31,6 +31,7 @@ + my $opt_nobinsplit = 0; + my $opt_winwarning; + my $opt_fromfiles = 0; ++my $opt_noautopatterns = 0; + + TeXLive::TLUtils::process_logging_options(); + GetOptions( +@@ -38,6 +39,7 @@ + "master=s" => \$opt_master, # location of the TL tree + "catalogue=s" => \$opt_catalogue, # location of the TeX Catalogue + "no-bin-split!" => \$opt_nobinsplit, ++ "no-autopatterns" => \$opt_noautopatterns, + "from-files" => \$opt_fromfiles, + "with-win-pattern-warning" => \$opt_winwarning, + "help|?" => \$help) or pod2usage(1); +@@ -63,9 +65,66 @@ + $tlc = TeXLive::TeXCatalogue->new ("location" => $opt_catalogue); + } + ++ my $tlpsrc_dir = "$opt_master/tlpkg/tlpsrc"; ++ ++ # get the default patterns ++ my %autopatterns; ++ if (! $opt_noautopatterns) { ++ my $apfile = "$tlpsrc_dir/00texlive.autopatterns.tlpsrc"; ++ if (! -r $apfile) { ++ if (! $opt_noautopatterns) { ++ tlwarn ("No autopatterns tlpsrc 00texlive.autopatterns.tlpsrc found.\n"); ++ tlwarn ("Stopping here. If you want to continue either add the above file\n"); ++ tlwarn ("or call tlpsrc with --no-autopatterns.\n"); ++ exit 1; ++ } ++ } ++ my $tlsrc = new TeXLive::TLPSRC; ++ $tlsrc->from_file ( $apfile ); ++ if ($tlsrc->binpatterns) { ++ for my $p ($tlsrc->binpatterns) { ++ my ($cat, @rest) = split ' ', $p; ++ push @{$autopatterns{$cat}{"bin"}}, join(' ', @rest); ++ } ++ } ++ if ($tlsrc->srcpatterns) { ++ for my $p ($tlsrc->srcpatterns) { ++ my ($cat, @rest) = split ' ', $p; ++ push @{$autopatterns{$cat}{"src"}}, join(' ', @rest); ++ } ++ } ++ if ($tlsrc->docpatterns) { ++ for my $p ($tlsrc->docpatterns) { ++ my ($cat, @rest) = split ' ', $p; ++ push @{$autopatterns{$cat}{"doc"}}, join(' ', @rest); ++ } ++ } ++ if ($tlsrc->runpatterns) { ++ for my $p ($tlsrc->runpatterns) { ++ my ($cat, @rest) = split ' ', $p; ++ push @{$autopatterns{$cat}{"run"}}, join(' ', @rest); ++ } ++ } ++ ++ for my $cat (keys %autopatterns) { ++ debug ("Category $cat\n"); ++ for my $d (@{$autopatterns{$cat}{"bin"}}) { ++ debug ("Found auto bin pattern $d\n"); ++ } ++ for my $d (@{$autopatterns{$cat}{"src"}}) { ++ debug ("Found auto src pattern $d\n"); ++ } ++ for my $d (@{$autopatterns{$cat}{"doc"}}) { ++ debug ("Found auto doc pattern $d\n"); ++ } ++ for my $d (@{$autopatterns{$cat}{"run"}}) { ++ debug ("Found auto run pattern $d\n"); ++ } ++ } ++ } # end of if (! $opt_noautopatterns) ++ + # if we're regenerating the whole thing, get all our tlpsrc files. + if ($opt_all) { +- my $tlpsrc_dir = "$opt_master/tlpkg/tlpsrc"; + chdir ($tlpsrc_dir) || die "chdir($tlpsrc_dir) failed: $!"; + @ARGV = glob ("*.tlpsrc"); + } +@@ -82,11 +141,16 @@ + my $tldb = TeXLive::TLPDB->new; + my $src_count = 0; + foreach my $f (@ARGV) { ++ next if ($f =~ m/^00texlive\.autopatterns/); + $src_count++ if $opt_all; + + my $tlsrc = new TeXLive::TLPSRC; + $tlsrc->from_file ($f); +- my $tlp = $tlsrc->make_tlpobj ($tltree); ++ my $patternref; ++ if (defined($autopatterns{$tlsrc->category})) { ++ $patternref = $autopatterns{$tlsrc->category}; ++ } ++ my $tlp = $tlsrc->make_tlpobj ($tltree, $autopatterns{$tlsrc->category}); + + (my $base_f = $f) =~ s/\.tlpsrc$//; + warn "$f: package name " . $tlp->name . " does not match filename\n" |