mirror of
https://github.com/freedoom/freedoom.git
synced 2025-09-01 22:25:46 -04:00
attic-me.rb: script to find "orphaned" resources that can be moved
out of the main build tree and into the attic.
This commit is contained in:
parent
2e5d8fd981
commit
b9fb28ca73
2 changed files with 33 additions and 0 deletions
33
tools/attic-me.rb
Executable file
33
tools/attic-me.rb
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/ruby
|
||||
# attic-me.rb: find resources not symlinked to for moving to attic
|
||||
# (c) 2006 Jon Dowland <jon@alcopop.org>, see "COPYING" file
|
||||
# vim: set ts=2:
|
||||
require "find"
|
||||
|
||||
class Regexp # mass match with [].include?
|
||||
def ==(str); self.match(str); end
|
||||
end
|
||||
|
||||
class AtticMe < File
|
||||
@@ignore = [
|
||||
/\.$/, /\.svn/, /\.txt$/i, /\.bmp$/i,
|
||||
"Makefile", /aoddoom_skeletons/,
|
||||
]
|
||||
|
||||
def AtticMe.main
|
||||
[ "flats", "graphics", "levels",
|
||||
"musics", "patches", "sounds",
|
||||
"textures", "lumps", "sprites",
|
||||
].each do |dir|
|
||||
files = []
|
||||
linked_to = []
|
||||
Find.find(dir) { |f|
|
||||
Find.prune if @@ignore.include?(basename(f))
|
||||
files << expand_path(f) if file?(f) and not symlink?(f)
|
||||
linked_to << expand_path(dir+Separator+readlink(f)) if symlink?(f)
|
||||
}
|
||||
puts (files - linked_to).join("\n")
|
||||
end
|
||||
end
|
||||
end
|
||||
AtticMe.main
|
Loading…
Add table
Add a link
Reference in a new issue