I would like to have an option for pamac CLI to send output from pamac upgrade to a text file while keep showing progress and prompts on screen. I want to examine the output to catch pacnew and other warnings after the upgrade has completed.
When I upgrade Manjaro, I log out and switch to a tty and run
pamac upgrade --no-confirm 2>&1 | tee $HOME/pamac_upgrade.log
Then I run
sed 's/[\r].*//' $HOME/pamac_upgrade.log | uniq > $HOME/pamac_upgrade.txt
to remove all the updating that shows progress for each package being downloaded and upgraded. The resulting text is far more legible than the raw output.
Using tee has the disadvantage that the output to screen is buffered, so sometimes it looks like the upgrade is stuck. Sometimes this is due to pamac waiting for my input, but the prompting is not shown on screen because of tee’s buffer.
Please make an option for pamac to create a log file, e.g. like
Line 2:
if test $# -gt 0 ; then pattern="$@"
^-- SC2124 (warning): Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.
Line 3:
else pattern="`date '+%y-%m-%d'`T"
^-- SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
Did you mean: (apply this, apply all SC2006)
else pattern="$(date '+%y-%m-%d')T"
Line 5:
grep $pattern /var/log/pacman.log |
^-- SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
grep "$pattern" /var/log/pacman.log |