# SPDX-FileCopyrightText: no
# SPDX-License-Identifier: CC0-1.0
#
# shellprocess_initialize_pacman.conf
# generate pacman keyring, mirrorlist and copy them into target system
# used for online
---

i18n:
  name: "Initialize pacman ... ranking mirrors ... copy pacman mirrorlist and keyring to target ..."
  name[ru]: "Инициализация pacman ... ранжирование зеркал ... копирование списка зеркал pacman и связок ключей ..."

dontChroot: true

script:
  - "-mkdir -p ${ROOT}/etc"
  - "cp /etc/pacman.conf ${ROOT}/etc/pacman.conf"
  - "mkdir -p ${ROOT}/etc/pacman.d/"
  - "cp /etc/pacman.d/mirrorlist ${ROOT}/etc/pacman.d/"
  - "-cp /etc/pacman.d/melawy-linux-mirrorlist ${ROOT}/etc/pacman.d/"
  - "-cp /etc/pacman.d/cachyos-mirrorlist ${ROOT}/etc/pacman.d/"
  - "-cp /etc/pacman.d/arcolinux-mirrorlist ${ROOT}/etc/pacman.d/"
  - "-cp /etc/pacman.d/chaotic-mirrorlist ${ROOT}/etc/pacman.d/"
  - "-cp /etc/pacman.d/endeavouros-mirrorlist ${ROOT}/etc/pacman.d/"
  - "cp -a /etc/pacman.d/gnupg ${ROOT}/etc/pacman.d/"
  - "cp /etc/resolv.conf ${ROOT}/etc/"

  - command: "/usr/local/bin/update-mirrorlist"
    timeout: 3600

  - command: "pacman -Sy --noconfirm --needed archlinux-keyring"
    timeout: 3600

  - command: "pacman -Sy --noconfirm --needed melawy-linux-keyring"
    timeout: 3600

  - command: "pacman -Sy --noconfirm --needed cachyos-keyring"
    timeout: 3600

  - command: "pacman -Sy --noconfirm --needed arcolinux-keyring"
    timeout: 3600

  - command: "pacman -Sy --noconfirm --needed chaotic-keyring"
    timeout: 3600

  - command: "pacman -Sy --noconfirm --needed endeavouros-keyring"
    timeout: 3600
