cpt-extra

Extra utilities for cpt
git clone git://git.carbslinux.org/cpt-extra
Log | Files | Refs | README | LICENSE

cpt-orphans (574B)


      1 #!/bin/sh -e
      2 # List orphaned packages
      3 
      4 # Copyright (C) 2019-2020 - Dylan Araps.
      5 # Distributed under the terms of the MIT License.
      6 
      7 case "$1" in ''|--help|-h)
      8     printf '\033[1;33m-> \033[m%s\n' \
      9     "${0##*/}: lists packages that do not have any packages depending on them" >&2
     10     exit 0
     11 esac
     12 
     13 cd "$CPT_ROOT/var/db/cpt/installed/"
     14 
     15 for pkg in *; do
     16     case $pkg in
     17         baseinit|baselayout|gcc|pkgconf|e2fsprogs|musl|\
     18         make|busybox|bzip2|grub|cpt|git|linux-headers)
     19             continue
     20     esac
     21 
     22     grep -q "^$pkg$" ./*/depends || printf '%s\n' "$pkg"
     23 done