Files
haikuports/app-text/texlive/additional-files/getPackageEntries.pl
Joachim Mairböck 1801479c90 texlive: split the package into multiple subpackages (#6229)
* texlive: split texlive_texmf into multiple subpackages (per collection)

There is one package for the runtime files, documentation and source files
for each TeXLive collection each. Packages that would be empty are omitted.
Additionaly, there are '_full' metapackages that depend on all the others.

The subpackage metadata and packageEntries are generated using perl scripts
that use the TeXLive package database API.

The package metadata is pre-generated because it needs already extracted and
preprocessed sources.

* texlive: fixes

 * change package descriptions to not contain the prefix "TeXLive" which is not allowed, being the package name
 * apply the $portDir workaround also for the PATCH function (see haikuporter issue #168)

* add missing config file to GLOBAL_WRITABLE_FILES

* remove the waiting on texlive's post-install scripts because it is not needed

* texlive: remove the alternate version of the createSubpackageInfos script

* texlive: add license header to the perl helper scripts
2022-03-26 17:55:40 +01:00

37 lines
1.2 KiB
Perl

#!/bin/perl
# Copyright 2021, Joachim Mairböck <j.mairboeck@gmail.com>
# Distributed under the terms of the MIT license.
# Helper script to get the packageEntries for texlive subpackages
# usage:
# perl -I $sourceDir/tlpkg getPackageEntries.pl <prefix> <collectionname>
#
# <prefix> is the root of the installation, containing tlpkg/texlive.tlpdb, i.e. $dataDir/texlive/
# <collectionname> is the base name of the subpackage without prefix
#
# This script uses the TeXLive perl modules, therefore it needs $sourceDir/tlpkg in @INC.
use strict;
use warnings;
use TeXLive::TLPDB;
my $tlpdb = TeXLive::TLPDB->new(root => $ARGV[0]);
my ($collection, $suffix) = split "_", $ARGV[1];
my $tlpkg = $tlpdb->get_package("collection-$collection");
my @depnames = $tlpkg->depends();
foreach my $depname (@depnames) {
my $deppkg = $tlpdb->get_package($depname);
my $filesfield = do {
unless (defined $suffix) { "runfiles" }
elsif ($suffix eq "doc") { "docfiles" }
elsif ($suffix eq "source") { "srcfiles" }
};
my @files = @{$deppkg->{$filesfield}};
foreach my $filename (@files) {
my $path = $ARGV[0] . $filename;
print $path, "\n" if -e $path; # ignore missing files
}
}