X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=tools%2Flist-files.pl;h=7b5de8e4ffd1812cef2347c276254ae9adac4138;hb=baa785a7bd2832bbaee73620c5cd493cdf539778;hp=673d43b8ae6e0b51e76b7e248569ca3e21298531;hpb=765b2f1a538b8e0725a48945e4efacf767bf2035;p=sugar.git diff --git a/tools/list-files.pl b/tools/list-files.pl index 673d43b..7b5de8e 100644 --- a/tools/list-files.pl +++ b/tools/list-files.pl @@ -4,18 +4,22 @@ use Smart::Comments; use List::MoreUtils qw(any); use File::Spec; -my @RE_IGNORED = map { - s/\./\\./g; - s/\+/\\+/g; - - s/\?/.?/g; - s/\*/.*?/g; - - qr/^$_$/; - } - grep {length} - map {tr/\n//d; $_} - ; +my @RE_IGNORED = do { + open my $fh, '<', 'IGNORE' or die $!; + map { + s/\./\\./g; + s/\+/\\+/g; + + s/\?/.?/g; + s/\*/.*?/g; + + qr/^$_$/; + } + grep {length} + map {s/^\s*#//; $_} + map {tr/\n//d; $_} + <$fh>; +}; main(); @@ -44,7 +48,7 @@ sub find { my $rel = File::Spec->abs2rel($abs, $base); next if any { $rel =~ m/$_/ } @RE_IGNORED; - next if !-f $abs; + next if !-e $abs; if (-d $abs) { push @d, find($base, $rel); @@ -55,64 +59,3 @@ sub find { } @d; } - -__DATA__ -*~ -.*cache* -.*history* -.CFUserTextEncoding -.DS_Store -.ICEauthority -.MacOSX -.Trash -.Xauthority -.cabal -.cpan -.dbus -.dvdcss -.easytag -.elisp -.esd_auth -.emacs.d -.eshell -.firefox -.fontconfig* -.fonts -.gconf* -.gimp* -.glimpse* -.gnome2* -.gnucash -.gnupg -.gstreamer-0.10 -.htpasswd -.ido.last* -.jungledisk* -.kde -.localized -.mozilla -.mpd -.mplayer -.nautilus -.navi2ch -.nh-todo -.pan -.projects.ede -.qt -.recently-used* -.rnd -.s9x -.scribus -.skk-* -.snes* -.ssh -.thumbnails -.tome -.trackballs -.uim.d -.unison -.viminfo -.w3m -.xchat2* -.zcomp* -.zfunc