Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: dedup and sort oma rdepends output #213

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stdmnpkg
Copy link

oma rdepends will print an entry for every version of a package, cause many seemingly duplicated entries.

this PR mitigated above effect by dedup these entries.

before & after:

studentmain@MeowPC3E [ oma@rdepends-output-dedup ] $ oma rdepends kio-fuse
kio-fuse:
  Reverse dependencies:
    Depends: kio-fuse-dbg (kio-fuse = 5.0.1-2)
    Depends: xdg-desktop-portal-kde (kio-fuse >= 5.0.1-2)
    Depends: xdg-desktop-portal-kde (kio-fuse >= 5.0.1-2)
    Depends: xdg-desktop-portal-kde (kio-fuse >= 5.0.1-2)
    Depends: xdg-desktop-portal-kde (kio-fuse >= 5.0.1-2)
    Depends: xdg-desktop-portal-kde (kio-fuse >= 5.0.1-2)
    Depends: xdg-desktop-portal-kde (kio-fuse >= 5.0.1-2)
    Depends: xdg-desktop-portal-kde (kio-fuse >= 5.0.1-2)
    Depends: xdg-desktop-portal-kde (kio-fuse >= 5.0.1-2)
    Depends: xdg-desktop-portal-kde (kio-fuse >= 5.0.1-2)
    Depends: xdg-desktop-portal-kde (kio-fuse >= 5.0.1-2)
    Depends: xdg-desktop-portal-kde (kio-fuse >= 5.0.1-2)
    Depends: xdg-desktop-portal-kde (kio-fuse >= 5.0.1-2)
    Depends: xdg-desktop-portal-kde (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: xdg-desktop-portal-kde (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
studentmain@MeowPC3E [ oma@rdepends-output-dedup ] $ ./target/debug/oma rdepends kio-fuse
kio-fuse:
  Reverse dependencies:
    Depends: kio-fuse-dbg (kio-fuse = 5.0.1-2)
    Depends: plasma-workspace (kio-fuse >= 5.0.1-2)
    Depends: xdg-desktop-portal-kde (kio-fuse >= 5.0.1-2)
studentmain@MeowPC3E [ oma@rdepends-output-dedup ] $ 

alternative solution is show source package's version info, so it's no longer duplicate.

e.g.

pkg1:
  Reverse dependencies:
    Depends: pkg2 1.0 (pkg1 >= 1)
    Depends: pkg2 1.1 (pkg1 >= 1)

@eatradish
Copy link
Member

eatradish commented Nov 12, 2024

This modification is not correct, the duplication is due to different versions of this package being output and duplicated. oma depends/rdepends mimics the output of apt , and I don't have any ideas for improving it at the moment.

@stdmnpkg stdmnpkg marked this pull request as draft November 12, 2024 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants