Skip to content

Commit

Permalink
Add support for Debian 12 (bookworm)
Browse files Browse the repository at this point in the history
Not much is changed for PHP in this upcoming release, except for the
version of PHP shipped which is now 8.2
  • Loading branch information
jcharaoui committed Dec 5, 2023
1 parent 11913ce commit be22ebe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions manifests/globals.pp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
'Debian' => $facts['os']['release']['major'] ? {
'10' => '7.3',
'11' => '7.4',
'12' => '8.2',
default => fail("Unsupported Debian release: ${fact('os.release.major')}"),
},
'Ubuntu' => $facts['os']['release']['major'] ? {
Expand Down
4 changes: 2 additions & 2 deletions manifests/repo/debian.pp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}
include 'apt'

if ($dotdeb and $facts['os']['release']['major'] in ['6', '7', '8']) {
if ($dotdeb and versioncmp($facts['os']['release']['major'], '9') < 1) {
apt::source { 'source_php_dotdeb':
location => $location,
repos => $repos,
Expand All @@ -50,7 +50,7 @@
}
}

if ($sury and $facts['os']['release']['major'] in ['9', '10', '11']) {
if ($sury and versioncmp($facts['os']['release']['major'], '9') >= 0) {
apt::source { 'source_php_sury':
location => 'https://packages.sury.org/php/',
repos => 'main',
Expand Down
3 changes: 2 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"operatingsystem": "Debian",
"operatingsystemrelease": [
"10",
"11"
"11",
"12"
]
},
{
Expand Down
5 changes: 2 additions & 3 deletions spec/classes/php_repo_debian_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
if facts[:os]['name'] == 'Debian'
it { is_expected.to compile.with_all_deps }

case facts[:os]['release']['major']
when '6', '7', '8'
if facts[:os]['release']['major'].to_i < 9
it { is_expected.to contain_apt__source('source_php_dotdeb') }
it { is_expected.not_to contain_apt__source('source_php_sury') }
when '9', '10', '11'
elsif facts[:os]['release']['major'].to_i >= 9
it { is_expected.not_to contain_apt__source('source_php_dotdeb') }
it { is_expected.to contain_apt__source('source_php_sury') }
end
Expand Down

0 comments on commit be22ebe

Please sign in to comment.