# if input os is empty then return
if os.nil? or os.empty? then return end
- File.open( "#{@location}/#{PKG_LIST_FILE_PREFIX}#{os}", "w" ) do |f|
+ # generate temp file
+ tmp_file_name = ""
+ while ( tmp_file_name.empty? )
+ tmp_file_name = @location + "/temp/." + Utils.create_uniq_name
+
+ if File.exist? tmp_file_name then
+ tmp_file_name = ""
+ end
+ end
+
+ File.open( tmp_file_name, "w" ) do |f|
@pkg_hash_os[os].each_value do |pkg|
# insert package information to file
pkg.print_to_file(f)
f.puts
end
end
+
+ FileUtils.mv( tmp_file_name, "#{@location}/#{PKG_LIST_FILE_PREFIX}#{os}", :force => true )
end
# input: package file path(zip file)