kewlfft / ansible-aur

Ansible module to manage packages from the AUR
GNU General Public License v3.0
299 stars 47 forks source link

Fix upgrade changed logic and language definition when using pikaur #56

Closed grcancelliere closed 3 years ago

grcancelliere commented 3 years ago

Every time I called the module to upgrade my system it would set the status as changed even if I upgraded the whole system with my AUR helper (I use pikaur). This was the raw command output:

# sudo -Hsn -u aur_user env LC_ALL=C pikaur -S --noconfirm --noedit --needed --aur -u           
:: Inizio un aggiornamento completo di AUR...
Sto leggendo i database dei pacchetti nel repository...
Sto leggendo il database locale dei pacchetti...
Sto leggendo le informazioni dei pacchetti AUR...    
:: Niente da fare.

In my shell I set LANGUAGE=it:en, so I think the module should also override LANGUAGE. One other thing was the capitalization of the last line, Nothing to do instead of nothing to do, so the check should be made against the output after lower capitalization.

grcancelliere commented 3 years ago

Sorry, I actually I set LANGUAGE in /etc/security/pam_env.conf, but yes, if I empty LANGUAGE on the command line it works:

# sudo -Hsn -u aur_user unset LANGUAGE && env LC_ALL=C pikaur -S --noconfirm --noedit --needed --aur -u
:: Starting full AUR upgrade...
Reading repository package databases...
Reading local package database...
Reading AUR packages info...
:: warning: Following packages cannot be found in AUR:
    eduke32-xdg-git    
    ioquake3-xdg-git    
    vkquake-xdg-git    
:: Nothing to do.

EDIT

One other difference is that Pacman works with just setting LC_ALL=C, while pikaur does not.