├── .rspec ├── CODEOWNERS ├── bin ├── setup └── console ├── Gemfile ├── Rakefile ├── .github └── workflows │ ├── ruby3.yml │ ├── release.yml │ └── security.yml ├── spec ├── spec_helper.rb └── debian_codename_spec.rb ├── debian_codename.gemspec ├── README.md ├── lib └── debian_codename.rb ├── .rubocop.yml └── LICENSE /.rspec: -------------------------------------------------------------------------------- 1 | --format documentation 2 | --color 3 | --require spec_helper 4 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # added by slack-gitbot 2 | * @puppetlabs/release-engineering -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | set -vx 5 | 6 | bundle install 7 | 8 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Specify your gem's dependencies in debian_codename.gemspec 4 | gemspec 5 | 6 | gem 'rake', '~> 13.0' 7 | 8 | gem 'rspec', '~> 3.0' 9 | 10 | gem 'rubocop', '~> 1.21' 11 | 12 | gem 'rubocop-rake' 13 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "bundler/gem_tasks" 4 | require "rspec/core/rake_task" 5 | 6 | RSpec::Core::RakeTask.new(:spec) 7 | 8 | require "rubocop/rake_task" 9 | 10 | RuboCop::RakeTask.new 11 | 12 | task default: %i[spec rubocop] 13 | -------------------------------------------------------------------------------- /.github/workflows/ruby3.yml: -------------------------------------------------------------------------------- 1 | name: Ruby 3 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | test: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v3 10 | - uses: ruby/setup-ruby@v1 11 | with: 12 | ruby-version: '3.0' 13 | - run: | 14 | gem install bundler 15 | bundle install --jobs 4 --retry 3 16 | bundle exec rake 17 | -------------------------------------------------------------------------------- /bin/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | require "bundler/setup" 5 | require "debian_codename" 6 | 7 | # You can add fixtures and/or initialization code here to make experimenting 8 | # with your gem easier. You can also use a different console, if you like. 9 | 10 | # (If you use this, don't forget to add pry to your Gemfile!) 11 | # require "pry" 12 | # Pry.start 13 | 14 | require "irb" 15 | IRB.start(__FILE__) 16 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "debian_codename" 4 | 5 | RSpec.configure do |config| 6 | # Enable flags like --only-failures and --next-failure 7 | config.example_status_persistence_file_path = ".rspec_status" 8 | 9 | # Disable RSpec exposing methods globally on `Module` and `main` 10 | config.disable_monkey_patching! 11 | 12 | config.expect_with :rspec do |c| 13 | c.syntax = :expect 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Gem release 2 | 3 | on: 4 | push: 5 | tags: 6 | - '*' 7 | 8 | jobs: 9 | release: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v1 14 | - name: Build gem 15 | uses: scarhand/actions-ruby@master 16 | with: 17 | args: build *.gemspec 18 | - name: Publish gem 19 | uses: scarhand/actions-ruby@master 20 | env: 21 | RUBYGEMS_AUTH_TOKEN: ${{ secrets.RUBYGEMS_AUTH_TOKEN }} 22 | with: 23 | args: push *.gem 24 | -------------------------------------------------------------------------------- /debian_codename.gemspec: -------------------------------------------------------------------------------- 1 | Gem::Specification.new do |spec| 2 | spec.name = 'debian_codename' 3 | spec.version = %x(git describe --tags).tr('-', '.').chomp 4 | spec.authors = ['Puppet Release Engineering'] 5 | spec.email = ['release@puppet.com'] 6 | spec.license = 'Apache-2.0' 7 | 8 | spec.summary = 'Convert Debian/Ubuntu codenames to version numbers and vice-versa' 9 | spec.description = spec.summary 10 | spec.homepage = 'https://github.com/puppetlabs/debian_codename' 11 | spec.required_ruby_version = '>= 3.0.0' 12 | 13 | spec.metadata['homepage_uri'] = spec.homepage 14 | spec.metadata['source_code_uri'] = spec.homepage 15 | spec.metadata['changelog_uri'] = "#{spec.homepage}/CHANGELOG.md" 16 | 17 | spec.files = Dir['LICENSE', 'README.md', 'lib/*'] 18 | end 19 | -------------------------------------------------------------------------------- /spec/debian_codename_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | RSpec.describe DebianCodename do 4 | it 'can convert version string to codename' do 5 | expect(DebianCodename.fast_find('20.10')).to eq('groovy') 6 | end 7 | 8 | it 'can convert codename to version string' do 9 | expect(DebianCodename.fast_find('groovy')).to eq('20.10') 10 | end 11 | 12 | it 'can convert codename to canonical form' do 13 | expect(DebianCodename.find('groovy')) 14 | .to eq({ 15 | version: '20.10', 16 | codename: 'groovy', 17 | distribution: 'ubuntu' 18 | }) 19 | end 20 | 21 | it 'can convert version string to canonical form' do 22 | expect(DebianCodename.find('12')) 23 | .to eq({ 24 | version: '12', 25 | codename: 'bookworm', 26 | distribution: 'debian' 27 | }) 28 | end 29 | 30 | it 'throws DebianCodenameError when nothing is found' do 31 | expect { DebianCodename.fast_find('FOO!') }.to raise_error(DebianCodename::DebianCodenameError) 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /.github/workflows/security.yml: -------------------------------------------------------------------------------- 1 | name: Security 2 | on: 3 | workflow_dispatch: 4 | push: 5 | branches: 6 | - main 7 | jobs: 8 | scan: 9 | name: Mend Scanning 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: checkout repo content 13 | uses: actions/checkout@v3 14 | with: 15 | fetch-depth: 1 16 | - name: setup ruby 17 | uses: ruby/setup-ruby@v1 18 | with: 19 | ruby-version: 2.7 20 | # setup a package lock if one doesn't exist, otherwise do nothing 21 | - name: check lock 22 | run: '[ -f "Gemfile.lock" ] && echo "package lock file exists, skipping" || bundle lock' 23 | # install java 24 | - uses: actions/setup-java@v3 25 | with: 26 | distribution: 'temurin' # See 'Supported distributions' for available options 27 | java-version: '17' 28 | # download mend 29 | - name: download_mend 30 | run: curl -o wss-unified-agent.jar https://unified-agent.s3.amazonaws.com/wss-unified-agent.jar 31 | - name: run mend 32 | run: java -jar wss-unified-agent.jar 33 | env: 34 | WS_APIKEY: ${{ secrets.MEND_API_KEY }} 35 | WS_WSS_URL: https://saas-eu.whitesourcesoftware.com/agent 36 | WS_USERKEY: ${{ secrets.MEND_TOKEN }} 37 | WS_PRODUCTNAME: RE 38 | WS_PROJECTNAME: ${{ github.event.repository.name }} 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DebianCodename 2 | 3 | A minimalist mixin module for providing debian/ubuntu codename to version translation. 4 | 5 | ## Installation 6 | 7 | Add this line to your application's Gemfile: 8 | 9 | ```ruby 10 | gem 'debian_codename' 11 | ``` 12 | 13 | And then execute: 14 | 15 | $ bundle install 16 | 17 | Or install it yourself as: 18 | 19 | $ gem install debian_codename 20 | 21 | ## Usage 22 | 23 | ### find 24 | 25 | Given a codename or a version string, `find` will return a hash with the codename, version string, and distribution name: 26 | 27 | require 'debian_codename' 28 | 29 | DebianCodename.find('groovy') 30 | => {:version=>"20.10", :codename=>"groovy", :distribution=>"ubuntu"} 31 | 32 | DebianCodename.find('12') 33 | => {:version=>"12", :codename=>"bookworm", :distribution=>"debian"} 34 | 35 | 36 | ### fast_find 37 | 38 | Given a codename, `fast_find` will return the corresponding version string and vice-versa. 39 | 40 | require 'debian_codename' 41 | 42 | DebianCodename.fast_find('groovy') 43 | => "20.10" 44 | 45 | DebianCodename.fast_find('20.10') 46 | => "groovy" 47 | 48 | 49 | ## Errors 50 | 51 | Raises `DebianCodename::DebianCodenameError` if no match is found. 52 | 53 | ## Development 54 | 55 | After checking out the repo, run `bin/setup` to install 56 | dependencies. 57 | 58 | Run `rake spec` to run the tests. 59 | 60 | Run `bin/console` for an interactive prompt that will allow you to 61 | experiment. 62 | 63 | To install this gem onto your local machine, run `bundle exec rake install`. 64 | -------------------------------------------------------------------------------- /lib/debian_codename.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module DebianCodename 4 | class DebianCodenameError < StandardError; end 5 | 6 | # Codenames need to be all lower case 7 | 8 | # https://wiki.debian.org/DebianReleases#Production_Releases 9 | DEBIAN_CODENAMES = { 10 | '@distribution' => 'debian', 11 | '14' => %w[forky], 12 | '13' => %w[trixie], 13 | '12' => %w[bookworm], 14 | '11' => %w[bullseye], 15 | '10' => %w[buster], 16 | '9' => %w[stretch], 17 | '8' => %w[jessie], 18 | '7' => %w[wheezy], 19 | '6.0' => %w[squeeze], 20 | '5.0' => %w[lenny], 21 | '4.0' => %w[etch], 22 | '3.1' => %w[sarge], 23 | '3.0' => %w[woody], 24 | '2.2' => %w[potato], 25 | '2.1' => %w[slink], 26 | '2.0' => %w[hamm], 27 | '1.3' => %w[bo], 28 | '1.2' => %w[rex], 29 | '1.1' => %w[buzz] 30 | }.freeze 31 | 32 | # https://wiki.ubuntu.com/DevelopmentCodeNames 33 | # https://wiki.ubuntu.com/Releases 34 | # Codename nouns ignored here at the moment but kept for consistency and possible future 35 | # improvements 36 | UBUNTU_CODENAMES = { 37 | '@distribution' => 'ubuntu', 38 | '24.10' => %w[oracular oriole], 39 | '24.04' => %w[noble numbat], 40 | '23.04' => %w[lunar lobster], 41 | '22.10' => %w[kinetic kudu], 42 | '22.04' => %w[jammy jellyfish], 43 | '20.10' => %w[groovy gorilla], 44 | '20.04' => %w[focal fossa], 45 | '19.10' => %w[eoan ermine], 46 | '19.04' => %w[disco dingo], 47 | '18.10' => %w[cosmic cuttlefish], 48 | '18.04' => %w[bionic beaver], 49 | '17.10' => %w[artful aardvark], 50 | '17.04' => %w[zesty zapus], 51 | '16.10' => %w[yakkety yak], 52 | '16.04' => %w[xenial xerus], 53 | '15.10' => %w[wily werewolf], 54 | '15.04' => %w[vivid vervet], 55 | '14.10' => %w[utopic unicorn], 56 | '14.04' => %w[trusty tahr], 57 | '13.10' => %w[saucy salamander], 58 | '13.05' => %w[raring ringtail], 59 | '12.10' => %w[quantal quetzal], 60 | '12.04' => %w[precise pangolin], 61 | '11.10' => %w[oneiric ocelot], 62 | '11.04' => %w[natty narwhal], 63 | '10.10' => %w[maverick meerkat], 64 | '10.04' => %w[lucid lynx], 65 | '9.10' => %w[karmic koala], 66 | '9.04' => %w[jaunty jackalope], 67 | '8.10' => %w[intrepid ibex], 68 | '8.04' => %w[hardy heron], 69 | '7.10' => %w[gutsy gibbon], 70 | '7.04' => %w[feisty fawn], 71 | '6.10' => %w[edgy eft], 72 | '6.06' => %w[dapper drake], 73 | '5.10' => %w[breezy badger], 74 | '5.04' => %w[hoary hedgehog], 75 | '4.10' => %w[warty warthog] 76 | }.freeze 77 | 78 | module_function 79 | 80 | # Convert from version string to codename and vice versa 81 | def fast_find(user_search_string) 82 | search_string = user_search_string.downcase 83 | 84 | [DEBIAN_CODENAMES, UBUNTU_CODENAMES].each do |code_catalog| 85 | return codename(code_catalog, search_string) if code_catalog.key?(search_string) 86 | 87 | version_found = code_catalog.find { |_, value| value[0] == search_string } 88 | return version_found.first unless version_found.nil? 89 | end 90 | 91 | raise DebianCodenameError, "No match for #{user_search_string}" 92 | end 93 | 94 | # Return a canonical form (Hash with ':version', ':codename', and ':distribution' keys) 95 | def find(user_search_string) 96 | search_string = user_search_string.downcase 97 | 98 | [DEBIAN_CODENAMES, UBUNTU_CODENAMES].each do |code_catalog| 99 | if code_catalog.key?(search_string) 100 | return { 101 | version: search_string, 102 | codename: codename(code_catalog, search_string), 103 | distribution: distribution(code_catalog) 104 | } 105 | end 106 | 107 | version_found = code_catalog.find { |_, value| value[0] == search_string } 108 | unless version_found.nil? 109 | return { 110 | version: version_found.first, 111 | codename: search_string, 112 | distribution: distribution(code_catalog) 113 | } 114 | end 115 | end 116 | 117 | raise DebianCodenameError, 'No match' 118 | end 119 | 120 | def codename(code_catalog, version_string) 121 | code_catalog[version_string][0] 122 | end 123 | 124 | def distribution(code_catalog) 125 | code_catalog['@distribution'] 126 | end 127 | end 128 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | require: rubocop-rake 4 | 5 | AllCops: 6 | Exclude: 7 | - Rakefile 8 | - Gemfile 9 | - bin/* 10 | - spec/**/*.rb 11 | - templates/* 12 | SuggestExtensions: false 13 | 14 | Gemspec/DeprecatedAttributeAssignment: 15 | Enabled: true 16 | 17 | Gemspec/RequiredRubyVersion: 18 | Enabled: false 19 | 20 | Gemspec/RequireMFA: 21 | Enabled: false 22 | 23 | Layout/FirstArrayElementIndentation: 24 | Enabled: false 25 | 26 | Layout/LineContinuationLeadingSpace: 27 | Enabled: true 28 | 29 | Layout/LineContinuationSpacing: 30 | Enabled: true 31 | 32 | Layout/LineEndStringConcatenationIndentation: 33 | Enabled: true 34 | 35 | Layout/MultilineMethodCallIndentation: 36 | Enabled: false 37 | 38 | Layout/SpaceBeforeBrackets: 39 | Enabled: true 40 | 41 | Lint/AmbiguousAssignment: 42 | Enabled: true 43 | 44 | Lint/AmbiguousOperatorPrecedence: 45 | Enabled: true 46 | 47 | Lint/AmbiguousRange: 48 | Enabled: true 49 | 50 | Lint/ConstantOverwrittenInRescue: 51 | Enabled: true 52 | 53 | Lint/DeprecatedConstants: 54 | Enabled: true 55 | 56 | Lint/DuplicateBranch: 57 | Enabled: true 58 | 59 | Lint/DuplicateMagicComment: 60 | Enabled: true 61 | 62 | Lint/DuplicateRegexpCharacterClassElement: 63 | Enabled: true 64 | 65 | Lint/EmptyBlock: 66 | Enabled: true 67 | 68 | Lint/EmptyClass: 69 | Enabled: true 70 | 71 | Lint/EmptyInPattern: 72 | Enabled: true 73 | 74 | Lint/IncompatibleIoSelectWithFiberScheduler: 75 | Enabled: true 76 | 77 | Lint/LambdaWithoutLiteralBlock: 78 | Enabled: true 79 | 80 | Lint/NoReturnInBeginEndBlocks: 81 | Enabled: true 82 | 83 | Lint/NonAtomicFileOperation: 84 | Enabled: true 85 | 86 | Lint/NumberedParameterAssignment: 87 | Enabled: true 88 | 89 | Lint/OrAssignmentToConstant: 90 | Enabled: true 91 | 92 | Lint/RedundantDirGlobSort: 93 | Enabled: true 94 | 95 | Lint/RefinementImportMethods: 96 | Enabled: true 97 | 98 | Lint/RequireRangeParentheses: 99 | Enabled: true 100 | 101 | Lint/RequireRelativeSelfPath: 102 | Enabled: true 103 | 104 | Lint/SymbolConversion: 105 | Enabled: true 106 | 107 | Lint/ToEnumArguments: 108 | Enabled: true 109 | 110 | Lint/TripleQuotes: 111 | Enabled: true 112 | 113 | Lint/UnexpectedBlockArity: 114 | Enabled: true 115 | 116 | Lint/UnmodifiedReduceAccumulator: 117 | Enabled: true 118 | 119 | Lint/UselessRuby2Keywords: 120 | Enabled: true 121 | 122 | Metrics/AbcSize: 123 | Enabled: false 124 | 125 | Metrics/BlockLength: 126 | Enabled: false 127 | 128 | Metrics/ClassLength: 129 | Enabled: false 130 | 131 | Metrics/CyclomaticComplexity: 132 | Enabled: false 133 | 134 | Metrics/MethodLength: 135 | Enabled: false 136 | 137 | Metrics/ModuleLength: 138 | Enabled: false 139 | 140 | Metrics/PerceivedComplexity: 141 | Enabled: false 142 | 143 | Naming/AccessorMethodName: 144 | Enabled: false 145 | 146 | Naming/BlockForwarding: 147 | Enabled: true 148 | 149 | Security/CompoundHash: 150 | Enabled: true 151 | 152 | Security/IoMethods: 153 | Enabled: true 154 | 155 | Style/ArgumentsForwarding: 156 | Enabled: true 157 | 158 | Style/ArrayIntersect: 159 | Enabled: true 160 | 161 | Style/CollectionCompact: 162 | Enabled: true 163 | 164 | Style/CommandLiteral: 165 | Enabled: false 166 | 167 | Style/ConcatArrayLiterals: 168 | Enabled: true 169 | 170 | Style/DocumentDynamicEvalDefinition: 171 | Enabled: true 172 | 173 | Style/Documentation: 174 | Enabled: false 175 | 176 | Style/EachWithObject: 177 | Enabled: false 178 | 179 | Style/EmptyHeredoc: 180 | Enabled: true 181 | 182 | Style/EndlessMethod: 183 | Enabled: true 184 | 185 | Style/EnvHome: 186 | Enabled: true 187 | 188 | Style/FetchEnvVar: 189 | Enabled: true 190 | 191 | Style/FileRead: 192 | Enabled: true 193 | 194 | Style/FileWrite: 195 | Enabled: true 196 | 197 | Style/FormatString: 198 | Enabled: false 199 | 200 | Style/FormatStringToken: 201 | Enabled: false 202 | 203 | Style/FrozenStringLiteralComment: 204 | Enabled: false 205 | 206 | Style/HashConversion: 207 | Enabled: true 208 | 209 | Style/HashExcept: 210 | Enabled: true 211 | 212 | Style/IfUnlessModifier: 213 | Enabled: false 214 | 215 | Style/IfWithBooleanLiteralBranches: 216 | Enabled: true 217 | 218 | Style/InPatternThen: 219 | Enabled: true 220 | 221 | Style/MagicCommentFormat: 222 | Enabled: true 223 | 224 | Style/MapCompactWithConditionalBlock: 225 | Enabled: true 226 | 227 | Style/MapToHash: 228 | Enabled: true 229 | 230 | Style/MapToSet: 231 | Enabled: true 232 | 233 | Style/MinMaxComparison: 234 | Enabled: true 235 | 236 | Style/MultilineInPatternThen: 237 | Enabled: true 238 | 239 | Style/MutableConstant: 240 | Enabled: false 241 | 242 | Style/NegatedIfElseCondition: 243 | Enabled: true 244 | 245 | Style/NestedFileDirname: 246 | Enabled: true 247 | 248 | Style/NilLambda: 249 | Enabled: true 250 | 251 | Style/NumberedParameters: 252 | Enabled: true 253 | 254 | Style/NumberedParametersLimit: 255 | Enabled: true 256 | 257 | Style/ObjectThen: 258 | Enabled: true 259 | 260 | Style/OpenStructUse: 261 | Enabled: true 262 | 263 | Style/OperatorMethodCall: 264 | Enabled: true 265 | 266 | Style/OptionalBooleanParameter: 267 | Enabled: false 268 | 269 | Style/QuotedSymbols: 270 | Enabled: true 271 | 272 | Style/RedundantArgument: 273 | Enabled: true 274 | 275 | Style/RedundantConstantBase: 276 | Enabled: true 277 | 278 | Style/RedundantDoubleSplatHashBraces: 279 | Enabled: true 280 | 281 | Style/RedundantEach: 282 | Enabled: true 283 | 284 | Style/RedundantInitialize: 285 | Enabled: true 286 | 287 | Style/RedundantReturn: 288 | Enabled: false 289 | 290 | Style/RedundantSelfAssignmentBranch: 291 | Enabled: true 292 | 293 | Style/RedundantStringEscape: 294 | Enabled: true 295 | 296 | Style/SelectByRegexp: 297 | Enabled: true 298 | 299 | Style/StringChars: 300 | Enabled: true 301 | 302 | Style/SwapValues: 303 | Enabled: true 304 | 305 | Style/YodaExpression: 306 | Enabled: true 307 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2023 Puppet by Perforce 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------