simp-rake-helpers 2.4.6 → 2.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/CHANGELOG.md +4 -1
 - data/lib/simp/rake/build/deps.rb +7 -1
 - data/lib/simp/rake/helpers/rpm_spec.rb +28 -2
 - data/lib/simp/rake/helpers/version.rb +1 -1
 - data/lib/simp/rake/pkg.rb +17 -10
 - data/spec/lib/simp/rpm_spec.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: e3c3b2c1a47ba2ce959ba6e31716fd3dcc288dd3
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 8222f40ce96eab1ec4e4477f5d140de3cdb4cead
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: c5f7b59e386f9cead4d67a12a11d328079de00a2482ef0209dd83a1c1224327fa7a0e5c499512d56292e99f6e1fb5503e2a2fbdd5509cd85b875c80ca99b280b
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: a031834da602e106f958bd0724ea441ab8d29a87e8ba1b2fc7d50448e1226016b753136b24a34bd94a1fec7824f3fd7efb7ff804b66f9e953ba0ec745bd6431b
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,4 +1,7 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            ### 2.4. 
     | 
| 
      
 1 
     | 
    
         
            +
            ### 2.4.7 / 2016-08-14
         
     | 
| 
      
 2 
     | 
    
         
            +
            * Removed unecessary `deps:checkout` warnings from fresh (empty) checkouts
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            ### 2.4.6 / 2016-08-11
         
     | 
| 
       2 
5 
     | 
    
         
             
            * Fix a broken method call between `r10k` 2.4.0 and `R10KHelper.new()`
         
     | 
| 
       3 
6 
     | 
    
         
             
            * Add `:insync` status to acceptable module statuses for `deps:checkout`
         
     | 
| 
       4 
7 
     | 
    
         | 
    
        data/lib/simp/rake/build/deps.rb
    CHANGED
    
    | 
         @@ -201,7 +201,13 @@ module Simp::Rake::Build 
     | 
|
| 
       201 
201 
     | 
    
         
             
                        unless mod[:status] == :unknown
         
     | 
| 
       202 
202 
     | 
    
         
             
                          # Since r10k is destructive, we're enumerating all valid states
         
     | 
| 
       203 
203 
     | 
    
         
             
                          # here
         
     | 
| 
       204 
     | 
    
         
            -
                          if [ 
     | 
| 
      
 204 
     | 
    
         
            +
                          if [
         
     | 
| 
      
 205 
     | 
    
         
            +
                              :absent,
         
     | 
| 
      
 206 
     | 
    
         
            +
                              :mismatched,
         
     | 
| 
      
 207 
     | 
    
         
            +
                              :outdated,
         
     | 
| 
      
 208 
     | 
    
         
            +
                              :insync,
         
     | 
| 
      
 209 
     | 
    
         
            +
                              :dirty
         
     | 
| 
      
 210 
     | 
    
         
            +
                          ].include?(mod[:r10k_module].status)
         
     | 
| 
       205 
211 
     | 
    
         
             
                            unless mod[:r10k_cache].synced?
         
     | 
| 
       206 
212 
     | 
    
         
             
                              mod[:r10k_cache].sync
         
     | 
| 
       207 
213 
     | 
    
         
             
                            end
         
     | 
| 
         @@ -18,10 +18,18 @@ class Simp::Rake::Helpers 
     | 
|
| 
       18 
18 
     | 
    
         
             
            -- Example:
         
     | 
| 
       19 
19 
     | 
    
         
             
            --   rpmbuild -D 'pup_module_info_dir /home/user/project/puppet_module' -ba SPECS/specfile.spec
         
     | 
| 
       20 
20 
     | 
    
         
             
            --
         
     | 
| 
      
 21 
     | 
    
         
            +
            -- If this is not found, we will look in %{_sourcedir} for the files and fall
         
     | 
| 
      
 22 
     | 
    
         
            +
            -- back to the current directory
         
     | 
| 
      
 23 
     | 
    
         
            +
            --
         
     | 
| 
       21 
24 
     | 
    
         | 
| 
       22 
25 
     | 
    
         
             
            src_dir = rpm.expand('%{pup_module_info_dir}')
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
       23 
27 
     | 
    
         
             
            if string.match(src_dir, '^%%') or (posix.stat(src_dir, 'type') ~= 'directory') then
         
     | 
| 
       24 
     | 
    
         
            -
              src_dir = ' 
     | 
| 
      
 28 
     | 
    
         
            +
              src_dir = rpm.expand('%{_sourcedir}')
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
              if (posix.stat((src_dir .. "/metadata.json"), 'type') ~= 'regular') then
         
     | 
| 
      
 31 
     | 
    
         
            +
                src_dir = './'
         
     | 
| 
      
 32 
     | 
    
         
            +
              end
         
     | 
| 
       25 
33 
     | 
    
         
             
            end
         
     | 
| 
       26 
34 
     | 
    
         | 
| 
       27 
35 
     | 
    
         
             
            -- These UNKNOWN entries should break the build if something bad happens
         
     | 
| 
         @@ -30,8 +38,11 @@ package_name = "UNKNOWN" 
     | 
|
| 
       30 
38 
     | 
    
         
             
            package_version = "UNKNOWN"
         
     | 
| 
       31 
39 
     | 
    
         
             
            module_license = "UNKNOWN"
         
     | 
| 
       32 
40 
     | 
    
         | 
| 
      
 41 
     | 
    
         
            +
            --
         
     | 
| 
       33 
42 
     | 
    
         
             
            -- Default to 2016
         
     | 
| 
       34 
43 
     | 
    
         
             
            -- This was done due to the change in naming scheme across all of the modules.
         
     | 
| 
      
 44 
     | 
    
         
            +
            --
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
       35 
46 
     | 
    
         
             
            package_release = '2016'
         
     | 
| 
       36 
47 
     | 
    
         | 
| 
       37 
48 
     | 
    
         
             
            }
         
     | 
| 
         @@ -233,7 +244,22 @@ Version:   %{lua: print(package_version)} 
     | 
|
| 
       233 
244 
     | 
    
         
             
            Release:   %{lua: print(package_release)}
         
     | 
| 
       234 
245 
     | 
    
         
             
            License:   %{lua: print(module_license)}
         
     | 
| 
       235 
246 
     | 
    
         
             
            Group:     Applications/System
         
     | 
| 
       236 
     | 
    
         
            -
             
     | 
| 
      
 247 
     | 
    
         
            +
            Source0:    %{base_name}-%{version}-%{release}.tar.gz
         
     | 
| 
      
 248 
     | 
    
         
            +
            Source1:   %{lua: print("metadata.json")}
         
     | 
| 
      
 249 
     | 
    
         
            +
            %{lua:
         
     | 
| 
      
 250 
     | 
    
         
            +
              -- Include our sources as appropriate
         
     | 
| 
      
 251 
     | 
    
         
            +
              changelog = io.open(src_dir .. "/CHANGELOG","r")
         
     | 
| 
      
 252 
     | 
    
         
            +
              if changelog then
         
     | 
| 
      
 253 
     | 
    
         
            +
                print("Source2: " .. "CHANGELOG")
         
     | 
| 
      
 254 
     | 
    
         
            +
              end
         
     | 
| 
      
 255 
     | 
    
         
            +
             
     | 
| 
      
 256 
     | 
    
         
            +
              if rel_file then
         
     | 
| 
      
 257 
     | 
    
         
            +
                print("Source3: " .. "build/rpm_metadata/release")
         
     | 
| 
      
 258 
     | 
    
         
            +
              end
         
     | 
| 
      
 259 
     | 
    
         
            +
              if req_file then
         
     | 
| 
      
 260 
     | 
    
         
            +
                print("Source4: " .. "build/rpm_metadata/requires")
         
     | 
| 
      
 261 
     | 
    
         
            +
              end
         
     | 
| 
      
 262 
     | 
    
         
            +
            }
         
     | 
| 
       237 
263 
     | 
    
         
             
            URL:       %{lua: print(module_source)}
         
     | 
| 
       238 
264 
     | 
    
         
             
            BuildRoot: %{_tmppath}/%{base_name}-%{version}-%{release}-buildroot
         
     | 
| 
       239 
265 
     | 
    
         
             
            BuildArch: noarch
         
     | 
    
        data/lib/simp/rake/pkg.rb
    CHANGED
    
    | 
         @@ -58,9 +58,12 @@ module Simp::Rake 
     | 
|
| 
       58 
58 
     | 
    
         | 
| 
       59 
59 
     | 
    
         
             
                    @spec_tempfile = File.open(File.join(@pkg_tmp_dir, "#{@pkg_name}.spec"), 'w')
         
     | 
| 
       60 
60 
     | 
    
         
             
                    @spec_tempfile.write(Simp::Rake::Helpers::RPM_Spec.template)
         
     | 
| 
       61 
     | 
    
         
            -
                    @spec_tempfile.flush
         
     | 
| 
       62 
61 
     | 
    
         | 
| 
       63 
62 
     | 
    
         
             
                    @spec_file = @spec_tempfile.path
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
                    @spec_tempfile.flush
         
     | 
| 
      
 65 
     | 
    
         
            +
                    @spec_tempfile.close
         
     | 
| 
      
 66 
     | 
    
         
            +
             
     | 
| 
       64 
67 
     | 
    
         
             
                    FileUtils.chmod(0640, @spec_file)
         
     | 
| 
       65 
68 
     | 
    
         
             
                  end
         
     | 
| 
       66 
69 
     | 
    
         | 
| 
         @@ -105,7 +108,7 @@ module Simp::Rake 
     | 
|
| 
       105 
108 
     | 
    
         
             
                def initialize_spec_info(chroot, unique)
         
     | 
| 
       106 
109 
     | 
    
         
             
                  unless @spec_info
         
     | 
| 
       107 
110 
     | 
    
         
             
                    # This gets the resting spec file and allows us to pull out the name
         
     | 
| 
       108 
     | 
    
         
            -
                    @spec_info   = Simp::RPM.get_info( 
     | 
| 
      
 111 
     | 
    
         
            +
                    @spec_info   = Simp::RPM.get_info(@spec_file)
         
     | 
| 
       109 
112 
     | 
    
         
             
                    @spec_info_dir = @base_dir
         
     | 
| 
       110 
113 
     | 
    
         | 
| 
       111 
114 
     | 
    
         
             
                    if chroot
         
     | 
| 
         @@ -121,9 +124,8 @@ module Simp::Rake 
     | 
|
| 
       121 
124 
     | 
    
         
             
                      mock_cmd = "#{mock_cmd} -D 'pup_module_info_dir #{rand_tmpdir}'"
         
     | 
| 
       122 
125 
     | 
    
         | 
| 
       123 
126 
     | 
    
         
             
                      sh %Q(#{mock_cmd} --chroot 'mkdir -p #{rand_tmpdir}')
         
     | 
| 
       124 
     | 
    
         
            -
                      sh %Q(#{mock_cmd} --chroot 'sed -i /pup_module_info_dir/d ~/.rpmmacros')
         
     | 
| 
       125 
127 
     | 
    
         | 
| 
       126 
     | 
    
         
            -
                      @puppet_module_info_files 
     | 
| 
      
 128 
     | 
    
         
            +
                      @puppet_module_info_files.each do |copy_in|
         
     | 
| 
       127 
129 
     | 
    
         
             
                        if File.exist?(copy_in)
         
     | 
| 
       128 
130 
     | 
    
         
             
                          sh %Q(#{mock_cmd} --copyin #{copy_in} #{rand_tmpdir})
         
     | 
| 
       129 
131 
     | 
    
         
             
                        end
         
     | 
| 
         @@ -137,8 +139,6 @@ module Simp::Rake 
     | 
|
| 
       137 
139 
     | 
    
         
             
                      }
         
     | 
| 
       138 
140 
     | 
    
         | 
| 
       139 
141 
     | 
    
         
             
                      @spec_info = Simp::RPM.get_info(@spec_file, info_hash)
         
     | 
| 
       140 
     | 
    
         
            -
             
     | 
| 
       141 
     | 
    
         
            -
                      @spec_info_dir = rand_tmpdir
         
     | 
| 
       142 
142 
     | 
    
         
             
                    end
         
     | 
| 
       143 
143 
     | 
    
         | 
| 
       144 
144 
     | 
    
         
             
                    @dir_name       = "#{@spec_info[:name]}-#{@spec_info[:version]}"
         
     | 
| 
         @@ -264,8 +264,15 @@ module Simp::Rake 
     | 
|
| 
       264 
264 
     | 
    
         | 
| 
       265 
265 
     | 
    
         
             
                        srpms = Dir.glob(%(#{@pkg_dir}/#{@spec_info[:name]}#{suffix}-#{@spec_info[:version]}-#{@spec_info[:release]}#{l_date}.*.src.rpm))
         
     | 
| 
       266 
266 
     | 
    
         | 
| 
       267 
     | 
    
         
            -
                        if require_rebuild?(@tar_dest,srpms)
         
     | 
| 
       268 
     | 
    
         
            -
             
     | 
| 
      
 267 
     | 
    
         
            +
                        if require_rebuild?(@tar_dest,srpms) || require_rebuild?("#{@base_dir}/metadata.json")
         
     | 
| 
      
 268 
     | 
    
         
            +
             
     | 
| 
      
 269 
     | 
    
         
            +
                          @puppet_module_info_files.each do |file|
         
     | 
| 
      
 270 
     | 
    
         
            +
                            tgt_file = File.join(@pkg_dir, File.basename(file))
         
     | 
| 
      
 271 
     | 
    
         
            +
                            FileUtils.rm_rf(tgt_file) if File.exist?(tgt_file)
         
     | 
| 
      
 272 
     | 
    
         
            +
                            FileUtils.cp_r(file, @pkg_dir) if File.exist?(file)
         
     | 
| 
      
 273 
     | 
    
         
            +
                          end
         
     | 
| 
      
 274 
     | 
    
         
            +
             
     | 
| 
      
 275 
     | 
    
         
            +
                          cmd = %Q(#{mock_cmd} --root #{args.chroot} #{mocksnap} --buildsrpm --spec #{@spec_file} --sources #{@pkg_dir})
         
     | 
| 
       269 
276 
     | 
    
         
             
                          if suffix
         
     | 
| 
       270 
277 
     | 
    
         
             
                            cmd += %( -D "_variant #{variant}")
         
     | 
| 
       271 
278 
     | 
    
         
             
                          end
         
     | 
| 
         @@ -387,7 +394,6 @@ module Simp::Rake 
     | 
|
| 
       387 
394 
     | 
    
         
             
                  require_rebuild
         
     | 
| 
       388 
395 
     | 
    
         
             
                end
         
     | 
| 
       389 
396 
     | 
    
         | 
| 
       390 
     | 
    
         
            -
             
     | 
| 
       391 
397 
     | 
    
         
             
                # Run some pre-checks to make sure that mock will work properly.
         
     | 
| 
       392 
398 
     | 
    
         
             
                #
         
     | 
| 
       393 
399 
     | 
    
         
             
                # chroot   = name of mock chroot to use
         
     | 
| 
         @@ -418,7 +424,8 @@ module Simp::Rake 
     | 
|
| 
       418 
424 
     | 
    
         
             
                  # if true, restrict yum to the chroot's local yum cache (defaults to false)
         
     | 
| 
       419 
425 
     | 
    
         
             
                  mock_offline = ENV.fetch( 'SIMP_RAKE_MOCK_OFFLINE', 'N' ).chomp.index( %r{^(1|Y|true|yes)$} ) || false
         
     | 
| 
       420 
426 
     | 
    
         | 
| 
       421 
     | 
    
         
            -
                  mock_cmd =  "#{mock} -D 'pup_module_info_dir #{@spec_info_dir}' --quiet"
         
     | 
| 
      
 427 
     | 
    
         
            +
                  #mock_cmd =  "#{mock} -D 'pup_module_info_dir #{@spec_info_dir}' --quiet"
         
     | 
| 
      
 428 
     | 
    
         
            +
                  mock_cmd =  "#{mock} --quiet"
         
     | 
| 
       422 
429 
     | 
    
         
             
                  mock_cmd += " --uniqueext=#{unique_ext}" if unique
         
     | 
| 
       423 
430 
     | 
    
         
             
                  mock_cmd += ' --offline'                 if mock_offline
         
     | 
| 
       424 
431 
     | 
    
         | 
    
        data/spec/lib/simp/rpm_spec.rb
    CHANGED
    
    | 
         @@ -41,7 +41,7 @@ describe Simp::RPM do 
     | 
|
| 
       41 
41 
     | 
    
         
             
                  expect( info.fetch( :version ) ).to eq '1'
         
     | 
| 
       42 
42 
     | 
    
         
             
                end
         
     | 
| 
       43 
43 
     | 
    
         | 
| 
       44 
     | 
    
         
            -
                it "extracts  
     | 
| 
      
 44 
     | 
    
         
            +
                it "extracts correct information from the first entry from a multi-package .spec file" do
         
     | 
| 
       45 
45 
     | 
    
         
             
                  info = Simp::RPM.get_info(@m_spec_file)
         
     | 
| 
       46 
46 
     | 
    
         
             
                  expect( info.fetch( :name    ) ).to eq 'testpackage-multi-1'
         
     | 
| 
       47 
47 
     | 
    
         
             
                  expect( info.fetch( :version ) ).to eq '1'
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: simp-rake-helpers
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 2.4. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 2.4.7
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Chris Tessmer
         
     | 
| 
         @@ -9,7 +9,7 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2016-08- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2016-08-22 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: bundler
         
     |