pikaur icon indicating copy to clipboard operation
pikaur copied to clipboard

`pikaur -Scc`: clean-up directories set in `SRCDEST` and `BUILDDIR` variables

Open morganmay opened this issue 1 year ago • 1 comments

pikaur -Vq
Pikaur v1.18.3
Pacman v6.0.2 - libalpm v13.0.2 - pyalpm v0.10.6
Description:

Expected behavior: Setting SRCDEST and BUILDDIR variables in /etc/makepkg.conf overrides the default source and build directories; pikaur -Scc cleans the source and build directories.

Actual behavior: pikaur -Scc cleans the default source and build directories, but ignores the directories set in the SRCDEST and BUILDDIR variables. (This bug probably would also affect PKGDEST as well, but that was unset in this case.)

Steps to reproduce:

  1. Set SRCDEST and BUILDDIR variables in /etc/makepkg.conf (in this case, to /opt/sources and /opt/makepkg).
  2. Build and install packages with pikaur; files are left in the directories set in SRCDEST and BUILDDIR.
  3. Run pikaur -Scc and answer "y" to the relevant prompts.
  4. Contents of the directories set in SRCDEST and BUILDDIR are untouched when they should be deleted.
Attached log:
:: debug: main_1000: Setting stdout to utf-8...
:: debug: main_1000: already set - nothing to do
:: debug: main_1000: Setting stderr to utf-8...
:: debug: main_1000: already set - nothing to do
:: debug: main_1000: Pikaur operation found for args ['/usr/bin/pikaur', '-Scc', '--verbose', '--pikaur-debug']: cli_clean_packages_cache
=> sudo --preserve-env=EDITOR -- /usr/bin/pikaur -Scc --verbose --pikaur-debug --pikaur-config=/home/user/.config/pikaur.conf --user-id=1000 --home-dir=/home/user --xdg-cache-home=/home/user/.cache --xdg-config-home=/home/user/.config --xdg-data-home=/home/user/.local/share
:: debug: main_0: Setting stdout to utf-8...
:: debug: main_0: already set - nothing to do
:: debug: main_0: Setting stderr to utf-8...
:: debug: main_0: already set - nothing to do
:: debug: main_0: Pikaur operation found for args ['/usr/bin/pikaur', '-Scc', '--verbose', '--pikaur-debug', '--pikaur-config=/home/user/.config/pikaur.conf', '--user-id=1000', '--home-dir=/home/user', '--xdg-cache-home=/home/user/.cache', '--xdg-config-home=/home/user/.config', '--xdg-data-home=/home/user/.local/share']: cli_clean_packages_cache
=> pacman --sync --verbose --clean --clean
:: Do you want to remove ALL files from cache? [y/N] :: Do you want to remove unused repositories? [Y/n] :: debug: main_0: Restoring stdout...
:: debug: main_0: nothing to do
:: debug: main_0: Restoring stderr...
:: debug: main_0: nothing to do
:: debug: main_1000: Restoring stdout...
:: debug: main_1000: nothing to do
:: debug: main_1000: Restoring stderr...
:: debug: main_1000: nothing to do

morganmay avatar Oct 19 '23 23:10 morganmay

it's not meant to handle those, only https://github.com/actionless/pikaur#file-locations

feel free to add a new --key for cleaning those dirs as well

actionless avatar Oct 24 '23 21:10 actionless