DOKK / manpages / debian 11 / lintian / Test::Lintian::Templates.3.en
Test::Lintian::Templates(3) Debian Package Checker Test::Lintian::Templates(3)

Test::Lintian::Templates -- Helper routines dealing with templates

use Test::Lintian::Templates qw(fill_template);

my $data = { 'placeholder' => 'value' }; my $file = '/path/to/generated/file';

fill_template("$file.in", $file, $data);

Routines for dealing with templates in Lintian test specifications.

Copies template sets belonging to SUITE into the test working directory RUN_PATH according to INSTRUCTIONS. The INSTRUCTIONS are the target directory relative to RUN_PATH followed by the name of the template set in parentheses. Multiple such instructions must be separated by commas.
Removes from TARGET_DIR any templates that have corresponding originals in SRC_DIR.
Fills the templates specified in INSTRUCTIONS using the data in HASH. Only fills templates when the generated files are not present or are older than either the file modification time of the template or the age of the data as evidenced by EPOCH. The INSTRUCTIONS are the target directory relative to RUN_PATH followed by the name of the whitelist in parentheses. Multiple instructions must be separated by commas.
Generates all files in array WHITE_LIST relative to DIR from their templates, which are assumed to have the same file name but with extension '.in', using data provided in HASH. The optional argument HASH_EPOCH can be used to preserve files when no generation is necessary.
Fills all templates in DIR with data from HASH.
Fills template TEMPLATE with data from HASH and places the result in file GENERATED. When given HASH_EPOCH, will evaluate beforehand if a substitution is necessary based on file modification times. The optional parameter DELIMITERS can be used to change the standard delimiters.
2020-11-27 Lintian v2.104.0