puppet-modulebuilder 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca2a1887e9b40f9439cdf6fb1335b5ce7978d1ab3c4d806fc90c7ec735949957
4
- data.tar.gz: 5961801ac2e64949b4367a8e7f3be1c0ef505008da5f30e0c80b4cc26ad60ff0
3
+ metadata.gz: caf535563497b6e0a7bd98c749821dd30c60e33174497449459c754fc8ebffd1
4
+ data.tar.gz: e72590d578145ced4d745cab78f32ea581208e537022b9d68ce6856bb3950664
5
5
  SHA512:
6
- metadata.gz: 7cbf20f57e42e53825e1afc3a9f20c7c5e3334c7e2e360ff26f08e6cd7600de89c5fda05769b2242ec080c1c7e0796e295a47828cefca0f47b68dcc9fb631eaf
7
- data.tar.gz: e78d9e044df24a6e87564173adfaa6f21d0cecff194440277657e5083a0edf67a6aad3924bb530f3a44018b1d7d77dbad449fbeb8f573d05f3855f602e841595
6
+ metadata.gz: 3d3d125ef17ee7c5598ead12a03c8cd210435d9dd11ee89289233f51ff2231d7dd46ddd2901f4301550a889eac540e8f8ece5ff43610a313f312b9563854261f
7
+ data.tar.gz: 16e26fef2258fbc132962aeb8bce6c0ede396fcd0d498778be63450e4df3b10ec9a2870e3043e8a11d2e16a1dcf42bd551dbd62e82d46ae7054f401f8178486f
@@ -0,0 +1,15 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ time: "13:00"
8
+ open-pull-requests-limit: 10
9
+ ignore:
10
+ - dependency-name: rake
11
+ versions:
12
+ - ">= 13.a, < 14"
13
+ - dependency-name: rubocop
14
+ versions:
15
+ - "> 0.68"
data/.travis.yml CHANGED
@@ -7,11 +7,5 @@ env:
7
7
  jobs:
8
8
  include:
9
9
  - rvm: 2.7
10
- - rvm: 2.5.7
11
- before_install: gem install bundler -v 2.1.4
12
- - rvm: 2.4.9
13
- before_install: gem install bundler -v 2.1.4
14
- - rvm: 2.1.9
15
- script: "bundle exec rake spec # don't try to run rubocop on ancient ruby"
16
- env:
17
- - SIMPLECOV=no
10
+ - rvm: 2.5
11
+ - rvm: 2.4
data/CHANGELOG.md CHANGED
@@ -3,6 +3,23 @@
3
3
  All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).
4
4
 
5
5
 
6
+ ## [v0.3.0](https://github.com/puppetlabs/puppet-modulebuilder/tree/v0.3.0) (2021-05-17)
7
+
8
+ [Full Changelog](https://github.com/puppetlabs/puppet-modulebuilder/compare/v0.2.1...v0.3.0)
9
+
10
+ **Implemented enhancements:**
11
+
12
+ - Refresh dependency matrix; drop ruby 2.3 and earlier [\#35](https://github.com/puppetlabs/puppet-modulebuilder/pull/35) ([DavidS](https://github.com/DavidS))
13
+ - Use Puppet 7 in development on Ruby 2.7+ [\#32](https://github.com/puppetlabs/puppet-modulebuilder/pull/32) ([ekohl](https://github.com/ekohl))
14
+ - Add a setter for release\_name [\#31](https://github.com/puppetlabs/puppet-modulebuilder/pull/31) ([ekohl](https://github.com/ekohl))
15
+ - Preserve directory mtimes [\#27](https://github.com/puppetlabs/puppet-modulebuilder/pull/27) ([ekohl](https://github.com/ekohl))
16
+ - Use match\_path instead of match\_paths [\#26](https://github.com/puppetlabs/puppet-modulebuilder/pull/26) ([ekohl](https://github.com/ekohl))
17
+
18
+ **Fixed bugs:**
19
+
20
+ - Use correct source variable when warning about symlinks [\#36](https://github.com/puppetlabs/puppet-modulebuilder/pull/36) ([DavidS](https://github.com/DavidS))
21
+ - Ignore all hidden files in the root dir [\#29](https://github.com/puppetlabs/puppet-modulebuilder/pull/29) ([ekohl](https://github.com/ekohl))
22
+
6
23
  ## [v0.2.1](https://github.com/puppetlabs/puppet-modulebuilder/tree/v0.2.1) (2020-06-08)
7
24
 
8
25
  [Full Changelog](https://github.com/puppetlabs/puppet-modulebuilder/compare/v0.2.0...v0.2.1)
data/Gemfile CHANGED
@@ -6,25 +6,28 @@ source 'https://rubygems.org'
6
6
  gemspec
7
7
 
8
8
  group :development do
9
+ ruby_version = Gem::Version.new(RUBY_VERSION)
10
+
9
11
  gem 'rake', '~> 12.0'
10
12
  gem 'rspec', '~> 3.0'
11
- if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')
12
- gem 'rubocop', ['~> 0.68', '< 0.82.0']
13
- gem 'rubocop-rspec', '~> 1.38'
14
-
15
- gem 'codecov', '~> 0.1'
16
- gem 'github_changelog_generator', '~> 1.15', require: false
17
- gem 'simplecov', '~> 0.18'
18
- gem 'simplecov-console', '~> 0.6'
19
- end
20
13
 
21
- if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.5.0')
22
- gem 'puppet', '~> 6.0'
23
- elsif Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.4.0')
24
- gem 'puppet', '~> 5.0' # rubocop:disable Bundler/DuplicatedGem Nope, not a duplicate!
25
- else
26
- gem 'puppet', '~> 4.0' # rubocop:disable Bundler/DuplicatedGem Nope, not a duplicate!
27
- end
14
+ gem 'rubocop', ['~> 0.68', '< 0.82.0']
15
+ gem 'rubocop-rspec', '~> 1.38'
16
+
17
+ gem 'codecov', '~> 0.1'
18
+ gem 'github_changelog_generator', '~> 1.15', require: false
19
+ gem 'simplecov', '~> 0.18'
20
+ gem 'simplecov-console', '~> 0.6'
21
+
22
+ puppet_version = if ruby_version >= Gem::Version.new('2.7.0')
23
+ '~> 7.0'
24
+ elsif ruby_version >= Gem::Version.new('2.5.0')
25
+ '~> 6.0'
26
+ else
27
+ '~> 5.0'
28
+ end
29
+
30
+ gem 'puppet', puppet_version
28
31
  end
29
32
 
30
33
  # Evaluate Gemfile.local and ~/.gemfile if they exist
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Build Status](https://travis-ci.com/puppetlabs/puppet-modulebuilder.svg?branch=master)](https://travis-ci.com/puppetlabs/puppet-modulebuilder) [![Build status](https://ci.appveyor.com/api/projects/status/j9tosvq4a09iw0bx/branch/master?svg=true)](https://ci.appveyor.com/project/puppetlabs/puppet-modulebuilder/branch/master)
1
+ [![Build Status](https://travis-ci.com/puppetlabs/puppet-modulebuilder.svg?branch=main)](https://travis-ci.com/puppetlabs/puppet-modulebuilder) [![Build status](https://ci.appveyor.com/api/projects/status/j9tosvq4a09iw0bx/branch/main?svg=true)](https://ci.appveyor.com/project/puppetlabs/puppet-modulebuilder/branch/main)
2
2
 
3
3
  # Puppet::Modulebuilder
4
4
 
data/appveyor.yml CHANGED
@@ -1,6 +1,11 @@
1
1
  ---
2
+ environment:
3
+ matrix:
4
+ - RUBY_VERSION: 25-x64
5
+ - RUBY_VERSION: 24-x64
6
+
2
7
  install:
3
- - set PATH=C:\Ruby25-x64\bin;%PATH%
8
+ - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
4
9
  - set SIMPLECOV=yes
5
10
  - gem install bundler -v 2.1.4
6
11
  - bundle -v
@@ -10,7 +15,7 @@ build: off
10
15
 
11
16
  branches:
12
17
  only:
13
- - master
18
+ - main
14
19
 
15
20
  before_test:
16
21
  - bundle env
@@ -22,4 +27,4 @@ test_script:
22
27
  # Uncomment this block to enable RDP access to the AppVeyor test instance for
23
28
  # debugging purposes.
24
29
  # on_finish:
25
- # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
30
+ # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
@@ -6,7 +6,7 @@ module Puppet::Modulebuilder
6
6
  # Class to build Puppet Modules from source
7
7
  class Builder
8
8
  DEFAULT_IGNORED = [
9
- '/.git',
9
+ '/.*',
10
10
  '/pkg/',
11
11
  '~*',
12
12
  '/coverage',
@@ -53,7 +53,9 @@ module Puppet::Modulebuilder
53
53
  end
54
54
 
55
55
  # Return the path to the temporary build directory, which will be placed
56
- # inside the target directory and match the release name (see #release_name).
56
+ # inside the target directory and match the release name
57
+ #
58
+ # @see #release_name
57
59
  def build_dir
58
60
  @build_dir ||= File.join(build_context[:parent_dir], build_context[:build_dir_name])
59
61
  end
@@ -72,7 +74,9 @@ module Puppet::Modulebuilder
72
74
  def stage_module_in_build_dir
73
75
  require 'find'
74
76
 
75
- Find.find(source) do |path|
77
+ directories = [source]
78
+
79
+ staged = Find.find(source) do |path|
76
80
  next if path == source
77
81
 
78
82
  if ignored_path?(path)
@@ -80,9 +84,18 @@ module Puppet::Modulebuilder
80
84
  Find.prune
81
85
  else
82
86
  logger.debug("Staging #{path} for the build")
87
+ directories << path if file_directory?(path)
83
88
  stage_path(path)
84
89
  end
85
90
  end
91
+
92
+ # Reset directory mtimes. This must happen after the files have been
93
+ # copied since that modifies a directory's mtime
94
+ directories.each do |directory|
95
+ copy_mtime(directory)
96
+ end
97
+
98
+ staged
86
99
  end
87
100
 
88
101
  # Stage a file or directory from the module into the build directory.
@@ -112,6 +125,17 @@ module Puppet::Modulebuilder
112
125
  end
113
126
  end
114
127
 
128
+ def copy_mtime(path)
129
+ require 'pathname'
130
+
131
+ relative_path = Pathname.new(path).relative_path_from(Pathname.new(source))
132
+ dest_path = File.join(build_dir, relative_path)
133
+
134
+ validate_path_encoding!(relative_path.to_path)
135
+
136
+ fileutils_touch(dest_path, mtime: file_stat(path).mtime)
137
+ end
138
+
115
139
  # Check if the given path matches one of the patterns listed in the
116
140
  # ignore file.
117
141
  #
@@ -121,7 +145,7 @@ module Puppet::Modulebuilder
121
145
  def ignored_path?(path)
122
146
  path = path.to_s + '/' if File.directory?(path)
123
147
 
124
- !ignored_files.match_paths([path], source).empty?
148
+ ignored_files.match_path(path, source)
125
149
  end
126
150
 
127
151
  # Warn the user about a symlink that would have been included in the
@@ -134,9 +158,9 @@ module Puppet::Modulebuilder
134
158
  require 'pathname'
135
159
 
136
160
  symlink_path = Pathname.new(path)
137
- module_path = Pathname.new(module_dir)
161
+ module_path = Pathname.new(source)
138
162
 
139
- logger.warn _('Symlinks in modules are not supported and will not be included in the package. Please investigate symlink %{from} -> %{to}.') % {
163
+ logger.warn 'Symlinks in modules are not supported and will not be included in the package. Please investigate symlink %{from} -> %{to}.' % {
140
164
  from: symlink_path.relative_path_from(module_path),
141
165
  to: symlink_path.realpath.relative_path_from(module_path),
142
166
  }
@@ -299,10 +323,14 @@ module Puppet::Modulebuilder
299
323
  file_exists?(package_file)
300
324
  end
301
325
 
302
- # Combine the module name and version into a Forge-compatible dash
303
- # separated string.
326
+ # The release name is used for the build directory and resulting package
327
+ # file.
328
+ #
329
+ # The default combines the module name and version into a Forge-compatible
330
+ # dash separated string. Unless you have an unusual use case this isn't set
331
+ # manually.
304
332
  #
305
- # @return [String] The module name and version, joined by a dash.
333
+ # @return [String]
306
334
  def release_name
307
335
  @release_name ||= [
308
336
  metadata['name'],
@@ -310,6 +338,8 @@ module Puppet::Modulebuilder
310
338
  ].join('-')
311
339
  end
312
340
 
341
+ attr_writer :release_name
342
+
313
343
  # Checks if the path length will fit into the POSIX.1-1998 (ustar) tar
314
344
  # header format.
315
345
  #
@@ -408,6 +438,10 @@ module Puppet::Modulebuilder
408
438
  FileUtils.mkdir_p(dir, **options)
409
439
  end
410
440
 
441
+ def fileutils_touch(list, **options)
442
+ FileUtils.touch(list, **options)
443
+ end
444
+
411
445
  def file_stat(*args)
412
446
  File.stat(*args)
413
447
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Puppet # rubocop:disable Style/ClassAndModuleChildren
4
4
  module Modulebuilder
5
- VERSION = '0.2.1'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
 
14
14
  spec.metadata['homepage_uri'] = spec.homepage
15
15
  spec.metadata['source_code_uri'] = 'https://github.com/puppetlabs/puppet-modulebuilder'
16
- spec.metadata['changelog_uri'] = 'https://github.com/puppetlabs/puppet-modulebuilder/blob/master/CHANGELOG.md'
16
+ spec.metadata['changelog_uri'] = 'https://github.com/puppetlabs/puppet-modulebuilder/blob/main/CHANGELOG.md'
17
17
 
18
18
  # Specify which files should be added to the gem when it is released.
19
19
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -24,6 +24,6 @@ Gem::Specification.new do |spec|
24
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
25
  spec.require_paths = ['lib']
26
26
  # minitar and pathspec is required for building Puppet modules
27
- spec.add_runtime_dependency 'minitar', '~> 0.6'
28
- spec.add_runtime_dependency 'pathspec', '~> 0.2.1'
27
+ spec.add_runtime_dependency 'minitar', '~> 0.9'
28
+ spec.add_runtime_dependency 'pathspec', '>= 0.2.1', '< 2.0.0'
29
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-modulebuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sheena
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-06-08 00:00:00.000000000 Z
12
+ date: 2021-05-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitar
@@ -17,28 +17,34 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '0.6'
20
+ version: '0.9'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '0.6'
27
+ version: '0.9'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: pathspec
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - "~>"
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: 0.2.1
35
+ - - "<"
36
+ - !ruby/object:Gem::Version
37
+ version: 2.0.0
35
38
  type: :runtime
36
39
  prerelease: false
37
40
  version_requirements: !ruby/object:Gem::Requirement
38
41
  requirements:
39
- - - "~>"
42
+ - - ">="
40
43
  - !ruby/object:Gem::Version
41
44
  version: 0.2.1
45
+ - - "<"
46
+ - !ruby/object:Gem::Version
47
+ version: 2.0.0
42
48
  description:
43
49
  email:
44
50
  - sheena@puppet.com
@@ -48,6 +54,7 @@ extensions: []
48
54
  extra_rdoc_files: []
49
55
  files:
50
56
  - ".github/CODEOWNERS"
57
+ - ".github/dependabot.yml"
51
58
  - ".gitignore"
52
59
  - ".rspec"
53
60
  - ".rubocop.yml"
@@ -68,7 +75,7 @@ licenses: []
68
75
  metadata:
69
76
  homepage_uri: https://github.com/puppetlabs/puppet-modulebuilder
70
77
  source_code_uri: https://github.com/puppetlabs/puppet-modulebuilder
71
- changelog_uri: https://github.com/puppetlabs/puppet-modulebuilder/blob/master/CHANGELOG.md
78
+ changelog_uri: https://github.com/puppetlabs/puppet-modulebuilder/blob/main/CHANGELOG.md
72
79
  post_install_message:
73
80
  rdoc_options: []
74
81
  require_paths:
@@ -84,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
91
  - !ruby/object:Gem::Version
85
92
  version: '0'
86
93
  requirements: []
87
- rubygems_version: 3.1.2
94
+ rubygems_version: 3.0.3
88
95
  signing_key:
89
96
  specification_version: 4
90
97
  summary: A gem to set up puppet-modulebuilder