if an entire directory is removed, dont forget to remove the target directory as...
authorgc <gc>
Fri, 18 Nov 2005 22:08:50 +0000 (22:08 +0000)
committergc <gc>
Fri, 18 Nov 2005 22:08:50 +0000 (22:08 +0000)
bin/booh-backend

index b63a3a4f418f85a974592e900894f61c1b2ac677..4c88919e53bb9420b17e88fd3dfee7274ac977a6 100755 (executable)
@@ -619,11 +619,16 @@ def walk_source_dir
             die _("Source directory or sub-directories can't contain a single-quote character, sorry: %s") % dir
         end
 
             die _("Source directory or sub-directories can't contain a single-quote character, sorry: %s") % dir
         end
 
+        dest_dir = make_dest_filename(dir.sub(/^#{Regexp.quote($source)}/, $dest))
+
         #- place xml document on proper node if exists, else create
         xmldir = optxpath[utf8(dir)]
         if $mode == 'use_config' || $mode == 'use_config_changetheme'
             if !xmldir || (xmldir.attributes['already-generated'] && !$force) || xmldir.attributes['deleted']
                 info("walking: #{dir}|#{$source}, 0 elements")
         #- place xml document on proper node if exists, else create
         xmldir = optxpath[utf8(dir)]
         if $mode == 'use_config' || $mode == 'use_config_changetheme'
             if !xmldir || (xmldir.attributes['already-generated'] && !$force) || xmldir.attributes['deleted']
                 info("walking: #{dir}|#{$source}, 0 elements")
+                if xmldir && xmldir.attributes['deleted']
+                    system("rm -rf '#{dest_dir}'")
+                end
                 next
             end
         else
                 next
             end
         else
@@ -691,7 +696,6 @@ def walk_source_dir
         msg 3, _("\t%s videos") % videos.length
         info("walking: #{dir}|#{$source}, #{images.length + videos.length} elements")
 
         msg 3, _("\t%s videos") % videos.length
         info("walking: #{dir}|#{$source}, #{images.length + videos.length} elements")
 
-        dest_dir = make_dest_filename(dir.sub(/^#{Regexp.quote($source)}/, $dest))
         system("mkdir -p '#{dest_dir}'")
 
         #- pass through if there are no images and videos
         system("mkdir -p '#{dest_dir}'")
 
         #- pass through if there are no images and videos