"use strict";
/**
 * penguins-eggs
 * lib: dependencies.ts
 * author: Piero Proietti
 * email: piero.proietti@gmail.com
 * license: MIT
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.depInit = exports.depVersions = exports.depArch = exports.depCommon = exports.array2spaced = exports.array2comma = void 0;
/**
 * depCommon
 * depArch
 * depVersion
 * depInit
 */
/**
 *
 * @param packages array packages
 */
function array2comma(packages) {
    let commaSep = '';
    const last = packages.length;
    for (let i = 0; i < last; i++) {
        commaSep += packages[i];
        if (i < last - 1) {
            commaSep += ', ';
        }
    }
    return commaSep;
}
exports.array2comma = array2comma;
/**
 *
 * @param packages
 * @returns
 */
function array2spaced(packages) {
    let spaced = '';
    for (const i in packages) {
        spaced += packages[i] + ' ';
    }
    return spaced;
}
exports.array2spaced = array2spaced;
/**
 * common dependencies
 * removable: isolinux live-boot live-boot-doc live-boot-initramfs-tools live-tools syslinux syslinux-common
 * sudo apt purge cryptsetup dosfstools dpkg-dev isolinux live-boot live-boot-initramfs-tools  squashfs-tools syslinux-common coreutils xorriso
 */
exports.depCommon = [
    'coreutils', // whoami
    'cryptsetup',
    'curl', // wardrobe
    'dosfstools', // eggs
    'dpkg-dev', // yolk
    'git', // wardrobe
    'grub-efi-amd64-bin', // grub
    'isolinux', // eggs
    'jq', // mom restored
    'live-boot-initramfs-tools', // eggs
    'live-boot', // eggs
    'lsb-release', // eggs
    'lvm2', // pvdisplay in krill
    'parted', // eggs
    'pxelinux', // cuckoo
    'rsync', // eggs
    'squashfs-tools', // eggs
    'sshfs', // eggs
    'syslinux-common', // eggs
    'xorriso', // eggs
];
/**
 * Dependencies for architectures
 */
exports.depArch = [
    {
        package: 'syslinux',
        arch: ['amd64', 'i386'],
    },
    {
        package: 'syslinux-efi',
        arch: ['arm64', 'armel'],
    },
];
/**
 * dependencies for versions
 *
 */
exports.depVersions = [
    {
        package: 'live-config',
        versions: ['jessie', 'stretch'], // jessie and stretch need it
    },
    {
        package: 'live-config-systemd',
        versions: ['jessie', 'stretch', 'buster'], // jessie, stretch and buster need it
    },
    {
        package: 'live-config-sysvinit',
        versions: ['beowulf'], // only Devuan beowulf
    },
    {
        package: 'open-infrastructure-system-config',
        versions: ['bionic'], // only Ubuntu bionic
    },
];
/**
 * dependecies for init
 *
 * We need for buster derivate with systemd and using sysvinit
 * like MX-LINUX and probably others
 *
 */
exports.depInit = [
    {
        package: 'live-config-sysvinit',
        init: 'sysvinit',
    },
];
