Commit graph

12 commits

Author SHA1 Message Date
Adam Spiers
9ce10eb3b1 Remove dependencies on Hash::Merge and Clone::Choose
stow 2.3.0 added external runtime dependencies on Hash::Merge and
Clone::Choose. Historically stow hasn't had runtime dependencies other
than Perl itself, which is a useful property if you're managing the
installation of Perl using stow; the bootstrapping instructions in
stow's manual would need updating to describe how to install these two
modules (and any dependencies they have now or in the future) as well.

However, Hash::Merge is much more general than stow actually needs, so
replace the merge() call with a few lines of equivalent code -- this
avoids the external dependencies, and is clearer than the merge()
call.

Many thanks to Adam Sampson for this patch:

https://lists.gnu.org/archive/html/bug-stow/2019-06/msg00001.html
2019-06-29 13:42:19 +01:00
Adam Spiers
00c92076d9 Use Clone backend for Hash::Merge, not Storable
Need to avoid Storable backend, since it can't deal with regexps:

    https://rt.perl.org/Public/Bug/Display.html?id=50608

This should fix the Docker builds.
2019-06-28 21:20:45 +01:00
Adam Spiers
27796720d5 Upgrade to GPL v3 and add headers to files (#44)
Following advice from maintainers@gnu.org, bring Stow in line with
other GNU projects by upgrading it from GPL v2 to v3

  https://www.gnu.org/prep/maintain/html_node/Licensing-of-GNU-Packages.html#Licensing-of-GNU-Packages

as obtained in plain text and texinfo formats from

  https://www.gnu.org/licenses/

and adding appropriate headers:

  https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Code.html#License-Notices-for-Code

Fixes #44: https://github.com/aspiers/stow/issues/44
2019-06-27 20:37:40 +01:00
Charles LeDoux
4d1167ffd7 Parse cli and stowrc files separately
Why:

* We want to selectively apply expansion to:
    * Only options from stowrc files.
    * Only options that take a path.
* This requires ability to:
    * Differentiate cli options from stowrc options
    * Distinguish between individual stowrc options.

This change addresses the need by:

* Options from ARGV and stowrc files are separately parsed, resulting in
  two options hashes.
    * Creating an option hash from stowrc files allows modification of
      specific arguments without having to rely on something like regex
      parsing of the options.

* get_config_file_options modified to return options hash.
    * Uses the same parse_options function that parses ARGV

* Add Hash:Merge to dependencies in order to merge the two option
  hashes.

* process_options() merges the two option hashes.
    * Get option hash for ARGV
    * Get option hash from get_config_file_options().
    * Merge the two hashes with Hash::Merge.
    * Sanitation and checks are ran on the merged options.

* The options -S, -D, and -R are ignored in stowrc files.
    * Due to the way argument parsing happens, the effect of these
      actions is not carried from stowrc into parsing of cli options.
    * It doesn't seem to make sense to put these options in stowrc
      anyway.
2019-06-25 19:38:25 +01:00
Adam Spiers
f24de47b82 add IO::Scalar to build_requires 2015-11-13 12:05:42 +00:00
Adam Spiers
6e5331814d Fix some incorrect CPAN meta-data about the project. 2011-12-15 21:14:07 +00:00
Adam Spiers
1f35c6c94f Automate check for 'use lib' line in bin/stow. 2011-12-11 13:16:03 +00:00
Adam Spiers
d6d51a7883 chkstow was missing from Module::Build install. 2011-12-06 17:11:12 +00:00
Adam Spiers
51b1bd3958 File::Slurp is no longer used. 2011-12-06 17:11:12 +00:00
Adam Spiers
bbaace4d5a Fix automake issues (thanks to Stefano Lattarini for spotting these!) 2011-12-06 17:11:12 +00:00
Adam Spiers
59fa7ae4a6 Add build-time dependencies on Test::More and Test::Output. 2011-11-26 15:10:27 +00:00
Adam Spiers
58625800ee Reorganise more files into subdirectories and add CPAN support via Module::Build 2011-11-26 15:10:26 +00:00