From 0820d149250135255f59ee4006f875c36ad412f7 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Tue, 4 Feb 2014 05:04:18 +0000 Subject: [PATCH] Remove redundant scripts. --- cleanup/find-duplicates.rb | 19 ------------------ cleanup/find-redundant.rb | 41 -------------------------------------- tools/attic-me.rb | 35 -------------------------------- tools/gen_gallery.py | 16 --------------- 4 files changed, 111 deletions(-) delete mode 100644 cleanup/find-duplicates.rb delete mode 100644 cleanup/find-redundant.rb delete mode 100755 tools/attic-me.rb delete mode 100644 tools/gen_gallery.py diff --git a/cleanup/find-duplicates.rb b/cleanup/find-duplicates.rb deleted file mode 100644 index b88dd632..00000000 --- a/cleanup/find-duplicates.rb +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env ruby - -IO.popen("find -type f -name '*.gif' | xargs md5sum |sort") do |proc| - lastline = '' - lastsum = '' - proc.each_line do |s| - s =~ /^(\w+)/ - sum = $1 - if sum == lastsum - print lastline - puts s - lastline = '' - else - lastsum = sum - lastline = s - end - end -end - diff --git a/cleanup/find-redundant.rb b/cleanup/find-redundant.rb deleted file mode 100644 index 13fca682..00000000 --- a/cleanup/find-redundant.rb +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env ruby -# -# Find possibly redundant files for removal - -valid_files = {} - -# all files in the top level dir - -for file in Dir.glob("*") - valid_files[File.expand_path(file)] = 1 -end - -# all files in immediate subdirs and the files they link to - -for file in Dir.glob("*/*") - stat = File.lstat(file) - if stat.symlink? - valid_files[File.expand_path(file)] = 1 - linked = File.readlink(file) - linked = File.dirname(file) + "/" + linked - linked = File.expand_path(linked) - valid_files[linked] = 1 - end -end - -# seek out invalid files and build a list - -puts "" - diff --git a/tools/attic-me.rb b/tools/attic-me.rb deleted file mode 100755 index 64b75e9e..00000000 --- a/tools/attic-me.rb +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/ruby -# attic-me.rb: find resources not symlinked to for moving to attic -# (c) 2006 Jon Dowland , 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/, /\.mid$/, - /dummy/, "fakedemo.lmp", "misc-lumps", - "blank.gif", "nomonst.gif", "titlepic", - ] - - 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 diff --git a/tools/gen_gallery.py b/tools/gen_gallery.py deleted file mode 100644 index bbf4993b..00000000 --- a/tools/gen_gallery.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/python -import os,sys,re - -# this sucks - -patches = [ x for x in os.listdir('.') if re.match(r'.*\.gif$', x) ] -patches.sort() - -print ''' -''' -print ''.join(['

%s
' % (x,x) for x in patches])