diff options
-rw-r--r-- | po/es/libretools.po | 16 | ||||
-rw-r--r-- | src/chroot-tools/chcleanup.in | 20 |
2 files changed, 17 insertions, 19 deletions
diff --git a/po/es/libretools.po b/po/es/libretools.po index f5e9583..de1e684 100644 --- a/po/es/libretools.po +++ b/po/es/libretools.po @@ -508,31 +508,27 @@ msgstr "chroot '%s' no está a la versión %s. Por favor reconstruir." msgid "(chcleanup): Must be run inside of a chroot" msgstr "(chcleanup): Debe ser ejecutado dentro de un chroot" -#: src/chroot-tools/chcleanup:91 +#: src/chroot-tools/chcleanup:92 msgid "Cleaning chroot..." msgstr "Limpiando un chroot..." -#: src/chroot-tools/chcleanup:104 +#: src/chroot-tools/chcleanup:105 msgid "Creating a full list of packages..." msgstr "Creando una lista completa de paquetes..." -#: src/chroot-tools/chcleanup:108 -msgid "Could not create a full list of packages, exiting." -msgstr "No se pudo crear una lista completa de paquetes, saliendo." - -#: src/chroot-tools/chcleanup:117 +#: src/chroot-tools/chcleanup:119 msgid "No packages to remove" msgstr "No hay paquetes para remover" -#: src/chroot-tools/chcleanup:119 +#: src/chroot-tools/chcleanup:121 msgid "Removing %d packages" msgstr "Removiendo %d paquetes" -#: src/chroot-tools/chcleanup:132 +#: src/chroot-tools/chcleanup:134 msgid "No packages to add" msgstr "" -#: src/chroot-tools/chcleanup:134 +#: src/chroot-tools/chcleanup:136 msgid "Adding %d packages" msgstr "" diff --git a/src/chroot-tools/chcleanup.in b/src/chroot-tools/chcleanup.in index 317bf10..d114080 100644 --- a/src/chroot-tools/chcleanup.in +++ b/src/chroot-tools/chcleanup.in @@ -59,8 +59,9 @@ if [[ -f ./PKGBUILD ]]; then sudo -u "#$(stat -c %u -- ./PKGBUILD)" sh -c 'makepkg --printsrcinfo > .SRCINFO' fi CARCH="$(. /etc/makepkg.conf; printf '%s' "$CARCH")" - mapfile -t all_depends < <(sed -nE "s/^\\s+(|make|check)depends(|_${CARCH}) = //p" < .SRCINFO) - CHROOTEXTRAPKG+=("${all_depends[@]}") + mapfile -t DEPENDS < <(sed -nE "s/^\\s+(|make|check)depends(|_${CARCH}) = //p" < .SRCINFO) +else + DEPENDS=() fi msg "Cleaning chroot..." @@ -77,13 +78,14 @@ pkglist="${TEMPDIR}"/pkglist.txt # Get the full list of packages needed by dependencies, including the base system msg2 "Creating a full list of packages..." -pacman -b "${TEMPDIR}" \ - -Sp --print-format "%n" base-devel "${CHROOTEXTRAPKG[@]}" >"$pkglist" || { - ret=$? - error "Could not create a full list of packages, exiting." - plain "This is likely caused by a dependency that could not be found." - exit $ret -} +pacman --dbpath="$TEMPDIR" --hookdir=/var/empty -Sq --needed --dbonly --noconfirm -- base-devel >/dev/null +if (( ${#CHROOTEXTRAPKG[@]} > 0 )); then + pacman --dbpath="$TEMPDIR" --hookdir=/var/empty -Sq --needed --dbonly --noconfirm -- "${CHROOTEXTRAPKG[@]}" >/dev/null +fi +if (( ${#DEPENDS[@]} > 0 )); then + pacman --dbpath="$TEMPDIR" --hookdir=/var/empty -Sq --needed --dbonly --noconfirm -- "${DEPENDS[@]}" >/dev/null +fi +pacman --dbpath="$TEMPDIR" -Qq >"$pkglist" # Diff installed packages against a clean chroot then remove leftovers packages=($(comm -23 <(pacman -Qq | sort -u) \ |