GithubHelp home page GithubHelp logo

herzrasen / pkghist Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 0.0 125 KB

Query the local version history of packages

License: MIT License

Rust 96.27% Shell 3.73%
arch-linux archlinux pacman pkg pkgbuild rust rust-lang

pkghist's Introduction

herzrasen

The pitch

The pitch

pkghist's People

Contributors

dependabot[bot] avatar herzrasen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pkghist's Issues

Implement --after

A commandline option should be implemented to limit the regarded date range.

Panic when piping to less and ctrl-c'ing out

╰─➤ 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.

Implement downgrades

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.

More compact output format

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.

new date format

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.

--last does not respect multiple events on a package

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

Reinstallations not listed

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)

stream did not contain valid UTF-8

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.

Implement completions

Clap provides a mechanism to create bash, zsh and fish completions. This should be used to create completions and install them via AUR.

Remove deprecation warning

The compiler complaints about the use of Error.description(). It can be replaced by the use of the Display trait

versions limit of 0 outputs error

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.

Implement --first

A commandline option should be added to get the first n packages from the pacman log. This should be the opposite of --last

implement --exclude

An option --exclude should be implemented to allow filtering anything matching filters.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.