fpm 1.10.2 → 1.15.0
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 +5 -5
- data/CHANGELOG.rst +101 -5
- data/CONTRIBUTORS +1 -0
- data/LICENSE +1 -1
- data/lib/fpm/command.rb +90 -0
- data/lib/fpm/package/apk.rb +1 -1
- data/lib/fpm/package/cpan.rb +2 -1
- data/lib/fpm/package/deb.rb +200 -27
- data/lib/fpm/package/dir.rb +3 -3
- data/lib/fpm/package/empty.rb +13 -1
- data/lib/fpm/package/freebsd.rb +13 -20
- data/lib/fpm/package/gem.rb +50 -14
- data/lib/fpm/package/osxpkg.rb +6 -1
- data/lib/fpm/package/pacman.rb +22 -10
- data/lib/fpm/package/pleaserun.rb +1 -0
- data/lib/fpm/package/pyfpm/get_metadata.py +5 -0
- data/lib/fpm/package/python.rb +54 -7
- data/lib/fpm/package/rpm.rb +56 -16
- data/lib/fpm/package/sh.rb +1 -1
- data/lib/fpm/package/snap.rb +130 -0
- data/lib/fpm/package/tar.rb +1 -1
- data/lib/fpm/package/virtualenv.rb +3 -2
- data/lib/fpm/package/zip.rb +1 -1
- data/lib/fpm/package.rb +5 -4
- data/lib/fpm/util/tar_writer.rb +1 -1
- data/lib/fpm/util.rb +59 -46
- data/lib/fpm/version.rb +1 -1
- data/lib/fpm.rb +1 -0
- data/templates/deb/changelog.erb +1 -1
- data/templates/deb/deb.changes.erb +2 -3
- data/templates/deb/postinst_upgrade.sh.erb +30 -8
- data/templates/deb/postrm_upgrade.sh.erb +5 -0
- data/templates/deb/preinst_upgrade.sh.erb +5 -0
- data/templates/deb/prerm_upgrade.sh.erb +12 -4
- data/templates/deb.erb +2 -2
- data/templates/rpm.erb +5 -5
- data/templates/sh.erb +6 -1
- metadata +30 -78
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ea647fcf022326ec4218db722e99c134664446ef0f5ce1885a7440acb1bc6a85
|
4
|
+
data.tar.gz: 8fa7b284c275629fac6d598211c2c54628c527435afbc835582279c760162786
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8f4c7e20bc10732d29febc59824562d2da5d1273d6ca96788d0e033b08b9b4dad1fac8281f8030f70a65dd465fbffc194448f13291cc51105172e35370c1800
|
7
|
+
data.tar.gz: 4fcd3503b21ec04b1edb28ffca688898799d35f437cf097f4a3938adab78644bd0294bf9a4af327827bea63df04028150ada442727a0a41c005b59911c2d7a42
|
data/CHANGELOG.rst
CHANGED
@@ -1,6 +1,101 @@
|
|
1
1
|
Release Notes and Change Log
|
2
2
|
============================
|
3
3
|
|
4
|
+
1.15.0 (November 13, 2022)
|
5
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
6
|
+
* 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)
|
7
|
+
* deb: Periods are now accepted in package names (`#1899`_; C. Cooke)
|
8
|
+
* Fix bug where fpm would crash if ``--workdir`` pointed at a path that didn't
|
9
|
+
exist. (`#1959`_; Jordan Sissel)
|
10
|
+
* osxpkg: this package format now supports the fpm ``--prefix`` flag(`#1909`_, `#1908`_; Jordan Sissel, mcataga)
|
11
|
+
* cpan: Fix bug where fpm would fail on certain Perl modules due to their source tarball structure (`#1940`_; Nicholas Hubbard, William N. Braswell, Jr.)
|
12
|
+
* cpan: Fix crash on certain CPAN modules where the author field was blank (`#1942`_, `#1937`_, `#1523`_, `#1528`_; Nicholas Hubbard, William N. Braswell, Jr.)
|
13
|
+
* deb: The distribution field of the debian changelog and changes files will now use the value set by ``--deb-dist`` (default is "unstable") (`#1934`_; Chabert Loïc)
|
14
|
+
* 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
|
+
* pleaserun: Add ``--pleaserun-user`` flag. (`#1912`_; Evgeny Stambulchik)
|
16
|
+
* 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
|
+
* 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
|
+
* 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
|
+
* Fix bug where subprocesses could hang waiting for input (`#1955`_, `#1519`_, `#1522`_; Nicholas Hubbard, William N. Braswell, Jr.)
|
21
|
+
* Update Dockerfile to use ubuntu:20.04 (`#1935`_; Gnought)
|
22
|
+
* internal: Fix a code typo (`#1948`_; Nicholas Hubbard)
|
23
|
+
* internal tests: Support newer versions of lintian (`#1939`_, `#1907`_; Jordan Sissel)
|
24
|
+
* 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
|
26
|
+
|
27
|
+
1.14.2 (March 30, 2022)
|
28
|
+
^^^^^^^^^^^^^^^^^^^^^^^
|
29
|
+
* deb: fix bug causing ``--deb-compression none`` to invoke ``tar`` incorrectly (`#1879`_; John Howard)
|
30
|
+
* rpm: Better support for paths that have spaces and mixed quotation marks in them. (`#1882`_, `#1886`_, `#1385`_; John Bollinger and Jordan Sissel)
|
31
|
+
* pacman: Fix typo preventing the use of ``--pacman-compression xz`` (`#1876`_; mszprejda)
|
32
|
+
* docs: All supported package types now have dedicated documentation pages. Some pages are small stubs and would benefit from future improvement. (`#1884`_; mcandre, Jordan Sissel)
|
33
|
+
* docs: Small but lovely documentation fixes (`#1875`_ by Corey Quinn, `#1864`_ by Geoff Beier)
|
34
|
+
* Fixed mistake causing the test suite to fail when ``rake`` wasn't available. (`#1877`_; Jordan Sissel)
|
35
|
+
|
36
|
+
1.14.1 (November 10, 2021)
|
37
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
38
|
+
* Fix a bug that impacted fpm api usage (from other ruby programs) that caused an error "NameError: uninitialized constant FPM::Package::CPAN" when trying to output a Deb package. (`#1854`_, `#1856`_; Karol Bucek, Jordan Sissel)
|
39
|
+
|
40
|
+
1.14.0 (November 9, 2021)
|
41
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^
|
42
|
+
* python: Use pip by default for fetching Python packages. This matches the Python 3 "installation" docs which recommend calling pip as ``python -m pip`` where ``python`` depends on ``--python-bin`` (default "python"). Previous default was to use `easy_install` which is no longer available on many newer systems. To use easy_install, you can set ``--no-python-internal-pip`` to revert this pip default. Further, you can specify your own pip path instead of using ``python -m pip`` with the ``--python-pip /path/to/pip`` flag. (`#1820`_, `#1821`_; Jordan Sissel)
|
43
|
+
* python: Support extras_require build markers in python packages (`#1307`_, `#1816`_; Joris Vandermeersch)
|
44
|
+
* freebsd: Fix bug which caused fpm to generate incorrect FreeBSD packages "missing leading `/`" (`#1811`_, `#1812`_, `#1844`_, `#1832`_, `#1845`_; Vlastimil Holer, Clayton Wong, Markus Ueberall, Jordan Sissel)
|
45
|
+
* deb: In order to only allow fpm to create valid packages, fpm now rejects packages with invalid "provides" (``--provides``) values. (`#1829`_, `#1825`_; Jordan Sissel, Peter Teichman)
|
46
|
+
* deb: Only show a warning about /etc and config files if there are files in /etc (`#1852`_, `#1851`_; Jordan Sissel)
|
47
|
+
|
48
|
+
* rpm: replace dash with underscore in rpm's "Release" field aka what fpm calls ``--iteration``. (`#1834`_, `#1833`_; Jordan Sissel)
|
49
|
+
* empty: `fpm -s empty ...` now defaults to "all" architecture instead of "native". (`#1850`_, `#1846`_; Jordan Sissel)
|
50
|
+
* Significant documentation improvements rewriting most of the documentation. New overview pages, full CLI flag listing, and new sections dedicated package types (rpm, cpan, deb, etc). (`#1815`_, `#1817`_, `#1838`_; Vedant K, Jordan Sissel)
|
51
|
+
* Typo fixes in documentation are always appreciated! (`#1842`_; Clayton Wong)
|
52
|
+
* fpm can now (we hope!) now be tested more easily from docker (`#1818`_, `#1682`_, `#1453`_; @directionless, Jordan Sissel, Douglas Muth)
|
53
|
+
|
54
|
+
1.13.1 (July 6, 2021)
|
55
|
+
^^^^^^^^^^^^^^^^^^^^^
|
56
|
+
* deb: The `--provides` flag now allows for versions. Previously, fpm would
|
57
|
+
remove the version part of a provides field when generating deb packages.
|
58
|
+
(`#1788`_, `#1803`_; Jordan Sissel, Phil Schwartz, tympanix)
|
59
|
+
* osxpkg: Update documentation to include installing `rpm` tools on OSX
|
60
|
+
(`#1797`_; allen joslin)
|
61
|
+
|
62
|
+
1.13.0 (June 19, 2021)
|
63
|
+
^^^^^^^^^^^^^^^^^^^^^^
|
64
|
+
* Apple M1 users should now work (`#1772`_, `#1785`_, `#1786`_; Jordan Sissel)
|
65
|
+
* Removed `ffi` ruby library as a dependency. This should make it easier to support a wider range of Ruby versions (Ruby 2.2, 3.0, etc) and platforms (like arm64, Apple M1, etc) in the future. (`#1785`_, `#1786`_; Jordan Sissel)
|
66
|
+
* Now uses the correct architecture synonym for ARM 64 systems. Debian uses `arm64` as a synonym for what other systems call `aarch64` (linux kernel, RPM, Arch Linux). (`#1775`_; Steve Kamerman)
|
67
|
+
* Docs: Fix a typo in an example (`#1785`_; Zoe O'Connell)
|
68
|
+
* rpm: File paths can now contain single-quote characters (`#1774`_; Jordan Sissel)
|
69
|
+
* rpm: Use correct SPEC syntax when using --after-upgrade or similar features (`#1761`_; Jo Vandeginste. Robert Fielding)
|
70
|
+
* Ruby 3.0 support: Added `rexml` as a runtime dependency. In Ruby 2.0, `rexml` came by default, but in Ruby 3.0, `rexml` is now a bundled gem and some distributiosn do not include it by default. (`#1794`_; Jordan Sissel)
|
71
|
+
* Fix error "git: not found (Git::GitExecuteError)". Now loads `git` library only when using git features. (`#1753`_, `#1748`_, `#1751`_, `#1766`_; Jordan Sissel, Cameron Nemo, Jason Rogers, Luke Short)
|
72
|
+
* deb: Fix syntax error in `postinst` (`--after-install`) script. (`#1752`_, `#1749`_, `#1764`_; rmanus, Adam Mohammed, Elliot Murphy, kimw, Jordan Sissel)
|
73
|
+
* deb: --deb-compression now uses the same compression and file suffix on the control.tar file (`#1760`_; Philippe Poilbarbe)
|
74
|
+
|
75
|
+
|
76
|
+
1.12.0 (January 19, 2021)
|
77
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^
|
78
|
+
|
79
|
+
* Pin ffi dependency to ruby ffi 1.12.x to try keeping fpm compatible with older/abandoned rubies like 2.0 and 2.1. (`#1709`_; Matt Patterson)
|
80
|
+
* deb: New flag to add 'set -e' to all scripts. `--deb-maintainerscripts-force-errorchecks` which defaults to off. (`#1697`_; Andreas Ulm)
|
81
|
+
* deb: Fix bug when converting rubygems to debs where certain constraints like `~>1` would generate a deb dependency that couldn't be satisfied. (`#1699`_; Vlastimil Holer)
|
82
|
+
* deb: Fix error 'uninitialized constant FPM::Package::Deb::Zlib' (`#1739`_, `#1740`_; Federico Lancerin)
|
83
|
+
* python: Prepend to PYTHONPATH instead of replacing it. This should help on platforms that rely heavily on PYTHONPATH, such as NixOSX (`#1711`_, `#1710`_; anarg)
|
84
|
+
* python: Add `--python-trusted-host` flag which passes `--trusted-host` flag to `pip` (`#1737`_; Vladimir Ponarevsky)
|
85
|
+
* Documentation improvements (`#1724`_, `#1738`_, `#1667`_, `#1636`_)
|
86
|
+
* Dockerfile updated to Alpine 3.12 (`#1745`_; Cameron Nemo)
|
87
|
+
* Remove the 'backports' deprecation warning (`#1727`_; Jose Galvez)
|
88
|
+
* sh: Performance improvement when printing package metadata (`#1729`_; James Logsdon, Ed Healy)
|
89
|
+
* rpm: Add support for `xzmt` compression (multithreaded xz compressor) to help when creating very large packages (several gigabytes). (`#1447`_, `#1419`_; amnobc)
|
90
|
+
* rpm: Add `--rpm-macro-expansion` flag to enable macro expansion in scripts during rpmbuild. See https://rpm.org/user_doc/scriptlet_expansion.html for more details. (`#1642`_; juliantrzeciak)
|
91
|
+
* deb: use correct control.tar filename (`#1668`_; Mike Perham)
|
92
|
+
|
93
|
+
1.11.0 (January 30, 2019)
|
94
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^
|
95
|
+
|
96
|
+
* snap: Snap packages can now be created! (`#1490`_; kyrofa)
|
97
|
+
* Fix an installation problem where a dependency (childprocess) fails to install correctly. (#1592; Jordan Sissel)
|
98
|
+
|
4
99
|
1.10.2 (July 3, 2018)
|
5
100
|
^^^^^^^^^^^^^^^^^^^^^
|
6
101
|
|
@@ -13,7 +108,7 @@ Release Notes and Change Log
|
|
13
108
|
* cpan: Adds `--[no-]cpan-verbose` flag which, when set, runs `cpanm` with the `--verbose` flag (`#1511`_; William N. Braswell, Jr)
|
14
109
|
|
15
110
|
1.10.0 (May 21, 2018)
|
16
|
-
|
111
|
+
^^^^^^^^^^^^^^^^^^^^^
|
17
112
|
|
18
113
|
* Pin `ruby-xz` dependency to one which allows Ruby versions older than 2.3.0 (`#1494`_; Marat Sharafutdinov)
|
19
114
|
* Documentation improvements: `#1488`_; Arthur Burkart. `#1384`_; Justin Kolberg. `#1452`_; Anatoli Babenia.
|
@@ -25,6 +120,7 @@ Release Notes and Change Log
|
|
25
120
|
* rpm: fix shell function name `install` conflicting with `install` program. In
|
26
121
|
postinst (after-install), the function is now called `_install` to avoid
|
27
122
|
conflicting with `/usr/bin/install` (`#1434`_; Torsten Schmidt)
|
123
|
+
* rpm: Allow binary "arch dependent" files in noarch rpms (Jordan Sissel)
|
28
124
|
* - deb: --config-files ? (`#1440`_, `#1443`_; NoBodyCam)
|
29
125
|
* FPM source repo now contains a Brewfile for use with Homebrew.
|
30
126
|
* FPM source repo has a Dockerfile for invoking fpm with docker. (`#1484`_, ;Allan Lewis
|
@@ -40,7 +136,7 @@ Release Notes and Change Log
|
|
40
136
|
* rpm: Fix `--config-files` handling (`#1390`_, `#1391`_; Jordan Sissel)
|
41
137
|
|
42
138
|
1.9.1 (July 28, 2017) happy sysadmin day!
|
43
|
-
|
139
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
44
140
|
|
45
141
|
* Documentation improvements: `#1291`_; Pablo Castellano. `#1321`_; ge-fa. `#1309`_; jesusbagpuss. `#1349`_; Perry Stole. `#1352`_, Jordan Sissel. `#1384`_; Justin Kolberg.
|
46
142
|
* Testing improvements: `#1320`_; Rob Young. `#1266`_; Ryan Parman. `#1374`_; Thiago Figueiró.
|
@@ -69,9 +165,9 @@ Release Notes and Change Log
|
|
69
165
|
* Other: Remove unused archive-tar-minitar as a dependency of fpm (`#1355`_; Diego Martins)
|
70
166
|
* Other: Add stud as a runtime dependency (`#1354`_; Elan Ruusamäe)
|
71
167
|
|
72
|
-
.. _reproducible_builds
|
73
|
-
.. _path mapping
|
74
|
-
.. _Deterministic output
|
168
|
+
.. _reproducible_builds: https://reproducible-builds.org/
|
169
|
+
.. _path mapping: source/dir.html#path-mapping
|
170
|
+
.. _Deterministic output: source/gem.html
|
75
171
|
|
76
172
|
1.9.0 (July 28, 2017)
|
77
173
|
^^^^^^^^^^^^^^^^^^^^^
|
data/CONTRIBUTORS
CHANGED
@@ -21,6 +21,7 @@ sbuss
|
|
21
21
|
Brett Gailey (github: dnbert)
|
22
22
|
Daniel Haskin (github: djhaskin987)
|
23
23
|
Richard Grainger (github: liger1978)
|
24
|
+
seph (github: directionless)
|
24
25
|
|
25
26
|
If you have contributed (bug reports, feature requests, help in IRC, blog
|
26
27
|
posts, code, etc) and aren't listed here, please let me know if you wish to be
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
(This is an MIT-style license)
|
2
2
|
|
3
|
-
Copyright (c) 2011-
|
3
|
+
Copyright (c) 2011-2021 Jordan Sissel and contributors.
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/lib/fpm/command.rb
CHANGED
@@ -247,6 +247,13 @@ class FPM::Command < Clamp::Command
|
|
247
247
|
"See https://reproducible-builds.org/specs/source-date-epoch ",
|
248
248
|
:environment_variable => "SOURCE_DATE_EPOCH"
|
249
249
|
|
250
|
+
option "--fpm-options-file", "FPM_OPTIONS_FILE",
|
251
|
+
"A file that contains additional fpm options. Any fpm flag format is valid in this file. " \
|
252
|
+
"This can be useful on build servers where you want to use a common configuration or " \
|
253
|
+
"inject other parameters from a file instead of from a command-line flag.." do |path|
|
254
|
+
load_options(path)
|
255
|
+
end
|
256
|
+
|
250
257
|
parameter "[ARGS] ...",
|
251
258
|
"Inputs to the source package type. For the 'dir' type, this is the files" \
|
252
259
|
" and directories you want to include in the package. For others, like " \
|
@@ -291,6 +298,15 @@ class FPM::Command < Clamp::Command
|
|
291
298
|
args << "."
|
292
299
|
end
|
293
300
|
|
301
|
+
if !File.exists?(workdir)
|
302
|
+
logger.fatal("Given --workdir=#{workdir} is not a path that exists.")
|
303
|
+
raise FPM::Package::InvalidArgument, "The given workdir '#{workdir}' does not exist."
|
304
|
+
end
|
305
|
+
if !File.directory?(workdir)
|
306
|
+
logger.fatal("Given --workdir=#{workdir} must be a directory")
|
307
|
+
raise FPM::Package::InvalidArgument, "The given workdir '#{workdir}' must be a directory."
|
308
|
+
end
|
309
|
+
|
294
310
|
logger.info("Setting workdir", :workdir => workdir)
|
295
311
|
ENV["TMP"] = workdir
|
296
312
|
|
@@ -571,12 +587,86 @@ class FPM::Command < Clamp::Command
|
|
571
587
|
|
572
588
|
ARGV.unshift(*flags)
|
573
589
|
ARGV.push(*args)
|
590
|
+
|
574
591
|
super(run_args)
|
575
592
|
rescue FPM::Package::InvalidArgument => e
|
576
593
|
logger.error("Invalid package argument: #{e}")
|
577
594
|
return 1
|
578
595
|
end # def run
|
579
596
|
|
597
|
+
def load_options(path)
|
598
|
+
@loaded_files ||= []
|
599
|
+
|
600
|
+
if @loaded_files.include?(path)
|
601
|
+
#logger.error("Options file was already loaded once. Refusing to load a second time.", :path => path)
|
602
|
+
raise FPM::Package::InvalidArgument, "Options file already loaded once. Refusing to load a second time. Maybe a file tries to load itself? Path: #{path}"
|
603
|
+
end
|
604
|
+
|
605
|
+
if !File.exist?(path)
|
606
|
+
logger.fatal("Cannot load options from file because the file doesn't exist.", :path => path)
|
607
|
+
end
|
608
|
+
|
609
|
+
if !File.readable?(path)
|
610
|
+
logger.fatal("Cannot load options from file because the file isn't readable.", :path => path)
|
611
|
+
end
|
612
|
+
|
613
|
+
@loaded_files << path
|
614
|
+
|
615
|
+
logger.info("Loading flags from file", :path => path)
|
616
|
+
|
617
|
+
# Safety check, abort if the file is huge. Arbitrarily chosen limit is 100kb
|
618
|
+
stat = File.stat(path)
|
619
|
+
max = 100 * 1024
|
620
|
+
if stat.size > max
|
621
|
+
logger.fatal("Refusing to load options from file because the file seems pretty large.", :path => path, :size => stat.size)
|
622
|
+
raise FPM::Package::InvalidArgument, "Options file given to --fpm-options-file is seems too large. For safety, fpm is refusing to load this. Path: #{path} - Size: #{stat.size}, maximum allowed size #{max}."
|
623
|
+
end
|
624
|
+
|
625
|
+
File.read(path).split($/).each do |line|
|
626
|
+
logger.info("Processing flags from file", :path => path, :line => line)
|
627
|
+
# With apologies for this hack to mdub (Mike Williams, author of Clamp)...
|
628
|
+
# The following code will read a file and parse the file
|
629
|
+
# as flags as if they were in same argument position as the given --fpm-options-file option.
|
630
|
+
|
631
|
+
args = Shellwords.split(line)
|
632
|
+
while args.any?
|
633
|
+
arg = args.shift
|
634
|
+
|
635
|
+
# Lookup the Clamp option by its --flag-name or short name like -f
|
636
|
+
if arg =~ /^-/
|
637
|
+
# Single-letter options like -a or -z
|
638
|
+
if single_letter = arg.match(/^(-[A-Za-z0-9])(.*)$/)
|
639
|
+
option = self.class.find_option(single_letter.match(1))
|
640
|
+
arg, remainder = single_letter.match(1), single_letter.match(2)
|
641
|
+
if option.flag?
|
642
|
+
# Flags aka switches take no arguments, so we push the rest of the 'arg' entry back onto the args list
|
643
|
+
|
644
|
+
# For combined letter flags, like `-abc`, we want to consume the
|
645
|
+
# `-a` and then push `-bc` back to be processed.
|
646
|
+
# Only do this if there's more flags, like, not for `-a` but yes for `-abc`
|
647
|
+
args.unshift("-" + remainder) unless remainder.empty?
|
648
|
+
else
|
649
|
+
# Single letter options that take arguments, like `-ohello` same as `-o hello`
|
650
|
+
|
651
|
+
# For single letter flags with values, like `-ofilename` aka `-o filename`, push the remainder ("filename")
|
652
|
+
# back onto the args list so that it is consumed when we extract the flag value.
|
653
|
+
args.unshift(remainder) unless remainder.empty?
|
654
|
+
end
|
655
|
+
elsif arg.match(/^--/)
|
656
|
+
# Lookup the flag by its long --flag-name
|
657
|
+
option = self.class.find_option(arg)
|
658
|
+
end
|
659
|
+
end
|
660
|
+
|
661
|
+
# Extract the flag value, if any, from the remaining args list.
|
662
|
+
value = option.extract_value(arg, args)
|
663
|
+
|
664
|
+
# Process the flag into `self`
|
665
|
+
option.of(self).take(value)
|
666
|
+
end
|
667
|
+
end
|
668
|
+
end
|
669
|
+
|
580
670
|
# A simple flag validator
|
581
671
|
#
|
582
672
|
# The goal of this class is to ensure the flags and arguments given
|
data/lib/fpm/package/apk.rb
CHANGED
data/lib/fpm/package/cpan.rb
CHANGED
@@ -112,6 +112,7 @@ class FPM::Package::CPAN < FPM::Package
|
|
112
112
|
self.vendor = case metadata["author"]
|
113
113
|
when String; metadata["author"]
|
114
114
|
when Array; metadata["author"].join(", ")
|
115
|
+
when NilClass; "No Vendor Or Author Provided"
|
115
116
|
else
|
116
117
|
raise FPM::InvalidPackageConfiguration, "Unexpected CPAN 'author' field type: #{metadata["author"].class}. This is a bug."
|
117
118
|
end if metadata.include?("author")
|
@@ -304,7 +305,7 @@ class FPM::Package::CPAN < FPM::Package
|
|
304
305
|
directory = build_path("module")
|
305
306
|
::Dir.mkdir(directory)
|
306
307
|
args = [ "-C", directory, "-zxf", tarball,
|
307
|
-
|
308
|
+
%q{--transform=s,[./]*[^/]*/,,} ]
|
308
309
|
safesystem("tar", *args)
|
309
310
|
return directory
|
310
311
|
end
|