# # # patch "ChangeLog" # from [2f112bf7d675476f4defdfbd335bc02c1836ed13] # to [7fb64962e77815890d05f239cfd2ecd41053e1d8] # # patch "std_hooks.lua" # from [87a925a89f17ae312390049e28296bbb9f7ee170] # to [4ca1188ac09063710baa429986649f2c3ad13083] # ============================================================ --- ChangeLog 2f112bf7d675476f4defdfbd335bc02c1836ed13 +++ ChangeLog 7fb64962e77815890d05f239cfd2ecd41053e1d8 @@ -1,3 +1,9 @@ +2006-02-27 Matt Johnston + + * std_hooks.lua (ignore_file, dir_matches): add dir_matches helper + to avoid including ignored dirs such as '.svn', since dirs now + actually exist. + 2006-02-25 Nathaniel Smith * work.cc (attach_node): Apparently the tests depend on update ============================================================ --- std_hooks.lua 87a925a89f17ae312390049e28296bbb9f7ee170 +++ std_hooks.lua 4ca1188ac09063710baa429986649f2c3ad13083 @@ -70,6 +70,15 @@ end end +function dir_matches(name, dir) + -- helper for ignore_file, matching files within dir, or dir itself. + -- eg for dir of 'CVS', matches CVS/, CVS/*, */CVS/ and */CVS/* + if (string.find(name, "^" .. dir .. "/")) then return true end + if (string.find(name, "^" .. dir .. "$")) then return true end + if (string.find(name, "/" .. dir .. "/")) then return true end + if (string.find(name, "/" .. dir .. "$")) then return true end + return false +end function ignore_file(name) -- project specific @@ -124,26 +133,21 @@ -- emacs creates #foo# files if (string.find(name, "%#[^/]*%#$")) then return true end -- autotools detritus: - if (string.find(name, "^autom4te.cache/")) then return true end - if (string.find(name, "/autom4te.cache/")) then return true end - if (string.find(name, "^.deps/")) then return true end - if (string.find(name, "/.deps/")) then return true end + if dir_matches(name, "autom4te.cache") then return true end + if dir_matches(name, ".deps") then return true end -- Cons/SCons detritus: - if (string.find(name, "^.consign$")) then return true end - if (string.find(name, "/.consign$")) then return true end - if (string.find(name, "^.sconsign$")) then return true end - if (string.find(name, "/.sconsign$")) then return true end + if dir_matches(name, ".consign") then return true end + if dir_matches(name, ".sconsign") then return true end -- other VCSes: - if (string.find(name, "^CVS/")) then return true end - if (string.find(name, "/CVS/")) then return true end - if (string.find(name, "^%.svn/")) then return true end - if (string.find(name, "/%.svn/")) then return true end - if (string.find(name, "^SCCS/")) then return true end - if (string.find(name, "/SCCS/")) then return true end - if (string.find(name, "^_darcs/")) then return true end - if (string.find(name, "^.cdv/")) then return true end - if (string.find(name, "^.git/")) then return true end - if (string.find(name, "%.scc$")) then return true end + if dir_matches(name, "CVS") then return true end + if dir_matches(name, ".svn") then return true end + if dir_matches(name, "SCCS") then return true end + if dir_matches(name, "_darcs") then return true end + if dir_matches(name, ".cdv") then return true end + if dir_matches(name, ".git") then return true end + if dir_matches(name, ".scc") then return true end + if dir_matches(name, ".bzr") then return true end + if dir_matches(name, ".hg") then return true end -- desktop/directory configuration metadata if (string.find(name, "^.DS_Store$")) then return true end if (string.find(name, "/.DS_Store$")) then return true end