lib/fig/repository.rb in fig-0.1.10 vs lib/fig/repository.rb in fig-0.1.11
- old
+ new
@@ -86,10 +86,11 @@
end
if resources.size > 0
file = "resources.tar.gz"
file unless system "tar -zcf #{file} #{resources.join(' ')}"
new_package_statements.unshift(Archive.new(file))
+ at_exit { File.delete(file) }
end
new_package_statements
end
def load_package(package_name, version_name)
@@ -100,11 +101,16 @@
end
def update_package(package_name, version_name)
remote_fig_file = remote_fig_file_for_package(package_name, version_name)
local_fig_file = local_fig_file_for_package(package_name, version_name)
- if @os.download(remote_fig_file, local_fig_file)
- install_package(package_name, version_name)
+ begin
+ if @os.download(remote_fig_file, local_fig_file)
+ install_package(package_name, version_name)
+ end
+ rescue NotFoundException
+ $stderr.puts "Package not found in remote repository: #{package_name}/#{version_name}"
+ exit 1
end
end
def read_local_package(package_name, version_name)
dir = local_dir_for_package(package_name, version_name)