Test::Lintian::Templates(3)

πŸ’– Test::Lintian::Templates(3) πŸ’–

okay bestie so this one is from the Debian Package Checker manual, section 3, and it's literally the little helper module that handles templates πŸ’… like the glue that goes brrr between a .in file and the file it's supposed to become. no cap.


✨ NAME ✨

Test::Lintian::Templates β€” helper routines dealing with templates 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

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

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

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

so you import fill_template, you make yourself a $data hashref with the placeholder values, you point $file at where the generated file should live, and then you just… call it. that's the whole vibe ✨


🌈 DESCRIPTION 🌈

Routines for dealing with templates in Lintian test specifications. it's giving infrastructure, it's giving plumbing, and honestly? we're obsessed 🫢


πŸ‘‘ FUNCTIONS πŸ‘‘

πŸ’œ copy_skeleton_template_sets(INSTRUCTIONS, RUN_PATH, SUITE, TEST_SET)

Copies template sets belonging to SUITE into the test working directory RUN_PATH according to INSTRUCTIONS.

and what are those instructions, you ask? the target directory relative to RUN_PATH, followed by the name of the template set in parentheses. and if you want multiple of them? separate them with commas, periodt. πŸ”₯


πŸ’œ remove_surplus_templates(SRC_DIR, TARGET_DIR)

Removes from TARGET_DIR any templates that have corresponding originals in SRC_DIR. spring cleaning but make it automated 🧹 ✨


πŸ’œ fill_skeleton_templates(INSTRUCTIONS, HASH, EPOCH, RUN_PATH, TEST_SET)

Fills the templates specified in INSTRUCTIONS using the data in HASH. πŸ“

but here's the catch β€” it 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. no wasted work, we love an efficient queen πŸ’…

the INSTRUCTIONS are the target directory relative to RUN_PATH followed by the name of the whitelist in parentheses, and multiple instructions must be separated by commas.


πŸ’œ fill_whitelisted_templates(DIR, WHITE_LIST, HASH, HASH_EPOCH)

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. 🌸

and the optional argument HASH_EPOCH? you can use it to preserve files when no generation is necessary. lowkey genius. 😌


πŸ’œ fill_all_templates(HASH, DIR)

Fills all templates in DIR with data from HASH. all of them. every single one. go big or go home πŸ”₯


πŸ’œ fill_template(TEMPLATE, GENERATED, HASH, HASH_EPOCH, DELIMITERS)

Fills template TEMPLATE with data from HASH and places the result in file GENERATED. ✨

when you give it HASH_EPOCH, it will evaluate beforehand whether a substitution is even necessary, based on file modification times. so it checks first, then acts β€” main character energy honestly πŸŽ€

and the optional parameter DELIMITERS? that one lets you change the standard delimiters, iykyk 🌟


πŸ’– reminder bestie: delimiters matter, epochs matter, and modification times are always watching. read the args, love the args, pass them in the right order. 🫢

and that's the whole page, fr fr πŸ’œ brought to you by Lintian v2.139.0ubuntu2, dated 2026-10-08 β€” go forth and template responsibly, you absolute icon πŸ‘‘πŸŒˆ

πŸ“¦ where this page comes from