Skip to content

Commit

Permalink
Auto-correct ChefStyle offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
schisamo committed May 20, 2016
1 parent 4b4a749 commit c47c820
Show file tree
Hide file tree
Showing 50 changed files with 199 additions and 212 deletions.
8 changes: 4 additions & 4 deletions Gemfile
@@ -1,8 +1,8 @@
source 'https://rubygems.org'
source "https://rubygems.org"
gemspec

group :development, :test do
gem 'omnibus', github: 'opscode/omnibus'
gem 'highline'
gem 'rake'
gem "omnibus", github: "opscode/omnibus"
gem "highline"
gem "rake"
end
8 changes: 4 additions & 4 deletions Rakefile
@@ -1,5 +1,5 @@
require 'bundler/gem_tasks'
require 'omnibus-software'
require "bundler/gem_tasks"
require "omnibus-software"

task :test do
OmnibusSoftware.verify!
Expand Down Expand Up @@ -36,7 +36,7 @@ RuboCop::RakeTask.new(:chefstyle) do |task|
end

namespace :travis do
task ci: ['chefstyle', 'test']
task ci: %w{chefstyle test}
end

task default: ['travis:ci']
task default: ["travis:ci"]
2 changes: 1 addition & 1 deletion config/software/autoconf.rb
Expand Up @@ -38,7 +38,7 @@
env = with_standard_compiler_flags(with_embedded_path)

if solaris2?
env['M4'] = "#{install_dir}/embedded/bin/m4"
env["M4"] = "#{install_dir}/embedded/bin/m4"
end

command "./configure" \
Expand Down
4 changes: 2 additions & 2 deletions config/software/berkshelf2.rb
Expand Up @@ -14,8 +14,8 @@
# limitations under the License.
#

Omnibus.logger.deprecated('berkshelf2') do
'Please upgrade to Berkshelf 3. Continued use of Berkshelf 2 will not be supported in the future.'
Omnibus.logger.deprecated("berkshelf2") do
"Please upgrade to Berkshelf 3. Continued use of Berkshelf 2 will not be supported in the future."
end

name "berkshelf2"
Expand Down
4 changes: 2 additions & 2 deletions config/software/bzip2.rb
Expand Up @@ -42,8 +42,8 @@
# The list of arguments to pass to make
args = "PREFIX='#{install_dir}/embedded' VERSION='#{version}'"

patch source: 'makefile_take_env_vars.patch', env: env
patch source: 'soname_install_dir.patch', env: env if mac_os_x?
patch source: "makefile_take_env_vars.patch", env: env
patch source: "soname_install_dir.patch", env: env if mac_os_x?

make "#{args}", env: env
make "#{args} -f Makefile-libbz2_so", env: env
Expand Down
1 change: 0 additions & 1 deletion config/software/chef-provisioning-fog.rb
Expand Up @@ -25,7 +25,6 @@
dependency "bundler"
dependency "chef"


build do
env = with_standard_compiler_flags(with_embedded_path)

Expand Down
10 changes: 5 additions & 5 deletions config/software/chef.rb
Expand Up @@ -55,7 +55,7 @@
# compiled ruby on windows 2k8R2 x86 is having issude compiling
# native extensions for pry-byebug so excluding for now
excluded_groups = %w{server docgen maintenance pry travis}
excluded_groups << 'ruby_prof' if aix?
excluded_groups << "ruby_prof" if aix?

# install the whole bundle first
bundle "install --without #{excluded_groups.join(' ')}", env: env
Expand All @@ -64,7 +64,7 @@
# 'chef-config'
bundle "exec rake install_components", env: env

gemspec_name = windows? ? 'chef-windows.gemspec' : 'chef.gemspec'
gemspec_name = windows? ? "chef-windows.gemspec" : "chef.gemspec"

# This step will build native components as needed - the event log dll is
# generated as part of this step. This is why we need devkit.
Expand All @@ -80,15 +80,15 @@
end

auxiliary_gems = {}
auxiliary_gems['ruby-shadow'] = '>= 0.0.0' unless aix? || windows?
auxiliary_gems["ruby-shadow"] = ">= 0.0.0" unless aix? || windows?

auxiliary_gems.each do |name, version|
gem "install #{name} --version '#{version}' --no-ri --no-rdoc --verbose",
env: env
end

appbundle 'chef'
appbundle 'ohai'
appbundle "chef"
appbundle "ohai"

# Clean up
# TODO: Move this cleanup to a more appropriate place that's common to all
Expand Down
4 changes: 2 additions & 2 deletions config/software/clean-static-libs.rb
Expand Up @@ -16,7 +16,7 @@

name "clean-static-libs"
description "cleanup un-needed static libraries from the build"
default_version '1.0.0'
default_version "1.0.0"

license :project_license

Expand All @@ -26,7 +26,7 @@
unless aix?
block "Remove static libraries" do
# find the embedded ruby gems dir and clean it up for globbing
target_dir = "#{install_dir}/embedded/lib/ruby/gems".gsub(/\\/, '/')
target_dir = "#{install_dir}/embedded/lib/ruby/gems".tr('\\', "/")

# find all the static *.a files and delete them
Dir.glob("#{target_dir}/**/*.a").each do |f|
Expand Down
8 changes: 4 additions & 4 deletions config/software/delivery-cli.rb
Expand Up @@ -30,14 +30,14 @@

# The rust core libraries are dynamicaly linked
if linux?
env['LD_LIBRARY_PATH'] = "#{install_dir}/embedded/lib"
env["LD_LIBRARY_PATH"] = "#{install_dir}/embedded/lib"
elsif mac_os_x?
env['DYLD_FALLBACK_LIBRARY_PATH'] = "#{install_dir}/embedded/lib:"
env["DYLD_FALLBACK_LIBRARY_PATH"] = "#{install_dir}/embedded/lib:"
end

# pass version info into the build
env['DELIV_CLI_VERSION'] = version
env['DELIV_CLI_GIT_SHA'] = Omnibus::Fetcher.resolve_version(version, source)
env["DELIV_CLI_VERSION"] = version
env["DELIV_CLI_GIT_SHA"] = Omnibus::Fetcher.resolve_version(version, source)

if windows?
copy "#{install_dir}/embedded/bin/ssleay32.dll", "#{install_dir}/embedded/bin/libssl32.dll"
Expand Down
48 changes: 24 additions & 24 deletions config/software/erlang.rb
Expand Up @@ -42,41 +42,41 @@
relative_path "otp_src_#{version}"
end

version '17.0' do
source md5: 'a5f78c1cf0eb7724de3a59babc1a28e5'
relative_path 'otp_src_17.0'
version "17.0" do
source md5: "a5f78c1cf0eb7724de3a59babc1a28e5"
relative_path "otp_src_17.0"
end

version '17.1' do
source md5: '9c90706ce70e01651adde34a2b79bf4c'
relative_path 'otp_src_17.1'
version "17.1" do
source md5: "9c90706ce70e01651adde34a2b79bf4c"
relative_path "otp_src_17.1"
end

version '17.3' do
source md5: '1d0bb2d54dfe1bb6844756b99902ba20'
relative_path 'otp_src_17.3'
version "17.3" do
source md5: "1d0bb2d54dfe1bb6844756b99902ba20"
relative_path "otp_src_17.3"
end

version '17.4' do
source md5: '3d33c4c6bd7950240dcd7479edd9c7d8'
relative_path 'otp_src_17.4'
version "17.4" do
source md5: "3d33c4c6bd7950240dcd7479edd9c7d8"
relative_path "otp_src_17.4"
end

version '17.5' do
source md5: '346dd0136bf1cc28cebc140e505206bb'
relative_path 'otp_src_17.5'
version "17.5" do
source md5: "346dd0136bf1cc28cebc140e505206bb"
relative_path "otp_src_17.5"
end

version '18.1' do
source md5: 'fa64015fdd133e155b5b19bf90ac8678'
relative_path 'otp_src_18.1'
version "18.1" do
source md5: "fa64015fdd133e155b5b19bf90ac8678"
relative_path "otp_src_18.1"
license "Apache-2.0"
license_file "LICENSE.txt"
end

version '18.2' do
source md5: 'b336d2a8ccfbe60266f71d102e99f7ed'
relative_path 'otp_src_18.2'
version "18.2" do
source md5: "b336d2a8ccfbe60266f71d102e99f7ed"
relative_path "otp_src_18.2"
license "Apache-2.0"
license_file "LICENSE.txt"
end
Expand All @@ -85,9 +85,9 @@
env = with_standard_compiler_flags(with_embedded_path).merge(
# WARNING!
"CFLAGS" => "-L#{install_dir}/embedded/lib -I#{install_dir}/embedded/erlang/include",
"LDFLAGS" => "-Wl,-rpath #{install_dir}/embedded/lib -L#{install_dir}/embedded/lib -I#{install_dir}/embedded/erlang/include",
"LDFLAGS" => "-Wl,-rpath #{install_dir}/embedded/lib -L#{install_dir}/embedded/lib -I#{install_dir}/embedded/erlang/include"
)
env.delete('CPPFLAGS')
env.delete("CPPFLAGS")

update_config_guess(target: "erts/autoconf")
update_config_guess(target: "lib/common_test/priv/auxdir")
Expand All @@ -104,7 +104,7 @@
#
# In future releases of erlang, someone should check if these flags (or
# environment variables) are avaiable to remove this ugly hack.
%w(ncurses openssl zlib.h zconf.h).each do |name|
%w{ncurses openssl zlib.h zconf.h}.each do |name|
link "#{install_dir}/embedded/include/#{name}", "#{install_dir}/embedded/erlang/include/#{name}"
end

Expand Down
10 changes: 5 additions & 5 deletions config/software/figlet.rb
Expand Up @@ -25,14 +25,14 @@

build do
env = with_standard_compiler_flags(with_embedded_path)
env['DEFAULTFONTDIR'] = "#{install_dir}/share/figlet/fonts"
env['prefix'] = "#{install_dir}/embedded"
env["DEFAULTFONTDIR"] = "#{install_dir}/share/figlet/fonts"
env["prefix"] = "#{install_dir}/embedded"

if aix?
# give us /opt/freeware/bin/patch
env['PATH'] = "/opt/freeware/bin:#{env['PATH']}"
env['CC'] = 'cc_r -q64'
env['LD'] = 'cc_r -q64'
env["PATH"] = "/opt/freeware/bin:#{env['PATH']}"
env["CC"] = "cc_r -q64"
env["LD"] = "cc_r -q64"
patch source: "aix-figlet-cdefs.patch", plevel: 0, env: env
end

Expand Down
1 change: 0 additions & 1 deletion config/software/gcc.rb
Expand Up @@ -41,7 +41,6 @@
"--with-as=/usr/ccs/bin/as",
"--with-ld=/usr/ccs/bin/ld"]


command configure_command.join(" "), env: env
# gcc takes quite a long time to build (over 2 hours) so we're setting the mixlib shellout
# timeout to 4 hours. It's not great but it's required (on solaris at least, need to verify
Expand Down
2 changes: 1 addition & 1 deletion config/software/git-windows.rb
Expand Up @@ -21,7 +21,7 @@
# the license file does not ship in the portable git package so pull from the source repo
license_file "https://raw.githubusercontent.com/git-for-windows/git/master/LGPL-2.1"

arch_suffix = windows_arch_i386? ? '32' : '64'
arch_suffix = windows_arch_i386? ? "32" : "64"
source url: "https://github.com/git-for-windows/git/releases/download/v#{version}.windows.1/PortableGit-#{version}-#{arch_suffix}-bit.7z.exe"

if windows_arch_i386?
Expand Down
56 changes: 28 additions & 28 deletions config/software/git.rb
Expand Up @@ -73,10 +73,10 @@
# AIX needs /opt/freeware/bin only for patch
if aix?
patch_env = env.dup
patch_env['PATH'] = "/opt/freeware/bin:#{env['PATH']}"
patch_env["PATH"] = "/opt/freeware/bin:#{env['PATH']}"

# But only needs the below for 1.9.5
if version == '1.9.5'
if version == "1.9.5"
patch source: "aix-strcmp-in-dirc.patch", plevel: 1, env: patch_env
end
end
Expand All @@ -92,48 +92,48 @@
}

if freebsd?
config_hash['CHARSET_LIB'] = "-lcharset"
config_hash['FREAD_READS_DIRECTORIES'] = "UnfortunatelyYes"
config_hash['HAVE_CLOCK_GETTIME'] = "YesPlease"
config_hash['HAVE_CLOCK_MONOTONIC'] = "YesPlease"
config_hash['HAVE_GETDELIM'] = "YesPlease"
config_hash['HAVE_PATHS_H'] = "YesPlease"
config_hash['HAVE_STRINGS_H'] = "YesPlease"
config_hash['PTHREAD_LIBS'] = "-pthread"
config_hash['USE_ST_TIMESPEC'] = "YesPlease"
config_hash['HAVE_BSD_SYSCTL'] = "YesPlease"
config_hash['NO_R_TO_GCC_LINKER'] = "YesPlease"
config_hash["CHARSET_LIB"] = "-lcharset"
config_hash["FREAD_READS_DIRECTORIES"] = "UnfortunatelyYes"
config_hash["HAVE_CLOCK_GETTIME"] = "YesPlease"
config_hash["HAVE_CLOCK_MONOTONIC"] = "YesPlease"
config_hash["HAVE_GETDELIM"] = "YesPlease"
config_hash["HAVE_PATHS_H"] = "YesPlease"
config_hash["HAVE_STRINGS_H"] = "YesPlease"
config_hash["PTHREAD_LIBS"] = "-pthread"
config_hash["USE_ST_TIMESPEC"] = "YesPlease"
config_hash["HAVE_BSD_SYSCTL"] = "YesPlease"
config_hash["NO_R_TO_GCC_LINKER"] = "YesPlease"
elsif solaris?
env['CC'] = 'gcc'
env['SHELL_PATH'] = "#{install_dir}/embedded/bin/bash"
config_hash['NEEDS_SOCKET'] = "YesPlease"
config_hash['NO_R_TO_GCC_LINKER'] = "YesPlease"
env["CC"] = "gcc"
env["SHELL_PATH"] = "#{install_dir}/embedded/bin/bash"
config_hash["NEEDS_SOCKET"] = "YesPlease"
config_hash["NO_R_TO_GCC_LINKER"] = "YesPlease"
elsif aix?
env['CC'] = 'xlc_r'
env['INSTALL'] = '/opt/freeware/bin/install'
env["CC"] = "xlc_r"
env["INSTALL"] = "/opt/freeware/bin/install"
# xlc doesn't understand the '-Wl,-rpath' syntax at all so... we don't enable
# the NO_R_TO_GCC_LINKER flag. This means that it will try to use the
# old style -R for libraries and as a result, xlc will ignore it. In this case, we
# we want that to happen because we explicitly set the libpath with the correct
# command line argument in omnibus itself.
else
# Linux things!
config_hash['HAVE_PATHS_H'] = "YesPlease"
config_hash['NO_R_TO_GCC_LINKER'] = "YesPlease"
config_hash["HAVE_PATHS_H"] = "YesPlease"
config_hash["NO_R_TO_GCC_LINKER"] = "YesPlease"
end

erb source: "config.mak.erb",
dest: "#{project_dir}/config.mak",
mode: 0755,
vars: {
cc: env['CC'],
ld: env['LD'],
cflags: env['CFLAGS'],
cppflags: env['CPPFLAGS'],
install: env['INSTALL'],
cc: env["CC"],
ld: env["LD"],
cflags: env["CFLAGS"],
cppflags: env["CPPFLAGS"],
install: env["INSTALL"],
install_dir: install_dir,
ldflags: env['LDFLAGS'],
shell_path: env['SHELL_PATH'],
ldflags: env["LDFLAGS"],
shell_path: env["SHELL_PATH"],
config_hash: config_hash,
}

Expand Down
2 changes: 1 addition & 1 deletion config/software/gmp.rb
Expand Up @@ -33,7 +33,7 @@
env = with_standard_compiler_flags(with_embedded_path)

if solaris2?
env['ABI'] = "32"
env["ABI"] = "32"
end

configure_command = ["./configure",
Expand Down
2 changes: 1 addition & 1 deletion config/software/libarchive.rb
Expand Up @@ -24,7 +24,7 @@
license_file "COPYING"

source url: "http://www.libarchive.org/downloads/libarchive-#{version}.tar.gz",
md5: 'efad5a503f66329bb9d2f4308b5de98a'
md5: "efad5a503f66329bb9d2f4308b5de98a"

relative_path "libarchive-#{version}"

Expand Down
2 changes: 1 addition & 1 deletion config/software/libffi.rb
Expand Up @@ -34,7 +34,7 @@
build do
env = with_standard_compiler_flags(with_embedded_path({}, msys: true))

env['INSTALL'] = "/opt/freeware/bin/install" if aix?
env["INSTALL"] = "/opt/freeware/bin/install" if aix?

configure_command = []

Expand Down

0 comments on commit c47c820

Please sign in to comment.