From 381532da4556d3bf591c4d36d7f12e98f384d3a9 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 5 Mar 2013 17:16:33 +0100 Subject: [PATCH] Check, if file exists. Only delete if exists. --- app/models/package.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/package.rb b/app/models/package.rb index d6819c80c..95317b653 100644 --- a/app/models/package.rb +++ b/app/models/package.rb @@ -374,7 +374,9 @@ class Package < ApplicationModel # install file puts "NOTICE: uninstall '#{location}'" - File.delete( location ) + if File.exist?( location ) + File.delete( location ) + end # rename existing file backup_location = location + '.save'