fpm 1.15.0 → 1.15.1

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: ea647fcf022326ec4218db722e99c134664446ef0f5ce1885a7440acb1bc6a85
4
- data.tar.gz: 8fa7b284c275629fac6d598211c2c54628c527435afbc835582279c760162786
3
+ metadata.gz: d2157b42ae94755f7521964dc3f92af2a535ee87506303aca5bb72222b48495b
4
+ data.tar.gz: 8772b7c1f612dfe8bd698b136418bda8c7b63d9243b1b253832917ad926cab7c
5
5
  SHA512:
6
- metadata.gz: a8f4c7e20bc10732d29febc59824562d2da5d1273d6ca96788d0e033b08b9b4dad1fac8281f8030f70a65dd465fbffc194448f13291cc51105172e35370c1800
7
- data.tar.gz: 4fcd3503b21ec04b1edb28ffca688898799d35f437cf097f4a3938adab78644bd0294bf9a4af327827bea63df04028150ada442727a0a41c005b59911c2d7a42
6
+ metadata.gz: 9cee7c2885fcf85d75cdc74b2e41399ddce10693fefc3c0b09c49e73b16fcd73140527d646ee5886ef231de7cb202a67f22130d01324d83923195833693f00e2
7
+ data.tar.gz: 18f5d405ecd21a0309abf1e08219b0b23aa60eb2e8e7e3f00d7c17ea31e5a3e7b4cbf3a9b9e5bbfb467111a4b8ea9424d61a0f0ff81c9179490e54b17cbfde29
data/CHANGELOG.rst CHANGED
@@ -1,6 +1,10 @@
1
1
  Release Notes and Change Log
2
2
  ============================
3
3
 
4
+ 1.15.1 (January 31, 2023)
5
+ ^^^^^^^^^^^^^^^^^^^^^^^^^
6
+ * Ruby 3.2.0 now supported. This fixes error 'undefined method exists? for File' '(`#1981`_, `#1988`_; Nicholas Hubbard, romulasry)
7
+
4
8
  1.15.0 (November 13, 2022)
5
9
  ^^^^^^^^^^^^^^^^^^^^^^^^^^
6
10
  * New flag ``--fpm-options-file path/to/file`` which allows you to specify additional fpm flags in an external file of your choosing. (`#1905`_, `#1902`_, `#1827`_; Jordan Sissel, Will Furnell, hjpotter92)
@@ -14,7 +18,6 @@ Release Notes and Change Log
14
18
  * python: Fix errors in how fpm invoked ``pip``. Previously, fpm would use pip's ``--build`` flag, but this was removed a while ago, and fpm is now aware! (`#1896`_, `#1831`_, `#1893`_, `#1916`_; Jordan Sissel, Svyatogor Chuykov)
15
19
  * pleaserun: Add ``--pleaserun-user`` flag. (`#1912`_; Evgeny Stambulchik)
16
20
  * deb: The default ``--deb-priority`` is now "optional" instead of "extra" (`#1913`_; Chris Novakovic)
17
- * https://github.com/jordansissel/fpm/pull/1897 (`#1897`_; Jordan Sissel)
18
21
  * Enable installation of fpm on older versions of ruby. This change removed ``git`` rubygem dependency. (`#1946`_, `#1923`_; Jordan Sissel, Andreas Wirooks, Ruslan Kuprieiev, jamshid, Lorenzo Castellino, Sam Hughes)
19
22
  * Enable operation of fpm on very old versions of ruby (as old as Ruby 1.9.3). This changed removed ``json`` rubygem dependency. (`#1950`_, `#1949`_, `#1741`_, `#1264`_, `#1798`_, `#1800`_, `#1784`_; Jordan Sissel and many others)
20
23
  * Fix bug where subprocesses could hang waiting for input (`#1955`_, `#1519`_, `#1522`_; Nicholas Hubbard, William N. Braswell, Jr.)
@@ -22,7 +25,7 @@ Release Notes and Change Log
22
25
  * internal: Fix a code typo (`#1948`_; Nicholas Hubbard)
23
26
  * internal tests: Support newer versions of lintian (`#1939`_, `#1907`_; Jordan Sissel)
24
27
  * Improve support for Ruby 3.1.0 and newer that would previously crash with an error mentioning Psych::DisallowedClass (`#1898`_, `#1895`_; Jordan Sissel, Alexandre ZANNI)
25
- * Improve support for Ruby 3.1.0 and newer that changed the API for ERB
28
+ * Improve support for Ruby 3.1.0 and newer that changed the API for ERB (`#1897`_; Jordan Sissel)
26
29
 
27
30
  1.14.2 (March 30, 2022)
28
31
  ^^^^^^^^^^^^^^^^^^^^^^^
data/lib/fpm/command.rb CHANGED
@@ -298,7 +298,7 @@ class FPM::Command < Clamp::Command
298
298
  args << "."
299
299
  end
300
300
 
301
- if !File.exists?(workdir)
301
+ if !File.exist?(workdir)
302
302
  logger.fatal("Given --workdir=#{workdir} is not a path that exists.")
303
303
  raise FPM::Package::InvalidArgument, "The given workdir '#{workdir}' does not exist."
304
304
  end
@@ -371,7 +371,7 @@ class FPM::Command < Clamp::Command
371
371
 
372
372
  # If --inputs was specified, read it as a file.
373
373
  if !inputs.nil?
374
- if !File.exists?(inputs)
374
+ if !File.exist?(inputs)
375
375
  logger.fatal("File given for --inputs does not exist (#{inputs})")
376
376
  return 1
377
377
  end
@@ -386,7 +386,7 @@ class FPM::Command < Clamp::Command
386
386
  # If --exclude-file was specified, read it as a file and append to
387
387
  # the exclude pattern list.
388
388
  if !exclude_file.nil?
389
- if !File.exists?(exclude_file)
389
+ if !File.exist?(exclude_file)
390
390
  logger.fatal("File given for --exclude-file does not exist (#{exclude_file})")
391
391
  return 1
392
392
  end
@@ -451,7 +451,7 @@ class FPM::Command < Clamp::Command
451
451
  # Skip scripts not set
452
452
  next if path.nil?
453
453
 
454
- if !File.exists?(path)
454
+ if !File.exist?(path)
455
455
  logger.error("No such file (for #{scriptname.to_s}): #{path.inspect}")
456
456
  script_errors << path
457
457
  end
@@ -43,7 +43,15 @@ class FPM::Package::Deb < FPM::Package
43
43
  # epoch - This is a single (generally small) unsigned integer
44
44
  # upstream_version - must contain only alphanumerics 6 and the characters . + - ~
45
45
  # debian_revision - only alphanumerics and the characters + . ~
46
- RELATIONSHIP_FIELD_PATTERN = /^(?<name>[A-z0-9][A-z0-9_.-]+)(?: *\((?<relation>[<>=]+) *(?<version>(?:[0-9]+:)?[0-9A-Za-z+~.-]+(?:-[0-9A-Za-z+~.]+)?)\))?$/
46
+ VERSION_FIELD_PATTERN = /
47
+ (?:(?:[0-9]+):)? # The epoch, an unsigned int
48
+ (?:[A-Za-z0-9+~.-]+) # upstream version, probably should not contain dashes?
49
+ (?:-[A-Za-z0-9+~.]+)? # debian_revision
50
+ /x # Version field pattern
51
+ RELATIONSHIP_FIELD_PATTERN = /^
52
+ (?<name>[A-z0-9][A-z0-9_.-]+)
53
+ (?:\s*\((?<relation>[<>=]+)\s(?<version>#{VERSION_FIELD_PATTERN})\))?
54
+ $/x # Relationship field pattern
47
55
 
48
56
  option "--ignore-iteration-in-dependencies", :flag,
49
57
  "For '=' (equal) dependencies, allow iterations on the specified " \
@@ -292,6 +300,21 @@ class FPM::Package::Deb < FPM::Package
292
300
  return (attributes[:prefix] or "/")
293
301
  end # def prefix
294
302
 
303
+ def version
304
+ if @version.kind_of?(String)
305
+ if @version.start_with?("v") && @version.gsub(/^v/, "") =~ /^#{VERSION_FIELD_PATTERN}$/
306
+ logger.warn("Debian 'Version' field needs to start with a digit. I was provided '#{@version}' which seems like it just has a 'v' prefix to an otherwise-valid Debian version, I'll remove the 'v' for you.")
307
+ @version = @version.gsub(/^v/, "")
308
+ end
309
+
310
+ if @version !~ /^#{VERSION_FIELD_PATTERN}$/
311
+ raise FPM::InvalidPackageConfiguration, "The version looks invalid for Debian packages. Debian version field must contain only alphanumerics and . (period), + (plus), - (hyphen) or ~ (tilde). I have '#{@version}' which which isn't valid."
312
+ end
313
+ end
314
+
315
+ return @version
316
+ end
317
+
295
318
  def input(input_path)
296
319
  extract_info(input_path)
297
320
  extract_files(input_path)
@@ -568,7 +591,7 @@ class FPM::Package::Deb < FPM::Package
568
591
  end # No need to close, GzipWriter#close will close it.
569
592
  end
570
593
 
571
- if File.exists?(dest_changelog) and not File.exists?(dest_upstream_changelog)
594
+ if File.exist?(dest_changelog) and not File.exist?(dest_upstream_changelog)
572
595
  # see https://www.debian.org/doc/debian-policy/ch-docs.html#s-changelogs
573
596
  File.rename(dest_changelog, dest_upstream_changelog)
574
597
  end
@@ -724,7 +747,7 @@ class FPM::Package::Deb < FPM::Package
724
747
 
725
748
  if origin == FPM::Package::Deb
726
749
  changelog_path = staging_path("usr/share/doc/#{name}/changelog.Debian.gz")
727
- if File.exists?(changelog_path)
750
+ if File.exist?(changelog_path)
728
751
  logger.debug("Found a deb changelog file, using it.", :path => changelog_path)
729
752
  attributes[:deb_changelog] = build_path("deb_changelog")
730
753
  File.open(attributes[:deb_changelog], "w") do |deb_changelog|
@@ -738,7 +761,7 @@ class FPM::Package::Deb < FPM::Package
738
761
 
739
762
  if origin == FPM::Package::Deb
740
763
  changelog_path = staging_path("usr/share/doc/#{name}/changelog.gz")
741
- if File.exists?(changelog_path)
764
+ if File.exist?(changelog_path)
742
765
  logger.debug("Found an upstream changelog file, using it.", :path => changelog_path)
743
766
  attributes[:deb_upstream_changelog] = build_path("deb_upstream_changelog")
744
767
  File.open(attributes[:deb_upstream_changelog], "w") do |deb_upstream_changelog|
@@ -1015,7 +1038,7 @@ class FPM::Package::Deb < FPM::Package
1015
1038
  etcfiles = []
1016
1039
  # Add everything in /etc
1017
1040
  begin
1018
- if !attributes[:deb_no_default_config_files?] && File.exists?(staging_path("/etc"))
1041
+ if !attributes[:deb_no_default_config_files?] && File.exist?(staging_path("/etc"))
1019
1042
  logger.warn("Debian packaging tools generally labels all files in /etc as config files, " \
1020
1043
  "as mandated by policy, so fpm defaults to this behavior for deb packages. " \
1021
1044
  "You can disable this default behavior with --deb-no-default-config-files flag")
@@ -1189,5 +1212,5 @@ class FPM::Package::Deb < FPM::Package
1189
1212
  return data_tar_flags
1190
1213
  end # def data_tar_flags
1191
1214
 
1192
- public(:input, :output, :architecture, :name, :prefix, :converted_from, :to_s, :data_tar_flags)
1215
+ public(:input, :output, :architecture, :name, :prefix, :version, :converted_from, :to_s, :data_tar_flags)
1193
1216
  end # class FPM::Target::Deb
@@ -43,7 +43,7 @@ class FPM::Package::Dir < FPM::Package
43
43
  # This mapping should work the same way 'rsync -a' does
44
44
  # Meaning 'rsync -a source dest'
45
45
  # and 'source=dest' in fpm work the same as the above rsync
46
- if path =~ /.=./ && !File.exists?(chdir == '.' ? path : File.join(chdir, path))
46
+ if path =~ /.=./ && !File.exist?(chdir == '.' ? path : File.join(chdir, path))
47
47
  origin, destination = path.split("=", 2)
48
48
 
49
49
  if File.directory?(origin) && origin[-1,1] == "/"
@@ -60,7 +60,7 @@ class FPM::Package::Puppet < FPM::Package
60
60
  end # case name
61
61
  end # self.scripts.each
62
62
 
63
- if File.exists?(params[:output])
63
+ if File.exist?(params[:output])
64
64
  # TODO(sissel): Allow folks to choose output?
65
65
  logger.error("Puppet module directory '#{params[:output]}' already " \
66
66
  "exists. Delete it or choose another output (-p flag)")
@@ -112,3 +112,4 @@ class get_metadata(Command):
112
112
  else:
113
113
  # For Python 2.5 and Debian's python-json
114
114
  output.write(json.write(data))
115
+ output.close()
@@ -259,7 +259,9 @@ class FPM::Package::Python < FPM::Package
259
259
  self.description = metadata["description"]
260
260
  # Sometimes the license field is multiple lines; do best-effort and just
261
261
  # use the first line.
262
- self.license = metadata["license"].split(/[\r\n]+/).first
262
+ if metadata["license"]
263
+ self.license = metadata["license"].split(/[\r\n]+/).first
264
+ end
263
265
  self.version = metadata["version"]
264
266
  self.url = metadata["url"]
265
267
 
data/lib/fpm/util.rb CHANGED
@@ -345,7 +345,7 @@ module FPM::Util
345
345
  when 'characterSpecial', 'blockSpecial'
346
346
  raise UnsupportedSpecialFile.new("File is device which fpm doesn't know how to copy (#{File.ftype(src)}): #{src}")
347
347
  when 'directory'
348
- FileUtils.mkdir(dst) unless File.exists? dst
348
+ FileUtils.mkdir(dst) unless File.exist? dst
349
349
  else
350
350
  # if the file with the same dev and inode has been copied already -
351
351
  # hard link it's copy to `dst`, otherwise make an actual copy
data/lib/fpm/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module FPM
2
- VERSION = "1.15.0"
2
+ VERSION = "1.15.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.0
4
+ version: 1.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Sissel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-14 00:00:00.000000000 Z
11
+ date: 2023-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cabin
@@ -254,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
254
254
  - !ruby/object:Gem::Version
255
255
  version: '0'
256
256
  requirements: []
257
- rubygems_version: 3.3.20
257
+ rubygems_version: 3.4.1
258
258
  signing_key:
259
259
  specification_version: 4
260
260
  summary: fpm - package building and mangling