From owner-svn-src-projects@FreeBSD.ORG Tue Apr 7 23:31:51 2015 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65E4F47B; Tue, 7 Apr 2015 23:31:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46F5CE1E; Tue, 7 Apr 2015 23:31:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t37NVorN024526; Tue, 7 Apr 2015 23:31:50 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t37NVo22024254; Tue, 7 Apr 2015 23:31:50 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201504072331.t37NVo22024254@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 7 Apr 2015 23:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r281240 - projects/lua-bootloader/sys/boot/lua X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2015 23:31:51 -0000 Author: rpaulo Date: Tue Apr 7 23:31:49 2015 New Revision: 281240 URL: https://svnweb.freebsd.org/changeset/base/281240 Log: lua: remove '\n' in print() calls. Lua's print() function already prints a new line. Modified: projects/lua-bootloader/sys/boot/lua/config.lua projects/lua-bootloader/sys/boot/lua/menu.lua Modified: projects/lua-bootloader/sys/boot/lua/config.lua ============================================================================== --- projects/lua-bootloader/sys/boot/lua/config.lua Tue Apr 7 23:09:34 2015 (r281239) +++ projects/lua-bootloader/sys/boot/lua/config.lua Tue Apr 7 23:31:49 2015 (r281240) @@ -98,7 +98,7 @@ pattern_table = { str = "^%s*exec%s*=%s*\"([%w%s%p]-)\"%s*(.*)", process = function(k, v) if loader.perform(k) ~= 0 then - print("Failed to exec '"..k.."'\n"); + print("Failed to exec '"..k.."'"); end end }, @@ -107,7 +107,7 @@ pattern_table = { str = "^%s*([%w%p]+)%s*=%s*\"([%w%s%p]-)\"%s*(.*)", process = function(k, v) if loader.perform("set "..k.."=\""..v.."\"") ~= 0 then - print("Failed to set '"..k.."' with value: "..v.."\n"); + print("Failed to set '"..k.."' with value: "..v..""); end end }, @@ -116,7 +116,7 @@ pattern_table = { str = "^%s*([%w%p]+)%s*=%s*(%d+)%s*(.*)", process = function(k, v) if loader.perform("set "..k.."="..v.."") ~= 0 then - print("Failed to set '"..k.."' with value: "..v.."\n"); + print("Failed to set '"..k.."' with value: "..v..""); end end } @@ -143,14 +143,14 @@ function config.loadmod(mod, silent) if v.before ~= nil then if loader.perform(v.before) ~= 0 then if not silent then - print("Failed to execute '"..v.before.."' before loading '"..k.."'\n"); + print("Failed to execute '"..v.before.."' before loading '"..k.."'"); end status = false; end end if loader.perform(str) ~= 0 then - if not silent then print("Failed to execute '" .. str .. "'\n"); end + if not silent then print("Failed to execute '" .. str .. "'"); end if v.error ~= nil then loader.perform(v.error); end @@ -160,14 +160,14 @@ function config.loadmod(mod, silent) if v.after ~= nil then if loader.perform(v.after) ~= 0 then if not silent then - print("Failed to execute '"..v.after.."' after loading '"..k.."'\n"); + print("Failed to execute '"..v.after.."' after loading '"..k.."'"); end status = false; end end else - --if not silent then print("Skiping module '".. k .. "'\n"); end + --if not silent then print("Skiping module '".. k .. "'"); end end end @@ -177,7 +177,7 @@ end function config.parse(name, silent) local f = io.open(name); if f == nil then - if not silent then print("Failed to open config: '" .. name.."'\n"); end + if not silent then print("Failed to open config: '" .. name.."'"); end return false; end @@ -187,7 +187,7 @@ function config.parse(name, silent) text, r = io.read(f); if text == nil then - if not silent then print("Failed to read config: '" .. name.."'\n"); end + if not silent then print("Failed to read config: '" .. name.."'"); end return false; end @@ -207,7 +207,7 @@ function config.parse(name, silent) if config.isValidComment(c) then val.process(k, v); else - print("Malformed line ("..n.."):\n\t'"..line.."'\n"); + print("Malformed line ("..n.."):\n\t'"..line.."'"); status = false; end @@ -216,7 +216,7 @@ function config.parse(name, silent) end if found == false then - print("Malformed line ("..n.."):\n\t'"..line.."'\n"); + print("Malformed line ("..n.."):\n\t'"..line.."'"); status = false; end end @@ -261,7 +261,7 @@ function config.loadkernel() if res ~= nil then return true; else - print("Failed to load kernel '"..res.."'\n"); + print("Failed to load kernel '"..res.."'"); return false; end else @@ -290,7 +290,7 @@ function config.loadkernel() if res ~= nil then return true; else - print("Failed to load kernel '"..res.."'\n"); + print("Failed to load kernel '"..res.."'"); return false; end end @@ -302,24 +302,24 @@ function config.load(file) if not file then file = "/boot/defaults/loader.conf"; end if not config.parse(file) then - print("Failed to parse configuration: '"..file.."'\n"); + print("Failed to parse configuration: '"..file.."'"); end local f = loader.getenv("loader_conf_files"); if f ~= nil then for name in string.gmatch(f, "([%w%p]+)%s*") do if not config.parse(name) then - print("Failed to parse configuration: '"..name.."'\n"); + print("Failed to parse configuration: '"..name.."'"); end end end - print("Loading kernel...\n"); + print("Loading kernel..."); config.loadkernel(); - print("Loading configurations...\n"); + print("Loading configurations..."); if not config.loadmod(modules) then - print("Could not load configurations!\n"); + print("Could not load configurations!"); end end @@ -327,7 +327,7 @@ function config.reload(kernel) local res = 1; -- unload all modules - print("Unloading modules...\n"); + print("Unloading modules..."); loader.perform("unload"); if kernel ~= nil then @@ -338,7 +338,7 @@ function config.reload(kernel) -- failed to load kernel or it is nil -- then load default if res == 1 then - print("Loading default kernel...\n"); + print("Loading default kernel..."); config.loadkernel(); end Modified: projects/lua-bootloader/sys/boot/lua/menu.lua ============================================================================== --- projects/lua-bootloader/sys/boot/lua/menu.lua Tue Apr 7 23:09:34 2015 (r281239) +++ projects/lua-bootloader/sys/boot/lua/menu.lua Tue Apr 7 23:31:49 2015 (r281240) @@ -91,7 +91,7 @@ function menu.run(opts) if (opts[ch] ~= nil) then local ret = opts[ch].func(); if (ret) then - print("Exiting menu!\n"); + print("Exiting menu!"); return; end else @@ -100,7 +100,7 @@ function menu.run(opts) if opts.alias[ch] ~= nil then local ret = opts.alias[ch].func(); if (ret) then - print("Exiting menu!\n"); + print("Exiting menu!"); return; end end