From 6214c7b6ebac525f6bfa22cb78e7a3dc89688c4f Mon Sep 17 00:00:00 2001 From: donghee yang Date: Tue, 9 Oct 2012 10:04:21 +0900 Subject: [PATCH] [Title] Fixed a bug that download log does not work --- src/common/execute_with_log.rb | 6 +++++- src/pkg_server/downloader.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/common/execute_with_log.rb b/src/common/execute_with_log.rb index 7990697..f98a8fc 100755 --- a/src/common/execute_with_log.rb +++ b/src/common/execute_with_log.rb @@ -36,7 +36,11 @@ cmd = ARGV[0] log_path = ARGV[1] # create logger -log = Logger.new(log_path) +if log_path.nil? or log_path.empty? then + log = Logger.new(STDOUT) +else + log = Logger.new(log_path) +end # generate command cmd = Utils.generate_shell_command(cmd, nil) diff --git a/src/pkg_server/downloader.rb b/src/pkg_server/downloader.rb index 982fde0..a01bd24 100644 --- a/src/pkg_server/downloader.rb +++ b/src/pkg_server/downloader.rb @@ -45,7 +45,7 @@ class FileDownLoader logger.info "Downloading #{url}" if is_remote then - pid,status = Utils.execute_shell_with_log( "wget #{url} -O #{fullpath} -nv", logger ) + pid,status = Utils.execute_shell_with_log( "wget #{url} -O #{fullpath} -nv", logger.path ) ret = status.exitstatus != 0 ? false : true #ret = Utils.execute_shell( "wget #{url} -O #{fullpath} -q") else -- 2.34.1