1
0
mirror of https://codeberg.org/kiss-community/kiss synced 2024-12-23 07:30:16 -07:00
kiss/contrib/kiss-orphans

42 lines
718 B
Plaintext
Raw Normal View History

2019-10-30 04:51:48 -06:00
#!/bin/sh -e
2020-05-01 00:07:20 -06:00
# List orphaned packages
2019-10-30 04:51:48 -06:00
n='
'
cd "$KISS_ROOT/var/db/kiss/installed"
set -- *
l=$n$(
for pkg do shift
set -- "$@" -e "$pkg"
done
# Get a list of non-orphans.
grep -Fx "$@" -- */depends |
{
# Strip filename.
sed s,.\*/depends:,,
# Exclude packages which are not really orphans.
printf '%s\n' baseinit baselayout busybox bzip2 e2fsprogs gcc \
git grub kiss make musl
} |
# Remove duplicates.
sort -u
)$n
# Generate the list of orphans by finding the inverse of the non-orphan list.
for pkg do shift
case $l in (*"$n$pkg$n"*)
continue
esac
2019-10-30 04:51:48 -06:00
set -- "$@" "$pkg"
done
printf '%s\n' "$@"