The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

PkgForge::Utils - General utilities for the LCFG Package Forge

VERSION

This documentation refers to PkgForge::Utils version 1.4.8

SYNOPSIS

     use PkgForge::Utils;

     PkgForge::Utils::remove_tree($dir);

DESCRIPTION

This module provides various utility functions which are used throughout the LCFG Package Forge software suite.

SUBROUTINES/METHODS

remove_tree($dir,[$options]);

This will remove a tree of files and directories in a similar way to the function with the same name in newer versions of the File::Path module. It takes a directory name and an optional reference to a hash of options. It returns the number of files and directories which have been deleted. The supported options are:

verbose

A boolean, when this is true the files and directories removed will be printed to STDOUT, defaults to false.

keep_root

A boolean, when this is true the top-level directory itself will not be removed, only the contents would be erased. This defaults to false.

result

A reference to an array into which the list of removed files and directories will be added.

error

A reference to an array into which the list of any failures to remove files and directories will be added.

list_dirs( $dir, $list )

This function will find all the sub-directories of the specified directory. It puts them into an array (which is referenced in the second required argument) which is ordered such that the sub-directories are before the directory itself. This is used by remove_tree.

kinit( $keytab, $principal, $ccache )

This does the equivalent of kinit(1) using the specified keytab and principal. Optionally you can specify the credentials cache to use, by default it uses a memory cache. The KRB5CCNAME environment variable will be set so that Kerberos-aware modules (such as DBI) will automatically use the credentials cache.

job_resultsdir( $results_base, $job_uuid )

This computes and returns the job-specific results directory given the base directory and the UUID for the job.

DEPENDENCIES

This module requires File::Find::Rule. To use the kinit method you will also need the Authen::Krb5 to be installed.

SEE ALSO

PkgForge

PLATFORMS

This is the list of platforms on which we have tested this software. We expect this software to work on any Unix-like platform which is supported by Perl.

ScientificLinux5, Fedora13

BUGS AND LIMITATIONS

Please report any bugs or problems (or praise!) to bugs@lcfg.org, feedback and patches are also always very welcome.

AUTHOR

    Stephen Quinney <squinney@inf.ed.ac.uk>

LICENSE AND COPYRIGHT

    Copyright (C) 2010-2011 University of Edinburgh. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the terms of the GPL, version 2 or later.