From 9deea9af37f88d68ee59bd22242adeb84faebd0e Mon Sep 17 00:00:00 2001 From: gc Date: Wed, 30 Nov 2005 20:00:52 +0000 Subject: [PATCH] bugfix < 0.8.4 migrating --- bin/booh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/booh b/bin/booh index fe30d52..6bfdd9c 100755 --- a/bin/booh +++ b/bin/booh @@ -2377,13 +2377,18 @@ def open_file(filename) if xmldir = $xmldoc.elements["//dir[@path='#{utf8(dir)}']"] xmldir.elements.each { |element| if %w(image video).include?(element.name) && !element.attributes['deleted'] - old_name = old_dest_dir + '/' + make_dest_filename_old(from_utf8(element.attributes['filename'])).sub(/\.[^\.]+$/, '') + old_name = new_dest_dir + '/' + make_dest_filename_old(from_utf8(element.attributes['filename'])).sub(/\.[^\.]+$/, '') new_name = new_dest_dir + '/' + make_dest_filename(from_utf8(element.attributes['filename'])).sub(/\.[^\.]+$/, '') Dir[old_name + '*'].each { |file| new_file = file.sub(/^#{Regexp.quote(old_name)}/, new_name) file != new_file and sys("mv '#{file}' '#{new_file}'") } end + if element.name == 'dir' && !element.attributes['deleted'] + old_name = new_dest_dir + '/thumbnails-' + make_dest_filename_old(from_utf8(File.basename(element.attributes['path']))) + '.jpg' + new_name = new_dest_dir + '/thumbnails-' + make_dest_filename(from_utf8(File.basename(element.attributes['path']))) + '.jpg' + old_name != new_name and sys("mv '#{old_name}' '#{new_name}'") + end } else msg 1, "could not find element by path '#{utf8(dir)}' in xml file" -- 2.30.4