dont delete theme stuff when cleaning up, to put it back right after
authorgc <gc>
Mon, 13 Jun 2005 18:43:56 +0000 (18:43 +0000)
committergc <gc>
Mon, 13 Jun 2005 18:43:56 +0000 (18:43 +0000)
bin/booh-backend

index f8595a6f898262882accb425193d73910863b532..4b15471038f685a65f71459afbc24fcbad89c0c5 100755 (executable)
@@ -654,22 +654,23 @@ def walk_source_dir
         }
 
         if !$forgui
+            themestuff = Dir.entries("#{$FPATH}/themes/#{$theme}").
+                             find_all { |e| !%w(. .. skeleton_image.html skeleton_thumbnails.html skeleton_index.html metadata CVS).include?(e) }
+
             #- cleanup old images/videos (for when removing elements or sizes)
             all_elements = fullscreen_images.collect { |e| e[1] }.flatten.
                      concat(thumbnail_images.collect { |e| e[1] }.flatten).
                      concat(thumbnail_videos.collect { |e| e[1] }.flatten).
                      concat(videos)
-            to_del = Dir.entries(dest_dir).find_all { |e| e != '.' && e != '..' && !all_elements.include?(e) }.collect { |e| "#{dest_dir}/#{e} " }
-            system("rm -f #{to_del}")
+            to_del = Dir.entries(dest_dir).find_all { |e| e != '.' && e != '..' && !all_elements.include?(e) } - themestuff
+            system("rm -f " + to_del.collect { |e| "#{dest_dir}/#{e}" }.join(' '))
 
             #- copy any resource file that goes with the theme (css, images..)
-            for entry in Dir.entries("#{$FPATH}/themes/#{$theme}")
-                if !%w(. .. skeleton_image.html skeleton_thumbnails.html skeleton_index.html metadata CVS).include?(entry)
-                    if !File.exists?("#{dest_dir}/#{entry}")
-                        psys("cp '#{$FPATH}/themes/#{$theme}/#{entry}' '#{dest_dir}'")
-                    end
+            themestuff.each { |entry|
+                if !File.exists?("#{dest_dir}/#{entry}")
+                    psys("cp '#{$FPATH}/themes/#{$theme}/#{entry}' '#{dest_dir}'")
                 end
-            end
+            }
 
             msg 3, _("\tgenerating HTML pages...")