sp_variant/
data.rs

1/*
2 * SPDX-FileCopyrightText: 2021 - 2024  StorPool <support@storpool.com>
3 * SPDX-License-Identifier: BSD-2-Clause
4 */
5//! Partially-generated data for handling build variants.
6//!
7//! The data is autogenerated from the supported StorPool build variants.
8
9use std::collections::HashMap;
10use std::str::FromStr;
11
12use enum_iterator::Sequence;
13use once_cell::sync::Lazy;
14use serde_derive::{Deserialize, Serialize};
15
16use crate::{
17    Builder, DebRepo, Detect, Repo, Supported, Variant, VariantDefTop, VariantError, VariantFormat,
18    VariantFormatVersion, YumRepo,
19};
20
21/// The supported StorPool build variants (OS distribution, version, etc).
22#[derive(Debug, Clone, Copy, PartialEq, Hash, Eq, Serialize, Deserialize, Sequence)]
23#[non_exhaustive]
24pub enum VariantKind {
25    /// AlmaLinux 8.x
26    ALMA8,
27    /// AlmaLinux 9.x
28    ALMA9,
29    /// CentOS 7.x
30    CENTOS7,
31    /// CentOS 8.x
32    CENTOS8,
33    /// CentOS Stream 9.x
34    CENTOS9,
35    /// Debian 10.x (buster)
36    DEBIAN10,
37    /// Debian 11.x (bullseye)
38    DEBIAN11,
39    /// Debian 12.x (bookworm)
40    DEBIAN12,
41    /// Debian 13.x (trixie/unstable)
42    DEBIAN13,
43    /// Oracle Linux 7.x
44    ORACLE7,
45    /// Oracle Linux 8.x
46    ORACLE8,
47    /// Oracle Linux 9.x
48    ORACLE9,
49    /// RedHat Enterprise Linux 8.x
50    RHEL8,
51    /// Rocky Linux 8.x
52    ROCKY8,
53    /// Rocky Linux 9.x
54    ROCKY9,
55    /// Ubuntu 18.04 LTS (Bionic Beaver)
56    UBUNTU1804,
57    /// Ubuntu 20.04 LTS (Focal Fossa)
58    UBUNTU2004,
59    /// Ubuntu 22.04 LTS (Jammy Jellyfish)
60    UBUNTU2204,
61    /// Ubuntu 24.04 LTS (Noble Numbat)
62    UBUNTU2404,
63}
64
65impl VariantKind {
66    const ALMA8_NAME: &'static str = "ALMA8";
67    const ALMA9_NAME: &'static str = "ALMA9";
68    const CENTOS7_NAME: &'static str = "CENTOS7";
69    const CENTOS8_NAME: &'static str = "CENTOS8";
70    const CENTOS9_NAME: &'static str = "CENTOS9";
71    const DEBIAN10_NAME: &'static str = "DEBIAN10";
72    const DEBIAN11_NAME: &'static str = "DEBIAN11";
73    const DEBIAN12_NAME: &'static str = "DEBIAN12";
74    const DEBIAN13_NAME: &'static str = "DEBIAN13";
75    const ORACLE7_NAME: &'static str = "ORACLE7";
76    const ORACLE8_NAME: &'static str = "ORACLE8";
77    const ORACLE9_NAME: &'static str = "ORACLE9";
78    const RHEL8_NAME: &'static str = "RHEL8";
79    const ROCKY8_NAME: &'static str = "ROCKY8";
80    const ROCKY9_NAME: &'static str = "ROCKY9";
81    const UBUNTU1804_NAME: &'static str = "UBUNTU1804";
82    const UBUNTU2004_NAME: &'static str = "UBUNTU2004";
83    const UBUNTU2204_NAME: &'static str = "UBUNTU2204";
84    const UBUNTU2404_NAME: &'static str = "UBUNTU2404";
85}
86
87impl AsRef<str> for VariantKind {
88    #[inline]
89    fn as_ref(&self) -> &str {
90        match *self {
91            Self::ALMA8 => Self::ALMA8_NAME,
92            Self::ALMA9 => Self::ALMA9_NAME,
93            Self::CENTOS7 => Self::CENTOS7_NAME,
94            Self::CENTOS8 => Self::CENTOS8_NAME,
95            Self::CENTOS9 => Self::CENTOS9_NAME,
96            Self::DEBIAN10 => Self::DEBIAN10_NAME,
97            Self::DEBIAN11 => Self::DEBIAN11_NAME,
98            Self::DEBIAN12 => Self::DEBIAN12_NAME,
99            Self::DEBIAN13 => Self::DEBIAN13_NAME,
100            Self::ORACLE7 => Self::ORACLE7_NAME,
101            Self::ORACLE8 => Self::ORACLE8_NAME,
102            Self::ORACLE9 => Self::ORACLE9_NAME,
103            Self::RHEL8 => Self::RHEL8_NAME,
104            Self::ROCKY8 => Self::ROCKY8_NAME,
105            Self::ROCKY9 => Self::ROCKY9_NAME,
106            Self::UBUNTU1804 => Self::UBUNTU1804_NAME,
107            Self::UBUNTU2004 => Self::UBUNTU2004_NAME,
108            Self::UBUNTU2204 => Self::UBUNTU2204_NAME,
109            Self::UBUNTU2404 => Self::UBUNTU2404_NAME,
110        }
111    }
112}
113
114impl FromStr for VariantKind {
115    type Err = VariantError;
116
117    #[inline]
118    fn from_str(value: &str) -> Result<Self, Self::Err> {
119        match value {
120            Self::ALMA8_NAME => Ok(Self::ALMA8),
121            Self::ALMA9_NAME => Ok(Self::ALMA9),
122            Self::CENTOS7_NAME => Ok(Self::CENTOS7),
123            Self::CENTOS8_NAME => Ok(Self::CENTOS8),
124            Self::CENTOS9_NAME => Ok(Self::CENTOS9),
125            Self::DEBIAN10_NAME => Ok(Self::DEBIAN10),
126            Self::DEBIAN11_NAME => Ok(Self::DEBIAN11),
127            Self::DEBIAN12_NAME => Ok(Self::DEBIAN12),
128            Self::DEBIAN13_NAME => Ok(Self::DEBIAN13),
129            Self::ORACLE7_NAME => Ok(Self::ORACLE7),
130            Self::ORACLE8_NAME => Ok(Self::ORACLE8),
131            Self::ORACLE9_NAME => Ok(Self::ORACLE9),
132            Self::RHEL8_NAME => Ok(Self::RHEL8),
133            Self::ROCKY8_NAME => Ok(Self::ROCKY8),
134            Self::ROCKY9_NAME => Ok(Self::ROCKY9),
135            Self::UBUNTU1804_NAME => Ok(Self::UBUNTU1804),
136            Self::UBUNTU2004_NAME => Ok(Self::UBUNTU2004),
137            Self::UBUNTU2204_NAME => Ok(Self::UBUNTU2204),
138            Self::UBUNTU2404_NAME => Ok(Self::UBUNTU2404),
139            other => Err(VariantError::BadVariant(other.to_owned())),
140        }
141    }
142}
143
144/// Return the definition of the StorPool variants.
145#[allow(clippy::manual_string_new)]
146#[allow(clippy::panic)]
147#[allow(clippy::too_many_lines)]
148#[must_use]
149pub fn get_variants() -> &'static VariantDefTop {
150    static DEF_TOP: Lazy<VariantDefTop> = Lazy::new(|| {
151        VariantDefTop {
152            format: VariantFormat {
153                version: VariantFormatVersion {
154                    major: 1,
155                    minor: 4,
156                },
157            },
158            order: vec![
159                    VariantKind::ROCKY8,
160                    VariantKind::ROCKY9,
161                    VariantKind::RHEL8,
162                    VariantKind::ORACLE8,
163                    VariantKind::ORACLE7,
164                    VariantKind::ORACLE9,
165                    VariantKind::CENTOS7,
166                    VariantKind::CENTOS8,
167                    VariantKind::CENTOS9,
168                    VariantKind::ALMA8,
169                    VariantKind::ALMA9,
170                    VariantKind::UBUNTU1804,
171                    VariantKind::UBUNTU2004,
172                    VariantKind::UBUNTU2204,
173                    VariantKind::UBUNTU2404,
174                    VariantKind::DEBIAN10,
175                    VariantKind::DEBIAN11,
176                    VariantKind::DEBIAN12,
177                    VariantKind::DEBIAN13,
178            ],
179            variants: HashMap::from(
180                [
181                    (
182                            VariantKind::ALMA8,
183                            Variant {
184                                kind: VariantKind::ALMA8,
185                                descr: "AlmaLinux 8.x".to_owned(),
186                                family: "redhat".to_owned(),
187                                parent: "ALMA9".to_owned(),
188                                detect: Detect {
189                                    filename: "/etc/redhat-release".to_owned(),
190                                    #[allow(clippy::needless_raw_strings)]
191                                    regex: r"^ AlmaLinux \s .* \s 8 \. (?: [4-9] | [1-9][0-9] )".to_owned(),
192                                    os_id: "almalinux".to_owned(),
193                                    #[allow(clippy::needless_raw_strings)]
194                                    os_version_regex: r"^8(?:$|\.[4-9]|\.[1-9][0-9])".to_owned(),
195                                },
196                                supported: Supported {
197                                    repo: true,
198                                },
199                                commands: HashMap::from(
200                                    [
201                                        (
202                                            "package".to_owned(),
203                                            HashMap::from(
204                                                [
205                                                    (
206                                                        "install".to_owned(),
207                                                        vec![
208                                                            "dnf".to_owned(),
209                                                            "--disablerepo=*".to_owned(),
210                                                            "--enablerepo=appstream".to_owned(),
211                                                            "--enablerepo=baseos".to_owned(),
212                                                            "--enablerepo=powertools".to_owned(),
213                                                            "--enablerepo=storpool-contrib".to_owned(),
214                                                            "install".to_owned(),
215                                                            "-q".to_owned(),
216                                                            "-y".to_owned(),
217                                                            "--".to_owned(),
218                                                        ],
219                                                    ),
220                                                    (
221                                                        "list_all".to_owned(),
222                                                        vec![
223                                                            "rpm".to_owned(),
224                                                            "-qa".to_owned(),
225                                                            "--qf".to_owned(),
226                                                            "%{Name}\\t%{EVR}\\t%{Arch}\\tii\\n".to_owned(),
227                                                            "--".to_owned(),
228                                                        ],
229                                                    ),
230                                                    (
231                                                        "purge".to_owned(),
232                                                        vec![
233                                                            "yum".to_owned(),
234                                                            "remove".to_owned(),
235                                                            "-q".to_owned(),
236                                                            "-y".to_owned(),
237                                                            "--".to_owned(),
238                                                        ],
239                                                    ),
240                                                    (
241                                                        "remove".to_owned(),
242                                                        vec![
243                                                            "yum".to_owned(),
244                                                            "remove".to_owned(),
245                                                            "-q".to_owned(),
246                                                            "-y".to_owned(),
247                                                            "--".to_owned(),
248                                                        ],
249                                                    ),
250                                                    (
251                                                        "remove_impl".to_owned(),
252                                                        vec![
253                                                            "rpm".to_owned(),
254                                                            "-e".to_owned(),
255                                                            "--".to_owned(),
256                                                        ],
257                                                    ),
258                                                    (
259                                                        "update_db".to_owned(),
260                                                        vec![
261                                                            "true".to_owned(),
262                                                        ],
263                                                    ),
264                                                ]
265                                            ),
266                                        ),
267                                        (
268                                            "pkgfile".to_owned(),
269                                            HashMap::from(
270                                                [
271                                                    (
272                                                        "dep_query".to_owned(),
273                                                        vec![
274                                                            "sh".to_owned(),
275                                                            "-c".to_owned(),
276                                                            "rpm -qpR -- \"$pkg\"".to_owned(),
277                                                        ],
278                                                    ),
279                                                    (
280                                                        "install".to_owned(),
281                                                        vec![
282                                                            "sh".to_owned(),
283                                                            "-c".to_owned(),
284                                                            "
285unset to_install to_reinstall
286for f in $packages; do
287    package=\"$(rpm -qp \"$f\")\"
288    if rpm -q -- \"$package\"; then
289        to_reinstall=\"$to_reinstall ./$f\"
290    else
291        to_install=\"$to_install ./$f\"
292    fi
293done
294
295if [ -n \"$to_install\" ]; then
296    dnf install -y --disablerepo='*' --enablerepo=appstream,baseos,storpool-contrib,powertools --setopt=localpkg_gpgcheck=0 -- $to_install
297fi
298if [ -n \"$to_reinstall\" ]; then
299    dnf reinstall -y --disablerepo='*' --enablerepo=appstream,baseos,storpool-contrib,powertools --setopt=localpkg_gpgcheck=0 -- $to_reinstall
300fi
301".to_owned(),
302                                                        ],
303                                                    ),
304                                                ]
305                                            ),
306                                        ),
307                                    ]
308                                ),
309                                min_sys_python: "3.6".to_owned(),
310                                repo:
311                                    Repo::Yum(YumRepo {
312                                        yumdef: "redhat/repo/storpool-centos.repo".to_owned(),
313                                        keyring: "redhat/repo/RPM-GPG-KEY-StorPool".to_owned(),
314                                    }),
315                                    package: HashMap::from(
316                                    [
317                                        ("KMOD".to_owned(), "kmod".to_owned()),
318                                        ("LIBCGROUP".to_owned(), "libcgroup-tools".to_owned()),
319                                        ("LIBUDEV".to_owned(), "systemd-libs".to_owned()),
320                                        ("OPENSSL".to_owned(), "openssl-libs".to_owned()),
321                                        ("PERL_AUTODIE".to_owned(), "perl-autodie".to_owned()),
322                                        ("PERL_FILE_PATH".to_owned(), "perl-File-Path".to_owned()),
323                                        ("PERL_LWP_PROTO_HTTPS".to_owned(), "perl-LWP-Protocol-https".to_owned()),
324                                        ("PERL_SYS_SYSLOG".to_owned(), "perl-Sys-Syslog".to_owned()),
325                                        ("PROCPS".to_owned(), "procps-ng".to_owned()),
326                                        ("PYTHON_SIMPLEJSON".to_owned(), "python2-simplejson".to_owned()),
327                                        ("UDEV".to_owned(), "systemd".to_owned()),
328                                    ]
329                                ),
330                                systemd_lib: "usr/lib/systemd/system".to_owned(),
331                                file_ext: "rpm".to_owned(),
332                                initramfs_flavor: "mkinitrd".to_owned(),
333                                builder: Builder {
334                                    alias: "alma8".to_owned(),
335                                    base_image: "almalinux:8".to_owned(),
336                                    branch: "".to_owned(),
337                                    kernel_package: "kernel-core".to_owned(),
338                                    utf8_locale: "C.UTF-8".to_owned(),
339                                },
340                            },
341                    ),
342                    (
343                            VariantKind::ALMA9,
344                            Variant {
345                                kind: VariantKind::ALMA9,
346                                descr: "AlmaLinux 9.x".to_owned(),
347                                family: "redhat".to_owned(),
348                                parent: "".to_owned(),
349                                detect: Detect {
350                                    filename: "/etc/redhat-release".to_owned(),
351                                    #[allow(clippy::needless_raw_strings)]
352                                    regex: r"^ AlmaLinux \s .* \s 9 \. [0-9]".to_owned(),
353                                    os_id: "almalinux".to_owned(),
354                                    #[allow(clippy::needless_raw_strings)]
355                                    os_version_regex: r"^9(?:$|\.[0-9])".to_owned(),
356                                },
357                                supported: Supported {
358                                    repo: false,
359                                },
360                                commands: HashMap::from(
361                                    [
362                                        (
363                                            "package".to_owned(),
364                                            HashMap::from(
365                                                [
366                                                    (
367                                                        "install".to_owned(),
368                                                        vec![
369                                                            "dnf".to_owned(),
370                                                            "--disablerepo=*".to_owned(),
371                                                            "--enablerepo=appstream".to_owned(),
372                                                            "--enablerepo=baseos".to_owned(),
373                                                            "--enablerepo=crb".to_owned(),
374                                                            "--enablerepo=storpool-contrib".to_owned(),
375                                                            "install".to_owned(),
376                                                            "-q".to_owned(),
377                                                            "-y".to_owned(),
378                                                            "--".to_owned(),
379                                                        ],
380                                                    ),
381                                                    (
382                                                        "list_all".to_owned(),
383                                                        vec![
384                                                            "rpm".to_owned(),
385                                                            "-qa".to_owned(),
386                                                            "--qf".to_owned(),
387                                                            "%{Name}\\t%{EVR}\\t%{Arch}\\tii\\n".to_owned(),
388                                                            "--".to_owned(),
389                                                        ],
390                                                    ),
391                                                    (
392                                                        "purge".to_owned(),
393                                                        vec![
394                                                            "yum".to_owned(),
395                                                            "remove".to_owned(),
396                                                            "-q".to_owned(),
397                                                            "-y".to_owned(),
398                                                            "--".to_owned(),
399                                                        ],
400                                                    ),
401                                                    (
402                                                        "remove".to_owned(),
403                                                        vec![
404                                                            "yum".to_owned(),
405                                                            "remove".to_owned(),
406                                                            "-q".to_owned(),
407                                                            "-y".to_owned(),
408                                                            "--".to_owned(),
409                                                        ],
410                                                    ),
411                                                    (
412                                                        "remove_impl".to_owned(),
413                                                        vec![
414                                                            "rpm".to_owned(),
415                                                            "-e".to_owned(),
416                                                            "--".to_owned(),
417                                                        ],
418                                                    ),
419                                                    (
420                                                        "update_db".to_owned(),
421                                                        vec![
422                                                            "true".to_owned(),
423                                                        ],
424                                                    ),
425                                                ]
426                                            ),
427                                        ),
428                                        (
429                                            "pkgfile".to_owned(),
430                                            HashMap::from(
431                                                [
432                                                    (
433                                                        "dep_query".to_owned(),
434                                                        vec![
435                                                            "sh".to_owned(),
436                                                            "-c".to_owned(),
437                                                            "rpm -qpR -- \"$pkg\"".to_owned(),
438                                                        ],
439                                                    ),
440                                                    (
441                                                        "install".to_owned(),
442                                                        vec![
443                                                            "sh".to_owned(),
444                                                            "-c".to_owned(),
445                                                            "
446unset to_install to_reinstall
447for f in $packages; do
448    package=\"$(rpm -qp \"$f\")\"
449    if rpm -q -- \"$package\"; then
450        to_reinstall=\"$to_reinstall ./$f\"
451    else
452        to_install=\"$to_install ./$f\"
453    fi
454done
455
456if [ -n \"$to_install\" ]; then
457    dnf install -y --disablerepo='*' --enablerepo=appstream,baseos,crb,storpool-contrib --setopt=localpkg_gpgcheck=0 -- $to_install
458fi
459if [ -n \"$to_reinstall\" ]; then
460    dnf reinstall -y --disablerepo='*' --enablerepo=appstream,baseos,crb,storpool-contrib --setopt=localpkg_gpgcheck=0 -- $to_reinstall
461fi
462".to_owned(),
463                                                        ],
464                                                    ),
465                                                ]
466                                            ),
467                                        ),
468                                    ]
469                                ),
470                                min_sys_python: "3.9".to_owned(),
471                                repo:
472                                    Repo::Yum(YumRepo {
473                                        yumdef: "redhat/repo/storpool-centos.repo".to_owned(),
474                                        keyring: "redhat/repo/RPM-GPG-KEY-StorPool".to_owned(),
475                                    }),
476                                    package: HashMap::from(
477                                    [
478                                        ("KMOD".to_owned(), "kmod".to_owned()),
479                                        ("LIBCGROUP".to_owned(), "bash".to_owned()),
480                                        ("LIBUDEV".to_owned(), "systemd-libs".to_owned()),
481                                        ("OPENSSL".to_owned(), "openssl-libs".to_owned()),
482                                        ("PERL_AUTODIE".to_owned(), "perl-autodie".to_owned()),
483                                        ("PERL_FILE_PATH".to_owned(), "perl-File-Path".to_owned()),
484                                        ("PERL_LWP_PROTO_HTTPS".to_owned(), "perl-LWP-Protocol-https".to_owned()),
485                                        ("PERL_SYS_SYSLOG".to_owned(), "perl-Sys-Syslog".to_owned()),
486                                        ("PROCPS".to_owned(), "procps-ng".to_owned()),
487                                        ("PYTHON_SIMPLEJSON".to_owned(), "bash".to_owned()),
488                                        ("UDEV".to_owned(), "systemd".to_owned()),
489                                    ]
490                                ),
491                                systemd_lib: "usr/lib/systemd/system".to_owned(),
492                                file_ext: "rpm".to_owned(),
493                                initramfs_flavor: "mkinitrd".to_owned(),
494                                builder: Builder {
495                                    alias: "alma9".to_owned(),
496                                    base_image: "almalinux:9".to_owned(),
497                                    branch: "".to_owned(),
498                                    kernel_package: "kernel-core".to_owned(),
499                                    utf8_locale: "C.UTF-8".to_owned(),
500                                },
501                            },
502                    ),
503                    (
504                            VariantKind::CENTOS7,
505                            Variant {
506                                kind: VariantKind::CENTOS7,
507                                descr: "CentOS 7.x".to_owned(),
508                                family: "redhat".to_owned(),
509                                parent: "CENTOS8".to_owned(),
510                                detect: Detect {
511                                    filename: "/etc/redhat-release".to_owned(),
512                                    #[allow(clippy::needless_raw_strings)]
513                                    regex: r"^ (?: CentOS | Virtuozzo ) \s .* \s 7 \.".to_owned(),
514                                    os_id: "centos".to_owned(),
515                                    #[allow(clippy::needless_raw_strings)]
516                                    os_version_regex: r"^7(?:$|\.[0-9])".to_owned(),
517                                },
518                                supported: Supported {
519                                    repo: true,
520                                },
521                                commands: HashMap::from(
522                                    [
523                                        (
524                                            "package".to_owned(),
525                                            HashMap::from(
526                                                [
527                                                    (
528                                                        "install".to_owned(),
529                                                        vec![
530                                                            "yum".to_owned(),
531                                                            "--disablerepo=*".to_owned(),
532                                                            "--enablerepo=base".to_owned(),
533                                                            "--enablerepo=updates".to_owned(),
534                                                            "--enablerepo=storpool-contrib".to_owned(),
535                                                            "install".to_owned(),
536                                                            "-q".to_owned(),
537                                                            "-y".to_owned(),
538                                                        ],
539                                                    ),
540                                                    (
541                                                        "list_all".to_owned(),
542                                                        vec![
543                                                            "rpm".to_owned(),
544                                                            "-qa".to_owned(),
545                                                            "--qf".to_owned(),
546                                                            "%{Name}\\t%{EVR}\\t%{Arch}\\tii\\n".to_owned(),
547                                                            "--".to_owned(),
548                                                        ],
549                                                    ),
550                                                    (
551                                                        "purge".to_owned(),
552                                                        vec![
553                                                            "yum".to_owned(),
554                                                            "remove".to_owned(),
555                                                            "-q".to_owned(),
556                                                            "-y".to_owned(),
557                                                            "--".to_owned(),
558                                                        ],
559                                                    ),
560                                                    (
561                                                        "remove".to_owned(),
562                                                        vec![
563                                                            "yum".to_owned(),
564                                                            "remove".to_owned(),
565                                                            "-q".to_owned(),
566                                                            "-y".to_owned(),
567                                                            "--".to_owned(),
568                                                        ],
569                                                    ),
570                                                    (
571                                                        "remove_impl".to_owned(),
572                                                        vec![
573                                                            "rpm".to_owned(),
574                                                            "-e".to_owned(),
575                                                            "--".to_owned(),
576                                                        ],
577                                                    ),
578                                                    (
579                                                        "update_db".to_owned(),
580                                                        vec![
581                                                            "true".to_owned(),
582                                                        ],
583                                                    ),
584                                                ]
585                                            ),
586                                        ),
587                                        (
588                                            "pkgfile".to_owned(),
589                                            HashMap::from(
590                                                [
591                                                    (
592                                                        "dep_query".to_owned(),
593                                                        vec![
594                                                            "sh".to_owned(),
595                                                            "-c".to_owned(),
596                                                            "rpm -qpR -- \"$pkg\"".to_owned(),
597                                                        ],
598                                                    ),
599                                                    (
600                                                        "install".to_owned(),
601                                                        vec![
602                                                            "
603unset to_install to_reinstall
604for f in $packages; do
605    package=\"$(rpm -qp \"$f\")\"
606    if rpm -q -- \"$package\"; then
607        to_reinstall=\"$to_reinstall ./$f\"
608    else
609        to_install=\"$to_install ./$f\"
610    fi
611done
612
613if [ -n \"$to_install\" ]; then
614    yum install -y --disablerepo='*' --enablerepo=base,updates,storpool-contrib --setopt=localpkg_gpgcheck=0 -- $to_install
615fi
616if [ -n \"$to_reinstall\" ]; then
617    yum reinstall -y --disablerepo='*' --enablerepo=base,updates,storpool-contrib --setopt=localpkg_gpgcheck=0 -- $to_reinstall
618fi
619".to_owned(),
620                                                        ],
621                                                    ),
622                                                ]
623                                            ),
624                                        ),
625                                    ]
626                                ),
627                                min_sys_python: "3.6".to_owned(),
628                                repo:
629                                    Repo::Yum(YumRepo {
630                                        yumdef: "redhat/repo/storpool-centos.repo".to_owned(),
631                                        keyring: "redhat/repo/RPM-GPG-KEY-StorPool".to_owned(),
632                                    }),
633                                    package: HashMap::from(
634                                    [
635                                        ("KMOD".to_owned(), "kmod".to_owned()),
636                                        ("LIBCGROUP".to_owned(), "libcgroup-tools".to_owned()),
637                                        ("LIBUDEV".to_owned(), "systemd-libs".to_owned()),
638                                        ("OPENSSL".to_owned(), "openssl-libs".to_owned()),
639                                        ("PERL_AUTODIE".to_owned(), "perl-autodie".to_owned()),
640                                        ("PERL_FILE_PATH".to_owned(), "perl-File-Path".to_owned()),
641                                        ("PERL_LWP_PROTO_HTTPS".to_owned(), "perl-LWP-Protocol-https".to_owned()),
642                                        ("PERL_SYS_SYSLOG".to_owned(), "perl-Sys-Syslog".to_owned()),
643                                        ("PROCPS".to_owned(), "procps-ng".to_owned()),
644                                        ("PYTHON_SIMPLEJSON".to_owned(), "python2-simplejson".to_owned()),
645                                        ("UDEV".to_owned(), "systemd".to_owned()),
646                                    ]
647                                ),
648                                systemd_lib: "usr/lib/systemd/system".to_owned(),
649                                file_ext: "rpm".to_owned(),
650                                initramfs_flavor: "mkinitrd".to_owned(),
651                                builder: Builder {
652                                    alias: "centos7".to_owned(),
653                                    base_image: "centos:7".to_owned(),
654                                    branch: "centos/7".to_owned(),
655                                    kernel_package: "kernel".to_owned(),
656                                    utf8_locale: "en_US.utf8".to_owned(),
657                                },
658                            },
659                    ),
660                    (
661                            VariantKind::CENTOS8,
662                            Variant {
663                                kind: VariantKind::CENTOS8,
664                                descr: "CentOS 8.x".to_owned(),
665                                family: "redhat".to_owned(),
666                                parent: "ALMA8".to_owned(),
667                                detect: Detect {
668                                    filename: "/etc/redhat-release".to_owned(),
669                                    #[allow(clippy::needless_raw_strings)]
670                                    regex: r"^ CentOS \s .* \s 8 \. (?: [3-9] | (?: [12][0-9] ) )".to_owned(),
671                                    os_id: "centos".to_owned(),
672                                    #[allow(clippy::needless_raw_strings)]
673                                    os_version_regex: r"^8(?:$|\.[4-9]|\.[1-9][0-9])".to_owned(),
674                                },
675                                supported: Supported {
676                                    repo: true,
677                                },
678                                commands: HashMap::from(
679                                    [
680                                        (
681                                            "package".to_owned(),
682                                            HashMap::from(
683                                                [
684                                                    (
685                                                        "install".to_owned(),
686                                                        vec![
687                                                            "dnf".to_owned(),
688                                                            "--disablerepo=*".to_owned(),
689                                                            "--enablerepo=appstream".to_owned(),
690                                                            "--enablerepo=baseos".to_owned(),
691                                                            "--enablerepo=powertools".to_owned(),
692                                                            "--enablerepo=storpool-contrib".to_owned(),
693                                                            "install".to_owned(),
694                                                            "-q".to_owned(),
695                                                            "-y".to_owned(),
696                                                            "--".to_owned(),
697                                                        ],
698                                                    ),
699                                                    (
700                                                        "list_all".to_owned(),
701                                                        vec![
702                                                            "rpm".to_owned(),
703                                                            "-qa".to_owned(),
704                                                            "--qf".to_owned(),
705                                                            "%{Name}\\t%{EVR}\\t%{Arch}\\tii\\n".to_owned(),
706                                                            "--".to_owned(),
707                                                        ],
708                                                    ),
709                                                    (
710                                                        "purge".to_owned(),
711                                                        vec![
712                                                            "yum".to_owned(),
713                                                            "remove".to_owned(),
714                                                            "-q".to_owned(),
715                                                            "-y".to_owned(),
716                                                            "--".to_owned(),
717                                                        ],
718                                                    ),
719                                                    (
720                                                        "remove".to_owned(),
721                                                        vec![
722                                                            "yum".to_owned(),
723                                                            "remove".to_owned(),
724                                                            "-q".to_owned(),
725                                                            "-y".to_owned(),
726                                                            "--".to_owned(),
727                                                        ],
728                                                    ),
729                                                    (
730                                                        "remove_impl".to_owned(),
731                                                        vec![
732                                                            "rpm".to_owned(),
733                                                            "-e".to_owned(),
734                                                            "--".to_owned(),
735                                                        ],
736                                                    ),
737                                                    (
738                                                        "update_db".to_owned(),
739                                                        vec![
740                                                            "true".to_owned(),
741                                                        ],
742                                                    ),
743                                                ]
744                                            ),
745                                        ),
746                                        (
747                                            "pkgfile".to_owned(),
748                                            HashMap::from(
749                                                [
750                                                    (
751                                                        "dep_query".to_owned(),
752                                                        vec![
753                                                            "sh".to_owned(),
754                                                            "-c".to_owned(),
755                                                            "rpm -qpR -- \"$pkg\"".to_owned(),
756                                                        ],
757                                                    ),
758                                                    (
759                                                        "install".to_owned(),
760                                                        vec![
761                                                            "sh".to_owned(),
762                                                            "-c".to_owned(),
763                                                            "
764unset to_install to_reinstall
765for f in $packages; do
766    package=\"$(rpm -qp \"$f\")\"
767    if rpm -q -- \"$package\"; then
768        to_reinstall=\"$to_reinstall ./$f\"
769    else
770        to_install=\"$to_install ./$f\"
771    fi
772done
773
774if [ -n \"$to_install\" ]; then
775    dnf install -y --disablerepo='*' --enablerepo=appstream,baseos,storpool-contrib,powertools --setopt=localpkg_gpgcheck=0 -- $to_install
776fi
777if [ -n \"$to_reinstall\" ]; then
778    dnf reinstall -y --disablerepo='*' --enablerepo=appstream,baseos,storpool-contrib,powertools --setopt=localpkg_gpgcheck=0 -- $to_reinstall
779fi
780".to_owned(),
781                                                        ],
782                                                    ),
783                                                ]
784                                            ),
785                                        ),
786                                    ]
787                                ),
788                                min_sys_python: "3.6".to_owned(),
789                                repo:
790                                    Repo::Yum(YumRepo {
791                                        yumdef: "redhat/repo/storpool-centos.repo".to_owned(),
792                                        keyring: "redhat/repo/RPM-GPG-KEY-StorPool".to_owned(),
793                                    }),
794                                    package: HashMap::from(
795                                    [
796                                        ("KMOD".to_owned(), "kmod".to_owned()),
797                                        ("LIBCGROUP".to_owned(), "libcgroup-tools".to_owned()),
798                                        ("LIBUDEV".to_owned(), "systemd-libs".to_owned()),
799                                        ("OPENSSL".to_owned(), "openssl-libs".to_owned()),
800                                        ("PERL_AUTODIE".to_owned(), "perl-autodie".to_owned()),
801                                        ("PERL_FILE_PATH".to_owned(), "perl-File-Path".to_owned()),
802                                        ("PERL_LWP_PROTO_HTTPS".to_owned(), "perl-LWP-Protocol-https".to_owned()),
803                                        ("PERL_SYS_SYSLOG".to_owned(), "perl-Sys-Syslog".to_owned()),
804                                        ("PROCPS".to_owned(), "procps-ng".to_owned()),
805                                        ("PYTHON_SIMPLEJSON".to_owned(), "python2-simplejson".to_owned()),
806                                        ("UDEV".to_owned(), "systemd".to_owned()),
807                                    ]
808                                ),
809                                systemd_lib: "usr/lib/systemd/system".to_owned(),
810                                file_ext: "rpm".to_owned(),
811                                initramfs_flavor: "mkinitrd".to_owned(),
812                                builder: Builder {
813                                    alias: "centos8".to_owned(),
814                                    base_image: "centos:8".to_owned(),
815                                    branch: "centos/8".to_owned(),
816                                    kernel_package: "kernel-core".to_owned(),
817                                    utf8_locale: "C.UTF-8".to_owned(),
818                                },
819                            },
820                    ),
821                    (
822                            VariantKind::CENTOS9,
823                            Variant {
824                                kind: VariantKind::CENTOS9,
825                                descr: "CentOS Stream 9.x".to_owned(),
826                                family: "redhat".to_owned(),
827                                parent: "ALMA9".to_owned(),
828                                detect: Detect {
829                                    filename: "/etc/redhat-release".to_owned(),
830                                    #[allow(clippy::needless_raw_strings)]
831                                    regex: r"^ CentOS Stream release 9".to_owned(),
832                                    os_id: "centos".to_owned(),
833                                    #[allow(clippy::needless_raw_strings)]
834                                    os_version_regex: r"^9(?:$|\.[4-9]|\.[1-9][0-9])".to_owned(),
835                                },
836                                supported: Supported {
837                                    repo: false,
838                                },
839                                commands: HashMap::from(
840                                    [
841                                        (
842                                            "package".to_owned(),
843                                            HashMap::from(
844                                                [
845                                                    (
846                                                        "install".to_owned(),
847                                                        vec![
848                                                            "dnf".to_owned(),
849                                                            "--disablerepo=*".to_owned(),
850                                                            "--enablerepo=appstream".to_owned(),
851                                                            "--enablerepo=baseos".to_owned(),
852                                                            "--enablerepo=crb".to_owned(),
853                                                            "--enablerepo=storpool-contrib".to_owned(),
854                                                            "install".to_owned(),
855                                                            "-q".to_owned(),
856                                                            "-y".to_owned(),
857                                                            "--".to_owned(),
858                                                        ],
859                                                    ),
860                                                    (
861                                                        "list_all".to_owned(),
862                                                        vec![
863                                                            "rpm".to_owned(),
864                                                            "-qa".to_owned(),
865                                                            "--qf".to_owned(),
866                                                            "%{Name}\\t%{EVR}\\t%{Arch}\\tii\\n".to_owned(),
867                                                            "--".to_owned(),
868                                                        ],
869                                                    ),
870                                                    (
871                                                        "purge".to_owned(),
872                                                        vec![
873                                                            "yum".to_owned(),
874                                                            "remove".to_owned(),
875                                                            "-q".to_owned(),
876                                                            "-y".to_owned(),
877                                                            "--".to_owned(),
878                                                        ],
879                                                    ),
880                                                    (
881                                                        "remove".to_owned(),
882                                                        vec![
883                                                            "yum".to_owned(),
884                                                            "remove".to_owned(),
885                                                            "-q".to_owned(),
886                                                            "-y".to_owned(),
887                                                            "--".to_owned(),
888                                                        ],
889                                                    ),
890                                                    (
891                                                        "remove_impl".to_owned(),
892                                                        vec![
893                                                            "rpm".to_owned(),
894                                                            "-e".to_owned(),
895                                                            "--".to_owned(),
896                                                        ],
897                                                    ),
898                                                    (
899                                                        "update_db".to_owned(),
900                                                        vec![
901                                                            "true".to_owned(),
902                                                        ],
903                                                    ),
904                                                ]
905                                            ),
906                                        ),
907                                        (
908                                            "pkgfile".to_owned(),
909                                            HashMap::from(
910                                                [
911                                                    (
912                                                        "dep_query".to_owned(),
913                                                        vec![
914                                                            "sh".to_owned(),
915                                                            "-c".to_owned(),
916                                                            "rpm -qpR -- \"$pkg\"".to_owned(),
917                                                        ],
918                                                    ),
919                                                    (
920                                                        "install".to_owned(),
921                                                        vec![
922                                                            "sh".to_owned(),
923                                                            "-c".to_owned(),
924                                                            "
925unset to_install to_reinstall
926for f in $packages; do
927    package=\"$(rpm -qp \"$f\")\"
928    if rpm -q -- \"$package\"; then
929        to_reinstall=\"$to_reinstall ./$f\"
930    else
931        to_install=\"$to_install ./$f\"
932    fi
933done
934
935if [ -n \"$to_install\" ]; then
936    dnf install -y --disablerepo='*' --enablerepo=appstream,baseos,crb,storpool-contrib --setopt=localpkg_gpgcheck=0 -- $to_install
937fi
938if [ -n \"$to_reinstall\" ]; then
939    dnf reinstall -y --disablerepo='*' --enablerepo=appstream,baseos,crb,storpool-contrib --setopt=localpkg_gpgcheck=0 -- $to_reinstall
940fi
941".to_owned(),
942                                                        ],
943                                                    ),
944                                                ]
945                                            ),
946                                        ),
947                                    ]
948                                ),
949                                min_sys_python: "3.9".to_owned(),
950                                repo:
951                                    Repo::Yum(YumRepo {
952                                        yumdef: "redhat/repo/storpool-centos.repo".to_owned(),
953                                        keyring: "redhat/repo/RPM-GPG-KEY-StorPool".to_owned(),
954                                    }),
955                                    package: HashMap::from(
956                                    [
957                                        ("KMOD".to_owned(), "kmod".to_owned()),
958                                        ("LIBCGROUP".to_owned(), "bash".to_owned()),
959                                        ("LIBUDEV".to_owned(), "systemd-libs".to_owned()),
960                                        ("OPENSSL".to_owned(), "openssl-libs".to_owned()),
961                                        ("PERL_AUTODIE".to_owned(), "perl-autodie".to_owned()),
962                                        ("PERL_FILE_PATH".to_owned(), "perl-File-Path".to_owned()),
963                                        ("PERL_LWP_PROTO_HTTPS".to_owned(), "perl-LWP-Protocol-https".to_owned()),
964                                        ("PERL_SYS_SYSLOG".to_owned(), "perl-Sys-Syslog".to_owned()),
965                                        ("PROCPS".to_owned(), "procps-ng".to_owned()),
966                                        ("PYTHON_SIMPLEJSON".to_owned(), "bash".to_owned()),
967                                        ("UDEV".to_owned(), "systemd".to_owned()),
968                                    ]
969                                ),
970                                systemd_lib: "usr/lib/systemd/system".to_owned(),
971                                file_ext: "rpm".to_owned(),
972                                initramfs_flavor: "mkinitrd".to_owned(),
973                                builder: Builder {
974                                    alias: "centos9".to_owned(),
975                                    base_image: "quay.io/centos/centos:stream9".to_owned(),
976                                    branch: "centos/9".to_owned(),
977                                    kernel_package: "kernel-core".to_owned(),
978                                    utf8_locale: "C.UTF-8".to_owned(),
979                                },
980                            },
981                    ),
982                    (
983                            VariantKind::DEBIAN10,
984                            Variant {
985                                kind: VariantKind::DEBIAN10,
986                                descr: "Debian 10.x (buster)".to_owned(),
987                                family: "debian".to_owned(),
988                                parent: "DEBIAN11".to_owned(),
989                                detect: Detect {
990                                    filename: "/etc/os-release".to_owned(),
991                                    #[allow(clippy::needless_raw_strings)]
992                                    regex: r"^
993                    PRETTY_NAME= .*
994                    Debian \s+ GNU/Linux \s+
995                    (?: buster | 10 ) (?: \s | / )
996                ".to_owned(),
997                                    os_id: "debian".to_owned(),
998                                    #[allow(clippy::needless_raw_strings)]
999                                    os_version_regex: r"^10$".to_owned(),
1000                                },
1001                                supported: Supported {
1002                                    repo: false,
1003                                },
1004                                commands: HashMap::from(
1005                                    [
1006                                        (
1007                                            "package".to_owned(),
1008                                            HashMap::from(
1009                                                [
1010                                                    (
1011                                                        "install".to_owned(),
1012                                                        vec![
1013                                                            "env".to_owned(),
1014                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
1015                                                            "apt-get".to_owned(),
1016                                                            "-q".to_owned(),
1017                                                            "-y".to_owned(),
1018                                                            "--no-install-recommends".to_owned(),
1019                                                            "install".to_owned(),
1020                                                            "--".to_owned(),
1021                                                        ],
1022                                                    ),
1023                                                    (
1024                                                        "list_all".to_owned(),
1025                                                        vec![
1026                                                            "dpkg-query".to_owned(),
1027                                                            "-W".to_owned(),
1028                                                            "-f".to_owned(),
1029                                                            "${Package}\\t${Version}\\t${Architecture}\\t${db:Status-Abbrev}\\n".to_owned(),
1030                                                            "--".to_owned(),
1031                                                        ],
1032                                                    ),
1033                                                    (
1034                                                        "purge".to_owned(),
1035                                                        vec![
1036                                                            "env".to_owned(),
1037                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
1038                                                            "apt-get".to_owned(),
1039                                                            "-q".to_owned(),
1040                                                            "-y".to_owned(),
1041                                                            "purge".to_owned(),
1042                                                            "--".to_owned(),
1043                                                        ],
1044                                                    ),
1045                                                    (
1046                                                        "remove".to_owned(),
1047                                                        vec![
1048                                                            "env".to_owned(),
1049                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
1050                                                            "apt-get".to_owned(),
1051                                                            "-q".to_owned(),
1052                                                            "-y".to_owned(),
1053                                                            "remove".to_owned(),
1054                                                            "--".to_owned(),
1055                                                        ],
1056                                                    ),
1057                                                    (
1058                                                        "remove_impl".to_owned(),
1059                                                        vec![
1060                                                            "env".to_owned(),
1061                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
1062                                                            "dpkg".to_owned(),
1063                                                            "-r".to_owned(),
1064                                                            "--".to_owned(),
1065                                                        ],
1066                                                    ),
1067                                                    (
1068                                                        "update_db".to_owned(),
1069                                                        vec![
1070                                                            "apt-get".to_owned(),
1071                                                            "-q".to_owned(),
1072                                                            "-y".to_owned(),
1073                                                            "update".to_owned(),
1074                                                        ],
1075                                                    ),
1076                                                ]
1077                                            ),
1078                                        ),
1079                                        (
1080                                            "pkgfile".to_owned(),
1081                                            HashMap::from(
1082                                                [
1083                                                    (
1084                                                        "dep_query".to_owned(),
1085                                                        vec![
1086                                                            "sh".to_owned(),
1087                                                            "-c".to_owned(),
1088                                                            "dpkg-deb -f -- \"$pkg\" \"Depends\" | sed -e \"s/ *, */,/g\" | tr \",\" \"\\n\"".to_owned(),
1089                                                        ],
1090                                                    ),
1091                                                    (
1092                                                        "install".to_owned(),
1093                                                        vec![
1094                                                            "sh".to_owned(),
1095                                                            "-c".to_owned(),
1096                                                            "env DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --reinstall -y -o DPkg::Options::=--force-confnew -- $packages".to_owned(),
1097                                                        ],
1098                                                    ),
1099                                                ]
1100                                            ),
1101                                        ),
1102                                    ]
1103                                ),
1104                                min_sys_python: "3.7".to_owned(),
1105                                repo:
1106                                    Repo::Deb(DebRepo {
1107                                        codename: "buster".to_owned(),
1108                                        vendor: "debian".to_owned(),
1109                                        sources: "debian/repo/storpool.sources".to_owned(),
1110                                        keyring: "debian/repo/storpool-keyring.gpg".to_owned(),
1111                                        req_packages: vec![
1112                                            "ca-certificates".to_owned(),
1113                                        ],
1114                                    }),
1115                                    package: HashMap::from(
1116                                    [
1117                                        ("BINDINGS_PYTHON".to_owned(), "python".to_owned()),
1118                                        ("BINDINGS_PYTHON_CONFGET".to_owned(), "python-confget".to_owned()),
1119                                        ("BINDINGS_PYTHON_SIMPLEJSON".to_owned(), "python-simplejson".to_owned()),
1120                                        ("CGROUP".to_owned(), "cgroup-tools".to_owned()),
1121                                        ("CPUPOWER".to_owned(), "linux-cpupower".to_owned()),
1122                                        ("LIBSSL".to_owned(), "libssl1.1".to_owned()),
1123                                        ("MCELOG".to_owned(), "bash".to_owned()),
1124                                    ]
1125                                ),
1126                                systemd_lib: "lib/systemd/system".to_owned(),
1127                                file_ext: "deb".to_owned(),
1128                                initramfs_flavor: "update-initramfs".to_owned(),
1129                                builder: Builder {
1130                                    alias: "debian10".to_owned(),
1131                                    base_image: "debian:buster".to_owned(),
1132                                    branch: "debian/buster".to_owned(),
1133                                    kernel_package: "linux-headers".to_owned(),
1134                                    utf8_locale: "C.UTF-8".to_owned(),
1135                                },
1136                            },
1137                    ),
1138                    (
1139                            VariantKind::DEBIAN11,
1140                            Variant {
1141                                kind: VariantKind::DEBIAN11,
1142                                descr: "Debian 11.x (bullseye)".to_owned(),
1143                                family: "debian".to_owned(),
1144                                parent: "DEBIAN12".to_owned(),
1145                                detect: Detect {
1146                                    filename: "/etc/os-release".to_owned(),
1147                                    #[allow(clippy::needless_raw_strings)]
1148                                    regex: r"^
1149                    PRETTY_NAME= .*
1150                    Debian \s+ GNU/Linux \s+
1151                    (?: bullseye | 11 ) (?: \s | / )
1152                ".to_owned(),
1153                                    os_id: "debian".to_owned(),
1154                                    #[allow(clippy::needless_raw_strings)]
1155                                    os_version_regex: r"^11$".to_owned(),
1156                                },
1157                                supported: Supported {
1158                                    repo: true,
1159                                },
1160                                commands: HashMap::from(
1161                                    [
1162                                        (
1163                                            "package".to_owned(),
1164                                            HashMap::from(
1165                                                [
1166                                                    (
1167                                                        "install".to_owned(),
1168                                                        vec![
1169                                                            "env".to_owned(),
1170                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
1171                                                            "apt-get".to_owned(),
1172                                                            "-q".to_owned(),
1173                                                            "-y".to_owned(),
1174                                                            "--no-install-recommends".to_owned(),
1175                                                            "install".to_owned(),
1176                                                            "--".to_owned(),
1177                                                        ],
1178                                                    ),
1179                                                    (
1180                                                        "list_all".to_owned(),
1181                                                        vec![
1182                                                            "dpkg-query".to_owned(),
1183                                                            "-W".to_owned(),
1184                                                            "-f".to_owned(),
1185                                                            "${Package}\\t${Version}\\t${Architecture}\\t${db:Status-Abbrev}\\n".to_owned(),
1186                                                            "--".to_owned(),
1187                                                        ],
1188                                                    ),
1189                                                    (
1190                                                        "purge".to_owned(),
1191                                                        vec![
1192                                                            "env".to_owned(),
1193                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
1194                                                            "apt-get".to_owned(),
1195                                                            "-q".to_owned(),
1196                                                            "-y".to_owned(),
1197                                                            "purge".to_owned(),
1198                                                            "--".to_owned(),
1199                                                        ],
1200                                                    ),
1201                                                    (
1202                                                        "remove".to_owned(),
1203                                                        vec![
1204                                                            "env".to_owned(),
1205                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
1206                                                            "apt-get".to_owned(),
1207                                                            "-q".to_owned(),
1208                                                            "-y".to_owned(),
1209                                                            "remove".to_owned(),
1210                                                            "--".to_owned(),
1211                                                        ],
1212                                                    ),
1213                                                    (
1214                                                        "remove_impl".to_owned(),
1215                                                        vec![
1216                                                            "env".to_owned(),
1217                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
1218                                                            "dpkg".to_owned(),
1219                                                            "-r".to_owned(),
1220                                                            "--".to_owned(),
1221                                                        ],
1222                                                    ),
1223                                                    (
1224                                                        "update_db".to_owned(),
1225                                                        vec![
1226                                                            "apt-get".to_owned(),
1227                                                            "-q".to_owned(),
1228                                                            "-y".to_owned(),
1229                                                            "update".to_owned(),
1230                                                        ],
1231                                                    ),
1232                                                ]
1233                                            ),
1234                                        ),
1235                                        (
1236                                            "pkgfile".to_owned(),
1237                                            HashMap::from(
1238                                                [
1239                                                    (
1240                                                        "dep_query".to_owned(),
1241                                                        vec![
1242                                                            "sh".to_owned(),
1243                                                            "-c".to_owned(),
1244                                                            "dpkg-deb -f -- \"$pkg\" \"Depends\" | sed -e \"s/ *, */,/g\" | tr \",\" \"\\n\"".to_owned(),
1245                                                        ],
1246                                                    ),
1247                                                    (
1248                                                        "install".to_owned(),
1249                                                        vec![
1250                                                            "sh".to_owned(),
1251                                                            "-c".to_owned(),
1252                                                            "env DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --reinstall -y -o DPkg::Options::=--force-confnew -- $packages".to_owned(),
1253                                                        ],
1254                                                    ),
1255                                                ]
1256                                            ),
1257                                        ),
1258                                    ]
1259                                ),
1260                                min_sys_python: "3.9".to_owned(),
1261                                repo:
1262                                    Repo::Deb(DebRepo {
1263                                        codename: "bullseye".to_owned(),
1264                                        vendor: "debian".to_owned(),
1265                                        sources: "debian/repo/storpool.sources".to_owned(),
1266                                        keyring: "debian/repo/storpool-keyring.gpg".to_owned(),
1267                                        req_packages: vec![
1268                                            "ca-certificates".to_owned(),
1269                                        ],
1270                                    }),
1271                                    package: HashMap::from(
1272                                    [
1273                                        ("BINDINGS_PYTHON".to_owned(), "python3".to_owned()),
1274                                        ("BINDINGS_PYTHON_CONFGET".to_owned(), "python3-confget".to_owned()),
1275                                        ("BINDINGS_PYTHON_SIMPLEJSON".to_owned(), "python3-simplejson".to_owned()),
1276                                        ("CGROUP".to_owned(), "cgroup-tools".to_owned()),
1277                                        ("CPUPOWER".to_owned(), "linux-cpupower".to_owned()),
1278                                        ("LIBSSL".to_owned(), "libssl1.1".to_owned()),
1279                                        ("MCELOG".to_owned(), "bash".to_owned()),
1280                                    ]
1281                                ),
1282                                systemd_lib: "lib/systemd/system".to_owned(),
1283                                file_ext: "deb".to_owned(),
1284                                initramfs_flavor: "update-initramfs".to_owned(),
1285                                builder: Builder {
1286                                    alias: "debian11".to_owned(),
1287                                    base_image: "debian:bullseye".to_owned(),
1288                                    branch: "debian/bullseye".to_owned(),
1289                                    kernel_package: "linux-headers".to_owned(),
1290                                    utf8_locale: "C.UTF-8".to_owned(),
1291                                },
1292                            },
1293                    ),
1294                    (
1295                            VariantKind::DEBIAN12,
1296                            Variant {
1297                                kind: VariantKind::DEBIAN12,
1298                                descr: "Debian 12.x (bookworm)".to_owned(),
1299                                family: "debian".to_owned(),
1300                                parent: "DEBIAN13".to_owned(),
1301                                detect: Detect {
1302                                    filename: "/etc/os-release".to_owned(),
1303                                    #[allow(clippy::needless_raw_strings)]
1304                                    regex: r"^
1305                    PRETTY_NAME= .*
1306                    Debian \s+ GNU/Linux \s+
1307                    (?: bookworm | 12 ) (?: \s | / )
1308                ".to_owned(),
1309                                    os_id: "debian".to_owned(),
1310                                    #[allow(clippy::needless_raw_strings)]
1311                                    os_version_regex: r"^12$".to_owned(),
1312                                },
1313                                supported: Supported {
1314                                    repo: true,
1315                                },
1316                                commands: HashMap::from(
1317                                    [
1318                                        (
1319                                            "package".to_owned(),
1320                                            HashMap::from(
1321                                                [
1322                                                    (
1323                                                        "install".to_owned(),
1324                                                        vec![
1325                                                            "env".to_owned(),
1326                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
1327                                                            "apt-get".to_owned(),
1328                                                            "-q".to_owned(),
1329                                                            "-y".to_owned(),
1330                                                            "--no-install-recommends".to_owned(),
1331                                                            "install".to_owned(),
1332                                                            "--".to_owned(),
1333                                                        ],
1334                                                    ),
1335                                                    (
1336                                                        "list_all".to_owned(),
1337                                                        vec![
1338                                                            "dpkg-query".to_owned(),
1339                                                            "-W".to_owned(),
1340                                                            "-f".to_owned(),
1341                                                            "${Package}\\t${Version}\\t${Architecture}\\t${db:Status-Abbrev}\\n".to_owned(),
1342                                                            "--".to_owned(),
1343                                                        ],
1344                                                    ),
1345                                                    (
1346                                                        "purge".to_owned(),
1347                                                        vec![
1348                                                            "env".to_owned(),
1349                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
1350                                                            "apt-get".to_owned(),
1351                                                            "-q".to_owned(),
1352                                                            "-y".to_owned(),
1353                                                            "purge".to_owned(),
1354                                                            "--".to_owned(),
1355                                                        ],
1356                                                    ),
1357                                                    (
1358                                                        "remove".to_owned(),
1359                                                        vec![
1360                                                            "env".to_owned(),
1361                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
1362                                                            "apt-get".to_owned(),
1363                                                            "-q".to_owned(),
1364                                                            "-y".to_owned(),
1365                                                            "remove".to_owned(),
1366                                                            "--".to_owned(),
1367                                                        ],
1368                                                    ),
1369                                                    (
1370                                                        "remove_impl".to_owned(),
1371                                                        vec![
1372                                                            "env".to_owned(),
1373                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
1374                                                            "dpkg".to_owned(),
1375                                                            "-r".to_owned(),
1376                                                            "--".to_owned(),
1377                                                        ],
1378                                                    ),
1379                                                    (
1380                                                        "update_db".to_owned(),
1381                                                        vec![
1382                                                            "apt-get".to_owned(),
1383                                                            "-q".to_owned(),
1384                                                            "-y".to_owned(),
1385                                                            "update".to_owned(),
1386                                                        ],
1387                                                    ),
1388                                                ]
1389                                            ),
1390                                        ),
1391                                        (
1392                                            "pkgfile".to_owned(),
1393                                            HashMap::from(
1394                                                [
1395                                                    (
1396                                                        "dep_query".to_owned(),
1397                                                        vec![
1398                                                            "sh".to_owned(),
1399                                                            "-c".to_owned(),
1400                                                            "dpkg-deb -f -- \"$pkg\" \"Depends\" | sed -e \"s/ *, */,/g\" | tr \",\" \"\\n\"".to_owned(),
1401                                                        ],
1402                                                    ),
1403                                                    (
1404                                                        "install".to_owned(),
1405                                                        vec![
1406                                                            "sh".to_owned(),
1407                                                            "-c".to_owned(),
1408                                                            "env DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --reinstall -y -o DPkg::Options::=--force-confnew -- $packages".to_owned(),
1409                                                        ],
1410                                                    ),
1411                                                ]
1412                                            ),
1413                                        ),
1414                                    ]
1415                                ),
1416                                min_sys_python: "3.11".to_owned(),
1417                                repo:
1418                                    Repo::Deb(DebRepo {
1419                                        codename: "bookworm".to_owned(),
1420                                        vendor: "debian".to_owned(),
1421                                        sources: "debian/repo/storpool.sources".to_owned(),
1422                                        keyring: "debian/repo/storpool-keyring.gpg".to_owned(),
1423                                        req_packages: vec![
1424                                            "ca-certificates".to_owned(),
1425                                        ],
1426                                    }),
1427                                    package: HashMap::from(
1428                                    [
1429                                        ("BINDINGS_PYTHON".to_owned(), "python3".to_owned()),
1430                                        ("BINDINGS_PYTHON_CONFGET".to_owned(), "python3-confget".to_owned()),
1431                                        ("BINDINGS_PYTHON_SIMPLEJSON".to_owned(), "python3-simplejson".to_owned()),
1432                                        ("CGROUP".to_owned(), "cgroup-tools".to_owned()),
1433                                        ("CPUPOWER".to_owned(), "linux-cpupower".to_owned()),
1434                                        ("LIBSSL".to_owned(), "libssl3".to_owned()),
1435                                        ("MCELOG".to_owned(), "bash".to_owned()),
1436                                    ]
1437                                ),
1438                                systemd_lib: "lib/systemd/system".to_owned(),
1439                                file_ext: "deb".to_owned(),
1440                                initramfs_flavor: "update-initramfs".to_owned(),
1441                                builder: Builder {
1442                                    alias: "debian12".to_owned(),
1443                                    base_image: "debian:bookworm".to_owned(),
1444                                    branch: "debian/bookworm".to_owned(),
1445                                    kernel_package: "linux-headers".to_owned(),
1446                                    utf8_locale: "C.UTF-8".to_owned(),
1447                                },
1448                            },
1449                    ),
1450                    (
1451                            VariantKind::DEBIAN13,
1452                            Variant {
1453                                kind: VariantKind::DEBIAN13,
1454                                descr: "Debian 13.x (trixie/unstable)".to_owned(),
1455                                family: "debian".to_owned(),
1456                                parent: "".to_owned(),
1457                                detect: Detect {
1458                                    filename: "/etc/os-release".to_owned(),
1459                                    #[allow(clippy::needless_raw_strings)]
1460                                    regex: r"^
1461                    PRETTY_NAME= .*
1462                    Debian \s+ GNU/Linux \s+
1463                    (?: trixie | 13 ) (?: \s | / )
1464                ".to_owned(),
1465                                    os_id: "debian".to_owned(),
1466                                    #[allow(clippy::needless_raw_strings)]
1467                                    os_version_regex: r"^13$".to_owned(),
1468                                },
1469                                supported: Supported {
1470                                    repo: false,
1471                                },
1472                                commands: HashMap::from(
1473                                    [
1474                                        (
1475                                            "package".to_owned(),
1476                                            HashMap::from(
1477                                                [
1478                                                    (
1479                                                        "install".to_owned(),
1480                                                        vec![
1481                                                            "env".to_owned(),
1482                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
1483                                                            "apt-get".to_owned(),
1484                                                            "-q".to_owned(),
1485                                                            "-y".to_owned(),
1486                                                            "--no-install-recommends".to_owned(),
1487                                                            "install".to_owned(),
1488                                                            "--".to_owned(),
1489                                                        ],
1490                                                    ),
1491                                                    (
1492                                                        "list_all".to_owned(),
1493                                                        vec![
1494                                                            "dpkg-query".to_owned(),
1495                                                            "-W".to_owned(),
1496                                                            "-f".to_owned(),
1497                                                            "${Package}\\t${Version}\\t${Architecture}\\t${db:Status-Abbrev}\\n".to_owned(),
1498                                                            "--".to_owned(),
1499                                                        ],
1500                                                    ),
1501                                                    (
1502                                                        "purge".to_owned(),
1503                                                        vec![
1504                                                            "env".to_owned(),
1505                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
1506                                                            "apt-get".to_owned(),
1507                                                            "-q".to_owned(),
1508                                                            "-y".to_owned(),
1509                                                            "purge".to_owned(),
1510                                                            "--".to_owned(),
1511                                                        ],
1512                                                    ),
1513                                                    (
1514                                                        "remove".to_owned(),
1515                                                        vec![
1516                                                            "env".to_owned(),
1517                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
1518                                                            "apt-get".to_owned(),
1519                                                            "-q".to_owned(),
1520                                                            "-y".to_owned(),
1521                                                            "remove".to_owned(),
1522                                                            "--".to_owned(),
1523                                                        ],
1524                                                    ),
1525                                                    (
1526                                                        "remove_impl".to_owned(),
1527                                                        vec![
1528                                                            "env".to_owned(),
1529                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
1530                                                            "dpkg".to_owned(),
1531                                                            "-r".to_owned(),
1532                                                            "--".to_owned(),
1533                                                        ],
1534                                                    ),
1535                                                    (
1536                                                        "update_db".to_owned(),
1537                                                        vec![
1538                                                            "apt-get".to_owned(),
1539                                                            "-q".to_owned(),
1540                                                            "-y".to_owned(),
1541                                                            "update".to_owned(),
1542                                                        ],
1543                                                    ),
1544                                                ]
1545                                            ),
1546                                        ),
1547                                        (
1548                                            "pkgfile".to_owned(),
1549                                            HashMap::from(
1550                                                [
1551                                                    (
1552                                                        "dep_query".to_owned(),
1553                                                        vec![
1554                                                            "sh".to_owned(),
1555                                                            "-c".to_owned(),
1556                                                            "dpkg-deb -f -- \"$pkg\" \"Depends\" | sed -e \"s/ *, */,/g\" | tr \",\" \"\\n\"".to_owned(),
1557                                                        ],
1558                                                    ),
1559                                                    (
1560                                                        "install".to_owned(),
1561                                                        vec![
1562                                                            "sh".to_owned(),
1563                                                            "-c".to_owned(),
1564                                                            "env DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --reinstall -y -o DPkg::Options::=--force-confnew -- $packages".to_owned(),
1565                                                        ],
1566                                                    ),
1567                                                ]
1568                                            ),
1569                                        ),
1570                                    ]
1571                                ),
1572                                min_sys_python: "3.11".to_owned(),
1573                                repo:
1574                                    Repo::Deb(DebRepo {
1575                                        codename: "unstable".to_owned(),
1576                                        vendor: "debian".to_owned(),
1577                                        sources: "debian/repo/storpool.sources".to_owned(),
1578                                        keyring: "debian/repo/storpool-keyring.gpg".to_owned(),
1579                                        req_packages: vec![
1580                                            "ca-certificates".to_owned(),
1581                                        ],
1582                                    }),
1583                                    package: HashMap::from(
1584                                    [
1585                                        ("BINDINGS_PYTHON".to_owned(), "python3".to_owned()),
1586                                        ("BINDINGS_PYTHON_CONFGET".to_owned(), "python3-confget".to_owned()),
1587                                        ("BINDINGS_PYTHON_SIMPLEJSON".to_owned(), "python3-simplejson".to_owned()),
1588                                        ("CGROUP".to_owned(), "cgroup-tools".to_owned()),
1589                                        ("CPUPOWER".to_owned(), "linux-cpupower".to_owned()),
1590                                        ("LIBSSL".to_owned(), "libssl3".to_owned()),
1591                                        ("MCELOG".to_owned(), "bash".to_owned()),
1592                                    ]
1593                                ),
1594                                systemd_lib: "lib/systemd/system".to_owned(),
1595                                file_ext: "deb".to_owned(),
1596                                initramfs_flavor: "update-initramfs".to_owned(),
1597                                builder: Builder {
1598                                    alias: "debian13".to_owned(),
1599                                    base_image: "debian:unstable".to_owned(),
1600                                    branch: "debian/unstable".to_owned(),
1601                                    kernel_package: "linux-headers".to_owned(),
1602                                    utf8_locale: "C.UTF-8".to_owned(),
1603                                },
1604                            },
1605                    ),
1606                    (
1607                            VariantKind::ORACLE7,
1608                            Variant {
1609                                kind: VariantKind::ORACLE7,
1610                                descr: "Oracle Linux 7.x".to_owned(),
1611                                family: "redhat".to_owned(),
1612                                parent: "CENTOS7".to_owned(),
1613                                detect: Detect {
1614                                    filename: "/etc/oracle-release".to_owned(),
1615                                    #[allow(clippy::needless_raw_strings)]
1616                                    regex: r"^ Oracle \s+ Linux \s .* \s 7 \.".to_owned(),
1617                                    os_id: "ol".to_owned(),
1618                                    #[allow(clippy::needless_raw_strings)]
1619                                    os_version_regex: r"^7(?:$|\.[0-9])".to_owned(),
1620                                },
1621                                supported: Supported {
1622                                    repo: true,
1623                                },
1624                                commands: HashMap::from(
1625                                    [
1626                                        (
1627                                            "package".to_owned(),
1628                                            HashMap::from(
1629                                                [
1630                                                    (
1631                                                        "install".to_owned(),
1632                                                        vec![
1633                                                            "yum".to_owned(),
1634                                                            "--disablerepo=*".to_owned(),
1635                                                            "--enablerepo=base".to_owned(),
1636                                                            "--enablerepo=updates".to_owned(),
1637                                                            "--enablerepo=storpool-contrib".to_owned(),
1638                                                            "install".to_owned(),
1639                                                            "-q".to_owned(),
1640                                                            "-y".to_owned(),
1641                                                        ],
1642                                                    ),
1643                                                    (
1644                                                        "list_all".to_owned(),
1645                                                        vec![
1646                                                            "rpm".to_owned(),
1647                                                            "-qa".to_owned(),
1648                                                            "--qf".to_owned(),
1649                                                            "%{Name}\\t%{EVR}\\t%{Arch}\\tii\\n".to_owned(),
1650                                                            "--".to_owned(),
1651                                                        ],
1652                                                    ),
1653                                                    (
1654                                                        "purge".to_owned(),
1655                                                        vec![
1656                                                            "yum".to_owned(),
1657                                                            "remove".to_owned(),
1658                                                            "-q".to_owned(),
1659                                                            "-y".to_owned(),
1660                                                            "--".to_owned(),
1661                                                        ],
1662                                                    ),
1663                                                    (
1664                                                        "remove".to_owned(),
1665                                                        vec![
1666                                                            "yum".to_owned(),
1667                                                            "remove".to_owned(),
1668                                                            "-q".to_owned(),
1669                                                            "-y".to_owned(),
1670                                                            "--".to_owned(),
1671                                                        ],
1672                                                    ),
1673                                                    (
1674                                                        "remove_impl".to_owned(),
1675                                                        vec![
1676                                                            "rpm".to_owned(),
1677                                                            "-e".to_owned(),
1678                                                            "--".to_owned(),
1679                                                        ],
1680                                                    ),
1681                                                    (
1682                                                        "update_db".to_owned(),
1683                                                        vec![
1684                                                            "true".to_owned(),
1685                                                        ],
1686                                                    ),
1687                                                ]
1688                                            ),
1689                                        ),
1690                                        (
1691                                            "pkgfile".to_owned(),
1692                                            HashMap::from(
1693                                                [
1694                                                    (
1695                                                        "dep_query".to_owned(),
1696                                                        vec![
1697                                                            "sh".to_owned(),
1698                                                            "-c".to_owned(),
1699                                                            "rpm -qpR -- \"$pkg\"".to_owned(),
1700                                                        ],
1701                                                    ),
1702                                                    (
1703                                                        "install".to_owned(),
1704                                                        vec![
1705                                                            "
1706unset to_install to_reinstall
1707for f in $packages; do
1708    package=\"$(rpm -qp \"$f\")\"
1709    if rpm -q -- \"$package\"; then
1710        to_reinstall=\"$to_reinstall ./$f\"
1711    else
1712        to_install=\"$to_install ./$f\"
1713    fi
1714done
1715
1716if [ -n \"$to_install\" ]; then
1717    yum install -y --disablerepo='*' --enablerepo=base,updates,storpool-contrib --setopt=localpkg_gpgcheck=0 -- $to_install
1718fi
1719if [ -n \"$to_reinstall\" ]; then
1720    yum reinstall -y --disablerepo='*' --enablerepo=base,updates,storpool-contrib --setopt=localpkg_gpgcheck=0 -- $to_reinstall
1721fi
1722".to_owned(),
1723                                                        ],
1724                                                    ),
1725                                                ]
1726                                            ),
1727                                        ),
1728                                    ]
1729                                ),
1730                                min_sys_python: "3.6".to_owned(),
1731                                repo:
1732                                    Repo::Yum(YumRepo {
1733                                        yumdef: "redhat/repo/storpool-centos.repo".to_owned(),
1734                                        keyring: "redhat/repo/RPM-GPG-KEY-StorPool".to_owned(),
1735                                    }),
1736                                    package: HashMap::from(
1737                                    [
1738                                        ("KMOD".to_owned(), "kmod".to_owned()),
1739                                        ("LIBCGROUP".to_owned(), "libcgroup-tools".to_owned()),
1740                                        ("LIBUDEV".to_owned(), "systemd-libs".to_owned()),
1741                                        ("OPENSSL".to_owned(), "openssl-libs".to_owned()),
1742                                        ("PERL_AUTODIE".to_owned(), "perl-autodie".to_owned()),
1743                                        ("PERL_FILE_PATH".to_owned(), "perl-File-Path".to_owned()),
1744                                        ("PERL_LWP_PROTO_HTTPS".to_owned(), "perl-LWP-Protocol-https".to_owned()),
1745                                        ("PERL_SYS_SYSLOG".to_owned(), "perl-Sys-Syslog".to_owned()),
1746                                        ("PROCPS".to_owned(), "procps-ng".to_owned()),
1747                                        ("PYTHON_SIMPLEJSON".to_owned(), "python2-simplejson".to_owned()),
1748                                        ("UDEV".to_owned(), "systemd".to_owned()),
1749                                    ]
1750                                ),
1751                                systemd_lib: "usr/lib/systemd/system".to_owned(),
1752                                file_ext: "rpm".to_owned(),
1753                                initramfs_flavor: "mkinitrd".to_owned(),
1754                                builder: Builder {
1755                                    alias: "oracle7".to_owned(),
1756                                    base_image: "IGNORE".to_owned(),
1757                                    branch: "".to_owned(),
1758                                    kernel_package: "kernel".to_owned(),
1759                                    utf8_locale: "en_US.utf8".to_owned(),
1760                                },
1761                            },
1762                    ),
1763                    (
1764                            VariantKind::ORACLE8,
1765                            Variant {
1766                                kind: VariantKind::ORACLE8,
1767                                descr: "Oracle Linux 8.x".to_owned(),
1768                                family: "redhat".to_owned(),
1769                                parent: "ALMA8".to_owned(),
1770                                detect: Detect {
1771                                    filename: "/etc/oracle-release".to_owned(),
1772                                    #[allow(clippy::needless_raw_strings)]
1773                                    regex: r"^ Oracle \s+ Linux \s+ Server \s+ release \s .* \s 8 \. (?: [4-9] | [1-9][0-9] )".to_owned(),
1774                                    os_id: "ol".to_owned(),
1775                                    #[allow(clippy::needless_raw_strings)]
1776                                    os_version_regex: r"^8(?:$|\.[4-9]|\.[1-9][0-9])".to_owned(),
1777                                },
1778                                supported: Supported {
1779                                    repo: true,
1780                                },
1781                                commands: HashMap::from(
1782                                    [
1783                                        (
1784                                            "package".to_owned(),
1785                                            HashMap::from(
1786                                                [
1787                                                    (
1788                                                        "install".to_owned(),
1789                                                        vec![
1790                                                            "dnf".to_owned(),
1791                                                            "--disablerepo=*".to_owned(),
1792                                                            "--enablerepo=ol8_appstream".to_owned(),
1793                                                            "--enablerepo=ol8_baseos_latest".to_owned(),
1794                                                            "--enablerepo=ol8_codeready_builder".to_owned(),
1795                                                            "--enablerepo=storpool-contrib".to_owned(),
1796                                                            "install".to_owned(),
1797                                                            "-q".to_owned(),
1798                                                            "-y".to_owned(),
1799                                                            "--".to_owned(),
1800                                                        ],
1801                                                    ),
1802                                                    (
1803                                                        "list_all".to_owned(),
1804                                                        vec![
1805                                                            "rpm".to_owned(),
1806                                                            "-qa".to_owned(),
1807                                                            "--qf".to_owned(),
1808                                                            "%{Name}\\t%{EVR}\\t%{Arch}\\tii\\n".to_owned(),
1809                                                            "--".to_owned(),
1810                                                        ],
1811                                                    ),
1812                                                    (
1813                                                        "purge".to_owned(),
1814                                                        vec![
1815                                                            "yum".to_owned(),
1816                                                            "remove".to_owned(),
1817                                                            "-q".to_owned(),
1818                                                            "-y".to_owned(),
1819                                                            "--".to_owned(),
1820                                                        ],
1821                                                    ),
1822                                                    (
1823                                                        "remove".to_owned(),
1824                                                        vec![
1825                                                            "yum".to_owned(),
1826                                                            "remove".to_owned(),
1827                                                            "-q".to_owned(),
1828                                                            "-y".to_owned(),
1829                                                            "--".to_owned(),
1830                                                        ],
1831                                                    ),
1832                                                    (
1833                                                        "remove_impl".to_owned(),
1834                                                        vec![
1835                                                            "rpm".to_owned(),
1836                                                            "-e".to_owned(),
1837                                                            "--".to_owned(),
1838                                                        ],
1839                                                    ),
1840                                                    (
1841                                                        "update_db".to_owned(),
1842                                                        vec![
1843                                                            "true".to_owned(),
1844                                                        ],
1845                                                    ),
1846                                                ]
1847                                            ),
1848                                        ),
1849                                        (
1850                                            "pkgfile".to_owned(),
1851                                            HashMap::from(
1852                                                [
1853                                                    (
1854                                                        "dep_query".to_owned(),
1855                                                        vec![
1856                                                            "sh".to_owned(),
1857                                                            "-c".to_owned(),
1858                                                            "rpm -qpR -- \"$pkg\"".to_owned(),
1859                                                        ],
1860                                                    ),
1861                                                    (
1862                                                        "install".to_owned(),
1863                                                        vec![
1864                                                            "sh".to_owned(),
1865                                                            "-c".to_owned(),
1866                                                            "
1867unset to_install to_reinstall
1868for f in $packages; do
1869    package=\"$(rpm -qp \"$f\")\"
1870    if rpm -q -- \"$package\"; then
1871        to_reinstall=\"$to_reinstall ./$f\"
1872    else
1873        to_install=\"$to_install ./$f\"
1874    fi
1875done
1876
1877if [ -n \"$to_install\" ]; then
1878    dnf install -y --disablerepo='*' --enablerepo=ol8_appstream,ol8_codeready_builder,ol8_baseos_latest,storpool-contrib --setopt=localpkg_gpgcheck=0 -- $to_install
1879fi
1880if [ -n \"$to_reinstall\" ]; then
1881    dnf reinstall -y --disablerepo='*' --enablerepo=ol8_appstream,ol8_codeready_builder,ol8_baseos_latest,storpool-contrib --setopt=localpkg_gpgcheck=0 -- $to_reinstall
1882fi
1883".to_owned(),
1884                                                        ],
1885                                                    ),
1886                                                ]
1887                                            ),
1888                                        ),
1889                                    ]
1890                                ),
1891                                min_sys_python: "3.6".to_owned(),
1892                                repo:
1893                                    Repo::Yum(YumRepo {
1894                                        yumdef: "redhat/repo/storpool-centos.repo".to_owned(),
1895                                        keyring: "redhat/repo/RPM-GPG-KEY-StorPool".to_owned(),
1896                                    }),
1897                                    package: HashMap::from(
1898                                    [
1899                                        ("KMOD".to_owned(), "kmod".to_owned()),
1900                                        ("LIBCGROUP".to_owned(), "libcgroup-tools".to_owned()),
1901                                        ("LIBUDEV".to_owned(), "systemd-libs".to_owned()),
1902                                        ("OPENSSL".to_owned(), "openssl-libs".to_owned()),
1903                                        ("PERL_AUTODIE".to_owned(), "perl-autodie".to_owned()),
1904                                        ("PERL_FILE_PATH".to_owned(), "perl-File-Path".to_owned()),
1905                                        ("PERL_LWP_PROTO_HTTPS".to_owned(), "perl-LWP-Protocol-https".to_owned()),
1906                                        ("PERL_SYS_SYSLOG".to_owned(), "perl-Sys-Syslog".to_owned()),
1907                                        ("PROCPS".to_owned(), "procps-ng".to_owned()),
1908                                        ("PYTHON_SIMPLEJSON".to_owned(), "python2-simplejson".to_owned()),
1909                                        ("UDEV".to_owned(), "systemd".to_owned()),
1910                                    ]
1911                                ),
1912                                systemd_lib: "usr/lib/systemd/system".to_owned(),
1913                                file_ext: "rpm".to_owned(),
1914                                initramfs_flavor: "mkinitrd".to_owned(),
1915                                builder: Builder {
1916                                    alias: "oracle8".to_owned(),
1917                                    base_image: "oraclelinux:8".to_owned(),
1918                                    branch: "".to_owned(),
1919                                    kernel_package: "kernel-core".to_owned(),
1920                                    utf8_locale: "C.UTF-8".to_owned(),
1921                                },
1922                            },
1923                    ),
1924                    (
1925                        VariantKind::ORACLE9,
1926                        Variant {
1927                            kind: VariantKind::ORACLE9,
1928                            descr: "Oracle Linux 9.x".to_owned(),
1929                            family: "redhat".to_owned(),
1930                            parent: "".to_owned(),
1931                            detect: Detect {
1932                                filename: "/etc/oracle-release".to_owned(),
1933                                #[allow(clippy::needless_raw_strings)]
1934                                regex: r"^ Oracle \s+ Linux \s+ Server \s+ release \s .* \s 9 \. (?: [4-9] | [1-9][0-9] )".to_owned(),
1935                                os_id: "ol".to_owned(),
1936                                #[allow(clippy::needless_raw_strings)]
1937                                os_version_regex: r"^9(?:$|\.[0-9])".to_owned(),
1938                            },
1939                            supported: Supported {
1940                                repo: false,
1941                            },
1942                            commands: HashMap::from(
1943                                [
1944                                    (
1945                                        "package".to_owned(),
1946                                        HashMap::from(
1947                                            [
1948                                                (
1949                                                    "install".to_owned(),
1950                                                    vec![
1951                                                        "dnf".to_owned(),
1952                                                        "--disablerepo=*".to_owned(),
1953                                                        "--enablerepo=ol9_appstream".to_owned(),
1954                                                        "--enablerepo=ol9_baseos_latest".to_owned(),
1955                                                        "--enablerepo=ol9_codeready_builder".to_owned(),
1956                                                        "--enablerepo=storpool-contrib".to_owned(),
1957                                                        "install".to_owned(),
1958                                                        "-q".to_owned(),
1959                                                        "-y".to_owned(),
1960                                                        "--".to_owned(),
1961                                                    ],
1962                                                ),
1963                                                (
1964                                                    "list_all".to_owned(),
1965                                                    vec![
1966                                                        "rpm".to_owned(),
1967                                                        "-qa".to_owned(),
1968                                                        "--qf".to_owned(),
1969                                                        "%{Name}\\t%{EVR}\\t%{Arch}\\tii\\n".to_owned(),
1970                                                        "--".to_owned(),
1971                                                    ],
1972                                                ),
1973                                                (
1974                                                    "purge".to_owned(),
1975                                                    vec![
1976                                                        "yum".to_owned(),
1977                                                        "remove".to_owned(),
1978                                                        "-q".to_owned(),
1979                                                        "-y".to_owned(),
1980                                                        "--".to_owned(),
1981                                                    ],
1982                                                ),
1983                                                (
1984                                                    "remove".to_owned(),
1985                                                    vec![
1986                                                        "yum".to_owned(),
1987                                                        "remove".to_owned(),
1988                                                        "-q".to_owned(),
1989                                                        "-y".to_owned(),
1990                                                        "--".to_owned(),
1991                                                    ],
1992                                                ),
1993                                                (
1994                                                    "remove_impl".to_owned(),
1995                                                    vec![
1996                                                        "rpm".to_owned(),
1997                                                        "-e".to_owned(),
1998                                                        "--".to_owned(),
1999                                                    ],
2000                                                ),
2001                                                (
2002                                                    "update_db".to_owned(),
2003                                                    vec![
2004                                                        "true".to_owned(),
2005                                                    ],
2006                                                ),
2007                                            ]
2008                                        ),
2009                                    ),
2010                                    (
2011                                        "pkgfile".to_owned(),
2012                                        HashMap::from(
2013                                            [
2014                                                (
2015                                                    "dep_query".to_owned(),
2016                                                    vec![
2017                                                        "sh".to_owned(),
2018                                                        "-c".to_owned(),
2019                                                        "rpm -qpR -- \"$pkg\"".to_owned(),
2020                                                    ],
2021                                                ),
2022                                                (
2023                                                    "install".to_owned(),
2024                                                    vec![
2025                                                        "sh".to_owned(),
2026                                                        "-c".to_owned(),
2027                                                        "
2028unset to_install to_reinstall
2029for f in $packages; do
2030    package=\"$(rpm -qp \"$f\")\"
2031    if rpm -q -- \"$package\"; then
2032        to_reinstall=\"$to_reinstall ./$f\"
2033    else
2034        to_install=\"$to_install ./$f\"
2035    fi
2036done
2037
2038if [ -n \"$to_install\" ]; then
2039    dnf install -y --disablerepo='*' --enablerepo=ol9_appstream,ol9_codeready_builder,ol9_baseos_latest,storpool-contrib --setopt=localpkg_gpgcheck=0 -- $to_install
2040fi
2041if [ -n \"$to_reinstall\" ]; then
2042    dnf reinstall -y --disablerepo='*' --enablerepo=ol9_appstream,ol9_codeready_builder,ol9_baseos_latest,storpool-contrib --setopt=localpkg_gpgcheck=0 -- $to_reinstall
2043fi
2044".to_owned(),
2045                                                    ],
2046                                                ),
2047                                            ]
2048                                        ),
2049                                    ),
2050                                ]
2051                            ),
2052                            min_sys_python: "3.9".to_owned(),
2053                            repo:
2054                            Repo::Yum(YumRepo {
2055                                yumdef: "redhat/repo/storpool-centos.repo".to_owned(),
2056                                keyring: "redhat/repo/RPM-GPG-KEY-StorPool".to_owned(),
2057                            }),
2058                            package: HashMap::from(
2059                                [
2060                                    ("KMOD".to_owned(), "kmod".to_owned()),
2061                                    ("LIBCGROUP".to_owned(), "bash".to_owned()),
2062                                    ("LIBUDEV".to_owned(), "systemd-libs".to_owned()),
2063                                    ("OPENSSL".to_owned(), "openssl-libs".to_owned()),
2064                                    ("PERL_AUTODIE".to_owned(), "perl-autodie".to_owned()),
2065                                    ("PERL_FILE_PATH".to_owned(), "perl-File-Path".to_owned()),
2066                                    ("PERL_LWP_PROTO_HTTPS".to_owned(), "perl-LWP-Protocol-https".to_owned()),
2067                                    ("PERL_SYS_SYSLOG".to_owned(), "perl-Sys-Syslog".to_owned()),
2068                                    ("PROCPS".to_owned(), "procps-ng".to_owned()),
2069                                    ("PYTHON_SIMPLEJSON".to_owned(), "bash".to_owned()),
2070                                    ("UDEV".to_owned(), "systemd".to_owned()),
2071                                ]
2072                            ),
2073                            systemd_lib: "usr/lib/systemd/system".to_owned(),
2074                            file_ext: "rpm".to_owned(),
2075                            initramfs_flavor: "mkinitrd".to_owned(),
2076                            builder: Builder {
2077                                alias: "oracle9".to_owned(),
2078                                base_image: "oraclelinux:9".to_owned(),
2079                                branch: "".to_owned(),
2080                                kernel_package: "kernel-core".to_owned(),
2081                                utf8_locale: "C.UTF-8".to_owned(),
2082                            },
2083                        },
2084                    ),
2085                    (
2086                            VariantKind::RHEL8,
2087                            Variant {
2088                                kind: VariantKind::RHEL8,
2089                                descr: "RedHat Enterprise Linux 8.x".to_owned(),
2090                                family: "redhat".to_owned(),
2091                                parent: "CENTOS8".to_owned(),
2092                                detect: Detect {
2093                                    filename: "/etc/redhat-release".to_owned(),
2094                                    #[allow(clippy::needless_raw_strings)]
2095                                    regex: r"^ Red \s+ Hat \s+ Enterprise \s+ Linux \s .* \s 8 \. (?: [4-9] | [1-9][0-9] )".to_owned(),
2096                                    os_id: "rhel".to_owned(),
2097                                    #[allow(clippy::needless_raw_strings)]
2098                                    os_version_regex: r"^8(?:$|\.[4-9]|\.[1-9][0-9])".to_owned(),
2099                                },
2100                                supported: Supported {
2101                                    repo: true,
2102                                },
2103                                commands: HashMap::from(
2104                                    [
2105                                        (
2106                                            "package".to_owned(),
2107                                            HashMap::from(
2108                                                [
2109                                                    (
2110                                                        "install".to_owned(),
2111                                                        vec![
2112                                                            "dnf".to_owned(),
2113                                                            "--disablerepo=*".to_owned(),
2114                                                            "--enablerepo=appstream".to_owned(),
2115                                                            "--enablerepo=baseos".to_owned(),
2116                                                            "--enablerepo=storpool-contrib".to_owned(),
2117                                                            "--enablerepo=codeready-builder-for-rhel-8-x86_64-rpms".to_owned(),
2118                                                            "install".to_owned(),
2119                                                            "-q".to_owned(),
2120                                                            "-y".to_owned(),
2121                                                            "--".to_owned(),
2122                                                        ],
2123                                                    ),
2124                                                    (
2125                                                        "list_all".to_owned(),
2126                                                        vec![
2127                                                            "rpm".to_owned(),
2128                                                            "-qa".to_owned(),
2129                                                            "--qf".to_owned(),
2130                                                            "%{Name}\\t%{EVR}\\t%{Arch}\\tii\\n".to_owned(),
2131                                                            "--".to_owned(),
2132                                                        ],
2133                                                    ),
2134                                                    (
2135                                                        "purge".to_owned(),
2136                                                        vec![
2137                                                            "yum".to_owned(),
2138                                                            "remove".to_owned(),
2139                                                            "-q".to_owned(),
2140                                                            "-y".to_owned(),
2141                                                            "--".to_owned(),
2142                                                        ],
2143                                                    ),
2144                                                    (
2145                                                        "remove".to_owned(),
2146                                                        vec![
2147                                                            "yum".to_owned(),
2148                                                            "remove".to_owned(),
2149                                                            "-q".to_owned(),
2150                                                            "-y".to_owned(),
2151                                                            "--".to_owned(),
2152                                                        ],
2153                                                    ),
2154                                                    (
2155                                                        "remove_impl".to_owned(),
2156                                                        vec![
2157                                                            "rpm".to_owned(),
2158                                                            "-e".to_owned(),
2159                                                            "--".to_owned(),
2160                                                        ],
2161                                                    ),
2162                                                    (
2163                                                        "update_db".to_owned(),
2164                                                        vec![
2165                                                            "true".to_owned(),
2166                                                        ],
2167                                                    ),
2168                                                ]
2169                                            ),
2170                                        ),
2171                                        (
2172                                            "pkgfile".to_owned(),
2173                                            HashMap::from(
2174                                                [
2175                                                    (
2176                                                        "dep_query".to_owned(),
2177                                                        vec![
2178                                                            "sh".to_owned(),
2179                                                            "-c".to_owned(),
2180                                                            "rpm -qpR -- \"$pkg\"".to_owned(),
2181                                                        ],
2182                                                    ),
2183                                                    (
2184                                                        "install".to_owned(),
2185                                                        vec![
2186                                                            "sh".to_owned(),
2187                                                            "-c".to_owned(),
2188                                                            "
2189unset to_install to_reinstall
2190for f in $packages; do
2191    package=\"$(rpm -qp \"$f\")\"
2192    if rpm -q -- \"$package\"; then
2193        to_reinstall=\"$to_reinstall ./$f\"
2194    else
2195        to_install=\"$to_install ./$f\"
2196    fi
2197done
2198
2199if [ -n \"$to_install\" ]; then
2200    dnf install -y --disablerepo='*' --enablerepo=appstream,baseos,storpool-contrib,codeready-builder-for-rhel-8-x86_64-rpms --setopt=localpkg_gpgcheck=0 -- $to_install
2201fi
2202if [ -n \"$to_reinstall\" ]; then
2203    dnf reinstall -y --disablerepo='*' --enablerepo=appstream,baseos,storpool-contrib,codeready-builder-for-rhel-8-x86_64-rpms --setopt=localpkg_gpgcheck=0 -- $to_reinstall
2204fi
2205".to_owned(),
2206                                                        ],
2207                                                    ),
2208                                                ]
2209                                            ),
2210                                        ),
2211                                    ]
2212                                ),
2213                                min_sys_python: "3.6".to_owned(),
2214                                repo:
2215                                    Repo::Yum(YumRepo {
2216                                        yumdef: "redhat/repo/storpool-centos.repo".to_owned(),
2217                                        keyring: "redhat/repo/RPM-GPG-KEY-StorPool".to_owned(),
2218                                    }),
2219                                    package: HashMap::from(
2220                                    [
2221                                        ("KMOD".to_owned(), "kmod".to_owned()),
2222                                        ("LIBCGROUP".to_owned(), "libcgroup-tools".to_owned()),
2223                                        ("LIBUDEV".to_owned(), "systemd-libs".to_owned()),
2224                                        ("OPENSSL".to_owned(), "openssl-libs".to_owned()),
2225                                        ("PERL_AUTODIE".to_owned(), "perl-autodie".to_owned()),
2226                                        ("PERL_FILE_PATH".to_owned(), "perl-File-Path".to_owned()),
2227                                        ("PERL_LWP_PROTO_HTTPS".to_owned(), "perl-LWP-Protocol-https".to_owned()),
2228                                        ("PERL_SYS_SYSLOG".to_owned(), "perl-Sys-Syslog".to_owned()),
2229                                        ("PROCPS".to_owned(), "procps-ng".to_owned()),
2230                                        ("PYTHON_SIMPLEJSON".to_owned(), "python2-simplejson".to_owned()),
2231                                        ("UDEV".to_owned(), "systemd".to_owned()),
2232                                    ]
2233                                ),
2234                                systemd_lib: "usr/lib/systemd/system".to_owned(),
2235                                file_ext: "rpm".to_owned(),
2236                                initramfs_flavor: "mkinitrd".to_owned(),
2237                                builder: Builder {
2238                                    alias: "rhel8".to_owned(),
2239                                    base_image: "redhat/ubi8:reg".to_owned(),
2240                                    branch: "".to_owned(),
2241                                    kernel_package: "kernel-core".to_owned(),
2242                                    utf8_locale: "C.UTF-8".to_owned(),
2243                                },
2244                            },
2245                    ),
2246                    (
2247                            VariantKind::ROCKY8,
2248                            Variant {
2249                                kind: VariantKind::ROCKY8,
2250                                descr: "Rocky Linux 8.x".to_owned(),
2251                                family: "redhat".to_owned(),
2252                                parent: "CENTOS8".to_owned(),
2253                                detect: Detect {
2254                                    filename: "/etc/redhat-release".to_owned(),
2255                                    #[allow(clippy::needless_raw_strings)]
2256                                    regex: r"^ Rocky \s+ Linux \s .* \s 8 \. (?: [4-9] | [1-9][0-9] )".to_owned(),
2257                                    os_id: "rocky".to_owned(),
2258                                    #[allow(clippy::needless_raw_strings)]
2259                                    os_version_regex: r"^8(?:$|\.[4-9]|\.[1-9][0-9])".to_owned(),
2260                                },
2261                                supported: Supported {
2262                                    repo: true,
2263                                },
2264                                commands: HashMap::from(
2265                                    [
2266                                        (
2267                                            "package".to_owned(),
2268                                            HashMap::from(
2269                                                [
2270                                                    (
2271                                                        "install".to_owned(),
2272                                                        vec![
2273                                                            "dnf".to_owned(),
2274                                                            "--disablerepo=*".to_owned(),
2275                                                            "--enablerepo=appstream".to_owned(),
2276                                                            "--enablerepo=baseos".to_owned(),
2277                                                            "--enablerepo=powertools".to_owned(),
2278                                                            "--enablerepo=storpool-contrib".to_owned(),
2279                                                            "install".to_owned(),
2280                                                            "-q".to_owned(),
2281                                                            "-y".to_owned(),
2282                                                            "--".to_owned(),
2283                                                        ],
2284                                                    ),
2285                                                    (
2286                                                        "list_all".to_owned(),
2287                                                        vec![
2288                                                            "rpm".to_owned(),
2289                                                            "-qa".to_owned(),
2290                                                            "--qf".to_owned(),
2291                                                            "%{Name}\\t%{EVR}\\t%{Arch}\\tii\\n".to_owned(),
2292                                                            "--".to_owned(),
2293                                                        ],
2294                                                    ),
2295                                                    (
2296                                                        "purge".to_owned(),
2297                                                        vec![
2298                                                            "yum".to_owned(),
2299                                                            "remove".to_owned(),
2300                                                            "-q".to_owned(),
2301                                                            "-y".to_owned(),
2302                                                            "--".to_owned(),
2303                                                        ],
2304                                                    ),
2305                                                    (
2306                                                        "remove".to_owned(),
2307                                                        vec![
2308                                                            "yum".to_owned(),
2309                                                            "remove".to_owned(),
2310                                                            "-q".to_owned(),
2311                                                            "-y".to_owned(),
2312                                                            "--".to_owned(),
2313                                                        ],
2314                                                    ),
2315                                                    (
2316                                                        "remove_impl".to_owned(),
2317                                                        vec![
2318                                                            "rpm".to_owned(),
2319                                                            "-e".to_owned(),
2320                                                            "--".to_owned(),
2321                                                        ],
2322                                                    ),
2323                                                    (
2324                                                        "update_db".to_owned(),
2325                                                        vec![
2326                                                            "true".to_owned(),
2327                                                        ],
2328                                                    ),
2329                                                ]
2330                                            ),
2331                                        ),
2332                                        (
2333                                            "pkgfile".to_owned(),
2334                                            HashMap::from(
2335                                                [
2336                                                    (
2337                                                        "dep_query".to_owned(),
2338                                                        vec![
2339                                                            "sh".to_owned(),
2340                                                            "-c".to_owned(),
2341                                                            "rpm -qpR -- \"$pkg\"".to_owned(),
2342                                                        ],
2343                                                    ),
2344                                                    (
2345                                                        "install".to_owned(),
2346                                                        vec![
2347                                                            "sh".to_owned(),
2348                                                            "-c".to_owned(),
2349                                                            "
2350unset to_install to_reinstall
2351for f in $packages; do
2352    package=\"$(rpm -qp \"$f\")\"
2353    if rpm -q -- \"$package\"; then
2354        to_reinstall=\"$to_reinstall ./$f\"
2355    else
2356        to_install=\"$to_install ./$f\"
2357    fi
2358done
2359
2360if [ -n \"$to_install\" ]; then
2361    dnf install -y --disablerepo='*' --enablerepo=appstream,baseos,storpool-contrib,powertools --setopt=localpkg_gpgcheck=0 -- $to_install
2362fi
2363if [ -n \"$to_reinstall\" ]; then
2364    dnf reinstall -y --disablerepo='*' --enablerepo=appstream,baseos,storpool-contrib,powertools --setopt=localpkg_gpgcheck=0 -- $to_reinstall
2365fi
2366".to_owned(),
2367                                                        ],
2368                                                    ),
2369                                                ]
2370                                            ),
2371                                        ),
2372                                    ]
2373                                ),
2374                                min_sys_python: "3.6".to_owned(),
2375                                repo:
2376                                    Repo::Yum(YumRepo {
2377                                        yumdef: "redhat/repo/storpool-centos.repo".to_owned(),
2378                                        keyring: "redhat/repo/RPM-GPG-KEY-StorPool".to_owned(),
2379                                    }),
2380                                    package: HashMap::from(
2381                                    [
2382                                        ("KMOD".to_owned(), "kmod".to_owned()),
2383                                        ("LIBCGROUP".to_owned(), "libcgroup-tools".to_owned()),
2384                                        ("LIBUDEV".to_owned(), "systemd-libs".to_owned()),
2385                                        ("OPENSSL".to_owned(), "openssl-libs".to_owned()),
2386                                        ("PERL_AUTODIE".to_owned(), "perl-autodie".to_owned()),
2387                                        ("PERL_FILE_PATH".to_owned(), "perl-File-Path".to_owned()),
2388                                        ("PERL_LWP_PROTO_HTTPS".to_owned(), "perl-LWP-Protocol-https".to_owned()),
2389                                        ("PERL_SYS_SYSLOG".to_owned(), "perl-Sys-Syslog".to_owned()),
2390                                        ("PROCPS".to_owned(), "procps-ng".to_owned()),
2391                                        ("PYTHON_SIMPLEJSON".to_owned(), "python2-simplejson".to_owned()),
2392                                        ("UDEV".to_owned(), "systemd".to_owned()),
2393                                    ]
2394                                ),
2395                                systemd_lib: "usr/lib/systemd/system".to_owned(),
2396                                file_ext: "rpm".to_owned(),
2397                                initramfs_flavor: "mkinitrd".to_owned(),
2398                                builder: Builder {
2399                                    alias: "rocky8".to_owned(),
2400                                    base_image: "rockylinux:8".to_owned(),
2401                                    branch: "".to_owned(),
2402                                    kernel_package: "kernel-core".to_owned(),
2403                                    utf8_locale: "C.UTF-8".to_owned(),
2404                                },
2405                            },
2406                    ),
2407                    (
2408                            VariantKind::ROCKY9,
2409                            Variant {
2410                                kind: VariantKind::ROCKY9,
2411                                descr: "Rocky Linux 9.x".to_owned(),
2412                                family: "redhat".to_owned(),
2413                                parent: "ALMA9".to_owned(),
2414                                detect: Detect {
2415                                    filename: "/etc/redhat-release".to_owned(),
2416                                    #[allow(clippy::needless_raw_strings)]
2417                                    regex: r"^ Rocky \s+ Linux \s .* \s 9 \. [0-9]".to_owned(),
2418                                    os_id: "rocky".to_owned(),
2419                                    #[allow(clippy::needless_raw_strings)]
2420                                    os_version_regex: r"^8(?:$|\.[0-9])".to_owned(),
2421                                },
2422                                supported: Supported {
2423                                    repo: false,
2424                                },
2425                                commands: HashMap::from(
2426                                    [
2427                                        (
2428                                            "package".to_owned(),
2429                                            HashMap::from(
2430                                                [
2431                                                    (
2432                                                        "install".to_owned(),
2433                                                        vec![
2434                                                            "dnf".to_owned(),
2435                                                            "--disablerepo=*".to_owned(),
2436                                                            "--enablerepo=appstream".to_owned(),
2437                                                            "--enablerepo=baseos".to_owned(),
2438                                                            "--enablerepo=crb".to_owned(),
2439                                                            "--enablerepo=storpool-contrib".to_owned(),
2440                                                            "install".to_owned(),
2441                                                            "-q".to_owned(),
2442                                                            "-y".to_owned(),
2443                                                            "--".to_owned(),
2444                                                        ],
2445                                                    ),
2446                                                    (
2447                                                        "list_all".to_owned(),
2448                                                        vec![
2449                                                            "rpm".to_owned(),
2450                                                            "-qa".to_owned(),
2451                                                            "--qf".to_owned(),
2452                                                            "%{Name}\\t%{EVR}\\t%{Arch}\\tii\\n".to_owned(),
2453                                                            "--".to_owned(),
2454                                                        ],
2455                                                    ),
2456                                                    (
2457                                                        "purge".to_owned(),
2458                                                        vec![
2459                                                            "yum".to_owned(),
2460                                                            "remove".to_owned(),
2461                                                            "-q".to_owned(),
2462                                                            "-y".to_owned(),
2463                                                            "--".to_owned(),
2464                                                        ],
2465                                                    ),
2466                                                    (
2467                                                        "remove".to_owned(),
2468                                                        vec![
2469                                                            "yum".to_owned(),
2470                                                            "remove".to_owned(),
2471                                                            "-q".to_owned(),
2472                                                            "-y".to_owned(),
2473                                                            "--".to_owned(),
2474                                                        ],
2475                                                    ),
2476                                                    (
2477                                                        "remove_impl".to_owned(),
2478                                                        vec![
2479                                                            "rpm".to_owned(),
2480                                                            "-e".to_owned(),
2481                                                            "--".to_owned(),
2482                                                        ],
2483                                                    ),
2484                                                    (
2485                                                        "update_db".to_owned(),
2486                                                        vec![
2487                                                            "true".to_owned(),
2488                                                        ],
2489                                                    ),
2490                                                ]
2491                                            ),
2492                                        ),
2493                                        (
2494                                            "pkgfile".to_owned(),
2495                                            HashMap::from(
2496                                                [
2497                                                    (
2498                                                        "dep_query".to_owned(),
2499                                                        vec![
2500                                                            "sh".to_owned(),
2501                                                            "-c".to_owned(),
2502                                                            "rpm -qpR -- \"$pkg\"".to_owned(),
2503                                                        ],
2504                                                    ),
2505                                                    (
2506                                                        "install".to_owned(),
2507                                                        vec![
2508                                                            "sh".to_owned(),
2509                                                            "-c".to_owned(),
2510                                                            "
2511unset to_install to_reinstall
2512for f in $packages; do
2513    package=\"$(rpm -qp \"$f\")\"
2514    if rpm -q -- \"$package\"; then
2515        to_reinstall=\"$to_reinstall ./$f\"
2516    else
2517        to_install=\"$to_install ./$f\"
2518    fi
2519done
2520
2521if [ -n \"$to_install\" ]; then
2522    dnf install -y --disablerepo='*' --enablerepo=appstream,baseos,crb,storpool-contrib --setopt=localpkg_gpgcheck=0 -- $to_install
2523fi
2524if [ -n \"$to_reinstall\" ]; then
2525    dnf reinstall -y --disablerepo='*' --enablerepo=appstream,baseos,crb,storpool-contrib --setopt=localpkg_gpgcheck=0 -- $to_reinstall
2526fi
2527".to_owned(),
2528                                                        ],
2529                                                    ),
2530                                                ]
2531                                            ),
2532                                        ),
2533                                    ]
2534                                ),
2535                                min_sys_python: "3.9".to_owned(),
2536                                repo:
2537                                    Repo::Yum(YumRepo {
2538                                        yumdef: "redhat/repo/storpool-centos.repo".to_owned(),
2539                                        keyring: "redhat/repo/RPM-GPG-KEY-StorPool".to_owned(),
2540                                    }),
2541                                    package: HashMap::from(
2542                                    [
2543                                        ("KMOD".to_owned(), "kmod".to_owned()),
2544                                        ("LIBCGROUP".to_owned(), "bash".to_owned()),
2545                                        ("LIBUDEV".to_owned(), "systemd-libs".to_owned()),
2546                                        ("OPENSSL".to_owned(), "openssl-libs".to_owned()),
2547                                        ("PERL_AUTODIE".to_owned(), "perl-autodie".to_owned()),
2548                                        ("PERL_FILE_PATH".to_owned(), "perl-File-Path".to_owned()),
2549                                        ("PERL_LWP_PROTO_HTTPS".to_owned(), "perl-LWP-Protocol-https".to_owned()),
2550                                        ("PERL_SYS_SYSLOG".to_owned(), "perl-Sys-Syslog".to_owned()),
2551                                        ("PROCPS".to_owned(), "procps-ng".to_owned()),
2552                                        ("PYTHON_SIMPLEJSON".to_owned(), "bash".to_owned()),
2553                                        ("UDEV".to_owned(), "systemd".to_owned()),
2554                                    ]
2555                                ),
2556                                systemd_lib: "usr/lib/systemd/system".to_owned(),
2557                                file_ext: "rpm".to_owned(),
2558                                initramfs_flavor: "mkinitrd".to_owned(),
2559                                builder: Builder {
2560                                    alias: "rocky9".to_owned(),
2561                                    base_image: "rockylinux:9".to_owned(),
2562                                    branch: "".to_owned(),
2563                                    kernel_package: "kernel-core".to_owned(),
2564                                    utf8_locale: "C.UTF-8".to_owned(),
2565                                },
2566                            },
2567                    ),
2568                    (
2569                            VariantKind::UBUNTU1804,
2570                            Variant {
2571                                kind: VariantKind::UBUNTU1804,
2572                                descr: "Ubuntu 18.04 LTS (Bionic Beaver)".to_owned(),
2573                                family: "debian".to_owned(),
2574                                parent: "UBUNTU2004".to_owned(),
2575                                detect: Detect {
2576                                    filename: "/etc/os-release".to_owned(),
2577                                    #[allow(clippy::needless_raw_strings)]
2578                                    regex: r"^ PRETTY_NAME= .* Ubuntu \s+ 18 \. 04 ".to_owned(),
2579                                    os_id: "ubuntu".to_owned(),
2580                                    #[allow(clippy::needless_raw_strings)]
2581                                    os_version_regex: r"^18\.04$".to_owned(),
2582                                },
2583                                supported: Supported {
2584                                    repo: true,
2585                                },
2586                                commands: HashMap::from(
2587                                    [
2588                                        (
2589                                            "package".to_owned(),
2590                                            HashMap::from(
2591                                                [
2592                                                    (
2593                                                        "install".to_owned(),
2594                                                        vec![
2595                                                            "env".to_owned(),
2596                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
2597                                                            "apt-get".to_owned(),
2598                                                            "-q".to_owned(),
2599                                                            "-y".to_owned(),
2600                                                            "--no-install-recommends".to_owned(),
2601                                                            "install".to_owned(),
2602                                                            "--".to_owned(),
2603                                                        ],
2604                                                    ),
2605                                                    (
2606                                                        "list_all".to_owned(),
2607                                                        vec![
2608                                                            "dpkg-query".to_owned(),
2609                                                            "-W".to_owned(),
2610                                                            "-f".to_owned(),
2611                                                            "${Package}\\t${Version}\\t${Architecture}\\t${db:Status-Abbrev}\\n".to_owned(),
2612                                                            "--".to_owned(),
2613                                                        ],
2614                                                    ),
2615                                                    (
2616                                                        "purge".to_owned(),
2617                                                        vec![
2618                                                            "env".to_owned(),
2619                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
2620                                                            "apt-get".to_owned(),
2621                                                            "-q".to_owned(),
2622                                                            "-y".to_owned(),
2623                                                            "purge".to_owned(),
2624                                                            "--".to_owned(),
2625                                                        ],
2626                                                    ),
2627                                                    (
2628                                                        "remove".to_owned(),
2629                                                        vec![
2630                                                            "env".to_owned(),
2631                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
2632                                                            "apt-get".to_owned(),
2633                                                            "-q".to_owned(),
2634                                                            "-y".to_owned(),
2635                                                            "remove".to_owned(),
2636                                                            "--".to_owned(),
2637                                                        ],
2638                                                    ),
2639                                                    (
2640                                                        "remove_impl".to_owned(),
2641                                                        vec![
2642                                                            "env".to_owned(),
2643                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
2644                                                            "dpkg".to_owned(),
2645                                                            "-r".to_owned(),
2646                                                            "--".to_owned(),
2647                                                        ],
2648                                                    ),
2649                                                    (
2650                                                        "update_db".to_owned(),
2651                                                        vec![
2652                                                            "apt-get".to_owned(),
2653                                                            "-q".to_owned(),
2654                                                            "-y".to_owned(),
2655                                                            "update".to_owned(),
2656                                                        ],
2657                                                    ),
2658                                                ]
2659                                            ),
2660                                        ),
2661                                        (
2662                                            "pkgfile".to_owned(),
2663                                            HashMap::from(
2664                                                [
2665                                                    (
2666                                                        "dep_query".to_owned(),
2667                                                        vec![
2668                                                            "sh".to_owned(),
2669                                                            "-c".to_owned(),
2670                                                            "dpkg-deb -f -- \"$pkg\" \"Depends\" | sed -e \"s/ *, */,/g\" | tr \",\" \"\\n\"".to_owned(),
2671                                                        ],
2672                                                    ),
2673                                                    (
2674                                                        "install".to_owned(),
2675                                                        vec![
2676                                                            "sh".to_owned(),
2677                                                            "-c".to_owned(),
2678                                                            "env DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --reinstall -y -o DPkg::Options::=--force-confnew -- $packages".to_owned(),
2679                                                        ],
2680                                                    ),
2681                                                ]
2682                                            ),
2683                                        ),
2684                                    ]
2685                                ),
2686                                min_sys_python: "3.6".to_owned(),
2687                                repo:
2688                                    Repo::Deb(DebRepo {
2689                                        codename: "bionic".to_owned(),
2690                                        vendor: "ubuntu".to_owned(),
2691                                        sources: "debian/repo/storpool.sources".to_owned(),
2692                                        keyring: "debian/repo/storpool-keyring.gpg".to_owned(),
2693                                        req_packages: vec![
2694                                            "ca-certificates".to_owned(),
2695                                        ],
2696                                    }),
2697                                    package: HashMap::from(
2698                                    [
2699                                        ("BINDINGS_PYTHON".to_owned(), "python".to_owned()),
2700                                        ("BINDINGS_PYTHON_CONFGET".to_owned(), "python-confget".to_owned()),
2701                                        ("BINDINGS_PYTHON_SIMPLEJSON".to_owned(), "python-simplejson".to_owned()),
2702                                        ("CGROUP".to_owned(), "cgroup-tools".to_owned()),
2703                                        ("CPUPOWER".to_owned(), "linux-tools-generic".to_owned()),
2704                                        ("LIBSSL".to_owned(), "libssl1.1".to_owned()),
2705                                        ("MCELOG".to_owned(), "bash".to_owned()),
2706                                    ]
2707                                ),
2708                                systemd_lib: "lib/systemd/system".to_owned(),
2709                                file_ext: "deb".to_owned(),
2710                                initramfs_flavor: "update-initramfs".to_owned(),
2711                                builder: Builder {
2712                                    alias: "ubuntu-18.04".to_owned(),
2713                                    base_image: "ubuntu:bionic".to_owned(),
2714                                    branch: "ubuntu/bionic".to_owned(),
2715                                    kernel_package: "linux-headers".to_owned(),
2716                                    utf8_locale: "C.UTF-8".to_owned(),
2717                                },
2718                            },
2719                    ),
2720                    (
2721                            VariantKind::UBUNTU2004,
2722                            Variant {
2723                                kind: VariantKind::UBUNTU2004,
2724                                descr: "Ubuntu 20.04 LTS (Focal Fossa)".to_owned(),
2725                                family: "debian".to_owned(),
2726                                parent: "UBUNTU2204".to_owned(),
2727                                detect: Detect {
2728                                    filename: "/etc/os-release".to_owned(),
2729                                    #[allow(clippy::needless_raw_strings)]
2730                                    regex: r"^ PRETTY_NAME= .* (?: Ubuntu \s+ 20 \. 04 | Mint \s+ 20 ) ".to_owned(),
2731                                    os_id: "ubuntu".to_owned(),
2732                                    #[allow(clippy::needless_raw_strings)]
2733                                    os_version_regex: r"^20\.04$".to_owned(),
2734                                },
2735                                supported: Supported {
2736                                    repo: true,
2737                                },
2738                                commands: HashMap::from(
2739                                    [
2740                                        (
2741                                            "package".to_owned(),
2742                                            HashMap::from(
2743                                                [
2744                                                    (
2745                                                        "install".to_owned(),
2746                                                        vec![
2747                                                            "env".to_owned(),
2748                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
2749                                                            "apt-get".to_owned(),
2750                                                            "-q".to_owned(),
2751                                                            "-y".to_owned(),
2752                                                            "--no-install-recommends".to_owned(),
2753                                                            "install".to_owned(),
2754                                                            "--".to_owned(),
2755                                                        ],
2756                                                    ),
2757                                                    (
2758                                                        "list_all".to_owned(),
2759                                                        vec![
2760                                                            "dpkg-query".to_owned(),
2761                                                            "-W".to_owned(),
2762                                                            "-f".to_owned(),
2763                                                            "${Package}\\t${Version}\\t${Architecture}\\t${db:Status-Abbrev}\\n".to_owned(),
2764                                                            "--".to_owned(),
2765                                                        ],
2766                                                    ),
2767                                                    (
2768                                                        "purge".to_owned(),
2769                                                        vec![
2770                                                            "env".to_owned(),
2771                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
2772                                                            "apt-get".to_owned(),
2773                                                            "-q".to_owned(),
2774                                                            "-y".to_owned(),
2775                                                            "purge".to_owned(),
2776                                                            "--".to_owned(),
2777                                                        ],
2778                                                    ),
2779                                                    (
2780                                                        "remove".to_owned(),
2781                                                        vec![
2782                                                            "env".to_owned(),
2783                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
2784                                                            "apt-get".to_owned(),
2785                                                            "-q".to_owned(),
2786                                                            "-y".to_owned(),
2787                                                            "remove".to_owned(),
2788                                                            "--".to_owned(),
2789                                                        ],
2790                                                    ),
2791                                                    (
2792                                                        "remove_impl".to_owned(),
2793                                                        vec![
2794                                                            "env".to_owned(),
2795                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
2796                                                            "dpkg".to_owned(),
2797                                                            "-r".to_owned(),
2798                                                            "--".to_owned(),
2799                                                        ],
2800                                                    ),
2801                                                    (
2802                                                        "update_db".to_owned(),
2803                                                        vec![
2804                                                            "apt-get".to_owned(),
2805                                                            "-q".to_owned(),
2806                                                            "-y".to_owned(),
2807                                                            "update".to_owned(),
2808                                                        ],
2809                                                    ),
2810                                                ]
2811                                            ),
2812                                        ),
2813                                        (
2814                                            "pkgfile".to_owned(),
2815                                            HashMap::from(
2816                                                [
2817                                                    (
2818                                                        "dep_query".to_owned(),
2819                                                        vec![
2820                                                            "sh".to_owned(),
2821                                                            "-c".to_owned(),
2822                                                            "dpkg-deb -f -- \"$pkg\" \"Depends\" | sed -e \"s/ *, */,/g\" | tr \",\" \"\\n\"".to_owned(),
2823                                                        ],
2824                                                    ),
2825                                                    (
2826                                                        "install".to_owned(),
2827                                                        vec![
2828                                                            "sh".to_owned(),
2829                                                            "-c".to_owned(),
2830                                                            "env DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --reinstall -y -o DPkg::Options::=--force-confnew -- $packages".to_owned(),
2831                                                        ],
2832                                                    ),
2833                                                ]
2834                                            ),
2835                                        ),
2836                                    ]
2837                                ),
2838                                min_sys_python: "3.8".to_owned(),
2839                                repo:
2840                                    Repo::Deb(DebRepo {
2841                                        codename: "focal".to_owned(),
2842                                        vendor: "ubuntu".to_owned(),
2843                                        sources: "debian/repo/storpool.sources".to_owned(),
2844                                        keyring: "debian/repo/storpool-keyring.gpg".to_owned(),
2845                                        req_packages: vec![
2846                                            "ca-certificates".to_owned(),
2847                                        ],
2848                                    }),
2849                                    package: HashMap::from(
2850                                    [
2851                                        ("BINDINGS_PYTHON".to_owned(), "python3".to_owned()),
2852                                        ("BINDINGS_PYTHON_CONFGET".to_owned(), "python3-confget".to_owned()),
2853                                        ("BINDINGS_PYTHON_SIMPLEJSON".to_owned(), "python3-simplejson".to_owned()),
2854                                        ("CGROUP".to_owned(), "cgroup-tools".to_owned()),
2855                                        ("CPUPOWER".to_owned(), "linux-tools-generic".to_owned()),
2856                                        ("LIBSSL".to_owned(), "libssl1.1".to_owned()),
2857                                        ("MCELOG".to_owned(), "bash".to_owned()),
2858                                    ]
2859                                ),
2860                                systemd_lib: "lib/systemd/system".to_owned(),
2861                                file_ext: "deb".to_owned(),
2862                                initramfs_flavor: "update-initramfs".to_owned(),
2863                                builder: Builder {
2864                                    alias: "ubuntu-20.04".to_owned(),
2865                                    base_image: "ubuntu:focal".to_owned(),
2866                                    branch: "ubuntu/focal".to_owned(),
2867                                    kernel_package: "linux-headers".to_owned(),
2868                                    utf8_locale: "C.UTF-8".to_owned(),
2869                                },
2870                            },
2871                    ),
2872                    (
2873                            VariantKind::UBUNTU2204,
2874                            Variant {
2875                                kind: VariantKind::UBUNTU2204,
2876                                descr: "Ubuntu 22.04 LTS (Jammy Jellyfish)".to_owned(),
2877                                family: "debian".to_owned(),
2878                                parent: "UBUNTU2404".to_owned(),
2879                                detect: Detect {
2880                                    filename: "/etc/os-release".to_owned(),
2881                                    #[allow(clippy::needless_raw_strings)]
2882                                    regex: r"^ PRETTY_NAME= .* (?: Ubuntu \s+ 22 \. 04 | Mint \s+ 21 ) ".to_owned(),
2883                                    os_id: "ubuntu".to_owned(),
2884                                    #[allow(clippy::needless_raw_strings)]
2885                                    os_version_regex: r"^22\.04$".to_owned(),
2886                                },
2887                                supported: Supported {
2888                                    repo: true,
2889                                },
2890                                commands: HashMap::from(
2891                                    [
2892                                        (
2893                                            "package".to_owned(),
2894                                            HashMap::from(
2895                                                [
2896                                                    (
2897                                                        "install".to_owned(),
2898                                                        vec![
2899                                                            "env".to_owned(),
2900                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
2901                                                            "apt-get".to_owned(),
2902                                                            "-q".to_owned(),
2903                                                            "-y".to_owned(),
2904                                                            "--no-install-recommends".to_owned(),
2905                                                            "install".to_owned(),
2906                                                            "--".to_owned(),
2907                                                        ],
2908                                                    ),
2909                                                    (
2910                                                        "list_all".to_owned(),
2911                                                        vec![
2912                                                            "dpkg-query".to_owned(),
2913                                                            "-W".to_owned(),
2914                                                            "-f".to_owned(),
2915                                                            "${Package}\\t${Version}\\t${Architecture}\\t${db:Status-Abbrev}\\n".to_owned(),
2916                                                            "--".to_owned(),
2917                                                        ],
2918                                                    ),
2919                                                    (
2920                                                        "purge".to_owned(),
2921                                                        vec![
2922                                                            "env".to_owned(),
2923                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
2924                                                            "apt-get".to_owned(),
2925                                                            "-q".to_owned(),
2926                                                            "-y".to_owned(),
2927                                                            "purge".to_owned(),
2928                                                            "--".to_owned(),
2929                                                        ],
2930                                                    ),
2931                                                    (
2932                                                        "remove".to_owned(),
2933                                                        vec![
2934                                                            "env".to_owned(),
2935                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
2936                                                            "apt-get".to_owned(),
2937                                                            "-q".to_owned(),
2938                                                            "-y".to_owned(),
2939                                                            "remove".to_owned(),
2940                                                            "--".to_owned(),
2941                                                        ],
2942                                                    ),
2943                                                    (
2944                                                        "remove_impl".to_owned(),
2945                                                        vec![
2946                                                            "env".to_owned(),
2947                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
2948                                                            "dpkg".to_owned(),
2949                                                            "-r".to_owned(),
2950                                                            "--".to_owned(),
2951                                                        ],
2952                                                    ),
2953                                                    (
2954                                                        "update_db".to_owned(),
2955                                                        vec![
2956                                                            "apt-get".to_owned(),
2957                                                            "-q".to_owned(),
2958                                                            "-y".to_owned(),
2959                                                            "update".to_owned(),
2960                                                        ],
2961                                                    ),
2962                                                ]
2963                                            ),
2964                                        ),
2965                                        (
2966                                            "pkgfile".to_owned(),
2967                                            HashMap::from(
2968                                                [
2969                                                    (
2970                                                        "dep_query".to_owned(),
2971                                                        vec![
2972                                                            "sh".to_owned(),
2973                                                            "-c".to_owned(),
2974                                                            "dpkg-deb -f -- \"$pkg\" \"Depends\" | sed -e \"s/ *, */,/g\" | tr \",\" \"\\n\"".to_owned(),
2975                                                        ],
2976                                                    ),
2977                                                    (
2978                                                        "install".to_owned(),
2979                                                        vec![
2980                                                            "sh".to_owned(),
2981                                                            "-c".to_owned(),
2982                                                            "env DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --reinstall -y -o DPkg::Options::=--force-confnew -- $packages".to_owned(),
2983                                                        ],
2984                                                    ),
2985                                                ]
2986                                            ),
2987                                        ),
2988                                    ]
2989                                ),
2990                                min_sys_python: "3.10".to_owned(),
2991                                repo:
2992                                    Repo::Deb(DebRepo {
2993                                        codename: "jammy".to_owned(),
2994                                        vendor: "ubuntu".to_owned(),
2995                                        sources: "debian/repo/storpool.sources".to_owned(),
2996                                        keyring: "debian/repo/storpool-keyring.gpg".to_owned(),
2997                                        req_packages: vec![
2998                                            "ca-certificates".to_owned(),
2999                                        ],
3000                                    }),
3001                                    package: HashMap::from(
3002                                    [
3003                                        ("BINDINGS_PYTHON".to_owned(), "python3".to_owned()),
3004                                        ("BINDINGS_PYTHON_CONFGET".to_owned(), "python3-confget".to_owned()),
3005                                        ("BINDINGS_PYTHON_SIMPLEJSON".to_owned(), "python3-simplejson".to_owned()),
3006                                        ("CGROUP".to_owned(), "cgroup-tools".to_owned()),
3007                                        ("CPUPOWER".to_owned(), "linux-tools-generic".to_owned()),
3008                                        ("LIBSSL".to_owned(), "libssl3".to_owned()),
3009                                        ("MCELOG".to_owned(), "bash".to_owned()),
3010                                    ]
3011                                ),
3012                                systemd_lib: "lib/systemd/system".to_owned(),
3013                                file_ext: "deb".to_owned(),
3014                                initramfs_flavor: "update-initramfs".to_owned(),
3015                                builder: Builder {
3016                                    alias: "ubuntu-22.04".to_owned(),
3017                                    base_image: "ubuntu:jammy".to_owned(),
3018                                    branch: "ubuntu/jammy".to_owned(),
3019                                    kernel_package: "linux-headers".to_owned(),
3020                                    utf8_locale: "C.UTF-8".to_owned(),
3021                                },
3022                            },
3023                    ),
3024                    (
3025                            VariantKind::UBUNTU2404,
3026                            Variant {
3027                                kind: VariantKind::UBUNTU2404,
3028                                descr: "Ubuntu 24.04 LTS (Noble Numbat)".to_owned(),
3029                                family: "debian".to_owned(),
3030                                parent: "DEBIAN13".to_owned(),
3031                                detect: Detect {
3032                                    filename: "/etc/os-release".to_owned(),
3033                                    #[allow(clippy::needless_raw_strings)]
3034                                    regex: r"^ PRETTY_NAME= .* Ubuntu \s+ .* Noble ".to_owned(),
3035                                    os_id: "ubuntu".to_owned(),
3036                                    #[allow(clippy::needless_raw_strings)]
3037                                    os_version_regex: r"^24\.04$".to_owned(),
3038                                },
3039                                supported: Supported {
3040                                    repo: false,
3041                                },
3042                                commands: HashMap::from(
3043                                    [
3044                                        (
3045                                            "package".to_owned(),
3046                                            HashMap::from(
3047                                                [
3048                                                    (
3049                                                        "install".to_owned(),
3050                                                        vec![
3051                                                            "env".to_owned(),
3052                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
3053                                                            "apt-get".to_owned(),
3054                                                            "-q".to_owned(),
3055                                                            "-y".to_owned(),
3056                                                            "--no-install-recommends".to_owned(),
3057                                                            "install".to_owned(),
3058                                                            "--".to_owned(),
3059                                                        ],
3060                                                    ),
3061                                                    (
3062                                                        "list_all".to_owned(),
3063                                                        vec![
3064                                                            "dpkg-query".to_owned(),
3065                                                            "-W".to_owned(),
3066                                                            "-f".to_owned(),
3067                                                            "${Package}\\t${Version}\\t${Architecture}\\t${db:Status-Abbrev}\\n".to_owned(),
3068                                                            "--".to_owned(),
3069                                                        ],
3070                                                    ),
3071                                                    (
3072                                                        "purge".to_owned(),
3073                                                        vec![
3074                                                            "env".to_owned(),
3075                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
3076                                                            "apt-get".to_owned(),
3077                                                            "-q".to_owned(),
3078                                                            "-y".to_owned(),
3079                                                            "purge".to_owned(),
3080                                                            "--".to_owned(),
3081                                                        ],
3082                                                    ),
3083                                                    (
3084                                                        "remove".to_owned(),
3085                                                        vec![
3086                                                            "env".to_owned(),
3087                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
3088                                                            "apt-get".to_owned(),
3089                                                            "-q".to_owned(),
3090                                                            "-y".to_owned(),
3091                                                            "remove".to_owned(),
3092                                                            "--".to_owned(),
3093                                                        ],
3094                                                    ),
3095                                                    (
3096                                                        "remove_impl".to_owned(),
3097                                                        vec![
3098                                                            "env".to_owned(),
3099                                                            "DEBIAN_FRONTEND=noninteractive".to_owned(),
3100                                                            "dpkg".to_owned(),
3101                                                            "-r".to_owned(),
3102                                                            "--".to_owned(),
3103                                                        ],
3104                                                    ),
3105                                                    (
3106                                                        "update_db".to_owned(),
3107                                                        vec![
3108                                                            "apt-get".to_owned(),
3109                                                            "-q".to_owned(),
3110                                                            "-y".to_owned(),
3111                                                            "update".to_owned(),
3112                                                        ],
3113                                                    ),
3114                                                ]
3115                                            ),
3116                                        ),
3117                                        (
3118                                            "pkgfile".to_owned(),
3119                                            HashMap::from(
3120                                                [
3121                                                    (
3122                                                        "dep_query".to_owned(),
3123                                                        vec![
3124                                                            "sh".to_owned(),
3125                                                            "-c".to_owned(),
3126                                                            "dpkg-deb -f -- \"$pkg\" \"Depends\" | sed -e \"s/ *, */,/g\" | tr \",\" \"\\n\"".to_owned(),
3127                                                        ],
3128                                                    ),
3129                                                    (
3130                                                        "install".to_owned(),
3131                                                        vec![
3132                                                            "sh".to_owned(),
3133                                                            "-c".to_owned(),
3134                                                            "env DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --reinstall -y -o DPkg::Options::=--force-confnew -- $packages".to_owned(),
3135                                                        ],
3136                                                    ),
3137                                                ]
3138                                            ),
3139                                        ),
3140                                    ]
3141                                ),
3142                                min_sys_python: "3.12".to_owned(),
3143                                repo:
3144                                    Repo::Deb(DebRepo {
3145                                        codename: "noble".to_owned(),
3146                                        vendor: "ubuntu".to_owned(),
3147                                        sources: "debian/repo/storpool.sources".to_owned(),
3148                                        keyring: "debian/repo/storpool-keyring.gpg".to_owned(),
3149                                        req_packages: vec![
3150                                            "ca-certificates".to_owned(),
3151                                        ],
3152                                    }),
3153                                    package: HashMap::from(
3154                                    [
3155                                        ("BINDINGS_PYTHON".to_owned(), "python3".to_owned()),
3156                                        ("BINDINGS_PYTHON_CONFGET".to_owned(), "python3-confget".to_owned()),
3157                                        ("BINDINGS_PYTHON_SIMPLEJSON".to_owned(), "python3-simplejson".to_owned()),
3158                                        ("CGROUP".to_owned(), "cgroup-tools".to_owned()),
3159                                        ("CPUPOWER".to_owned(), "linux-tools-generic".to_owned()),
3160                                        ("LIBSSL".to_owned(), "libssl3".to_owned()),
3161                                        ("MCELOG".to_owned(), "bash".to_owned()),
3162                                    ]
3163                                ),
3164                                systemd_lib: "lib/systemd/system".to_owned(),
3165                                file_ext: "deb".to_owned(),
3166                                initramfs_flavor: "update-initramfs".to_owned(),
3167                                builder: Builder {
3168                                    alias: "ubuntu-24.04".to_owned(),
3169                                    base_image: "ubuntu:noble".to_owned(),
3170                                    branch: "ubuntu/noble".to_owned(),
3171                                    kernel_package: "linux-headers".to_owned(),
3172                                    utf8_locale: "C.UTF-8".to_owned(),
3173                                },
3174                            },
3175                    ),
3176                ]
3177            ),
3178            version: "3.5.3".to_owned(),
3179        }
3180    });
3181    assert!(
3182        DEF_TOP.format.version.major == 1,
3183        "Internal error: JSON variant definition: version {:?}",
3184        DEF_TOP.format.version
3185    );
3186    &DEF_TOP
3187}