[cage] Add some karma aliases for myself
[parrot.git] / tools / dev / svnclobber.pl
blob3aa0b8c255ef3fdbf19ce55d42b3dffd388d8f04
1 #! perl
3 # Copyright (C) 2007-2008, Parrot Foundation.
4 # $Id$
6 =head1 NAME
8 svnclobber.pl - delete all files that are not checked into SVN
10 =head1 SYNOPSIS
12 perl svnclobber.pl
14 =head1 DESCRIPTION
16 This is a dangerous script. It deletes all files that are not checked
17 into SVN.
19 Usually this script is invoked by C<make svnclobber> of the root Parrot makefile.
20 In case that there is no Makefile, this script can also be invoked directly.
22 =head1 HISTORY
24 Extracted from F<config/gen/makefiles/root.in>
26 =cut
28 package main;
30 use strict;
31 use warnings;
32 use 5.008;
34 use File::Find ();
36 # Try to be nice and delete files only below a checked out SVN repository.
38 die "The current directory is not a SVN working copy" unless -d '.svn';
40 File::Find::find(
41 sub {
42 if ( -f # remove only files
43 and not $File::Find::name =~ m/\.svn/
44 and not -e ".svn/text-base/$_.svn-base"
47 unlink $_;
50 q{.}
53 # Local Variables:
54 # mode: cperl
55 # cperl-indent-level: 4
56 # fill-column: 100
57 # End:
58 # vim: expandtab shiftwidth=4: