https://github.com/tohuwabohu/puppet-patch
Puppet module to manage and apply diff files using the patch command
https://github.com/tohuwabohu/puppet-patch
diff-files patch puppet
Last synced: 28 days ago
JSON representation
Puppet module to manage and apply diff files using the patch command
- Host: GitHub
- URL: https://github.com/tohuwabohu/puppet-patch
- Owner: tohuwabohu
- License: apache-2.0
- Created: 2014-03-22T06:55:27.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2023-08-11T20:38:29.000Z (almost 2 years ago)
- Last Synced: 2024-12-18T00:19:52.662Z (5 months ago)
- Topics: diff-files, patch, puppet
- Language: Ruby
- Homepage:
- Size: 101 KB
- Stars: 6
- Watchers: 3
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# patch
[](https://github.com/tohuwabohu/puppet-patch/blob/master/LICENSE.txt)
[](https://forge.puppetlabs.com/tohuwabohu/patch)
[](https://forge.puppetlabs.com/tohuwabohu/patch)## Overview
Manage and apply diff files on original files using the patch command.
## Usage
* Install patch with package settings; this itself doesn't do much. To apply patches, you have to use `patch::file`.
```
class { 'patch': }
```* Apply diff referenced by a file on a given original file
```
patch::file { '/path/to/file':
diff_source => '/path/to/diff',
}
```* Apply inline diff on a given original file
```
patch::file { '/path/to/file':
diff_content => '',
}
```* Apply two diff files in a particular order on the same original file
```
$target = '/path/to/file'
patch::file { 'first-patch':
target => $target,
prefix => '0001',
diff_source => '/path/to/0001.diff',
}
patch::file { 'second-patch':
target => $target,
prefix => '0002',
diff_source => '/path/to/0002.diff',
require => Patch::File['first-patch'],
}
```* Apply diff to a directory
```
patch::directory { '/path/to/target/directory':
diff_source => '/path/to/diff',
strip => 2,
}
```## Limitations
The module has been tested on the following operating systems. Testing and patches for other platforms are welcome.
* Debian 7.0 (Wheezy)
* Debian 8.0 (Jessie)
* Ubuntu 14.04 (Trusty Tahr)
* Ubuntu 16.04 (Xenial Xerus)## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request### Development
This project uses rspec-puppet and beaker to ensure the module works as expected and to prevent regressions.
```
gem install bundler
bundle install --path vendorbundle exec rake spec
bundle exec rake beaker
```
(note: see [Beaker - Supported ENV variables](https://github.com/puppetlabs/beaker-rspec/blob/master/README.md)
for a list of environment variables to control the default behaviour of Beaker)