Skip to content

xmyorphans: Script to list locally installed packages that are orphaned #339

@Anachron

Description

@Anachron

Script to either list all (-a|--all) packages locally installed that are orphaned or only those with pending updates (-o|--outdated).

#!/bin/sh

orphans=$(xbps-query -p maintainer -s orphan | sed 's/-[^-]*:.*//')

case "${1:---all}" in
  -a|--all) printf '%s\n' "${orphans}";;
  -o|--outdated)
    regex=$(printf '%s\n' "${orphans}" | tr '\n' '|' | sed 's;|$;;g')
    curl -s "https://repo-default.voidlinux.org/void-updates/void-updates_$(date +%Y-%m-%d).txt" \
     | grep -E "^(${regex}) ";;
esac

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions