diff --git a/ext/project_data.yaml b/ext/project_data.yaml index ef5391c4b..7c0b706ff 100644 --- a/ext/project_data.yaml +++ b/ext/project_data.yaml @@ -1,56 +1,56 @@ --- project: 'puppet' author: 'Puppet Labs' email: 'info@puppetlabs.com' homepage: 'https://github.com/puppetlabs/puppet' summary: 'Puppet, an automated configuration management tool' description: 'Puppet, an automated configuration management tool' version_file: 'lib/puppet/version.rb' # files and gem_files are space separated lists files: '[A-Z]* install.rb bin lib conf man examples ext tasks spec' # The gem specification bits only work on Puppet >= 3.0rc, NOT 2.7.x and earlier gem_files: '[A-Z]* install.rb bin lib conf man examples ext tasks spec' gem_test_files: 'spec/**/*' gem_executables: 'puppet' gem_default_executables: 'puppet' gem_forge_project: 'puppet' gem_runtime_dependencies: facter: ['> 1.6', '< 3'] hiera: '~> 1.0' rgen: '~> 0.6.5' json_pure: gem_rdoc_options: - --title - "Puppet - Configuration Management" - --main - README.md - --line-numbers gem_platform_dependencies: x86-mingw32: gem_runtime_dependencies: # Pinning versions that require native extensions ffi: '1.9.3' win32-api: '1.4.8' win32-dir: '~> 0.4.3' win32-eventlog: '~> 0.6.1' - win32-process: '~> 0.6.5' + win32-process: '~> 0.7.4' win32-security: '~> 0.2.5' win32-service: '0.7.2' win32-taskscheduler: '~> 0.2.2' win32console: '1.3.2' windows-api: '~> 0.4.2' windows-pr: '~> 1.2.2' minitar: '~> 0.5.4' x64-mingw32: gem_runtime_dependencies: ffi: '1.9.3' win32-dir: '~> 0.4.8' win32-eventlog: '~> 0.6.1' win32-process: '~> 0.7.4' win32-security: '~> 0.2.5' win32-service: '0.8.4' win32-taskscheduler: '~> 0.3.0' minitar: '~> 0.5.4' bundle_platforms: x86-mingw32: mingw x64-mingw32: x64_mingw diff --git a/lib/puppet/util/pidlock.rb b/lib/puppet/util/pidlock.rb index 3e8389e23..3ebb4e0c9 100644 --- a/lib/puppet/util/pidlock.rb +++ b/lib/puppet/util/pidlock.rb @@ -1,61 +1,62 @@ require 'fileutils' require 'puppet/util/lockfile' class Puppet::Util::Pidlock def initialize(lockfile) @lockfile = Puppet::Util::Lockfile.new(lockfile) end def locked? clear_if_stale @lockfile.locked? end def mine? Process.pid == lock_pid end def lock return mine? if locked? @lockfile.lock(Process.pid) end def unlock if mine? return @lockfile.unlock else false end end def lock_pid pid = @lockfile.lock_data begin Integer(pid) rescue ArgumentError, TypeError nil end end def file_path @lockfile.file_path end def clear_if_stale return @lockfile.unlock if lock_pid.nil? errors = [Errno::ESRCH] - # Process::Error can only happen, and is only defined, on Windows - errors << Process::Error if defined? Process::Error + # Win32::Process now throws SystemCallError. Since this could be + # defined anywhere, only add when on Windows. + errors << SystemCallError if Puppet::Util::Platform.windows? begin Process.kill(0, lock_pid) rescue *errors @lockfile.unlock end end private :clear_if_stale end