NAME
Meta::Baseline::Cleanup - module to do cleanup of a change.
COPYRIGHT
Copyright (C) 2001, 2002 Mark Veltzer; All rights reserved.
LICENSE
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
DETAILS
MANIFEST: Cleanup.pm
PROJECT: meta
VERSION: 0.27
SYNOPSIS
package foo;
use Meta::Baseline::Cleanup qw();
Meta::Baseline::Cleanup::cleanup($directory,$demo,$abso,$matc,$safe,$verbose);
DESCRIPTION
This module gives you a cleaning up utility for parts of the baseline. This is the basis of the now all world popular cleanup.pl script. Have a good time on me.
p.s. Aegis gives this service (aeclean) but it doesnt have a demo type flag and so we want to have our own implementation.
FUNCTIONS
cleanup($$$$$$)
extra_files_hash($$$$)
no_extra_files($$$$)
TEST($)
FUNCTION DOCUMENTATION
- cleanup($$$$$$)
-
This function does the actual cleaning up. It just uses the extra_files_hash and removes the files and then does some purging. input: 0. directory - directory in which to cleanup. 1. absolute - whether to work in absolute mode or not. 2. safe - whether the cleanup will be safe or not. 3. matc - string to match agains for each remove. 4. demo - whether this is a demo or not. 5. verbose - whether to be verbose or not.
This routine returns a success value.
- extra_files_hash($$$$)
-
This routine receives a directory and returns a hash with all the files in that directory which are not reported to aegis (extra). The way the routine works is using collect to collect all the files in the directory, using change_files to get all the files in the change and subtracting one from the other. If safe mode is on it also subtracts anything which is not a temp file. input: 0. directory - directory in which to check for extra files. 1. absolute - whether to give out a hash with absolute file names or not. 2. safe - whether the check will be safe or not. 3. verb - whether the check will be verbose or not.
- no_extra_files($$$$)
-
This routine returns a boolean according to whether there are no extra files in the directory it receives. input: 0. directory - directory in which to check. 1. absolute - whether the check will use absolute pathnames. 2. safe - whether the check will be safe. 3. verb - whether to be verbose or not. The routine simply calls extra_files_hash and checks if the hash is empty.
- TEST($)
-
Test suite for this module.
SUPER CLASSES
None.
BUGS
None.
AUTHOR
Name: Mark Veltzer
Email: mailto:veltzer@cpan.org
WWW: http://www.veltzer.org
CPAN id: VELTZER
HISTORY
0.00 MV initial code brought in
0.01 MV make quality checks on perl code
0.02 MV more perl checks
0.03 MV check that all uses have qw
0.04 MV fix todo items look in pod documentation
0.05 MV make all tests real tests
0.06 MV more on tests/more checks to perl
0.07 MV more perl quality
0.08 MV perl code quality
0.09 MV more perl quality
0.10 MV more perl quality
0.11 MV perl documentation
0.12 MV more perl quality
0.13 MV perl qulity code
0.14 MV more perl code quality
0.15 MV revision change
0.16 MV languages.pl test online
0.17 MV perl packaging
0.18 MV md5 project
0.19 MV database
0.20 MV perl module versions in files
0.21 MV movies and small fixes
0.22 MV thumbnail user interface
0.23 MV more thumbnail issues
0.24 MV website construction
0.25 MV web site automation
0.26 MV SEE ALSO section fix
0.27 MV md5 issues
SEE ALSO
Meta::Baseline::Aegis(3), Meta::Baseline::Cook(3), Meta::Utils::File::Collect(3), Meta::Utils::File::Purge(3), Meta::Utils::File::Remove(3), Meta::Utils::Hash(3), Meta::Utils::Output(3), strict(3)
TODO
-Cleanup does not work well when $abso is 0. fix this. after that fix the base_aegi_cleanup script which uses this to have a default value of 0 on the $abso flag.