Skip to content

Commit

Permalink
Generate a file containing a list of licenses for all installed packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Kron4ek authored Sep 29, 2024
1 parent 59769cc commit d74f9b6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions create-arch-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF > locale.gen
ar_EG.UTF-8 UTF-8
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d74f9b6

Please sign in to comment.