FossaPup64 pkg uninstall stops working if too many packages are installed

Post here if you feel others can duplicate your so discovered "bug"

Moderator: Forum moderators

Post Reply
artemis
Posts: 44
Joined: Wed Mar 24, 2021 8:16 pm
Has thanked: 8 times
Been thanked: 5 times

FossaPup64 pkg uninstall stops working if too many packages are installed

Post by artemis »

I'm on fossapup64 and pkg says its verison 1.9.23

anyway in the uninstall function there is this, at line 5906 on my machine

Code: Select all

  # remove $PKGNAME from user-installed-packages
  NEWUSERPKGS="$(grep -v "^${PKGNAME}" ${REPO_DIR}/user-installed-packages)"
  [ "$NEWUSERPKGS" != "" ] && echo "$NEWUSERPKGS" > ${REPO_DIR}/user-installed-packages

this puts all of user-installed-packages into a variable. this is a problem because the script uses `set -a` (at line 310 on my machine). this makes it so all variables are automatically exported. when NEWUSERPKGS gets too big, it can make the exported environment variables exceed the linux kernel argument size limit, which is calculated as size of arguments + size of environment variables. then no other commands can run from the script so it breaks.

i fixed this on my computer by changing it to this

Code: Select all

  # remove $PKGNAME from user-installed-packages
  NEWUSERPKGS="$(grep -v "^${PKGNAME}" ${REPO_DIR}/user-installed-packages)"
  export -n NEWUSERPKGS
  [ "$NEWUSERPKGS" != "" ] && echo "$NEWUSERPKGS" > ${REPO_DIR}/user-installed-packages

the `export -n` removes NEWUSERPKGS from the exports list. but maybe there is a better way.

Post Reply

Return to “Bug Reports”