From d74f9b6bc8d38b9fcfcedf1f3742568f1a5968c5 Mon Sep 17 00:00:00 2001 From: Kron4ek Date: Sun, 29 Sep 2024 14:51:22 +0300 Subject: [PATCH] Generate a file containing a list of licenses for all installed packages --- create-arch-bootstrap.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/create-arch-bootstrap.sh b/create-arch-bootstrap.sh index e69c93b..1856796 100755 --- a/create-arch-bootstrap.sh +++ b/create-arch-bootstrap.sh @@ -178,6 +178,13 @@ install_aur_packages () { done } +generate_pkg_licenses_file () { + for p in $(pacman -Q | cut -d' ' -f1); do + echo -n $(pacman -Qi "${p}" | grep -E 'Name|Licenses' | cut -d ":" -f 2) >>/pkglicenses.txt + echo >>/pkglicenses.txt + done +} + generate_localegen () { cat < locale.gen ar_EG.UTF-8 UTF-8 @@ -376,9 +383,15 @@ fi run_in_chroot locale-gen +echo "Generating package info, please wait..." + # Generate a list of installed packages run_in_chroot pacman -Q > "${bootstrap}"/pkglist.x86_64.txt +# Generate a list of licenses of installed packages +export -f generate_pkg_licenses_file +run_in_chroot bash -c generate_pkg_licenses_file + unmount_chroot # Clear pacman package cache