lib/getch/gentoo/config.rb in getch-0.1.1 vs lib/getch/gentoo/config.rb in getch-0.1.2

- old
+ new

@@ -9,37 +9,35 @@ @make = "#{MOUNTPOINT}/etc/portage/make.conf" @log = Getch::Log.new end def portage - nproc = `nproc`.chomp() grub_pc = Helpers::efi? ? '' : 'GRUB_PLATFORMS="pc"' - quiet = DEFAULT_OPTIONS[:verbose] ? '' : "EMERGE_DEFAULT_OPTS=\"--jobs=#{nproc} --load-average=#{nproc}\"" + nproc = `nproc`.chomp() # Add cpu name cpu=`chroot #{MOUNTPOINT} /bin/bash -c \"source /etc/profile ; gcc -c -Q -march=native --help=target | grep march\" | awk '{print $2}' | head -1`.chomp raise "Error, no cpu found" if ! cpu or cpu == "" @log.debug "CPU found ==> #{cpu}" tmp = Tempfile.new('make.conf') File.open(@make).each { |l| if l.match(/^COMMON_FLAGS/) - File.write(tmp, "COMMON_FLAGS=\"-march=#{cpu} -O2 -pipe\"\n", mode: 'a') + File.write(tmp, "COMMON_FLAGS=\"-march=#{cpu} -O2 -pipe -fomit-frame-pointer\"\n", mode: 'a') else File.write(tmp, l, mode: 'a') end } FileUtils.copy_file(tmp, @make, preserve = true) # Add the rest data = [ '', + "MAKEOPTS=\"-j#{nproc}\"", 'ACCEPT_KEYWORDS="amd64"', - "MAKEOPTS=\"-j#{nproc} -l#{nproc}\"", - quiet, 'INPUT_DEVICES="libinput"', grub_pc ] File.write(@make, data.join("\n"), mode: "a") end @@ -111,10 +109,10 @@ } raise ArgumentError, "No keymap #{@keymap} found" if ! @keymap end def search_zone(zone) - if ! File.exist?("#{MOUNTPOINT}/usr/share/zoneinfo/#{zone}") + if !File.exist?("#{MOUNTPOINT}/usr/share/zoneinfo/#{zone}") raise ArgumentError, "Zoneinfo #{zone} doesn\'t exist." end end def search_utf8(lang)