herzrasen / pkghist Goto Github PK
View Code? Open in Web Editor NEWQuery the local version history of packages
License: MIT License
Query the local version history of packages
License: MIT License
Clap provides a mechanism to create bash, zsh and fish completions. This should be used to create completions and install them via AUR.
Pacman 5.2 created log entries that contain the timezone offset.
[2019-10-25T09:51:21+0200] [ALPM] installed teams-for-linux (0.7.0-1)
pkghist's log parser does currently not support this.
The documentation should contain the command to install the resulting packages of pkghist
.
https://superuser.com/questions/1061612/how-do-you-make-a-list-file-for-pacman-to-install-from
sudo pacman -S $(pkghist --no-details --no-colors '^bash$')
Hi, as my Arch installation ages the pacman log is around 12MB and pkghist is a great tool for checking stuff. So I installed it from AUR but I'm getting a panic. Here's more info:
$ pacman -Q pkghist rust
pkghist 0.1.0-1
rust 1:1.37.0-2
$ file /var/log/pacman.log
/var/log/pacman.log: UTF-8 Unicode text, with very long lines, with escape sequences
$ pkghist --last 8
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: InvalidData, error: "stream did not contain valid UTF-8" }', src/libcore/result.rs:999:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
$ RUST_BACKTRACE=1 pkghist --last 8
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: InvalidData, error: "stream did not contain valid UTF-8" }', src/libcore/result.rs:999:5
stack backtrace:
0: <unknown>
1: <unknown>
2: <unknown>
3: <unknown>
4: <unknown>
5: <unknown>
6: <unknown>
7: <unknown>
8: <unknown>
9: <unknown>
10: <unknown>
11: <unknown>
12: <unknown>
13: <unknown>
14: <unknown>
15: __libc_start_main
16: <unknown>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
$ RUST_BACKTRACE=full pkghist --last 8
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: InvalidData, error: "stream did not contain valid UTF-8" }', src/libcore/result.rs:999:5
stack backtrace:
0: 0x55a4fde84b1b - <unknown>
1: 0x55a4fde847f7 - <unknown>
2: 0x55a4fde85230 - <unknown>
3: 0x55a4fde84db2 - <unknown>
4: 0x55a4fde84c96 - <unknown>
5: 0x55a4fde97ddd - <unknown>
6: 0x55a4fdd68fce - <unknown>
7: 0x55a4fdd6fbb2 - <unknown>
8: 0x55a4fdd83e0f - <unknown>
9: 0x55a4fdd71887 - <unknown>
10: 0x55a4fdd6c930 - <unknown>
11: 0x55a4fde84c33 - <unknown>
12: 0x55a4fde86dfa - <unknown>
13: 0x55a4fde8573d - <unknown>
14: 0x55a4fdd719b2 - <unknown>
15: 0x7f056ef17ee3 - __libc_start_main
16: 0x55a4fdd620ae - <unknown>
17: 0x0 - <unknown>
If there's any additional info I can provide, feel free to ask.
The compiler complaints about the use of Error.description(). It can be replaced by the use of the Display trait
It would be nice to see a more compact output format. Something that can display each version on a single line. A CSV format would probably satisfy this request, but also maybe something 'slim' like...
[linux]
2018-09-18 16:50:00 | 4.18.8.arch1-1 | Installed
2018-09-20 15:41:00 | 4.18.9.arch1-1 | Upgraded
2018-12-30 20:56:00 | 4.20.arch1-1 | Upgraded
...just to save some vertical space. Not sure of the value of padding the output to keep things aligned.
Anyways, just an idea/request.
A commandline option should be added to get the first n
packages from the pacman log. This should be the opposite of --last
An option --exclude
should be implemented to allow filtering anything matching filters
.
╰─➤ pkghist | less
thread 'main' panicked at 'failed printing to stdout: Broken pipe (os error 32)', src/libstd/io/stdio.rs:792:9
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace.
In order to search for packages using the positional filter argument, either wildcards or a regex based search should be implemented.
I was trying to get a list of uninstalled packages without any details and came across this bug. The output of pkghist --limit 0
is:
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
When querying using --last n
it is ignored when multiple events occurred on a single package.
For exampe i3-gaps has been installed and removed multiple times which is using to many "slots" in the result set.
[2019-08-25 20:52] [ALPM] installed yajl (2.1.0-2)
[2019-08-25 20:52] [ALPM] installed i3-gaps (4.17-1)
[2019-08-25 20:52] [ALPM] installed i3blocks (1.4-6)
[2019-08-25 20:52] [ALPM] installed i3lock (2.12-1)
[2019-08-25 20:52] [ALPM] installed confuse (3.2.2-1)
[2019-08-25 20:52] [ALPM] installed i3status (2.13-2)
[2019-08-25 20:52] [ALPM] transaction completed
[2019-08-25 20:52] [ALPM] running 'systemd-update.hook'...
[2019-08-25 20:52] [ALPM] running 'update-desktop-database.hook'...
[2019-08-25 21:32] [ALPM] transaction started
[2019-08-25 21:32] [ALPM] removed i3status (2.13-2)
[2019-08-25 21:32] [ALPM] removed i3lock (2.12-1)
[2019-08-25 21:32] [ALPM] removed i3blocks (1.4-6)
[2019-08-25 21:32] [ALPM] removed i3-gaps (4.17-1)
[2019-08-25 21:32] [ALPM] transaction completed
[2019-08-25 21:32] [ALPM] running 'systemd-update.hook'...
[2019-08-25 21:32] [ALPM] running 'update-desktop-database.hook'...
[2019-08-25 21:33] [ALPM] transaction started
[2019-08-25 21:33] [ALPM] upgraded libldap (2.4.47-3 -> 2.4.48-1)
[2019-08-25 21:33] [ALPM] upgraded llvm-libs (8.0.1-2 -> 8.0.1-3)
[2019-08-25 21:33] [ALPM] transaction completed
[2019-08-25 21:33] [ALPM] running 'systemd-update.hook'...
[2019-08-26 13:39] [ALPM] transaction started
[2019-08-26 13:39] [ALPM] reinstalled st (0.8.2-2)
[2019-08-26 13:39] [ALPM] transaction completed
[2019-08-26 13:39] [ALPM] running 'systemd-update.hook'...
[2019-08-26 14:13] [ALPM] transaction started
[2019-08-26 14:13] [ALPM] installed i3-gaps (4.17-1)
[2019-08-26 14:13] [ALPM] installed i3lock (2.12-1)
[2019-08-26 14:13] [ALPM] transaction completed
[2019-08-26 14:13] [ALPM] running 'systemd-update.hook'...
[2019-08-26 14:13] [ALPM] running 'update-desktop-database.hook'...
[2019-08-26 14:17] [ALPM] transaction started
[2019-08-26 14:17] [ALPM] installed herbstluftwm (0.7.2-1)
[2019-08-26 14:17] [ALPM] transaction completed
[2019-08-26 14:17] [ALPM] running 'systemd-update.hook'...
[2019-08-26 14:17] [ALPM] transaction started
[2019-08-26 14:17] [ALPM] installed dzen2 (0.9.5.14.488ab66-1)
[2019-08-26 14:17] [ALPM] transaction completed
[2019-08-26 14:17] [ALPM] running 'systemd-update.hook'...
[2019-08-26 14:29] [ALPM] transaction started
[2019-08-26 14:29] [ALPM] removed dzen2 (0.9.5.14.488ab66-1)
[2019-08-26 14:29] [ALPM] removed herbstluftwm (0.7.2-1)
╰─➤ pkghist --last 20 --limit 1
confuse
[2019-08-25 20:52:00] Installed
3.2.2-1
yajl
[2019-08-25 20:52:00] Installed
2.1.0-2
libldap
[2019-08-25 21:33:00] Upgraded
2.4.48-1
llvm-libs
[2019-08-25 21:33:00] Upgraded
8.0.1-3
i3-gaps
[2019-08-26 14:13:00] Installed
4.17-1
i3lock
[2019-08-26 14:13:00] Installed
2.12-1
An additional action that is logged is a downgrade:
[2018-12-15 00:22] [ALPM] downgraded mps-youtube (0.2.8-2 -> 0.2.8-1)
These actions should be respected as well.
A commandline option should be implemented to limit the regarded date range.
When querying a package that has been reinstalled, the reinstallation is not reported.
╰─➤ pkghist st
st
[2019-04-13 21:54:00] Installed
0.8.2-2
╰─➤ less /var/log/pacman.log | grep -w st | grep ALPM
[2019-04-13 21:54] [ALPM] installed st (0.8.2-2)
[2019-08-26 13:39] [ALPM] reinstalled st (0.8.2-2)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.