emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patch] leim/Makefile.in: make distclean should make clean


From: Stefan Monnier
Subject: Re: [patch] leim/Makefile.in: make distclean should make clean
Date: 16 Feb 2004 09:39:35 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> I understand your point. Nonetheless, I need to clean such
> files, so would it be possible to keep such a target around, no
> matter how it is called?

To make things spotless, I use cvsclean.


        Stefan


emacs/work-0% cat =cvsclean
#!/usr/bin/perl

sub cvsclean {
    my($path) = @_;
    my(%files) = ();
    my(@subdirs);

    print STDOUT "Cleaning $path\n";
    opendir (DIR, "$path/") || die "No directory $path";
    open (ENTRIES, "$path/CVS/Entries") || die "No $path/CVS/Entries file";
    while (<ENTRIES>) {
        if (m[^D/([^/]+)]) {
            push (@subdirs, "$path/$1");
        } elsif (m[^/([^/]+)/[^/-]]) {
            $files{$1} = "managed";
        }
    }

    foreach $entry (readdir(DIR)) {
        if (!exists ($files{$entry})) {
            $entry = "$path/$entry";
            if (-f $entry) {
                print STDOUT "unlink $entry\n";
                unlink $entry;
            }
        }
    }
    
    foreach $subdir (@subdirs) {
        &cvsclean ($subdir);
    }
}

&cvsclean (".");
emacs/work-0% 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]