Merge pull request #2633 from zaphod42/issue/master/pup-1597-contain-is-just-wrong

(PUP-1597) Fix contain functions lookup of class with leading ::
(PUP-2214) Fix spec failures under 1.8.7

Fixes some rdoc1 spec issues by providing explicit envs in the specs.
Merge pull request #2631 from hlindberg/pup-2214_change-env-lookup-to-current-env

(PUP-2214) change env lookup to current env
Merge branch 'stable'
Merge remote-tracking branch 'upstream/stable'

* upstream/stable:
  (PUP-2561) Fix spec test on windows
(PUP-1843) Restore hiera indirector terminus

This was collapsed into the DataBindings code in 9a5b81b412. That broke
community plugins using this code. This commit just restores the code
but doesn't revert the other changes from that commit.
Merge pull request #2563 from jasperla/openbsd/uninstall

(PUP-2311) OpenBSD uninstall broken when multiple uninstall_options give
Merge pull request #2606 from nfagerlund/docs_ssh_key_purge

(doc) Document key purging in the description of the ssh_authorized_key ...
Merge pull request #2615 from domcleal/tickets/master/pup-2458-inherit-providers

(PUP-2458) Tests for providers inheriting from providers of another type
(PUP-1027) Add warnings for bare words that will be keywords in 4.0

This adds a check for reserved words and makes the words:
private, function, type, and attr reserved.

These warnings are for the --parser current setting in 3x.
(PUP-1027) Change warning for reserved words to a deprecation warning
(PUP-2298) add resource lifecycle method Puppet::Type#pre_run_check

In order to deprecate the builtin defined function (which is often abused
to work around resource duplication among modules) it is desirable to
add resource constraints to the language. An easy approach to allowing such
constraints to work is to add them as a special resource type that does not
take effect during the transaction, but fails the whole catalog in case of
validation failure.

To make this possible, add a new method #pre_run_check to the Type base class
for overriding in appropriate resource types (such as constraint).

The semantics is simply
- raise nothing if the pre-run check is succesful
- raise a Puppet::Error otherwise

The check is performed during evaluation of the transaction, just before
the catalog is applied. The generating of additional resources should be
complete when this is done (because the hook is meant to be able to
check the whole catalog for consistency).
(PUP-2298) protect transaction spec test against new exceptions

The new perform_pre_run_checks method in the transaction loops over
all resources in the catalog. This is prone to failures if any nil references
end up in the catalog. This can happen during the addition of resources
to the catalog under test conditions, because the mock resources are not
sufficiently contained.

To work around this effect, stub the very #container_of method in the mock
catalog so that all resources will have an apparent container.
(PUP-1027) Make it an error to use reserved words in future parser.

This makes it an error to use the reserved words function, private,
attr, and type in the future parser. The same keywords issue warnings
in 3x that they must be quoted. Therefore, the 4x implementation should
make it an error to use them (until there is support for the features
they will represent). If these are not made in to errors the features
can not be introduced without breakage since a deprecation can only be
turned into an error (or something new) in a major release.
(PUP-1027) Improve warning message for reserved words

The original warning about reserved words implied that a user could
always quote the word to be able to use this. Although this is often the
case there are also places where the word is used as a NAME (such as
class function {}) where quoting is not an option. In those cases they
need to select a different name.
Merge pull request #2640 from peterhuene/pup/2182

(PUP-2182) Add virtual_packages feature to package type.
(PUP-2578) Unbreak services from packages which set local flags.

So don't add _flags="" for pkg_scripts if no :flags were set, as it
may override the default flags from inside the script.
(PUP-2578) Keep order for pkg_scripts.

Do not unconditionally alphabetically sort the list of pkg_scripts
as order matters. Explicit ordering will need to be forced through
resources dependencies.
(PUP-2578) Tweak #in_base? by not relying on pkg_info, but on /etc/rc.conf which is faster
(maint) Fix latent error in parser face

There was an error when the spec/unit/util/rdoc_spec.rb tests were run
before the spec/unit/face/parser_spec.rb tests. In that order the test
for the "parser validate" action would fail when it is supposed to read
text from stdin.

What occured was that the environment from the previous test had created
a @known_resource_types on the current_environment. When the face ran it
didn't make sure that the environment was reset before trying to
validate the code it was given. The validation is done in a very
round-about manner where simply asking the environment for the
known_resource_types is expected to result in perform_initial_import,
which will raise and error if there are syntax errors in the manifest.
However, since the environment already had a @known_resource_types
value, it skipped perform_initial_import and didn't fail as the test
expected.

The fix is to ensure that the environment will reparse the manifests if
needed, which required a small adjustment to the reparse logic on the
environment, since the watching? flag should only control file watching,
not changes to the code setting. The other part is to have the validate
face check that it needs to reparse before assuming that
known_resource_types will automatically cause a parse to occur.

This is still a very awkward way to validate syntax, but it perhaps
slightly better now.